From 6df3da6caba132c08250591e3f4e166c601ad856 Mon Sep 17 00:00:00 2001 From: Ned Loynd <41816363+NeRdTheNed@users.noreply.github.com> Date: Wed, 14 Oct 2020 17:06:45 +1100 Subject: [PATCH 1/3] Ignore commonly generated Mac OS junk files This is optional, but it would be a huge quality of life improvement for anyone developing on Mac OS, as the first thing I do when starting a new project is always to add this to the .gitignore. Example: Just from the small changes I've made to the build script alone, I've generated 4 .DS_Store files, which would clutter up this PR if I included them. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 550b373..09cd281 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,10 @@ bin/ .classpath .project +# macos + +*.DS_Store + # fabric run/ -- 2.39.2 From 5206a8b3851e054d7c05fee47084cd0a975a60fd Mon Sep 17 00:00:00 2001 From: Ned Loynd <41816363+NeRdTheNed@users.noreply.github.com> Date: Wed, 14 Oct 2020 17:07:01 +1100 Subject: [PATCH 2/3] Simply processResources logic & make it compatible with future versions of Gradle When the processResources task is currently run, it uses deprecated Gradle features. Running "gradle clean build --warning-mode all" should output a message along the lines of "Copying or archiving duplicate paths with the default duplicates strategy has been deprecated. This is scheduled to be removed in Gradle 7.0.". This is due to inlcuding all files twice, as the "from" blocks includes them for the second time (gradle includes these files by default). This PR simply edits the relevant files from the already selected resources directory. This also reduces the amount of repetition in the script. --- build.gradle | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index fc34cb8..6234cd0 100644 --- a/build.gradle +++ b/build.gradle @@ -26,14 +26,9 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" + filesMatching('fabric.mod.json') { expand "version": project.version } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } } // ensure that the encoding is set to UTF-8, no matter what the system default is -- 2.39.2 From 8088fdf8342879c16c32ac7cd733489086915f19 Mon Sep 17 00:00:00 2001 From: Ned Loynd <41816363+NeRdTheNed@users.noreply.github.com> Date: Wed, 14 Oct 2020 17:35:41 +1100 Subject: [PATCH 3/3] Switch to double quotes to match style D'oh! --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6234cd0..220d900 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ dependencies { processResources { inputs.property "version", project.version - filesMatching('fabric.mod.json') { + filesMatching("fabric.mod.json") { expand "version": project.version } } -- 2.39.2