Skip to content

Commit fdcbca9

Browse files
authoredMar 26, 2019
Merge pull request #380 from diffplug/feature/buildcache
Enable the buildcache - read only for PRs, and read/write for trusted…
2 parents 69538dd + e68413e commit fdcbca9

File tree

4 files changed

+40
-8
lines changed

4 files changed

+40
-8
lines changed
 

‎.ci/ci.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash
22

33
# Do the Gradle build
4-
./gradlew --scan build || exit 1
5-
./gradlew npmTest || exit 1
4+
./gradlew --scan build --build-cache || exit 1
5+
./gradlew npmTest --build-cache || exit 1
66

77
if [ "$TRAVIS_REPO_SLUG" == "diffplug/spotless" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
88
# Make sure that all pom are up-to-date
9-
./gradlew generatePomFileForPluginMavenPublication
9+
./gradlew generatePomFileForPluginMavenPublication --build-cache
1010
# Publish the artifacts
11-
./gradlew publish publishPlugins -Dgradle.publish.key=$gradle_key -Dgradle.publish.secret=$gradle_secret || exit 1
11+
./gradlew publish publishPlugins -Dgradle.publish.key=$gradle_key -Dgradle.publish.secret=$gradle_secret --build-cache || exit 1
1212
# Push the javadoc
13-
./gradlew publishGhPages || exit 1
13+
./gradlew publishGhPages --build-cache || exit 1
1414
fi

‎CHANGES.md

+5
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ You might be looking for:
77

88
### Version 1.21.0-SNAPSHOT - TBD (javadoc [lib](https://diffplug.github.io/spotless/javadoc/spotless-lib/snapshot/) [lib-extra](https://diffplug.github.io/spotless/javadoc/spotless-lib-extra/snapshot/), [snapshot repo](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/spotless/))
99

10+
* We now use a remote build cache to speed up CI builds. Reduced build time from ~13 minutes to as low as ~3 minutes, dependending on how deep the change is ([#380](https://github.com/diffplug/spotless/pull/380)).
11+
1012
### Version 1.20.0 - March 11th 2018 (javadoc [lib](https://diffplug.github.io/spotless/javadoc/spotless-lib/1.20.0/) [lib-extra](https://diffplug.github.io/spotless/javadoc/spotless-lib-extra/1.20.0/), artifact [lib]([jcenter](https://bintray.com/diffplug/opensource/spotless-lib), [lib-extra]([jcenter](https://bintray.com/diffplug/opensource/spotless-lib-extra)))
1113

1214
* Made npm package versions of [`prettier`](https://prettier.io/) and [`tsfmt`](https://github.com/vvakame/typescript-formatter) (and its internal packages) configurable. ([#363](https://github.com/diffplug/spotless/pull/363))
1315
* Updated default npm package version of `prettier` from 1.13.4 to 1.16.4
1416
* Updated default npm package version of internally used typescript package from 2.9.2 to 3.3.3 and tslint package from 5.1.0 to 5.12.0 (both used by `tsfmt`)
1517
* Updated default eclipse-wtp from 4.7.3a to 4.7.3b ([#371](https://github.com/diffplug/spotless/pull/371)).
18+
* Configured `buìld-scan` plugin in build ([#356](https://github.com/diffplug/spotless/pull/356)).
19+
* Runs on every CI build automatically.
20+
* Users need to opt-in on their local machine.
1621
* Default behavior of XML formatter changed to ignore external URIs ([#369](https://github.com/diffplug/spotless/issues/369)).
1722
* **WARNING RESOLVED: By default, xml formatter no longer downloads external entities. You can opt-in to resolve external entities by setting resolveExternalURI to true. However, if you do opt-in, be sure that all external entities are referenced over https and not http, or you may be vulnerable to XXE attacks.**
1823

‎plugin-gradle/CHANGES.md

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
* Updated default npm package version of `prettier` from 1.13.4 to 1.16.4
99
* Updated default npm package version of internally used typescript package from 2.9.2 to 3.3.3 and tslint package from 5.1.0 to 5.12.0 (both used by `tsfmt`)
1010
* Updated default eclipse-wtp from 4.7.3a to 4.7.3b ([#371](https://github.com/diffplug/spotless/pull/371)).
11-
* Configured `buìld-scan` plugin in build ([#356](https://github.com/diffplug/spotless/pull/356)).
12-
* Runs on every CI build automatically.
13-
* Users need to opt-in on their local machine.
1411
* Default behavior of XML formatter changed to ignore external URIs ([#369](https://github.com/diffplug/spotless/issues/369)).
1512
* **WARNING RESOLVED: By default, xml formatter no longer downloads external entities. You can opt-in to resolve external entities by setting resolveExternalURI to true. However, if you do opt-in, be sure that all external entities are referenced over https and not http, or you may be vulnerable to XXE attacks.**
1613

‎settings.gradle

+30
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
if (System.env['CI'] != null) {
2+
// use the remote buildcache on all CI builds
3+
buildCache {
4+
def cred = {
5+
if (System.env[it] != null) {
6+
return System.env[it]
7+
} else {
8+
return System.getProperty(it)
9+
}
10+
}
11+
remote(HttpBuildCache) {
12+
url = 'https://buildcache.diffplug.com/cache/'
13+
// but we only push if it's a trusted build (not PRs)
14+
String user = cred('buildcacheuser')
15+
String pass = cred('buildcachepass')
16+
if (user != null && pass != null) {
17+
push = true
18+
credentials {
19+
username = user
20+
password = pass
21+
}
22+
} else {
23+
credentials {
24+
username = 'anonymous'
25+
}
26+
}
27+
}
28+
}
29+
}
30+
131
include 'ide' // easy dev setup
232
include 'javadoc-publish' // publish javadoc for the various libs
333

0 commit comments

Comments
 (0)