Fix developer organization in pom, make artifact manifests same as in libraries
This commit is contained in:
committed by
Ilya Chernikov
parent
d441f7ad9a
commit
4a3c8286a3
@@ -32,28 +32,6 @@ fun AbstractTask.dependsOnTaskIfExistsRec(task: String, project: Project? = null
|
||||
}
|
||||
}
|
||||
|
||||
fun Jar.setupRuntimeJar(implementationTitle: String): Unit {
|
||||
dependsOn(":prepare:build.version:prepare")
|
||||
manifest.attributes.apply {
|
||||
put("Built-By", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Title", implementationTitle)
|
||||
put("Implementation-Version", project.rootProject.extra["buildNumber"])
|
||||
}
|
||||
// from(project.configurations.getByName("build-version").files, action = { into("META-INF/") })
|
||||
}
|
||||
|
||||
fun Jar.setupSourceJar(implementationTitle: String): Unit {
|
||||
dependsOn("classes")
|
||||
setupRuntimeJar(implementationTitle + " Sources")
|
||||
project.pluginManager.withPlugin("java-base") {
|
||||
from(project.the<JavaPluginConvention>().sourceSets["main"].allSource)
|
||||
}
|
||||
classifier = "sources"
|
||||
project.artifacts.add("archives", this)
|
||||
}
|
||||
|
||||
|
||||
inline fun<T: Any> Project.withJavaPlugin(crossinline body: () -> T?): T? {
|
||||
var res: T? = null
|
||||
pluginManager.withPlugin("java") {
|
||||
|
||||
@@ -84,7 +84,7 @@ fun Project.runtimeJar(taskName: String = "jar", body: Jar.() -> Unit = {}): Jar
|
||||
fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar =
|
||||
getOrCreateTask("sourcesJar") {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
setupPublicJar("Sources")
|
||||
classifier = "sources"
|
||||
try {
|
||||
project.pluginManager.withPlugin("java-base") {
|
||||
from(project.the<JavaPluginConvention>().sourceSets["main"].allSource)
|
||||
@@ -100,7 +100,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar =
|
||||
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar =
|
||||
getOrCreateTask("javadocJar") {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
setupPublicJar("JavaDoc")
|
||||
classifier = "javadoc"
|
||||
tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let {
|
||||
dependsOn(it)
|
||||
from(it.destinationDir)
|
||||
@@ -180,16 +180,14 @@ private fun Project.runtimeJarTaskIfExists(): Task? =
|
||||
|
||||
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
|
||||
|
||||
fun Jar.setupPublicJar(classifier: String = "", classifierDescr: String? = null) {
|
||||
this.classifier = classifier.toLowerCase()
|
||||
dependsOn(":prepare:build.version:prepare")
|
||||
fun Jar.setupPublicJar(classifier: String = "") {
|
||||
this.classifier = classifier
|
||||
manifest.attributes.apply {
|
||||
put("Built-By", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"])
|
||||
put("Implementation-Title", "${project.description} ${classifierDescr ?: classifier}".trim())
|
||||
put("Implementation-Vendor", "JetBrains")
|
||||
put("Implementation-Title", project.the<BasePluginConvention>().archivesBaseName)
|
||||
put("Implementation-Version", project.rootProject.extra["buildNumber"])
|
||||
put("Build-Jdk", System.getProperty("java.version"))
|
||||
}
|
||||
// from(project.configurations.getByName("build-version").files, action = { into("META-INF/") })
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -74,10 +74,8 @@ open class PublishedKotlinModule : Plugin<Project> {
|
||||
"developers" {
|
||||
"developer" {
|
||||
"name"("Kotlin Team")
|
||||
"organization" {
|
||||
"name"("JetBrains")
|
||||
"url"("https://www.jetbrains.com")
|
||||
}
|
||||
setProperty("organization", "JetBrains")
|
||||
"organizationUrl"("https://www.jetbrains.com")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ val packCompiler by task<ShadowJar> {
|
||||
destinationDir = File(buildDir, "libs")
|
||||
dependsOn(protobufFullTask)
|
||||
|
||||
setupPublicJar("before-proguard", "")
|
||||
setupPublicJar("before-proguard")
|
||||
from(fatJarContents)
|
||||
ideaSdkDeps("jps-model.jar", subdir = "jps").forEach { from(zipTree(it)) { exclude("META-INF/services/**") } }
|
||||
ideaSdkDeps("oromatcher").forEach { from(zipTree(it)) { exclude("META-INF/jb/** META-INF/LICENSE") } }
|
||||
|
||||
Reference in New Issue
Block a user