-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
194 lines (162 loc) · 6.54 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
buildscript {
repositories {
mavenCentral()
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
}
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven'
apply plugin: 'pmd'
apply plugin: 'org.spongepowered.mixin'
ext.configFile = file('build.properties')
ext.config = parseConfig(configFile)
def mc_version = "1.16.3"
version = "${config.version}-${config.build_number}"
group = "dudblockman.${config.mod_id}"
archivesBaseName = config.mod_name
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft {
mappings channel: "snapshot", version: "20200916-1.16.2"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
//property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
arg "-mixin.config=" + config.mod_id + ".mixins.json"
property 'mixin.debug.export', 'true'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
mods {
psipherals {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
//property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
arg "-mixin.config=" + config.mod_id + ".mixins.json"
property 'mixin.debug.export', 'true'
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
singleInstance(true)
mods {
psipherals {
source sourceSets.main
}
}
}
data {
properties 'forge.logging.console.level': 'debug'
properties 'fml.earlyprogresswindow': 'false'
property 'mixin.env.disableRefMap', 'true'
arg "-mixin.config=" + config.mod_id + ".mixins.json"
workingDirectory project.file('run')
mods {
psipherals {
source sourceSets.main
}
}
args '--mod', 'psipherals', '--all',
'--existing', file('src/main/resources/'),
'--output', file('src/generated/resources/')
}
}
}
repositories {
maven {
// for Patchouli
name "blamejared"
url "http://maven.blamejared.com/"
}
maven {
// for JEI
name "promwml16"
url "http://dvs1.progwml6.com/files/maven"
}
maven {
//yarn2mcp
name "yarn2mcp"
url "https://maven.tterrag.com"
}
maven {
name "curios"
url "https://maven.theillusivec4.top/"
}
}
dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft group: 'net.minecraftforge', name: 'forge', version: "${mc_version}-34.1.0"
annotationProcessor 'org.spongepowered:mixin:0.8.1:processor'
compileOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.2-48-SNAPSHOT:api")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:1.16.2-48-SNAPSHOT")
compileOnly fg.deobf("mezz.jei:jei-1.16.2:7.3.2.25:api")
runtimeOnly fg.deobf("mezz.jei:jei-1.16.2:7.3.2.25")
compileOnly fg.deobf("vazkii.psi:Psi:1.16-94.399")
runtimeOnly fg.deobf("vazkii.psi:Psi:1.16-94.399")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.3-4.0.2.0")
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.16.3-4.0.2.0")
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
def parseConfig(File config) {
config.withReader {
def prop = new Properties()
prop.load(it)
return (new ConfigSlurper().parse(prop))
}
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
//rename the default output, for some better... sanity with scripts
archiveName = "${baseName} ${version}.${extension}"
manifest {
attributes([
"Specification-Title": "${config.mod_id}",
"Specification-Vendor": "dudblockman",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": "${config.mod_id}",
"Implementation-Version": "${version}",
"Implementation-Vendor" :"dudblockman",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": "${config.mod_id}.mixins.json"
])
}
exclude "**/*.bat"
exclude "**/*.psd"
exclude "**/*.exe"
exclude "**/unused"
exclude "**/*.py"
exclude "**/*.sh"
exclude "**/*.txt"
exclude "**/*.sh"
exclude "**/*.vim"
exclude "**/mappings-en_us.json"
exclude "**/en_us_base.json"
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
mixin {
add sourceSets.main, "${config.mod_id}.refmap.json"
}
defaultTasks 'clean', 'runData', 'build'