Build: Migrate plugin markers to maven-publish publication
This commit is contained in:
@@ -1,56 +0,0 @@
|
||||
ext.pluginMarkerProject = { String pluginProjectId ->
|
||||
evaluationDependsOn(":$pluginProjectId")
|
||||
|
||||
if (rootProject.ext.get("isSonatypePublish")) {
|
||||
def warning = "Plugin marker is not created for $pluginProjectId Sonatype publishing"
|
||||
task('uploadArchives').doLast { println warning }
|
||||
return
|
||||
}
|
||||
|
||||
def pluginProject = findProject(":$pluginProjectId")
|
||||
|
||||
repositories.addAll(pluginProject.repositories.toList())
|
||||
|
||||
apply plugin: 'java'
|
||||
|
||||
dependencies {
|
||||
compile project(path: pluginProject.path, configuration: 'runtimeJar')
|
||||
}
|
||||
|
||||
// Remove the default JAR artifact added by the Java plugin
|
||||
configurations.archives.artifacts.clear()
|
||||
|
||||
// TODO: Migrate to maven-publish publishing
|
||||
configureLegacyPublishing(project)
|
||||
|
||||
task emptyJar(type: Jar)
|
||||
|
||||
version = project.version + (findProperty('marker_version_suffix') ?: "")
|
||||
|
||||
for (pluginId in pluginProject.pluginBundle.plugins.collect { it.id }) {
|
||||
def artifactName = "${pluginId}.gradle.plugin"
|
||||
|
||||
artifacts {
|
||||
['', 'javadoc', 'sources'].forEach { theClassifier ->
|
||||
archives(emptyJar) {
|
||||
group = pluginId
|
||||
name = artifactName
|
||||
classifier = theClassifier
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Publish each gradle plugin marker under its own Maven coordinates pluginId:pluginId.gradle.plugin
|
||||
def setUpSeparateArtifact = {
|
||||
addFilter(pluginId) { artifact, file -> artifact.name == artifactName }
|
||||
def pom = pom(pluginId)
|
||||
pom.groupId = pluginId
|
||||
pom.artifactId = "${pluginId}.gradle.plugin"
|
||||
}
|
||||
|
||||
configure(uploadArchives.repositories.mavenDeployer, setUpSeparateArtifact)
|
||||
configure(install.repositories.mavenInstaller, setUpSeparateArtifact)
|
||||
}
|
||||
|
||||
publish.dependsOn uploadArchives
|
||||
}
|
||||
@@ -50,4 +50,6 @@ pluginBundle {
|
||||
}
|
||||
}
|
||||
|
||||
configurePluginMarkers(project)
|
||||
|
||||
test.executable = "${JDK_18}/bin/java"
|
||||
@@ -1,3 +0,0 @@
|
||||
apply from: "$rootDir/libraries/tools/gradle-tools/pluginMarkers.gradle"
|
||||
|
||||
pluginMarkerProject('kotlin-allopen')
|
||||
@@ -206,3 +206,5 @@ pluginBundle {
|
||||
display = "Kotlin Native plugin for CocoaPods integration"
|
||||
)
|
||||
}
|
||||
|
||||
publishPluginMarkers()
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
apply from: "$rootDir/libraries/tools/gradle-tools/pluginMarkers.gradle"
|
||||
|
||||
pluginMarkerProject('kotlin-gradle-plugin')
|
||||
@@ -56,4 +56,6 @@ pluginBundle {
|
||||
}
|
||||
}
|
||||
|
||||
configurePluginMarkers(project)
|
||||
|
||||
test.executable = "${JDK_18}/bin/java"
|
||||
@@ -1,3 +0,0 @@
|
||||
apply from: "$rootDir/libraries/tools/gradle-tools/pluginMarkers.gradle"
|
||||
|
||||
pluginMarkerProject('kotlin-noarg')
|
||||
@@ -38,4 +38,6 @@ pluginBundle {
|
||||
description = displayName = 'Kotlin compiler plugin for kotlinx.serialization library'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurePluginMarkers(project)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
apply from: "$rootDir/libraries/tools/gradle-tools/pluginMarkers.gradle"
|
||||
|
||||
pluginMarkerProject('kotlin-serialization')
|
||||
Reference in New Issue
Block a user