diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ab84f0f7ffcdf9d662effeece62e5f9d55a634..06b0c63fba95d0052a8fd6dc4d1e59300d20fba0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +Release 1.7.2: + - Refactor `LibraryInitializer.registerExtensionLibrary`, see Readme + Release 1.7.1: - Remove references to `PupilIdCredential`, will be moved to separate library diff --git a/build.gradle.kts b/build.gradle.kts index aa1a4e53700af8d11ef6b7bcd81dfa94774c6c22..4da86a991b24f860ee3c28461b3d4f6eca3e5d7b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,7 @@ +plugins { + id("io.github.gradle-nexus.publish-plugin") version Versions.nexus +} + buildscript { repositories { gradlePluginPortal() @@ -18,3 +22,17 @@ allprojects { tasks.register("clean", Delete::class) { delete(rootProject.buildDir) } + +val artifactVersion: String by extra +group = "at.asitplus.wallet" +version = artifactVersion + +nexusPublishing { + repositories { + sonatype { + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + } + } +} + diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 1c6d9363bfdf71f697d76e0b56a308f22fc0d374..93a3b3b31b1284110c9b8b756a95b7bcd0a7b830 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -10,6 +10,8 @@ object Versions { const val resultlib = "1.4.0" const val encoding = "1.1.3" const val okio = "3.2.0" + const val dokka = "1.7.20" + const val nexus = "1.1.0" object Jvm { const val target = "11" diff --git a/gradle.properties b/gradle.properties index 39b4380b465d47b789362828bb260a5cb40e6213..7d0dfcd9c89934dabfa6153f503db25cd486b1e5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,4 +14,6 @@ kotlin.native.binary.memoryModel=experimental kotlin.native.binary.freezing=disabled kotlin.native.ignoreDisabledTargets=true -artifactVersion = 1.7.2-SNAPSHOT +gitLabProjectId = 751 +gitLabGroupId = 159 +artifactVersion = 1.7.2 diff --git a/vclib/build.gradle.kts b/vclib/build.gradle.kts index 82f62dc078d47922388a1cebf59f8004412147e6..95ac5e33ff72b9bf1ee44d0ff4836123200b0a58 100644 --- a/vclib/build.gradle.kts +++ b/vclib/build.gradle.kts @@ -9,6 +9,8 @@ plugins { kotlin("plugin.serialization") version Versions.kotlin id("maven-publish") id("io.kotest.multiplatform") version Versions.kotest + id("signing") + id("org.jetbrains.dokka") version Versions.dokka } /* required for maven publication */ @@ -16,8 +18,20 @@ val artifactVersion: String by extra group = "at.asitplus.wallet" version = artifactVersion -kotlin { +val dokkaOutputDir = "$buildDir/dokka" +tasks.dokkaHtml { + outputDirectory.set(file(dokkaOutputDir)) +} +val deleteDokkaOutputDir by tasks.register<Delete>("deleteDokkaOutputDirectory") { + delete(dokkaOutputDir) +} +val javadocJar = tasks.register<Jar>("javadocJar") { + dependsOn(deleteDokkaOutputDir, tasks.dokkaHtml) + archiveClassifier.set("javadoc") + from(dokkaOutputDir) +} +kotlin { val xcf = XCFrameworkConfig(project, "VcLibKMM") ios { @@ -119,7 +133,7 @@ tasks.withType<Test> { showExceptions = true showStandardStreams = true events = setOf( - TestLogEvent.FAILED, + TestLogEvent.FAILED, TestLogEvent.PASSED ) exceptionFormat = TestExceptionFormat.FULL @@ -131,13 +145,88 @@ Properties().apply { forEach { (k, v) -> extra.set(k as String, v) } } +val gitLabPrivateToken: String? by extra +val gitLabProjectId: String by extra +val gitLabGroupId: String by extra + repositories { mavenLocal() + if (System.getenv("CI_JOB_TOKEN") != null || gitLabPrivateToken != null) { + maven { + name = "gitlab" + url = uri("https://gitlab.iaik.tugraz.at/api/v4/groups/$gitLabGroupId/-/packages/maven") + if (gitLabPrivateToken != null) { + credentials(HttpHeaderCredentials::class) { + name = "Private-Token" + value = gitLabPrivateToken + } + } else if (System.getenv("CI_JOB_TOKEN") != null) { + credentials(HttpHeaderCredentials::class) { + name = "Job-Token" + value = System.getenv("CI_JOB_TOKEN") + } + } + authentication { + create<HttpHeaderAuthentication>("header") + } + } + } mavenCentral() } + publishing { + publications { + withType<MavenPublication> { + artifact(javadocJar) + pom { + name.set("KmmVcLib") + description.set("Functional equivalent of kotlin.Result but with KMM goodness") + url.set("https://github.com/a-sit-plus/kmm-vc-library") + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + id.set("JesusMcCloud") + name.set("Bernd PrĂ¼nster") + email.set("bernd.pruenster@a-sit.at") + } + developer { + id.set("nodh") + name.set("Christian Kollmann") + email.set("christian.kollmann@a-sit.at") + } + } + scm { + connection.set("scm:git:git@github.com:a-sit-plus/kmm-vc-library.git") + developerConnection.set("scm:git:git@github.com:a-sit-plus/kmm-vc-library.git") + url.set("https://github.com/a-sit-plus/kmm-vc-library") + } + } + } + } repositories { mavenLocal() + if (System.getenv("CI_JOB_TOKEN") != null) { + maven { + name = "gitlab" + url = uri("https://gitlab.iaik.tugraz.at/api/v4/projects/$gitLabProjectId/packages/maven") + credentials(HttpHeaderCredentials::class) { + name = "Job-Token" + value = System.getenv("CI_JOB_TOKEN") + } + authentication { + create<HttpHeaderAuthentication>("header") + } + } + } } } + +signing { + sign(publishing.publications) +}