Skip to content

Commit

Permalink
1.1.0-SNAPSHOT: Let's get serious about this.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdude2002 committed Jan 4, 2025
1 parent 1f6f174 commit 2c9a2d3
Show file tree
Hide file tree
Showing 22 changed files with 480 additions and 229 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
env:
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.GPG_KEY }}"
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.GPG_PASSWORD }}"
ORG_GRADLE_PROJECT_mavenCentralUsername: "${{ secrets.MAVEN_CENTRAL_USERNAME }}"
ORG_GRADLE_PROJECT_mavenCentralPassword: "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"
ORG_GRADLE_PROJECT_publishingTag: "true"

KORDEX_MAVEN_PASSWORD: "${{ secrets.KORDEX_MAVEN_PASSWORD }}"
KORDEX_MAVEN_USERNAME: "${{ secrets.KORDEX_MAVEN_USERNAME }}"
Expand Down
10 changes: 0 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
import org.jetbrains.dokka.DokkaConfiguration
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.dokka.gradle.formats.DokkaJavadocPlugin

plugins {
id("org.jetbrains.dokka") version "2.0.0"
}

subprojects {
apply(plugin = "org.jetbrains.dokka")

task("javadocJar", Jar::class) {
dependsOn(tasks.dokkaGeneratePublicationHtml)
from(tasks.dokkaGeneratePublicationHtml.flatMap { it.outputDirectory })
archiveClassifier = "javadoc"
}
}
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies {

implementation("dev.yumi", "yumi-gradle-licenser", "1.2.0")
implementation("io.gitlab.arturbosch.detekt", "detekt-gradle-plugin", "1.23.6")
implementation("com.vanniktech.maven.publish.base", "com.vanniktech.maven.publish.base.gradle.plugin", "0.30.0")
}

beforeEvaluate {
Expand Down
8 changes: 0 additions & 8 deletions buildSrc/src/main/kotlin/general.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.gradle.kotlin.dsl.from

plugins {
id("dev.yumi.gradle.licenser")
id("io.gitlab.arturbosch.detekt")
Expand Down Expand Up @@ -31,9 +29,3 @@ license {
kotlin {
explicitApi()
}

val sourceJar = task("sourceJar", Jar::class) {
dependsOn(tasks["classes"])
archiveClassifier = "sources"
from(sourceSets.main.get().allSource)
}
64 changes: 48 additions & 16 deletions buildSrc/src/main/kotlin/published.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,46 +1,55 @@
import org.gradle.kotlin.dsl.from
import kotlin.text.get
import kotlin.text.set
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.SonatypeHost

plugins {
`maven-publish`
signing

id("com.vanniktech.maven.publish.base")
}

val sourceJar: Task by tasks.getting
val javadocJar: Task by tasks.getting
//val dokkaJar: Task by tasks.getting
val isSnapshot = project.version.toString().contains("SNAPSHOT")
val isTag = (project.findProperty("publishingTag") as String?) == "true"

afterEvaluate {
publishing {
repositories {
maven {
name = "KordEx"
name = "kordEx"

url = if (project.version.toString().contains("SNAPSHOT")) {
url = if (isSnapshot) {
uri("https://repo.kordex.dev/snapshots/")
} else {
uri("https://repo.kordex.dev/releases/")
}

credentials {
username = project.findProperty("ossrhUsername") as String?
username = project.findProperty("kordexMavenUsername") as String?
?: System.getenv("KORDEX_MAVEN_USERNAME")

password = project.findProperty("ossrhPassword") as String?
password = project.findProperty("kordexMavenPassword") as String?
?: System.getenv("KORDEX_MAVEN_PASSWORD")
}

version = project.version
}
}

publications {
create<MavenPublication>("maven") {
from(components.getByName("java"))
mavenPublishing {
if (isTag && !isSnapshot) {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
}

configure(
KotlinJvm(
javadocJar = JavadocJar.Dokka("dokkaGeneratePublicationHtml"),
sourcesJar = true
)
)

signAllPublications()

artifact(sourceJar)
// artifact(javadocJar)
coordinates(project.group.toString(), project.name, project.version.toString())

pom {
name.set(project.ext.get("pubName").toString())
Expand Down Expand Up @@ -83,3 +92,26 @@ afterEvaluate {
sign(publishing.publications["maven"])
}
}

afterEvaluate {
project.publishing.publications.forEach { publication ->
if (publication is MavenPublication) {
println(">> Publication: ${publication.groupId}:${publication.artifactId}:${publication.version}")

println(
" Classifiers: " +
publication.artifacts
.filter { artifact -> artifact.classifier != null }
.sortedBy { it.classifier }
.joinToString { it -> "${it.classifier}:${it.extension}" }
)

println(
" Repos: " +
project.publishing.repositories
.sortedBy { it.name }
.joinToString { it.name }
)
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ org.gradle.parallel=true
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true

projectVersion=1.0.7
projectVersion=1.1.0-SNAPSHOT
10 changes: 10 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[versions]
kotlin = "2.0.21"

icu4j = "76.1"
ktlint = "1.5.0"
kx-ser = "1.7.3"
logging = "7.0.0"
slf4j = "2.0.16"
Expand All @@ -12,6 +15,12 @@ yaml-resource-bundle = "2.13.0"
icu4j = { module = "com.ibm.icu:icu4j", version.ref = "icu4j" }
kx-ser = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kx-ser" }
kotlin-logging = { module = "io.github.oshai:kotlin-logging", version.ref = "logging" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }

ktlint-engine = { module = "com.pinterest.ktlint:ktlint-rule-engine", version.ref = "ktlint" }
ktlint-cli-rules = { module = "com.pinterest.ktlint:ktlint-cli-ruleset-core", version.ref = "ktlint" }
ktlint-rules = { module = "com.pinterest.ktlint:ktlint-ruleset-standard", version.ref = "ktlint" }

slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" }

Expand All @@ -22,6 +31,7 @@ kotest-property = { module = "io.kotest:kotest-property", version.ref = "kotest"
yaml-resource-bundle = { module = "dev.akkinoc.util:yaml-resource-bundle", version.ref = "yaml-resource-bundle" }

[bundles]
ktlint = ["ktlint-engine", "ktlint-cli-rules", "ktlint-rules"]
logging = ["kotlin-logging", "slf4j"]
resources = ["yaml-resource-bundle"]
testing = ["kotest-assertions", "kotest-framework", "kotest-property"]
4 changes: 4 additions & 0 deletions i18n-generator/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ repositories {

dependencies {
implementation("info.picocli:picocli:4.7.6")
implementation(libs.kotlin.reflect)
implementation(libs.slf4j.simple)

api("com.hanggrian:kotlinpoet-dsl:0.2")
api("com.squareup:kotlinpoet:1.18.1")
api(libs.bundles.ktlint)
api(project(":i18n"))
}

val propsTask = tasks.register<WriteProperties>("kordExProps") {
Expand Down
Loading

0 comments on commit 2c9a2d3

Please sign in to comment.