Skip to content

Commit

Permalink
chore(build): finalize deployment configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Nov 12, 2023
1 parent 29be4c6 commit ff2a604
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 31 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ bin/
.vscode/

### Mac OS ###
.DS_Store
.DS_Store


local.properties
77 changes: 47 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import java.util.*

plugins {
id("java")
id("java-library")
id("maven-publish")
id("signing")
id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "dev.gothickit"
Expand All @@ -27,10 +25,10 @@ tasks.getByName<Test>("test") {
useJUnitPlatform()
}

tasks.withType<ShadowJar> {
tasks.withType<Jar> {
archiveBaseName.set("zenkit")
archiveClassifier.set("")
archiveVersion.set("0.0.1")
archiveVersion.set(version.toString())
}

// Stub secrets to let the project sync and build without the publication values set up
Expand Down Expand Up @@ -58,51 +56,70 @@ if (secretPropsFile.exists()) {
ext["ossrhPassword"] = System.getenv("OSSRH_PASSWORD")
}

val javadocJar by tasks.registering(Jar::class) {
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

val javadocJar by tasks.creating(Jar::class) {
dependsOn.add(JavaPlugin.JAVADOC_TASK_NAME)
archiveClassifier.set("javadoc")
from(tasks["javadoc"])
}

fun getExtraString(name: String) = ext[name]?.toString()

publishing {
repositories {
maven {
name = "sonatype"
name = "SonatypeRelease"
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = getExtraString("ossrhUsername")
password = getExtraString("ossrhPassword")
}
}
maven {
name = "SonatypeSnapshot"
setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/")
credentials {
username = getExtraString("ossrhUsername")
password = getExtraString("ossrhPassword")
}
}
mavenLocal()
}

publications.withType<MavenPublication> {
project.shadow.component(this)
artifact(javadocJar.get())

pom {
name.set("ZenKit Java Bindings")
description.set("Java bindings for ZenKit, the ZenGin Asset Parser")

licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
publications {
create<MavenPublication>("main") {
from(components.getByName("java"))
artifact(javadocJar)
artifact(sourcesJar)

pom {
name.set("ZenKit Java Bindings")
description.set("Java bindings for ZenKit, the ZenGin Asset Parser")

licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
}

developers {
developer {
id.set("lmichaelis")
name.set("Luis Michaelis")
email.set("[email protected]")
organization.set("GothicKit")
organizationUrl.set("https://github.com/GothicKit")
developers {
developer {
id.set("lmichaelis")
name.set("Luis Michaelis")
email.set("[email protected]")
organization.set("GothicKit")
organizationUrl.set("https://github.com/GothicKit")
}
}
}

scm {
url.set("https://github.com/GothicKit/ZenKit4J")
scm {
url.set("https://github.com/GothicKit/ZenKit4J")
}
}
}
}
Expand Down

0 comments on commit ff2a604

Please sign in to comment.