diff --git a/build.gradle.kts b/build.gradle.kts index d24de58..e66f47a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,11 @@ +import com.infendro.plugin.infendro +import com.infendro.plugin.token + group = "com.infendro" version = "1.2.0" -repositories { - maven("https://git.infendro.com/api/packages/Infendro/maven") - mavenCentral() -} - plugins { + alias(libs.plugins.infendro) alias(libs.plugins.multiplatform) id("maven-publish") } @@ -18,6 +17,11 @@ kotlin { } linuxX64() + repositories { + infendro() + mavenCentral() + } + sourceSets { commonMain.dependencies { implementation(libs.hash) @@ -31,31 +35,6 @@ kotlin { } } -publishing { - repositories { - maven { - url = uri("https://git.infendro.com/api/packages/Infendro/maven") - authentication.create("header", HttpHeaderAuthentication::class) - credentials(HttpHeaderCredentials::class) { - val token = secret("git.token") ?: throw GradleException() - - name = "Authorization" - value = "token $token" - } - } - } -} - -fun secret( - key: String, -): String? { - val property = key - val environment = key - .uppercase() - .replace(".", "__") - - val prop = properties[property] as String? - val env = System.getenv(environment) - - return prop ?: env +publishing.repositories { + infendro(token) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3a0b1a1..f087be6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,12 @@ [versions] -kotlin = "2.1.20" +infendro = "1.0.0" +kotlin = "2.2.21" hash = "1.3.2" mac = "1.2.0" -bytearray = "1.2.2" +bytearray = "1.2.4" [plugins] +infendro = { id = "com.infendro.plugin", version.ref = "infendro" } multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } [libraries] diff --git a/settings.gradle.kts b/settings.gradle.kts index cb9751a..7a15580 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,6 @@ -rootProject.name = "random" +rootProject.name = "prng" + +pluginManagement.repositories { + maven("https://git.infendro.com/api/packages/Infendro/maven") + mavenCentral() +}