use common plugin

This commit is contained in:
2025-12-13 01:49:22 +01:00
parent bd5d904a3b
commit 704cf2a796
3 changed files with 18 additions and 32 deletions

View File

@@ -1,11 +1,11 @@
import com.infendro.plugin.infendro
import com.infendro.plugin.token
group = "com.infendro"
version = "1.2.0"
repositories {
mavenCentral()
}
plugins {
alias(libs.plugins.infendro)
alias(libs.plugins.multiplatform)
id("maven-publish")
}
@@ -17,6 +17,10 @@ kotlin {
}
linuxX64()
repositories {
mavenCentral()
}
sourceSets {
commonTest.dependencies {
implementation(libs.test)
@@ -28,31 +32,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)
}

View File

@@ -1,7 +1,9 @@
[versions]
kotlin = "2.1.20"
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" }
[libraries]

View File

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