From 5f53b9806271cfe1893b59f16a4fecee7f52686e Mon Sep 17 00:00:00 2001 From: rnentjes Date: Sat, 3 May 2025 11:10:00 +0200 Subject: [PATCH] Version 0.2.11 - update publish plugin --- .gitignore | 4 +- build.gradle.kts | 93 +++++++++++------------- gradle/wrapper/gradle-wrapper.properties | 2 +- readme.md | 6 +- settings.gradle.kts | 15 ++++ 5 files changed, 64 insertions(+), 56 deletions(-) diff --git a/.gitignore b/.gitignore index bea213b..7d3595d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ .gradle -build/ +build +web +.kotlin !gradle/wrapper/gradle-wrapper.jar !**/src/main/**/build/ !**/src/test/**/build/ diff --git a/build.gradle.kts b/build.gradle.kts index 38c0425..7d7ea72 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,18 +1,24 @@ +import com.vanniktech.maven.publish.SonatypeHost + plugins { kotlin("multiplatform") version "2.1.20" - `maven-publish` signing - id("org.jetbrains.dokka") version "1.5.31" + id("org.jetbrains.dokka") version "2.0.0" + id("com.vanniktech.maven.publish") version "0.31.0" } group = "nl.astraeus" -version = "0.2.10" +version = "0.2.11" repositories { mavenCentral() maven { url = uri("https://gitea.astraeus.nl:8443/api/packages/rnentjes/maven") } + maven { + name = "Sonatype Releases" + url = uri("https://central.sonatype.com/api/v1/publisher/deployments/download/") + } } kotlin { @@ -46,25 +52,9 @@ kotlin { } } -extra["PUBLISH_GROUP_ID"] = group -extra["PUBLISH_VERSION"] = version -extra["PUBLISH_ARTIFACT_ID"] = name - -// Stub secrets to let the project sync and build without the publication values set up -val signingKeyId: String? by project -val signingPassword: String? by project -val signingSecretKeyRingFile: String? by project - -extra["signing.keyId"] = signingKeyId -extra["signing.password"] = signingPassword -extra["signing.secretKeyRingFile"] = signingSecretKeyRingFile - -val javadocJar by tasks.registering(Jar::class) { - archiveClassifier.set("javadoc") -} - publishing { repositories { + mavenLocal() maven { name = "gitea" setUrl("https://gitea.astraeus.nl/api/packages/rnentjes/maven") @@ -90,42 +80,43 @@ publishing { } } } +} - // Configure all publications - publications.withType { - // Stub javadoc.jar artifact - artifact(javadocJar.get()) - - // Provide artifacts information requited by Maven Central - pom { - name.set("typed-byte-arrays") - description.set("Typed byte arrays") - url.set("https://gitea.astraeus.nl/rnentjes/typed-byte-arrays") - - licenses { - license { - name.set("MIT") - url.set("https://opensource.org/licenses/MIT") - } - } - developers { - developer { - id.set("rnentjes") - name.set("Rien Nentjes") - email.set("info@nentjes.com") - } - } - scm { - url.set("https://gitea.astraeus.nl/rnentjes/typed-byte-arrays") - } - } - } +tasks.withType { + dependsOn(tasks.withType()) } signing { sign(publishing.publications) } -tasks.withType { - dependsOn(tasks.withType()) +mavenPublishing { + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) + + signAllPublications() + + coordinates(group.toString(), name, version.toString()) + + pom { + name = "typed-byte-arrays" + description = "Typed byte arrays" + inceptionYear = "2024" + url = "https://gitea.astraeus.nl/rnentjes/typed-byte-arrays" + licenses { + license { + name = "MIT" + url = "https://opensource.org/licenses/MIT" + } + } + developers { + developer { + id = "rnentjes" + name = "Rien Nentjes" + email = "info@nentjes.com" + } + } + scm { + url = "https://gitea.astraeus.nl/rnentjes/typed-byte-arrays" + } + } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4e074eb..f34fad1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Aug 31 15:35:11 CEST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/readme.md b/readme.md index 426b646..64f19da 100644 --- a/readme.md +++ b/readme.md @@ -41,8 +41,8 @@ class Person() : TypedByteArray( } ``` -The different between STRING and CLOB is the maximum size (32kb vs 2gb). For any type where the length isn't fixed we need to provide max size. -When such a type is updated, for example we update a string with a shorter string, the remaining bytes are zeroed to make compression as efficient as possible. +The difference between STRING and CLOB is the maximum size (32kb vs 2gb). For any type where the length isn't fixed we need to provide max size. +When such a type is updated with a shorter element, the remaining bytes are zeroed to make compression as efficient as possible. -Strings are stored as UTF-8 bytes, there is also a CachedStringProperty which will keep a copy of the string so it isn't converted to a +Strings are stored as UTF-8 bytes, there is also a CachedStringProperty that will keep a copy of the string so it isn't converted to a native string every time it's accessed. diff --git a/settings.gradle.kts b/settings.gradle.kts index 8b53baa..793604a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,18 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + } +} + plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" }