diff --git a/.ci/ci.sh b/.ci/ci.sh index 5a33cbd710..42915e498f 100755 --- a/.ci/ci.sh +++ b/.ci/ci.sh @@ -1,14 +1,14 @@ #!/bin/bash # Do the Gradle build -./gradlew --scan build || exit 1 -./gradlew npmTest || exit 1 +./gradlew --scan build --build-cache || exit 1 +./gradlew npmTest --build-cache || exit 1 if [ "$TRAVIS_REPO_SLUG" == "diffplug/spotless" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then # Make sure that all pom are up-to-date - ./gradlew generatePomFileForPluginMavenPublication + ./gradlew generatePomFileForPluginMavenPublication --build-cache # Publish the artifacts - ./gradlew publish publishPlugins -Dgradle.publish.key=$gradle_key -Dgradle.publish.secret=$gradle_secret || exit 1 + ./gradlew publish publishPlugins -Dgradle.publish.key=$gradle_key -Dgradle.publish.secret=$gradle_secret --build-cache || exit 1 # Push the javadoc - ./gradlew publishGhPages || exit 1 + ./gradlew publishGhPages --build-cache || exit 1 fi diff --git a/CHANGES.md b/CHANGES.md index 52bb67089f..1dfe6d22be 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,12 +7,17 @@ You might be looking for: ### 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/)) +* 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)). + ### 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))) * 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)) * Updated default npm package version of `prettier` from 1.13.4 to 1.16.4 * 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`) * Updated default eclipse-wtp from 4.7.3a to 4.7.3b ([#371](https://github.com/diffplug/spotless/pull/371)). +* Configured `buìld-scan` plugin in build ([#356](https://github.com/diffplug/spotless/pull/356)). + * Runs on every CI build automatically. + * Users need to opt-in on their local machine. * Default behavior of XML formatter changed to ignore external URIs ([#369](https://github.com/diffplug/spotless/issues/369)). * **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.** diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 66daf97f79..f7a613819b 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -8,9 +8,6 @@ * Updated default npm package version of `prettier` from 1.13.4 to 1.16.4 * 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`) * Updated default eclipse-wtp from 4.7.3a to 4.7.3b ([#371](https://github.com/diffplug/spotless/pull/371)). -* Configured `buìld-scan` plugin in build ([#356](https://github.com/diffplug/spotless/pull/356)). - * Runs on every CI build automatically. - * Users need to opt-in on their local machine. * Default behavior of XML formatter changed to ignore external URIs ([#369](https://github.com/diffplug/spotless/issues/369)). * **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.** diff --git a/settings.gradle b/settings.gradle index dd09f48a5d..2d4bca940e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,33 @@ +if (System.env['CI'] != null) { + // use the remote buildcache on all CI builds + buildCache { + def cred = { + if (System.env[it] != null) { + return System.env[it] + } else { + return System.getProperty(it) + } + } + remote(HttpBuildCache) { + url = 'https://buildcache.diffplug.com/cache/' + // but we only push if it's a trusted build (not PRs) + String user = cred('buildcacheuser') + String pass = cred('buildcachepass') + if (user != null && pass != null) { + push = true + credentials { + username = user + password = pass + } + } else { + credentials { + username = 'anonymous' + } + } + } + } +} + include 'ide' // easy dev setup include 'javadoc-publish' // publish javadoc for the various libs