Use konan.home as compiler system property, kotlin.native.home as a gradle only property
This commit is contained in:
committed by
Pavel Punegov
parent
3efca3d8b8
commit
309ecbb696
+1
-1
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.native.interop.gen.jvm.KotlinPlatform
|
|||||||
|
|
||||||
class ToolConfig(userProvidedTargetName: String?, flavor: KotlinPlatform) {
|
class ToolConfig(userProvidedTargetName: String?, flavor: KotlinPlatform) {
|
||||||
|
|
||||||
private val konanHome = System.getProperty("org.jetbrains.kotlin.native.home")
|
private val konanHome = System.getProperty("konan.home")
|
||||||
private val distribution = customerDistribution(konanHome)
|
private val distribution = customerDistribution(konanHome)
|
||||||
private val platformManager = PlatformManager(distribution)
|
private val platformManager = PlatformManager(distribution)
|
||||||
private val targetManager = platformManager.targetManager(userProvidedTargetName)
|
private val targetManager = platformManager.targetManager(userProvidedTargetName)
|
||||||
|
|||||||
@@ -207,11 +207,11 @@ task teamcityPublishStdLibSources {
|
|||||||
|
|
||||||
// These files are built before the 'dist' is complete,
|
// These files are built before the 'dist' is complete,
|
||||||
// so we provide custom values for
|
// so we provide custom values for
|
||||||
// org.jetbrains.kotlin.native.home, --runtime, -Djava.library.path etc
|
// konan.home, --runtime, -Djava.library.path etc
|
||||||
|
|
||||||
targetList.each { target ->
|
targetList.each { target ->
|
||||||
def konanJvmArgs = [*HostManager.regularJvmArgs,
|
def konanJvmArgs = [*HostManager.regularJvmArgs,
|
||||||
"-Dorg.jetbrains.kotlin.native.home=${rootProject.projectDir}",
|
"-Dkonan.home=${rootProject.projectDir}",
|
||||||
"-Djava.library.path=${project.buildDir}/nativelibs/$hostName",
|
"-Djava.library.path=${project.buildDir}/nativelibs/$hostName",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ abstract class KonanTest extends JavaExec {
|
|||||||
classpath = project.fileTree("$dist.canonicalPath/konan/lib/") {
|
classpath = project.fileTree("$dist.canonicalPath/konan/lib/") {
|
||||||
include '*.jar'
|
include '*.jar'
|
||||||
}
|
}
|
||||||
jvmArgs "-Dorg.jetbrains.kotlin.native.home=${dist.canonicalPath}", "-Xmx4G",
|
jvmArgs "-Dkonan.home=${dist.canonicalPath}", "-Xmx4G",
|
||||||
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib"
|
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib"
|
||||||
enableAssertions = true
|
enableAssertions = true
|
||||||
def sources = File.createTempFile(name,".lst")
|
def sources = File.createTempFile(name,".lst")
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ class NamedNativeInteropConfig implements Named {
|
|||||||
new File(project.findProject(":Interop:Indexer").buildDir, "nativelibs"),
|
new File(project.findProject(":Interop:Indexer").buildDir, "nativelibs"),
|
||||||
new File(project.findProject(":Interop:Runtime").buildDir, "nativelibs")
|
new File(project.findProject(":Interop:Runtime").buildDir, "nativelibs")
|
||||||
).asPath
|
).asPath
|
||||||
systemProperties "org.jetbrains.kotlin.native.home": project.rootProject.projectDir
|
systemProperties "konan.home": project.rootProject.projectDir
|
||||||
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
|
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
|
||||||
|
|
||||||
outputs.dir generatedSrcDir
|
outputs.dir generatedSrcDir
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ java_opts=(-ea \
|
|||||||
-Xmx3G \
|
-Xmx3G \
|
||||||
-XX:TieredStopAtLevel=1 \
|
-XX:TieredStopAtLevel=1 \
|
||||||
"-Djava.library.path=${NATIVE_LIB}" \
|
"-Djava.library.path=${NATIVE_LIB}" \
|
||||||
"-Dorg.jetbrains.kotlin.native.home=${KONAN_HOME}" \
|
"-Dkonan.home=${KONAN_HOME}" \
|
||||||
-Dfile.encoding=UTF-8 \
|
-Dfile.encoding=UTF-8 \
|
||||||
${JAVA_OPTS})
|
${JAVA_OPTS})
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -75,7 +75,7 @@ set JAVA_OPTS=-ea ^
|
|||||||
-Xmx3G ^
|
-Xmx3G ^
|
||||||
-XX:TieredStopAtLevel=1 ^
|
-XX:TieredStopAtLevel=1 ^
|
||||||
"-Djava.library.path=%NATIVE_LIB%" ^
|
"-Djava.library.path=%NATIVE_LIB%" ^
|
||||||
"-Dorg.jetbrains.kotlin.native.home=%_KONAN_HOME%" ^
|
"-Dkonan.home=%_KONAN_HOME%" ^
|
||||||
-Dfile.encoding=UTF-8 ^
|
-Dfile.encoding=UTF-8 ^
|
||||||
%JAVA_OPTS%
|
%JAVA_OPTS%
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ dependencies {
|
|||||||
|
|
||||||
test {
|
test {
|
||||||
dependsOn 'cleanTest'
|
dependsOn 'cleanTest'
|
||||||
systemProperty('org.jetbrains.kotlin.native.home', getProperty("org.jetbrains.kotlin.native.home"))
|
systemProperty('konan.home', getProperty("org.jetbrains.kotlin.native.home"))
|
||||||
dependsOn konanArtifacts.collect { it.getByTarget('host') }
|
dependsOn konanArtifacts.collect { it.getByTarget('host') }
|
||||||
if (useCustomDist) {
|
if (useCustomDist) {
|
||||||
// Use the klib utility from the distribution
|
// Use the klib utility from the distribution
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class Distribution(
|
|||||||
private fun findKonanHome(): String {
|
private fun findKonanHome(): String {
|
||||||
if (konanHomeOverride != null) return konanHomeOverride
|
if (konanHomeOverride != null) return konanHomeOverride
|
||||||
|
|
||||||
val value = System.getProperty("org.jetbrains.kotlin.native.home", "dist")
|
val value = System.getProperty("konan.home", "dist")
|
||||||
val path = File(value).absolutePath
|
val path = File(value).absolutePath
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ internal abstract class KonanCliRunner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val additionalSystemProperties = mutableMapOf(
|
override val additionalSystemProperties = mutableMapOf(
|
||||||
"org.jetbrains.kotlin.native.home" to project.konanHome,
|
"konan.home" to project.konanHome,
|
||||||
"java.library.path" to "${project.konanHome}/konan/nativelib"
|
"java.library.path" to "${project.konanHome}/konan/nativelib"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user