Build: Rework runtimeJar helper and drop redundant configuration
#KTI-559
This commit is contained in:
@@ -547,8 +547,6 @@ allprojects {
|
||||
tasks {
|
||||
register("listArchives") { listConfigurationContents("archives") }
|
||||
|
||||
register("listRuntimeJar") { listConfigurationContents("runtimeJar") }
|
||||
|
||||
register("listDistJar") { listConfigurationContents("distJar") }
|
||||
|
||||
// Aggregate task for build related checks
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@file:Suppress("unused") // usages in build scripts are not tracked properly
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.gradle.publish.PublishTask
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.Task
|
||||
@@ -8,8 +9,6 @@ import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.artifacts.ConfigurationContainer
|
||||
import org.gradle.api.artifacts.PublishArtifact
|
||||
import org.gradle.api.artifacts.component.ProjectComponentIdentifier
|
||||
import org.gradle.api.attributes.Bundling
|
||||
import org.gradle.api.attributes.Category
|
||||
import org.gradle.api.attributes.LibraryElements
|
||||
import org.gradle.api.attributes.Usage
|
||||
import org.gradle.api.component.AdhocComponentWithVariants
|
||||
@@ -68,15 +67,9 @@ fun Project.noDefaultJar() {
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.runtimeJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> = runtimeJar(getOrCreateTask("jar", body)) { }
|
||||
|
||||
fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {}): TaskProvider<T> {
|
||||
|
||||
tasks.named<Jar>("jar").configure {
|
||||
removeArtifacts(configurations.getOrCreate("archives"), this)
|
||||
}
|
||||
|
||||
task.configure {
|
||||
fun Project.runtimeJar(body: Jar.() -> Unit = {}): TaskProvider<out Jar> {
|
||||
val jarTask = tasks.named<Jar>("jar")
|
||||
jarTask.configure {
|
||||
configurations.findByName("embedded")?.let { embedded ->
|
||||
dependsOn(embedded)
|
||||
from {
|
||||
@@ -88,29 +81,23 @@ fun <T : Jar> Project.runtimeJar(task: TaskProvider<T>, body: T.() -> Unit = {})
|
||||
body()
|
||||
}
|
||||
|
||||
return jarTask
|
||||
}
|
||||
|
||||
fun Project.runtimeJar(task: TaskProvider<ShadowJar>, body: ShadowJar.() -> Unit = {}): TaskProvider<out Jar> {
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
task.configure {
|
||||
configurations = configurations + listOf(project.configurations["embedded"])
|
||||
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
body()
|
||||
}
|
||||
|
||||
project.addArtifact("archives", task, task)
|
||||
project.addArtifact("runtimeJar", task, task)
|
||||
project.configurations.findByName("runtime")?.let {
|
||||
project.addArtifact(it.name, task, task)
|
||||
}
|
||||
|
||||
val runtimeJar = configurations.maybeCreate("runtimeJar").apply {
|
||||
isCanBeConsumed = true
|
||||
isCanBeResolved = false
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))
|
||||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
|
||||
}
|
||||
}
|
||||
|
||||
configurePublishedComponent {
|
||||
withVariantsFromConfiguration(configurations[RUNTIME_ELEMENTS_CONFIGURATION_NAME]) { skip() }
|
||||
addVariantsFromConfiguration(runtimeJar) { }
|
||||
}
|
||||
|
||||
(components.findByName("java") as AdhocComponentWithVariants?)?.addVariantsFromConfiguration(runtimeJar) { }
|
||||
project.addArtifact("runtimeElements", task, task)
|
||||
project.addArtifact("apiElements", task, task)
|
||||
|
||||
return task
|
||||
}
|
||||
|
||||
@@ -108,8 +108,6 @@ fun Project.kotlinBuiltins(forJvm: Boolean): Any =
|
||||
else dependencies.project(":core:builtins", configuration = "runtimeElementsJvm".takeIf { forJvm })
|
||||
|
||||
fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
|
||||
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
|
||||
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
|
||||
|
||||
enum class JpsDepScope {
|
||||
COMPILE, TEST, RUNTIME, PROVIDED
|
||||
|
||||
@@ -4,12 +4,13 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.DependencySubstitution
|
||||
import org.gradle.api.artifacts.component.ProjectComponentSelector
|
||||
import org.gradle.api.attributes.LibraryElements
|
||||
import org.gradle.api.attributes.Usage
|
||||
import org.gradle.api.file.DuplicatesStrategy
|
||||
import org.gradle.api.tasks.TaskProvider
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.gradle.kotlin.dsl.named
|
||||
import org.gradle.kotlin.dsl.project
|
||||
import org.gradle.kotlin.dsl.provideDelegate
|
||||
import org.gradle.kotlin.dsl.register
|
||||
import java.io.File
|
||||
|
||||
@@ -69,10 +70,18 @@ private fun ShadowJar.configureEmbeddableCompilerRelocation(withJavaxInject: Boo
|
||||
}
|
||||
}
|
||||
|
||||
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): TaskProvider<out ShadowJar> {
|
||||
private fun Project.compilerShadowJar(taskName: String, body: ShadowJar.() -> Unit): TaskProvider<ShadowJar> {
|
||||
|
||||
val compilerJar = configurations.getOrCreate("compilerJar")
|
||||
dependencies.add(compilerJar.name, dependencies.project(":kotlin-compiler", configuration = "runtimeJar"))
|
||||
val compilerJar = configurations.getOrCreate("compilerJar").apply {
|
||||
isCanBeConsumed = false
|
||||
isCanBeResolved = true
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
|
||||
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.JAR))
|
||||
}
|
||||
}
|
||||
|
||||
dependencies.add(compilerJar.name, dependencies.project(":kotlin-compiler")) { isTransitive = false }
|
||||
|
||||
return tasks.register<ShadowJar>(taskName) {
|
||||
destinationDirectory.set(project.file(File(buildDir, "libs")))
|
||||
@@ -100,7 +109,7 @@ fun Project.configureShadowJarSubstitutionInCompileClasspath() {
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<out ShadowJar> =
|
||||
fun Project.embeddableCompiler(taskName: String = "embeddable", body: ShadowJar.() -> Unit = {}): TaskProvider<ShadowJar> =
|
||||
compilerShadowJar(taskName) {
|
||||
configureEmbeddableCompilerRelocation()
|
||||
body()
|
||||
@@ -141,8 +150,8 @@ fun Project.embeddableCompilerDummyForDependenciesRewriting(
|
||||
}
|
||||
|
||||
fun Project.rewriteDepsToShadedJar(
|
||||
originalJarTask: TaskProvider<out Jar>, shadowJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}
|
||||
): TaskProvider<out Jar> {
|
||||
originalJarTask: TaskProvider<out Jar>, shadowJarTask: TaskProvider<ShadowJar>, body: Jar.() -> Unit = {}
|
||||
): TaskProvider<ShadowJar> {
|
||||
originalJarTask.configure {
|
||||
archiveClassifier.set("original")
|
||||
}
|
||||
@@ -154,7 +163,7 @@ fun Project.rewriteDepsToShadedJar(
|
||||
|
||||
// When Gradle traverses the inputs, reject the shaded compiler JAR,
|
||||
// which leads to the content of that JAR being excluded as well:
|
||||
val compilerDummyJarFile = project.provider { configurations.getByName("compilerDummyJar").singleFile }
|
||||
val compilerDummyJarFile = project.provider { project.configurations.getByName("compilerDummyJar").singleFile }
|
||||
exclude { it.file == compilerDummyJarFile.get() }
|
||||
|
||||
archiveClassifier.set("original")
|
||||
@@ -163,8 +172,8 @@ fun Project.rewriteDepsToShadedJar(
|
||||
return shadowJarTask
|
||||
}
|
||||
|
||||
fun Project.rewriteDepsToShadedCompiler(originalJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
|
||||
fun Project.rewriteDepsToShadedCompiler(originalJarTask: TaskProvider<out Jar>, body: Jar.() -> Unit = {}): TaskProvider<ShadowJar> =
|
||||
rewriteDepsToShadedJar(originalJarTask, embeddableCompilerDummyForDependenciesRewriting(), body)
|
||||
|
||||
fun Project.rewriteDefaultJarDepsToShadedCompiler(body: Jar.() -> Unit = {}): TaskProvider<out Jar> =
|
||||
fun Project.rewriteDefaultJarDepsToShadedCompiler(body: Jar.() -> Unit = {}): TaskProvider<ShadowJar> =
|
||||
rewriteDepsToShadedJar(tasks.named<Jar>("jar"), embeddableCompilerDummyForDependenciesRewriting(), body)
|
||||
|
||||
@@ -12,10 +12,10 @@ dependencies {
|
||||
compileOnly(project(":compiler:frontend.java"))
|
||||
compileOnly(project(":daemon-common"))
|
||||
compileOnly(project(":daemon-common-new"))
|
||||
api(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
api(project(":kotlin-daemon-client"))
|
||||
compileOnly(project(":compiler:util"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-compiler-embeddable"))
|
||||
runtimeOnly(project(":kotlin-compiler-embeddable"))
|
||||
api(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ dependencies {
|
||||
testApi(commonDep("junit:junit"))
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testCompileOnly(project(":kotlin-test:kotlin-test-junit"))
|
||||
testApi(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
testApi(projectRuntimeJar(":kotlin-daemon-client-new"))
|
||||
testApi(project(":kotlin-daemon-client"))
|
||||
testApi(project(":kotlin-daemon-client-new"))
|
||||
testCompileOnly(project(":kotlin-daemon"))
|
||||
testApi(projectTests(":compiler:tests-common"))
|
||||
testApi(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
|
||||
|
||||
@@ -13,12 +13,13 @@ project.buildscript.repositories {
|
||||
project.buildscript.dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}"
|
||||
}
|
||||
|
||||
configurations {
|
||||
kotlinCompilerClasspath
|
||||
}
|
||||
|
||||
if (!(project.findProperty("withoutEmbedabble")?.toString()?.toBoolean() ?: false)) {
|
||||
project.dependencies {
|
||||
kotlinCompilerClasspath(project(path: ":kotlin-compiler-embeddable", configuration: "runtimeJar"))
|
||||
kotlinCompilerClasspath(project(":kotlin-compiler-embeddable"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ dependencies {
|
||||
kotlinNativeEmbedded(project(":kotlin-native:utilities:basic-utils"))
|
||||
kotlinNativeEmbedded(project(":kotlin-native:klib"))
|
||||
kotlinNativeEmbedded(project(":kotlin-native:endorsedLibraries:kotlinx.cli", "jvmRuntimeElements"))
|
||||
kotlinNativeEmbedded(project(":kotlin-compiler", configuration = "runtimeJar"))
|
||||
kotlinNativeEmbedded(project(":kotlin-compiler")) { isTransitive = false }
|
||||
testImplementation(commonDep("junit:junit"))
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
}
|
||||
|
||||
@@ -22,9 +22,9 @@ dependencies {
|
||||
testApi(kotlinStdlib())
|
||||
testApi(project(":kotlin-script-runtime"))
|
||||
testApi(project(":kotlin-script-util"))
|
||||
testApi(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
testApi(projectRuntimeJar(":kotlin-daemon-embeddable"))
|
||||
testApi(projectRuntimeJar(":kotlin-compiler-embeddable"))
|
||||
testApi(project(":kotlin-daemon-client"))
|
||||
testApi(project(":kotlin-daemon-embeddable"))
|
||||
testApi(project(":kotlin-compiler-embeddable"))
|
||||
testApi(commonDep("junit:junit"))
|
||||
testApi(project(":kotlin-test:kotlin-test-junit"))
|
||||
testRuntimeOnly(project(":kotlin-reflect"))
|
||||
|
||||
@@ -56,8 +56,6 @@ if (deployVersion != null) {
|
||||
publish()
|
||||
}
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
runtimeJar(tasks.register<ShadowJar>("shadowJar")) {
|
||||
callGroovy("manifestAttributes", manifest, project)
|
||||
manifest.attributes["Implementation-Version"] = version
|
||||
|
||||
@@ -24,6 +24,7 @@ sourceSets {
|
||||
val shadows by configurations.creating {
|
||||
isTransitive = false
|
||||
}
|
||||
|
||||
configurations.getByName("compileOnly").extendsFrom(shadows)
|
||||
configurations.getByName("testApi").extendsFrom(shadows)
|
||||
|
||||
@@ -44,8 +45,6 @@ if (deployVersion != null) {
|
||||
publish()
|
||||
}
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
runtimeJar(tasks.register<ShadowJar>("shadowJar")) {
|
||||
callGroovy("manifestAttributes", manifest, project)
|
||||
manifest.attributes["Implementation-Version"] = version
|
||||
|
||||
@@ -69,4 +69,5 @@ task java9Jar(type: Jar) {
|
||||
|
||||
artifacts {
|
||||
archives java9Jar
|
||||
runtimeElements java9Jar
|
||||
}
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
|
||||
description = "Kotlin Scripting JSR-223 support"
|
||||
|
||||
plugins { java }
|
||||
|
||||
val packedJars by configurations.creating
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
dependencies {
|
||||
packedJars(project(":kotlin-scripting-jsr223-unshaded")) { isTransitive = false }
|
||||
embedded(project(":kotlin-scripting-jsr223-unshaded")) { isTransitive = false }
|
||||
runtimeOnly(project(":kotlin-script-runtime"))
|
||||
runtimeOnly(kotlinStdlib())
|
||||
runtimeOnly(project(":kotlin-scripting-common"))
|
||||
@@ -26,12 +22,6 @@ sourceSets {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
runtimeJar(rewriteDepsToShadedCompiler(
|
||||
tasks.register<ShadowJar>("shadowJar") {
|
||||
from(packedJars)
|
||||
}
|
||||
))
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
@@ -21,8 +21,8 @@ dependencies {
|
||||
testRuntimeOnly(project(":kotlin-reflect"))
|
||||
|
||||
embeddableTestRuntime(commonDep("junit"))
|
||||
embeddableTestRuntime(project(":kotlin-scripting-jsr223", configuration = "runtimeElements"))
|
||||
embeddableTestRuntime(project(":kotlin-scripting-compiler-embeddable", configuration = "runtimeElements"))
|
||||
embeddableTestRuntime(project(":kotlin-scripting-jsr223"))
|
||||
embeddableTestRuntime(project(":kotlin-scripting-compiler-embeddable"))
|
||||
embeddableTestRuntime(testSourceSet.output)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
|
||||
description = "Kotlin Scripting JVM host (for using with embeddable compiler)"
|
||||
|
||||
plugins { java }
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
dependencies {
|
||||
embedded(project(":kotlin-scripting-jvm-host-unshaded")) { isTransitive = false }
|
||||
@@ -21,8 +21,6 @@ sourceSets {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
@@ -11,13 +11,12 @@ dependencies {
|
||||
api project(':kotlin-gradle-plugin-api')
|
||||
api project(':kotlin-gradle-plugin-model')
|
||||
|
||||
compileOnly project(path: ':kotlin-compiler-embeddable', configuration: 'runtimeJar')
|
||||
compileOnly project(':kotlin-compiler-embeddable')
|
||||
compileOnly project(':kotlin-allopen-compiler-plugin')
|
||||
|
||||
embedded(project(":kotlin-allopen-compiler-plugin")) { transitive = false }
|
||||
}
|
||||
|
||||
ArtifactsKt.noDefaultJar(project)
|
||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||
configureSourcesJar()
|
||||
configureJavadocJar()
|
||||
|
||||
@@ -12,7 +12,7 @@ val packedJars by configurations.creating
|
||||
dependencies {
|
||||
api(kotlinStdlib())
|
||||
packedJars(project(":kotlin-annotation-processing")) { isTransitive = false }
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-compiler-embeddable"))
|
||||
runtimeOnly(project(":kotlin-compiler-embeddable"))
|
||||
}
|
||||
|
||||
projectTest(parallel = true) {
|
||||
|
||||
@@ -14,6 +14,7 @@ val kotlinGradlePluginTest = project(":kotlin-gradle-plugin").sourceSets.named("
|
||||
|
||||
dependencies {
|
||||
testImplementation(project(":kotlin-gradle-plugin"))
|
||||
testImplementation(project(":kotlin-gradle-plugin-model"))
|
||||
testImplementation(project(":kotlin-project-model"))
|
||||
testImplementation(project(":kotlin-tooling-metadata"))
|
||||
testImplementation(kotlinGradlePluginTest)
|
||||
@@ -26,12 +27,12 @@ dependencies {
|
||||
testImplementation(project(":native:kotlin-native-utils"))
|
||||
testImplementation(project(":native:kotlin-klib-commonizer-api"))
|
||||
|
||||
testImplementation(projectRuntimeJar(":kotlin-compiler-embeddable"))
|
||||
testImplementation(project(":kotlin-compiler-embeddable"))
|
||||
testImplementation(intellijCoreDep()) { includeJars("jdom") }
|
||||
// testCompileOnly dependency on non-shaded artifacts is needed for IDE support
|
||||
// testRuntimeOnly on shaded artifact is needed for running tests with shaded compiler
|
||||
testCompileOnly(project(path = ":kotlin-gradle-plugin-test-utils-embeddable", configuration = "compile"))
|
||||
testRuntimeOnly(projectRuntimeJar(":kotlin-gradle-plugin-test-utils-embeddable"))
|
||||
testCompileOnly(project(":kotlin-gradle-plugin-test-utils-embeddable"))
|
||||
testRuntimeOnly(project(":kotlin-gradle-plugin-test-utils-embeddable"))
|
||||
|
||||
testImplementation(project(path = ":examples:annotation-processor-example"))
|
||||
testImplementation(kotlinStdlib("jdk8"))
|
||||
@@ -45,7 +46,7 @@ dependencies {
|
||||
testImplementation("com.google.code.gson:gson:${rootProject.extra["versions.jar.gson"]}")
|
||||
testApiJUnit5(vintageEngine = true, jupiterParams = true)
|
||||
|
||||
testRuntimeOnly(projectRuntimeJar(":kotlin-android-extensions"))
|
||||
testRuntimeOnly(project(":kotlin-android-extensions"))
|
||||
testRuntimeOnly(project(":compiler:tests-mutes"))
|
||||
|
||||
// Workaround for missing transitive import of the common(project `kotlin-test-common`
|
||||
|
||||
@@ -3,18 +3,12 @@
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
|
||||
description = "Shaded test jars from compiler for Gradle integration tests"
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
}
|
||||
|
||||
val packedJars by configurations.creating
|
||||
|
||||
val projectsToInclude = listOf(
|
||||
":compiler:test-infrastructure-utils",
|
||||
":compiler:tests-common",
|
||||
@@ -25,15 +19,10 @@ val projectsToInclude = listOf(
|
||||
dependencies {
|
||||
for (projectName in projectsToInclude) {
|
||||
api(projectTests(projectName)) { isTransitive = false }
|
||||
packedJars(projectTests(projectName)) { isTransitive = false }
|
||||
embedded(projectTests(projectName)) { isTransitive = false }
|
||||
}
|
||||
|
||||
packedJars(intellijDep()) { includeJars("idea_rt") }
|
||||
|
||||
embedded(intellijDep()) { includeJars("idea_rt") }
|
||||
}
|
||||
|
||||
runtimeJar(rewriteDepsToShadedCompiler(
|
||||
tasks.register<ShadowJar>("shadowJar") {
|
||||
from(packedJars)
|
||||
}
|
||||
))
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
@@ -16,8 +16,6 @@ configure<GradlePluginDevelopmentExtension> {
|
||||
isAutomatedPublishing = false
|
||||
}
|
||||
|
||||
val jarContents by configurations.creating
|
||||
|
||||
repositories {
|
||||
google()
|
||||
maven("https://plugins.gradle.org/m2/")
|
||||
@@ -66,14 +64,14 @@ dependencies {
|
||||
compileOnly(project(":kotlin-reflect"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-compiler-embeddable"))
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-annotation-processing-gradle"))
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-android-extensions"))
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-compiler-runner"))
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-scripting-compiler-embeddable"))
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-scripting-compiler-impl-embeddable"))
|
||||
runtimeOnly(project(":kotlin-compiler-embeddable"))
|
||||
runtimeOnly(project(":kotlin-annotation-processing-gradle"))
|
||||
runtimeOnly(project(":kotlin-android-extensions"))
|
||||
runtimeOnly(project(":kotlin-compiler-runner"))
|
||||
runtimeOnly(project(":kotlin-scripting-compiler-embeddable"))
|
||||
runtimeOnly(project(":kotlin-scripting-compiler-impl-embeddable"))
|
||||
|
||||
jarContents(compileOnly(intellijDep()) {
|
||||
embedded(compileOnly(intellijDep()) {
|
||||
includeJars("asm-all", "gson", "guava", "serviceMessages", rootProject = rootProject)
|
||||
})
|
||||
|
||||
@@ -105,17 +103,7 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
configurations.api.get().exclude("com.android.tools.external.com-intellij", "intellij-core")
|
||||
}
|
||||
|
||||
noDefaultJar()
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler()).configure {
|
||||
dependsOn(jarContents)
|
||||
|
||||
from {
|
||||
jarContents.asFileTree.map {
|
||||
if (it.endsWith(".jar")) zipTree(it)
|
||||
else it
|
||||
}
|
||||
}
|
||||
}
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
tasks {
|
||||
named<ProcessResources>("processResources") {
|
||||
|
||||
@@ -21,7 +21,6 @@ publishGradlePlugin()
|
||||
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
noDefaultJar()
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
tasks {
|
||||
|
||||
@@ -20,7 +20,6 @@ dependencies {
|
||||
embedded(project(":kotlin-noarg-compiler-plugin")) { transitive = false }
|
||||
}
|
||||
|
||||
ArtifactsKt.noDefaultJar(project)
|
||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||
|
||||
pluginBundle {
|
||||
|
||||
@@ -20,5 +20,4 @@ dependencies {
|
||||
embedded(project(":kotlin-sam-with-receiver-compiler-plugin")) { transitive = false }
|
||||
}
|
||||
|
||||
ArtifactsKt.noDefaultJar(project)
|
||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||
|
||||
@@ -14,7 +14,7 @@ dependencies {
|
||||
compileOnly(project(":compiler:cli"))
|
||||
compileOnly(project(":daemon-common"))
|
||||
compileOnly(project(":kotlin-scripting-compiler"))
|
||||
api(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
api(project(":kotlin-daemon-client"))
|
||||
compileOnly("org.jetbrains.kotlin:jcabi-aether:1.0-dev-3")
|
||||
compileOnly("org.sonatype.aether:aether-api:1.13.1")
|
||||
compileOnly("org.apache.maven:maven-core:3.0.3")
|
||||
|
||||
@@ -6,11 +6,6 @@ dependencies {
|
||||
embedded(project(":kotlinx-serialization-compiler-plugin")) { transitive = false }
|
||||
}
|
||||
|
||||
TaskProvider<Jar> jar = tasks.named("jar")
|
||||
jar.configure {
|
||||
manifestAttributes(manifest, project)
|
||||
}
|
||||
|
||||
ArtifactsKt.runtimeJar(project, jar, {})
|
||||
ArtifactsKt.runtimeJar(project, {})
|
||||
configureSourcesJar()
|
||||
configureJavadocJar()
|
||||
|
||||
@@ -12,7 +12,7 @@ dependencies {
|
||||
api project(':kotlin-gradle-plugin-api')
|
||||
|
||||
compileOnly kotlinStdlib()
|
||||
compileOnly project(path: ':kotlin-compiler-embeddable', configuration: 'runtimeJar')
|
||||
compileOnly project(':kotlin-compiler-embeddable')
|
||||
|
||||
embedded(project(":kotlinx-serialization-compiler-plugin")) { transitive = false }
|
||||
}
|
||||
@@ -21,7 +21,6 @@ jar {
|
||||
manifestAttributes(manifest, project)
|
||||
}
|
||||
|
||||
ArtifactsKt.noDefaultJar(project)
|
||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||
configureSourcesJar()
|
||||
configureJavadocJar()
|
||||
|
||||
@@ -26,13 +26,13 @@ dependencies {
|
||||
testImplementation(projectTests(":compiler:tests-common"))
|
||||
testImplementation(projectTests(":generators:test-generator"))
|
||||
|
||||
testRuntimeOnly(project(":kotlinx-metadata-jvm"/*, configuration = "runtime"*/))
|
||||
testRuntimeOnly(project(":kotlinx-metadata-jvm"))
|
||||
|
||||
testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
testRuntimeOnly(intellijDep()) { includeJars("platform-concurrency", "platform-objectSerializer") }
|
||||
|
||||
shadows(project(":kotlinx-metadata-jvm", configuration = "runtimeElements"))
|
||||
shadows(project(":kotlinx-metadata-jvm"))
|
||||
shadows("org.jetbrains.intellij.deps:asm-all:$kotlinpAsmVersion")
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@ sourceSets {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
sourcesJar { includeEmptyDirs = false; eachFile { exclude() } } // empty Jar, no public sources
|
||||
javadocJar { includeEmptyDirs = false; eachFile { exclude() } } // empty Jar, no public javadocs
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins { java }
|
||||
|
||||
description = "Kotlin Scripting Compiler Plugin for embeddable compiler"
|
||||
|
||||
val packedJars by configurations.creating
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
dependencies {
|
||||
packedJars(project(":kotlin-scripting-compiler")) { isTransitive = false }
|
||||
embedded(project(":kotlin-scripting-compiler")) { isTransitive = false }
|
||||
runtimeOnly(project(":kotlin-scripting-compiler-impl-embeddable"))
|
||||
runtimeOnly(kotlinStdlib())
|
||||
}
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
runtimeJar(rewriteDepsToShadedCompiler(
|
||||
tasks.register<ShadowJar>("shadowJar") {
|
||||
from(packedJars)
|
||||
}
|
||||
))
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins { java }
|
||||
|
||||
description = "Kotlin Compiler Infrastructure for Scripting for embeddable compiler"
|
||||
|
||||
val packedJars by configurations.creating
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
dependencies {
|
||||
packedJars(project(":kotlin-scripting-compiler-impl")) { isTransitive = false }
|
||||
embedded(project(":kotlin-scripting-compiler-impl")) { isTransitive = false }
|
||||
runtimeOnly(project(":kotlin-scripting-common"))
|
||||
runtimeOnly(project(":kotlin-scripting-jvm"))
|
||||
runtimeOnly(kotlinStdlib())
|
||||
@@ -14,11 +13,6 @@ dependencies {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
runtimeJar(rewriteDepsToShadedCompiler(
|
||||
tasks.register<ShadowJar>("shadowJar") {
|
||||
from(packedJars)
|
||||
}
|
||||
))
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
description = "Kotlin Scripting Compiler extension providing code completion and static analysis (for using in embeddable mode)"
|
||||
|
||||
plugins { java }
|
||||
plugins {
|
||||
java
|
||||
}
|
||||
|
||||
dependencies {
|
||||
embedded(project(":kotlin-scripting-ide-services-unshaded")) { isTransitive = false }
|
||||
@@ -20,8 +22,6 @@ sourceSets {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
|
||||
description = "Kotlin Android Extensions Compiler"
|
||||
|
||||
plugins {
|
||||
@@ -14,7 +11,7 @@ dependencies {
|
||||
compileOnly(project(":compiler:frontend.java"))
|
||||
compileOnly(project(":compiler:backend"))
|
||||
compileOnly(project(":kotlin-android-extensions-runtime"))
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-compiler-embeddable"))
|
||||
runtimeOnly(project(":kotlin-compiler-embeddable"))
|
||||
compileOnly(commonDep("com.google.android", "android"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
@@ -29,7 +26,6 @@ sourceSets {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
sourcesJar()
|
||||
|
||||
@@ -17,12 +17,12 @@ dependencies {
|
||||
embedded(project(":compiler:cli-common")) { isTransitive = false }
|
||||
embedded(project(":daemon-common")) { isTransitive = false }
|
||||
embedded(project(":daemon-common-new")) { isTransitive = false }
|
||||
embedded(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
embedded(project(":kotlin-daemon-client")) { isTransitive = false }
|
||||
|
||||
testApi(project(":compiler:cli-common"))
|
||||
testApi(project(":daemon-common"))
|
||||
testApi(project(":daemon-common-new"))
|
||||
testApi(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
testApi(project(":kotlin-daemon-client"))
|
||||
testApi(commonDep("junit:junit"))
|
||||
testApi(project(":kotlin-test:kotlin-test-jvm"))
|
||||
testApi(project(":kotlin-test:kotlin-test-junit"))
|
||||
|
||||
@@ -41,8 +41,6 @@ sourceSets {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
|
||||
// dummy is used for rewriting dependencies to the shaded packages in the embeddable compiler
|
||||
compilerDummyJar(compilerDummyForDependenciesRewriting("compilerDummy") {
|
||||
archiveClassifier.set("dummy")
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
|
||||
description = "Annotation Processor for Kotlin (for using with embeddable compiler)"
|
||||
|
||||
plugins {
|
||||
`java`
|
||||
java
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -12,7 +10,6 @@ dependencies {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
sourcesJar()
|
||||
|
||||
@@ -10,7 +10,6 @@ dependencies {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
sourcesJar()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
|
||||
description = "Parcelize compiler plugin"
|
||||
|
||||
plugins {
|
||||
@@ -13,7 +11,7 @@ dependencies {
|
||||
compileOnly(project(":compiler:frontend.java"))
|
||||
compileOnly(project(":compiler:backend"))
|
||||
compileOnly(project(":plugins:parcelize:parcelize-runtime"))
|
||||
runtimeOnly(projectRuntimeJar(":kotlin-compiler-embeddable"))
|
||||
runtimeOnly(project(":kotlin-compiler-embeddable"))
|
||||
compileOnly(commonDep("com.google.android", "android"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
@@ -28,7 +26,6 @@ sourceSets {
|
||||
|
||||
publish()
|
||||
|
||||
noDefaultJar()
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
sourcesJar()
|
||||
|
||||
Reference in New Issue
Block a user