Skip to content

Commit

Permalink
gradle build update to publish sources and javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
morisil committed Aug 16, 2024
1 parent d95e559 commit 639c70d
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 137 deletions.
155 changes: 110 additions & 45 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

plugins {
alias(libs.plugins.kotlin.jvm) apply false
`maven-publish`
signing
alias(libs.plugins.versions)
Expand All @@ -28,49 +29,49 @@ allprojects {
repositories {
mavenCentral()
}

}

publishing {

publications {
create<MavenPublication>("mavenJava") {
groupId = "com.xemantic.kotlin"
//from(components["kotlin"])
pom {
name.set("xemantic-kotlin-swing-dsl")
description.set("Kotlin goodies for Java Swing")
url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")

licenses {
license {
name.set("GNU Lesser General Public License 3")
url.set("https://www.gnu.org/licenses/lgpl-3.0.en.html")
}
}
developers {
developer {
id.set("morisil")
name.set("Kazik Pogoda")
email.set("morisil@xemantic.com")
}
}
scm {
url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")
subprojects {

if (project.name.startsWith("xemantic")) {

tasks {
withType<Jar> {
manifest {
attributes(
mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
)
)
}
}
}
}

repositories {
maven {
name = "GitHubPackages"
setUrl("https://maven.pkg.github.com/xemantic/xemantic-kotlin-swing-dsl")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
// tasks.jar {

// }

apply(plugin = "maven-publish")
apply(plugin = "java-library")

afterEvaluate {

configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
}
}

configure<PublishingExtension> {
repositories {
maven {
name = "GitHubPackages"
setUrl("https://maven.pkg.github.com/xemantic/xemantic-kotlin-swing-dsl")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
// maven {
// name = "OSSRH"
// setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/")
Expand All @@ -79,18 +80,82 @@ publishing {
// password = System.getenv("MAVEN_PASSWORD")
// }
// }
}
publications {
create<MavenPublication>("maven") {
from(components["kotlin"])
pom {
description = "Kotlin goodies for Java Swing"
url = "https://github.com/xemantic/xemantic-kotlin-swing-dsl"
licenses {
license {
name.set("GNU Lesser General Public License 3")
url.set("https://www.gnu.org/licenses/lgpl-3.0.en.html")
}
}
developers {
developer {
id.set("morisil")
name.set("Kazik Pogoda")
email.set("morisil@xemantic.com")
}
}
scm {
url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")
}
}
}
}
}
}

}

}

//publishing {
//
// publications {
// create<MavenPublication>("mavenJava") {
// groupId = "com.xemantic.kotlin"
// //from(components["kotlin"])
// pom {
// name.set("xemantic-kotlin-swing-dsl")
// description.set("Kotlin goodies for Java Swing")
// url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")
//
// licenses {
// license {
// name.set("GNU Lesser General Public License 3")
// url.set("https://www.gnu.org/licenses/lgpl-3.0.en.html")
// }
// }
// developers {
// developer {
// id.set("morisil")
// name.set("Kazik Pogoda")
// email.set("morisil@xemantic.com")
// }
// }
// scm {
// url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")
// }
// }
// }
// }
//
//
//
//}


signing {
if (
project.hasProperty("signing.keyId")
&& project.hasProperty("signing.password")
&& project.hasProperty("signing.secretKeyRingFile")
) {
sign(publishing.publications)
}
}

//signing {
// if (
// project.hasProperty("signing.keyId")
// && project.hasProperty("signing.password")
// && project.hasProperty("signing.secretKeyRingFile")
// ) {
// sign(publishing.publications)
// }
//}
46 changes: 0 additions & 46 deletions xemantic-kotlin-swing-dsl-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,55 +20,9 @@

plugins {
alias(libs.plugins.kotlin.jvm)
`maven-publish`
signing
}

dependencies {
api(libs.kotlinx.coroutines.core)
runtimeOnly(libs.kotlinx.coroutines.swing)
}

publishing {

publications {
create<MavenPublication>("mavenJava") {
groupId = "com.xemantic.kotlin"
from(components["kotlin"])
pom {
name.set("xemantic-kotlin-swing-dsl-core")
description.set("Kotlin goodies for Java Swing")
url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")

licenses {
license {
name.set("GNU Lesser General Public License 3")
url.set("https://www.gnu.org/licenses/lgpl-3.0.en.html")
}
}
developers {
developer {
id.set("morisil")
name.set("Kazik Pogoda")
email.set("morisil@xemantic.com")
}
}
scm {
url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")
}
}
}
}

repositories {
maven {
name = "GitHubPackages"
setUrl("https://maven.pkg.github.com/xemantic/xemantic-kotlin-swing-dsl")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}

}
46 changes: 0 additions & 46 deletions xemantic-kotlin-swing-dsl-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,54 +20,8 @@

plugins {
alias(libs.plugins.kotlin.jvm)
`maven-publish`
signing
}

dependencies {
api(libs.kotlinx.coroutines.test)
}

publishing {

publications {
create<MavenPublication>("mavenJava") {
groupId = "com.xemantic.kotlin"
from(components["kotlin"])
pom {
name.set("xemantic-kotlin-swing-dsl-test")
description.set("Kotlin goodies for Java Swing")
url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")

licenses {
license {
name.set("GNU Lesser General Public License 3")
url.set("https://www.gnu.org/licenses/lgpl-3.0.en.html")
}
}
developers {
developer {
id.set("morisil")
name.set("Kazik Pogoda")
email.set("morisil@xemantic.com")
}
}
scm {
url.set("https://github.com/xemantic/xemantic-kotlin-swing-dsl")
}
}
}
}

repositories {
maven {
name = "GitHubPackages"
setUrl("https://maven.pkg.github.com/xemantic/xemantic-kotlin-swing-dsl")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}

}

0 comments on commit 639c70d

Please sign in to comment.