Simply processResources logic & make it compatible with future versions of Gradle #69

Merged
NeRdTheNed merged 3 commits from master into master 2020-10-14 10:23:07 +00:00
NeRdTheNed commented 2020-10-14 06:18:51 +00:00 (Migrated from github.com)

When the processResources task is currently run, it uses deprecated Gradle features. Running "gradle clean build --warning-mode all" on this example project 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 the build script currently including all files twice. Gradle includes the resources directory by default, and the build script includes it again with the "from" block. This PR simply uses "filesMatching" to instead select the relevant files from the already included resources directory, leaving all other resources unmodified but still included in the output of the task. This also reduces the amount of repetition in the script, and helps with reducing human error (e.g. changing only one "from" block to the new desired behaviour).

This PR also includes an edit to the .gitignore to ignore commonly generated Mac OS junk files. This is optional, but 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.

When the processResources task is currently run, it uses deprecated Gradle features. Running "gradle clean build --warning-mode all" on this example project 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 the build script currently including all files twice. Gradle includes the resources directory by default, and the build script includes it again with the "from" block. This PR simply uses "filesMatching" to instead select the relevant files from the already included resources directory, leaving all other resources unmodified but still included in the output of the task. This also reduces the amount of repetition in the script, and helps with reducing human error (e.g. changing only one "from" block to the new desired behaviour). This PR also includes an edit to the .gitignore to ignore commonly generated Mac OS junk files. This is optional, but 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.
modmuss50 (Migrated from github.com) approved these changes 2020-10-14 10:04:41 +00:00
modmuss50 (Migrated from github.com) left a comment

Looks good, I will test before merging when I get a chance

Looks good, I will test before merging when I get a chance
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Steven/fabric-example-mod#69
No description provided.