From 1811c9807334a9ac3d693f250098f3abfbe5ee7d Mon Sep 17 00:00:00 2001 From: Infendro Date: Sat, 13 Dec 2025 00:49:24 +0100 Subject: [PATCH] use common plugin --- build.gradle.kts | 33 +++++++-------------------------- gradle/libs.versions.toml | 2 ++ settings.gradle.kts | 5 +++++ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 49336ff..95034ae 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,6 @@ +import com.infendro.plugin.infendro +import com.infendro.plugin.token + group = "com.infendro" version = "1.1.1" @@ -6,6 +9,7 @@ repositories { } plugins { + alias(libs.plugins.infendro) alias(libs.plugins.kotlin) id("maven-publish") } @@ -19,35 +23,12 @@ publishing { publications { create("JVM") { from(components["java"]) - groupId = group as String + groupId = project.group as String artifactId = project.name - version = version + version = project.version as String } } 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" - } - } + infendro(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 -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8c90fa7..e7c8fce 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,10 @@ [versions] +infendro = "1.0.0" kotlin = "2.2.10" exposed = "0.61.0" [plugins] +infendro = { id = "com.infendro.plugin", version.ref = "infendro" } kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } [libraries] diff --git a/settings.gradle.kts b/settings.gradle.kts index dd28cf8..7bdce23 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,6 @@ rootProject.name = "migration" + +pluginManagement.repositories { + maven("https://git.infendro.com/api/packages/Infendro/maven") + mavenCentral() +}