From 810c2d4263aec0d50306a99dfaa4e49c2eac3854 Mon Sep 17 00:00:00 2001 From: Infendro Date: Sat, 13 Dec 2025 01:47:38 +0100 Subject: [PATCH] use common plugin --- build.gradle.kts | 35 +++++++---------------------------- gradle/libs.versions.toml | 4 +++- settings.gradle.kts | 5 +++++ 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 18417a0..97585c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,11 +1,11 @@ +import com.infendro.plugin.infendro +import com.infendro.plugin.token + group = "com.infendro" version = "1.3.0" -repositories { - mavenCentral() -} - plugins { + alias(libs.plugins.infendro) alias(libs.plugins.multiplatform) id("maven-publish") } @@ -16,33 +16,12 @@ kotlin { nodejs() } linuxX64() -} -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" - } - } + mavenCentral() } } -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 c6f20aa..1139889 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,7 @@ [versions] -kotlin = "2.2.10" +infendro = "1.0.0" +kotlin = "2.2.21" [plugins] +infendro = { id = "com.infendro.plugin", version.ref = "infendro" } multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } diff --git a/settings.gradle.kts b/settings.gradle.kts index c23d142..abef261 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,6 @@ rootProject.name = "cli" + +pluginManagement.repositories { + maven("https://git.infendro.com/api/packages/Infendro/maven") + mavenCentral() +}