enterprise.gradle.kts
provides rich metadata for builds published to gradle enterprise.
settings.gradle.kts
uses apply(from = "enterprise.gradle.kts")
to configure Gradle Enterprise.
default-custom-user-data.gradle has been converted to Kotlin (with non-Jenkins CI removed).
- Run
export JENKINS_URL=true
so gradle thinks we're running on Jenkins. By default, the script will publish only on CI. ./gradlew clean
will produce a build scan.
Credentials
then clickSystem
. Add a Global credential.- Kind: Secret Text. Set text using the
domain=accesskey
format - Specify an id.
gradle-enterprise
Update the Jenkinsfile with
environment {
GRADLE_ENTERPRISE_ACCESS_KEY = credentials('gradle-enterprise')
}
Detecting IntelliJ vs Android Studio
Android Studio:
idea.executable=studio
idea.paths.selector=AndroidStudioPreview4.1
idea.platform.prefix=AndroidStudio
IntelliJ Community:
idea.executable=idea
idea.paths.selector=IdeaIC2019.3
Dump system properties:
var props = System.getProperties()
val writer = java.io.FileWriter(file("community.properties"))
writer.use { writer ->
props.store(writer, "")
writer.flush()
}
compileOnly("com.gradle:gradle-enterprise-gradle-plugin:${gradleEnterprisePluginVersion}")