Clone the samples-kotlin project
git clone https://github.com/corda/samples-kotlin.git
Go to the negotiation cordapp
cd samples-kotlin/Advanced/negotiation-cordapp/
Remove gradle build cache
rm -rf ~/.gradle/caches/build-cache-1
Clean the output directory
./gradlew clean
Now compile the workflows-kotlin module using the gradle build cache:
./gradlew :workflows-kotlin:compileKotlin --build-cache --info
That's part of the output
Task :contracts-kotlin:compileKotlin
Build cache key for task ':contracts-kotlin:compileKotlin' is a28ea2174b89889611f6e999ebf92bd8
Task ':contracts-kotlin:compileKotlin' is not up-to-date because:
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/kotlin/main has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/kotlin/main/META-INF has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/kotlin/main/META-INF/contracts-kotlin.kotlin_module has been removed.
All input files are considered out-of-date for incremental task ':contracts-kotlin:compileKotlin'.
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/src/main/java', not found
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/src/main/java', not found
Packing task ':contracts-kotlin:compileKotlin'
:contracts-kotlin:compileKotlin (Thread[Execution worker for ':',5,main]) completed. Took 4.547 secs.
:contracts-kotlin:compileJava (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:compileJava NO-SOURCE
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/src/main/java', not found
Skipping task ':contracts-kotlin:compileJava' as it has no source files and no previous output files.
:contracts-kotlin:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.002 secs.
:contracts-kotlin:processResources (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:processResources NO-SOURCE
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/src/main/resources', not found
Skipping task ':contracts-kotlin:processResources' as it has no source files and no previous output files.
:contracts-kotlin:processResources (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:contracts-kotlin:classes (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:classes UP-TO-DATE
Skipping task ':contracts-kotlin:classes' as it has no actions.
:contracts-kotlin:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:contracts-kotlin:configureCordappFatJar (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:configureCordappFatJar
Custom actions are attached to task ':contracts-kotlin:configureCordappFatJar'.
Caching disabled for task ':contracts-kotlin:configureCordappFatJar' because:
Caching has not been enabled for the task
Task ':contracts-kotlin:configureCordappFatJar' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Finding direct non-corda dependencies for inclusion in CorDapp JAR
:contracts-kotlin:configureCordappFatJar (Thread[Execution worker for ':',5,main]) completed. Took 0.029 secs.
:contracts-kotlin:inspectClassesForKotlinIC (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:inspectClassesForKotlinIC
Caching disabled for task ':contracts-kotlin:inspectClassesForKotlinIC' because:
Caching has not been enabled for the task
Task ':contracts-kotlin:inspectClassesForKotlinIC' is not up-to-date because:
Output property 'classesListFile$kotlin_gradle_plugin' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/kotlin/contractskotlin02jar-classes.txt has been removed.
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/java/main', not found
:contracts-kotlin:inspectClassesForKotlinIC (Thread[Execution worker for ':',5,main]) completed. Took 0.007 secs.
:contracts-kotlin:jar (Thread[Execution worker for ':',5,main]) started.
[ant:signjar] jar signed.
[ant:signjar]
[ant:signjar] Warning:
[ant:signjar] The signer's certificate is self-signed.
[ant:signjar] Enter Passphrase for keystore: Enter key password for cordacodesign:
Task :contracts-kotlin:jar
Custom actions are attached to task ':contracts-kotlin:jar'.
Caching disabled for task ':contracts-kotlin:jar' because:
Caching has not been enabled for the task
Task ':contracts-kotlin:jar' is not up-to-date because:
Output property 'archiveFile' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar has been removed.
CorDapp JAR signing with the default Corda development key, suitable for Corda running in development mode only.
Jar signing with following options: {alias=cordacodesign, storepass=cordacadevpass, keystore=/tmp/cordadevcakeys3771095016112066472jks, storetype=JKS, keypass=cordacadevkeypass, jar=/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar}
[ant:signjar] Signing JAR: /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar to /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar as cordacodesign
:contracts-kotlin:jar (Thread[Execution worker for ':',5,main]) completed. Took 1.522 secs.
:workflows-kotlin:compileKotlin (Thread[Execution worker for ':',5,main]) started.
Task :workflows-kotlin:compileKotlin
Build cache key for task ':workflows-kotlin:compileKotlin' is 63f7d28e8a5e95419ee5890a84f912fd
Task ':workflows-kotlin:compileKotlin' is not up-to-date because:
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/build/classes/kotlin/main has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/build/classes/kotlin/main/META-INF has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/build/classes/kotlin/main/META-INF/workflows-kotlin.kotlin_module has been removed.
All input files are considered out-of-date for incremental task ':workflows-kotlin:compileKotlin'.
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/src/main/java', not found
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/src/main/java', not found
Packing task ':workflows-kotlin:compileKotlin'
:workflows-kotlin:compileKotlin (Thread[Execution worker for ':',5,main]) completed. Took 1.306 secs.
Both tasks :contracts-kotlin:compileKotlin and :workflows-kotlin:compileKotlin are executed as expected as the cache is empty.
Clean the output directory one more time
./gradlew clean
Now compile the workflows-kotlin module using the gradle build cache:
./gradlew :workflows-kotlin:compileKotlin --build-cache --info
That's part of the output
Task :contracts-kotlin:compileKotlin FROM-CACHE
Build cache key for task ':contracts-kotlin:compileKotlin' is a28ea2174b89889611f6e999ebf92bd8
Task ':contracts-kotlin:compileKotlin' is not up-to-date because:
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/kotlin/main has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/kotlin/main/META-INF has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/kotlin/main/META-INF/contracts-kotlin.kotlin_module has been removed.
Origin for org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution@40bdaad4: {executionTime=4520, hostName=mrpoopybutthole, operatingSystem=Linux, buildInvocationId=7z7ip7sm3vblnp4xqzdd24g2me, creationTime=1601893169735, identity=:contracts-kotlin:compileKotlin, type=org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.TaskExecution, userName=diegomrsantos, gradleVersion=5.4.1, rootPath=/workspace/samples-kotlin/Advanced/negotiation-cordapp}
Unpacked trees for task ':contracts-kotlin:compileKotlin' from cache.
:contracts-kotlin:compileKotlin (Thread[Execution worker for ':',5,main]) completed. Took 0.057 secs.
:contracts-kotlin:compileJava (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:compileJava NO-SOURCE
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/src/main/java', not found
Skipping task ':contracts-kotlin:compileJava' as it has no source files and no previous output files.
:contracts-kotlin:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.001 secs.
:contracts-kotlin:processResources (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:processResources NO-SOURCE
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/src/main/resources', not found
Skipping task ':contracts-kotlin:processResources' as it has no source files and no previous output files.
:contracts-kotlin:processResources (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:contracts-kotlin:classes (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:classes UP-TO-DATE
Skipping task ':contracts-kotlin:classes' as it has no actions.
:contracts-kotlin:classes (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:contracts-kotlin:configureCordappFatJar (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:configureCordappFatJar
Custom actions are attached to task ':contracts-kotlin:configureCordappFatJar'.
Caching disabled for task ':contracts-kotlin:configureCordappFatJar' because:
Caching has not been enabled for the task
Task ':contracts-kotlin:configureCordappFatJar' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Finding direct non-corda dependencies for inclusion in CorDapp JAR
:contracts-kotlin:configureCordappFatJar (Thread[Execution worker for ':',5,main]) completed. Took 0.02 secs.
:contracts-kotlin:inspectClassesForKotlinIC (Thread[Execution worker for ':',5,main]) started.
Task :contracts-kotlin:inspectClassesForKotlinIC
Caching disabled for task ':contracts-kotlin:inspectClassesForKotlinIC' because:
Caching has not been enabled for the task
Task ':contracts-kotlin:inspectClassesForKotlinIC' is not up-to-date because:
Output property 'classesListFile$kotlin_gradle_plugin' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/kotlin/contractskotlin02jar-classes.txt has been removed.
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/classes/java/main', not found
:contracts-kotlin:inspectClassesForKotlinIC (Thread[Execution worker for ':',5,main]) completed. Took 0.003 secs.
:contracts-kotlin:jar (Thread[Execution worker for ':',5,main]) started.
[ant:signjar] jar signed.
[ant:signjar]
[ant:signjar] Warning:
[ant:signjar] The signer's certificate is self-signed.
[ant:signjar] Enter Passphrase for keystore: Enter key password for cordacodesign:
Task :contracts-kotlin:jar
Custom actions are attached to task ':contracts-kotlin:jar'.
Caching disabled for task ':contracts-kotlin:jar' because:
Caching has not been enabled for the task
Task ':contracts-kotlin:jar' is not up-to-date because:
Output property 'archiveFile' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar has been removed.
CorDapp JAR signing with the default Corda development key, suitable for Corda running in development mode only.
Jar signing with following options: {alias=cordacodesign, storepass=cordacadevpass, keystore=/tmp/cordadevcakeys9052883946585902024jks, storetype=JKS, keypass=cordacadevkeypass, jar=/workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar}
[ant:signjar] Signing JAR: /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar to /workspace/samples-kotlin/Advanced/negotiation-cordapp/contracts-kotlin/build/libs/contracts-kotlin-0.2.jar as cordacodesign
:contracts-kotlin:jar (Thread[Execution worker for ':',5,main]) completed. Took 1.313 secs.
:workflows-kotlin:compileKotlin (Thread[Execution worker for ':',5,main]) started.
Task :workflows-kotlin:compileKotlin
Build cache key for task ':workflows-kotlin:compileKotlin' is b88a78d738bfb64a3ed2ad4cdbfe8726
Task ':workflows-kotlin:compileKotlin' is not up-to-date because:
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/build/classes/kotlin/main has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/build/classes/kotlin/main/META-INF has been removed.
Output property 'destinationDir' file /workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/build/classes/kotlin/main/META-INF/workflows-kotlin.kotlin_module has been removed.
All input files are considered out-of-date for incremental task ':workflows-kotlin:compileKotlin'.
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/src/main/java', not found
file or directory '/workspace/samples-kotlin/Advanced/negotiation-cordapp/workflows-kotlin/src/main/java', not found
Packing task ':workflows-kotlin:compileKotlin'
:workflows-kotlin:compileKotlin (Thread[Execution worker for ':',5,main]) completed. Took 1.043 secs.
The task :contracts-kotlin:compileKotlin is retrieved from the cache, but the task :workflows-kotlin:compileKotlin is not. Nothing was modified in the project.
If we enable gradle caching debug
./gradlew :workflows-kotlin:compileKotlin --build-cache -Dorg.gradle.caching.debug=true
We see this in the output
Task :workflows-kotlin:compileKotlin
Appending implementation to build cache key: org.jetbrains.kotlin.gradle.tasks.KotlinCompile_Decorated@e8fbdc73afb94883285acc9e7cbf2508
Appending additional implementation to build cache key: org.jetbrains.kotlin.gradle.tasks.KotlinCompile_Decorated@e8fbdc73afb94883285acc9e7cbf2508
Appending input value fingerprint for 'coroutinesStr$kotlin_gradle_plugin' to build cache key: f11c69e19062475a4bd6447e0c6820fc
Appending input value fingerprint for 'filteredArgumentsMap' to build cache key: e81e29e68b39c6ecb6cbd133e65b8357
Appending input value fingerprint for 'incremental' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'javaPackagePrefix' to build cache key: f6bd6b3389b872033d462029172c8612
Appending input value fingerprint for 'moduleName$kotlin_gradle_plugin' to build cache key: 0fa93a7a9b880d78afcfacb36fa1410f
Appending input value fingerprint for 'sourceCompatibility' to build cache key: 12f0ae79f405c46e9045f83b66543728
Appending input value fingerprint for 'targetCompatibility' to build cache key: 12f0ae79f405c46e9045f83b66543728
Appending input value fingerprint for 'useFallbackCompilerSearch$kotlin_gradle_plugin' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'useModuleDetection$kotlin_gradle_plugin' to build cache key: c06857e9ea338f3f3a24bb78f8fbdf6f
Appending input value fingerprint for 'usePreciseJavaTracking' to build cache key: f6d7ed39fe24031e22d54f3fe65b901c
Appending input file fingerprints for 'additionalClasspath' to build cache key: 5fd1e7396e8de4cb5c23dc6aadd7787a
Appending input file fingerprints for 'classpath' to build cache key: a205213469fbbde7b4c86c707b7c78fc
Appending input file fingerprints for 'commonSourceSet$kotlin_gradle_plugin' to build cache key: 5fd1e7396e8de4cb5c23dc6aadd7787a
Appending input file fingerprints for 'computedCompilerClasspath$kotlin_gradle_plugin' to build cache key: c12986a46a8f661947b468a6ba1ffa03
Appending input file fingerprints for 'pluginClasspath' to build cache key: 529f254376edfb889ce878d49a799ca1
Appending input file fingerprints for 'source' to build cache key: 8550e60cdcf6a5b2e4b9266e8a95617a
Appending output property name to build cache key: destinationDir
Build cache key for task ':workflows-kotlin:compileKotlin' is 1d889453d3f2244e8731dc3fbe4c6e36
The classpath input for the task :workflows-kotlin:compileKotlin is changing in every run. Even if nothing was modified in the project.