diff --git a/.github/workflows/maven-build-caching-samples-verification.yml b/.github/workflows/maven-build-caching-samples-verification.yml index fc39f518d..3e467167a 100644 --- a/.github/workflows/maven-build-caching-samples-verification.yml +++ b/.github/workflows/maven-build-caching-samples-verification.yml @@ -50,6 +50,12 @@ jobs: goals: ${{ env.GOALS }} args: ${{ env.ARGS }} failIfNotFullyCacheable: true + - name: Publish .data for experiment 1 + uses: actions/upload-artifact@v5 + if: failure() + with: + path: develocity-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest/ + name: 01-validate-local-build-caching-same-location-data-dir - name: Run experiment 2 uses: gradle/develocity-build-validation-scripts/.github/actions/maven/experiment-2@actions-stable with: @@ -59,3 +65,9 @@ jobs: goals: ${{ env.GOALS }} args: ${{ env.ARGS }} failIfNotFullyCacheable: true + - name: Publish .data for experiment 2 + uses: actions/upload-artifact@v5 + if: failure() + with: + path: develocity-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest/ + name: 02-validate-local-build-caching-different-locations-data-dir diff --git a/build-caching-maven-samples/pom.xml b/build-caching-maven-samples/pom.xml index 6d3f0f910..81d968257 100644 --- a/build-caching-maven-samples/pom.xml +++ b/build-caching-maven-samples/pom.xml @@ -21,6 +21,7 @@ kotlin-project pmd-project protobuf-project + scala-project spotbugs-project spring-cloud-contract-project diff --git a/build-caching-maven-samples/scala-project/README.md b/build-caching-maven-samples/scala-project/README.md new file mode 100644 index 000000000..e4165ef13 --- /dev/null +++ b/build-caching-maven-samples/scala-project/README.md @@ -0,0 +1 @@ +Example configuration for making the `compile` and `testCompile` goals of the `scala-maven-plugin` cacheable. diff --git a/build-caching-maven-samples/scala-project/pom.xml b/build-caching-maven-samples/scala-project/pom.xml new file mode 100644 index 000000000..774daf156 --- /dev/null +++ b/build-caching-maven-samples/scala-project/pom.xml @@ -0,0 +1,453 @@ + + + 4.0.0 + scala-project + jar + + + com.example + develocity-maven-caching-sample + 1.0-SNAPSHOT + + + + 2.13.12 + 2.13 + + + + + org.scala-lang + scala-library + ${scala.version} + + + + org.scalatest + scalatest_${scala.binary.version} + 3.2.17 + test + + + + + src/main/scala + src/test/scala + + + + net.alchim31.maven + scala-maven-plugin + 4.8.1 + + + scala-compile + + compile + + process-resources + + + scala-test-compile + + testCompile + + process-test-resources + + + + + + + + + com.gradle + develocity-maven-extension + + + + + net.alchim31.maven + scala-maven-plugin + + + scala-compile + + + + sourceDirectory + + src/main/scala + + + true + true + + + + sourceDir + includes + excludes + + true + true + + + + classpathElements + COMPILE_CLASSPATH + + + compilerPlugins + IGNORED_PATH + + + + + addJavacArgs + + + addScalacArgs + + + additionalDependencies + + + args + + + checkMultipleScalaVersions + + + compileOrder + + + displayCmd + + + encoding + + + failOnMultipleScalaVersions + + + forceUseArgFile + + + fork + + + javacArgs + + + jvmArgs + + + recompileMode + + + release + + + scalaClassName + + + scalaCompatVersion + + + scalaHome + + + scalaOrganization + + + scalaVersion + + + sendJavaToScalac + + + skipMain + + + source + + + target + + + useCanonicalPath + + + + project + session + notifyCompilation + javacGenerateDebugSymbols + classpath + + + + + pluginArtifacts + + + + groupId + + + artifactId + + + version + + + baseVersion + + + type + + + classifier + + + scope + + + + + + dependencies + + + + groupId + + + artifactId + + + version + + + classifier + + + + + + + compilation is CPU-bound + + + outputDir + + + + + + + secondaryCacheDir + + + analysisCacheFile + + + + + + scala-test-compile + + skip + + + + + testSourceDirectory + + src/test/scala + + + true + true + + + + testSourceDir + includes + excludes + + true + true + + + + classpathElements + COMPILE_CLASSPATH + + + compilerPlugins + IGNORED_PATH + + + + + addJavacArgs + + + addScalacArgs + + + additionalDependencies + + + args + + + checkMultipleScalaVersions + + + compileOrder + + + displayCmd + + + encoding + + + failOnMultipleScalaVersions + + + forceUseArgFile + + + fork + + + javacArgs + + + jvmArgs + + + recompileMode + + + release + + + scalaClassName + + + scalaCompatVersion + + + scalaHome + + + scalaOrganization + + + scalaVersion + + + sendJavaToScalac + + + source + + + target + + + useCanonicalPath + + + + project + session + notifyCompilation + javacGenerateDebugSymbols + + + + + pluginArtifacts + + + + groupId + + + artifactId + + + version + + + baseVersion + + + type + + + classifier + + + scope + + + + + + dependencies + + + + groupId + + + artifactId + + + version + + + classifier + + + + + + + compilation is CPU-bound with well-defined inputs and outputs + + + testOutputDir + + + + + + + secondaryCacheDir + + + testAnalysisCacheFile + + + + + + + + + + + + + + diff --git a/build-caching-maven-samples/scala-project/src/main/scala/com/example/App.scala b/build-caching-maven-samples/scala-project/src/main/scala/com/example/App.scala new file mode 100644 index 000000000..25729a3e5 --- /dev/null +++ b/build-caching-maven-samples/scala-project/src/main/scala/com/example/App.scala @@ -0,0 +1,9 @@ +package com.example + +object App { + def greet(name: String): String = s"Hello, $name!" + + def main(args: Array[String]): Unit = { + println(greet("World")) + } +} diff --git a/build-caching-maven-samples/scala-project/src/test/scala/com/example/AppTest.scala b/build-caching-maven-samples/scala-project/src/test/scala/com/example/AppTest.scala new file mode 100644 index 000000000..4622c2a95 --- /dev/null +++ b/build-caching-maven-samples/scala-project/src/test/scala/com/example/AppTest.scala @@ -0,0 +1,9 @@ +package com.example + +import org.scalatest.funsuite.AnyFunSuite + +class AppTest extends AnyFunSuite { + test("greet returns correct greeting") { + assert(App.greet("Scala") == "Hello, Scala!") + } +}