Initial work on reflection, pulls version from resources.
This commit is contained in:
parent
e64b563190
commit
56f337110f
11 changed files with 161 additions and 58 deletions
93
build.gradle.kts
Normal file
93
build.gradle.kts
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
plugins {
|
||||
java
|
||||
id("xyz.jpenilla.run-paper") version "2.3.1"
|
||||
}
|
||||
|
||||
group = "io.github.adrianvic"
|
||||
version = "1.0.2-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
}
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* SUPPORTED VERSIONS */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
val mcVersions = listOf(
|
||||
"b1_7_3",
|
||||
"r1_21"
|
||||
)
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* CREATE SOURCE SET PER VERSION */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
mcVersions.forEach { ver ->
|
||||
val ss = sourceSets.create(ver) {
|
||||
java.srcDir("src/$ver/java")
|
||||
|
||||
resources.setSrcDirs(listOf("src/$ver/resources", "src/main/resources"))
|
||||
|
||||
compileClasspath += sourceSets["main"].output
|
||||
runtimeClasspath += output + compileClasspath
|
||||
}
|
||||
|
||||
tasks.withType<ProcessResources> {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
configurations[ss.implementationConfigurationName]
|
||||
.extendsFrom(configurations["implementation"])
|
||||
|
||||
configurations[ss.compileOnlyConfigurationName]
|
||||
.extendsFrom(configurations["compileOnly"])
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* DEPENDENCIES */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
dependencies {
|
||||
add("compileOnly", "io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
|
||||
add("r1_21CompileOnly", "io.papermc.paper:paper-api:1.21.10-R0.1-SNAPSHOT")
|
||||
add("b1_7_3CompileOnly", files("libs/beta173-api.jar"))
|
||||
}
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* BUILD TASKS */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
mcVersions.forEach { ver ->
|
||||
tasks.register<Jar>("jar${ver.replace(".", "_").replace("-", "_").replace("/", "_").capitalize()}") {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
from(sourceSets["main"].output)
|
||||
from(sourceSets[ver].output)
|
||||
archiveClassifier.set(ver)
|
||||
|
||||
manifest {
|
||||
attributes(
|
||||
"Nemesis-Impl-Version" to ver
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------- */
|
||||
/* JAVA SETTINGS */
|
||||
/* ----------------------------------------- */
|
||||
|
||||
java {
|
||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
tasks.runServer {
|
||||
minecraftVersion("1.21")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue