Skip to content

Commit 9ee2f1f

Browse files
committed
Add test distribution to plugin caching, rename file to snake_case
1 parent 9d5307a commit 9ee2f1f

7 files changed

+9
-6
lines changed

cmd/activateForGradle.go renamed to cmd/activate_for_gradle.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If it already exists a "# [start/end] generated-by-bitrise-build-cache" block wi
2525
If the "# [start/end] generated-by-bitrise-build-cache" block is already present in the file then only the block's content will be modified.
2626
`,
2727
SilenceUsage: true,
28-
RunE: func(_ *cobra.Command, _ []string) error {
28+
RunE: func(cmd *cobra.Command, _ []string) error {
2929
logger := log.NewLogger()
3030
logger.EnableDebugLog(isDebugLogMode)
3131
logger.TInfof("Activate Bitrise plugins for Gradle")
@@ -35,6 +35,10 @@ If the "# [start/end] generated-by-bitrise-build-cache" block is already present
3535
return fmt.Errorf("expand Gradle home path (%s), error: %w", gradleHome, err)
3636
}
3737

38+
if err := getPlugins(cmd.Context(), logger, os.Getenv); err != nil {
39+
return fmt.Errorf("failed to fetch plugins: %w", err)
40+
}
41+
3842
if err := activateForGradleCmdFn(
3943
logger,
4044
gradleHome,
File renamed without changes.

cmd/enable_for_gradle.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import (
44
"context"
55
"fmt"
66
"os"
7+
"os/exec"
78

9+
"github.com/bitrise-io/bitrise-build-cache-cli/internal/config/common"
810
gradleconfig "github.com/bitrise-io/bitrise-build-cache-cli/internal/config/gradle"
911
"github.com/bitrise-io/bitrise-build-cache-cli/internal/gradle"
1012
"github.com/bitrise-io/go-utils/v2/log"
@@ -14,7 +16,7 @@ import (
1416
)
1517

1618
const (
17-
gradleHomeNonExpanded = "~/.gradle"
19+
gradleHomeNonExpanded = "~/.gradle"
1820
FmtErrorEnableForGradle = "adding Gradle plugins failed: %w"
1921
)
2022

@@ -131,10 +133,7 @@ func getPlugins(ctx context.Context, logger log.Logger, envProvider func(string)
131133

132134
pluginCacher := gradle.PluginCacher{}
133135

134-
if err = pluginCacher.CachePlugins(ctx, kvClient, logger, []gradle.Plugin{
135-
gradle.PluginAnalytics(),
136-
gradle.PluginCache(),
137-
}); err != nil {
136+
if err = pluginCacher.CachePlugins(ctx, kvClient, logger, gradle.Plugins()); err != nil {
138137
return fmt.Errorf("caching plugins: %w", err)
139138
}
140139

0 commit comments

Comments
 (0)