Unify Kotlin daemon JVM arguments settings in Kotlin repo

Now 'kotlin-daemon-config' convention plugin should be added into
settings plugins to configure Kotlin daemon.
This commit is contained in:
Yahor Berdnikau
2023-03-03 17:22:13 +01:00
committed by Space Team
parent c080765905
commit b9d19a864a
10 changed files with 36 additions and 6 deletions
-2
View File
@@ -1,6 +1,4 @@
org.gradle.jvmargs=-Duser.country=US -Dfile.encoding=UTF-8
# Should be the same as in the root gradle.properties to avoid spawning second daemon
kotlin.daemon.jvmargs=-Xmx3g -Dkotlin.js.compiler.legacy.force_enabled=true
cacheRedirectorEnabled=true
+1
View File
@@ -19,6 +19,7 @@ plugins {
id "build-cache"
id "gradle-enterprise"
id "jvm-toolchain-provisioning"
id "kotlin-daemon-config"
}
File versionPropertiesFile = new File(rootProject.projectDir.parentFile, "gradle/versions.properties")
-3
View File
@@ -1,8 +1,5 @@
org.gradle.jvmargs=-Duser.country=US -Dfile.encoding=UTF-8 -Dorg.gradle.internal.publish.checksums.insecure=true
#!!! It should be uniform across the project to avoid multiple daemons spawning during the build, which often leads to OOM on build server
kotlin.daemon.jvmargs=-Xmx3g -Dkotlin.js.compiler.legacy.force_enabled=true
systemProp.file.encoding=UTF-8
systemProp.user.country=US
# Enable new incremental compiation
@@ -16,6 +16,7 @@ pluginManagement {
plugins {
id("jvm-toolchain-provisioning")
id("build-cache")
id("kotlin-daemon-config")
}
buildscript {
@@ -7,3 +7,4 @@ Provides common settings convention plugins for the repo.
- "build-cache" - local and remote build cache configuration
- "gradle-enterprise" - configures build scans upload
- "jvm-toolchain-provisioning" - configures JVM toolchain to download project JDKs via Disco API
- "kotlin-daemon-config" - common project JVM arguments for Kotlin daemon
@@ -1,5 +1,5 @@
kotlin.build.gradlePlugin.version=0.0.39
kotlin.options.suppressFreeCompilerArgsModificationWarning=true
cacheRedirectorEnabled=true
# Should be the same as in the root gradle.properties to avoid spawning second daemon
# Should be in sync with ":kotlin-daemon-config" project convention script configuration
kotlin.daemon.jvmargs=-Xmx3g -Dkotlin.js.compiler.legacy.force_enabled=true
@@ -0,0 +1,16 @@
plugins {
`kotlin-dsl`
id("org.jetbrains.kotlin.jvm")
}
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
// TODO: migrate to api only dependency once Kotlin daemon configuration will be available there (Yahor)
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
kotlin.jvmToolchain(8)
@@ -0,0 +1,14 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinBasePlugin
gradle.afterProject {
plugins.withType<KotlinBasePlugin> {
extensions.configure<KotlinTopLevelExtension> {
// Should be in sync with 'gradle-settings-conventions/gradle.properties'
kotlinDaemonJvmArgs = listOf(
"-Xmx3g",
"-Dkotlin.js.compiler.legacy.force_enabled=true"
)
}
}
}
@@ -23,6 +23,7 @@ plugins {
include(":build-cache")
include(":gradle-enterprise")
include(":jvm-toolchain-provisioning")
include(":kotlin-daemon-config")
// 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"
+1
View File
@@ -19,6 +19,7 @@ plugins {
id "build-cache"
id "gradle-enterprise"
id "jvm-toolchain-provisioning"
id "kotlin-daemon-config"
}
def buildProperties = BuildPropertiesKt.getKotlinBuildPropertiesForSettings(settings)