-
-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'EngineHub:master' into master
- Loading branch information
Showing
37 changed files
with
712 additions
and
380 deletions.
There are no files selected for viewing
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,2 +1,34 @@ | ||
*.java diff=java | ||
* text=auto eol=lf | ||
# Force Batch files to CRLF | ||
*.bat eol=crlf -text | ||
|
||
# Java sources | ||
*.java text diff=java | ||
*.kt text diff=java | ||
*.gradle text diff=java | ||
*.gradle.kts text diff=java | ||
|
||
# These files are text and should be normalized (Convert crlf => lf) | ||
*.css text diff=css | ||
*.df text | ||
*.htm text diff=html | ||
*.html text diff=html | ||
*.js text | ||
*.jsp text | ||
*.jspf text | ||
*.jspx text | ||
*.properties text | ||
*.tld text | ||
*.tag text | ||
*.tagx text | ||
*.xml text | ||
|
||
# These files are binary and should be left untouched | ||
# (binary is a macro for -text -diff) | ||
*.class binary | ||
*.dll binary | ||
*.ear binary | ||
*.jar binary | ||
*.so binary | ||
*.war binary | ||
*.jks binary |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Compiling | ||
========= | ||
|
||
You can compile WorldGuard as long as you have some version of Java greater than or equal to 16 installed. Gradle will download JDK 16 specifically if needed, | ||
but it needs some version of Java to bootstrap from. | ||
|
||
Note that if you have JRE 16 installed, Gradle will currently attempt to use that to compile, which will not work. It is easiest to uninstall JRE 16 and | ||
replace it with JDK 16. | ||
|
||
The build process uses Gradle, which you do *not* need to download. WorldGuard is a multi-module project with three modules: | ||
|
||
* `worldguard-core` contains the WorldGuard API | ||
* `worldguard-bukkit` is the Bukkit plugin | ||
* `worldguard-libs` contains library relocations | ||
|
||
## To compile... | ||
|
||
### On Windows | ||
|
||
1. **Shift** + **right click** the folder with WorldGuard's files and click "Open PowerShell window here". | ||
2. `gradlew build` | ||
|
||
### On Linux, BSD, or Mac OS X | ||
|
||
1. In your terminal, navigate to the folder with WorldGuard's files (`cd /folder/of/worldguard/files`) | ||
2. `./gradlew build` | ||
|
||
## Then you will find... | ||
|
||
You will find: | ||
|
||
* The core WorldGuard API in **worldguard-core/build/libs** | ||
* WorldGuard for Bukkit in **worldguard-bukkit/build/libs** | ||
|
||
If you want to use WorldGuard, use the `-dist` version. | ||
|
||
(The -dist version includes WorldGuard + necessary libraries.) | ||
|
||
## Other commands | ||
|
||
* `gradlew idea` will generate an [IntelliJ IDEA](http://www.jetbrains.com/idea/) module for each folder. | ||
* `gradlew eclipse` will generate an [Eclipse](https://www.eclipse.org/downloads/) project for each folder. |
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
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
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,86 @@ | ||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.api.plugins.quality.CheckstyleExtension | ||
import org.gradle.api.tasks.compile.JavaCompile | ||
import org.gradle.api.tasks.javadoc.Javadoc | ||
import org.gradle.api.tasks.testing.Test | ||
import org.gradle.external.javadoc.StandardJavadocDocletOptions | ||
import org.gradle.kotlin.dsl.apply | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.get | ||
import org.gradle.kotlin.dsl.withType | ||
|
||
fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, javaRelease: Int = 8, banSlf4j: Boolean = true) { | ||
applyCommonConfiguration() | ||
apply(plugin = "eclipse") | ||
apply(plugin = "idea") | ||
apply(plugin = "checkstyle") | ||
|
||
tasks | ||
.withType<JavaCompile>() | ||
.matching { it.name == "compileJava" || it.name == "compileTestJava" } | ||
.configureEach { | ||
val disabledLint = listOf( | ||
"processing", "path", "fallthrough", "serial" | ||
) | ||
options.release.set(javaRelease) | ||
options.compilerArgs.addAll(listOf("-Xlint:all") + disabledLint.map { "-Xlint:-$it" }) | ||
options.isDeprecation = true | ||
options.encoding = "UTF-8" | ||
options.compilerArgs.add("-parameters") | ||
} | ||
|
||
configure<CheckstyleExtension> { | ||
configFile = rootProject.file("config/checkstyle/checkstyle.xml") | ||
toolVersion = "9.1" | ||
} | ||
|
||
tasks.withType<Test>().configureEach { | ||
useJUnitPlatform() | ||
} | ||
|
||
dependencies { | ||
"compileOnly"("com.google.code.findbugs:jsr305:${Versions.FINDBUGS}") | ||
"testImplementation"("org.junit.jupiter:junit-jupiter-api:${Versions.JUNIT}") | ||
"testImplementation"("org.junit.jupiter:junit-jupiter-params:${Versions.JUNIT}") | ||
"testImplementation"("org.mockito:mockito-core:${Versions.MOCKITO}") | ||
"testImplementation"("org.mockito:mockito-junit-jupiter:${Versions.MOCKITO}") | ||
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:${Versions.JUNIT}") | ||
} | ||
|
||
// Java 8 turns on doclint which we fail | ||
tasks.withType<Javadoc>().configureEach { | ||
options.encoding = "UTF-8" | ||
(options as StandardJavadocDocletOptions).apply { | ||
addStringOption("Xdoclint:none", "-quiet") | ||
tags( | ||
"apiNote:a:API Note:", | ||
"implSpec:a:Implementation Requirements:", | ||
"implNote:a:Implementation Note:" | ||
) | ||
} | ||
} | ||
|
||
configure<JavaPluginExtension> { | ||
disableAutoTargetJvm() | ||
withJavadocJar() | ||
if (sourcesJar) { | ||
withSourcesJar() | ||
} | ||
} | ||
|
||
if (banSlf4j) { | ||
configurations["compileClasspath"].apply { | ||
resolutionStrategy.componentSelection { | ||
withModule("org.slf4j:slf4j-api") { | ||
reject("No SLF4J allowed on compile classpath") | ||
} | ||
} | ||
} | ||
} | ||
|
||
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
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
Oops, something went wrong.