Created
August 25, 2021 21:09
-
-
Save Lanse505/91455a94a25b4b08208d21ea5d7e4a0f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Attach plugins | |
plugins { | |
id 'net.minecraftforge.gradle' version '5.+' | |
id 'java-library' | |
id 'com.github.johnrengelman.shadow' version '5.2.0' | |
id 'org.spongepowered.mixin' version '0.8+' | |
id 'org.parchementmc.librarian' version '1.0+' | |
} | |
// Standard Project Information | |
version = "$project.minecraftVersion-$project.modSpecVer.$project.modImplVer" | |
group = project.userGroup | |
archivesBaseName = project.modId | |
// Sets the toolchain to compile against OpenJDK 16 | |
java.toolchain { | |
languageVersion = JavaLanguageVersion.of(16) | |
vendor = JvmVendorSpec.ADOPTOPENJDK | |
} | |
// Add generated source set and attach to main source set | |
sourceSets { | |
api | |
generated | |
main{ | |
java { | |
srcDirs += sourceSets.api.java.srcDirs | |
} | |
resources { | |
srcDirs += sourceSets.api.resources.srcDirs | |
srcDirs += sourceSets.generated.resources.srcDirs | |
exclude '.cache/' | |
} | |
} | |
} | |
minecraft { | |
// The mappings can be changed at any time, and must be in the following format: | |
// Channel: Version: | |
// snapshot YYYYMMDD Snapshot are built nightly | |
// stable # Stables are built at the discretion of the MCP team | |
// official MCVersion Official field/method names from Mojang mapping files | |
// | |
// You must be aware of the Mojang license when using the 'official' mappings | |
// 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 | |
// Simply re-run your setup task after changing the mappings to update your workspace | |
mappings channel: project.mappingsType, version: project.mappingsVersion | |
// Exposes fields, methods, constructors, and classes for use within the mod | |
// Set modTransformer to 'true' within gradle.properties to enable | |
if (project.hasProperty('modTransformer') && project.getProperty('modTransformer').toBoolean()) | |
accessTransformer file('src/main/resources/META-INF/accesstransformer.cfg') | |
// Default run configurations | |
// These can be tweaked, removed, or duplicated as needed | |
runs { | |
// Client run configuration | |
client { | |
// Directory for the project to run in | |
workingDirectory file('run/client') | |
// Add mixin configuration argument | |
arg '-mixin.config=' + project.modId + '.mixins.json' | |
// Set the console logging level | |
property 'forge.logging.console.level', 'debug' | |
// Attach the sources to the run | |
mods.create(project.modId).source(sourceSets.main) | |
} | |
// Server run configuration | |
server { | |
workingDirectory file('run/server') | |
arg '-mixin.config=' + project.modId + '.mixins.json' | |
property 'forge.logging.console.level', 'debug' | |
mods.create(project.modId).source(sourceSets.main) | |
} | |
// Data run configuration | |
data { | |
workingDirectory file('run/data') | |
property 'forge.logging.console.level', 'debug' | |
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources | |
args '--mod', project.modId, | |
'--all', | |
'--output', sourceSets.generated.resources.srcDirs[0], | |
'--existing', sourceSets.main.resources.srcDirs[0] | |
mods.create(project.modId).source(sourceSets.main) | |
} | |
} | |
} | |
repositories { | |
maven { | |
name 'Registrate' | |
url 'https://maven.tterrag.com/' | |
} | |
/*maven { | |
name 'Thiakil Mappings' | |
url 'https://maven.thiakil.com' | |
content { | |
includeGroup 'de.oceanlabs.mcp' | |
includeGroup 'net.minecraft' | |
} | |
}*/ | |
maven { | |
name 'Just Enough Items' | |
url 'https://dvs1.progwml6.com/files/maven/' | |
} | |
maven { | |
name 'Titanium' | |
url 'https://maven.blamejared.com/' | |
} | |
flatDir { | |
dir 'libs' | |
} | |
} | |
configurations { | |
shade | |
runtimeMod { transitive = false } | |
} | |
dependencies { | |
// Include MinecraftForge as a dependency | |
minecraft group: 'net.minecraftforge', name: 'forge', version: "$project.minecraftVersion-$project.forgeVersion" | |
// Add exp4j as shaded library for string expression evaluation | |
def exp4j = 'net.objecthunter:exp4j:latest.release' | |
implementation exp4j | |
shade exp4j | |
// Add Registrate as shaded library | |
//def registrate = "com.tterrag.registrate:Registrate:MC$project.minecraftVersion-$project.registrateVersion" | |
//implementation fg.deobf(registrate) | |
//shade registrate | |
// Add JEI | |
//compileOnly fg.deobf("mezz.jei:jei-$project.minecraftVersion:$project.jeiVersion:api") | |
//runtimeOnly fg.deobf("mezz.jei:jei-$project.minecraftVersion:$project.jeiVersion") | |
// Add JUnit for testing | |
testImplementation "org.junit.jupiter:junit-jupiter-api:$project.junitVersion" | |
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:' | |
// Add Titanium | |
//implementation fg.deobf("com.hrznstudio:titanium:$project.minecraftVersion-$project.titaniumVersion-10") | |
// Add DynamicRegistries | |
//compileOnly fg.deobf('net.ashwork:dynamicregistries:1.17.1-0.2.0') | |
} | |
test { | |
useJUnitPlatform() | |
} | |
shadowJar { | |
configurations = [project.configurations.shade] | |
relocate 'net.objecthunter.exp4j', "${project.userGroup}.${project.modId}.repack.exp4j" | |
//relocate 'com.tterrag.registrate', "${project.userGroup}.${project.modId}.repack.registrate" | |
finalizedBy 'reobfShadowJar' | |
} | |
// Set attributes of the jar | |
jar { | |
finalizedBy 'reobfJar' | |
// Set manifest information | |
// Add mixin to jar manifest | |
manifest.attributes([ | |
'Specification-Title': project.modName, | |
'Specification-Vendor': project.userName, | |
'Specification-Version': project.modSpecVer, | |
'Implementation-Title': project.modName, | |
'Implementation-Version': project.version, | |
'Implementation-Vendor': project.userName, | |
'Implementation-Timestamp': new Date().format('yyyy-MM-dd\'T\'HH:mm:ssZ'), | |
'MixinConfigs': "${project.modId}.mixins.json" | |
]) | |
} | |
// Setup mixin reference map | |
mixin { | |
add sourceSets.main, "${project.modId}.refmap.json" | |
} | |
reobf { | |
shadowJar {} | |
} | |
project.afterEvaluate { | |
task copyMods(type:Copy) { | |
from configurations.runtimeMod.files | |
into file("run/mods") | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add External Plugins | |
pluginManagement { | |
// Add MinecraftForge maven to plugin management | |
repositories { | |
maven { | |
name 'Minecraft Forge' | |
url 'https://maven.minecraftforge.net' | |
} | |
maven { | |
name 'Parchment' | |
url 'https://maven.parchmentmc.org' | |
} | |
maven { | |
name 'Mixins' | |
url 'https://repo.spongepowered.org/maven/' | |
} | |
gradlePluginPortal() | |
} | |
// Resolve ForgeGradle within plugin block | |
resolutionStrategy.eachPlugin { | |
if (requested.id.id == 'net.minecraftforge.gradle') | |
useModule group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: requested.version | |
else if (requested.id.id == 'org.parchmentmc.librarian') | |
useModule group: 'org.parchmentmc.librarian', name: 'forgegradle', version: requested.version | |
else if (requested.id.id == 'org.spongepowered.mixin') | |
useModule group: 'org.spongepowered', name: 'mixingradle', version: requested.version | |
} | |
} | |
// Project Name | |
rootProject.name = 'Epos' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gradle Properties | |
org.gradle.jvmargs=-Xmx3G | |
org.gradle.daemon=false | |
# User Information | |
userName = Team Acronym Coders | |
userGroup = com.teamacronymcoders | |
# Minecraft Information | |
minecraftVersion = 1.17.1 | |
# Forge Information | |
forgeVersion = 37.0.33 | |
# Mixin Information | |
mixinVersion = 0.7-SNAPSHOT | |
# Dependencies Information | |
registrateVersion = 1.0.5 | |
jeiVersion = 7.7.0.104 | |
junitVersion = 5.7.2 | |
titaniumVersion = 3.2.8.4 | |
# Mappings Information | |
mappingsType = parchment | |
mappingsVersion = 2021.07.27-1.17.1 | |
# Mod Information | |
modId = epos | |
modName = Epos | |
modDesc = An RPG of Paths, Skills, and Feats | |
modTransformer = false | |
modSpecVer = 0.1.0 | |
modImplVer = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment