Shadow Gradle plugin 3rd party dependencies
Such dependencies will be embedded into plugin jar and their package will be relocated. This is need to avoid dependency conflicts with user build scripts dependencies or other Gradle plugins. Kotlin project dependencies are not shadowed. ^KT-46034 Fixed
This commit is contained in:
@@ -1846,6 +1846,12 @@
|
||||
<sha256 value="4a5aa70cc968a4d137e599ad37553e5cfeed2265e8c193476d7119036c536fe7" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.guava" name="guava" version="28.2-jre">
|
||||
<artifact name="guava-28.2-jre.jar">
|
||||
<md5 value="33083157d8725e867b2c71fb4ddf5e59" origin="Generated by Gradle"/>
|
||||
<sha256 value="fc3aa363ad87223d1fbea584eee015a862150f6d34c71f24dc74088a635f08ef" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.google.guava" name="guava" version="29.0-jre">
|
||||
<artifact name="guava-29.0-jre.jar">
|
||||
<md5 value="c87962fe0522b105531f37fe351b3b0c" origin="Generated by Gradle"/>
|
||||
@@ -3023,6 +3029,12 @@
|
||||
</sha256>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="de.undercouch" name="gradle-download-task" version="5.1.0">
|
||||
<artifact name="gradle-download-task-5.1.0.jar">
|
||||
<md5 value="d1acaba482d8b278952608aab95d941b" origin="Generated by Gradle"/>
|
||||
<sha256 value="ef21232955e314d621638b971da4ad786f04fe0cc608837d696bb2af3ec574ee" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="dev.gradleplugins" name="gradle-api" version="6.1">
|
||||
<artifact name="gradle-api-6.1.jar">
|
||||
<md5 value="22dfc96d7c3fd7d324d3fdc998a1bfd9" origin="Generated by Gradle"/>
|
||||
@@ -5806,6 +5818,12 @@
|
||||
<sha256 value="deb10353dd2b1bee0e548b74014d80a1179a8faaf8d0d886c01b4d6ca9300068" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.checkerframework" name="checker-qual" version="2.10.0">
|
||||
<artifact name="checker-qual-2.10.0.jar">
|
||||
<md5 value="ef26289b4355269fa45ca0174d4d6652" origin="Generated by Gradle"/>
|
||||
<sha256 value="d261fde25d590f6b69db7721d469ac1b0a19a17ccaaaa751c31f0d8b8260b894" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.checkerframework" name="checker-qual" version="2.11.1">
|
||||
<artifact name="checker-qual-2.11.1.jar">
|
||||
<md5 value="936884d7b04ee8f064df137bcdfe470d" origin="Generated by Gradle"/>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import org.jetbrains.dokka.gradle.DokkaTask
|
||||
import org.jetbrains.kotlin.pill.PillExtension
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import com.github.jengelman.gradle.plugins.shadow.transformers.DontIncludeResourceTransformer
|
||||
|
||||
plugins {
|
||||
id("gradle-plugin-common-configuration")
|
||||
@@ -54,18 +56,18 @@ dependencies {
|
||||
commonCompileOnly(intellijCore())
|
||||
commonCompileOnly(commonDependency("org.jetbrains.teamcity:serviceMessages"))
|
||||
commonCompileOnly("com.gradle:gradle-enterprise-gradle-plugin:3.9")
|
||||
commonCompileOnly(commonDependency("com.google.code.gson:gson"))
|
||||
commonCompileOnly(commonDependency("com.google.guava:guava"))
|
||||
commonCompileOnly("de.undercouch:gradle-download-task:4.1.1")
|
||||
commonCompileOnly("com.github.gundy:semver4j:0.16.4:nodeps") {
|
||||
exclude(group = "*")
|
||||
}
|
||||
commonCompileOnly(project(":kotlin-tooling-metadata"))
|
||||
|
||||
commonImplementation(project(":kotlin-gradle-plugin-idea"))
|
||||
commonImplementation(project(":kotlin-util-klib"))
|
||||
commonImplementation(project(":native:kotlin-klib-commonizer-api"))
|
||||
commonImplementation(project(":kotlin-tooling-metadata"))
|
||||
commonImplementation(project(":kotlin-project-model"))
|
||||
commonImplementation(commonDependency("com.google.code.gson:gson"))
|
||||
commonImplementation(commonDependency("com.google.guava:guava"))
|
||||
commonImplementation("de.undercouch:gradle-download-task:4.1.1")
|
||||
commonImplementation("com.github.gundy:semver4j:0.16.4:nodeps") {
|
||||
exclude(group = "*")
|
||||
}
|
||||
|
||||
commonRuntimeOnly(project(":kotlin-compiler-embeddable"))
|
||||
commonRuntimeOnly(project(":kotlin-annotation-processing-gradle"))
|
||||
@@ -80,6 +82,11 @@ dependencies {
|
||||
embedded(commonDependency("com.google.code.gson:gson")) { isTransitive = false }
|
||||
embedded(commonDependency("com.google.guava:guava")) { isTransitive = false }
|
||||
embedded(commonDependency("org.jetbrains.teamcity:serviceMessages")) { isTransitive = false }
|
||||
embedded(project(":kotlin-tooling-metadata")) { isTransitive = false }
|
||||
embedded("de.undercouch:gradle-download-task:4.1.1")
|
||||
embedded("com.github.gundy:semver4j:0.16.4:nodeps") {
|
||||
exclude(group = "*")
|
||||
}
|
||||
|
||||
if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
"functionalTestImplementation"("com.android.tools.build:gradle:4.0.1") {
|
||||
@@ -87,6 +94,7 @@ dependencies {
|
||||
}
|
||||
"functionalTestImplementation"(gradleKotlinDsl())
|
||||
"functionalTestImplementation"(project(":kotlin-gradle-plugin-kpm-android"))
|
||||
"functionalTestImplementation"(project(":kotlin-tooling-metadata"))
|
||||
"functionalTestImplementation"(testFixtures(project(":kotlin-gradle-plugin-idea")))
|
||||
}
|
||||
|
||||
@@ -102,6 +110,7 @@ dependencies {
|
||||
testImplementation(project(":kotlin-test:kotlin-test-junit"))
|
||||
testImplementation(commonDependency("junit:junit"))
|
||||
testImplementation(project(":kotlin-gradle-statistics"))
|
||||
testImplementation(project(":kotlin-tooling-metadata"))
|
||||
}
|
||||
|
||||
if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
@@ -135,6 +144,17 @@ tasks {
|
||||
register("dokka") {
|
||||
dependsOn(named("dokkaJavadoc"))
|
||||
}
|
||||
|
||||
withType<ShadowJar>().configureEach {
|
||||
relocate("com.github.gundy", "$kotlinEmbeddableRootPackage.com.github.gundy")
|
||||
relocate("de.undercouch.gradle.tasks.download", "$kotlinEmbeddableRootPackage.de.undercouch.gradle.tasks.download")
|
||||
|
||||
// don't expose external Gradle plugin marker
|
||||
// workaround from https://github.com/johnrengelman/shadow/issues/505#issuecomment-644098082
|
||||
transform(DontIncludeResourceTransformer::class.java) {
|
||||
resource = "META-INF/gradle-plugins/de.undercouch.download.properties"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
projectTest {
|
||||
|
||||
@@ -7,6 +7,7 @@ plugins {
|
||||
publish()
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
configureKotlinCompileTasksGradleCompatibility()
|
||||
|
||||
dependencies {
|
||||
implementation(kotlinStdlib())
|
||||
|
||||
@@ -7,7 +7,6 @@ description = "Atomicfu Compiler Plugin"
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
id("de.undercouch.download")
|
||||
}
|
||||
|
||||
val antLauncherJar by configurations.creating
|
||||
|
||||
@@ -16,6 +16,10 @@ pluginManagement {
|
||||
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies" }
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "de.undercouch.download" version "5.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
|
||||
@@ -2,6 +2,7 @@ plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
kotlin("plugin.serialization")
|
||||
id("de.undercouch.download")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
Reference in New Issue
Block a user