Files
kotlin-fork/libraries/tools/gradle-tools/pluginMarkers.gradle
T
Sergey Igushkin 0cfac71efe (minor) Improve readability of pluginMarkers.gradle, fix indent in file
(minor) Clarify the comment on the setUpSeparateArtifact block
2017-08-07 14:33:35 +03:00

49 lines
1.5 KiB
Groovy

ext.pluginMarkerProject = { String pluginProjectId ->
evaluationDependsOn(":$pluginProjectId")
def pluginProject = findProject(":$pluginProjectId")
repositories.addAll(pluginProject.repositories.toList())
apply plugin: 'java'
dependencies {
compile pluginProject
}
// Remove the default JAR artifact added by the Java plugin
configurations.archives.artifacts.clear()
configurePublishing(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
}