Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
Build system update (Minestom#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
Articdive authored and TheMode committed Jan 10, 2022
1 parent de817e5 commit 3089843
Show file tree
Hide file tree
Showing 69 changed files with 433 additions and 1,325 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
hs_err_pid*

### Gradle template
.gradle
**/.gradle
**/build/

# Ignore Gradle GUI config
Expand All @@ -53,5 +53,6 @@ gradle-app.setting
/src/main/java/com/mcecraft/

# When running the demo we generate the extensions folder
/extensions/
/.mixin.out/
# Incase people are using IntelliJ to run the server, this will exclude extensions from any folder.
/demo/extensions
/extensions
16 changes: 16 additions & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
plugins {
`kotlin-dsl`
}

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
val indraVersion = "2.0.6"
implementation("org.jetbrains.kotlin", "kotlin-gradle-plugin", "1.6.10")
implementation("net.kyori", "indra-common", indraVersion)
implementation("net.kyori", "indra-publishing-sonatype", indraVersion)
implementation("org.graalvm.buildtools", "native-gradle-plugin", "0.9.9")
}
25 changes: 25 additions & 0 deletions build-logic/src/main/kotlin/minestom.common-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
plugins {
java
}

// Always exclude checker-qual. This is the single most annoying thing that always reappears.
configurations.all {
// We only use Jetbrains Annotations
exclude("org.checkerframework", "checker-qual")
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

tasks {
withType<JavaCompile> {
// We are fully aware, that we should be suppressing these instead of ignoring them here, but man keep my terminal clean.
options.compilerArgs.addAll(listOf("-Xlint:none", "-Xlint:-deprecation", "-Xlint:-unchecked"))
}
withType<Test> {
useJUnitPlatform()
}
}
14 changes: 14 additions & 0 deletions build-logic/src/main/kotlin/minestom.native-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
plugins {
id("minestom.common-conventions")
id("org.graalvm.buildtools.native")
}

graalvmNative {
binaries {
named("main") {
buildArgs.add("--allow-incomplete-classpath")
// One day toolchains will support getting this automagically, but that day is not today.
toolchainDetection.set(false)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
plugins {
id("net.kyori.indra")
id("net.kyori.indra.publishing")
id("net.kyori.indra.publishing.sonatype")
}

indra {
javaVersions {
target(17)
testWith(17)
}

github("Minestom", "Minestom") {
ci(true)
}
apache2License()

configurePublications {
pom {
developers {
developer {
id.set("TheMode")
name.set("TheMode")
}
developer {
id.set("jglrxavpok")
name.set("jglrxavpok")
}
}
}
}
}
186 changes: 0 additions & 186 deletions build.gradle

This file was deleted.

84 changes: 84 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
plugins {
`java-library`
id("minestom.publishing-conventions")
id("minestom.native-conventions")
}

allprojects {
group = "net.minestom.server"
version = "1.0"
description = "Lightweight and multi-threaded Minecraft server implementation"
}

sourceSets {
main {
java {
srcDir(file("src/autogenerated/java"))
}
}
}

java {
withJavadocJar()
withSourcesJar()
}

tasks {
withType<Javadoc> {
(options as? StandardJavadocDocletOptions)?.apply {
encoding = "UTF-8"

// Custom options
addBooleanOption("html5", true)
addStringOption("-release", "17")
// Links to external javadocs
links("https://docs.oracle.com/en/java/javase/17/docs/api/")
links("https://jd.adventure.kyori.net/api/${libs.versions.adventure.get()}/")
}
}
withType<Zip> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}

dependencies {
// Junit Testing Framework
testImplementation(libs.junit.api)
testRuntimeOnly(libs.junit.engine)
// Only here to ensure J9 module support for extensions and our classloaders
testCompileOnly(libs.mockito.core)


// Logging
implementation(libs.bundles.logging)
// Libraries required for the terminal
implementation(libs.bundles.terminal)

// Performance improving libraries
implementation(libs.caffeine)
api(libs.fastutil)
implementation(libs.bundles.flare)

// Libraries
api(libs.guava)
api(libs.gson)
implementation(libs.jcTools)
// Path finding
api(libs.hydrazine)

// Adventure, for user-interface
api(libs.bundles.adventure)

// Kotlin Libraries
api(libs.bundles.kotlin)

// Extension Management System dependency handler.
api(libs.dependencyGetter)

// Minestom Data (From MinestomDataGenerator)
implementation(libs.minestomData)

// NBT parsing/manipulation/saving
api("io.github.jglrxavpok.hephaistos:common:${libs.versions.hephaistos.get()}")
api("io.github.jglrxavpok.hephaistos:gson:${libs.versions.hephaistos.get()}")
}
Loading

0 comments on commit 3089843

Please sign in to comment.