Skip to content

Commit

Permalink
Caching polish. Rm explicit exec, set remote cache credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
aegershman committed Dec 18, 2021
1 parent 6a44e6f commit 04c406f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
uses: openrewrite/gh-automation/.github/workflows/ci-gradle.yml@main
secrets:
gradle_enterprise_access_key: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
gradle_enterprise_cache_username: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
gradle_enterprise_cache_password: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
ossrh_username: ${{ secrets.OSSRH_USERNAME }}
ossrh_token: ${{ secrets.OSSRH_TOKEN }}
ossrh_signing_key: ${{ secrets.OSSRH_SIGNING_KEY }}
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ tasks.named<JavaCompile>("compileJava") {
targetCompatibility = JavaVersion.VERSION_1_8.toString()

options.isFork = true
options.forkOptions.executable = "javac"
options.compilerArgs.addAll(listOf("--release", "8"))
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#
org.gradle.caching=true
org.gradle.parallel=true
8 changes: 8 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ plugins {
gradleEnterprise {
val isCiServer = System.getenv("CI")?.equals("true") ?: false
server = "https://ge.openrewrite.org/"
val gradleCacheRemoteUsername: String? = System.getenv("GRADLE_ENTERPRISE_CACHE_USERNAME")
val gradleCacheRemotePassword: String? = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")

buildCache {
remote(HttpBuildCache::class) {
url = uri("https://ge.openrewrite.org/cache/")
isPush = isCiServer
if (!gradleCacheRemoteUsername.isNullOrBlank() && !gradleCacheRemotePassword.isNullOrBlank()) {
credentials {
username = gradleCacheRemoteUsername
password = gradleCacheRemotePassword
}
}
}
}

Expand Down

0 comments on commit 04c406f

Please sign in to comment.