use common plugin
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import com.infendro.plugin.infendro
|
||||
import com.infendro.plugin.token
|
||||
|
||||
group = "com.infendro"
|
||||
version = "1.1.1"
|
||||
|
||||
@@ -6,6 +9,7 @@ repositories {
|
||||
}
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.infendro)
|
||||
alias(libs.plugins.kotlin)
|
||||
id("maven-publish")
|
||||
}
|
||||
@@ -19,35 +23,12 @@ publishing {
|
||||
publications {
|
||||
create<MavenPublication>("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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user