Skip to content

Commit 4a3c828

Browse files
ilya-gligee
authored andcommitted
Fix developer organization in pom, make artifact manifests same as in libraries
1 parent d441f7a commit 4a3c828

File tree

4 files changed

+10
-36
lines changed

4 files changed

+10
-36
lines changed

buildSrc/src/main/kotlin/CommonUtil.kt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,28 +32,6 @@ fun AbstractTask.dependsOnTaskIfExistsRec(task: String, project: Project? = null
3232
}
3333
}
3434

35-
fun Jar.setupRuntimeJar(implementationTitle: String): Unit {
36-
dependsOn(":prepare:build.version:prepare")
37-
manifest.attributes.apply {
38-
put("Built-By", project.rootProject.extra["manifest.impl.vendor"])
39-
put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"])
40-
put("Implementation-Title", implementationTitle)
41-
put("Implementation-Version", project.rootProject.extra["buildNumber"])
42-
}
43-
// from(project.configurations.getByName("build-version").files, action = { into("META-INF/") })
44-
}
45-
46-
fun Jar.setupSourceJar(implementationTitle: String): Unit {
47-
dependsOn("classes")
48-
setupRuntimeJar(implementationTitle + " Sources")
49-
project.pluginManager.withPlugin("java-base") {
50-
from(project.the<JavaPluginConvention>().sourceSets["main"].allSource)
51-
}
52-
classifier = "sources"
53-
project.artifacts.add("archives", this)
54-
}
55-
56-
5735
inline fun<T: Any> Project.withJavaPlugin(crossinline body: () -> T?): T? {
5836
var res: T? = null
5937
pluginManager.withPlugin("java") {

buildSrc/src/main/kotlin/artifacts.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fun Project.runtimeJar(taskName: String = "jar", body: Jar.() -> Unit = {}): Jar
8484
fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar =
8585
getOrCreateTask("sourcesJar") {
8686
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
87-
setupPublicJar("Sources")
87+
classifier = "sources"
8888
try {
8989
project.pluginManager.withPlugin("java-base") {
9090
from(project.the<JavaPluginConvention>().sourceSets["main"].allSource)
@@ -100,7 +100,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): Jar =
100100
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar =
101101
getOrCreateTask("javadocJar") {
102102
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
103-
setupPublicJar("JavaDoc")
103+
classifier = "javadoc"
104104
tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let {
105105
dependsOn(it)
106106
from(it.destinationDir)
@@ -180,16 +180,14 @@ private fun Project.runtimeJarTaskIfExists(): Task? =
180180

181181
fun ConfigurationContainer.getOrCreate(name: String): Configuration = findByName(name) ?: create(name)
182182

183-
fun Jar.setupPublicJar(classifier: String = "", classifierDescr: String? = null) {
184-
this.classifier = classifier.toLowerCase()
185-
dependsOn(":prepare:build.version:prepare")
183+
fun Jar.setupPublicJar(classifier: String = "") {
184+
this.classifier = classifier
186185
manifest.attributes.apply {
187-
put("Built-By", project.rootProject.extra["manifest.impl.vendor"])
188-
put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"])
189-
put("Implementation-Title", "${project.description} ${classifierDescr ?: classifier}".trim())
186+
put("Implementation-Vendor", "JetBrains")
187+
put("Implementation-Title", project.the<BasePluginConvention>().archivesBaseName)
190188
put("Implementation-Version", project.rootProject.extra["buildNumber"])
189+
put("Build-Jdk", System.getProperty("java.version"))
191190
}
192-
// from(project.configurations.getByName("build-version").files, action = { into("META-INF/") })
193191
}
194192

195193

buildSrc/src/main/kotlin/plugins/PublishedKotlinModule.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,8 @@ open class PublishedKotlinModule : Plugin<Project> {
7474
"developers" {
7575
"developer" {
7676
"name"("Kotlin Team")
77-
"organization" {
78-
"name"("JetBrains")
79-
"url"("https://www.jetbrains.com")
80-
}
77+
setProperty("organization", "JetBrains")
78+
"organizationUrl"("https://www.jetbrains.com")
8179
}
8280
}
8381
}

prepare/compiler/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ val packCompiler by task<ShadowJar> {
8888
destinationDir = File(buildDir, "libs")
8989
dependsOn(protobufFullTask)
9090

91-
setupPublicJar("before-proguard", "")
91+
setupPublicJar("before-proguard")
9292
from(fatJarContents)
9393
ideaSdkDeps("jps-model.jar", subdir = "jps").forEach { from(zipTree(it)) { exclude("META-INF/services/**") } }
9494
ideaSdkDeps("oromatcher").forEach { from(zipTree(it)) { exclude("META-INF/jb/** META-INF/LICENSE") } }

0 commit comments

Comments
 (0)