use common plugin

This commit is contained in:
2025-12-13 01:16:24 +01:00
parent 6f4d1c38a3
commit c075bbfa1e
3 changed files with 20 additions and 34 deletions

View File

@@ -1,12 +1,11 @@
import com.infendro.plugin.infendro
import com.infendro.plugin.token
group = "com.infendro"
version = "1.2.0"
repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
mavenCentral()
}
plugins {
alias(libs.plugins.infendro)
alias(libs.plugins.multiplatform)
id("maven-publish")
}
@@ -18,6 +17,11 @@ kotlin {
}
linuxX64()
repositories {
infendro()
mavenCentral()
}
sourceSets {
commonMain.dependencies {
implementation(libs.hash)
@@ -33,31 +37,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)
}