diff --git a/backend.native/build.gradle b/backend.native/build.gradle index 793526237d1..2b836284a4c 100644 --- a/backend.native/build.gradle +++ b/backend.native/build.gradle @@ -168,7 +168,7 @@ task start(dependsOn: "${hostName}Start") targetList.each { target -> def konanJvmArgs = ["-ea", - "-Dkonan.home=${project.parent.file('dist')}", + "-Dkonan.home=$distDir", "-Djava.library.path=${project.buildDir}/nativelibs", "-Dfile.encoding=UTF-8"] diff --git a/build.gradle b/build.gradle index 25b784a24c7..3d1a75ea35b 100644 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,7 @@ ext { konanPropertiesFile = project(':backend.native').file('konan.properties') konanProperties = PropertiesKt.loadProperties(konanPropertiesFile.absolutePath) + distDir = file('dist') dependenciesDir = DependencyProcessor.defaultDependenciesRoot clangManager = new ClangManager(konanProperties, dependenciesDir.absolutePath) kotlinCompilerModule="org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}" @@ -152,7 +153,7 @@ task distCompiler(type: Copy) { dependsOn ':klib:jar' dependsOn ':shared:jar' - destinationDir file('dist') + destinationDir distDir from(project(':backend.native').file('build/libs')) { into('konan/lib') @@ -223,7 +224,7 @@ task distCompiler(type: Copy) { } task listDist(type: Exec) { - commandLine 'find', 'dist' + commandLine 'find', distDir } task distRuntime(type: Copy) { @@ -234,7 +235,7 @@ task distRuntime(type: Copy) { def stdlib = 'klib/common/stdlib' task commonDistRuntime(type: Copy) { - destinationDir file('dist') + destinationDir distDir // Target independant common part. from(project(':runtime').file("build/${hostName}Stdlib")) { @@ -258,7 +259,7 @@ targetList.each { target -> dependsOn ":backend.native:${target}Stdlib" dependsOn ":backend.native:${target}Start" - destinationDir file('dist') + destinationDir distDir from(project(':runtime').file("build/$target")) { include("*.bc") @@ -298,7 +299,7 @@ targetList.each { target -> 'kotlin_version' : kotlin_version, 'name' : defFile.name, 'defFile' : defFile.file.absolutePath, - 'konan.home' : project.file('dist'), + 'konan.home' : distDir, 'target' : target, 'suffix' : suffix, 'libraries' : defFile.config.depends.join(" ") @@ -399,9 +400,7 @@ task performance(type: GradleBuild) { task clean { doLast { - file('dist').traverse(type: FileType.ANY, excludeNameFilter: "dependencies", maxDepth: 0) { - delete it - } + delete distDir delete bundle.outputs.files } } diff --git a/klib/build.gradle b/klib/build.gradle index 6d176a1875f..f679fb0026e 100644 --- a/klib/build.gradle +++ b/klib/build.gradle @@ -25,7 +25,7 @@ dependencies { compile project(path: ':backend.native', configuration: 'cli_bc') } -def dist = rootProject.file('dist').absolutePath +def dist = distDir.absolutePath def suffix = isWindows() ? ".bat" : "" // TODO: Ideally we want to write just konanArtifacts{} clause here, diff --git a/tools/kotlin-native-gradle-plugin/build.gradle b/tools/kotlin-native-gradle-plugin/build.gradle index 3a498871501..f64ee14ae1b 100644 --- a/tools/kotlin-native-gradle-plugin/build.gradle +++ b/tools/kotlin-native-gradle-plugin/build.gradle @@ -94,7 +94,7 @@ dependencies { test { dependsOn ':dist' //testLogging.showStandardStreams = true - systemProperty("konan.home", rootProject.file('dist').canonicalPath) + systemProperty("konan.home", distDir.absolutePath) } jar {