Build default jvm core libraries artifacts as modular

#KT-21266
This commit is contained in:
Ilya Gorbunov
2020-04-20 23:24:44 +03:00
parent e1e149a062
commit 01fb200791
5 changed files with 15 additions and 23 deletions
+4 -6
View File
@@ -23,9 +23,10 @@ dependencies {
archivesBaseName = 'kotlin-test' archivesBaseName = 'kotlin-test'
jar { jar {
manifestAttributes(manifest, project, 'Test' /*true*/) manifestAttributes(manifest, project, 'Test', true)
// TODO: enable as soon as this doesn't cause D8/DX to crash if (includeJava9) {
// from sourceSets.java9.output from sourceSets.java9.output
}
} }
task modularJar(type: Jar) { task modularJar(type: Jar) {
@@ -34,9 +35,6 @@ task modularJar(type: Jar) {
classifier = 'modular' classifier = 'modular'
from zipTree(jar.outputs.files.singleFile) from zipTree(jar.outputs.files.singleFile)
if (includeJava9) {
from sourceSets.java9.output
}
} }
artifacts { artifacts {
+4 -1
View File
@@ -204,7 +204,10 @@ val result by task<Jar> {
from { from {
zipTree(intermediate.get().singleOutputFile()) zipTree(intermediate.get().singleOutputFile())
} }
callGroovy("manifestAttributes", manifest, project, "Main") from(zipTree(provider { reflectShadowJar.get().archiveFile.get().asFile })) {
include("META-INF/versions/**")
}
callGroovy("manifestAttributes", manifest, project, "Main", true)
} }
val modularJar by task<Jar> { val modularJar by task<Jar> {
+2 -4
View File
@@ -45,9 +45,8 @@ dependencies {
} }
jar { jar {
manifestAttributes(manifest, project, 'Main' /*true*/) manifestAttributes(manifest, project, 'Main', true)
// TODO: enable as soon as this doesn't cause D8/DX to crash from sourceSets.java9.output
// from sourceSets.java9.output
} }
task modularJar(type: Jar) { task modularJar(type: Jar) {
@@ -56,7 +55,6 @@ task modularJar(type: Jar) {
classifier = 'modular' classifier = 'modular'
from zipTree(jar.outputs.files.singleFile) from zipTree(jar.outputs.files.singleFile)
from sourceSets.java9.output
} }
+2 -4
View File
@@ -39,9 +39,8 @@ sourceSets {
} }
jar { jar {
manifestAttributes(manifest, project, 'Main' /*true*/) manifestAttributes(manifest, project, 'Main', true)
// TODO: enable as soon as this doesn't cause D8/DX to crash from sourceSets.java9.output
// from sourceSets.java9.output
} }
task modularJar(type: Jar) { task modularJar(type: Jar) {
@@ -50,7 +49,6 @@ task modularJar(type: Jar) {
classifier = 'modular' classifier = 'modular'
from zipTree(jar.outputs.files.singleFile) from zipTree(jar.outputs.files.singleFile)
from sourceSets.java9.output
} }
+3 -8
View File
@@ -58,12 +58,11 @@ dependencies {
jar { jar {
dependsOn(configurations.builtins) dependsOn(configurations.builtins)
manifestAttributes(manifest, project, 'Main' /*true*/) manifestAttributes(manifest, project, 'Main', true)
from { from {
zipTree(configurations.builtins.singleFile) zipTree(configurations.builtins.singleFile)
} }
// TODO: enable as soon as this doesn't cause D8/DX to crash from sourceSets.java9.output
// from sourceSets.java9.output
} }
sourcesJar { sourcesJar {
@@ -90,11 +89,7 @@ task modularJar(type: Jar) {
manifestAttributes(manifest, project, 'Main', true) manifestAttributes(manifest, project, 'Main', true)
classifier = 'modular' classifier = 'modular'
from zipTree(jar.outputs.files.singleFile).matching { from zipTree(jar.outputs.files.singleFile)
// Beware of Gradle problem: changing exclude spec doesn't affect Jar task up-to-dateness
exclude('kotlin/native/**')
}
from sourceSets.java9.output
} }
artifacts { artifacts {