Skip to content

Commit

Permalink
latest fixes from template
Browse files Browse the repository at this point in the history
  • Loading branch information
brachy84 committed Jul 10, 2023
1 parent 150fad9 commit 240a907
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 55 deletions.
99 changes: 50 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar
import org.jetbrains.gradle.ext.Gradle

plugins {
id("java")
id("java-library")
id("maven-publish")
id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7"
id("eclipse")
id("com.gtnewhorizons.retrofuturagradle") version "1.3.9"
id("com.matthewprenger.cursegradle") version "1.4.0"
id 'java'
id 'java-library'
id 'maven-publish'
id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7'
id 'eclipse'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.16'
id 'com.matthewprenger.cursegradle' version '1.4.0'
}

version = project.mod_version
Expand All @@ -24,11 +23,11 @@ java {
}
// Generate sources and javadocs jars when building and publishing
withSourcesJar()
//withJavadocJar()
// withJavadocJar()
}

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.encoding = 'UTF-8'
}

configurations {
Expand All @@ -38,6 +37,18 @@ configurations {

minecraft {
mcVersion = '1.12.2'

// MCP Mappings
mcpMappingChannel = 'stable'
mcpMappingVersion = '39'

// Set username here, the UUID will be looked up automatically
username = 'Developer'

// Add any additional tweaker classes here
// extraTweakClasses.add('org.spongepowered.asm.launch.MixinTweaker')

// Add various JVM arguments here for runtime
def args = ["-ea:${project.group}"]
if (project.use_coremod.toBoolean()) {
args << '-Dfml.coreMods.load=' + coremod_plugin_class_name
Expand All @@ -51,25 +62,32 @@ minecraft {

useDependencyAccessTransformers = true

// Add any properties you want to swap out for a dynamic value at build time here
// Any properties here will be added to a class at build time, the name can be configured below
injectedTags.put("VERSION", project.version)
injectedTags.put("ID", project.archives_base_name)
}

// Generate a my.project.Tags class with the version number as a field
// Generate a group.archives_base_name.Tags class
tasks.injectTags.configure {
outputClassName.set("${project.group}.Tags")
// Change Tags class' name here:
outputClassName.set("${project.group}.${project.archives_base_name}.Tags")
}

repositories {
maven {
url = 'https://maven.cleanroommc.com'
name 'CleanroomMC Maven'
url 'https://maven.cleanroommc.com'
}
maven { url = "https://repo.spongepowered.org/maven" }
//maven { url "https://maven.mcmoddev.com/" }
maven {
url "https://cursemaven.com"
name 'SpongePowered Maven'
url 'https://repo.spongepowered.org/maven'
}
maven {
name 'CurseMaven'
url 'https://cursemaven.com'
content {
includeGroup "curse.maven"
includeGroup 'curse.maven'
}
}
maven {
Expand All @@ -80,59 +98,40 @@ repositories {

dependencies {
compileOnly 'org.jetbrains:annotations:24.0.1'
implementation 'zone.rong:mixinbooter:7.0'
implementation 'zone.rong:mixinbooter:8.3'

api("org.spongepowered:mixin:0.8.3") { transitive = false }
// Change your mixin refmap name here:
String mixin = modUtils.enableMixins('org.spongepowered:mixin:0.8.3', "mixins.${project.archives_base_name}.refmap.json")
api (mixin) {
transitive = false
}
annotationProcessor('org.ow2.asm:asm-debug-all:5.2')
annotationProcessor('com.google.guava:guava:24.1.1-jre')
annotationProcessor('com.google.code.gson:gson:2.8.6')
annotationProcessor("org.spongepowered:mixin:0.8.3") { transitive = false }
annotationProcessor(mixin) { transitive = false }
// Example deobf dependency
// compileOnly rfg.deobf("curse.maven:endercore-231868:2972849:")

implementation 'mezz.jei:jei_1.12.2:4.15.0.293'
}

def mixinConfigRefMap = 'mixins.' + project.archives_base_name + '.refmap.json'
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins'
def refMap = "${mixinTmpDir}" + File.separator + mixinConfigRefMap
def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg"

tasks.named("reobfJar", ReobfuscatedJar).configure {
extraSrgFiles.from(mixinSrg)
}

tasks.named("compileJava", JavaCompile).configure {
doFirst {
new File(mixinTmpDir).mkdirs()
}
options.compilerArgs += [
"-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}",
"-AoutSrgFile=${mixinSrg}",
"-AoutRefMapFile=${refMap}",
]
}

processResources {
// this will ensure that this task is redone when the versions change.
// This will ensure that this task is redone when the versions change
inputs.property 'version', project.version
inputs.property 'mcversion', project.minecraft.version
// replace stuff in mcmod.info, nothing else

// Replace various properties in mcmod.info and pack.mcmeta if applicable
filesMatching(['mcmod.info', 'pack.mcmeta']) { fcd ->
// replace version and mcversion
// Replace version and mcversion
fcd.expand(
'version': project.version,
'mcversion': project.minecraft.version
)
}

if (project.use_access_transformer.toBoolean()) {
rename '(.+_at.cfg)', 'META-INF/$1' // Access Transformers
rename '(.+_at.cfg)', 'META-INF/$1' // Make sure Access Transformer files are in META-INF folder
}

// Embed mixin refmap
from refMap
dependsOn("compileJava")
}

jar {
Expand All @@ -151,7 +150,9 @@ jar {
}

idea {
module { inheritOutputDirs = true }
module {
inheritOutputDirs = true
}
project {
settings {
runConfigurations {
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 '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,7 +18,7 @@ pluginManagement {

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

rootProject.name = "ModularUI"
1 change: 0 additions & 1 deletion src/main/java/com/cleanroommc/modularui/ModularUI.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.cleanroommc.modularui;

import com.cleanroommc.Tags;
import com.cleanroommc.modularui.drawable.DrawableSerialization;
import com.cleanroommc.modularui.holoui.HoloScreenEntity;
import com.cleanroommc.modularui.holoui.ScreenEntityRender;
Expand Down

0 comments on commit 240a907

Please sign in to comment.