Skip to content

Commit 7cf4049

Browse files
committed
update buildscript
1 parent c5be552 commit 7cf4049

File tree

1 file changed

+43
-19
lines changed

1 file changed

+43
-19
lines changed

build.gradle

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//version: 1656003793falsepattern51
1+
//version: 1656003793falsepattern58
22
/*
33
DO NOT CHANGE THIS FILE!
44
@@ -46,9 +46,13 @@ buildscript {
4646
name = "mavenpattern"
4747
url = "https://mvn.falsepattern.com/releases/"
4848
}
49+
maven {
50+
name = "usrv"
51+
url = "https://mvn.falsepattern.com/usrv/"
52+
}
4953
}
5054
dependencies {
51-
classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7'
55+
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11'
5256
classpath 'com.falsepattern:jtweaker:0.2.1'
5357
}
5458
}
@@ -133,7 +137,7 @@ propertyDefaultIfUnset("modrinthProjectId", "")
133137
propertyDefaultIfUnset("modrinthDependencies", "")
134138
propertyDefaultIfUnset("curseForgeProjectId", "")
135139
propertyDefaultIfUnset("curseForgeRelations", "")
136-
propertyDefaultIfUnset("changelog", "No changelog URL was provided.")
140+
propertyDefaultIfUnset("changelog", "")
137141

138142
propertyDefaultIfUnset("remoteMappings", "https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/")
139143
propertyDefaultIfUnset("mappingsChannel", "stable")
@@ -303,15 +307,15 @@ dependencies {
303307
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
304308
annotationProcessor("com.google.guava:guava:24.1.1-jre")
305309
annotationProcessor("com.google.code.gson:gson:2.8.6")
306-
annotationProcessor("com.llamalad7:MixinExtras:0.0.12-gasstation")
307-
annotationProcessor("org.spongepowered:mixin:0.8.5-gasstation_3")
308-
compile("org.spongepowered:mixin:0.8.5-gasstation_3")
309-
compile("com.llamalad7:MixinExtras:0.0.12-gasstation")
310-
compile("com.falsepattern:00gasstation-mc1.7.10:0.3.4:dev")
310+
annotationProcessor("com.llamalad7:MixinExtras:0.1.1-gasstation")
311+
annotationProcessor("org.spongepowered:mixin:0.8.5-gasstation_7")
312+
compile("org.spongepowered:mixin:0.8.5-gasstation_7")
313+
compile("com.llamalad7:MixinExtras:0.1.1-gasstation")
314+
compile("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev")
311315
} else if(hasMixinDeps.toBoolean()) {
312-
runtime("org.spongepowered:mixin:0.8.5-gasstation_3")
313-
runtime("com.llamalad7:MixinExtras:0.0.12-gasstation")
314-
runtime("com.falsepattern:00gasstation-mc1.7.10:0.3.4:dev")
316+
runtime("com.llamalad7:MixinExtras:0.1.1-gasstation")
317+
runtime("org.spongepowered:mixin:0.8.5-gasstation_7")
318+
runtime("com.falsepattern:00gasstation-mc1.7.10:0.5.1:dev")
315319
}
316320
}
317321

@@ -409,7 +413,7 @@ runClient {
409413

410414
if (usesMixins.toBoolean()) {
411415
arguments += [
412-
"--mods=../build/libs/$archivesBaseName-${version}.jar"
416+
"--mods=" + Paths.get("$projectDir").resolve(minecraft.runDir).normalize().relativize(Paths.get("$projectDir/build/libs/$archivesBaseName-${version}.jar"))
413417
]
414418
}
415419

@@ -439,7 +443,7 @@ runServer {
439443

440444
if (usesMixins.toBoolean()) {
441445
arguments += [
442-
"--mods=../build/libs/$archivesBaseName-${version}.jar"
446+
"--mods=" + Paths.get("$projectDir").resolve(minecraft.runDir).normalize().relativize(Paths.get("$projectDir/build/libs/$archivesBaseName-${version}.jar"))
443447
]
444448
}
445449

@@ -703,15 +707,24 @@ publishing {
703707
}
704708
}
705709

710+
if (project.changelog == "") {
711+
File changelogFile = new File(System.getenv("CHANGELOG_FILE") ?: "CHANGELOG.md")
712+
if (changelogFile.exists()) {
713+
project.changelog = changelogFile.getText("UTF-8")
714+
} else {
715+
project.changelog = "No changelog was provided."
716+
}
717+
}
718+
project.changelog = project.changelog.replace("{version}", modVersion)
706719

707-
if (curseForgeProjectId != "") {
720+
if (curseForgeProjectId != "" && System.getenv("CURSEFORGE_TOKEN") != null) {
708721
apply plugin: 'com.matthewprenger.cursegradle'
709722
curseforge {
710-
apiKey = System.getenv("CURSEFORGE_TOKEN") ?: ""
723+
apiKey = System.getenv("CURSEFORGE_TOKEN")
711724
project {
712725
id = curseForgeProjectId
713-
changelogType = "text"
714-
changelog = project.changelog.replace("{version}", modVersion)
726+
changelogType = "markdown"
727+
changelog = project.changelog
715728
releaseType = modVersion.contains("-a") ? "alpha" : modVersion.contains("-b") ? "beta" : "release"
716729
addGameVersion project.minecraft.version
717730
addGameVersion "Forge"
@@ -736,18 +749,22 @@ if (curseForgeProjectId != "") {
736749
addCurseForgeRelation(type, name)
737750
}
738751
}
752+
753+
if (usesMixins.toBoolean()) {
754+
addCurseForgeRelation("requiredDependency", "gasstation")
755+
}
739756
tasks.curseforge.dependsOn(build)
740757
tasks.publish.dependsOn(tasks.curseforge)
741758
}
742759

743-
if (modrinthProjectId != "") {
760+
if (modrinthProjectId != "" && System.getenv("MODRINTH_TOKEN") != null) {
744761
apply plugin: 'com.modrinth.minotaur'
745762
modrinth {
746763
token = System.getenv("MODRINTH_TOKEN")
747764
projectId = modrinthProjectId
748765
versionNumber = modVersion
749766
versionType = modVersion.contains("-a") ? "alpha" : modVersion.contains("-b") ? "beta" : "release"
750-
changelog = project.changelog.replace("{version}", modVersion)
767+
changelog = project.changelog
751768
uploadFile = jar
752769
gameVersions = [project.minecraft.version]
753770
loaders = ["forge"]
@@ -766,6 +783,9 @@ if (modrinthProjectId != "") {
766783
addModrinthDep(scope, type, name)
767784
}
768785
}
786+
if (usesMixins.toBoolean()) {
787+
addModrinthDep("required", "project", "cdeAhgfp")
788+
}
769789
tasks.modrinth.dependsOn(build)
770790
tasks.publish.dependsOn(tasks.modrinth)
771791
}
@@ -1098,4 +1118,8 @@ def propertyDefaultIfUnset(String propertyName, defaultValue) {
10981118

10991119
def getFile(String relativePath) {
11001120
return new File(projectDir, relativePath)
1121+
}
1122+
1123+
if(file("addon_final.gradle").exists()) {
1124+
apply from: "addon_final.gradle"
11011125
}

0 commit comments

Comments
 (0)