Migrates suproject configurations to using a script plugin.
Updates dependencies.
Forces generatedFilesBaseDir under java-tests/vanilla project to avoid duplicated input to Java/Kotlin compiler.
More on generatedFilesBaseDir fix
The problem is that generated-proto/test directory, if not deleted, is taken as a compilation input, while generated/test directory (produced by ProtoData) is available too. Removing the generated-proto/test directory in the build script resulted in the following error:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':java-tests:vanilla:compileTestKotlin'.
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
...
Caused by: java.lang.IllegalStateException: Changes are not tracked, unable determine incremental changes.
at org.gradle.internal.execution.steps.ResolveInputChangesStep.lambda$determineInputChanges$0(ResolveInputChangesStep.java:116)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.determineInputChanges(ResolveInputChangesStep.java:116)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:47)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:36)
at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:181)
at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$1(BuildCacheStep.java:71)
...
This error was caused by the build.gradle.kts code which did this:
/**
* Workaround related to https://github.com/SpineEventEngine/validation/issues/69 to ease
* the issue with IDEA not being able to locate Kotlin DSL.
*/
val launchTestProtoData: Task by tasks.getting {
doLast {
delete("$buildDir/generated-proto/test")
}
This did not result in build failure under macOS M1 Pro. It occurs only during the GitHub builds.
If generated-proto/test was not deleted, vanilla-Protobuf code was coming first, and our custom generated code was not visible in the test, which resulted in the compile time error. Hence the reference to the issue #69 in the comments of the removal arrangement.
So, manually setting generatedFilesBaseDir to $projectDir/generated avoids the “duplication” of sources, and also does not require the removal. Thus avoiding the racing error on CI builds.
This PR:
generatedFilesBaseDir
underjava-tests/vanilla
project to avoid duplicated input to Java/Kotlin compiler.More on
generatedFilesBaseDir
fixThe problem is that
generated-proto/test
directory, if not deleted, is taken as a compilation input, whilegenerated/test
directory (produced by ProtoData) is available too. Removing thegenerated-proto/test
directory in the build script resulted in the following error:This error was caused by the
build.gradle.kts
code which did this:This did not result in build failure under macOS M1 Pro. It occurs only during the GitHub builds.
If
generated-proto/test
was not deleted, vanilla-Protobuf code was coming first, and our custom generated code was not visible in the test, which resulted in the compile time error. Hence the reference to the issue #69 in the comments of the removal arrangement.So, manually setting
generatedFilesBaseDir
to$projectDir/generated
avoids the “duplication” of sources, and also does not require the removal. Thus avoiding the racing error on CI builds.In order to resolve the issue for good, we need to migrate to Protobuf Gradle Plugin v0.9.2 and use task inputs and outputs gracefully.