Add settings convention for Gradle enterprise
This commit is contained in:
committed by
Space Team
parent
b7f50aeaf2
commit
920f76b9ef
@@ -4,4 +4,5 @@ Provides common settings convention plugins for the repo.
|
||||
|
||||
### List of plugins
|
||||
|
||||
- "build-cache" - local and remote build cache configuration
|
||||
- "build-cache" - local and remote build cache configuration
|
||||
- "gradle-enterprise" - configures build scans upload
|
||||
@@ -0,0 +1,19 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
id("org.jetbrains.kotlin.jvm")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven(url = "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
kotlin.jvmToolchain(8)
|
||||
|
||||
val buildGradlePluginVersion = extra.get("kotlin.build.gradlePlugin.version")
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:$buildGradlePluginVersion")
|
||||
implementation("com.gradle:gradle-enterprise-gradle-plugin:3.12.3")
|
||||
implementation("com.gradle:common-custom-user-data-gradle-plugin:1.8.2")
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
plugins {
|
||||
id("com.gradle.enterprise")
|
||||
id("com.gradle.common-custom-user-data-gradle-plugin") apply false
|
||||
}
|
||||
|
||||
val buildProperties = getKotlinBuildPropertiesForSettings(settings)
|
||||
|
||||
val buildScanServer = buildProperties.buildScanServer
|
||||
val isTeamCity = buildProperties.isTeamcityBuild
|
||||
|
||||
if (buildProperties.buildScanServer != null) {
|
||||
plugins.apply("com.gradle.common-custom-user-data-gradle-plugin")
|
||||
}
|
||||
|
||||
gradleEnterprise {
|
||||
buildScan {
|
||||
if (buildScanServer != null) {
|
||||
server = buildScanServer
|
||||
publishAlways()
|
||||
|
||||
capture {
|
||||
isTaskInputFiles = true
|
||||
isBuildLogging = true
|
||||
isBuildLogging = true
|
||||
isUploadInBackground = true
|
||||
}
|
||||
} else {
|
||||
termsOfServiceUrl = "https://gradle.com/terms-of-service"
|
||||
termsOfServiceAgree = "yes"
|
||||
}
|
||||
|
||||
val username = if (isTeamCity) "TeamCity" else "concealed"
|
||||
obfuscation {
|
||||
ipAddresses { _ -> listOf("0.0.0.0") }
|
||||
hostname { _ -> "concealed" }
|
||||
username { _ -> username }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ buildscript {
|
||||
}
|
||||
|
||||
include(":build-cache")
|
||||
include(":gradle-enterprise")
|
||||
|
||||
// Unfortunately it is not possible to apply build-cache.settings.gradle.kts as script compilation
|
||||
// could not then find types from "kotlin-build-gradle-plugin"
|
||||
|
||||
Reference in New Issue
Block a user