Update Gradle plugins publishing setup
Simplifies and make it aligned with official documentation, which removes some old workarounds. Additionally, it enables publication of Gradle metadata file, which is required for plugin variants feature support. Instead of using 'gradleApi()' as Gradle API dependency, which provides build current Gradle version api, now setup is using "dev.gradleplugins:gradle-api" artifacts with specific Gradle version. This allows to have more fine-grained Gradle support for removed apis. ^KT-49227 In Progress
This commit is contained in:
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.Configuration
|
||||
import org.gradle.api.artifacts.ModuleDependency
|
||||
import org.gradle.api.plugins.JavaLibraryPlugin
|
||||
import org.gradle.api.plugins.JavaPlugin.JAVADOC_ELEMENTS_CONFIGURATION_NAME
|
||||
import org.gradle.api.plugins.JavaPlugin.SOURCES_ELEMENTS_CONFIGURATION_NAME
|
||||
import org.gradle.api.plugins.JavaPluginExtension
|
||||
import org.gradle.api.publish.PublishingExtension
|
||||
import org.gradle.api.publish.maven.MavenPublication
|
||||
import org.gradle.api.tasks.SourceSet
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.gradle.kotlin.dsl.*
|
||||
import org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin
|
||||
import org.jetbrains.dokka.gradle.DokkaTask
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import plugins.configureDefaultPublishing
|
||||
import plugins.configureKotlinPomAttributes
|
||||
|
||||
/**
|
||||
* Configures common pom configuration parameters
|
||||
*/
|
||||
fun Project.configureCommonPublicationSettingsForGradle() {
|
||||
plugins.withId("maven-publish") {
|
||||
configureDefaultPublishing()
|
||||
|
||||
extensions.configure<PublishingExtension> {
|
||||
publications
|
||||
.withType<MavenPublication>()
|
||||
.configureEach {
|
||||
configureKotlinPomAttributes(project)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* These dependencies will be provided by Gradle, and we should prevent version conflict
|
||||
*/
|
||||
fun Configuration.excludeGradleCommonDependencies() {
|
||||
dependencies
|
||||
.withType<ModuleDependency>()
|
||||
.configureEach {
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-script-runtime")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude Gradle runtime from given SourceSet configurations.
|
||||
*/
|
||||
fun Project.excludeGradleCommonDependencies(sourceSet: SourceSet) {
|
||||
configurations[sourceSet.implementationConfigurationName].excludeGradleCommonDependencies()
|
||||
configurations[sourceSet.apiConfigurationName].excludeGradleCommonDependencies()
|
||||
configurations[sourceSet.runtimeOnlyConfigurationName].excludeGradleCommonDependencies()
|
||||
}
|
||||
|
||||
/**
|
||||
* 'main' sources are used for Gradle 6.1-6.9 versions.
|
||||
* Directories are renamed into 'src/gradle61'.
|
||||
*/
|
||||
fun Project.configureGradlePluginCommonSettings() {
|
||||
sourceSets.named(SourceSet.MAIN_SOURCE_SET_NAME) {
|
||||
plugins.withType<JavaGradlePluginPlugin>().configureEach {
|
||||
// Removing Gradle api default dependency added by 'java-gradle-plugin'
|
||||
configurations[apiConfigurationName].dependencies.remove(dependencies.gradleApi())
|
||||
}
|
||||
|
||||
dependencies {
|
||||
"compileOnly"(kotlinStdlib())
|
||||
// Decoupling gradle-api artifact from current project Gradle version. Later would be useful for
|
||||
// gradle plugin variants
|
||||
"compileOnly"("dev.gradleplugins:gradle-api:7.1.1")
|
||||
if (this@configureGradlePluginCommonSettings.name != "kotlin-gradle-plugin-api") {
|
||||
"api"(project(":kotlin-gradle-plugin-api"))
|
||||
}
|
||||
}
|
||||
|
||||
excludeGradleCommonDependencies(this)
|
||||
|
||||
tasks.withType<Jar>().configureEach {
|
||||
if (name == jarTaskName) {
|
||||
setupPublicJar(archiveBaseName.get())
|
||||
addEmbeddedRuntime()
|
||||
} else if (name == sourcesJarTaskName) {
|
||||
addEmbeddedSources()
|
||||
|
||||
configurePublishedComponent {
|
||||
addVariantsFromConfiguration(configurations[SOURCES_ELEMENTS_CONFIGURATION_NAME]) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins.withType<JavaLibraryPlugin>().configureEach {
|
||||
this@configureGradlePluginCommonSettings
|
||||
.extensions
|
||||
.configure<JavaPluginExtension> {
|
||||
withSourcesJar()
|
||||
withJavadocJar()
|
||||
}
|
||||
}
|
||||
|
||||
plugins.withId("org.jetbrains.dokka") {
|
||||
val dokkaTask = tasks.named<DokkaTask>("dokkaJavadoc")
|
||||
|
||||
tasks.withType<Jar>().configureEach {
|
||||
if (name == javadocJarTaskName) {
|
||||
from(dokkaTask.flatMap { it.outputDirectory })
|
||||
|
||||
configurePublishedComponent {
|
||||
addVariantsFromConfiguration(configurations[JAVADOC_ELEMENTS_CONFIGURATION_NAME]) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.configureKotlinCompileTasksGradleCompatibility() {
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions.languageVersion = "1.4"
|
||||
kotlinOptions.apiVersion = "1.4"
|
||||
kotlinOptions.freeCompilerArgs += listOf(
|
||||
"-Xskip-prerelease-check",
|
||||
"-Xsuppress-version-warnings",
|
||||
"-Xuse-ir" // Needed as long as languageVersion is less than 1.5.
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -67,15 +67,19 @@ fun Project.noDefaultJar() {
|
||||
}
|
||||
}
|
||||
|
||||
fun Jar.addEmbeddedRuntime() {
|
||||
project.configurations.findByName("embedded")?.let { embedded ->
|
||||
dependsOn(embedded)
|
||||
from {
|
||||
embedded.map(project::zipTree)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
embedded.map(::zipTree)
|
||||
}
|
||||
}
|
||||
addEmbeddedRuntime()
|
||||
setupPublicJar(project.extensions.getByType<BasePluginExtension>().archivesName.get())
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
body()
|
||||
@@ -102,34 +106,22 @@ fun Project.runtimeJar(task: TaskProvider<ShadowJar>, body: ShadowJar.() -> Unit
|
||||
return task
|
||||
}
|
||||
|
||||
private fun Project.mainJavaPluginSourceSet() = findJavaPluginExtension()?.sourceSets?.findByName("main")
|
||||
private fun Project.mainKotlinSourceSet() =
|
||||
(extensions.findByName("kotlin") as? KotlinSourceSetContainer)?.sourceSets?.findByName("main")
|
||||
private fun Project.sources() = mainJavaPluginSourceSet()?.allSource ?: mainKotlinSourceSet()?.kotlin
|
||||
|
||||
fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
||||
configure<JavaPluginExtension> {
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
val sourcesJar = getOrCreateTask<Jar>("sourcesJar") {
|
||||
fun Project.mainJavaPluginSourceSet() = findJavaPluginExtension()?.sourceSets?.findByName("main")
|
||||
fun Project.mainKotlinSourceSet() =
|
||||
(extensions.findByName("kotlin") as? KotlinSourceSetContainer)?.sourceSets?.findByName("main")
|
||||
|
||||
fun Project.sources() = mainJavaPluginSourceSet()?.allSource ?: mainKotlinSourceSet()?.kotlin
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
archiveClassifier.set("sources")
|
||||
|
||||
from(project.sources())
|
||||
|
||||
project.configurations.findByName("embedded")?.let { embedded ->
|
||||
from(provider {
|
||||
embedded.resolvedConfiguration
|
||||
.resolvedArtifacts
|
||||
.map { it.id.componentIdentifier }
|
||||
.filterIsInstance<ProjectComponentIdentifier>()
|
||||
.mapNotNull {
|
||||
project(it.projectPath).sources()
|
||||
}
|
||||
})
|
||||
}
|
||||
addEmbeddedSources()
|
||||
|
||||
body()
|
||||
}
|
||||
@@ -144,6 +136,20 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
||||
return sourcesJar
|
||||
}
|
||||
|
||||
fun Jar.addEmbeddedSources() {
|
||||
project.configurations.findByName("embedded")?.let { embedded ->
|
||||
from(project.provider {
|
||||
embedded.resolvedConfiguration
|
||||
.resolvedArtifacts
|
||||
.map { it.id.componentIdentifier }
|
||||
.filterIsInstance<ProjectComponentIdentifier>()
|
||||
.mapNotNull {
|
||||
project.project(it.projectPath).sources()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.javadocJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
||||
configure<JavaPluginExtension> {
|
||||
withJavadocJar()
|
||||
|
||||
@@ -2,50 +2,39 @@
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import com.gradle.publish.PluginBundleExtension
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
`java-gradle-plugin`
|
||||
id("org.jetbrains.dokka")
|
||||
`maven-publish`
|
||||
id("com.gradle.plugin-publish")
|
||||
}
|
||||
|
||||
publishGradlePlugin()
|
||||
standardPublicJars()
|
||||
|
||||
configureCommonPublicationSettingsForGradle()
|
||||
configureKotlinCompileTasksGradleCompatibility()
|
||||
extensions.extraProperties["kotlin.stdlib.default.dependency"] = "false"
|
||||
|
||||
dependencies {
|
||||
compileOnly(kotlinStdlib())
|
||||
compileOnly(gradleApi())
|
||||
// common plugin bundle configuration
|
||||
configure<PluginBundleExtension> {
|
||||
website = "https://kotlinlang.org/"
|
||||
vcsUrl = "https://github.com/jetbrains/kotlin"
|
||||
tags = listOf("kotlin")
|
||||
}
|
||||
|
||||
// These dependencies will be provided by Gradle and we should prevent version conflict
|
||||
fun Configuration.excludeGradleCommonDependencies() {
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
|
||||
exclude(group = "org.jetbrains.kotlin", module = "kotlin-script-runtime")
|
||||
}
|
||||
configurations {
|
||||
"implementation" {
|
||||
excludeGradleCommonDependencies()
|
||||
}
|
||||
"api" {
|
||||
excludeGradleCommonDependencies()
|
||||
configureGradlePluginCommonSettings()
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
withType<MavenPublication>().configureEach {
|
||||
if (name.endsWith("PluginMarkerMaven")) {
|
||||
pom {
|
||||
// https://github.com/gradle/gradle/issues/8754
|
||||
// and https://github.com/gradle/gradle/issues/6155
|
||||
packaging = "pom"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.languageVersion = "1.4"
|
||||
kotlinOptions.apiVersion = "1.4"
|
||||
kotlinOptions.freeCompilerArgs += listOf(
|
||||
"-Xskip-prerelease-check",
|
||||
"-Xsuppress-version-warnings",
|
||||
"-Xuse-ir" // Needed as long as languageVersion is less than 1.5.
|
||||
)
|
||||
}
|
||||
|
||||
tasks.named<Jar>("jar") {
|
||||
callGroovy("manifestAttributes", manifest, project)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
import plugins.KotlinBuildPublishingPlugin.Companion.DEFAULT_MAIN_PUBLICATION_NAME
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
kotlin("jvm")
|
||||
id("org.jetbrains.dokka")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
configureCommonPublicationSettingsForGradle()
|
||||
configureKotlinCompileTasksGradleCompatibility()
|
||||
extensions.extraProperties["kotlin.stdlib.default.dependency"] = "false"
|
||||
|
||||
configureGradlePluginCommonSettings()
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
register<MavenPublication>(DEFAULT_MAIN_PUBLICATION_NAME) {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2873,6 +2873,36 @@
|
||||
</sha256>
|
||||
</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"/>
|
||||
<sha256 value="30b79c1537c4b4b9ba816d026dfff48ddebaa8bc9f2bb716cc69066cea149c2b" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="dev.gradleplugins" name="gradle-api" version="6.9">
|
||||
<artifact name="gradle-api-6.9.jar">
|
||||
<md5 value="54b9007742dec27e80c6623d11e57ed4" origin="Generated by Gradle"/>
|
||||
<sha256 value="e5a3ac109ba1f12c534fd9ba730146011e18209ad1dd6398308cf75d841d3aab" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="dev.gradleplugins" name="gradle-api" version="7.1">
|
||||
<artifact name="gradle-api-7.1.jar">
|
||||
<md5 value="f76bd8fc83c4d405ea5c511465fb8695" origin="Generated by Gradle"/>
|
||||
<sha256 value="584ba92aea00ffe3be168db491bc46bd004b3bfc8d3a5d1f55a086f2f8f77e8e" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="dev.gradleplugins" name="gradle-api" version="7.1.1">
|
||||
<artifact name="gradle-api-7.1.1.jar">
|
||||
<md5 value="41fcb06dc8e93297af85b50bf193ced0" origin="Generated by Gradle"/>
|
||||
<sha256 value="40dc5853f0bfac353b7d73739361a485512192950690be28ce3f736a04c500cb" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="dev.gradleplugins" name="gradle-api" version="7.2">
|
||||
<artifact name="gradle-api-7.2.jar">
|
||||
<md5 value="dce115967701cdcb0dd761dc46099061" origin="Generated by Gradle"/>
|
||||
<sha256 value="0b3e8478a8ed6bdb226941b313c1a06d50ef9d389d30cc82d7bc5985d94ed00f" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="google" name="android_m2repository" version="r44">
|
||||
<artifact name="android_m2repository-r44.zip">
|
||||
<md5 value="7ba987b0caec8b0facfddd60851abb50" origin="Generated by Gradle"/>
|
||||
@@ -4820,6 +4850,12 @@
|
||||
<sha256 value="876a76b663db6c7326ad234afe430c473d3261a06b3284f31d5eb4889d1c3084" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.maven" name="maven-model" version="3.6.1">
|
||||
<artifact name="maven-model-3.6.1.jar">
|
||||
<md5 value="1ace8205ba7933c0ecc73632f620ee59" origin="Generated by Gradle"/>
|
||||
<sha256 value="ab10ced4a0f692cae285effacc70d458806ede856b9a2b3b318de1eb2f2f3b05" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.apache.maven" name="maven-model" version="3.6.3">
|
||||
<artifact name="maven-model-3.6.3.jar">
|
||||
<md5 value="ebf3c5e5556a22271bf315d0cd5b2b56" origin="Generated by Gradle"/>
|
||||
@@ -5398,6 +5434,30 @@
|
||||
<sha256 value="8603d6d290aaef00882cffb39136825e5aab36f36cf5352e3f9bd90485ac3303" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.codehaus.groovy" name="groovy" version="2.5.12">
|
||||
<artifact name="groovy-2.5.12.jar">
|
||||
<md5 value="eef7d55f2237756e97fd9ce7f185d07a" origin="Generated by Gradle"/>
|
||||
<sha256 value="b4d38b093e203c78bac7c8a0f26a7cb393fc6077897f693874500d9e35a18ae9" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.codehaus.groovy" name="groovy" version="2.5.8">
|
||||
<artifact name="groovy-2.5.8.jar">
|
||||
<md5 value="7a8f4afa3610ad56c469c31ca62cb95e" origin="Generated by Gradle"/>
|
||||
<sha256 value="a388c9770b8500d27881a867a02f1b117f749e5d7593817876dd0aac24b0dd86" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.codehaus.groovy" name="groovy" version="3.0.7">
|
||||
<artifact name="groovy-3.0.7.jar">
|
||||
<md5 value="0035721b2c7c7a9a0e4fdf7ee3d615cc" origin="Generated by Gradle"/>
|
||||
<sha256 value="51d1777e8dd1f00e60ea56e00d8a354ff5aab1f00fc8464ae8d39d71867e401f" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.codehaus.groovy" name="groovy" version="3.0.8">
|
||||
<artifact name="groovy-3.0.8.jar">
|
||||
<md5 value="adb6080ad937294752daa7b89534d74a" origin="Generated by Gradle"/>
|
||||
<sha256 value="fa498879e6f46c63d4c37341f6f539a9d0c5be1153b60eba75b4929263549b04" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="org.codehaus.groovy" name="groovy-all" version="2.4.12">
|
||||
<artifact name="groovy-all-2.4.12.jar">
|
||||
<md5 value="dddb0b3d3619875fa1c538c743ae8f99" origin="Generated by Gradle"/>
|
||||
|
||||
@@ -34,36 +34,16 @@ dependencies {
|
||||
compileOnly project(':dependencies:intellij-core')
|
||||
}
|
||||
|
||||
// Relocate `com.intellij.*` and some other classes to match those in the `kotlin-compiler-embeddable`
|
||||
// (for example, the actual package at runtime is `org.jetbrains.kotlin.com.intellij.*`):
|
||||
ArtifactsKt.runtimeJar(project, EmbeddableKt.rewriteDefaultJarDepsToShadedCompiler(project, {}), {})
|
||||
// In a standalone build, you can setup the relocation with the Shadow plugin.
|
||||
|
||||
// You should configure your own Gradle plugin publication!
|
||||
extensions.configure(GradlePluginDevelopmentExtension) {
|
||||
it.setAutomatedPublishing(false)
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
create("gradle-subplugin-example") {
|
||||
id = "org.jetbrains.kotlin.gradle-subplugin-example"
|
||||
implementationClass = "example.ExampleSubplugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
plugins {
|
||||
named("gradle-subplugin-example") {
|
||||
id = "org.jetbrains.kotlin.gradle-subplugin-example"
|
||||
displayName = "Kotlin Gradle subplugin example"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PluginMarkersKt.publishPluginMarkers(project, true)
|
||||
|
||||
// Disable releasing for this plugin
|
||||
// It is not intended to be released publicly
|
||||
tasks.withType(PublishToMavenRepository)
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import plugins.KotlinBuildPublishingPlugin
|
||||
|
||||
plugins {
|
||||
id("java-gradle-plugin")
|
||||
id("gradle-plugin-common-configuration")
|
||||
id("com.gradle.plugin-publish")
|
||||
}
|
||||
|
||||
repositories {
|
||||
@@ -18,30 +16,17 @@ dependencies {
|
||||
compileOnly("com.android.tools.build:builder-model:3.4.0")
|
||||
}
|
||||
|
||||
configure<GradlePluginDevelopmentExtension> {
|
||||
isAutomatedPublishing = false
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
(plugins) {
|
||||
plugins {
|
||||
create("android-test-fixes") {
|
||||
id = "org.jetbrains.kotlin.test.fixes.android"
|
||||
displayName = "AndroidTestFixes"
|
||||
description = displayName
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.test.fixes.android.AndroidTestFixesPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
(plugins) {
|
||||
named("android-test-fixes") {
|
||||
id = "org.jetbrains.kotlin.test.fixes.android"
|
||||
displayName = "AndroidTestFixes"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishPluginMarkers()
|
||||
|
||||
// Disable releasing for this plugin
|
||||
// It is not intended to be released publicly
|
||||
tasks.withType<PublishToMavenRepository>()
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import org.jetbrains.kotlin.pill.PillExtension
|
||||
|
||||
plugins {
|
||||
id("gradle-plugin-common-configuration")
|
||||
id("gradle-plugin-dependency-configuration")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ import org.jetbrains.dokka.gradle.DokkaTask
|
||||
import org.jetbrains.kotlin.pill.PillExtension
|
||||
|
||||
plugins {
|
||||
java
|
||||
`java-gradle-plugin`
|
||||
id("gradle-plugin-common-configuration")
|
||||
id("org.jetbrains.dokka")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
@@ -13,13 +10,10 @@ if (!kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
apply(from = "functionalTest.gradle.kts")
|
||||
}
|
||||
|
||||
configure<GradlePluginDevelopmentExtension> {
|
||||
isAutomatedPublishing = false
|
||||
}
|
||||
|
||||
repositories {
|
||||
google()
|
||||
maven("https://plugins.gradle.org/m2/")
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
|
||||
pill {
|
||||
@@ -120,8 +114,6 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) {
|
||||
configurations.api.get().exclude("com.android.tools.external.com-intellij", "intellij-core")
|
||||
}
|
||||
|
||||
runtimeJar(rewriteDefaultJarDepsToShadedCompiler())
|
||||
|
||||
tasks {
|
||||
named<ProcessResources>("processResources") {
|
||||
val propertiesToExpand = mapOf(
|
||||
@@ -161,65 +153,67 @@ projectTest {
|
||||
workingDir = rootDir
|
||||
}
|
||||
|
||||
pluginBundle {
|
||||
fun create(name: String, id: String, display: String) {
|
||||
(plugins).create(name) {
|
||||
this.id = id
|
||||
this.displayName = display
|
||||
this.description = display
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
create("kotlinJvmPlugin") {
|
||||
id = "org.jetbrains.kotlin.jvm"
|
||||
description = "Kotlin JVM plugin"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper"
|
||||
}
|
||||
create("kotlinJsPlugin") {
|
||||
id = "org.jetbrains.kotlin.js"
|
||||
description = "Kotlin JS plugin"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.plugin.KotlinJsPluginWrapper"
|
||||
}
|
||||
create("kotlinMultiplatformPlugin") {
|
||||
id = "org.jetbrains.kotlin.multiplatform"
|
||||
description = "Kotlin Multiplatform plugin"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper"
|
||||
}
|
||||
create("kotlinAndroidPlugin") {
|
||||
id = "org.jetbrains.kotlin.android"
|
||||
description = "Kotlin Android plugin"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper"
|
||||
}
|
||||
create("kotlinAndroidExtensionsPlugin") {
|
||||
id = "org.jetbrains.kotlin.android.extensions"
|
||||
description = "Kotlin Android Extensions plugin"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.internal.AndroidExtensionsSubpluginIndicator"
|
||||
}
|
||||
create("kotlinParcelizePlugin") {
|
||||
id = "org.jetbrains.kotlin.plugin.parcelize"
|
||||
description = "Kotlin Parcelize plugin"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.internal.ParcelizeSubplugin"
|
||||
}
|
||||
create("kotlinKaptPlugin") {
|
||||
id = "org.jetbrains.kotlin.kapt"
|
||||
description = "Kotlin Kapt plugin"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.internal.Kapt3GradleSubplugin"
|
||||
}
|
||||
create("kotlinScriptingPlugin") {
|
||||
id = "org.jetbrains.kotlin.plugin.scripting"
|
||||
description = "Gradle plugin for kotlin scripting"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin"
|
||||
}
|
||||
create("kotlinNativeCocoapodsPlugin") {
|
||||
id = "org.jetbrains.kotlin.native.cocoapods"
|
||||
description = "Kotlin Native plugin for CocoaPods integration"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin"
|
||||
}
|
||||
create("kotlinMultiplatformPluginPm20") {
|
||||
id = "org.jetbrains.kotlin.multiplatform.pm20"
|
||||
description = "Kotlin Multiplatform plugin with PM2.0"
|
||||
displayName = description
|
||||
implementationClass = "org.jetbrains.kotlin.gradle.plugin.KotlinPm20PluginWrapper"
|
||||
}
|
||||
}
|
||||
|
||||
create(
|
||||
name = "kotlinJvmPlugin",
|
||||
id = "org.jetbrains.kotlin.jvm",
|
||||
display = "Kotlin JVM plugin"
|
||||
)
|
||||
create(
|
||||
name = "kotlinJsPlugin",
|
||||
id = "org.jetbrains.kotlin.js",
|
||||
display = "Kotlin JS plugin"
|
||||
)
|
||||
create(
|
||||
name = "kotlinMultiplatformPlugin",
|
||||
id = "org.jetbrains.kotlin.multiplatform",
|
||||
display = "Kotlin Multiplatform plugin"
|
||||
)
|
||||
create(
|
||||
name = "kotlinAndroidPlugin",
|
||||
id = "org.jetbrains.kotlin.android",
|
||||
display = "Kotlin Android plugin"
|
||||
)
|
||||
create(
|
||||
name = "kotlinAndroidExtensionsPlugin",
|
||||
id = "org.jetbrains.kotlin.android.extensions",
|
||||
display = "Kotlin Android Extensions plugin"
|
||||
)
|
||||
create(
|
||||
name = "kotlinParcelizePlugin",
|
||||
id = "org.jetbrains.kotlin.plugin.parcelize",
|
||||
display = "Kotlin Parcelize plugin"
|
||||
)
|
||||
create(
|
||||
name = "kotlinKaptPlugin",
|
||||
id = "org.jetbrains.kotlin.kapt",
|
||||
display = "Kotlin Kapt plugin"
|
||||
)
|
||||
create(
|
||||
name = "kotlinScriptingPlugin",
|
||||
id = "org.jetbrains.kotlin.plugin.scripting",
|
||||
display = "Gradle plugin for kotlin scripting"
|
||||
)
|
||||
create(
|
||||
name = "kotlinNativeCocoapodsPlugin",
|
||||
id = "org.jetbrains.kotlin.native.cocoapods",
|
||||
display = "Kotlin Native plugin for CocoaPods integration"
|
||||
)
|
||||
create(
|
||||
name = "kotlinMultiplatformPluginPm20",
|
||||
id = "org.jetbrains.kotlin.multiplatform.pm20",
|
||||
display = "Kotlin Multiplatform plugin with PM2.0"
|
||||
)
|
||||
}
|
||||
|
||||
publishPluginMarkers()
|
||||
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.internal.AndroidExtensionsSubpluginIndicator
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinAndroidPluginWrapper
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinJsPluginWrapper
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.internal.Kapt3GradleSubplugin
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinPm20PluginWrapper
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.internal.ParcelizeSubplugin
|
||||
-1
@@ -1 +0,0 @@
|
||||
implementation-class=org.jetbrains.kotlin.gradle.scripting.internal.ScriptingGradleSubplugin
|
||||
Reference in New Issue
Block a user