Skip to content

Commit

Permalink
Update to the new MMT
Browse files Browse the repository at this point in the history
  • Loading branch information
Desoroxxx committed Sep 7, 2023
1 parent fc3fa15 commit 9705dff
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 69 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ jobs:

steps:
- name: Code Checkout
uses: actions/checkout@v3.5.3
uses: actions/checkout@v3.6.0


- name: 'Qodana Scan'
uses: JetBrains/[email protected]
env:
Expand Down
19 changes: 6 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project

# idea
# IntelliJ Idea
out
*.ipr
*.iws
*.iml
.idea

# gradle
# Gradle
build
.gradle

# other
eclipse
# Minecraft
run
*.log

# Misc
.settings
102 changes: 55 additions & 47 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import org.jetbrains.gradle.ext.Gradle

plugins {
id 'java'
id 'java-library'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'com.gtnewhorizons.retrofuturagradle' version '1.+'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'io.freefair.lombok' version '8.3'
id("java")
id("java-library")
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
id("com.gtnewhorizons.retrofuturagradle") version "1.+"
id("com.matthewprenger.cursegradle") version "1.4.0"
id("io.freefair.lombok") version "8.3"
}

// Add version to the jar name
Expand All @@ -16,27 +16,26 @@ version project.version
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
vendor.set(JvmVendorSpec.ADOPTIUM)
vendor.set(JvmVendorSpec.AZUL)
}
// Generate sources jar when building and publishing
withSourcesJar()
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.encoding = "UTF-8"
options.fork = true
options.forkOptions.jvmArgs += '-Xmx4G'
}

minecraft {
mcVersion = '1.12.2'
mcVersion = "1.12.2"

username = 'Desoroxxx'
username = "Desoroxxx"

extraRunJvmArguments.addAll('-Xmx6G', '-Xms4G', '-Dforge.logging.console.level=debug', '-Dfml.coreMods.load=io.redstudioragnarok.redcore.asm.RedCorePlugin')
extraRunJvmArguments.addAll("-Xmx6G", "-Xms4G", "-Dforge.logging.console.level=debug", "-Dfml.coreMods.load=io.redstudioragnarok.redcore.asm.RedCorePlugin")

injectedTags.put('ID', project.id)
injectedTags.put('VERSION', project.version)
injectedTags.put("ID", project.id)
injectedTags.put("VERSION", project.version)
}

// Generate a my.project.Tags class with the version number as a field
Expand All @@ -51,30 +50,29 @@ configurations {
}

dependencies {
implementation 'net.jafama:jafama:2.3.2'
embed 'net.jafama:jafama:2.3.2'
implementation "net.jafama:jafama:2.3.2"
embed "net.jafama:jafama:2.3.2"
}

// Replace version and id in `mcmod.info`
processResources {
inputs.property 'id', project.id
inputs.property 'version', project.version
filesMatching(['mcmod.info', 'pack.mcmeta']) { fcd ->
include 'mcmod.info'
inputs.property "id", project.id
inputs.property "version", project.version
filesMatching("mcmod.info") { fcd ->
include "mcmod.info"
fcd.expand (
'id': project.id,
'version': project.version
"id": project.id,
"version": project.version
)
}
dependsOn 'compileJava'
dependsOn "compileJava"
}

jar {
manifest.attributes([
'ModSide': 'BOTH',
'FMLCorePlugin': 'io.redstudioragnarok.redcore.asm.RedCorePlugin',
'FMLCorePluginContainsFMLMod': true,
'ForceLoadAsMod': true
"ModSide": "BOTH",
"FMLCorePlugin": "io.redstudioragnarok.redcore.asm.RedCorePlugin",
"FMLCorePluginContainsFMLMod": true,
"ForceLoadAsMod": true
])

// Add all embedded dependencies into the jar
Expand All @@ -85,41 +83,51 @@ jar {
}

idea {
module { inheritOutputDirs = true }

module { excludeDirs = [file('.github'), file('.gradle'), file('.idea'), file('build'), file('gradle'), file('run')] }
module {
inheritOutputDirs = true
excludeDirs = [
file(".settings"),
file(".github"),
file(".gradle"),
file("gradle"),
file(".idea"),
file("build"),
file("run"),
file("bin")
]
}

project { settings {
runConfigurations {
'Client'(Gradle) {
taskNames = ['runClient']
"Client"(Gradle) {
taskNames = ["runClient"]
}
'Server'(Gradle) {
taskNames = ['runServer']
"Server"(Gradle) {
taskNames = ["runServer"]
}
'Obfuscated Client'(Gradle) {
taskNames = ['runObfClient']
"Obfuscated Client"(Gradle) {
taskNames = ["runObfClient"]
}
'Obfuscated Server'(Gradle) {
taskNames = ['runObfServer']
"Obfuscated Server"(Gradle) {
taskNames = ["runObfServer"]
}
'Vanilla Client'(Gradle) {
taskNames = ['runVanillaClient']
"Vanilla Client"(Gradle) {
taskNames = ["runVanillaClient"]
}
'Vanilla Server'(Gradle) {
taskNames = ['runVanillaServer']
"Vanilla Server"(Gradle) {
taskNames = ["runVanillaServer"]
}
}

compiler.javac {
afterEvaluate {
javacAdditionalOptions = '-encoding utf8'
moduleJavacAdditionalOptions = [ (project.id + '.main'): tasks.compileJava.options.compilerArgs.collect { ''' + it + ''' }.join(' ') ]
javacAdditionalOptions = "-encoding utf8"
moduleJavacAdditionalOptions = [ (project.id + ".main"): tasks.compileJava.options.compilerArgs.collect { """ + it + """ }.join(" ") ]
}
}
}}
}

tasks.named('processIdeaSettings').configure {
dependsOn('injectTags')
tasks.named("processIdeaSettings").configure {
dependsOn("injectTags")
}
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Sets default memory used for Gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs = -Xmx4G
# Allow Gradle to use multi threading.
# Allow Gradle to execute tasks in parallel.
org.gradle.parallel = true
# Allow Gradle to cache build to avoid recompiling classes that did not change.
# Allow Gradle to cache build, to avoid recompiling classes that did not change.
org.gradle.caching = true
# Force the daemon to be used instead of being restarted each time.
org.gradle.daemon = true

# Mod Constants
# Versioning must follow Ragnarök versioning convention: https://shor.cz/ragnarok_versioning_convention
Expand Down
10 changes: 5 additions & 5 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ pluginManagement {
repositories {
maven {
// RetroFuturaGradle
name = 'GTNH Maven'
url = uri('http://jenkins.usrv.eu:8081/nexus/content/groups/public/')
name = "GTNH Maven"
url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/")
allowInsecureProtocol = true
mavenContent {
includeGroup 'com.gtnewhorizons'
includeGroup 'com.gtnewhorizons.retrofuturagradle'
includeGroup("com.gtnewhorizons")
includeGroup("com.gtnewhorizons.retrofuturagradle")
}
}
gradlePluginPortal()
Expand All @@ -18,5 +18,5 @@ pluginManagement {

plugins {
// Automatic toolchain provisioning
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

0 comments on commit 9705dff

Please sign in to comment.