Skip to content

Commit

Permalink
update buildscript
Browse files Browse the repository at this point in the history
  • Loading branch information
FalsePattern committed Mar 9, 2022
1 parent b9f8aa2 commit f0989a4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
40 changes: 31 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1641429628falsepattern8
//version: 1641429628falsepattern12
/*
DO NOT CHANGE THIS FILE!
Expand Down Expand Up @@ -28,11 +28,11 @@ buildscript {
}
maven {
name = "jitpack"
url = "https://jitpack.io"
url = "https://jitpack.falsepattern.com/"
}
}
dependencies {
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.5'
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.6'
}
}

Expand Down Expand Up @@ -94,6 +94,7 @@ checkPropertyExists("repositoryURL")
checkPropertyExists("repositoryName")
checkPropertyExists("mavenGroupId")
checkPropertyExists("mavenArtifactId")
checkPropertyExists("hasMixinDeps")


String javaSourceDir = "src/main/java/"
Expand Down Expand Up @@ -213,13 +214,13 @@ repositories {
name = "Overmind forge repo mirror"
url = "https://gregtech.overminddl1.com/"
}
if(usesMixins.toBoolean()) {
if(usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
maven {
name = "sponge"
url = "https://repo.spongepowered.org/repository/maven-public"
url = "https://sponge.falsepattern.com/"
}
maven {
url = "https://jitpack.io"
url = "https://jitpack.falsepattern.com/"
}
}
}
Expand All @@ -241,6 +242,17 @@ dependencies {
}
compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
}
if(hasMixinDeps.toBoolean()) {
runtime("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
// Mixin includes a lot of dependencies that are too up-to-date
exclude module: "launchwrapper"
exclude module: "guava"
exclude module: "gson"
exclude module: "commons-io"
exclude module: "log4j-core"
}
runtime("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
}
}

apply from: 'dependencies.gradle'
Expand Down Expand Up @@ -328,9 +340,14 @@ runClient {
def arguments = []
def jvmArguments = []

if(usesMixins.toBoolean()) {
if (usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$archivesBaseName-${version}.jar"
]
}

if(usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
arguments += [
"--mods=../build/libs/$archivesBaseName-${version}.jar",
"--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"
]
jvmArguments += [
Expand All @@ -355,7 +372,12 @@ runServer {

if (usesMixins.toBoolean()) {
arguments += [
"--mods=../build/libs/$archivesBaseName-${version}.jar",
"--mods=../build/libs/$archivesBaseName-${version}.jar"
]
}

if (usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
arguments += [
"--tweakClass", "org.spongepowered.asm.launch.MixinTweaker"
]
jvmArguments += [
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ accessTransformersFile =

# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = true
# Enable this if one of the dependencies uses SpongeMixins.
hasMixinDeps = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin = mixin.plugin.MixinPlugin
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
Expand Down

0 comments on commit f0989a4

Please sign in to comment.