use common plugin

This commit is contained in:
2025-12-13 00:49:24 +01:00
parent e9ba266d53
commit 1811c98073
3 changed files with 14 additions and 26 deletions

View File

@@ -1,3 +1,6 @@
import com.infendro.plugin.infendro
import com.infendro.plugin.token
group = "com.infendro" group = "com.infendro"
version = "1.1.1" version = "1.1.1"
@@ -6,6 +9,7 @@ repositories {
} }
plugins { plugins {
alias(libs.plugins.infendro)
alias(libs.plugins.kotlin) alias(libs.plugins.kotlin)
id("maven-publish") id("maven-publish")
} }
@@ -19,35 +23,12 @@ publishing {
publications { publications {
create<MavenPublication>("JVM") { create<MavenPublication>("JVM") {
from(components["java"]) from(components["java"])
groupId = group as String groupId = project.group as String
artifactId = project.name artifactId = project.name
version = version version = project.version as String
} }
} }
repositories { repositories {
maven { infendro(token)
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
}

View File

@@ -1,8 +1,10 @@
[versions] [versions]
infendro = "1.0.0"
kotlin = "2.2.10" kotlin = "2.2.10"
exposed = "0.61.0" exposed = "0.61.0"
[plugins] [plugins]
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
[libraries] [libraries]

View File

@@ -1 +1,6 @@
rootProject.name = "migration" rootProject.name = "migration"
pluginManagement.repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
mavenCentral()
}