Build: Migrate stdlib & kotlin-test to maven-publish publication
This commit is contained in:
@@ -2,11 +2,9 @@ description = 'Kotlin Test for JS'
|
||||
|
||||
apply plugin: 'kotlin-platform-js'
|
||||
|
||||
// TODO: Migrate to maven-publish publishing
|
||||
configureLegacyPublishing(project)
|
||||
configurePublishing(project)
|
||||
|
||||
configurations {
|
||||
sources
|
||||
distJs
|
||||
distLibrary
|
||||
}
|
||||
@@ -78,6 +76,7 @@ task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
artifacts {
|
||||
runtime libraryJarWithIr
|
||||
archives libraryJarWithIr
|
||||
publishedRuntime libraryJarWithIr
|
||||
distLibrary libraryJarWithIr
|
||||
archives sourcesJar
|
||||
distJs(file(compileKotlin2Js.kotlinOptions.outputFile)) {
|
||||
|
||||
@@ -3,8 +3,10 @@ description = 'Kotlin Standard Library JDK 7 extension'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvm6Project(project)
|
||||
// TODO: Migrate to maven-publish publishing
|
||||
configureLegacyPublishing(project)
|
||||
configurePublishing(project)
|
||||
configureSourcesJar()
|
||||
configureJavadocJar()
|
||||
|
||||
ext.javaHome = JDK_17
|
||||
|
||||
sourceSets {
|
||||
@@ -50,10 +52,9 @@ jar {
|
||||
from sourceSets.java9.output
|
||||
}
|
||||
|
||||
task modularJar(type: Jar) {
|
||||
configureModularJar {
|
||||
dependsOn(jar)
|
||||
manifestAttributes(manifest, project, 'Main', true)
|
||||
classifier = 'modular'
|
||||
|
||||
from zipTree(jar.outputs.files.singleFile)
|
||||
}
|
||||
@@ -66,8 +67,6 @@ artifacts {
|
||||
archives modularJar
|
||||
}
|
||||
|
||||
configureJavadocJar()
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.jdkHome = JDK_17
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ description = 'Kotlin Standard Library JDK 8 extension'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
configureJvm6Project(project)
|
||||
// TODO: Migrate to maven-publish publishing
|
||||
configureLegacyPublishing(project)
|
||||
configurePublishing(project)
|
||||
configureSourcesJar()
|
||||
configureJavadocJar()
|
||||
|
||||
ext.javaHome = JDK_18
|
||||
ext.jvmTarget = "1.8"
|
||||
|
||||
@@ -44,15 +46,13 @@ jar {
|
||||
from sourceSets.java9.output
|
||||
}
|
||||
|
||||
task modularJar(type: Jar) {
|
||||
configureModularJar {
|
||||
dependsOn(jar)
|
||||
manifestAttributes(manifest, project, 'Main', true)
|
||||
classifier = 'modular'
|
||||
|
||||
from zipTree(jar.outputs.files.singleFile)
|
||||
}
|
||||
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
sources sourcesJar
|
||||
@@ -60,8 +60,6 @@ artifacts {
|
||||
archives modularJar
|
||||
}
|
||||
|
||||
configureJavadocJar()
|
||||
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
|
||||
kotlinOptions.jdkHome = JDK_18
|
||||
kotlinOptions.jvmTarget = 1.8
|
||||
|
||||
@@ -7,8 +7,8 @@ description = 'Kotlin Standard Library for JS'
|
||||
apply plugin: 'kotlin-platform-js'
|
||||
apply plugin: 'idea'
|
||||
|
||||
// TODO: Migrate to maven-publish publishing
|
||||
configureLegacyPublishing(project)
|
||||
configurePublishing(project)
|
||||
configureJavadocJar()
|
||||
|
||||
configurations {
|
||||
sources
|
||||
@@ -16,7 +16,6 @@ configurations {
|
||||
distSources
|
||||
distJs
|
||||
distLibrary
|
||||
publishedArtifacts
|
||||
}
|
||||
|
||||
def builtinsSrcDir = "${buildDir}/builtin-sources"
|
||||
@@ -306,13 +305,10 @@ task distSourcesJar(type: Jar) {
|
||||
}
|
||||
}
|
||||
|
||||
def javadocJar = configureJavadocJar()
|
||||
|
||||
artifacts {
|
||||
runtime libraryJarWithIr
|
||||
publishedArtifacts libraryJarWithIr
|
||||
publishedArtifacts sourcesJar
|
||||
publishedArtifacts javadocJar
|
||||
publishedRuntime libraryJarWithIr
|
||||
publishedRuntime sourcesJar
|
||||
sources sourcesJar
|
||||
distSources distSourcesJar
|
||||
distLibrary libraryJarWithIr
|
||||
@@ -322,14 +318,6 @@ artifacts {
|
||||
}
|
||||
}
|
||||
|
||||
uploadArchives {
|
||||
configuration = configurations.publishedArtifacts
|
||||
}
|
||||
|
||||
install {
|
||||
configuration = configurations.publishedArtifacts
|
||||
}
|
||||
|
||||
node {
|
||||
download = true
|
||||
version = '8.9.4' // The default 6.9.1 has buggy hyperbolic functions implementation
|
||||
|
||||
@@ -5,8 +5,9 @@ apply plugin: 'kotlin-platform-jvm'
|
||||
archivesBaseName = 'kotlin-stdlib'
|
||||
|
||||
configureJvm6Project(project)
|
||||
// TODO: Migrate to maven-publish publishing
|
||||
configureLegacyPublishing(project)
|
||||
configurePublishing(project)
|
||||
configureJavadocJar()
|
||||
configureSourcesJar()
|
||||
|
||||
configurations {
|
||||
distSources
|
||||
@@ -85,10 +86,9 @@ task distSourcesJar(type: Jar) {
|
||||
}
|
||||
}
|
||||
|
||||
task modularJar(type: Jar) {
|
||||
configureModularJar {
|
||||
dependsOn(jar)
|
||||
manifestAttributes(manifest, project, 'Main', true)
|
||||
classifier = 'modular'
|
||||
|
||||
from zipTree(jar.outputs.files.singleFile)
|
||||
}
|
||||
@@ -100,8 +100,6 @@ artifacts {
|
||||
archives modularJar
|
||||
}
|
||||
|
||||
configureJavadocJar()
|
||||
|
||||
DexMethodCountKt.dexMethodCount(project) { task ->
|
||||
task.from(jar)
|
||||
task.ownPackages = ['kotlin']
|
||||
|
||||
@@ -7,20 +7,14 @@ plugins {
|
||||
id("com.github.node-gradle.node") version "2.2.0"
|
||||
}
|
||||
|
||||
publish()
|
||||
|
||||
val default = configurations.getByName(Dependency.DEFAULT_CONFIGURATION)
|
||||
val archives = configurations.getByName(Dependency.ARCHIVES_CONFIGURATION)
|
||||
|
||||
default.extendsFrom(archives)
|
||||
|
||||
plugins.apply("maven")
|
||||
|
||||
convention.getPlugin(MavenPluginConvention::class.java).also {
|
||||
it.conf2ScopeMappings.addMapping(MavenPlugin.RUNTIME_PRIORITY, archives, Conf2ScopeMappingContainer.RUNTIME)
|
||||
}
|
||||
default.extendsFrom(configurations.publishedRuntime.get())
|
||||
|
||||
dependencies {
|
||||
if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
archives(project(":kotlin-test:kotlin-test-js"))
|
||||
publishedRuntime(project(":kotlin-test:kotlin-test-js"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,12 +82,6 @@ val jar by tasks.creating(Jar::class) {
|
||||
}
|
||||
|
||||
artifacts {
|
||||
add(
|
||||
"archives",
|
||||
jar.archiveFile.get().asFile
|
||||
) {
|
||||
builtBy(jar)
|
||||
}
|
||||
add(configurations.archives.name, jar)
|
||||
add(configurations.publishedRuntime.name, jar)
|
||||
}
|
||||
|
||||
publishWithLegacyMavenPlugin()
|
||||
Reference in New Issue
Block a user