[repo] Migrate Groovy build scripts to use 'javadocJar()' directly from buildSrc
This commit is contained in:
committed by
Space Team
parent
5de2b5aeb4
commit
6d5f1c84a7
@@ -1,4 +1,5 @@
|
|||||||
@file:Suppress("unused") // usages in build scripts are not tracked properly
|
@file:Suppress("unused") // usages in build scripts are not tracked properly
|
||||||
|
@file:JvmName("RepoArtifacts")
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
@@ -219,6 +220,7 @@ fun Jar.addEmbeddedSources(configurationName: String = "embedded") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmOverloads
|
||||||
fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
||||||
configure<JavaPluginExtension> {
|
configure<JavaPluginExtension> {
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
@@ -249,7 +249,7 @@ publishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactsKt.sourcesJar(project) {
|
RepoArtifacts.sourcesJar(project) {
|
||||||
it.from(sourceSets["cli_bc"].allSource)
|
it.from(sourceSets["cli_bc"].allSource)
|
||||||
it.from(sourceSets["compiler"].allSource)
|
it.from(sourceSets["compiler"].allSource)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ task preparePublication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ext.configurePublishing = { Project project, configure = { } ->
|
ext.configurePublishing = { Project project, configure = { } ->
|
||||||
ArtifactsKt.publish(project, false, true) { publication ->
|
RepoArtifacts.publish(project, false, true) { publication ->
|
||||||
configure.delegate = publication
|
configure.delegate = publication
|
||||||
configure()
|
configure()
|
||||||
}
|
}
|
||||||
@@ -74,14 +74,7 @@ ext.configureFrontendIr = { Project project ->
|
|||||||
|
|
||||||
allprojects { project ->
|
allprojects { project ->
|
||||||
project.ext.configureSourcesJar = { lambda = {} ->
|
project.ext.configureSourcesJar = { lambda = {} ->
|
||||||
ArtifactsKt.sourcesJar(project) { task ->
|
RepoArtifacts.sourcesJar(project) { task ->
|
||||||
lambda.delegate = task
|
|
||||||
lambda()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
project.ext.configureJavadocJar = { lambda = {} ->
|
|
||||||
ArtifactsKt.javadocJar(project) { task ->
|
|
||||||
lambda.delegate = task
|
lambda.delegate = task
|
||||||
lambda()
|
lambda()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ def shadowJarTask = EmbeddableKt.embeddableCompilerDummyForDependenciesRewriting
|
|||||||
project,
|
project,
|
||||||
"${EmbeddableKt.EMBEDDABLE_COMPILER_TASK_NAME}${sourceSet.jarTaskName.capitalize()}"
|
"${EmbeddableKt.EMBEDDABLE_COMPILER_TASK_NAME}${sourceSet.jarTaskName.capitalize()}"
|
||||||
) {
|
) {
|
||||||
ArtifactsKt.setupPublicJar(
|
RepoArtifacts.setupPublicJar(
|
||||||
it,
|
it,
|
||||||
jarTask.flatMap { it.archiveBaseName },
|
jarTask.flatMap { it.archiveBaseName },
|
||||||
jarTask.flatMap { it.archiveClassifier }
|
jarTask.flatMap { it.archiveClassifier }
|
||||||
)
|
)
|
||||||
ArtifactsKt.addEmbeddedRuntime(it)
|
RepoArtifacts.addEmbeddedRuntime(it)
|
||||||
it.from(sourceSet.output)
|
it.from(sourceSet.output)
|
||||||
|
|
||||||
// When Gradle traverses the inputs, reject the shaded compiler JAR,
|
// When Gradle traverses the inputs, reject the shaded compiler JAR,
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile) {
|
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile) {
|
||||||
kotlinOptions.freeCompilerArgs += ["-Xallow-kotlin-package", "-opt-in=kotlin.RequiresOptIn"]
|
kotlinOptions.freeCompilerArgs += ["-Xallow-kotlin-package", "-opt-in=kotlin.RequiresOptIn"]
|
||||||
|
|||||||
@@ -88,4 +88,4 @@ artifacts {
|
|||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
|
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.freeCompilerArgs = [
|
kotlinOptions.freeCompilerArgs = [
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.freeCompilerArgs = [
|
kotlinOptions.freeCompilerArgs = [
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ jar {
|
|||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
|
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.freeCompilerArgs = [
|
kotlinOptions.freeCompilerArgs = [
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.freeCompilerArgs = [
|
kotlinOptions.freeCompilerArgs = [
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
sourcesJar.dependsOn(":prepare:build.version:writeStdlibVersion")
|
sourcesJar.dependsOn(":prepare:build.version:writeStdlibVersion")
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_8)
|
|||||||
|
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ apply plugin: 'kotlin'
|
|||||||
|
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api project(':kotlin-stdlib')
|
api project(':kotlin-stdlib')
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ apply plugin: 'kotlin-platform-js'
|
|||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
|
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
sources
|
sources
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ archivesBaseName = 'kotlin-stdlib'
|
|||||||
JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_8)
|
JvmToolchain.configureJvmToolchain(project, JdkMajorVersion.JDK_1_8)
|
||||||
|
|
||||||
configurePublishing(project)
|
configurePublishing(project)
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.freeCompilerArgs = [
|
kotlinOptions.freeCompilerArgs = [
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ dependencies {
|
|||||||
embedded(project(":kotlinx-serialization-compiler-plugin")) { transitive = false }
|
embedded(project(":kotlinx-serialization-compiler-plugin")) { transitive = false }
|
||||||
}
|
}
|
||||||
|
|
||||||
ArtifactsKt.runtimeJar(project, {})
|
RepoArtifacts.runtimeJar(project, {})
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configureSourcesJar()
|
configureSourcesJar()
|
||||||
configureJavadocJar()
|
RepoArtifacts.javadocJar(project)
|
||||||
|
|
||||||
compileKotlin {
|
compileKotlin {
|
||||||
kotlinOptions.freeCompilerArgs = [
|
kotlinOptions.freeCompilerArgs = [
|
||||||
|
|||||||
Reference in New Issue
Block a user