add task to zip stdlib sources, extract&reuse code

This commit is contained in:
Eugene Petrenko
2018-09-23 15:20:10 +02:00
committed by Pavel Punegov
parent 62a1ff2e8e
commit 07c02db3f2
+22 -8
View File
@@ -156,6 +156,26 @@ task unzipStdlibSources(type: Copy) {
destinationDir commonSrc
}
final List<File> stdLibSrc = [
project(':Interop:Runtime').file('src/main/kotlin'),
project(':Interop:Runtime').file('src/native/kotlin'),
project(':Interop:JsRuntime').file('src/main/kotlin'),
project(':runtime').file('src/main/kotlin')
]
task zipStdLibSources(type: Zip, dependsOn: unzipStdlibSources) {
from stdLibSrc, {
into "native"
}
from commonSrc, {
into "common"
}
archiveName 'kotlin-stdlib-native-sources.zip'
destinationDir buildDir
}
// These files are built before the 'dist' is complete,
// so we provide custom values for
// konan.home, --runtime, -Djava.library.path etc
@@ -186,14 +206,8 @@ targetList.each { target ->
'-Xallow-result-return-type',
commonSrc.absolutePath,
"-Xcommon-sources=${commonSrc.absolutePath}",
project(':Interop:Runtime').file('src/main/kotlin'),
project(':Interop:Runtime').file('src/native/kotlin'),
project(':Interop:JsRuntime').file('src/main/kotlin'),
project(':runtime').file('src/main/kotlin')]
inputs.dir(project(':runtime').file('src/main/kotlin'))
inputs.dir(project(':Interop:Runtime').file('src/main/kotlin'))
inputs.dir(project(':Interop:Runtime').file('src/native/kotlin'))
inputs.dir(project(':Interop:JsRuntime').file('src/main/kotlin'))
*stdLibSrc]
stdLibSrc.forEach { inputs.dir(it) }
inputs.dir(commonSrc)
outputs.dir(project(':runtime').file("build/${target}Stdlib"))