Skip to content

Commit

Permalink
Add settings.gradle.kts sample
Browse files Browse the repository at this point in the history
  • Loading branch information
alextu committed Aug 31, 2022
1 parent cd6f7f3 commit 5eaa000
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
run: |
# apply sample file
echo "apply from: file(\"../build-data-capturing-gradle-samples/${{matrix.sample-file}}\")" >> common-gradle-enterprise-gradle-configuration/build.gradle
- name: Run Gradle build
- name: Run Gradle build with Groovy scripts
working-directory: common-gradle-enterprise-gradle-configuration
run: ./gradlew tasks
run: ./gradlew tasks
- name: Run Gradle build with Kotlin scripts
working-directory: common-gradle-enterprise-gradle-configuration
run: ./gradlew tasks -c settings.gradle.kts
36 changes: 36 additions & 0 deletions common-gradle-enterprise-gradle-configuration/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
id("com.gradle.enterprise") version("3.11.1")
id("com.gradle.common-custom-user-data-gradle-plugin") version("1.8")
}

val isCI = !System.getenv("CI").isNullOrEmpty() // adjust to your CI provider

gradleEnterprise {
server = "https://enterprise-samples.gradle.com" // adjust to your GE server
allowUntrustedServer = false // ensure a trusted certificate is configured

buildScan {
capture { isTaskInputFiles = true }
isUploadInBackground = !isCI
publishAlways()
}
}

buildCache {
local {
isEnabled = true
}

remote<HttpBuildCache> {
url = uri("https://enterprise-samples.gradle.com/cache/") // adjust to your GE server, and note the trailing slash
isAllowUntrustedServer = false // ensure a trusted certificate is configured
credentials {
username = System.getenv("GRADLE_ENTERPRISE_CACHE_USERNAME")
password = System.getenv("GRADLE_ENTERPRISE_CACHE_PASSWORD")
}
isEnabled = true
isPush = isCI
}
}

rootProject.name = "common-gradle-enterprise-gradle-configuration" // adjust to your project

0 comments on commit 5eaa000

Please sign in to comment.