From c5aa5ef571d602a195f3403c9c81c3d738db2dcc Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 19 Jan 2017 04:42:44 +0300 Subject: [PATCH] Do not duplicate sources, add non-compiled sources to runtime, dump declarations to json. --- libraries/build.gradle | 4 ++-- libraries/tools/runtime/build.gradle | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/libraries/build.gradle b/libraries/build.gradle index cdae3ab107c..0c825ca338c 100644 --- a/libraries/build.gradle +++ b/libraries/build.gradle @@ -1,6 +1,7 @@ buildscript { ext.kotlin_version = "1.1-SNAPSHOT" + ext.kotlin_language_version = "1.1" repositories { mavenCentral() maven { url 'http://dl.bintray.com/kotlin/kotlin-eap-1.1' } @@ -32,7 +33,6 @@ subprojects { 'Implementation-Title': "${project.description ?: project.name}", // TODO: project.description is resolved after evaluating this, therefore this attribute is repeated in the projects; seek for a solution 'Implementation-Version': version, 'Build-Jdk': System.getProperty('java.version'), -// 'Kotlin-Version': kotlin.language.version, // TODO: if we need it - find the way to extract it 'Built-By': 'JetBrains' } from("${rootDir}/../dist/kotlinc/build.txt") { into("META-INF/") } @@ -45,7 +45,7 @@ subprojects { task sourcesJar(type: Jar, dependsOn:classes) { classifier = 'sources' - from sourceSets.main.allSource + from sourceSets.main.kotlin } task javadocJar(type: Jar, dependsOn:javadoc) { diff --git a/libraries/tools/runtime/build.gradle b/libraries/tools/runtime/build.gradle index e3abf070e8a..739468cb615 100644 --- a/libraries/tools/runtime/build.gradle +++ b/libraries/tools/runtime/build.gradle @@ -13,8 +13,6 @@ sourceSets { exclude 'org/jetbrains/annotations/**' } kotlin { - srcDir "${rootDir}/../core/builtins/src" - srcDir "${rootDir}/../core/runtime.jvm/src" exclude 'org/jetbrains/annotations/**' } } @@ -23,11 +21,18 @@ sourceSets { jar { manifest { attributes 'Kotlin-Runtime-Component': 'Core', + 'Kotlin-Version': "$kotlin_language_version", 'Implementation-Title': "${project.description ?: project.name}" } from("${rootDir}/../dist/builtins") } +sourcesJar { + classifier = 'sources' + from sourceSets.main.kotlin + from "${rootDir}/../core/builtins/native" +} + artifacts { archives sourcesJar archives javadocJar @@ -42,5 +47,10 @@ compileJava { } compileKotlin { - kotlinOptions.freeCompilerArgs = ["-Xallow-kotlin-package", "-module-name", "${project.name}".toString()] + kotlinOptions.freeCompilerArgs = [ + "-Xallow-kotlin-package", + "-Xdump-declarations-to", "${buildDir}/runtime-declarations.json", + "-cp", "${rootDir}/../dist/builtins", + "-module-name", project.name + ] }