diff --git a/.gitattributes b/.gitattributes index 36452a5b0..a53a54228 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,38 +1,2 @@ -# Handle line endings automatically for files detected as text -# and leave all files detected as binary untouched. -* text=auto - -*.patch text eol=lf - -# -# The above will handle all files NOT found below -# -# These files are text and should be normalized (Convert crlf => lf) -*.css text -*.df text -*.htm text -*.html text -*.java text -*.js text -*.json text -*.jsp text -*.jspf text -*.properties text -*.sh text -*.tld text -*.txt text -*.xml text - -# These files are binary and should be left untouched -# (binary is a macro for -text -diff) -*.class binary -*.dll binary -*.ear binary -*.gif binary -*.ico binary -*.jar binary -*.jpg binary -*.jpeg binary -*.png binary -*.so binary -*.war binary +* text eol=lf +*.bat text eol=crlf \ No newline at end of file diff --git a/build.gradle b/build.gradle index 54a7c7d35..d7cf37194 100644 --- a/build.gradle +++ b/build.gradle @@ -215,6 +215,8 @@ java { } spotless { + lineEndings = com.diffplug.spotless.LineEnding.UNIX + java { licenseHeaderFile(rootProject.file("HEADER")).yearSeparator("-") targetExclude("**/loom/util/DownloadUtil.java") diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy index d8e6a1ee5..0b199268e 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy @@ -51,18 +51,12 @@ class ReproducibleBuildTest extends Specification implements GradleProjectTestTr then: result.task(":build").outcome == SUCCESS generateMD5(gradle.getOutputFile("fabric-example-mod-1.0.0.jar")) == modHash - generateMD5(gradle.getOutputFile("fabric-example-mod-1.0.0-sources.jar")) in sourceHash // Done for different line endings. + generateMD5(gradle.getOutputFile("fabric-example-mod-1.0.0-sources.jar")) == sourceHash where: version | modHash | sourceHash - DEFAULT_GRADLE | "4bb8acb5e575a4080a8fe1282f8e1994" | [ - "8e8fac2a5e32fc872e6cf0f9ccc55cfd", - "ed331b6fae5677797a0104eba014e255" - ] - PRE_RELEASE_GRADLE | "4bb8acb5e575a4080a8fe1282f8e1994" | [ - "8e8fac2a5e32fc872e6cf0f9ccc55cfd", - "ed331b6fae5677797a0104eba014e255" - ] + DEFAULT_GRADLE | "4bb8acb5e575a4080a8fe1282f8e1994" | "8e8fac2a5e32fc872e6cf0f9ccc55cfd" + PRE_RELEASE_GRADLE | "4bb8acb5e575a4080a8fe1282f8e1994" | "8e8fac2a5e32fc872e6cf0f9ccc55cfd" } String generateMD5(File file) {