mirror of https://github.com/Minestom/Minestom.git
hollow-cube/gradle-rework (#8)
* in order to make an omelet, you have to break a few eggs. aka absolutely decimate the gradle project
* far more sane gradle, no publishing yet tho
* attempt maven deploy
* fix publish url and use snapshot repo
* fix secret names
* release, and properly set version
* attempt to set group correctly
* more gradle fixups
(cherry picked from commit 381d89497a
)
This commit is contained in:
parent
8a6a8f0050
commit
9e85687575
|
@ -1,16 +1,12 @@
|
||||||
name: Build and test Minestom
|
name: Build and test Minestom
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: Gradle Publish to Maven Central
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
|
||||||
|
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
- name: Set outputs
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
echo "short_commit_hash=${GITHUB_SHA::10}" >> $GITHUB_OUTPUT
|
||||||
|
- name: Publish to Sonatype
|
||||||
|
env:
|
||||||
|
SHORT_COMMIT_HASH: ${{ steps.vars.outputs.short_commit_hash }}
|
||||||
|
run: |
|
||||||
|
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||||
|
echo "Version: ${SHORT_COMMIT_HASH}" >> $GITHUB_STEP_SUMMARY
|
|
@ -1,7 +1,7 @@
|
||||||
name: Trigger Jitpack Build
|
name: Trigger Jitpack Build
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ main ]
|
||||||
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -9,4 +9,4 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger Jitpack Build
|
- name: Trigger Jitpack Build
|
||||||
run: curl "https://jitpack.io/com/github/Minestom/Minestom/${GITHUB_SHA:0:10}/build.log"
|
run: curl "https://jitpack.io/com/github/hollow-cube/minestom-ce/${GITHUB_SHA:0:10}/build.log"
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
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")
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
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()
|
|
||||||
// Viewable packets make tracking harder. Could be re-enabled later.
|
|
||||||
jvmArgs("-Dminestom.viewable-packet=false")
|
|
||||||
jvmArgs("-Dminestom.inside-test=true")
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
199
build.gradle.kts
199
build.gradle.kts
|
@ -1,27 +1,79 @@
|
||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
id("minestom.publishing-conventions")
|
|
||||||
id("minestom.native-conventions")
|
|
||||||
alias(libs.plugins.blossom)
|
alias(libs.plugins.blossom)
|
||||||
|
|
||||||
|
`maven-publish`
|
||||||
|
signing
|
||||||
|
alias(libs.plugins.nexuspublish)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
version = System.getenv("SHORT_COMMIT_HASH") ?: "dev"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "net.minestom.server"
|
apply(plugin = "java")
|
||||||
version = "1.0"
|
|
||||||
|
group = "net.minestom"
|
||||||
|
version = rootProject.version
|
||||||
description = "Lightweight and multi-threaded Minecraft server implementation"
|
description = "Lightweight and multi-threaded Minecraft server implementation"
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven(url = "https://jitpack.io")
|
||||||
|
}
|
||||||
|
|
||||||
|
configurations.all {
|
||||||
|
// We only use Jetbrains Annotations
|
||||||
|
exclude("org.checkerframework", "checker-qual")
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
withSourcesJar()
|
||||||
|
withJavadocJar()
|
||||||
|
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<Zip> {
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<Test> {
|
||||||
|
useJUnitPlatform()
|
||||||
|
|
||||||
|
// Viewable packets make tracking harder. Could be re-enabled later.
|
||||||
|
jvmArgs("-Dminestom.viewable-packet=false")
|
||||||
|
jvmArgs("-Dminestom.inside-test=true")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java.srcDir(file("src/main/java"))
|
||||||
srcDir(file("src/autogenerated/java"))
|
java.srcDir(file("src/autogenerated/java"))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
dependencies {
|
||||||
withJavadocJar()
|
// Core dependencies
|
||||||
withSourcesJar()
|
api(libs.slf4j)
|
||||||
|
api(libs.jetbrainsAnnotations)
|
||||||
|
api(libs.bundles.adventure)
|
||||||
|
api(libs.hydrazine)
|
||||||
|
api(libs.bundles.kotlin)
|
||||||
|
api(libs.bundles.hephaistos)
|
||||||
|
implementation(libs.minestomData)
|
||||||
|
|
||||||
|
// Performance/data structures
|
||||||
|
implementation(libs.caffeine)
|
||||||
|
api(libs.fastutil)
|
||||||
|
implementation(libs.bundles.flare)
|
||||||
|
api(libs.gson)
|
||||||
|
implementation(libs.jcTools)
|
||||||
|
|
||||||
|
// Testing
|
||||||
|
testImplementation(libs.bundles.junit)
|
||||||
|
testImplementation(project(":testing"))
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
@ -37,63 +89,92 @@ tasks {
|
||||||
links("https://jd.adventure.kyori.net/api/${libs.versions.adventure.get()}/")
|
links("https://jd.adventure.kyori.net/api/${libs.versions.adventure.get()}/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
withType<Zip> {
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
||||||
}
|
|
||||||
|
|
||||||
blossom {
|
blossom {
|
||||||
val git = "src/main/java/net/minestom/server/Git.java"
|
val gitFile = "src/main/java/net/minestom/server/Git.java"
|
||||||
|
|
||||||
val gitCommit = System.getenv("GIT_COMMIT")
|
val gitCommit = System.getenv("GIT_COMMIT")
|
||||||
val gitBranch = System.getenv("GIT_BRANCH")
|
val gitBranch = System.getenv("GIT_BRANCH")
|
||||||
val group = System.getenv("GROUP")
|
val group = System.getenv("GROUP")
|
||||||
val artifact = System.getenv("ARTIFACT")
|
val artifact = System.getenv("ARTIFACT")
|
||||||
|
|
||||||
replaceToken("\"&COMMIT\"", if (gitCommit == null) "null" else "\"${gitCommit}\"", git)
|
replaceToken("\"&COMMIT\"", if (gitCommit == null) "null" else "\"${gitCommit}\"", gitFile)
|
||||||
replaceToken("\"&BRANCH\"", if (gitBranch == null) "null" else "\"${gitBranch}\"", git)
|
replaceToken("\"&BRANCH\"", if (gitBranch == null) "null" else "\"${gitBranch}\"", gitFile)
|
||||||
replaceToken("\"&GROUP\"", if (group == null) "null" else "\"${group}\"", git)
|
replaceToken("\"&GROUP\"", if (group == null) "null" else "\"${group}\"", gitFile)
|
||||||
replaceToken("\"&ARTIFACT\"", if (artifact == null) "null" else "\"${artifact}\"", git)
|
replaceToken("\"&ARTIFACT\"", if (artifact == null) "null" else "\"${artifact}\"", gitFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nexusPublishing{
|
||||||
|
useStaging.set(true)
|
||||||
|
this.packageGroup.set("dev.hollowcube")
|
||||||
|
|
||||||
|
repositories.sonatype {
|
||||||
|
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
|
||||||
|
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
|
||||||
|
|
||||||
|
if (System.getenv("SONATYPE_USERNAME") != null) {
|
||||||
|
username.set(System.getenv("SONATYPE_USERNAME"))
|
||||||
|
password.set(System.getenv("SONATYPE_PASSWORD"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing.publications.create<MavenPublication>("maven") {
|
||||||
|
groupId = "dev.hollowcube"
|
||||||
|
artifactId = "minestom-ce"
|
||||||
|
version = project.version.toString()
|
||||||
|
|
||||||
|
from(project.components["java"])
|
||||||
|
|
||||||
|
pom {
|
||||||
|
name.set("minestom-ce")
|
||||||
|
description.set("Lightweight and multi-threaded 1.19.3 Minecraft server")
|
||||||
|
url.set("https://github.com/hollow-cube/minestom-ce")
|
||||||
|
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name.set("Apache 2.0")
|
||||||
|
url.set("https://github.com/hollow-cube/minestom-ce/blob/main/LICENSE")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id.set("TheMode")
|
||||||
|
}
|
||||||
|
developer {
|
||||||
|
id.set("mworzala")
|
||||||
|
name.set("Matt Worzala")
|
||||||
|
email.set("matt@hollowcube.dev")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
issueManagement {
|
||||||
|
system.set("GitHub")
|
||||||
|
url.set("https://github.com/hollow-cube/minestom-ce/issues")
|
||||||
|
}
|
||||||
|
|
||||||
|
scm {
|
||||||
|
connection.set("scm:git:git://github.com/hollow-cube/minestom-ce.git")
|
||||||
|
developerConnection.set("scm:git:git@github.com:hollow-cube/minestom-ce.git")
|
||||||
|
url.set("https://github.com/hollow-cube/minestom-ce")
|
||||||
|
tag.set("HEAD")
|
||||||
|
}
|
||||||
|
|
||||||
|
ciManagement {
|
||||||
|
system.set("Github Actions")
|
||||||
|
url.set("https://github.com/hollow-cube/minestom-ce/actions")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
isRequired = System.getenv("CI") != null
|
||||||
|
|
||||||
|
val privateKey = System.getenv("GPG_PRIVATE_KEY")
|
||||||
|
val keyPassphrase = System.getenv()["GPG_PASSPHRASE"]
|
||||||
|
useInMemoryPgpKeys(privateKey, keyPassphrase)
|
||||||
|
|
||||||
|
sign(publishing.publications)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
// Testing Framework
|
|
||||||
testImplementation(project(mapOf("path" to ":testing")))
|
|
||||||
// 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.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()}")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,28 @@
|
||||||
plugins {
|
plugins {
|
||||||
application
|
application
|
||||||
id("minestom.common-conventions")
|
|
||||||
}
|
|
||||||
|
|
||||||
application {
|
|
||||||
mainClass.set("net.minestom.codegen.Generators")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(libs.gson)
|
// Provides the input JSON to generate from
|
||||||
implementation(libs.jetbrainsAnnotations)
|
|
||||||
implementation(libs.javaPoet)
|
|
||||||
// Logging
|
|
||||||
implementation(libs.bundles.logging)
|
|
||||||
// Contains the json files
|
|
||||||
implementation(libs.minestomData)
|
implementation(libs.minestomData)
|
||||||
|
|
||||||
|
// Common
|
||||||
|
implementation(libs.jetbrainsAnnotations)
|
||||||
|
implementation(libs.slf4j)
|
||||||
|
runtimeOnly(libs.bundles.logback)
|
||||||
|
|
||||||
|
// Parsing and generation
|
||||||
|
implementation(libs.gson)
|
||||||
|
implementation(libs.javaPoet)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|
||||||
|
application {
|
||||||
|
mainClass.set("net.minestom.codegen.Generators")
|
||||||
|
}
|
||||||
|
|
||||||
getByName<JavaExec>("run") {
|
getByName<JavaExec>("run") {
|
||||||
args = listOf(project.rootProject.projectDir.resolve("src").resolve("autogenerated").resolve("java").absolutePath)
|
args = listOf(rootProject.projectDir.resolve("src/autogenerated/java").absolutePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,23 +2,21 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
application
|
application
|
||||||
id("minestom.common-conventions")
|
alias(libs.plugins.shadow)
|
||||||
id("minestom.native-conventions")
|
|
||||||
id("com.github.johnrengelman.shadow") version ("7.1.1")
|
|
||||||
}
|
|
||||||
|
|
||||||
application {
|
|
||||||
mainClass.set("net.minestom.demo.Main")
|
|
||||||
// This is included because Shadow is buggy. Wait for https://github.com/johnrengelman/shadow/issues/613 to befixed.
|
|
||||||
@Suppress("DEPRECATION")
|
|
||||||
mainClassName = "net.minestom.demo.Main"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(rootProject)
|
implementation(rootProject)
|
||||||
implementation(libs.jNoise)
|
|
||||||
|
runtimeOnly(libs.bundles.logback)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<ShadowJar> {
|
tasks {
|
||||||
archiveFileName.set("minestom-demo.jar")
|
application {
|
||||||
|
mainClass.set("net.minestom.demo.Main")
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<ShadowJar> {
|
||||||
|
archiveFileName.set("minestom-demo.jar")
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,45 +0,0 @@
|
||||||
package net.minestom.demo;
|
|
||||||
|
|
||||||
import net.minestom.demo.commands.GamemodeCommand;
|
|
||||||
import net.minestom.demo.commands.SaveCommand;
|
|
||||||
import net.minestom.server.MinecraftServer;
|
|
||||||
import net.minestom.server.coordinate.Pos;
|
|
||||||
import net.minestom.server.entity.Player;
|
|
||||||
import net.minestom.server.event.GlobalEventHandler;
|
|
||||||
import net.minestom.server.event.player.PlayerLoginEvent;
|
|
||||||
import net.minestom.server.instance.AnvilLoader;
|
|
||||||
import net.minestom.server.instance.InstanceContainer;
|
|
||||||
import net.minestom.server.instance.InstanceManager;
|
|
||||||
import net.minestom.server.instance.block.Block;
|
|
||||||
import net.minestom.server.utils.NamespaceID;
|
|
||||||
import net.minestom.server.world.biomes.Biome;
|
|
||||||
import net.minestom.server.world.biomes.BiomeManager;
|
|
||||||
|
|
||||||
public class MainDemo {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
// Initialization
|
|
||||||
MinecraftServer minecraftServer = MinecraftServer.init();
|
|
||||||
|
|
||||||
MinecraftServer.getCommandManager().register(new GamemodeCommand());
|
|
||||||
MinecraftServer.getCommandManager().register(new SaveCommand());
|
|
||||||
|
|
||||||
InstanceManager instanceManager = MinecraftServer.getInstanceManager();
|
|
||||||
// Create the instance
|
|
||||||
InstanceContainer instanceContainer = instanceManager.createInstanceContainer();
|
|
||||||
// Set the ChunkGenerator
|
|
||||||
instanceContainer.setGenerator(unit -> unit.modifier().fillHeight(0, 40, Block.STONE));
|
|
||||||
|
|
||||||
// Add an event callback to specify the spawning instance (and the spawn position)
|
|
||||||
GlobalEventHandler globalEventHandler = MinecraftServer.getGlobalEventHandler();
|
|
||||||
globalEventHandler.addListener(PlayerLoginEvent.class, event -> {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
player.setPermissionLevel(2);
|
|
||||||
event.setSpawningInstance(instanceContainer);
|
|
||||||
player.setRespawnPoint(new Pos(0, 42, 0));
|
|
||||||
});
|
|
||||||
|
|
||||||
// Start the server on port 25565
|
|
||||||
minecraftServer.start("0.0.0.0", 25565);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,142 +0,0 @@
|
||||||
package net.minestom.demo.generator;
|
|
||||||
|
|
||||||
import de.articdive.jnoise.generators.noise_parameters.interpolation.Interpolation;
|
|
||||||
import de.articdive.jnoise.generators.noisegen.opensimplex.FastSimplexNoiseGenerator;
|
|
||||||
import de.articdive.jnoise.generators.noisegen.perlin.PerlinNoiseGenerator;
|
|
||||||
import de.articdive.jnoise.pipeline.JNoise;
|
|
||||||
import net.minestom.server.coordinate.Point;
|
|
||||||
import net.minestom.server.coordinate.Vec;
|
|
||||||
import net.minestom.server.instance.Chunk;
|
|
||||||
import net.minestom.server.instance.block.Block;
|
|
||||||
import net.minestom.server.instance.generator.GenerationUnit;
|
|
||||||
import net.minestom.server.instance.generator.Generator;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
public class NoiseTestGenerator implements Generator {
|
|
||||||
|
|
||||||
private final JNoise treeNoise = JNoise.newBuilder()
|
|
||||||
.fastSimplex(FastSimplexNoiseGenerator.newBuilder().setSeed(123).build())
|
|
||||||
.scale(999)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
private final JNoise jNoise = JNoise.newBuilder()
|
|
||||||
.perlin(PerlinNoiseGenerator.newBuilder().setSeed(123).setInterpolation(Interpolation.LINEAR).build())
|
|
||||||
.scale(0.4).build();
|
|
||||||
|
|
||||||
public int getHeight(int x, int z) {
|
|
||||||
double preHeight = jNoise.evaluateNoise(x / 16.0, z / 16.0);
|
|
||||||
return (int) ((preHeight > 0 ? preHeight * 6 : preHeight * 4) + 64);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void generate(@NotNull GenerationUnit unit) {
|
|
||||||
Point start = unit.absoluteStart();
|
|
||||||
for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) {
|
|
||||||
for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) {
|
|
||||||
Point pos;
|
|
||||||
{
|
|
||||||
int absX = start.blockX() + x;
|
|
||||||
int absZ = start.blockZ() + z;
|
|
||||||
final int height = getHeight(absX, absZ);
|
|
||||||
pos = new Vec(absX, height, absZ);
|
|
||||||
}
|
|
||||||
Point posp1 = pos.add(1, 0, 1);
|
|
||||||
|
|
||||||
// Water
|
|
||||||
if (pos.y() < 61) {
|
|
||||||
unit.modifier().fill(pos, posp1.withY(61), Block.WATER);
|
|
||||||
unit.modifier().fill(pos.withY(0), posp1, Block.AIR);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Regular terrain
|
|
||||||
unit.modifier().fill(pos.withY(0), posp1, Block.STONE);
|
|
||||||
unit.modifier().fill(pos.withY(pos.y() - 7), posp1, Block.DIRT);
|
|
||||||
unit.modifier().fill(pos.withY(pos.y() - 1), posp1, Block.GRASS_BLOCK);
|
|
||||||
unit.modifier().fill(pos.withY(0), posp1.withY(1), Block.BEDROCK);
|
|
||||||
|
|
||||||
if (treeNoise.evaluateNoise(pos.x(), pos.z()) > 0.8) {
|
|
||||||
TreePopulator.populate(pos, unit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class TreePopulator {
|
|
||||||
private static void populate(Point origin, GenerationUnit unit) {
|
|
||||||
unit.fork(setter -> {
|
|
||||||
setter.setBlock(origin.add(0, -1, 0), Block.DIRT);
|
|
||||||
setter.setBlock(origin.add(0, -1, 0), Block.DIRT);
|
|
||||||
setter.setBlock(origin.add(0, 0, 0), Block.OAK_LOG);
|
|
||||||
setter.setBlock(origin.add(0, 1, 0), Block.OAK_LOG);
|
|
||||||
setter.setBlock(origin.add(0, 2, 0), Block.OAK_LOG);
|
|
||||||
setter.setBlock(origin.add(0, 3, 0), Block.OAK_LOG);
|
|
||||||
setter.setBlock(origin.add(1, 1, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 1, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 1, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 1, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 1, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 1, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 1, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 1, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 1, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 1, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 1, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 1, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 1, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 1, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 1, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 1, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 1, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 1, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 1, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 1, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 1, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 1, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 1, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 1, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 2, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 2, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 2, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 2, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 2, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 2, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 2, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 2, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 2, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 2, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 2, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 2, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 2, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 2, 2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 2, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 2, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 2, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 2, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 2, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 2, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(2, 2, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 2, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 2, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-2, 2, -2), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 3, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 3, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 3, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 3, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 3, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 3, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 3, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 3, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(1, 4, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 4, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 4, 0), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 4, 1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(0, 4, -1), Block.OAK_LEAVES);
|
|
||||||
setter.setBlock(origin.add(-1, 4, -1), Block.OAK_LEAVES);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -3,44 +3,37 @@ metadata.format.version = "1.1"
|
||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
# Important dependencies
|
# Important dependencies
|
||||||
|
minestomData = "53e0da5be1"
|
||||||
adventure = "4.12.0"
|
adventure = "4.12.0"
|
||||||
kotlin = "1.7.22"
|
kotlin = "1.7.22"
|
||||||
hydrazine = "1.7.2"
|
hydrazine = "1.7.2"
|
||||||
dependencyGetter = "v1.0.1"
|
hephaistos = "2.5.3"
|
||||||
minestomData = "ddde11056e"
|
|
||||||
hephaistos = "2.6.1"
|
|
||||||
jetbrainsAnnotations = "23.0.0"
|
jetbrainsAnnotations = "23.0.0"
|
||||||
|
slf4j = "2.0.7"
|
||||||
# Terminal / Logging
|
|
||||||
tinylog = "2.5.0"
|
|
||||||
jline = "3.21.0"
|
|
||||||
|
|
||||||
# Performance / Data Structures
|
# Performance / Data Structures
|
||||||
caffeine = "3.1.2"
|
caffeine = "3.1.6"
|
||||||
fastutil = "8.5.9"
|
fastutil = "8.5.12"
|
||||||
flare = "2.0.1"
|
flare = "2.0.1"
|
||||||
gson = "2.9.1"
|
gson = "2.10.1"
|
||||||
jcTools = "4.0.1"
|
jcTools = "4.0.1"
|
||||||
|
|
||||||
# Test
|
# Quality
|
||||||
junit-jupiter = "5.8.2"
|
junit-jupiter = "5.9.3"
|
||||||
junit-platform = "1.8.2"
|
junit-platform = "1.9.3"
|
||||||
mockito = "4.2.0"
|
jmh = "1.36"
|
||||||
|
jcstress = "0.16"
|
||||||
|
|
||||||
# Code Generation
|
# Code Generation
|
||||||
javaPoet = "1.13.0"
|
javaPoet = "1.13.0"
|
||||||
|
|
||||||
# Demo
|
# Log impl (for demo & codegen)
|
||||||
jNoise = "b93008e35e"
|
logback = "1.4.5"
|
||||||
|
|
||||||
# JMH
|
|
||||||
jmh = "1.35"
|
|
||||||
|
|
||||||
# JCStress
|
|
||||||
jcstress = "0.8"
|
|
||||||
|
|
||||||
# Gradle plugins
|
# Gradle plugins
|
||||||
blossom = "1.3.0"
|
blossom = "1.3.0"
|
||||||
|
shadow = "8.1.1"
|
||||||
|
nexuspublish = "1.3.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
|
@ -58,18 +51,11 @@ kotlin-stdlib-jdk8 = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
hydrazine = { group = "com.github.MadMartian", name = "hydrazine-path-finding", version.ref = "hydrazine" }
|
hydrazine = { group = "com.github.MadMartian", name = "hydrazine-path-finding", version.ref = "hydrazine" }
|
||||||
dependencyGetter = { group = "com.github.Minestom", name = "DependencyGetter", version.ref = "dependencyGetter" }
|
|
||||||
minestomData = { group = "com.github.Minestom", name = "MinestomDataGenerator", version.ref = "minestomData" }
|
minestomData = { group = "com.github.Minestom", name = "MinestomDataGenerator", version.ref = "minestomData" }
|
||||||
jetbrainsAnnotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrainsAnnotations" }
|
jetbrainsAnnotations = { group = "org.jetbrains", name = "annotations", version.ref = "jetbrainsAnnotations" }
|
||||||
|
hephaistos-common = { group = "io.github.jglrxavpok.hephaistos", name = "common", version.ref = "hephaistos" }
|
||||||
# Logging
|
hephaistos-gson = { group = "io.github.jglrxavpok.hephaistos", name = "gson", version.ref = "hephaistos" }
|
||||||
tinylog-api = { group = "org.tinylog", name = "tinylog-api", version.ref = "tinylog" }
|
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j"}
|
||||||
tinylog-impl = { group = "org.tinylog", name = "tinylog-impl", version.ref = "tinylog" }
|
|
||||||
tinylog-slf4j = { group = "org.tinylog", name = "slf4j-tinylog", version.ref = "tinylog" }
|
|
||||||
|
|
||||||
# Terminal
|
|
||||||
jline = { group = "org.jline", name = "jline", version.ref = "jline" }
|
|
||||||
jline-jansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jline" }
|
|
||||||
|
|
||||||
# Performance / Data Structures
|
# Performance / Data Structures
|
||||||
caffeine = { group = "com.github.ben-manes.caffeine", name = "caffeine", version.ref = "caffeine" }
|
caffeine = { group = "com.github.ben-manes.caffeine", name = "caffeine", version.ref = "caffeine" }
|
||||||
|
@ -79,35 +65,34 @@ flare-fastutil = { group = "space.vectrix.flare", name = "flare-fastutil", versi
|
||||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||||
jcTools = { group = "org.jctools", name = "jctools-core", version.ref = "jcTools" }
|
jcTools = { group = "org.jctools", name = "jctools-core", version.ref = "jcTools" }
|
||||||
|
|
||||||
# Test
|
# Code quality
|
||||||
junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit-jupiter" }
|
junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit-jupiter" }
|
||||||
junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" }
|
junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit-jupiter" }
|
||||||
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit-jupiter" }
|
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit-jupiter" }
|
||||||
junit-suite-api = { group = "org.junit.platform", name = "junit-platform-suite-api", version.ref = "junit-platform" }
|
junit-suite-api = { group = "org.junit.platform", name = "junit-platform-suite-api", version.ref = "junit-platform" }
|
||||||
junit-suite-engine = { group = "org.junit.platform", name = "junit-platform-suite-engine", version.ref = "junit-platform" }
|
junit-suite-engine = { group = "org.junit.platform", name = "junit-platform-suite-engine", version.ref = "junit-platform" }
|
||||||
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
|
jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "jmh" }
|
||||||
|
jmh-annotationprocessor = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "jmh" }
|
||||||
|
jcstress-core = { group = "org.openjdk.jcstress", name = "jcstress-core", version.ref = "jcstress" }
|
||||||
|
|
||||||
# Code Generation
|
# Code Generation
|
||||||
javaPoet = { group = "com.squareup", name = "javapoet", version.ref = "javaPoet" }
|
javaPoet = { group = "com.squareup", name = "javapoet", version.ref = "javaPoet" }
|
||||||
|
|
||||||
# Demo
|
# Log impl (for demo & codegen)
|
||||||
jNoise = { group = "com.github.Articdive.JNoise", name = "jnoise-pipeline", version.ref = "jNoise" }
|
logback-core = { group = "ch.qos.logback", name = "logback-core", version.ref = "logback" }
|
||||||
|
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
|
||||||
# JMH
|
|
||||||
jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "jmh" }
|
|
||||||
jmh-annotationprocessor = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "jmh" }
|
|
||||||
|
|
||||||
# JCStress
|
|
||||||
jcstress-core = { group = "org.openjdk.jcstress", name = "jcstress-core", version.ref = "jcstress" }
|
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
|
|
||||||
kotlin = ["kotlin-stdlib-jdk8", "kotlin-reflect"]
|
kotlin = ["kotlin-stdlib-jdk8", "kotlin-reflect"]
|
||||||
flare = ["flare", "flare-fastutil"]
|
flare = ["flare", "flare-fastutil"]
|
||||||
adventure = ["adventure-api", "adventure-serializer-gson", "adventure-serializer-legacy", "adventure-serializer-plain", "adventure-text-logger-slf4j"]
|
adventure = ["adventure-api", "adventure-serializer-gson", "adventure-serializer-legacy", "adventure-serializer-plain", "adventure-text-logger-slf4j"]
|
||||||
logging = ["tinylog-api", "tinylog-impl", "tinylog-slf4j"]
|
junit = ["junit-api", "junit-engine", "junit-params", "junit-suite-api", "junit-suite-engine"]
|
||||||
terminal = ["jline", "jline-jansi"]
|
hephaistos = ["hephaistos-common", "hephaistos-gson"]
|
||||||
|
logback = ["logback-core", "logback-classic"]
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
|
|
||||||
blossom = { id = "net.kyori.blossom", version.ref = "blossom" }
|
blossom = { id = "net.kyori.blossom", version.ref = "blossom" }
|
||||||
|
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
|
||||||
|
nexuspublish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexuspublish" }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -1,24 +1,8 @@
|
||||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
rootProject.name = "minestom-ce"
|
||||||
enableFeaturePreview("VERSION_CATALOGS")
|
|
||||||
|
|
||||||
dependencyResolutionManagement {
|
|
||||||
repositories {
|
|
||||||
maven("https://jitpack.io")
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pluginManagement {
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
gradlePluginPortal()
|
|
||||||
}
|
|
||||||
includeBuild("build-logic")
|
|
||||||
}
|
|
||||||
|
|
||||||
rootProject.name = "Minestom"
|
|
||||||
include("code-generators")
|
|
||||||
include("jmh-benchmarks")
|
|
||||||
include("jcstress-tests")
|
|
||||||
include("demo")
|
|
||||||
include("testing")
|
include("testing")
|
||||||
|
include("code-generators")
|
||||||
|
//include("jmh-benchmarks")
|
||||||
|
//include("jcstress-tests")
|
||||||
|
|
||||||
|
include("demo")
|
||||||
|
|
|
@ -1,32 +1,14 @@
|
||||||
plugins {
|
plugins {
|
||||||
id("java-library")
|
`java-library`
|
||||||
`maven-publish`
|
// `maven-publish`
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
create<MavenPublication>("maven") {
|
|
||||||
groupId = "net.minestom.testing"
|
|
||||||
artifactId = "testing"
|
|
||||||
version = "1.0"
|
|
||||||
|
|
||||||
from(components["java"])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "net.minestom.testing"
|
group = "net.minestom.testing"
|
||||||
version = "1.0"
|
// version declared by root project
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven(url = "https://jitpack.io")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Minestom API
|
api(rootProject)
|
||||||
api(project(mapOf("path" to ":")))
|
|
||||||
// Junit Testing Framework
|
|
||||||
api(libs.junit.api)
|
api(libs.junit.api)
|
||||||
api(libs.junit.params)
|
api(libs.junit.params)
|
||||||
api(libs.junit.suite.api)
|
api(libs.junit.suite.api)
|
||||||
|
@ -34,6 +16,14 @@ dependencies {
|
||||||
runtimeOnly(libs.junit.suite.engine)
|
runtimeOnly(libs.junit.suite.engine)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.getByName<Test>("test") {
|
//publishing {
|
||||||
useJUnitPlatform()
|
// publications {
|
||||||
}
|
// create<MavenPublication>("maven") {
|
||||||
|
// groupId = "net.minestom.testing"
|
||||||
|
// artifactId = "testing"
|
||||||
|
// version = "1.0"
|
||||||
|
//
|
||||||
|
// from(components["java"])
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
Loading…
Reference in New Issue