Replace deprecated konan.home with org.jetbrains.kotlin.native.home
This commit is contained in:
committed by
Pavel Punegov
parent
6e8a56f00a
commit
9c3a1332d5
@@ -142,8 +142,8 @@ export KONAN_REPO=$PWD/../kotlin-native
|
|||||||
# Run this once since it is costly, you can remove the `clean` task if not big changes were made from the last time you did this
|
# Run this once since it is costly, you can remove the `clean` task if not big changes were made from the last time you did this
|
||||||
pushd $KONAN_REPO && git pull && ./gradlew clean dependencies:update dist distPlatformLibs && popd
|
pushd $KONAN_REPO && git pull && ./gradlew clean dependencies:update dist distPlatformLibs && popd
|
||||||
|
|
||||||
# In your project, you set have to the konan.home property, and include as composite the shared and gradle-plugin builds
|
# In your project, you set have to the org.jetbrains.kotlin.native.home property, and include as composite the shared and gradle-plugin builds
|
||||||
./gradlew check -Pkonan.home=$KONAN_REPO/dist --include-build $KONAN_REPO/shared --include-build $KONAN_REPO/tools/kotlin-native-gradle-plugin
|
./gradlew check -Porg.jetbrains.kotlin.native.home=$KONAN_REPO/dist --include-build $KONAN_REPO/shared --include-build $KONAN_REPO/tools/kotlin-native-gradle-plugin
|
||||||
```
|
```
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -48,12 +48,12 @@ apply plugin: 'org.jetbrains.kotlin.platform.native'
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
By default the plugin downloads the Kotlin/Native compiler during the first run. If you have already downloaded the compiler
|
By default the plugin downloads the Kotlin/Native compiler during the first run. If you have already downloaded the compiler
|
||||||
manually you can specify the path to its root directory using `konan.home` project property (e.g. in `gradle.properties`).
|
manually you can specify the path to its root directory using `org.jetbrains.kotlin.native.home` project property (e.g. in `gradle.properties`).
|
||||||
|
|
||||||
<div class="sample" markdown="1" theme="idea" mode="groovy">
|
<div class="sample" markdown="1" theme="idea" mode="groovy">
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
konan.home=/home/user/kotlin-native-0.8
|
org.jetbrains.kotlin.native.home=/home/user/kotlin-native-0.8
|
||||||
```
|
```
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+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("konan.home")
|
private val konanHome = System.getProperty("org.jetbrains.kotlin.native.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
|
||||||
// konan.home, --runtime, -Djava.library.path etc
|
// org.jetbrains.kotlin.native.home, --runtime, -Djava.library.path etc
|
||||||
|
|
||||||
targetList.each { target ->
|
targetList.each { target ->
|
||||||
def konanJvmArgs = [*HostManager.regularJvmArgs,
|
def konanJvmArgs = [*HostManager.regularJvmArgs,
|
||||||
"-Dkonan.home=${rootProject.projectDir}",
|
"-Dorg.jetbrains.kotlin.native.home=${rootProject.projectDir}",
|
||||||
"-Djava.library.path=${project.buildDir}/nativelibs/$hostName",
|
"-Djava.library.path=${project.buildDir}/nativelibs/$hostName",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ task debugCompiler(type: JavaExec) {
|
|||||||
classpath = project.fileTree("${distDir.canonicalPath}/konan/lib/") {
|
classpath = project.fileTree("${distDir.canonicalPath}/konan/lib/") {
|
||||||
include '*.jar'
|
include '*.jar'
|
||||||
}
|
}
|
||||||
jvmArgs "-Dkonan.home=${distDir.canonicalPath}",
|
jvmArgs "-Dorg.jetbrains.kotlin.native.home=${distDir.canonicalPath}",
|
||||||
"-Djava.library.path=${distDir.canonicalPath}/konan/nativelib"
|
"-Djava.library.path=${distDir.canonicalPath}/konan/nativelib"
|
||||||
enableAssertions = true
|
enableAssertions = true
|
||||||
args = findProperty("konan.debug.args").toString().tokenize() ?: []
|
args = findProperty("konan.debug.args").toString().tokenize() ?: []
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ test {
|
|||||||
|
|
||||||
def dist = project.rootProject.file("dist").canonicalPath
|
def dist = project.rootProject.file("dist").canonicalPath
|
||||||
systemProperties = [
|
systemProperties = [
|
||||||
'konan.home': dist,
|
'org.jetbrains.kotlin.native.home': dist,
|
||||||
'java.library.path': "$dist/konan/nativelib"
|
'java.library.path': "$dist/konan/nativelib"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ import java.nio.file.Paths
|
|||||||
|
|
||||||
|
|
||||||
object DistProperties {
|
object DistProperties {
|
||||||
private val dist: Path = Paths.get(requireProp("konan.home"))
|
private val dist: Path = Paths.get(requireProp("org.jetbrains.kotlin.native.home"))
|
||||||
private val konancDriver = if (HostManager.host.family == Family.MINGW) "konanc.bat" else "konanc"
|
private val konancDriver = if (HostManager.host.family == Family.MINGW) "konanc.bat" else "konanc"
|
||||||
val konanc: Path = dist.resolve("bin/$konancDriver")
|
val konanc: Path = dist.resolve("bin/$konancDriver")
|
||||||
val lldb: Path = Paths.get("lldb")
|
val lldb: Path = Paths.get("lldb")
|
||||||
|
|||||||
@@ -25,9 +25,9 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$gradlePluginVersion"
|
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$gradlePluginVersion"
|
||||||
}
|
}
|
||||||
ext.useCustomDist = project.hasProperty("konan.home")
|
ext.useCustomDist = project.hasProperty("org.jetbrains.kotlin.native.home")
|
||||||
if (!useCustomDist) {
|
if (!useCustomDist) {
|
||||||
ext.setProperty("konan.home", distDir.absolutePath)
|
ext.setProperty("org.jetbrains.kotlin.native.home", distDir.absolutePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ externalStdlibTestsDir.mkdirs()
|
|||||||
ext.platformManager = project.rootProject.platformManager
|
ext.platformManager = project.rootProject.platformManager
|
||||||
ext.target = platformManager.targetManager(project.testTarget).target
|
ext.target = platformManager.targetManager(project.testTarget).target
|
||||||
|
|
||||||
ext.testLibraryDir = "${project.property("konan.home")}/klib/platform/${project.target.name}"
|
ext.testLibraryDir = "${project.property("org.jetbrains.kotlin.native.home")}/klib/platform/${project.target.name}"
|
||||||
|
|
||||||
// Add executor to run tests depending on a target
|
// Add executor to run tests depending on a target
|
||||||
project.convention.plugins.executor = ExecutorServiceKt.create(project)
|
project.convention.plugins.executor = ExecutorServiceKt.create(project)
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ abstract class KonanTest extends JavaExec {
|
|||||||
public String source
|
public String source
|
||||||
def platformManager = project.rootProject.platformManager
|
def platformManager = project.rootProject.platformManager
|
||||||
def target = platformManager.targetManager(project.testTarget).target
|
def target = platformManager.targetManager(project.testTarget).target
|
||||||
def dist = project.rootProject.file(project.findProperty("konan.home") ?: "dist")
|
def dist = project.rootProject.file(project.findProperty("org.jetbrains.kotlin.native.home") ?: "dist")
|
||||||
def dependenciesDir = project.rootProject.dependenciesDir
|
def dependenciesDir = project.rootProject.dependenciesDir
|
||||||
def konancDriver = project.isWindows() ? "konanc.bat" : "konanc"
|
def konancDriver = project.isWindows() ? "konanc.bat" : "konanc"
|
||||||
def konanc = new File("${dist.canonicalPath}/bin/$konancDriver").absolutePath
|
def konanc = new File("${dist.canonicalPath}/bin/$konancDriver").absolutePath
|
||||||
@@ -100,7 +100,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 "-Dkonan.home=${dist.canonicalPath}", "-Xmx4G",
|
jvmArgs "-Dorg.jetbrains.kotlin.native.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")
|
||||||
@@ -521,8 +521,8 @@ class RunDriverKonanTest extends KonanTest {
|
|||||||
|
|
||||||
RunDriverKonanTest() {
|
RunDriverKonanTest() {
|
||||||
super()
|
super()
|
||||||
// We don't build the compiler if a custom konan.home path is specified.
|
// We don't build the compiler if a custom org.jetbrains.kotlin.native.home path is specified.
|
||||||
if (!project.hasProperty("konan.home")) {
|
if (!project.hasProperty("org.jetbrains.kotlin.native.home")) {
|
||||||
dependsOn(project.rootProject.tasks['cross_dist'])
|
dependsOn(project.rootProject.tasks['cross_dist'])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 "konan.home": project.rootProject.projectDir
|
systemProperties "org.jetbrains.kotlin.native.home": project.rootProject.projectDir
|
||||||
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
|
environment "LIBCLANG_DISABLE_CRASH_RECOVERY": "1"
|
||||||
|
|
||||||
outputs.dir generatedSrcDir
|
outputs.dir generatedSrcDir
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ open class KlibInstall: Exec() {
|
|||||||
|
|
||||||
override fun configure(config: Closure<*>): Task {
|
override fun configure(config: Closure<*>): Task {
|
||||||
val result = super.configure(config)
|
val result = super.configure(config)
|
||||||
val konanHomePath = project.findProperty("konan.home") ?: "dist"
|
val konanHomePath = project.findProperty("org.jetbrains.kotlin.native.home") ?: "dist"
|
||||||
val konanHome = project.rootProject.file(konanHomePath)
|
val konanHome = project.rootProject.file(konanHomePath)
|
||||||
val suffix = if (HostManager.host == KonanTarget.MINGW_X64) ".bat" else ""
|
val suffix = if (HostManager.host == KonanTarget.MINGW_X64) ".bat" else ""
|
||||||
val klibProgram = "$konanHome/bin/klib$suffix"
|
val klibProgram = "$konanHome/bin/klib$suffix"
|
||||||
|
|||||||
+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}" \
|
||||||
"-Dkonan.home=${KONAN_HOME}" \
|
"-Dorg.jetbrains.kotlin.native.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%" ^
|
||||||
"-Dkonan.home=%_KONAN_HOME%" ^
|
"-Dorg.jetbrains.kotlin.native.home=%_KONAN_HOME%" ^
|
||||||
-Dfile.encoding=UTF-8 ^
|
-Dfile.encoding=UTF-8 ^
|
||||||
%JAVA_OPTS%
|
%JAVA_OPTS%
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -8,9 +8,9 @@ buildscript {
|
|||||||
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$gradlePluginVersion"
|
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$gradlePluginVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.useCustomDist = project.hasProperty("konan.home")
|
ext.useCustomDist = project.hasProperty("org.jetbrains.kotlin.native.home")
|
||||||
if (!useCustomDist) {
|
if (!useCustomDist) {
|
||||||
ext.setProperty("konan.home", distDir.absolutePath)
|
ext.setProperty("org.jetbrains.kotlin.native.home", distDir.absolutePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,11 +50,11 @@ dependencies {
|
|||||||
|
|
||||||
test {
|
test {
|
||||||
dependsOn 'cleanTest'
|
dependsOn 'cleanTest'
|
||||||
systemProperty('konan.home', getProperty("konan.home"))
|
systemProperty('org.jetbrains.kotlin.native.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
|
||||||
def distClasspath = fileTree("${project.getProperty("konan.home")}/konan/lib") {
|
def distClasspath = fileTree("${project.getProperty("org.jetbrains.kotlin.native.home")}/konan/lib") {
|
||||||
include "**/*.jar"
|
include "**/*.jar"
|
||||||
}
|
}
|
||||||
classpath = distClasspath + sourceSets.test.runtimeClasspath - sourceSets.main.runtimeClasspath
|
classpath = distClasspath + sourceSets.test.runtimeClasspath - sourceSets.main.runtimeClasspath
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ buildscript {
|
|||||||
ext.konanHome = distDir.absolutePath
|
ext.konanHome = distDir.absolutePath
|
||||||
def jvmArguments = [project.findProperty("platformLibsJvmArgs") ?: "-Xmx6G", *HostManager.defaultJvmArgs]
|
def jvmArguments = [project.findProperty("platformLibsJvmArgs") ?: "-Xmx6G", *HostManager.defaultJvmArgs]
|
||||||
ext.jvmArgs = jvmArguments.join(" ")
|
ext.jvmArgs = jvmArguments.join(" ")
|
||||||
ext.setProperty("konan.home", konanHome)
|
ext.setProperty("org.jetbrains.kotlin.native.home", konanHome)
|
||||||
ext.setProperty("konan.jvmArgs", jvmArgs)
|
ext.setProperty("konan.jvmArgs", jvmArgs)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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("konan.home", "dist")
|
val value = System.getProperty("org.jetbrains.kotlin.native.home", "dist")
|
||||||
val path = File(value).absolutePath
|
val path = File(value).absolutePath
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,9 +172,13 @@ test {
|
|||||||
systemProperty("kotlin.repo", kotlinCompilerRepo)
|
systemProperty("kotlin.repo", kotlinCompilerRepo)
|
||||||
if (project.hasProperty("konan.home")) {
|
if (project.hasProperty("konan.home")) {
|
||||||
systemProperty("konan.home", project.property("konan.home"))
|
systemProperty("konan.home", project.property("konan.home"))
|
||||||
|
systemProperty("org.jetbrains.kotlin.native.home", project.property("konan.home"))
|
||||||
|
} else if (project.hasProperty("org.jetbrains.kotlin.native.home")) {
|
||||||
|
systemProperty("org.jetbrains.kotlin.native.home", project.property("org.jetbrains.kotlin.native.home"))
|
||||||
} else {
|
} else {
|
||||||
// The Koltin/Native compiler must be built before test execution.
|
// The Koltin/Native compiler must be built before test execution.
|
||||||
systemProperty("konan.home", distDir.absolutePath)
|
systemProperty("konan.home", distDir.absolutePath)
|
||||||
|
systemProperty("org.jetbrains.kotlin.native.home", distDir.absolutePath)
|
||||||
}
|
}
|
||||||
if (project.hasProperty("konan.jvmArgs")) {
|
if (project.hasProperty("konan.jvmArgs")) {
|
||||||
systemProperty("konan.jvmArgs", project.property("konan.jvmArgs"))
|
systemProperty("konan.jvmArgs", project.property("konan.jvmArgs"))
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ internal abstract class KonanCliRunner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override val additionalSystemProperties = mutableMapOf(
|
override val additionalSystemProperties = mutableMapOf(
|
||||||
"konan.home" to project.konanHome,
|
"org.jetbrains.kotlin.native.home" to project.konanHome,
|
||||||
"java.library.path" to "${project.konanHome}/konan/nativelib"
|
"java.library.path" to "${project.konanHome}/konan/nativelib"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ class KonanProject {
|
|||||||
this.targets = targets
|
this.targets = targets
|
||||||
projectPath = projectDir.toPath()
|
projectPath = projectDir.toPath()
|
||||||
konanBuildDir = projectPath.resolve('build/konan').toFile()
|
konanBuildDir = projectPath.resolve('build/konan').toFile()
|
||||||
def konanHome = System.getProperty("konan.home")
|
def konanHome = System.getProperty("konan.home") ?: System.getProperty("org.jetbrains.kotlin.native.home")
|
||||||
if (konanHome == null) {
|
if (konanHome == null) {
|
||||||
throw new IllegalStateException("konan.home isn't specified")
|
throw new IllegalStateException("konan.home isn't specified")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user