From 07c02db3f265f765511a150545076459c87f81e5 Mon Sep 17 00:00:00 2001 From: Eugene Petrenko Date: Sun, 23 Sep 2018 15:20:10 +0200 Subject: [PATCH] add task to zip stdlib sources, extract&reuse code --- backend.native/build.gradle | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/backend.native/build.gradle b/backend.native/build.gradle index 46ec8c7c20d..c6115a871ff 100644 --- a/backend.native/build.gradle +++ b/backend.native/build.gradle @@ -156,6 +156,26 @@ task unzipStdlibSources(type: Copy) { destinationDir commonSrc } +final List 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"))