This repository has been archived by the owner on Sep 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
144 lines (126 loc) · 4.34 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
buildscript {
repositories {
maven { url "https://repo.spongepowered.org/maven" }
maven { url "https://maven.minecraftforge.net" }
gradlePluginPortal()
}
dependencies {
classpath "net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT"
classpath "gradle.plugin.com.matthewprenger:CurseGradle:1.4.0"
classpath "org.spongepowered:mixingradle:0.6-SNAPSHOT"
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
}
def mcVersion = project.mc_version
def username = project.username
apply plugin: "net.minecraftforge.gradle.forge"
apply plugin: "org.spongepowered.mixin"
version = project.version
group = "com.stevekung.skyblockcatia"
archivesBaseName = "SkyBlockcatia"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = 1.8
compileJava.options.encoding = "UTF-8"
minecraft {
version = "${forge_version}"
runDir = "run"
mappings = "${mcp_mapping}"
makeObfSourceJar = false
clientJvmArgs += "-Dmixin.debug.export=true -Dmixin.debug.verbose=true"
if (project.hasProperty("devauth_dir")) {
clientJvmArgs += "-Ddevauth.configDir=${devauth_dir}"
}
clientRunArgs += "--mixin mixins.skyblockcatia.json --tweakClass org.spongepowered.asm.launch.MixinTweaker"
}
configurations {
embed
implementation.extendsFrom(embed)
}
// thanks to https://stackoverflow.com/a/38105112
def urlFile = { url, name ->
File file = new File("$buildDir/download/${name}.jar")
file.parentFile.mkdirs()
if (!file.exists()) {
new URL(url).withInputStream { downloadStream ->
file.withOutputStream { fileOut ->
fileOut << downloadStream
}
}
}
files(file.absolutePath)
}
repositories {
maven { url "https://repo.spongepowered.org/maven" }
maven { url "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1" }
}
dependencies {
embed("org.spongepowered:mixin:0.7.11-SNAPSHOT") { transitive = false }
compile urlFile("https://github.com/BiscuitDevelopment/SkyblockAddons/releases/download/${sba_version}/SkyblockAddons-${sba_jar_name}.jar", "SkyblockAddons")
compile "me.djtheredstoner:DevAuth-forge-legacy:1.0.0"
}
sourceSets {
main {
ext.refMap = "mixins.skyblockcatia.refmap.json"
}
}
jar {
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "LICENSE.txt", "META-INF/*.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
}
manifest {
attributes("FMLAT": "skyblockcatia_at.cfg",
"FMLCorePluginContainsFMLMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs": "mixins.skyblockcatia.json",
"ForceLoadAsMod": "true"
)
}
exclude "debug/**"
exclude "club/**"
baseName = "SkyBlockcatia-" + mcVersion
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
baseName = "SkyBlockcatia-" + mcVersion
exclude "debug/**"
classifier = "sources"
}
task deobfJar(type: Jar) {
from sourceSets.main.output
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
exclude "LICENSE.txt", "META-INF/*.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
}
manifest {
attributes("FMLAT": "skyblockcatia_at.cfg",
"FMLCorePluginContainsFMLMod": "true",
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
"MixinConfigs": "mixins.skyblockcatia.json",
"ForceLoadAsMod": "true"
)
}
exclude "debug/**"
baseName = "SkyBlockcatia-" + mcVersion
classifier = "deobf"
}
artifacts {
archives sourcesJar
archives deobfJar
}
curseforge {
if (project.hasProperty("upload_api_key")) {
apiKey = project.upload_api_key
project {
id = "397441"
changelog = file("CHANGE_LOG.md")
changelogType = "markdown"
releaseType = "release"
addGameVersion mcVersion
mainArtifact(jar) {
displayName = "SkyBlockcatia-" + mcVersion + "-" + version
}
addArtifact sourcesJar
addArtifact deobfJar
}
}
}