use common plugin

This commit is contained in:
2025-12-13 01:47:38 +01:00
parent 889f5ddb6c
commit 810c2d4263
3 changed files with 15 additions and 29 deletions

View File

@@ -1,11 +1,11 @@
import com.infendro.plugin.infendro
import com.infendro.plugin.token
group = "com.infendro" group = "com.infendro"
version = "1.3.0" version = "1.3.0"
repositories {
mavenCentral()
}
plugins { plugins {
alias(libs.plugins.infendro)
alias(libs.plugins.multiplatform) alias(libs.plugins.multiplatform)
id("maven-publish") id("maven-publish")
} }
@@ -16,33 +16,12 @@ kotlin {
nodejs() nodejs()
} }
linuxX64() linuxX64()
}
publishing {
repositories { repositories {
maven { mavenCentral()
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( publishing.repositories {
key: String, infendro(token)
): 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,5 +1,7 @@
[versions] [versions]
kotlin = "2.2.10" infendro = "1.0.0"
kotlin = "2.2.21"
[plugins] [plugins]
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

View File

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