Reformat publishing section of build.gradle.kts

This commit is contained in:
2023-09-01 19:57:54 +10:00
parent 0e0d0158ae
commit 0d82430968

View File

@ -13,7 +13,6 @@ repositories {
dependencies { dependencies {
implementation("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.3.3") implementation("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.3.3")
testImplementation(kotlin("test")) testImplementation(kotlin("test"))
} }
@ -40,39 +39,33 @@ gradlePlugin {
} }
publishing { publishing {
repositories { repositories {
mavenLocal() mavenLocal()
var githubPackagesToken = System.getenv("GITHUB_TOKEN") val githubPackagesToken = System.getenv("GITHUB_TOKEN")
if (githubPackagesToken == null) { ?: project.findProperty("github.token") as String?
githubPackagesToken = project.findProperty("github.token") as String? val gitlabPackagesToken = System.getenv("GITLAB_TOKEN")
} ?: project.findProperty("gitlab.com.accessToken") as String?
var gitlabPackagesToken = System.getenv("GITLAB_TOKEN") maven {
if (gitlabPackagesToken == null) { name = "GitHubPackages"
gitlabPackagesToken = project.findProperty("gitlab.com.accessToken") as String? url = uri("https://maven.pkg.github.com/gaypizzaspecifications/drywall")
} credentials {
username = project.findProperty("github.username") as String? ?: "gaypizzaspecifications"
password = githubPackagesToken
}
}
maven { maven {
name = "GitHubPackages" name = "GitLab"
url = uri("https://maven.pkg.github.com/gaypizzaspecifications/drywall") url = uri("https://gitlab.com/api/v4/projects/47347654/packages/maven")
credentials { credentials(HttpHeaderCredentials::class.java) {
username = project.findProperty("github.username") as String? ?: "gaypizzaspecifications" name = "Private-Token"
password = githubPackagesToken value = gitlabPackagesToken
} }
} authentication {
create<HttpHeaderAuthentication>("header")
maven { }
name = "GitLab" }
url = uri("https://gitlab.com/api/v4/projects/47347654/packages/maven") }
credentials(HttpHeaderCredentials::class.java) {
name = "Private-Token"
value = gitlabPackagesToken
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
} }