Skip to content

Commit c86134a

Browse files
committed
Fall back to develocity.server for cache server
When the cache server hasn't been explicitly configured, we should fall back to using the value of develocity.server. Doing so will make it easier to use a Develocity instance other than ge.spring.io as only develocity.server has to be configured. Closes gh-78
1 parent 3062bd4 commit c86134a

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/main/java/io/spring/ge/conventions/gradle/BuildCacheConventions.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@ public void execute(BuildCacheConfiguration buildCache) {
5252
String cacheServer = this.env.get("DEVELOCITY_CACHE_SERVER");
5353
if (cacheServer == null) {
5454
cacheServer = serverOfCacheUrl(this.env.get("GRADLE_ENTERPRISE_CACHE_URL"));
55-
if (cacheServer == null) {
56-
cacheServer = "https://ge.spring.io";
57-
}
5855
}
59-
remote.setServer(cacheServer);
56+
if (cacheServer != null) {
57+
remote.setServer(cacheServer);
58+
}
6059
String accessKey = this.env.get("DEVELOCITY_ACCESS_KEY");
6160
if (accessKey == null) {
6261
accessKey = this.env.get("GRADLE_ENTERPRISE_ACCESS_KEY");

src/test/java/io/spring/ge/conventions/gradle/BuildCacheConventionsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void localCacheIsEnabled() {
5151
void remoteCacheIsEnabled() {
5252
new BuildCacheConventions(DevelocityBuildCache.class).execute(this.buildCache);
5353
assertThat(this.buildCache.remote.isEnabled()).isTrue();
54-
assertThat(this.buildCache.remote.getServer()).isEqualTo("https://ge.spring.io");
54+
assertThat(this.buildCache.remote.getServer()).isNull();
5555
assertThat(this.buildCache.remote.isPush()).isFalse();
5656
}
5757

0 commit comments

Comments
 (0)