-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
156 lines (127 loc) · 3.65 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
145
146
147
148
149
150
151
152
153
154
155
156
buildscript { scriptHandler ->
apply from: 'gradle/plugins.gradle', to: scriptHandler
}
plugins {
id "com.github.johnrengelman.shadow" version "6.1.0"
id "org.jetbrains.kotlin.jvm" version "1.5.31"
id "java"
}
apply plugin: "net.minecraftforge.gradle.forge"
// Uncomment if using Mixin.
// apply from: 'gradle/mixin.gradle'
version = mod_version
group = mod_group
archivesBaseName = mod_name
sourceCompatibility = targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
replace('@NAME@', mod_name)
replace('@VER@': mod_version)
replace('@ID@', mod_id)
mappings = "stable_22"
makeObfSourceJar = false
clientRunArgs += '--tweakClass xyz.qalcyo.requisite.installer.RequisiteInstaller'
}
configurations {
/* Creates an extra dependency configuration that implements `implementation`, */
/* to be used later to shade libraries. */
shade
implementation.extendsFrom(shade)
}
repositories {
mavenCentral()
mavenLocal()
/* Currently down.
maven {
name = 'Qalcyo'
url = 'https://maven.qalcyo.xyz/repository/maven-public/'
}
*/
maven {
name = 'Sk1erLLC'
url = 'https://repo.sk1er.club/repository/maven-releases/'
}
maven {
name = 'Jitpack'
url = 'https://jitpack.io/'
}
maven {
name = 'Spongepowered'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
}
dependencies {
/* If you'd like access to a dependency's source (for example, another mod) use the method below: */
/* implementation('com.example.package:example:1.0.0') */
/* If you'd rather like your dependency to be inside your built JAR file, use: */
/* shade('com.example.package:example:1.0.0') */
/* Currently down.
implementation('xyz.qalcyo.crimson:Crimson-1.8.9:1.0.0')
shade('xyz.qalcyo.crimson:CrimsonInstaller-1.8.9:1.0')
*/
}
jar {
enabled = false
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest.attributes(
'ModSide': 'CLIENT',
'ForceLoadAsMod': true,
// 'TweakClass': 'xyz.qalcyo.crimson.installer.CrimsonInstaller'
)
}
task moveResources {
doLast {
try {
ant.move file: "${buildDir}/resources/main", todir: "${buildDir}/classes/java"
} catch (Exception e) {
e.printStackTrace()
}
}
}
shadowJar {
archiveClassifier.set('')
configurations = [project.configurations.shade]
duplicatesStrategy DuplicatesStrategy.EXCLUDE
exclude 'LICENSE.md'
exclude 'pack.mcmeta'
exclude 'dummyThing'
exclude '**/module-info.class'
exclude '*.so'
exclude '*.dylib'
exclude '*.dll'
exclude '*.jnilib'
exclude 'ibxm/**'
exclude 'com/jcraft/**'
exclude 'org/lwjgl/**'
exclude 'net/java/**'
exclude 'META-INF/proguard/**'
exclude 'META-INF/maven/**'
exclude 'META-INF/versions/**'
exclude 'META-INF/com.android.tools/**'
exclude 'fabric.mod.json'
}
processResources {
inputs.property "id", mod_id
inputs.property "name", mod_name
inputs.property "version", mod_version
inputs.property "mcversion", minecraft.version
filesMatching("mcmod.info") {
expand(
"id": mod_id,
"name": mod_name,
"version": project.version,
"mcversion": minecraft.version
)
}
rename '(.+_at.cfg)', 'META-INF/$1'
}
reobf {
shadowJar {
classpath = sourceSets.main.compileClasspath
}
}
moveResources.dependsOn(processResources)
classes.dependsOn(moveResources)
reobfJar.dependsOn(shadowJar)