8
8
"text/template"
9
9
10
10
"github.com/bitrise-io/bitrise-build-cache-cli/internal/config/common"
11
+ "github.com/bitrise-io/bitrise-build-cache-cli/internal/consts"
11
12
)
12
13
13
14
//go:embed initd.gradle.kts.gotemplate
@@ -21,30 +22,18 @@ var (
21
22
type templateInventory struct {
22
23
AuthToken string
23
24
CacheEndpointURLWithPort string
24
- CacheVersion string
25
+ CachePluginVersion string
25
26
PushEnabled bool
26
27
DebugEnabled bool
27
28
ValidationLevel string
28
- MetricsEnabled bool
29
- MetricsVersion string
30
- MetricsEndpoint string
31
- MetricsPort int
29
+ AnalyticsEnabled bool
30
+ AnalyticsPluginVersion string
31
+ AnalyticsEndpoint string
32
+ AnalyticsPort int
32
33
// Metadata
33
34
CacheConfigMetadata common.CacheConfigMetadata
34
35
}
35
36
36
- // Sync the major version of this step and the library.
37
- // Use the latest 1.x version of our dependency, so we don't have to update this definition after every lib release.
38
- // But don't forget to update this to `2.+` if the library reaches version 2.0!
39
- const gradleRemoteBuildCachePluginDepVersion = "1.+"
40
-
41
- // Sync the major version of this step and the plugin.
42
- // Use the latest 1.x version of the plugin, so we don't have to update this definition after every plugin release.
43
- // But don't forget to update this to `2.+` if the library reaches version 2.0!
44
- const analyticsPluginDepVersion = "0.+"
45
- const analyticsEndpoint = "gradle-analytics.services.bitrise.io"
46
- const analyticsPort = 443
47
-
48
37
// Generate init.gradle content.
49
38
// Recommended to save the content into $HOME/.gradle/init.d/ instead of
50
39
// overwriting the $HOME/.gradle/init.gradle file.
@@ -62,14 +51,14 @@ func GenerateInitGradle(endpointURL, authToken string, analyticsEnabled bool, ca
62
51
inventory := templateInventory {
63
52
AuthToken : authToken ,
64
53
CacheEndpointURLWithPort : endpointURL ,
65
- CacheVersion : gradleRemoteBuildCachePluginDepVersion ,
54
+ CachePluginVersion : consts . GradleRemoteBuildCachePluginDepVersion ,
66
55
PushEnabled : true ,
67
56
DebugEnabled : true ,
68
57
ValidationLevel : "warning" ,
69
- MetricsEnabled : analyticsEnabled ,
70
- MetricsVersion : analyticsPluginDepVersion ,
71
- MetricsEndpoint : analyticsEndpoint ,
72
- MetricsPort : analyticsPort ,
58
+ AnalyticsEnabled : analyticsEnabled ,
59
+ AnalyticsPluginVersion : consts . GradleAnalyticsPluginDepVersion ,
60
+ AnalyticsEndpoint : consts . GradleAnalyticsEndpoint ,
61
+ AnalyticsPort : consts . GradleAnalyticsPort ,
73
62
CacheConfigMetadata : cacheConfigMetadata ,
74
63
}
75
64
0 commit comments