├── .github ├── dco.yml ├── workflow-samples │ ├── .gitignore │ ├── gradle-plugin │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── plugin │ │ │ ├── build.gradle │ │ │ └── src │ │ │ │ ├── functionalTest │ │ │ │ └── java │ │ │ │ │ └── org │ │ │ │ │ └── example │ │ │ │ │ └── gradle │ │ │ │ │ └── plugin │ │ │ │ │ └── GradlePluginPluginFunctionalTest.java │ │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── org │ │ │ │ │ └── example │ │ │ │ │ └── gradle │ │ │ │ │ └── plugin │ │ │ │ │ └── GradlePluginPlugin.java │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── org │ │ │ │ └── example │ │ │ │ └── gradle │ │ │ │ └── plugin │ │ │ │ └── GradlePluginPluginTest.java │ │ └── settings.gradle │ ├── groovy-dsl │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ │ └── test │ │ │ └── java │ │ │ └── basic │ │ │ └── BasicTest.java │ ├── java-toolchain │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle │ │ └── src │ │ │ └── test │ │ │ └── java │ │ │ └── basic │ │ │ └── BasicTest.java │ ├── kotlin-dsl │ │ ├── build.gradle.kts │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ ├── settings.gradle.kts │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── Library.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── LibraryTest.java │ ├── no-ge │ │ ├── build.gradle │ │ └── settings.gradle │ ├── no-wrapper-gradle-4 │ │ ├── build.gradle │ │ └── settings.gradle │ ├── no-wrapper-gradle-5 │ │ ├── build.gradle │ │ └── settings.gradle │ └── no-wrapper │ │ ├── build.gradle │ │ └── settings.gradle └── workflows │ ├── ci-full-check.yml │ ├── ci-quick-check.yml │ ├── demo-failure-cases.yml │ ├── demo-job-summary.yml │ ├── demo-pr-build-scan-comment.yml │ ├── integ-test-action-inputs.yml │ ├── integ-test-caching-config.yml │ ├── integ-test-dependency-graph-failures.yml │ ├── integ-test-dependency-graph.yml │ ├── integ-test-detect-java-toolchains.yml │ ├── integ-test-execution-with-caching.yml │ ├── integ-test-execution.yml │ ├── integ-test-inject-develocity.yml │ ├── integ-test-provision-gradle-versions.yml │ ├── integ-test-restore-configuration-cache.yml │ ├── integ-test-restore-containerized-gradle-home.yml │ ├── integ-test-restore-custom-gradle-home.yml │ ├── integ-test-restore-gradle-home.yml │ ├── integ-test-restore-java-toolchain.yml │ ├── integ-test-sample-gradle-plugin.yml │ └── integ-test-sample-kotlin-dsl.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md └── action.yml /.github/dco.yml: -------------------------------------------------------------------------------- 1 | # Disable sign-off checking for members of the Gradle GitHub organization 2 | require: 3 | members: false 4 | -------------------------------------------------------------------------------- /.github/workflow-samples/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Gradle project-specific cache directory 2 | .gradle 3 | 4 | # Ignore Gradle build output directory 5 | build 6 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gradle/gradle-build-action/093dfe9d598ec5a42246855d09b49dc76803c005/.github/workflow-samples/gradle-plugin/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/plugin/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * This generated file contains a sample Gradle plugin project to get you started. 5 | * For more details take a look at the Writing Custom Plugins chapter in the Gradle 6 | * User Manual available at https://docs.gradle.org/7.3/userguide/custom_plugins.html 7 | * This project uses @Incubating APIs which are subject to change. 8 | */ 9 | 10 | plugins { 11 | // Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins 12 | id 'java-gradle-plugin' 13 | } 14 | 15 | repositories { 16 | // Use Maven Central for resolving dependencies. 17 | mavenCentral() 18 | } 19 | 20 | testing { 21 | suites { 22 | // Configure the built-in test suite 23 | test { 24 | // Use JUnit Jupiter test framework 25 | useJUnitJupiter('5.7.2') 26 | } 27 | 28 | // Create a new test suite 29 | functionalTest(JvmTestSuite) { 30 | dependencies { 31 | // functionalTest test suite depends on the production code in tests 32 | implementation(project(':plugin')) 33 | } 34 | 35 | targets { 36 | all { 37 | // This test suite should run after the built-in test suite has run its tests 38 | testTask.configure { shouldRunAfter(test) } 39 | } 40 | } 41 | } 42 | } 43 | } 44 | 45 | gradlePlugin { 46 | // Define the plugin 47 | plugins { 48 | greeting { 49 | id = 'org.example.gradle.plugin.greeting' 50 | implementationClass = 'org.example.gradle.plugin.GradlePluginPlugin' 51 | } 52 | } 53 | } 54 | 55 | gradlePlugin.testSourceSets(sourceSets.functionalTest) 56 | 57 | tasks.named('check') { 58 | // Include functionalTest as part of the check lifecycle 59 | dependsOn(testing.suites.functionalTest) 60 | } 61 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/plugin/src/functionalTest/java/org/example/gradle/plugin/GradlePluginPluginFunctionalTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | package org.example.gradle.plugin; 5 | 6 | import java.io.File; 7 | import java.io.IOException; 8 | import java.io.Writer; 9 | import java.io.FileWriter; 10 | import java.nio.file.Files; 11 | import org.gradle.testkit.runner.GradleRunner; 12 | import org.gradle.testkit.runner.BuildResult; 13 | import org.junit.jupiter.api.Test; 14 | import org.junit.jupiter.api.io.TempDir; 15 | import static org.junit.jupiter.api.Assertions.*; 16 | 17 | /** 18 | * A simple functional test for the 'org.example.gradle.plugin.greeting' plugin. 19 | */ 20 | class GradlePluginPluginFunctionalTest { 21 | @TempDir 22 | File projectDir; 23 | 24 | private File getBuildFile() { 25 | return new File(projectDir, "build.gradle"); 26 | } 27 | 28 | private File getSettingsFile() { 29 | return new File(projectDir, "settings.gradle"); 30 | } 31 | 32 | @Test void canRunTaskWithGradle691() throws IOException { 33 | writeString(getSettingsFile(), ""); 34 | writeString(getBuildFile(), 35 | "plugins {" + 36 | " id('org.example.gradle.plugin.greeting')" + 37 | "}"); 38 | 39 | // Run the build 40 | GradleRunner runner = GradleRunner.create(); 41 | runner.forwardOutput(); 42 | runner.withGradleVersion("6.9.1"); 43 | runner.withPluginClasspath(); 44 | runner.withArguments("greeting"); 45 | runner.withProjectDir(projectDir); 46 | BuildResult result = runner.build(); 47 | 48 | // Verify the result 49 | assertTrue(result.getOutput().contains("Hello from plugin 'org.example.gradle.plugin.greeting'")); 50 | } 51 | 52 | private void writeString(File file, String string) throws IOException { 53 | try (Writer writer = new FileWriter(file)) { 54 | writer.write(string); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/plugin/src/main/java/org/example/gradle/plugin/GradlePluginPlugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | package org.example.gradle.plugin; 5 | 6 | import org.gradle.api.Project; 7 | import org.gradle.api.Plugin; 8 | 9 | /** 10 | * A simple 'hello world' plugin. 11 | */ 12 | public class GradlePluginPlugin implements Plugin { 13 | public void apply(Project project) { 14 | // Register a task 15 | project.getTasks().register("greeting", task -> { 16 | task.doLast(s -> System.out.println("Hello from plugin 'org.example.gradle.plugin.greeting'")); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/plugin/src/test/java/org/example/gradle/plugin/GradlePluginPluginTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | package org.example.gradle.plugin; 5 | 6 | import org.gradle.testfixtures.ProjectBuilder; 7 | import org.gradle.api.Project; 8 | import org.junit.jupiter.api.Test; 9 | import static org.junit.jupiter.api.Assertions.*; 10 | 11 | /** 12 | * A simple unit test for the 'org.example.gradle.plugin.greeting' plugin. 13 | */ 14 | class GradlePluginPluginTest { 15 | @Test void pluginRegistersATask() { 16 | // Create a test project and apply the plugin 17 | Project project = ProjectBuilder.builder().build(); 18 | project.getPlugins().apply("org.example.gradle.plugin.greeting"); 19 | 20 | // Verify the result 21 | assertNotNull(project.getTasks().findByName("greeting")); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflow-samples/gradle-plugin/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * 6 | * Detailed information about configuring a multi-project build in Gradle can be found 7 | * in the user manual at https://docs.gradle.org/7.3/userguide/multi_project_builds.html 8 | * This project uses @Incubating APIs which are subject to change. 9 | */ 10 | 11 | rootProject.name = 'gradle-plugin' 12 | include('plugin') 13 | -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | } 8 | 9 | dependencies { 10 | testImplementation('junit:junit:4.13.2') 11 | } 12 | 13 | tasks.named("test").configure { 14 | // Write marker file so we can detect if task was configured 15 | file("task-configured.txt").text = "true" 16 | 17 | doLast { 18 | if (System.properties.verifyCachedBuild) { 19 | throw new RuntimeException("Build was not cached: unexpected execution of test task") 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.caching=true 2 | -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gradle/gradle-build-action/093dfe9d598ec5a42246855d09b49dc76803c005/.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/settings.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.gradle.enterprise" version "3.16.2" 3 | id "com.gradle.common-custom-user-data-gradle-plugin" version "1.13" 4 | } 5 | 6 | gradleEnterprise { 7 | buildScan { 8 | termsOfServiceUrl = "https://gradle.com/terms-of-service" 9 | termsOfServiceAgree = "yes" 10 | publishAlways() 11 | uploadInBackground = false 12 | } 13 | } 14 | rootProject.name = 'groovy-dsl' 15 | -------------------------------------------------------------------------------- /.github/workflow-samples/groovy-dsl/src/test/java/basic/BasicTest.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.junit.Test; 4 | 5 | public class BasicTest { 6 | @Test 7 | public void test() { 8 | assert true; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | } 4 | 5 | java { 6 | toolchain { 7 | languageVersion = JavaLanguageVersion.of(16) 8 | } 9 | } 10 | 11 | repositories { 12 | mavenCentral() 13 | } 14 | 15 | dependencies { 16 | testImplementation('junit:junit:4.13.2') 17 | } -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.caching=true 2 | -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gradle/gradle-build-action/093dfe9d598ec5a42246855d09b49dc76803c005/.github/workflow-samples/java-toolchain/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/settings.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0") 3 | } 4 | 5 | rootProject.name = 'basic' 6 | -------------------------------------------------------------------------------- /.github/workflow-samples/java-toolchain/src/test/java/basic/BasicTest.java: -------------------------------------------------------------------------------- 1 | package basic; 2 | 3 | import org.junit.Test; 4 | 5 | public class BasicTest { 6 | @Test 7 | public void test() { 8 | assert true; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | `java-library` 3 | } 4 | 5 | repositories { 6 | mavenCentral() 7 | } 8 | 9 | dependencies { 10 | api("org.apache.commons:commons-math3:3.6.1") 11 | implementation("com.google.guava:guava:33.1.0-jre") 12 | 13 | testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") 14 | } 15 | 16 | tasks.test { 17 | useJUnitPlatform() 18 | } 19 | 20 | tasks.named("test").configure { 21 | // Write marker file so we can detect if task was configured 22 | file("task-configured.txt").writeText("true") 23 | 24 | doLast { 25 | if (System.getProperties().containsKey("verifyCachedBuild")) { 26 | throw RuntimeException("Build was not cached: unexpected execution of test task") 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.caching=true 2 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gradle/gradle-build-action/093dfe9d598ec5a42246855d09b49dc76803c005/.github/workflow-samples/kotlin-dsl/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | networkTimeout=10000 6 | validateDistributionUrl=true 7 | zipStoreBase=GRADLE_USER_HOME 8 | zipStorePath=wrapper/dists 9 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) 87 | APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit 88 | 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. 90 | MAX_FD=maximum 91 | 92 | warn () { 93 | echo "$*" 94 | } >&2 95 | 96 | die () { 97 | echo 98 | echo "$*" 99 | echo 100 | exit 1 101 | } >&2 102 | 103 | # OS specific support (must be 'true' or 'false'). 104 | cygwin=false 105 | msys=false 106 | darwin=false 107 | nonstop=false 108 | case "$( uname )" in #( 109 | CYGWIN* ) cygwin=true ;; #( 110 | Darwin* ) darwin=true ;; #( 111 | MSYS* | MINGW* ) msys=true ;; #( 112 | NONSTOP* ) nonstop=true ;; 113 | esac 114 | 115 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 116 | 117 | 118 | # Determine the Java command to use to start the JVM. 119 | if [ -n "$JAVA_HOME" ] ; then 120 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 121 | # IBM's JDK on AIX uses strange locations for the executables 122 | JAVACMD=$JAVA_HOME/jre/sh/java 123 | else 124 | JAVACMD=$JAVA_HOME/bin/java 125 | fi 126 | if [ ! -x "$JAVACMD" ] ; then 127 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 128 | 129 | Please set the JAVA_HOME variable in your environment to match the 130 | location of your Java installation." 131 | fi 132 | else 133 | JAVACMD=java 134 | if ! command -v java >/dev/null 2>&1 135 | then 136 | die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | fi 142 | 143 | # Increase the maximum file descriptors if we can. 144 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 145 | case $MAX_FD in #( 146 | max*) 147 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 148 | # shellcheck disable=SC2039,SC3045 149 | MAX_FD=$( ulimit -H -n ) || 150 | warn "Could not query maximum file descriptor limit" 151 | esac 152 | case $MAX_FD in #( 153 | '' | soft) :;; #( 154 | *) 155 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 156 | # shellcheck disable=SC2039,SC3045 157 | ulimit -n "$MAX_FD" || 158 | warn "Could not set maximum file descriptor limit to $MAX_FD" 159 | esac 160 | fi 161 | 162 | # Collect all arguments for the java command, stacking in reverse order: 163 | # * args from the command line 164 | # * the main class name 165 | # * -classpath 166 | # * -D...appname settings 167 | # * --module-path (only if needed) 168 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 169 | 170 | # For Cygwin or MSYS, switch paths to Windows format before running java 171 | if "$cygwin" || "$msys" ; then 172 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 173 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 174 | 175 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 176 | 177 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 178 | for arg do 179 | if 180 | case $arg in #( 181 | -*) false ;; # don't mess with options #( 182 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 183 | [ -e "$t" ] ;; #( 184 | *) false ;; 185 | esac 186 | then 187 | arg=$( cygpath --path --ignore --mixed "$arg" ) 188 | fi 189 | # Roll the args list around exactly as many times as the number of 190 | # args, so each arg winds up back in the position where it started, but 191 | # possibly modified. 192 | # 193 | # NB: a `for` loop captures its iteration list before it begins, so 194 | # changing the positional parameters here affects neither the number of 195 | # iterations, nor the values presented in `arg`. 196 | shift # remove old arg 197 | set -- "$@" "$arg" # push replacement arg 198 | done 199 | fi 200 | 201 | 202 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 203 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 204 | 205 | # Collect all arguments for the java command: 206 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, 207 | # and any embedded shellness will be escaped. 208 | # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be 209 | # treated as '${Hostname}' itself on the command line. 210 | 211 | set -- \ 212 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 213 | -classpath "$CLASSPATH" \ 214 | org.gradle.wrapper.GradleWrapperMain \ 215 | "$@" 216 | 217 | # Stop when "xargs" is not available. 218 | if ! command -v xargs >/dev/null 2>&1 219 | then 220 | die "xargs is not available" 221 | fi 222 | 223 | # Use "xargs" to parse quoted args. 224 | # 225 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 226 | # 227 | # In Bash we could simply go: 228 | # 229 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 230 | # set -- "${ARGS[@]}" "$@" 231 | # 232 | # but POSIX shell has neither arrays nor command substitution, so instead we 233 | # post-process each arg (as a line of input to sed) to backslash-escape any 234 | # character that might be a shell metacharacter, then use eval to reverse 235 | # that process (while maintaining the separation between arguments), and wrap 236 | # the whole thing up as a single "set" statement. 237 | # 238 | # This will of course break if any of these variables contains a newline or 239 | # an unmatched quote. 240 | # 241 | 242 | eval "set -- $( 243 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 244 | xargs -n1 | 245 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 246 | tr '\n' ' ' 247 | )" '"$@"' 248 | 249 | exec "$JAVACMD" "$@" 250 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 1>&2 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 48 | echo. 1>&2 49 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 50 | echo location of your Java installation. 1>&2 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 1>&2 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 62 | echo. 1>&2 63 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 64 | echo location of your Java installation. 1>&2 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.gradle.enterprise") version "3.16.2" 3 | id("com.gradle.common-custom-user-data-gradle-plugin") version "1.13" 4 | } 5 | 6 | gradleEnterprise { 7 | buildScan { 8 | termsOfServiceUrl = "https://gradle.com/terms-of-service" 9 | termsOfServiceAgree = "yes" 10 | publishAlways() 11 | isUploadInBackground = false 12 | } 13 | } 14 | 15 | rootProject.name = "kotlin-dsl" 16 | 17 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/src/main/java/com/example/Library.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | package com.example; 5 | 6 | public class Library { 7 | public boolean someLibraryMethod() { 8 | return true; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.github/workflow-samples/kotlin-dsl/src/test/java/com/example/LibraryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This Java source file was generated by the Gradle 'init' task. 3 | */ 4 | package com.example; 5 | 6 | import org.junit.jupiter.api.Test; 7 | import static org.junit.jupiter.api.Assertions.*; 8 | 9 | class LibraryTest { 10 | @Test void someLibraryMethodReturnsTrue() { 11 | Library classUnderTest = new Library(); 12 | assertTrue(classUnderTest.someLibraryMethod(), "someLibraryMethod should return 'true'"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflow-samples/no-ge/build.gradle: -------------------------------------------------------------------------------- 1 | // Required to keep dependabot happy 2 | -------------------------------------------------------------------------------- /.github/workflow-samples/no-ge/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'no-ge' 2 | -------------------------------------------------------------------------------- /.github/workflow-samples/no-wrapper-gradle-4/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.gradle.build-scan" version "1.16" 3 | } 4 | 5 | buildScan { 6 | termsOfServiceUrl = "https://gradle.com/terms-of-service" 7 | termsOfServiceAgree = "yes" 8 | publishAlways() 9 | } 10 | 11 | -------------------------------------------------------------------------------- /.github/workflow-samples/no-wrapper-gradle-4/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'no-wrapper' 2 | 3 | println "Using Gradle version: ${gradle.gradleVersion}" 4 | 5 | def gradleVersionCheck = System.properties.gradleVersionCheck 6 | if (gradleVersionCheck && gradle.gradleVersion != gradleVersionCheck) { 7 | throw new RuntimeException("Got the wrong version: expected ${gradleVersionCheck} but was ${gradle.gradleVersion}") 8 | } -------------------------------------------------------------------------------- /.github/workflow-samples/no-wrapper-gradle-5/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.gradle.build-scan" version "3.16.2" 3 | } 4 | 5 | gradleEnterprise { 6 | buildScan { 7 | termsOfServiceUrl = "https://gradle.com/terms-of-service" 8 | termsOfServiceAgree = "yes" 9 | publishAlways() 10 | uploadInBackground = false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.github/workflow-samples/no-wrapper-gradle-5/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'no-wrapper' 2 | 3 | println "Using Gradle version: ${gradle.gradleVersion}" 4 | 5 | def gradleVersionCheck = System.properties.gradleVersionCheck 6 | if (gradleVersionCheck && gradle.gradleVersion != gradleVersionCheck) { 7 | throw new RuntimeException("Got the wrong version: expected ${gradleVersionCheck} but was ${gradle.gradleVersion}") 8 | } -------------------------------------------------------------------------------- /.github/workflow-samples/no-wrapper/build.gradle: -------------------------------------------------------------------------------- 1 | // Required to keep dependabot happy -------------------------------------------------------------------------------- /.github/workflow-samples/no-wrapper/settings.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.gradle.enterprise" version "3.16.2" 3 | } 4 | 5 | gradleEnterprise { 6 | buildScan { 7 | termsOfServiceUrl = "https://gradle.com/terms-of-service" 8 | termsOfServiceAgree = "yes" 9 | publishAlways() 10 | uploadInBackground = false 11 | } 12 | } 13 | 14 | rootProject.name = 'no-wrapper' 15 | 16 | println "Using Gradle version: ${gradle.gradleVersion}" 17 | 18 | def gradleVersionCheck = System.properties.gradleVersionCheck 19 | if (gradleVersionCheck && gradle.gradleVersion != gradleVersionCheck) { 20 | throw new RuntimeException("Got the wrong version: expected ${gradleVersionCheck} but was ${gradle.gradleVersion}") 21 | } -------------------------------------------------------------------------------- /.github/workflows/ci-full-check.yml: -------------------------------------------------------------------------------- 1 | name: CI-full-check 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | action-inputs: 8 | uses: ./.github/workflows/integ-test-action-inputs.yml 9 | with: 10 | cache-key-prefix: ${{github.run_number}}- 11 | 12 | caching-config: 13 | uses: ./.github/workflows/integ-test-caching-config.yml 14 | with: 15 | cache-key-prefix: ${{github.run_number}}- 16 | 17 | dependency-graph: 18 | uses: ./.github/workflows/integ-test-dependency-graph.yml 19 | permissions: 20 | contents: write 21 | with: 22 | cache-key-prefix: ${{github.run_number}}- 23 | 24 | dependency-graph-failures: 25 | uses: ./.github/workflows/integ-test-dependency-graph-failures.yml 26 | with: 27 | cache-key-prefix: ${{github.run_number}}- 28 | 29 | execution-with-caching: 30 | uses: ./.github/workflows/integ-test-execution-with-caching.yml 31 | with: 32 | cache-key-prefix: ${{github.run_number}}- 33 | 34 | execution: 35 | uses: ./.github/workflows/integ-test-execution.yml 36 | with: 37 | cache-key-prefix: ${{github.run_number}}- 38 | 39 | develocity-injection: 40 | uses: ./.github/workflows/integ-test-inject-develocity.yml 41 | with: 42 | cache-key-prefix: ${{github.run_number}}- 43 | secrets: 44 | DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }} 45 | 46 | provision-gradle-versions: 47 | uses: ./.github/workflows/integ-test-provision-gradle-versions.yml 48 | with: 49 | cache-key-prefix: ${{github.run_number}}- 50 | 51 | restore-configuration-cache: 52 | uses: ./.github/workflows/integ-test-restore-configuration-cache.yml 53 | with: 54 | cache-key-prefix: ${{github.run_number}}- 55 | secrets: 56 | GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 57 | 58 | restore-custom-gradle-home: 59 | uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml 60 | with: 61 | cache-key-prefix: ${{github.run_number}}- 62 | 63 | restore-containerized-gradle-home: 64 | uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml 65 | with: 66 | cache-key-prefix: ${{github.run_number}}- 67 | 68 | restore-gradle-home: 69 | uses: ./.github/workflows/integ-test-restore-gradle-home.yml 70 | with: 71 | cache-key-prefix: ${{github.run_number}}- 72 | 73 | restore-java-toolchain: 74 | uses: ./.github/workflows/integ-test-restore-java-toolchain.yml 75 | with: 76 | cache-key-prefix: ${{github.run_number}}- 77 | 78 | sample-kotlin-dsl: 79 | uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml 80 | with: 81 | cache-key-prefix: ${{github.run_number}}- 82 | 83 | sample-gradle-plugin: 84 | uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml 85 | with: 86 | cache-key-prefix: ${{github.run_number}}- 87 | 88 | toolchain-detection: 89 | uses: ./.github/workflows/integ-test-detect-java-toolchains.yml 90 | with: 91 | cache-key-prefix: ${{github.run_number}}- 92 | -------------------------------------------------------------------------------- /.github/workflows/ci-quick-check.yml: -------------------------------------------------------------------------------- 1 | name: CI-quick-check 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | 7 | jobs: 8 | action-inputs: 9 | uses: ./.github/workflows/integ-test-action-inputs.yml 10 | with: 11 | runner-os: '["ubuntu-latest"]' 12 | 13 | caching-config: 14 | uses: ./.github/workflows/integ-test-caching-config.yml 15 | with: 16 | runner-os: '["ubuntu-latest"]' 17 | 18 | dependency-graph: 19 | uses: ./.github/workflows/integ-test-dependency-graph.yml 20 | permissions: 21 | contents: write 22 | with: 23 | runner-os: '["ubuntu-latest"]' 24 | 25 | dependency-graph-failures: 26 | uses: ./.github/workflows/integ-test-dependency-graph-failures.yml 27 | with: 28 | runner-os: '["ubuntu-latest"]' 29 | 30 | execution-with-caching: 31 | uses: ./.github/workflows/integ-test-execution-with-caching.yml 32 | with: 33 | runner-os: '["ubuntu-latest"]' 34 | 35 | execution: 36 | uses: ./.github/workflows/integ-test-execution.yml 37 | with: 38 | runner-os: '["ubuntu-latest"]' 39 | 40 | develocity-injection: 41 | uses: ./.github/workflows/integ-test-inject-develocity.yml 42 | with: 43 | runner-os: '["ubuntu-latest"]' 44 | secrets: 45 | DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }} 46 | 47 | provision-gradle-versions: 48 | uses: ./.github/workflows/integ-test-provision-gradle-versions.yml 49 | with: 50 | runner-os: '["ubuntu-latest"]' 51 | 52 | restore-configuration-cache: 53 | uses: ./.github/workflows/integ-test-restore-configuration-cache.yml 54 | with: 55 | runner-os: '["ubuntu-latest"]' 56 | secrets: 57 | GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 58 | 59 | restore-containerized-gradle-home: 60 | uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml 61 | 62 | restore-custom-gradle-home: 63 | uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml 64 | 65 | restore-gradle-home: 66 | uses: ./.github/workflows/integ-test-restore-gradle-home.yml 67 | with: 68 | runner-os: '["ubuntu-latest"]' 69 | 70 | restore-java-toolchain: 71 | uses: ./.github/workflows/integ-test-restore-java-toolchain.yml 72 | with: 73 | runner-os: '["ubuntu-latest"]' 74 | 75 | sample-kotlin-dsl: 76 | uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml 77 | with: 78 | runner-os: '["ubuntu-latest"]' 79 | 80 | sample-gradle-plugin: 81 | uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml 82 | with: 83 | runner-os: '["ubuntu-latest"]' 84 | 85 | toolchain-detection: 86 | uses: ./.github/workflows/integ-test-detect-java-toolchains.yml 87 | with: 88 | runner-os: '["ubuntu-latest"]' 89 | -------------------------------------------------------------------------------- /.github/workflows/demo-failure-cases.yml: -------------------------------------------------------------------------------- 1 | name: demo-failure-cases 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | 8 | failing-build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout sources 12 | uses: actions/checkout@v4 13 | - name: Test build failure 14 | uses: ./ 15 | continue-on-error: true 16 | with: 17 | build-root-directory: .github/workflow-samples/kotlin-dsl 18 | arguments: not-a-valid-task 19 | 20 | wrapper-missing: 21 | runs-on: ubuntu-latest 22 | steps: 23 | - name: Checkout sources 24 | uses: actions/checkout@v4 25 | - name: Test wrapper missing 26 | uses: ./ 27 | continue-on-error: true 28 | with: 29 | build-root-directory: .github/workflow-samples/no-wrapper 30 | arguments: help 31 | 32 | bad-configuration: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - name: Checkout sources 36 | uses: actions/checkout@v4 37 | - name: Test bad config value 38 | uses: ./ 39 | continue-on-error: true 40 | with: 41 | build-root-directory: .github/workflow-samples/no-wrapper 42 | arguments: help 43 | cache-disabled: yes 44 | -------------------------------------------------------------------------------- /.github/workflows/demo-job-summary.yml: -------------------------------------------------------------------------------- 1 | name: Demo Job Summary, for Gradle builds 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | 7 | env: 8 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 9 | 10 | jobs: 11 | many-gradle-builds: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout sources 15 | uses: actions/checkout@v4 16 | - name: Setup Gradle 17 | uses: ./ 18 | - name: Build kotlin-dsl project 19 | working-directory: .github/workflow-samples/kotlin-dsl 20 | run: ./gradlew assemble 21 | - name: Build kotlin-dsl project without Build Scan® 22 | working-directory: .github/workflow-samples/kotlin-dsl 23 | run: ./gradlew assemble check --no-scan 24 | - name: Build kotlin-dsl project with Build Scan® publish failure 25 | working-directory: .github/workflow-samples/kotlin-dsl 26 | run: ./gradlew check -Dgradle.enterprise.url=https://not.valid.server 27 | - name: Build groovy-dsl project 28 | working-directory: .github/workflow-samples/groovy-dsl 29 | run: ./gradlew assemble 30 | - name: Build kotlin-dsl project with multiple gradle invocations 31 | working-directory: .github/workflow-samples/kotlin-dsl 32 | run: | 33 | ./gradlew tasks --no-daemon 34 | ./gradlew help check 35 | - name: Fail groovy-dsl project 36 | working-directory: .github/workflow-samples/groovy-dsl 37 | continue-on-error: true 38 | run: ./gradlew not-a-real-task 39 | 40 | successful-builds-with-no-summary: 41 | runs-on: ubuntu-latest 42 | steps: 43 | - name: Checkout sources 44 | uses: actions/checkout@v4 45 | - name: Setup Gradle 46 | uses: ./ 47 | with: 48 | add-job-summary: on-failure 49 | - name: Build kotlin-dsl project 50 | working-directory: .github/workflow-samples/kotlin-dsl 51 | run: ./gradlew assemble 52 | - name: Build kotlin-dsl project without Build Scan® 53 | working-directory: .github/workflow-samples/kotlin-dsl 54 | run: ./gradlew assemble check --no-scan 55 | 56 | pre-existing-gradle-home: 57 | runs-on: ubuntu-latest 58 | steps: 59 | - name: Checkout sources 60 | uses: actions/checkout@v4 61 | - name: Pre-create Gradle User Home 62 | shell: bash 63 | run: | 64 | mkdir ~/.gradle 65 | mkdir ~/.gradle/caches 66 | touch ~/.gradle/caches/dummy.txt 67 | - name: Setup Gradle 68 | uses: ./ 69 | - name: Run build 70 | working-directory: .github/workflow-samples/groovy-dsl 71 | run: ./gradlew assemble 72 | -------------------------------------------------------------------------------- /.github/workflows/demo-pr-build-scan-comment.yml: -------------------------------------------------------------------------------- 1 | name: Demo adding Build Scan® comment to PR 2 | on: 3 | pull_request: 4 | types: [assigned, review_requested] 5 | 6 | permissions: 7 | pull-requests: write 8 | 9 | jobs: 10 | successful-build-with-always-comment: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout project sources 14 | uses: actions/checkout@v4 15 | - name: Setup Gradle 16 | uses: ./ 17 | with: 18 | add-job-summary-as-pr-comment: always 19 | - name: Run build with Gradle wrapper 20 | id: gradle 21 | working-directory: .github/workflow-samples/kotlin-dsl 22 | run: ./gradlew build --scan 23 | 24 | successful-build-with-comment-on-failure: 25 | runs-on: ubuntu-latest 26 | steps: 27 | - name: Checkout project sources 28 | uses: actions/checkout@v4 29 | - name: Setup Gradle 30 | uses: ./ 31 | with: 32 | add-job-summary-as-pr-comment: on-failure 33 | - name: Run build with Gradle wrapper 34 | id: gradle 35 | working-directory: .github/workflow-samples/kotlin-dsl 36 | run: ./gradlew build --scan 37 | 38 | failing-build-with-comment-on-failure: 39 | runs-on: ubuntu-latest 40 | steps: 41 | - name: Checkout project sources 42 | uses: actions/checkout@v4 43 | - name: Setup Gradle 44 | uses: ./ 45 | with: 46 | add-job-summary-as-pr-comment: on-failure 47 | - name: Run build with Gradle wrapper 48 | id: gradle 49 | working-directory: .github/workflow-samples/kotlin-dsl 50 | run: ./gradlew no-a-real-task --scan 51 | continue-on-error: true 52 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-action-inputs.yml: -------------------------------------------------------------------------------- 1 | name: Test action inputs 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: action-inputs-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | action-inputs: 18 | strategy: 19 | matrix: 20 | os: ${{fromJSON(inputs.runner-os)}} 21 | runs-on: ${{ matrix.os }} 22 | steps: 23 | - name: Checkout sources 24 | uses: actions/checkout@v4 25 | - name: Invoke with multi-line arguments 26 | uses: ./ 27 | with: 28 | build-root-directory: .github/workflow-samples/groovy-dsl 29 | arguments: | 30 | --configuration-cache 31 | --build-cache 32 | -DsystemProperty=FOO 33 | -PgradleProperty=BAR 34 | test 35 | jar -------------------------------------------------------------------------------- /.github/workflows/integ-test-caching-config.yml: -------------------------------------------------------------------------------- 1 | name: Test caching configuration 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: action-inputs-caching-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | seed-build: 18 | strategy: 19 | matrix: 20 | os: ${{fromJSON(inputs.runner-os)}} 21 | runs-on: ${{ matrix.os }} 22 | steps: 23 | - name: Checkout sources 24 | uses: actions/checkout@v4 25 | - name: Setup Gradle 26 | uses: ./ 27 | with: 28 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 29 | # Add "enterprise" to main cache entry but omit "notifications" 30 | gradle-home-cache-includes: | 31 | caches 32 | enterprise 33 | # Exclude build-cache from main cache entry 34 | gradle-home-cache-excludes: | 35 | caches/build-cache-* 36 | caches/*/executionHistory 37 | - name: Build using Gradle wrapper 38 | working-directory: .github/workflow-samples/groovy-dsl 39 | run: ./gradlew test 40 | 41 | # Test that the gradle-user-home cache will cache dependencies, by running build with --offline 42 | verify-build: 43 | needs: seed-build 44 | strategy: 45 | matrix: 46 | os: ${{fromJSON(inputs.runner-os)}} 47 | runs-on: ${{ matrix.os }} 48 | steps: 49 | - name: Checkout sources 50 | uses: actions/checkout@v4 51 | - name: Setup Gradle 52 | uses: ./ 53 | with: 54 | # Use the same configuration as used in the seed build 55 | gradle-home-cache-includes: | 56 | caches 57 | enterprise 58 | gradle-home-cache-excludes: | 59 | caches/build-cache-* 60 | caches/*/executionHistory 61 | cache-read-only: true 62 | - name: Execute Gradle build with --offline 63 | working-directory: .github/workflow-samples/groovy-dsl 64 | run: ./gradlew test --offline 65 | 66 | # Test that build scans are captured when caching is explicitly disabled 67 | cache-disabled: 68 | strategy: 69 | matrix: 70 | os: ${{fromJSON(inputs.runner-os)}} 71 | runs-on: ${{ matrix.os }} 72 | steps: 73 | - name: Checkout sources 74 | uses: actions/checkout@v4 75 | - name: Setup Gradle 76 | uses: ./ 77 | with: 78 | cache-disabled: true 79 | - name: Run Gradle build 80 | id: gradle 81 | working-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }} 82 | run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}" 83 | - name: Check Build Scan url is captured 84 | if: ${{ !steps.gradle.outputs.build-scan-url }} 85 | uses: actions/github-script@v7 86 | with: 87 | script: | 88 | core.setFailed('No Build Scan detected') 89 | 90 | # Test that build scans are captured when caching is disabled because Gradle User Home already exists 91 | cache-disabled-pre-existing-gradle-home: 92 | runs-on: ubuntu-latest 93 | steps: 94 | - name: Checkout sources 95 | uses: actions/checkout@v4 96 | - name: Create dummy Gradle User Home 97 | run: mkdir -p ~/.gradle/caches 98 | - name: Setup Gradle 99 | uses: ./ 100 | - name: Run Gradle build 101 | id: gradle 102 | working-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }} 103 | run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}" 104 | - name: Check Build Scan url is captured 105 | if: ${{ !steps.gradle.outputs.build-scan-url }} 106 | uses: actions/github-script@v7 107 | with: 108 | script: | 109 | core.setFailed('No Build Scan detected') 110 | 111 | # Test seed the cache with cache-write-only and verify with cache-read-only 112 | seed-build-write-only: 113 | env: 114 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only- 115 | strategy: 116 | matrix: 117 | os: ${{fromJSON(inputs.runner-os)}} 118 | runs-on: ${{ matrix.os }} 119 | steps: 120 | - name: Checkout sources 121 | uses: actions/checkout@v4 122 | - name: Setup Gradle 123 | uses: ./ 124 | with: 125 | cache-write-only: true 126 | - name: Build using Gradle wrapper 127 | working-directory: .github/workflow-samples/groovy-dsl 128 | run: ./gradlew test 129 | 130 | verify-write-only-build: 131 | env: 132 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only- 133 | needs: seed-build-write-only 134 | strategy: 135 | matrix: 136 | os: ${{fromJSON(inputs.runner-os)}} 137 | runs-on: ${{ matrix.os }} 138 | steps: 139 | - name: Checkout sources 140 | uses: actions/checkout@v4 141 | - name: Setup Gradle 142 | uses: ./ 143 | with: 144 | cache-read-only: true 145 | - name: Execute Gradle build with --offline 146 | working-directory: .github/workflow-samples/groovy-dsl 147 | run: ./gradlew test --offline 148 | 149 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-dependency-graph-failures.yml: -------------------------------------------------------------------------------- 1 | name: Test dependency graph 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-graph-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | unsupported-gradle-version-warning: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - name: Checkout sources 21 | uses: actions/checkout@v4 22 | - name: Setup Gradle for dependency-graph generate 23 | uses: ./ 24 | with: 25 | gradle-version: 7.0.1 26 | dependency-graph: generate 27 | dependency-graph-continue-on-failure: true 28 | - name: Run with unsupported Gradle version 29 | working-directory: .github/workflow-samples/groovy-dsl 30 | run: | 31 | if gradle help | grep -q 'warning::Dependency Graph is not supported for Gradle 7.0.1. No dependency snapshot will be generated.'; 32 | then 33 | echo "Got the expected warning" 34 | else 35 | echo "Did not get the expected warning" 36 | exit 1 37 | fi 38 | 39 | unsupported-gradle-version-failure: 40 | runs-on: ubuntu-latest 41 | steps: 42 | - name: Checkout sources 43 | uses: actions/checkout@v4 44 | - name: Setup Gradle for dependency-graph generate 45 | uses: ./ 46 | with: 47 | gradle-version: 7.0.1 48 | dependency-graph: generate 49 | dependency-graph-continue-on-failure: false 50 | - name: Run with unsupported Gradle version 51 | working-directory: .github/workflow-samples/groovy-dsl 52 | run: | 53 | if gradle help; then 54 | echo "Expected build to fail with Gradle 7.0.1" 55 | exit 1 56 | fi 57 | 58 | insufficient-permissions-warning: 59 | runs-on: ubuntu-latest 60 | permissions: 61 | contents: read 62 | steps: 63 | - name: Checkout sources 64 | uses: actions/checkout@v4 65 | - name: Setup Gradle for dependency-graph generate 66 | uses: ./ 67 | with: 68 | dependency-graph: generate-and-submit 69 | dependency-graph-continue-on-failure: true 70 | - name: Run with insufficient permissions 71 | working-directory: .github/workflow-samples/groovy-dsl 72 | run: ./gradlew help 73 | # This test is primarily for demonstration: it's unclear how to check for warnings emitted in the post-action 74 | 75 | SHOULD_FAIL-insufficient-permissions-failure: 76 | runs-on: ubuntu-latest 77 | permissions: 78 | contents: read 79 | continue-on-error: true 80 | steps: 81 | - name: Checkout sources 82 | uses: actions/checkout@v4 83 | - name: Setup Gradle for dependency-graph generate 84 | uses: ./ 85 | with: 86 | dependency-graph: generate-and-submit 87 | dependency-graph-continue-on-failure: false 88 | - name: Run with insufficient permissions 89 | working-directory: .github/workflow-samples/groovy-dsl 90 | run: ./gradlew help 91 | # This test is primarily for demonstration: it's unclear how to check for a failure in the post-action 92 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-dependency-graph.yml: -------------------------------------------------------------------------------- 1 | name: Test dependency graph 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | permissions: 13 | contents: write 14 | 15 | env: 16 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-graph-${{ inputs.cache-key-prefix }} 17 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 18 | 19 | jobs: 20 | groovy-generate: 21 | strategy: 22 | matrix: 23 | os: ${{fromJSON(inputs.runner-os)}} 24 | runs-on: ${{ matrix.os }} 25 | steps: 26 | - name: Checkout sources 27 | uses: actions/checkout@v4 28 | - name: Setup Gradle for dependency-graph generate 29 | uses: ./ 30 | with: 31 | dependency-graph: generate-and-upload 32 | - name: Run gradle build 33 | run: ./gradlew build 34 | working-directory: .github/workflow-samples/groovy-dsl 35 | 36 | kotlin-generate: 37 | strategy: 38 | matrix: 39 | os: ${{fromJSON(inputs.runner-os)}} 40 | runs-on: ${{ matrix.os }} 41 | steps: 42 | - name: Checkout sources 43 | uses: actions/checkout@v4 44 | - name: Setup Gradle for dependency-graph generate 45 | uses: ./ 46 | with: 47 | dependency-graph: generate-and-submit 48 | - name: Run gradle build 49 | run: ./gradlew build 50 | working-directory: .github/workflow-samples/kotlin-dsl 51 | 52 | submit: 53 | needs: [groovy-generate] 54 | runs-on: "ubuntu-latest" 55 | steps: 56 | - name: Checkout sources 57 | uses: actions/checkout@v4 58 | - name: Submit dependency graphs 59 | uses: ./ 60 | with: 61 | dependency-graph: download-and-submit 62 | 63 | multiple-builds: 64 | strategy: 65 | matrix: 66 | os: ${{fromJSON(inputs.runner-os)}} 67 | runs-on: ${{ matrix.os }} 68 | steps: 69 | - name: Checkout sources 70 | uses: actions/checkout@v4 71 | - name: Setup Gradle for dependency-graph generate 72 | uses: ./ 73 | with: 74 | dependency-graph: generate-and-submit 75 | - id: gradle-assemble 76 | run: ./gradlew assemble 77 | working-directory: .github/workflow-samples/groovy-dsl 78 | - id: gradle-build 79 | run: ./gradlew build 80 | working-directory: .github/workflow-samples/groovy-dsl 81 | - id: gradle-build-again 82 | run: ./gradlew build 83 | working-directory: .github/workflow-samples/groovy-dsl 84 | - name: Check generated dependency graphs 85 | shell: bash 86 | run: | 87 | echo "gradle-assemble report file: ${{ steps.gradle-assemble.outputs.dependency-graph-file }}" 88 | echo "gradle-build report file: ${{ steps.gradle-build.outputs.dependency-graph-file }}" 89 | echo "gradle-build-again report file: ${{ steps.gradle-build-again.outputs.dependency-graph-file }}" 90 | ls -l dependency-graph-reports 91 | if [ ! -e "${{ steps.gradle-assemble.outputs.dependency-graph-file }}" ]; then 92 | echo "Did not find gradle-assemble dependency graph file" 93 | exit 1 94 | fi 95 | if [ ! -e "${{ steps.gradle-build.outputs.dependency-graph-file }}" ]; then 96 | echo "Did not find gradle-build dependency graph files" 97 | exit 1 98 | fi 99 | if [ ! -e "${{ steps.gradle-build-again.outputs.dependency-graph-file }}" ]; then 100 | echo "Did not find gradle-build-again dependency graph files" 101 | exit 1 102 | fi 103 | 104 | config-cache: 105 | runs-on: ubuntu-latest 106 | steps: 107 | - name: Checkout sources 108 | uses: actions/checkout@v4 109 | - name: Setup Gradle for dependency-graph generate 110 | uses: ./ 111 | with: 112 | dependency-graph: generate-and-submit 113 | - id: config-cache-store 114 | run: ./gradlew assemble --configuration-cache 115 | working-directory: .github/workflow-samples/groovy-dsl 116 | - name: Check and delete generated dependency graph 117 | shell: bash 118 | run: | 119 | if [ ! -e "${{ steps.config-cache-store.outputs.dependency-graph-file }}" ]; then 120 | echo "Did not find config-cache-store dependency graph files" 121 | exit 1 122 | fi 123 | rm ${{ steps.config-cache-store.outputs.dependency-graph-file }} 124 | - id: config-cache-reuse 125 | run: ./gradlew assemble --configuration-cache 126 | working-directory: .github/workflow-samples/groovy-dsl 127 | - name: Check no dependency graph is generated 128 | shell: bash 129 | run: | 130 | if [ ! -z "$(ls -A dependency-graph-reports)" ]; then 131 | echo "Expected no dependency graph files to be generated" 132 | ls -l dependency-graph-reports 133 | exit 1 134 | fi 135 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-detect-java-toolchains.yml: -------------------------------------------------------------------------------- 1 | name: Test detect java toolchains 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: detect-java-toolchain-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | # Test that pre-installed runner JDKs are detected 18 | pre-installed-toolchains: 19 | strategy: 20 | fail-fast: false 21 | matrix: 22 | os: ${{fromJSON(inputs.runner-os)}} 23 | runs-on: ${{ matrix.os }} 24 | steps: 25 | - name: Checkout sources 26 | uses: actions/checkout@v4 27 | - name: Setup Gradle 28 | uses: ./ 29 | - name: List detected toolchains 30 | shell: bash 31 | working-directory: .github/workflow-samples/groovy-dsl 32 | run: | 33 | gradle --info javaToolchains > output.txt 34 | cat output.txt 35 | - name: Verify detected toolchains 36 | shell: bash 37 | working-directory: .github/workflow-samples/groovy-dsl 38 | run: | 39 | grep -q 'Eclipse Temurin JDK 1.8' output.txt || (echo "::error::Did not detect preinstalled JDK 1.8" && exit 1) 40 | grep -q 'Eclipse Temurin JDK 11' output.txt || (echo "::error::Did not detect preinstalled JDK 11" && exit 1) 41 | grep -q 'Eclipse Temurin JDK 17' output.txt || (echo "::error::Did not detect preinstalled JDK 17" && exit 1) 42 | grep -q 'Eclipse Temurin JDK 21' output.txt || (echo "::error::Did not detect preinstalled JDK 21" && exit 1) 43 | 44 | # Test that JDKs provisioned by setup-java are detected 45 | setup-java-installed-toolchain: 46 | strategy: 47 | fail-fast: false 48 | matrix: 49 | os: ${{fromJSON(inputs.runner-os)}} 50 | runs-on: ${{ matrix.os }} 51 | steps: 52 | - name: Checkout sources 53 | uses: actions/checkout@v4 54 | - name: Setup Java 20 55 | uses: actions/setup-java@v4 56 | with: 57 | distribution: 'temurin' 58 | java-version: '20' 59 | - name: Setup Java 16 60 | uses: actions/setup-java@v4 61 | with: 62 | distribution: 'temurin' 63 | java-version: '16' 64 | - name: Setup Gradle 65 | uses: ./ 66 | - name: List detected toolchains 67 | shell: bash 68 | working-directory: .github/workflow-samples/groovy-dsl 69 | run: | 70 | gradle --info javaToolchains > output.txt 71 | cat output.txt 72 | - name: Verify setup JDKs are detected 73 | shell: bash 74 | working-directory: .github/workflow-samples/groovy-dsl 75 | run: | 76 | grep -q 'Eclipse Temurin JDK 16' output.txt || (echo "::error::Did not detect setup-java installed JDK 16" && exit 1) 77 | grep -q 'Eclipse Temurin JDK 20' output.txt || (echo "::error::Did not detect setup-java installed JDK 20" && exit 1) 78 | - name: Verify pre-installed toolchains are detected 79 | shell: bash 80 | working-directory: .github/workflow-samples/groovy-dsl 81 | run: | 82 | grep -q 'Eclipse Temurin JDK 1.8' output.txt || (echo "::error::Did not detect preinstalled JDK 1.8" && exit 1) 83 | grep -q 'Eclipse Temurin JDK 11' output.txt || (echo "::error::Did not detect preinstalled JDK 11" && exit 1) 84 | grep -q 'Eclipse Temurin JDK 17' output.txt || (echo "::error::Did not detect preinstalled JDK 17" && exit 1) 85 | grep -q 'Eclipse Temurin JDK 21' output.txt || (echo "::error::Did not detect preinstalled JDK 21" && exit 1) 86 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-execution-with-caching.yml: -------------------------------------------------------------------------------- 1 | name: Test execution with caching 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: execution-with-caching-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | seed-build: 18 | strategy: 19 | matrix: 20 | os: ${{fromJSON(inputs.runner-os)}} 21 | runs-on: ${{ matrix.os }} 22 | steps: 23 | - name: Checkout sources 24 | uses: actions/checkout@v4 25 | - name: Execute Gradle build 26 | uses: ./ 27 | with: 28 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 29 | build-root-directory: .github/workflow-samples/groovy-dsl 30 | arguments: test 31 | 32 | # Test that the gradle-user-home is restored 33 | verify-build: 34 | needs: seed-build 35 | strategy: 36 | matrix: 37 | os: ${{fromJSON(inputs.runner-os)}} 38 | runs-on: ${{ matrix.os }} 39 | steps: 40 | - name: Checkout sources 41 | uses: actions/checkout@v4 42 | - name: Execute Gradle build 43 | uses: ./ 44 | with: 45 | cache-read-only: true 46 | build-root-directory: .github/workflow-samples/groovy-dsl 47 | arguments: test --offline -DverifyCachedBuild=true 48 | 49 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-execution.yml: -------------------------------------------------------------------------------- 1 | name: Test execution 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: execution-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | # Tests for executing with different Gradle versions. 18 | # Each build verifies that it is executed with the expected Gradle version. 19 | gradle-execution: 20 | strategy: 21 | matrix: 22 | os: ${{fromJSON(inputs.runner-os)}} 23 | include: 24 | - os: windows-latest 25 | script-suffix: '.bat' 26 | runs-on: ${{ matrix.os }} 27 | steps: 28 | - name: Checkout sources 29 | uses: actions/checkout@v4 30 | - name: Test use defined Gradle version 31 | uses: ./ 32 | with: 33 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 34 | gradle-version: 6.9 35 | build-root-directory: .github/workflow-samples/no-wrapper 36 | arguments: help -DgradleVersionCheck=6.9 37 | - name: Test use Gradle version alias 38 | uses: ./ 39 | with: 40 | gradle-version: release-candidate 41 | build-root-directory: .github/workflow-samples/no-wrapper 42 | arguments: help 43 | 44 | gradle-versions: 45 | strategy: 46 | matrix: 47 | gradle: [7.5.1, 6.9.2, 5.6.4, 4.10.3, 3.5.1] 48 | os: ${{fromJSON(inputs.runner-os)}} 49 | include: 50 | - gradle: 5.6.4 51 | build-root-suffix: -gradle-5 52 | - gradle: 4.10.3 53 | build-root-suffix: -gradle-4 54 | - gradle: 3.5.1 55 | build-root-suffix: -gradle-4 56 | runs-on: ${{ matrix.os }} 57 | steps: 58 | - name: Checkout sources 59 | uses: actions/checkout@v4 60 | - name: Setup Java 61 | uses: actions/setup-java@v4 62 | with: 63 | distribution: temurin 64 | java-version: 8 65 | - name: Run Gradle build 66 | uses: ./ 67 | id: gradle 68 | with: 69 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 70 | gradle-version: ${{matrix.gradle}} 71 | build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }} 72 | arguments: help -DgradleVersionCheck=${{matrix.gradle}} 73 | - name: Check Build Scan url 74 | if: ${{ !steps.gradle.outputs.build-scan-url }} 75 | uses: actions/github-script@v7 76 | with: 77 | script: | 78 | core.setFailed('No Build Scan detected') 79 | 80 | 81 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-inject-develocity.yml: -------------------------------------------------------------------------------- 1 | name: Test develocity injection 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | secrets: 12 | DEVELOCITY_ACCESS_KEY: 13 | required: true 14 | 15 | env: 16 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: provision-gradle-versions-${{ inputs.cache-key-prefix }} 17 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 18 | 19 | jobs: 20 | inject-develocity: 21 | env: 22 | DEVELOCITY_INJECTION_ENABLED: true 23 | DEVELOCITY_URL: https://ge.solutions-team.gradle.com 24 | DEVELOCITY_PLUGIN_VERSION: 3.16.2 25 | DEVELOCITY_CCUD_PLUGIN_VERSION: 1.13 26 | GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} # This env var has not (yet) been renamed/aliased in GE plugin 3.16.2 27 | strategy: 28 | matrix: 29 | gradle: [current, 7.6.2, 6.9.4, 5.6.4] 30 | os: ${{fromJSON(inputs.runner-os)}} 31 | runs-on: ubuntu-latest 32 | steps: 33 | - name: Checkout sources 34 | uses: actions/checkout@v4 35 | - name: Setup Java 36 | uses: actions/setup-java@v4 37 | with: 38 | distribution: temurin 39 | java-version: 8 40 | - name: Setup Gradle 41 | id: setup-gradle 42 | uses: ./ 43 | with: 44 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 45 | gradle-version: ${{ matrix.gradle }} 46 | - name: Run Gradle build 47 | id: gradle 48 | working-directory: .github/workflow-samples/no-ge 49 | run: gradle help 50 | - name: Check Build Scan url 51 | if: ${{ !steps.gradle.outputs.build-scan-url }} 52 | uses: actions/github-script@v7 53 | with: 54 | script: | 55 | core.setFailed('No Build Scan detected') 56 | 57 | build-scan-publish: 58 | strategy: 59 | matrix: 60 | gradle: [current, 7.6.2, 6.9.4, 5.6.4] 61 | runs-on: ubuntu-latest 62 | steps: 63 | - name: Checkout sources 64 | uses: actions/checkout@v4 65 | - name: Setup Java 66 | uses: actions/setup-java@v4 67 | with: 68 | distribution: temurin 69 | java-version: 8 70 | - name: Setup Gradle 71 | id: setup-gradle 72 | uses: ./ 73 | with: 74 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 75 | gradle-version: ${{ matrix.gradle }} 76 | build-scan-publish: true 77 | build-scan-terms-of-service-url: "https://gradle.com/terms-of-service" 78 | build-scan-terms-of-service-agree: "yes" 79 | - name: Run Gradle build 80 | id: gradle 81 | working-directory: .github/workflow-samples/no-ge 82 | run: gradle help 83 | - name: Check Build Scan url 84 | if: ${{ !steps.gradle.outputs.build-scan-url }} 85 | uses: actions/github-script@v7 86 | with: 87 | script: | 88 | core.setFailed('No Build Scan detected') 89 | 90 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-provision-gradle-versions.yml: -------------------------------------------------------------------------------- 1 | name: Test provision Gradle versions 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: provision-gradle-versions-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | # Tests for executing with different Gradle versions. 18 | # Each build verifies that it is executed with the expected Gradle version. 19 | provision-gradle: 20 | strategy: 21 | matrix: 22 | os: ${{fromJSON(inputs.runner-os)}} 23 | include: 24 | - os: windows-latest 25 | script-suffix: '.bat' 26 | runs-on: ${{ matrix.os }} 27 | steps: 28 | - name: Checkout sources 29 | uses: actions/checkout@v4 30 | - name: Setup Gradle with v6.9 31 | uses: ./ 32 | with: 33 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 34 | gradle-version: 6.9 35 | - name: Test uses Gradle v6.9 36 | working-directory: .github/workflow-samples/no-wrapper 37 | run: gradle help "-DgradleVersionCheck=6.9" 38 | - name: Setup Gradle with v7.1.1 39 | uses: ./ 40 | with: 41 | gradle-version: 7.1.1 42 | - name: Test uses Gradle v7.1.1 43 | working-directory: .github/workflow-samples/no-wrapper 44 | run: gradle help "-DgradleVersionCheck=7.1.1" 45 | - name: Setup Gradle with release-candidate 46 | uses: ./ 47 | with: 48 | gradle-version: release-candidate 49 | - name: Test use release-candidate 50 | working-directory: .github/workflow-samples/no-wrapper 51 | run: gradle help 52 | - name: Setup Gradle with current 53 | id: gradle-current 54 | uses: ./ 55 | with: 56 | gradle-version: current 57 | - name: Check current version output parameter 58 | if: ${{ !startsWith(steps.gradle-current.outputs.gradle-version , '8.') }} 59 | uses: actions/github-script@v7 60 | with: 61 | script: | 62 | core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.gradle-current.outputs.gradle-version }}"') 63 | 64 | gradle-versions: 65 | strategy: 66 | matrix: 67 | gradle: [7.3, 6.9, 5.6.4, 4.10.3, 3.5.1] 68 | os: ${{fromJSON(inputs.runner-os)}} 69 | include: 70 | - gradle: 5.6.4 71 | build-root-suffix: -gradle-5 72 | - gradle: 4.10.3 73 | build-root-suffix: -gradle-4 74 | - gradle: 3.5.1 75 | build-root-suffix: -gradle-4 76 | runs-on: ${{ matrix.os }} 77 | steps: 78 | - name: Checkout sources 79 | uses: actions/checkout@v4 80 | - name: Setup Java 81 | uses: actions/setup-java@v4 82 | with: 83 | distribution: temurin 84 | java-version: 8 85 | - name: Setup Gradle 86 | id: setup-gradle 87 | uses: ./ 88 | with: 89 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 90 | gradle-version: ${{ matrix.gradle }} 91 | - name: Check output parameter 92 | if: ${{ steps.setup-gradle.outputs.gradle-version != matrix.gradle }} 93 | uses: actions/github-script@v7 94 | with: 95 | script: | 96 | core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.setup-gradle.outputs.gradle-version }}"') 97 | - name: Run Gradle build 98 | id: gradle 99 | working-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }} 100 | run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}" 101 | - name: Check Build Scan url 102 | if: ${{ !steps.gradle.outputs.build-scan-url }} 103 | uses: actions/github-script@v7 104 | with: 105 | script: | 106 | core.setFailed('No Build Scan detected') 107 | 108 | 109 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-restore-configuration-cache.yml: -------------------------------------------------------------------------------- 1 | name: Test restore configuration-cache 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | secrets: 12 | GRADLE_ENCRYPTION_KEY: 13 | required: true 14 | 15 | env: 16 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-configuration-cache-${{ inputs.cache-key-prefix }} 17 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 18 | 19 | jobs: 20 | seed-build-groovy: 21 | env: 22 | GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-groovy 23 | strategy: 24 | matrix: 25 | os: ${{fromJSON(inputs.runner-os)}} 26 | runs-on: ${{ matrix.os }} 27 | steps: 28 | - name: Checkout sources 29 | uses: actions/checkout@v4 30 | - name: Setup Java to ensure consistency 31 | uses: actions/setup-java@v4 32 | with: 33 | distribution: 'liberica' 34 | java-version: '21' 35 | - name: Setup Gradle 36 | uses: ./ 37 | with: 38 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 39 | cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 40 | gradle-version: 8.6-rc-1 41 | - name: Groovy build with configuration-cache enabled 42 | working-directory: .github/workflow-samples/groovy-dsl 43 | run: gradle test --configuration-cache 44 | 45 | verify-build-groovy: 46 | env: 47 | GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-groovy 48 | needs: seed-build-groovy 49 | strategy: 50 | matrix: 51 | os: ${{fromJSON(inputs.runner-os)}} 52 | runs-on: ${{ matrix.os }} 53 | steps: 54 | - name: Checkout sources 55 | uses: actions/checkout@v4 56 | - name: Setup Java to ensure consistency 57 | uses: actions/setup-java@v4 58 | with: 59 | distribution: 'liberica' 60 | java-version: '21' 61 | - name: Setup Gradle 62 | uses: ./ 63 | with: 64 | cache-read-only: true 65 | cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 66 | gradle-version: 8.6-rc-1 67 | - name: Groovy build with configuration-cache enabled 68 | id: execute 69 | working-directory: .github/workflow-samples/groovy-dsl 70 | run: gradle test --configuration-cache 71 | - name: Check that configuration-cache was used 72 | uses: actions/github-script@v7 73 | with: 74 | script: | 75 | const fs = require('fs') 76 | if (fs.existsSync('.github/workflow-samples/groovy-dsl/task-configured.txt')) { 77 | core.setFailed('Configuration cache was not used - task was configured unexpectedly') 78 | } 79 | 80 | # Check that the build can run when no extracted cache entries are restored 81 | gradle-user-home-not-fully-restored: 82 | env: 83 | GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-groovy 84 | needs: seed-build-groovy 85 | strategy: 86 | matrix: 87 | os: ${{fromJSON(inputs.runner-os)}} 88 | runs-on: ${{ matrix.os }} 89 | steps: 90 | - name: Checkout sources 91 | uses: actions/checkout@v4 92 | - name: Setup Java to ensure consistency 93 | uses: actions/setup-java@v4 94 | with: 95 | distribution: 'liberica' 96 | java-version: '21' 97 | - name: Setup Gradle with no extracted cache entries restored 98 | uses: ./ 99 | env: 100 | GRADLE_BUILD_ACTION_SKIP_RESTORE: "generated-gradle-jars|wrapper-zips|java-toolchains|instrumented-jars|dependencies|kotlin-dsl" 101 | with: 102 | cache-read-only: true 103 | cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 104 | gradle-version: 8.6-rc-1 105 | - name: Check execute Gradle build with configuration cache enabled (but not restored) 106 | working-directory: .github/workflow-samples/groovy-dsl 107 | run: gradle test --configuration-cache 108 | 109 | seed-build-kotlin: 110 | env: 111 | GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-kotlin 112 | strategy: 113 | matrix: 114 | os: ${{fromJSON(inputs.runner-os)}} 115 | runs-on: ${{ matrix.os }} 116 | steps: 117 | - name: Checkout sources 118 | uses: actions/checkout@v4 119 | - name: Setup Java to ensure consistency 120 | uses: actions/setup-java@v4 121 | with: 122 | distribution: 'liberica' 123 | java-version: '21' 124 | - name: Setup Gradle 125 | uses: ./ 126 | with: 127 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 128 | cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 129 | gradle-version: 8.6-rc-1 130 | - name: Execute 'help' with configuration-cache enabled 131 | working-directory: .github/workflow-samples/kotlin-dsl 132 | run: gradle help --configuration-cache 133 | 134 | modify-build-kotlin: 135 | env: 136 | GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-kotlin-modified 137 | needs: seed-build-kotlin 138 | strategy: 139 | matrix: 140 | os: ${{fromJSON(inputs.runner-os)}} 141 | runs-on: ${{ matrix.os }} 142 | steps: 143 | - name: Checkout sources 144 | uses: actions/checkout@v4 145 | - name: Setup Java to ensure consistency 146 | uses: actions/setup-java@v4 147 | with: 148 | distribution: 'liberica' 149 | java-version: '21' 150 | - name: Setup Gradle 151 | uses: ./ 152 | with: 153 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 154 | cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 155 | gradle-version: 8.6-rc-1 156 | - name: Execute 'test' with configuration-cache enabled 157 | working-directory: .github/workflow-samples/kotlin-dsl 158 | run: gradle test --configuration-cache 159 | 160 | # Test restore configuration-cache from the third build invocation 161 | verify-build-kotlin: 162 | env: 163 | GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-kotlin-modified 164 | needs: modify-build-kotlin 165 | strategy: 166 | matrix: 167 | os: ${{fromJSON(inputs.runner-os)}} 168 | runs-on: ${{ matrix.os }} 169 | steps: 170 | - name: Checkout sources 171 | uses: actions/checkout@v4 172 | - name: Setup Java to ensure consistency 173 | uses: actions/setup-java@v4 174 | with: 175 | distribution: 'liberica' 176 | java-version: '21' 177 | - name: Setup Gradle 178 | uses: ./ 179 | with: 180 | cache-read-only: true 181 | cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }} 182 | gradle-version: 8.6-rc-1 183 | - name: Execute 'test' again with configuration-cache enabled 184 | id: execute 185 | working-directory: .github/workflow-samples/kotlin-dsl 186 | run: gradle test --configuration-cache 187 | - name: Check that configuration-cache was used 188 | uses: actions/github-script@v7 189 | with: 190 | script: | 191 | const fs = require('fs') 192 | if (fs.existsSync('.github/workflow-samples/kotlin-dsl/task-configured.txt')) { 193 | core.setFailed('Configuration cache was not used - task was configured unexpectedly') 194 | } 195 | 196 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-restore-containerized-gradle-home.yml: -------------------------------------------------------------------------------- 1 | name: Test restore custom Gradle Home 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | 9 | env: 10 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-custom-gradle-home-${{ inputs.cache-key-prefix }} 11 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 12 | 13 | jobs: 14 | seed-build: 15 | runs-on: ubuntu-latest 16 | container: fedora:latest 17 | steps: 18 | - name: Checkout sources 19 | uses: actions/checkout@v4 20 | - name: Setup Java 21 | uses: actions/setup-java@v4 22 | with: 23 | java-version: 11 24 | distribution: temurin 25 | - name: Setup Gradle 26 | uses: ./ 27 | with: 28 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 29 | - name: Build using Gradle wrapper 30 | working-directory: .github/workflow-samples/groovy-dsl 31 | run: ./gradlew test 32 | 33 | # Test that the gradle-user-home cache will cache dependencies, by running build with --offline 34 | dependencies-cache: 35 | needs: seed-build 36 | runs-on: ubuntu-latest 37 | container: fedora:latest 38 | steps: 39 | - name: Checkout sources 40 | uses: actions/checkout@v4 41 | - name: Setup Java 42 | uses: actions/setup-java@v4 43 | with: 44 | java-version: 11 45 | distribution: temurin 46 | - name: Setup Gradle 47 | uses: ./ 48 | with: 49 | cache-read-only: true 50 | - name: Execute Gradle build with --offline 51 | working-directory: .github/workflow-samples/groovy-dsl 52 | run: ./gradlew test --offline -------------------------------------------------------------------------------- /.github/workflows/integ-test-restore-custom-gradle-home.yml: -------------------------------------------------------------------------------- 1 | name: Test restore custom Gradle Home 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | 9 | env: 10 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-custom-gradle-home-${{ inputs.cache-key-prefix }} 11 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 12 | 13 | jobs: 14 | seed-build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Set Gradle User Home 18 | run: | 19 | mkdir -p $GITHUB_WORKSPACE/gradle-user-home 20 | echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV 21 | - name: Checkout sources 22 | uses: actions/checkout@v4 23 | - name: Setup Gradle 24 | uses: ./ 25 | with: 26 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 27 | - name: Build using Gradle wrapper 28 | working-directory: .github/workflow-samples/groovy-dsl 29 | run: ./gradlew test --info 30 | 31 | # Test that the gradle-user-home cache will cache dependencies, by running build with --offline 32 | dependencies-cache: 33 | needs: seed-build 34 | runs-on: ubuntu-latest 35 | steps: 36 | - name: Set Gradle User Home 37 | run: | 38 | mkdir -p $GITHUB_WORKSPACE/gradle-user-home 39 | echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV 40 | - name: Checkout sources 41 | uses: actions/checkout@v4 42 | - name: Setup Gradle 43 | uses: ./ 44 | with: 45 | cache-read-only: true 46 | - name: Execute Gradle build with --offline 47 | working-directory: .github/workflow-samples/groovy-dsl 48 | run: ./gradlew test --offline --info 49 | 50 | # Test that the gradle-user-home cache will cache and restore local build-cache 51 | build-cache: 52 | needs: seed-build 53 | runs-on: ubuntu-latest 54 | steps: 55 | - name: Set Gradle User Home 56 | run: | 57 | mkdir -p $GITHUB_WORKSPACE/gradle-user-home 58 | echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV 59 | - name: Checkout sources 60 | uses: actions/checkout@v4 61 | - name: Setup Gradle 62 | uses: ./ 63 | with: 64 | cache-read-only: true 65 | - name: Execute Gradle build and verify tasks from cache 66 | working-directory: .github/workflow-samples/groovy-dsl 67 | run: ./gradlew test -DverifyCachedBuild=true --info 68 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-restore-gradle-home.yml: -------------------------------------------------------------------------------- 1 | name: Test restore Gradle Home 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-gradle-home-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-gradle-home 15 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 16 | 17 | jobs: 18 | seed-build: 19 | strategy: 20 | matrix: 21 | os: ${{fromJSON(inputs.runner-os)}} 22 | runs-on: ${{ matrix.os }} 23 | steps: 24 | - name: Checkout sources 25 | uses: actions/checkout@v4 26 | - name: Setup Gradle 27 | uses: ./ 28 | with: 29 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 30 | - name: Build using Gradle wrapper 31 | working-directory: .github/workflow-samples/groovy-dsl 32 | run: ./gradlew test 33 | 34 | # Test that the gradle-user-home cache will cache dependencies, by running build with --offline 35 | dependencies-cache: 36 | needs: seed-build 37 | strategy: 38 | matrix: 39 | os: ${{fromJSON(inputs.runner-os)}} 40 | runs-on: ${{ matrix.os }} 41 | steps: 42 | - name: Checkout sources 43 | uses: actions/checkout@v4 44 | - name: Setup Gradle 45 | uses: ./ 46 | with: 47 | cache-read-only: true 48 | - name: Execute Gradle build with --offline 49 | working-directory: .github/workflow-samples/groovy-dsl 50 | run: ./gradlew test --offline 51 | 52 | # Test that the gradle-user-home cache will cache and restore local build-cache 53 | build-cache: 54 | needs: seed-build 55 | strategy: 56 | matrix: 57 | os: ${{fromJSON(inputs.runner-os)}} 58 | runs-on: ${{ matrix.os }} 59 | steps: 60 | - name: Checkout sources 61 | uses: actions/checkout@v4 62 | - name: Setup Gradle 63 | uses: ./ 64 | with: 65 | cache-read-only: true 66 | - name: Execute Gradle build and verify tasks from cache 67 | working-directory: .github/workflow-samples/groovy-dsl 68 | run: ./gradlew test -DverifyCachedBuild=true 69 | 70 | # Check that the build can run when Gradle User Home is not fully restored 71 | no-extracted-cache-entries-restored: 72 | needs: seed-build 73 | strategy: 74 | matrix: 75 | os: ${{fromJSON(inputs.runner-os)}} 76 | runs-on: ${{ matrix.os }} 77 | steps: 78 | - name: Checkout sources 79 | uses: actions/checkout@v4 80 | - name: Setup Gradle with no extracted cache entries restored 81 | uses: ./ 82 | env: 83 | GRADLE_BUILD_ACTION_SKIP_RESTORE: "generated-gradle-jars|wrapper-zips|java-toolchains|instrumented-jars|dependencies|kotlin-dsl" 84 | with: 85 | cache-read-only: true 86 | - name: Check executee Gradle build 87 | working-directory: .github/workflow-samples/groovy-dsl 88 | run: ./gradlew test 89 | 90 | # Test that a pre-existing gradle-user-home can be overwritten by the restored cache 91 | pre-existing-gradle-home: 92 | needs: seed-build 93 | strategy: 94 | matrix: 95 | os: ${{fromJSON(inputs.runner-os)}} 96 | runs-on: ${{ matrix.os }} 97 | steps: 98 | - name: Checkout sources 99 | uses: actions/checkout@v4 100 | - name: Pre-create Gradle User Home 101 | shell: bash 102 | run: | 103 | mkdir -p ~/.gradle/caches 104 | touch ~/.gradle/gradle.properties 105 | touch ~/.gradle/caches/dummy.txt 106 | - name: Setup Gradle 107 | uses: ./ 108 | with: 109 | cache-read-only: true 110 | cache-overwrite-existing: true 111 | - name: Check that pre-existing content still exists 112 | shell: bash 113 | run: | 114 | if [ ! -e ~/.gradle/caches/dummy.txt ]; then 115 | echo "::error ::Should find dummy.txt after cache restore" 116 | exit 1 117 | fi 118 | if [ ! -e ~/.gradle/gradle.properties ]; then 119 | echo "::error ::Should find gradle.properties after cache restore" 120 | exit 1 121 | fi 122 | - name: Execute Gradle build with --offline 123 | working-directory: .github/workflow-samples/groovy-dsl 124 | run: ./gradlew test --offline 125 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-restore-java-toolchain.yml: -------------------------------------------------------------------------------- 1 | name: Test restore java toolchains 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-java-toolchain-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | seed-build: 18 | strategy: 19 | matrix: 20 | os: ${{fromJSON(inputs.runner-os)}} 21 | runs-on: ${{ matrix.os }} 22 | steps: 23 | - name: Checkout sources 24 | uses: actions/checkout@v4 25 | - name: Setup Gradle 26 | uses: ./ 27 | with: 28 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 29 | - name: Build using Gradle wrapper 30 | working-directory: .github/workflow-samples/java-toolchain 31 | run: ./gradlew test --info 32 | 33 | # Test that the gradle-user-home cache will cache the toolchain, by running build with --offline 34 | toolchain-cache: 35 | needs: seed-build 36 | strategy: 37 | matrix: 38 | os: ${{fromJSON(inputs.runner-os)}} 39 | runs-on: ${{ matrix.os }} 40 | steps: 41 | - name: Checkout sources 42 | uses: actions/checkout@v4 43 | - name: Setup Gradle 44 | uses: ./ 45 | with: 46 | cache-read-only: true 47 | - name: Execute Gradle build with --offline 48 | working-directory: .github/workflow-samples/java-toolchain 49 | run: ./gradlew test --info --offline 50 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-sample-gradle-plugin.yml: -------------------------------------------------------------------------------- 1 | name: Test sample Gradle Plugin project 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: sample-gradle-plugin-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | seed-build: 18 | strategy: 19 | matrix: 20 | os: ${{fromJSON(inputs.runner-os)}} 21 | runs-on: ${{ matrix.os }} 22 | steps: 23 | - name: Checkout sources 24 | uses: actions/checkout@v4 25 | - name: Setup Gradle 26 | uses: ./ 27 | with: 28 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 29 | - name: Build gradle-plugin project 30 | working-directory: .github/workflow-samples/gradle-plugin 31 | run: ./gradlew build 32 | 33 | verify-build: 34 | needs: seed-build 35 | strategy: 36 | matrix: 37 | os: ${{fromJSON(inputs.runner-os)}} 38 | runs-on: ${{ matrix.os }} 39 | steps: 40 | - name: Checkout sources 41 | uses: actions/checkout@v4 42 | - name: Setup Gradle 43 | uses: ./ 44 | with: 45 | cache-read-only: true 46 | - name: Build gradle-plugin project 47 | working-directory: .github/workflow-samples/gradle-plugin 48 | run: ./gradlew build --offline 49 | -------------------------------------------------------------------------------- /.github/workflows/integ-test-sample-kotlin-dsl.yml: -------------------------------------------------------------------------------- 1 | name: Test sample Kotlin DSL project 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-key-prefix: 7 | type: string 8 | runner-os: 9 | type: string 10 | default: '["ubuntu-latest", "windows-latest", "macos-latest"]' 11 | 12 | env: 13 | GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: sample-kotlin-dsl-${{ inputs.cache-key-prefix }} 14 | GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true 15 | 16 | jobs: 17 | seed-build: 18 | strategy: 19 | matrix: 20 | os: ${{fromJSON(inputs.runner-os)}} 21 | runs-on: ${{ matrix.os }} 22 | steps: 23 | - name: Checkout sources 24 | uses: actions/checkout@v4 25 | - name: Setup Gradle 26 | uses: ./ 27 | with: 28 | cache-read-only: false # For testing, allow writing cache entries on non-default branches 29 | - name: Build kotlin-dsl project 30 | working-directory: .github/workflow-samples/kotlin-dsl 31 | run: ./gradlew build 32 | 33 | verify-build: 34 | needs: seed-build 35 | strategy: 36 | matrix: 37 | os: ${{fromJSON(inputs.runner-os)}} 38 | runs-on: ${{ matrix.os }} 39 | steps: 40 | - name: Checkout sources 41 | uses: actions/checkout@v4 42 | - name: Setup Gradle 43 | uses: ./ 44 | with: 45 | cache-read-only: true 46 | - name: Build kotlin-dsl project 47 | working-directory: .github/workflow-samples/kotlin-dsl 48 | run: ./gradlew build --offline 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependency directory 2 | node_modules 3 | 4 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # Diagnostic reports (https://nodejs.org/api/report.html) 14 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 15 | 16 | # Runtime data 17 | pids 18 | *.pid 19 | *.seed 20 | *.pid.lock 21 | 22 | # Directory for instrumented libs generated by jscoverage/JSCover 23 | lib-cov 24 | 25 | # Coverage directory used by tools like istanbul 26 | coverage 27 | *.lcov 28 | 29 | # nyc test coverage 30 | .nyc_output 31 | 32 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # Bower dependency directory (https://bower.io/) 36 | bower_components 37 | 38 | # node-waf configuration 39 | .lock-wscript 40 | 41 | # Compiled binary addons (https://nodejs.org/api/addons.html) 42 | build/Release 43 | 44 | # Dependency directories 45 | jspm_packages/ 46 | 47 | # TypeScript v1 declaration files 48 | typings/ 49 | 50 | # TypeScript cache 51 | *.tsbuildinfo 52 | 53 | # Optional npm cache directory 54 | .npm 55 | 56 | # Optional eslint cache 57 | .eslintcache 58 | 59 | # Optional REPL history 60 | .node_repl_history 61 | 62 | # Output of 'npm pack' 63 | *.tgz 64 | 65 | # Yarn Integrity file 66 | .yarn-integrity 67 | 68 | # dotenv environment variables file 69 | .env 70 | .env.test 71 | 72 | # parcel-bundler cache (https://parceljs.org/) 73 | .cache 74 | 75 | # next.js build output 76 | .next 77 | 78 | # nuxt.js build output 79 | .nuxt 80 | 81 | # vuepress build output 82 | .vuepress/dist 83 | 84 | # Serverless directories 85 | .serverless/ 86 | 87 | # FuseBox cache 88 | .fusebox/ 89 | 90 | # DynamoDB Local files 91 | .dynamodb/ 92 | 93 | # OS metadata 94 | .DS_Store 95 | Thumbs.db 96 | 97 | # Ignore built ts files 98 | __tests__/runner/* 99 | # lib/**/* 100 | 101 | # IntelliJ IDEA config files 102 | .idea/ 103 | *.iml 104 | 105 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at paul@nosphere.org. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2023 Gradle Inc. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > [!IMPORTANT] 2 | > As of `v3` this action has been superceded by `gradle/actions/setup-gradle`. 3 | > Any workflow that uses `gradle/gradle-build-action@v3` will transparently delegate to `gradle/actions/setup-gradle@v3`. 4 | > 5 | > Users are encouraged to update their workflows, replacing: 6 | > ``` 7 | > uses: gradle/gradle-build-action@v3 8 | > ``` 9 | > 10 | > with 11 | > ``` 12 | > uses: gradle/actions/setup-gradle@v3 13 | > ``` 14 | > 15 | > See the [setup-gradle documentation](https://github.com/gradle/actions/tree/main/setup-gradle) for up-to-date documentation for `gradle/actions/setup-gradle`. 16 | 17 | # Setup Gradle for use in GitHub Actions workflows 18 | 19 | This GitHub Action can be used to configure Gradle on any platform supported by GitHub Actions. 20 | 21 | ## Example usage 22 | 23 | ```yaml 24 | name: Build 25 | 26 | on: [ push ] 27 | 28 | jobs: 29 | build: 30 | runs-on: ubuntu-latest 31 | steps: 32 | - name: Checkout sources 33 | uses: actions/checkout@v4 34 | - name: Setup Gradle 35 | uses: gradle/actions/setup-gradle@v3 36 | - name: Build with Gradle 37 | run: ./gradlew build 38 | ``` 39 | 40 | See the [full setup-gradle documentation](https://github.com/gradle/actions/tree/main/setup-gradle) for more advanced usage scenarios. 41 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: setup-gradle 2 | description: 'Configures Gradle for GitHub actions, caching state and generating a dependency graph via Dependency Submission.' 3 | 4 | inputs: 5 | gradle-version: 6 | description: | 7 | Gradle version to use. If specified, this Gradle version will be downloaded, added to the PATH and used for invoking Gradle. 8 | If not provided, it is assumed that the project uses the Gradle Wrapper. 9 | required: false 10 | 11 | # Cache configuration 12 | cache-disabled: 13 | description: When 'true', all caching is disabled. No entries will be written to or read from the cache. 14 | required: false 15 | default: false 16 | 17 | cache-read-only: 18 | description: | 19 | When 'true', existing entries will be read from the cache but no entries will be written. 20 | By default this value is 'false' for workflows on the GitHub default branch and 'true' for workflows on other branches. 21 | required: false 22 | default: ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }} 23 | 24 | cache-write-only: 25 | description: | 26 | When 'true', entries will not be restored from the cache but will be saved at the end of the Job. 27 | Setting this to 'true' implies cache-read-only will be 'false'. 28 | required: false 29 | default: false 30 | 31 | cache-overwrite-existing: 32 | description: When 'true', a pre-existing Gradle User Home will not prevent the cache from being restored. 33 | required: false 34 | default: false 35 | 36 | cache-encryption-key: 37 | description: | 38 | A base64 encoded AES key used to encrypt the configuration-cache data. The key is exported as 'GRADLE_ENCRYPTION_KEY' for later steps. 39 | A suitable key can be generated with `openssl rand -base64 16`. 40 | Configuration-cache data will not be saved/restored without an encryption key being provided. 41 | required: false 42 | 43 | gradle-home-cache-includes: 44 | description: Paths within Gradle User Home to cache. 45 | required: false 46 | default: | 47 | caches 48 | notifications 49 | 50 | gradle-home-cache-excludes: 51 | description: Paths within Gradle User Home to exclude from cache. 52 | required: false 53 | 54 | gradle-home-cache-cleanup: 55 | description: When 'true', the action will attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache. 56 | required: false 57 | default: false 58 | 59 | # Job summary configuration 60 | add-job-summary: 61 | description: Specifies when a Job Summary should be inluded in the action results. Valid values are 'never', 'always' (default), and 'on-failure'. 62 | required: false 63 | default: 'always' 64 | 65 | add-job-summary-as-pr-comment: 66 | description: Specifies when each Job Summary should be added as a PR comment. Valid values are 'never' (default), 'always', and 'on-failure'. No action will be taken if the workflow was not triggered from a pull request. 67 | required: false 68 | default: 'never' 69 | 70 | # Dependency Graph configuration 71 | dependency-graph: 72 | description: | 73 | Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how. 74 | Valid values are 'disabled' (default), 'generate', 'generate-and-submit', 'generate-and-upload', 'download-and-submit' and 'clear'. 75 | required: false 76 | default: 'disabled' 77 | 78 | dependency-graph-continue-on-failure: 79 | description: When 'false' a failure to generate or submit a dependency graph will fail the Step or Job. When 'true' a warning will be emitted but no failure will result. 80 | required: false 81 | default: true 82 | 83 | artifact-retention-days: 84 | description: Specifies the number of days to retain any artifacts generated by the action. If not set, the default retention settings for the repository will apply. 85 | required: false 86 | 87 | # Build Scan configuration 88 | build-scan-publish: 89 | description: | 90 | Set to 'true' to automatically publish build results as a Build Scan on scans.gradle.com. 91 | For publication to succeed without user input, you must also provide values for `build-scan-terms-of-use-url` and 'build-scan-terms-of-use-agree'. 92 | required: false 93 | default: false 94 | 95 | build-scan-terms-of-use-url: 96 | description: The URL to the Build Scan® terms of use. This input must be set to 'https://gradle.com/terms-of-service' or 'https://gradle.com/help/legal-terms-of-use'. 97 | required: false 98 | 99 | build-scan-terms-of-use-agree: 100 | description: Indicate that you agree to the Build Scan® terms of use. This input value must be "yes". 101 | required: false 102 | 103 | develocity-access-key: 104 | description: Develocity access key. Should be set to a secret containing the Develocity Access key. 105 | required: false 106 | 107 | develocity-token-expiry: 108 | description: The Develocity short-lived access tokens expiry in hours. Default is 2 hours. 109 | required: false 110 | 111 | develocity-injection-enabled: 112 | description: Enables Develocity injection. 113 | required: false 114 | 115 | develocity-url: 116 | description: The URL for the Develocity server. 117 | required: false 118 | 119 | develocity-allow-untrusted-server: 120 | description: Allow communication with an untrusted server; set to _true_ if your Develocity instance is using a self-signed. 121 | required: false 122 | 123 | develocity-capture-file-fingerprints: 124 | description: Enables capturing the paths and content hashes of each individual input file. 125 | required: false 126 | 127 | develocity-enforce-url: 128 | description: Enforce the configured Develocity URL over a URL configured in the project's build; set to _true_ to enforce publication of build scans to the configured Develocity URL. 129 | required: false 130 | 131 | develocity-plugin-version: 132 | description: The version of the Develocity Gradle plugin to apply. 133 | required: false 134 | 135 | develocity-ccud-plugin-version: 136 | description: The version of the Common Custom User Data Gradle plugin to apply, if any. 137 | required: false 138 | 139 | gradle-plugin-repository-url: 140 | description: The URL of the repository to use when resolving the Develocity and CCUD plugins; the Gradle Plugin Portal is used by default. 141 | required: false 142 | 143 | gradle-plugin-repository-username: 144 | description: The username for the repository URL to use when resolving the Develocity and CCUD. 145 | required: false 146 | 147 | gradle-plugin-repository-password: 148 | description: The password for the repository URL to use when resolving the Develocity and CCUD plugins; Consider using secrets to pass the value to this variable. 149 | required: false 150 | 151 | # Wrapper validation configuration 152 | validate-wrappers: 153 | description: | 154 | When 'true', the action will perform the 'wrapper-validation' action automatically. 155 | If the wrapper checksums are not valid, the action will fail. 156 | required: false 157 | default: false 158 | 159 | # DEPRECATED ACTION INPUTS 160 | build-scan-terms-of-service-url: 161 | description: The URL to the Build Scan® terms of use. This input must be set to 'https://gradle.com/terms-of-service'. 162 | required: false 163 | deprecation-message: The input has been renamed to align with the Develocity API. Use 'build-scan-terms-of-use-url' instead. 164 | 165 | build-scan-terms-of-service-agree: 166 | description: Indicate that you agree to the Build Scan® terms of use. This input value must be "yes". 167 | required: false 168 | deprecation-message: The input has been renamed to align with the Develocity API. Use 'build-scan-terms-of-use-agree' instead. 169 | 170 | generate-job-summary: 171 | description: When 'false', no Job Summary will be generated for the Job. 172 | required: false 173 | default: true 174 | deprecation-message: Superceded by the new 'add-job-summary' and 'add-job-summary-as-pr-comment' parameters. 175 | 176 | arguments: 177 | description: Gradle command line arguments (supports multi-line input) 178 | required: false 179 | deprecation-message: Using the action to execute Gradle directly is deprecated in favor of using the action to setup Gradle, and executing Gradle in a subsequent Step. 180 | 181 | build-root-directory: 182 | description: Path to the root directory of the build. Default is the root of the GitHub workspace. 183 | required: false 184 | deprecation-message: Using the action to execute Gradle directly is deprecated in favor of using the action to setup Gradle, and executing Gradle in a subsequent Step. 185 | 186 | # EXPERIMENTAL ACTION INPUTS 187 | # The following action properties allow fine-grained tweaking of the action caching behaviour. 188 | # These properties are experimental and not (yet) designed for production use, and may change without notice in a subsequent release of `setup-gradle`. 189 | # Use at your own risk! 190 | gradle-home-cache-strict-match: 191 | description: When 'true', the action will not attempt to restore the Gradle User Home entries from other Jobs. 192 | required: false 193 | default: false 194 | 195 | # INTERNAL ACTION INPUTS 196 | # These inputs should not be configured directly, and are only used to pass environmental information to the action 197 | workflow-job-context: 198 | description: Used to uniquely identify the current job invocation. Defaults to the matrix values for this job; this should not be overridden by users (INTERNAL). 199 | required: false 200 | default: ${{ toJSON(matrix) }} 201 | 202 | github-token: 203 | description: The GitHub token used to authenticate when submitting via the Dependency Submission API. 204 | default: ${{ github.token }} 205 | required: false 206 | 207 | outputs: 208 | build-scan-url: 209 | description: Link to the Build Scan® generated by a Gradle build. Note that this output applies to a Step executing Gradle, not to the `setup-gradle` Step itself. 210 | value: ${{ steps.setup-gradle.outputs.build-scan-url }} 211 | dependency-graph-file: 212 | description: Path to the GitHub Dependency Graph snapshot file generated by a Gradle build. Note that this output applies to a Step executing Gradle, not to the `setup-gradle` Step itself. 213 | value: ${{ steps.setup-gradle.outputs.dependency-graph-file }} 214 | gradle-version: 215 | description: Version of Gradle that was setup by the action 216 | value: ${{ steps.setup-gradle.outputs.gradle-version }} 217 | 218 | runs: 219 | using: "composite" 220 | steps: 221 | - name: Setup Gradle 222 | id: setup-gradle 223 | uses: gradle/actions/setup-gradle@v3.5.0 224 | with: 225 | gradle-version: ${{ inputs.gradle-version }} 226 | cache-disabled: ${{ inputs.cache-disabled }} 227 | cache-read-only: ${{ inputs.cache-read-only }} 228 | cache-write-only: ${{ inputs.cache-write-only }} 229 | cache-overwrite-existing: ${{ inputs.cache-overwrite-existing }} 230 | cache-encryption-key: ${{ inputs.cache-encryption-key }} 231 | gradle-home-cache-includes: ${{ inputs.gradle-home-cache-includes }} 232 | gradle-home-cache-excludes: ${{ inputs.gradle-home-cache-excludes }} 233 | gradle-home-cache-cleanup: ${{ inputs.gradle-home-cache-cleanup }} 234 | add-job-summary: ${{ inputs.add-job-summary }} 235 | add-job-summary-as-pr-comment: ${{ inputs.add-job-summary-as-pr-comment }} 236 | dependency-graph: ${{ inputs.dependency-graph }} 237 | dependency-graph-continue-on-failure: ${{ inputs.dependency-graph-continue-on-failure }} 238 | artifact-retention-days: ${{ inputs.artifact-retention-days }} 239 | build-scan-publish: ${{ inputs.build-scan-publish }} 240 | build-scan-terms-of-use-url: ${{ inputs.build-scan-terms-of-use-url }} 241 | build-scan-terms-of-use-agree: ${{ inputs.build-scan-terms-of-use-agree }} 242 | validate-wrappers: ${{ inputs.validate-wrappers }} 243 | build-scan-terms-of-service-url: ${{ inputs.build-scan-terms-of-service-url }} 244 | build-scan-terms-of-service-agree: ${{ inputs.build-scan-terms-of-service-agree }} 245 | generate-job-summary: ${{ inputs.generate-job-summary }} 246 | arguments: ${{ inputs.arguments }} 247 | build-root-directory: ${{ inputs.build-root-directory }} 248 | gradle-home-cache-strict-match: ${{ inputs.gradle-home-cache-strict-match }} 249 | workflow-job-context: ${{ inputs.workflow-job-context }} 250 | github-token: ${{ inputs.github-token }} 251 | develocity-access-key: ${{ inputs.develocity-access-key }} 252 | develocity-token-expiry: ${{ inputs.develocity-token-expiry }} 253 | develocity-injection-enabled: ${{ inputs.develocity-injection-enabled }} 254 | develocity-url: ${{ inputs.develocity-url }} 255 | develocity-allow-untrusted-server: ${{ inputs.develocity-allow-untrusted-server }} 256 | develocity-capture-file-fingerprints: ${{ inputs.develocity-capture-file-fingerprints }} 257 | develocity-enforce-url: ${{ inputs.develocity-enforce-url }} 258 | develocity-plugin-version: ${{ inputs.develocity-plugin-version }} 259 | develocity-ccud-plugin-version: ${{ inputs.develocity-ccud-plugin-version }} 260 | gradle-plugin-repository-url: ${{ inputs.gradle-plugin-repository-url }} 261 | gradle-plugin-repository-username: ${{ inputs.gradle-plugin-repository-username }} 262 | gradle-plugin-repository-password: ${{ inputs.gradle-plugin-repository-password }} 263 | 264 | env: 265 | GRADLE_ACTION_ID: gradle/gradle-build-action 266 | 267 | branding: 268 | icon: 'box' 269 | color: 'gray-dark' 270 | --------------------------------------------------------------------------------