diff --git a/e2e/bitrise.yml b/e2e/bitrise.yml index 10c4a1e..6cfad00 100644 --- a/e2e/bitrise.yml +++ b/e2e/bitrise.yml @@ -30,6 +30,7 @@ workflows: is_skippable: false inputs: - verbose: "true" + - save_transforms: "true" - script: title: Delete local Gradle caches inputs: diff --git a/step.yml b/step.yml index 120860c..0d30c11 100644 --- a/step.yml +++ b/step.yml @@ -52,3 +52,11 @@ inputs: title: Compression level summary: Zstd compression level to control speed / archive size. Set to 1 for fastest option. Valid values are between 1 and 19. Defaults to 3. is_required: false +- save_transforms: "false" + opts: + title: Save transforms + summary: Save transformed classes and resources under `$HOME/.gradle/caches/**/transforms` + is_required: true + value_options: + - "true" + - "false" diff --git a/step/step.go b/step/step.go index 8056ee1..9273dca 100644 --- a/step/step.go +++ b/step/step.go @@ -45,8 +45,7 @@ var paths = []string{ // Cache of downloaded Gradle binary "~/.gradle/wrapper", - // Configuration cache in project-level folder - ".gradle/configuration-cache", + // Configuration cache is saved by separate step: save-gradle-configuration-cache // JDKs downloaded by the toolchain support "~/.gradle/jdks", @@ -55,6 +54,7 @@ var paths = []string{ type Input struct { Verbose bool `env:"verbose,required"` CompressionLevel int `env:"compression_level,range[1..19]"` + SaveTransforms bool `env:"save_transforms"` } type SaveCacheStep struct { @@ -90,6 +90,13 @@ func (step SaveCacheStep) Run() error { return fmt.Errorf("failed to parse inputs: %w", err) } stepconf.Print(input) + + if input.SaveTransforms { + // Save artifact transforms + // The `**` segment matches the version-specific folder, such as `7.6`. + paths = append(paths, "~/.gradle/caches/**/transforms") + } + step.logger.Println() step.logger.Printf("Cache key: %s", key) step.logger.Printf("Cache paths:")