forked from TagnumElite/ProjectE-Integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
252 lines (210 loc) · 8.46 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
buildscript {
repositories {
maven { url = "https://maven.minecraftforge.net/" }
maven { url = "https://files.minecraftforge.net/maven" }
mavenCentral()
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
}
}
plugins {
id "com.matthewprenger.cursegradle" version "1.4.0"
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = "${mod_version}"
if (System.getenv('GITHUB_ACTIONS') != null && System.getenv('GITHUB_EVENT_NAME') != 'release') {
version += "+${System.getenv('GITHUB_SHA').substring(0, 7)}"
}
group = 'com.tagnumelite.projecteintegration'
archivesBaseName = "ProjectE-Integration-${mc_version}"
def apiProject = project(":Api")
def plugins = gradle.ext.pei_plugins
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
subprojects.each { subproject -> evaluationDependsOn(subproject.path) }
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.fork = true
options.incremental = true
options.encoding = 'UTF-8'
}
minecraft {
mappings channel: 'snapshot', version: "${mcp_version}"
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'
}
server {
// 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'
}
}
}
processResources {
inputs.property 'version', project.version
inputs.property 'mcversion', project.mc_version
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.mc_version
}
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
repositories {
maven { name 'CurseMaven'; url 'https://cursemaven.com' }
maven { name 'BlameJared'; url 'https://maven.blamejared.com' }
}
dependencies {
minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
compile apiProject
compile fg.deobf("curse.maven:ProjectE-226410:${curse_projecte}")
compileOnly "CraftTweaker2:CraftTweaker2-MC1120-Main:${version_crafttweaker}:deobf"
//runtimeOnly "CraftTweaker2:CraftTweaker2-MC1120-Main:${version_crafttweaker}"
}
jar {
dependsOn apiProject.tasks['classes']
from sourceSets.main.output.classesDirs
from apiProject.sourceSets.main.output.classesDirs
from sourceSets.main.output.resourcesDir
from apiProject.sourceSets.main.output.resourcesDir
plugins.each { plugin ->
def pProject = project("Plugins:${plugin}")
dependsOn pProject.tasks['classes']
from pProject.sourceSets.main.output.classesDir
from pProject.sourceSets.main.output.resourcesDir
}
manifest {
attributes([
"Specification-Title": "projecteintegration",
"Specification-Vendor": "TagnumElite",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"TagnumElite",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
task javadocJar(type: Jar, dependsOn: ":Api:javadoc") {
classifier = "javadoc"
from javadoc.destinationDir
from apiProject.javadoc.destinationDir
}
task sourcesJar(type: Jar, dependsOn: plugins.collect{ "Plugins:${it}:compileJava"}) {
classifier = "sources"
from sourceSets.main.allJava
from apiProject.sourceSets.main.allJava
from files(plugins.collect { project("Plugins:${it}").sourceSets.main.output })
}
task apiJar(type: Jar) {
classifier = "api"
from apiProject.sourceSets.main.output
}
artifacts {
archives javadocJar
archives sourcesJar
archives apiJar
}
// 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')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact javadocJar
artifact sourcesJar
artifact apiJar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
if (System.env.CURSEFORGE_API_KEY) {
curseforge {
apiKey = System.env.CURSEFORGE_API_KEY != null ? System.env.CURSEFORGE_API_KEY : '0'
project {
id = "${cf_project_id}"
releaseType = "${release_type}"
addGameVersion "${mc_version}"
mainArtifact(jar) { displayName = "ProjectEIntegration-${mc_version}-${version}" }
addArtifact(apiJar) { displayName = "ProjectEIntegration-${mc_version}-${version}-api" }
addArtifact(deobfJar) { displayName = "ProjectEIntegration-${mc_version}-${version}-deobf" }
addArtifact(javadocJar) { displayName = "ProjectEIntegration-${mc_version}-${version}-javadoc" }
addArtifact(sourcesJar) { displayName = "ProjectEIntegration-${mc_version}-${version}-sources" }
relations {
requiredDependency 'ProjectE'
// ProjectE-Integration Compact
optionalDependency 'CraftTweaker'
// Crafting Plugins
optionalDependency 'ArmorPlus'
optionalDependency 'Artisan-Worktables'
optionalDependency 'Chisel'
optionalDependency 'Extended-Crafting'
optionalDependency 'Modular-Machinery'
// Duplicate Plugins
// Legacy Plugins
//optionalDependency 'IC2Classic'
optionalDependency 'NuclearCraft-mod'
// Library Plugins
optionalDependency 'Charset-Lib'
optionalDependency 'LibVulpes'
optionalDependency 'RebornCore'
optionalDependency 'Sonar-Core'
// Magic Plugins
optionalDependency 'Astral-Sorcery'
optionalDependency 'Blood-Magic'
optionalDependency 'Botania'
optionalDependency 'Embers'
optionalDependency 'Embers-Rekindled' //The embers plugin supports both
optionalDependency 'ExtraBotany'
optionalDependency 'Mystical-Agriculture'
optionalDependency 'Psi'
optionalDependency 'Thaumcraft'
// Misc Plugins
optionalDependency 'Avaritia-1-10'
optionalDependency 'Pams-HarvestCraft'
optionalDependency 'Security-Craft'
optionalDependency 'Tinkers-Construct'
optionalDependency 'Woot'
// Rocketry Plugins
optionalDependency 'Advanced-Rocketry'
// Tech Plugins
optionalDependency 'Actually-Additions'
optionalDependency 'Applied-Energistics-2'
optionalDependency 'Calculator'
optionalDependency 'Compact-Machines'
optionalDependency 'Draconic-Evolution'
optionalDependency 'Ender-IO'
optionalDependency 'Extra-Utilities'
optionalDependency 'Forestry'
optionalDependency 'GregTechCE'
optionalDependency 'Immersive-Engineering'
optionalDependency 'Industrial-Craft'
optionalDependency 'Mekanism'
optionalDependency 'NuclearCraft-Overhauled'
optionalDependency 'PneumaticCraft-Repressurized'
optionalDependency 'TechReborn'
optionalDependency 'Thermal-Expansion'
}
}
}
}