Rework buildscript
This commit is contained in:
135
build.gradle
135
build.gradle
@@ -1,37 +1,28 @@
|
|||||||
import org.gradle.plugins.ide.eclipse.model.AccessRule
|
plugins {
|
||||||
|
id 'java'
|
||||||
buildscript {
|
id 'eclipse'
|
||||||
repositories {
|
id 'net.minecraftforge.gradle' version '5.1.+'
|
||||||
maven {
|
|
||||||
url = 'https://files.minecraftforge.net/maven'
|
|
||||||
}
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
version = "${minecraft_version}-${mod_version}"
|
||||||
apply plugin: 'eclipse'
|
archivesBaseName = project.name
|
||||||
|
|
||||||
version = "${minecraft_version}-${version}"
|
|
||||||
archivesBaseName = 'WorldHandler'
|
|
||||||
|
|
||||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||||
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
// The mappings can be changed at any time, and must be in the following format.
|
// The mappings can be changed at any time and must be in the following format.
|
||||||
// Channel: Version:
|
// Channel: Version:
|
||||||
// snapshot YYYYMMDD Snapshot are built nightly.
|
// official MCVersion Official field/method names from Mojang mapping files
|
||||||
// stable # Stables are built at the discretion of the MCP team.
|
// parchment YYYY.MM.DD-MCVersion Open community-sourced parameter names and javadocs layered on top of official
|
||||||
// official MCVersion Official field/method names from Mojang mapping files
|
|
||||||
//
|
//
|
||||||
// You must be aware of the Mojang license when using the 'official' mappings.
|
// You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
|
||||||
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
|
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
|
||||||
//
|
//
|
||||||
// Use non-default mappings at your own risk. they may not always work.
|
// Parchment is an unofficial project maintained by ParchmentMC, separate from MinecraftForge
|
||||||
|
// Additional setup is needed to use their mappings: https://github.com/ParchmentMC/Parchment/wiki/Getting-Started
|
||||||
|
//
|
||||||
|
// Use non-default mappings at your own risk. They may not always work.
|
||||||
// Simply re-run your setup task after changing the mappings to update your workspace.
|
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
mappings channel: 'official', version: minecraft_version
|
mappings channel: 'official', version: minecraft_version
|
||||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||||
@@ -41,14 +32,23 @@ minecraft {
|
|||||||
runs {
|
runs {
|
||||||
client {
|
client {
|
||||||
workingDirectory project.file('run')
|
workingDirectory project.file('run')
|
||||||
taskName 'WorldHandler Client'
|
taskName project.name + ' Client'
|
||||||
|
|
||||||
// Recommended logging data for a userdev environment
|
// Recommended logging data for a userdev environment
|
||||||
// property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
// The markers can be added/remove as needed separated by commas.
|
||||||
|
// "SCAN": For mods scan.
|
||||||
|
// "REGISTRIES": For firing of registry events.
|
||||||
|
// "REGISTRYDUMP": For getting the contents of all registries.
|
||||||
|
// property 'forge.logging.markers', 'REGISTRIES'
|
||||||
|
|
||||||
// Recommended logging level for the console
|
// Recommended logging level for the console
|
||||||
|
// You can set various levels here.
|
||||||
|
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
|
||||||
// property 'forge.logging.console.level', 'debug'
|
// property 'forge.logging.console.level', 'debug'
|
||||||
|
|
||||||
|
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
|
||||||
|
// property 'forge.enabledGameTestNamespaces', "${mod_id}"
|
||||||
|
|
||||||
mods {
|
mods {
|
||||||
worldhandler {
|
worldhandler {
|
||||||
source sourceSets.main
|
source sourceSets.main
|
||||||
@@ -58,13 +58,29 @@ minecraft {
|
|||||||
|
|
||||||
server {
|
server {
|
||||||
workingDirectory project.file('run')
|
workingDirectory project.file('run')
|
||||||
taskName 'WorldHandler Server'
|
taskName project.name + ' Server'
|
||||||
|
|
||||||
// Recommended logging data for a userdev environment
|
// property 'forge.logging.markers', 'REGISTRIES'
|
||||||
// property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
|
||||||
|
|
||||||
// Recommended logging level for the console
|
|
||||||
// property 'forge.logging.console.level', 'debug'
|
// property 'forge.logging.console.level', 'debug'
|
||||||
|
// property 'forge.enabledGameTestNamespaces', 'examplemod'
|
||||||
|
|
||||||
|
mods {
|
||||||
|
worldhandler {
|
||||||
|
source sourceSets.main
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// This run config launches GameTestServer and runs all registered gametests, then exits.
|
||||||
|
// By default, the server will crash when no gametests are provided.
|
||||||
|
// The gametest system is also enabled by default for other run configs under the /test command.
|
||||||
|
gameTestServer {
|
||||||
|
workingDirectory project.file('run')
|
||||||
|
taskName project.name + ' GameTestServer'
|
||||||
|
|
||||||
|
// property 'forge.logging.markers', 'REGISTRIES'
|
||||||
|
// property 'forge.logging.console.level', 'debug'
|
||||||
|
// property 'forge.enabledGameTestNamespaces', 'examplemod'
|
||||||
|
|
||||||
mods {
|
mods {
|
||||||
worldhandler {
|
worldhandler {
|
||||||
@@ -75,15 +91,12 @@ minecraft {
|
|||||||
|
|
||||||
data {
|
data {
|
||||||
workingDirectory project.file('run')
|
workingDirectory project.file('run')
|
||||||
taskName 'WorldHandler Data'
|
taskName project.name + ' Data'
|
||||||
|
|
||||||
// Recommended logging data for a userdev environment
|
// property 'forge.logging.markers', 'REGISTRIES'
|
||||||
// property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
|
||||||
|
|
||||||
// Recommended logging level for the console
|
|
||||||
// property 'forge.logging.console.level', 'debug'
|
// property 'forge.logging.console.level', 'debug'
|
||||||
|
|
||||||
args '--mod', 'worldhandler', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||||
|
|
||||||
mods {
|
mods {
|
||||||
worldhandler {
|
worldhandler {
|
||||||
@@ -94,14 +107,18 @@ minecraft {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets.main.resources {
|
||||||
|
srcDir 'src/generated/resources'
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// Put repositories for dependencies here
|
// Put repositories for dependencies here
|
||||||
// ForgeGradle automatically adds the Forge maven and Maven Central for you
|
// ForgeGradle automatically adds the Forge maven and Maven Central for you
|
||||||
|
|
||||||
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
|
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
|
||||||
// flatDir {
|
// flatDir {
|
||||||
// dir 'libs'
|
// dir 'libs'
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -110,19 +127,13 @@ dependencies {
|
|||||||
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
|
||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
// You may put jars on which you depend on in ./libs or you may define them like so..
|
// Real mod deobf dependency examples - these get remapped to your current mappings
|
||||||
// compile "some.group:artifact:version:classifier"
|
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
|
||||||
// compile "some.group:artifact:version"
|
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
|
||||||
|
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
|
||||||
|
|
||||||
// Real examples
|
// Examples using mod jars from ./libs
|
||||||
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
|
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
|
||||||
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
|
|
||||||
|
|
||||||
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
|
|
||||||
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
|
||||||
|
|
||||||
// These dependencies get remapped to your current MCP mappings
|
|
||||||
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
|
|
||||||
|
|
||||||
// For more info...
|
// For more info...
|
||||||
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
|
||||||
@@ -136,7 +147,7 @@ jar {
|
|||||||
"Specification-Vendor": "Exopandora",
|
"Specification-Vendor": "Exopandora",
|
||||||
"Specification-Version": "1",
|
"Specification-Version": "1",
|
||||||
"Implementation-Title": project.name,
|
"Implementation-Title": project.name,
|
||||||
"Implementation-Version": "${version}",
|
"Implementation-Version": project.jar.archiveVersion,
|
||||||
"Implementation-Vendor": "Exopandora",
|
"Implementation-Vendor": "Exopandora",
|
||||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||||
"Main-Class": "exopandora.worldhandler.Main"
|
"Main-Class": "exopandora.worldhandler.Main"
|
||||||
@@ -145,7 +156,17 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
filesMatching(['mods.toml']) {
|
outputs.upToDateWhen {
|
||||||
expand project.properties
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
from sourceSets.main.resources
|
||||||
|
|
||||||
|
filesMatching(['META-INF/mods.toml']) {
|
||||||
|
expand project.properties
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
options.encoding = 'UTF-8'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
# WorldHandler
|
# WorldHandler
|
||||||
version=3.3
|
mod_id=worldhandler
|
||||||
group=exopandora.worldhandler
|
mod_version=3.3
|
||||||
minecraft_version=1.19
|
minecraft_version=1.19
|
||||||
forge_version=41.0.100
|
forge_version=41.0.100
|
||||||
|
group=exopandora.worldhandler
|
||||||
|
main_class=exopandora.worldhandler.Main
|
||||||
|
|
||||||
# Gradle
|
# Gradle
|
||||||
org.gradle.jvmargs=-Xmx3G
|
org.gradle.jvmargs=-Xmx3G
|
||||||
|
|||||||
10
settings.gradle
Normal file
10
settings.gradle
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
maven {
|
||||||
|
url = 'https://maven.minecraftforge.net/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = 'WorldHandler'
|
||||||
@@ -11,7 +11,7 @@ license="GPL v3.0"
|
|||||||
|
|
||||||
[[mods]]
|
[[mods]]
|
||||||
modId="worldhandler"
|
modId="worldhandler"
|
||||||
version="${minecraft_version}-${version}"
|
version="${minecraft_version}-${mod_version}"
|
||||||
displayName="World Handler"
|
displayName="World Handler"
|
||||||
description="The World Handler provides a simple and easy to use graphical user interface for commands. It lets you create powerful and complex sub-commands alongside NBT-structures within seconds."
|
description="The World Handler provides a simple and easy to use graphical user interface for commands. It lets you create powerful and complex sub-commands alongside NBT-structures within seconds."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user