From 23fc64ce9154a067ba3815d3a77227857af246c5 Mon Sep 17 00:00:00 2001 From: Kenneth VanderLinde Date: Wed, 15 Nov 2023 10:57:41 -0800 Subject: [PATCH] Replace configSentryRelease task with processResources configuration This avoids dirtying the `src/` directory with build artifacts, thus introducing unexpected dependencies between tasks. The `:run` task naturally no longer depends on `:spotlessCheck` in any way. The `src/main/resources/sentry.properties` file is no longer ignored by git as it should not be generated by the build anymore. If the file is present in a dev tree, it should be deleted. --- .gitignore | 1 - build.gradle | 30 +++++++++++++----------------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 0221d0efc1..5e9a3e3957 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ out/ # Automatically Generated ################################################################################ package/windows/MapTool.iss -src/main/resources/sentry.properties # IDEs diff --git a/build.gradle b/build.gradle index adc027944f..53427ed2ef 100644 --- a/build.gradle +++ b/build.gradle @@ -514,18 +514,18 @@ dependencies { implementation 'com.github.RPTools:advanced-dice-roller:1.0.3' } - -task configSentryRelease(type: Copy) { - from("build-resources/sentry.properties.template") - into("src/main/resources/") - rename("sentry.properties.template", "sentry.properties") - def tokens = [ - AppVersion : "${tagVersion}", - Environment: "${environment}", - SentryDSN : "${sentryDSN}" - ] - expand(tokens) - inputs.properties(tokens) +processResources { + with copySpec { + from("build-resources/sentry.properties.template") + rename("sentry.properties.template", "sentry.properties") + def tokens = [ + AppVersion : "${tagVersion}", + Environment: "${environment}", + SentryDSN : "${sentryDSN}" + ] + expand(tokens) + inputs.properties(tokens) + } } shadowJar { @@ -598,8 +598,4 @@ test { task createWrapper(type: Wrapper) { gradleVersion = '8.2.1' -} - -// Configure current release tag in Sentry.io properties -processResources.dependsOn configSentryRelease -configSentryRelease.dependsOn 'spotlessCheck' \ No newline at end of file +} \ No newline at end of file