[Commonizer] Add Gradle property to pass JVM args

^KT-39094
This commit is contained in:
Dmitriy Dolovov
2020-05-22 12:00:01 +07:00
parent 2a1e014d51
commit 4076bf40a9
2 changed files with 9 additions and 0 deletions
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.compilerRunner
import org.gradle.api.Project import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.plugin.KLIB_COMMONIZER_CLASSPATH_CONFIGURATION_NAME import org.jetbrains.kotlin.gradle.plugin.KLIB_COMMONIZER_CLASSPATH_CONFIGURATION_NAME
import org.jetbrains.kotlin.gradle.plugin.PropertiesProvider
import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion
import java.io.File import java.io.File
@@ -31,4 +32,6 @@ internal class KotlinNativeKlibCommonizerToolRunner(project: Project) : KotlinTo
override val defaultMaxHeapSize: String get() = "4G" override val defaultMaxHeapSize: String get() = "4G"
override val mustRunViaExec get() = true // because it's not enough the standard Gradle wrapper's heap size override val mustRunViaExec get() = true // because it's not enough the standard Gradle wrapper's heap size
override fun getCustomJvmArgs() = PropertiesProvider(project).commonizerJvmArgs?.split("\\s+".toRegex()).orEmpty()
} }
@@ -173,6 +173,12 @@ internal class PropertiesProvider private constructor(private val project: Proje
val nativeEnableParallelExecutionCheck: Boolean val nativeEnableParallelExecutionCheck: Boolean
get() = booleanProperty(KOTLIN_NATIVE_ENABLE_PARALLEL_EXECUTION_CHECK) ?: true get() = booleanProperty(KOTLIN_NATIVE_ENABLE_PARALLEL_EXECUTION_CHECK) ?: true
/**
* Allows a user to specify additional arguments of a JVM executing KLIB commonizer.
*/
val commonizerJvmArgs: String?
get() = property("kotlin.commonizer.jvmArgs")
/** /**
* Dependencies caching strategy. The default is static. * Dependencies caching strategy. The default is static.
*/ */