From d0c130cb61f0cc06d1bdcd44e438a7f791b73aa0 Mon Sep 17 00:00:00 2001 From: Infendro Date: Sat, 13 Dec 2025 00:49:46 +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 3492295..d9c869b 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.0" @@ -7,6 +10,7 @@ repositories { } plugins { + alias(libs.plugins.infendro) alias(libs.plugins.kotlin) id("maven-publish") } @@ -21,35 +25,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 e1f4550..09b25aa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,12 @@ [versions] +infendro = "1.0.0" kotlin = "2.2.10" ktor = "3.2.3" exposed = "0.61.0" migration = "1.1.1" [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 019a2ce..29da793 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,6 @@ rootProject.name = "migration-ktor" + +pluginManagement.repositories { + maven("https://git.infendro.com/api/packages/Infendro/maven") + mavenCentral() +}