forked from EngineHub/WorldGuard
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
848 additions
and
599 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
kotlin("jvm") version embeddedKotlinVersion | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
|
||
dependencies { | ||
implementation(gradleApi()) | ||
implementation("gradle.plugin.org.cadixdev.gradle:licenser:0.6.1") | ||
implementation("org.ajoberstar.grgit:grgit-gradle:5.2.2") | ||
implementation("com.github.johnrengelman:shadow:8.1.1") | ||
implementation("org.jfrog.buildinfo:build-info-extractor-gradle:5.2.0") | ||
implementation(libs.licenser) | ||
implementation(libs.grgit) | ||
implementation(libs.shadow) | ||
implementation(libs.jfrog.buildinfo) | ||
implementation(libs.gson) | ||
|
||
constraints { | ||
val asmVersion = "[9.7,)" | ||
val asmVersion = "[${libs.versions.minimumAsm.get()},)" | ||
implementation("org.ow2.asm:asm:$asmVersion") { | ||
because("Need Java 21 support in shadow") | ||
} | ||
implementation("org.ow2.asm:asm-commons:$asmVersion") { | ||
because("Need Java 21 support in shadow") | ||
} | ||
implementation("org.vafer:jdependency:[2.10,)") { | ||
implementation("org.vafer:jdependency:[${libs.versions.minimumJdependency.get()},)") { | ||
because("Need Java 21 support in shadow") | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} | ||
|
||
rootProject.name = "build-logic" |
32 changes: 32 additions & 0 deletions
32
build-logic/src/main/kotlin/buildlogic.artifactory-root.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention | ||
import org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask | ||
|
||
plugins { | ||
id("com.jfrog.artifactory") | ||
} | ||
|
||
val ARTIFACTORY_CONTEXT_URL = "artifactory_contextUrl" | ||
val ARTIFACTORY_USER = "artifactory_user" | ||
val ARTIFACTORY_PASSWORD = "artifactory_password" | ||
|
||
if (!project.hasProperty(ARTIFACTORY_CONTEXT_URL)) ext[ARTIFACTORY_CONTEXT_URL] = "http://localhost" | ||
if (!project.hasProperty(ARTIFACTORY_USER)) ext[ARTIFACTORY_USER] = "guest" | ||
if (!project.hasProperty(ARTIFACTORY_PASSWORD)) ext[ARTIFACTORY_PASSWORD] = "" | ||
|
||
configure<ArtifactoryPluginConvention> { | ||
setContextUrl("${project.property(ARTIFACTORY_CONTEXT_URL)}") | ||
clientConfig.publisher.run { | ||
repoKey = when { | ||
"${project.version}".contains("SNAPSHOT") -> "libs-snapshot-local" | ||
else -> "libs-release-local" | ||
} | ||
username = "${project.property(ARTIFACTORY_USER)}" | ||
password = "${project.property(ARTIFACTORY_PASSWORD)}" | ||
isMaven = true | ||
isIvy = false | ||
} | ||
} | ||
|
||
tasks.named<ArtifactoryTask>("artifactoryPublish") { | ||
isSkip = true | ||
} |
10 changes: 10 additions & 0 deletions
10
build-logic/src/main/kotlin/buildlogic.artifactory-sub.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugins { | ||
id("com.jfrog.artifactory") | ||
} | ||
|
||
// Artifactory eagerly evaluates publications, so this must run after all changes to artifacts are done | ||
afterEvaluate { | ||
tasks.named<org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask>("artifactoryPublish") { | ||
publications("maven") | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
build-logic/src/main/kotlin/buildlogic.common-java.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import buildlogic.getLibrary | ||
import buildlogic.stringyLibs | ||
|
||
plugins { | ||
id("eclipse") | ||
id("idea") | ||
id("checkstyle") | ||
id("buildlogic.common") | ||
} | ||
|
||
tasks | ||
.withType<JavaCompile>() | ||
.matching { it.name == "compileJava" || it.name == "compileTestJava" } | ||
.configureEach { | ||
val disabledLint = listOf( | ||
"processing", "path", "fallthrough", "serial", "overloads", | ||
) | ||
options.release.set(21) | ||
options.compilerArgs.addAll(listOf("-Xlint:all") + disabledLint.map { "-Xlint:-$it" }) | ||
options.isDeprecation = true | ||
options.encoding = "UTF-8" | ||
options.compilerArgs.add("-parameters") | ||
//options.compilerArgs.add("-Werror") | ||
} | ||
|
||
configure<CheckstyleExtension> { | ||
configFile = rootProject.file("config/checkstyle/checkstyle.xml") | ||
toolVersion = "10.16.0" | ||
} | ||
|
||
tasks.withType<Test>().configureEach { | ||
useJUnitPlatform() | ||
} | ||
|
||
dependencies { | ||
"compileOnly"(stringyLibs.getLibrary("jsr305")) | ||
"testImplementation"(platform(stringyLibs.getLibrary("junit-bom"))) | ||
"testImplementation"(stringyLibs.getLibrary("junit-jupiter-api")) | ||
"testImplementation"(stringyLibs.getLibrary("junit-jupiter-params")) | ||
"testRuntimeOnly"(stringyLibs.getLibrary("junit-jupiter-engine")) | ||
} | ||
|
||
// Java 8 turns on doclint which we fail | ||
tasks.withType<Javadoc>().configureEach { | ||
options.encoding = "UTF-8" | ||
(options as StandardJavadocDocletOptions).apply { | ||
//addBooleanOption("Werror", true) | ||
addBooleanOption("Xdoclint:all", true) | ||
addBooleanOption("Xdoclint:-missing", true) | ||
tags( | ||
"apiNote:a:API Note:", | ||
"implSpec:a:Implementation Requirements:", | ||
"implNote:a:Implementation Note:" | ||
) | ||
} | ||
} | ||
|
||
configure<JavaPluginExtension> { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
tasks.named("check").configure { | ||
dependsOn("checkstyleMain", "checkstyleTest") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import buildlogic.getLibrary | ||
import buildlogic.stringyLibs | ||
import org.gradle.plugins.ide.idea.model.IdeaModel | ||
|
||
plugins { | ||
id("org.cadixdev.licenser") | ||
} | ||
|
||
group = rootProject.group | ||
version = rootProject.version | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { | ||
name = "EngineHub" | ||
url = uri("https://maven.enginehub.org/repo/") | ||
} | ||
} | ||
|
||
configurations.all { | ||
resolutionStrategy { | ||
cacheChangingModulesFor(1, TimeUnit.DAYS) | ||
} | ||
} | ||
|
||
plugins.withId("java") { | ||
the<JavaPluginExtension>().toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(21)) | ||
} | ||
} | ||
|
||
dependencies { | ||
for (conf in listOf("implementation", "api")) { | ||
if (!configurations.names.contains(conf)) { | ||
continue | ||
} | ||
add(conf, platform(stringyLibs.getLibrary("log4j-bom")).map { | ||
val dep = create(it) | ||
dep.because("Mojang provides Log4j") | ||
dep | ||
}) | ||
constraints { | ||
add(conf, stringyLibs.getLibrary("guava")) { | ||
because("Mojang provides Guava") | ||
} | ||
add(conf, stringyLibs.getLibrary("gson")) { | ||
because("Mojang provides Gson") | ||
} | ||
add(conf, stringyLibs.getLibrary("fastutil")) { | ||
because("Mojang provides FastUtil") | ||
} | ||
} | ||
} | ||
} | ||
|
||
license { | ||
header(rootProject.file("HEADER.txt")) | ||
include("**/*.java") | ||
include("**/*.kt") | ||
} | ||
|
||
plugins.withId("idea") { | ||
configure<IdeaModel> { | ||
module { | ||
isDownloadSources = true | ||
isDownloadJavadoc = true | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
build-logic/src/main/kotlin/buildlogic.core-and-platform.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
plugins { | ||
id("java") | ||
id("maven-publish") | ||
id("buildlogic.common-java") | ||
id("buildlogic.artifactory-sub") | ||
} | ||
|
||
ext["internalVersion"] = "$version+${rootProject.ext["gitCommitHash"]}" | ||
|
||
publishing { | ||
publications { | ||
register<MavenPublication>("maven") { | ||
versionMapping { | ||
usage("java-api") { | ||
fromResolutionOf("runtimeClasspath") | ||
} | ||
usage("java-runtime") { | ||
fromResolutionResult() | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.