diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c023..62d4c05355 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradlew b/gradlew index 4f906e0c81..fbd7c51583 100755 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 107acd32c4..5093609d51 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if "%ERRORLEVEL%" == "0" goto init echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto execute +if exist "%JAVA_EXE%" goto init echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,6 +64,21 @@ echo location of your Java installation. goto fail +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + :execute @rem Setup the command line @@ -71,7 +86,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% :end @rem End local scope for the variables with windows NT shell diff --git a/license-report.md b/license-report.md index 34ad1aa14c..e63c901aee 100644 --- a/license-report.md +++ b/license-report.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine:spine-base:1.5.29` +# Dependencies of `io.spine:spine-base:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -329,12 +329,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:23 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:07 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-errorprone-checks:1.5.29` +# Dependencies of `io.spine.tools:spine-errorprone-checks:1.5.30` ## Runtime 1. **Group:** com.github.ben-manes.caffeine **Name:** caffeine **Version:** 2.7.0 @@ -785,12 +785,12 @@ This report was generated on **Thu Aug 27 15:35:23 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:24 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:07 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-javadoc-filter:1.5.29` +# Dependencies of `io.spine.tools:spine-javadoc-filter:1.5.30` ## Runtime 1. **Group:** com.google.android **Name:** annotations **Version:** 4.1.1.4 @@ -1169,12 +1169,12 @@ This report was generated on **Thu Aug 27 15:35:24 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:24 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:08 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-javadoc-prettifier:1.5.29` +# Dependencies of `io.spine.tools:spine-javadoc-prettifier:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -1545,12 +1545,12 @@ This report was generated on **Thu Aug 27 15:35:24 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:25 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:08 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-model-compiler:1.5.29` +# Dependencies of `io.spine.tools:spine-model-compiler:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -1937,12 +1937,12 @@ This report was generated on **Thu Aug 27 15:35:25 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:25 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:08 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mute-logging:1.5.29` +# Dependencies of `io.spine.tools:spine-mute-logging:1.5.30` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -2317,12 +2317,12 @@ This report was generated on **Thu Aug 27 15:35:25 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:25 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:09 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-base:1.5.29` +# Dependencies of `io.spine.tools:spine-plugin-base:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -2693,12 +2693,12 @@ This report was generated on **Thu Aug 27 15:35:25 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:26 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:09 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-plugin-testlib:1.5.29` +# Dependencies of `io.spine.tools:spine-plugin-testlib:1.5.30` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -3123,12 +3123,12 @@ This report was generated on **Thu Aug 27 15:35:26 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:26 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:09 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-proto-dart-plugin:1.5.29` +# Dependencies of `io.spine.tools:spine-proto-dart-plugin:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -3499,12 +3499,12 @@ This report was generated on **Thu Aug 27 15:35:26 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:09 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-proto-js-plugin:1.5.29` +# Dependencies of `io.spine.tools:spine-proto-js-plugin:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -3875,12 +3875,12 @@ This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:10 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-protoc-api:1.5.29` +# Dependencies of `io.spine.tools:spine-protoc-api:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -4201,12 +4201,12 @@ This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:10 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-protoc-plugin:1.5.29` +# Dependencies of `io.spine.tools:spine-protoc-plugin:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -4545,12 +4545,12 @@ This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:10 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine:spine-testlib:1.5.29` +# Dependencies of `io.spine:spine-testlib:1.5.30` ## Runtime 1. **Group:** com.google.auto.value **Name:** auto-value-annotations **Version:** 1.6.3 @@ -4925,12 +4925,12 @@ This report was generated on **Thu Aug 27 15:35:27 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:28 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-tool-base:1.5.29` +# Dependencies of `io.spine.tools:spine-tool-base:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -5269,12 +5269,12 @@ This report was generated on **Thu Aug 27 15:35:28 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:28 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Sep 01 12:45:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-validation-generator:1.5.29` +# Dependencies of `io.spine.tools:spine-validation-generator:1.5.30` ## Runtime 1. **Group:** com.google.code.findbugs **Name:** jsr305 **Version:** 3.0.2 @@ -5613,4 +5613,4 @@ This report was generated on **Thu Aug 27 15:35:28 EEST 2020** using [Gradle-Lic The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Aug 27 15:35:28 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Tue Sep 01 12:45:11 EEST 2020** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index ac16a5438d..2899ca97bb 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-base -1.5.29 +1.5.30 2015 @@ -154,7 +154,7 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-protoc-plugin - 1.5.29 + 1.5.30 test diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/DescriptorSetMergerPlugin.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/DescriptorSetMergerPlugin.java index 4cb5713de4..224f42ffea 100644 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/DescriptorSetMergerPlugin.java +++ b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/DescriptorSetMergerPlugin.java @@ -35,6 +35,8 @@ import static io.spine.tools.gradle.ConfigurationName.runtimeClasspath; import static io.spine.tools.gradle.ConfigurationName.testRuntimeClasspath; +import static io.spine.tools.gradle.JavaTaskName.processResources; +import static io.spine.tools.gradle.JavaTaskName.processTestResources; import static io.spine.tools.gradle.ModelCompilerTaskName.mergeDescriptorSet; import static io.spine.tools.gradle.ModelCompilerTaskName.mergeTestDescriptorSet; import static io.spine.tools.gradle.ProtobufTaskName.generateProto; @@ -62,6 +64,7 @@ private void createTask(Project project, boolean tests) { Buildable dependencies = configuration.getAllDependencies(); GradleTask task = newTask(taskName(tests), createMergingAction(tests)) .insertAfterTask(generateProtoTaskName(tests)) + .insertBeforeTask(processResourcesTaskName(tests)) .applyNowTo(project); task.getTask().dependsOn(dependencies); } @@ -104,6 +107,12 @@ private static TaskName generateProtoTaskName(boolean tests) { : generateProto; } + private static TaskName processResourcesTaskName(boolean tests) { + return tests + ? processTestResources + : processResources; + } + private static File descriptorSet(Project project, boolean tests) { File descriptor = tests ? getTestDescriptorSet(project) diff --git a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java index 7479ae69aa..b4b81dcff8 100644 --- a/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java +++ b/tools/model-compiler/src/main/java/io/spine/tools/gradle/compiler/JavaProtocConfigurationPlugin.java @@ -43,6 +43,7 @@ import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Base64; @@ -54,14 +55,16 @@ import static io.spine.code.fs.java.DefaultJavaProject.at; import static io.spine.tools.gradle.BaseTaskName.clean; import static io.spine.tools.gradle.ConfigurationName.fetch; +import static io.spine.tools.gradle.JavaTaskName.processResources; +import static io.spine.tools.gradle.JavaTaskName.processTestResources; import static io.spine.tools.gradle.ModelCompilerTaskName.writeDescriptorReference; import static io.spine.tools.gradle.ModelCompilerTaskName.writePluginConfiguration; import static io.spine.tools.gradle.ModelCompilerTaskName.writeTestDescriptorReference; import static io.spine.tools.gradle.ModelCompilerTaskName.writeTestPluginConfiguration; import static io.spine.tools.gradle.ProtocPluginName.grpc; import static io.spine.tools.gradle.ProtocPluginName.spineProtoc; +import static io.spine.tools.gradle.compiler.ProtocPluginConfiguration.forProject; import static io.spine.util.Exceptions.illegalStateWithCauseOf; -import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.file.Files.createTempFile; import static java.util.regex.Matcher.quoteReplacement; import static org.gradle.internal.os.OperatingSystem.current; @@ -136,7 +139,7 @@ private static Path writeLaunchScript(Path jarFile) throws IOException { String script = matcher.replaceAll(quoteReplacement(jarFile.toString())); Path path = createTempFile(JavaProtocConfigurationPlugin.class.getSimpleName(), scriptExt); File file = path.toFile(); - CharSink sink = asCharSink(file, UTF_8); + CharSink sink = asCharSink(file, StandardCharsets.UTF_8); sink.write(script); boolean canBeExecuted = file.setExecutable(true, false); checkState(canBeExecuted, "Failed to make file `%s` executable.", file); @@ -164,9 +167,7 @@ protected void customizeTask(GenerateProtoTask protocTask) { private void customizeDescriptorSetGeneration(GenerateProtoTask protocTask) { boolean tests = isTestsTask(protocTask); Project project = protocTask.getProject(); - TaskName writeRefName = tests - ? writeTestDescriptorReference - : writeDescriptorReference; + TaskName writeRefName = writeRefNameTask(tests); JavaPluginConvention javaConvention = project.getConvention() .getPlugin(JavaPluginConvention.class); SourceScope sourceScope = tests ? SourceScope.test : SourceScope.main; @@ -177,14 +178,26 @@ private void customizeDescriptorSetGeneration(GenerateProtoTask protocTask) { .getByName(sourceScope.name()) .getResources() .srcDir(resourceDirectory); - GradleTask writeRef = newTask(writeRefName, task -> { - DescriptorReference reference = DescriptorReference.toOneFile(descriptorFile); - reference.writeTo(resourceDirectory); - }).allowNoDependencies() - .applyNowTo(project); + GradleTask writeRef = newTask(writeRefName, + task -> writeRefFile(descriptorFile, resourceDirectory)) + .insertBeforeTask(processResourceTaskName(tests)) + .applyNowTo(project); protocTask.finalizedBy(writeRef.getTask()); } + private static void writeRefFile(File descriptorFile, Path resourceDirectory) { + DescriptorReference reference = DescriptorReference.toOneFile(descriptorFile); + reference.writeTo(resourceDirectory); + } + + private static TaskName writeRefNameTask(boolean tests) { + return tests ? writeTestDescriptorReference : writeDescriptorReference; + } + + private static TaskName processResourceTaskName(boolean tests) { + return tests ? processTestResources : processResources; + } + @Override protected File getTestDescriptorSet(Project project) { return Extension.getTestDescriptorSet(project); @@ -207,14 +220,17 @@ protected File getMainDescriptorSet(Project project) { * {@code clean} task. */ private Task newWriteSpineProtocConfigTask(GenerateProtoTask protocTask, Path configPath) { - return newTask(spineProtocConfigWriteTaskName(protocTask), task -> { - ProtocPluginConfiguration configuration = ProtocPluginConfiguration - .forProject(protocTask.getProject()); - configuration.writeTo(configPath); - }).allowNoDependencies() - .applyNowTo(protocTask.getProject()) - .getTask() - .mustRunAfter(clean.name()); + return newTask(spineProtocConfigWriteTaskName(protocTask), + task -> writePluginConfig(protocTask, configPath)) + .allowNoDependencies() + .applyNowTo(protocTask.getProject()) + .getTask() + .mustRunAfter(clean.name()); + } + + private static void writePluginConfig(Task protocTask, Path configPath) { + ProtocPluginConfiguration configuration = forProject(protocTask.getProject()); + configuration.writeTo(configPath); } private static String base64Encoded(String value) { diff --git a/version.gradle.kts b/version.gradle.kts index 59670acc41..b478eed4f8 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -34,7 +34,7 @@ /** * The version of this library. */ -val base = "1.5.29" +val base = "1.5.30" project.extra.apply {