Files
Civ/scripts/gradle/common.gradle
AngrySoundTech 99d0940197 Fix Packages URI
2024-02-07 20:51:24 -05:00

68 lines
1.7 KiB
Groovy

pluginManager.withPlugin("java-library") {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withSourcesJar()
withJavadocJar()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release = 17
}
tasks.withType(ProcessResources).configureEach {
filteringCharset = "UTF-8"
}
// TODO
// tasks.withType(Test).configureEach {
// useJUnitPlatform()
// testLogging {
// events(*TestLogEvent.values())
// exceptionFormat = TestExceptionFormat.FULL
// showCauses = true
// showExceptions = true
// showStackTraces = true
// }
// }
}
pluginManager.withPlugin("maven-publish") {
def githubActor = System.getenv("GITHUB_ACTOR")
def githubToken = System.getenv("GITHUB_TOKEN")
publishing {
repositories {
if (githubActor && githubToken) {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/CivMC/Civ"
credentials {
username = githubActor
password = githubToken
}
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}
}
pluginManager.withPlugin("com.gradle.enterprise") {
gradleEnterprise {
buildScan {
if (System.getenv("CI")) {
it.tag("CI")
it.termsOfServiceUrl = "https://gradle.com/terms-of-service"
it.termsOfServiceAgree = "yes"
}
}
}
}