提交 4a3c8286 编写于 作者: I Ilya Gorbunov 提交者: Ilya Chernikov

Fix developer organization in pom, make artifact manifests same as in libraries

上级 d441f7ad
...@@ -32,28 +32,6 @@ fun AbstractTask.dependsOnTaskIfExistsRec(task: String, project: Project? = null ...@@ -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? { inline fun<T: Any> Project.withJavaPlugin(crossinline body: () -> T?): T? {
var res: T? = null var res: T? = null
pluginManager.withPlugin("java") { pluginManager.withPlugin("java") {
......
...@@ -84,7 +84,7 @@ fun Project.runtimeJar(taskName: String = "jar", body: Jar.() -> Unit = {}): Jar ...@@ -84,7 +84,7 @@ fun Project.runtimeJar(taskName: String = "jar", body: Jar.() -> Unit = {}): Jar
fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar = fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("sourcesJar") { getOrCreateTask("sourcesJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setupPublicJar("Sources") classifier = "sources"
try { try {
project.pluginManager.withPlugin("java-base") { project.pluginManager.withPlugin("java-base") {
from(project.the<JavaPluginConvention>().sourceSets["main"].allSource) from(project.the<JavaPluginConvention>().sourceSets["main"].allSource)
...@@ -100,7 +100,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar = ...@@ -100,7 +100,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar =
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar = fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("javadocJar") { getOrCreateTask("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
setupPublicJar("JavaDoc") classifier = "javadoc"
tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let { tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it) dependsOn(it)
from(it.destinationDir) from(it.destinationDir)
...@@ -180,16 +180,14 @@ private fun Project.runtimeJarTaskIfExists(): Task? = ...@@ -180,16 +180,14 @@ private fun Project.runtimeJarTaskIfExists(): Task? =
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name) fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
fun Jar.setupPublicJar(classifier: String = "", classifierDescr: String? = null) { fun Jar.setupPublicJar(classifier: String = "") {
this.classifier = classifier.toLowerCase() this.classifier = classifier
dependsOn(":prepare:build.version:prepare")
manifest.attributes.apply { manifest.attributes.apply {
put("Built-By", project.rootProject.extra["manifest.impl.vendor"]) put("Implementation-Vendor", "JetBrains")
put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"]) put("Implementation-Title", project.the<BasePluginConvention>().archivesBaseName)
put("Implementation-Title", "${project.description} ${classifierDescr ?: classifier}".trim())
put("Implementation-Version", project.rootProject.extra["buildNumber"]) 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> { ...@@ -74,10 +74,8 @@ open class PublishedKotlinModule : Plugin<Project> {
"developers" { "developers" {
"developer" { "developer" {
"name"("Kotlin Team") "name"("Kotlin Team")
"organization" { setProperty("organization", "JetBrains")
"name"("JetBrains") "organizationUrl"("https://www.jetbrains.com")
"url"("https://www.jetbrains.com")
}
} }
} }
} }
......
...@@ -88,7 +88,7 @@ val packCompiler by task<ShadowJar> { ...@@ -88,7 +88,7 @@ val packCompiler by task<ShadowJar> {
destinationDir = File(buildDir, "libs") destinationDir = File(buildDir, "libs")
dependsOn(protobufFullTask) dependsOn(protobufFullTask)
setupPublicJar("before-proguard", "") setupPublicJar("before-proguard")
from(fatJarContents) from(fatJarContents)
ideaSdkDeps("jps-model.jar", subdir = "jps").forEach { from(zipTree(it)) { exclude("META-INF/services/**") } } 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") } } ideaSdkDeps("oromatcher").forEach { from(zipTree(it)) { exclude("META-INF/jb/** META-INF/LICENSE") } }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册