forked from mekanism/Mekanism
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
240 lines (211 loc) · 6.8 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
buildscript {
repositories {
maven {
name = "central"
url = "https://maven.thorfusion.com/artifactory/central/"
}
}
dependencies {
classpath('com.anatawa12.forge:ForgeGradle:1.2-1.1.+') {
changing = true
}
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.33.1"
}
}
plugins {
id 'java-library'
}
apply plugin: 'forge'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: "com.jfrog.artifactory"
apply plugin: "maven-publish"
defaultTasks 'fullBuild'
repositories {
maven {
name 'central'
url 'https://maven.thorfusion.com/artifactory/central/'
}
}
idea {
module {
// For some reason this is necessary for IDEA 2014 workspaces to recognize assets
inheritOutputDirs = true
}
}
dependencies {
implementation "codechicken:CodeChickenLib:${minecraft_version}-${CCLIB_version}:dev"
implementation "codechicken:ForgeMultipart:${minecraft_version}-${FMP_version}:dev"
implementation "codechicken:NotEnoughItems:${minecraft_version}-${NEI_version}:dev"
implementation "codechicken:CodeChickenCore:${minecraft_version}-${CCC_version}:dev"
implementation "inventorytweaks:inventory-tweaks:1.7.10-1.60.0:api"
implementation "net.industrial-craft:industrialcraft-2:2.2.828-experimental:api"
implementation "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev"
}
if (System.getenv("BUILD_VER") == null) {
mod_version = mod_version
} else {
mod_version = mod_version + "-" + System.getenv("BUILD_VER")
}
version = minecraft_version + "-" + mod_version
group = "mekanism"
archivesBaseName = "Mekanism-Community-Edition"
libsDirName = "../output"
distsDirName = "../output"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
minecraft {
version = minecraft_version + "-" + forge_version
replaceIn "mekanism/common/Mekanism.java"
replaceIn "mekanism/generators/common/MekanismGenerators.java"
replaceIn "mekanism/tools/common/MekanismTools.java"
replace "GRADLE_MODVERSION", mod_version
replace "GRADLE_VERSIONMOD", alt_version
}
processResources {
duplicatesStrategy = 'include'
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
exclude '**/*.blend*'
}
}
task coreJar(type: Jar) {
classifier = 'Core'
manifest {
attributes 'FMLCorePlugin': 'mekanism.common.asm.LoadingHook'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
from('etc/core') {
include '*.info'
expand 'version': mod_version, 'mc_version': minecraft_version, 'fmp_version': FMP_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
exclude 'mekanism/tools/**', 'mekanism/generators/**', 'mcmod.info'
}
}
task alltJar(type: Jar) {
classifier = 'ALL'
manifest {
attributes 'FMLCorePlugin': 'mekanism.common.asm.LoadingHook'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
from('etc/all') {
include '*.info'
expand 'version': mod_version, 'mc_version': minecraft_version, 'fmp_version': FMP_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
exclude 'mcmod.info'
}
}
task toolsJar(type: Jar) {
classifier = 'Tools'
from('etc/tools') {
include '*.info'
expand 'version': mod_version, 'mc_version': minecraft_version, 'fmp_version': FMP_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
include 'mekanism/tools/**'
exclude 'mcmod.info'
}
}
task generatorsJar(type: Jar) {
classifier = 'Generators'
from('etc/generators') {
include '*.info'
expand 'version': mod_version, 'mc_version': minecraft_version, 'fmp_version': FMP_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
include 'mekanism/generators/**'
exclude 'mcmod.info'
}
}
coreJar.dependsOn('reobf')
toolsJar.dependsOn('reobf')
generatorsJar.dependsOn('reobf')
alltJar.dependsOn('reobf')
task MDKZip(type: Zip) {
classifier = 'MDK'
from sourceSets.main.java.srcDirs
include 'mekanism/api/**'
}
task devJar(type: Jar) {
classifier = 'DEV'
dependsOn processResources
from sourceSets.main.java.srcDirs
manifest {
attributes 'FMLCorePlugin': 'mekanism.common.asm.LoadingHook'
attributes 'FMLCorePluginContainsFMLMod': 'true'
}
from('etc/all') {
include '*.info'
expand 'version': mod_version, 'mc_version': minecraft_version, 'fmp_version': FMP_version
}
from zipTree(jar.outputs.getFiles().getSingleFile()).matching {
exclude 'mcmod.info'
}
}
task apiJar(type: Jar) {
classifier = 'API'
dependsOn processResources
from sourceSets.main.java.srcDirs
from sourceSets.main.output
include 'mekanism/api/**'
}
task fullBuild(type: Delete) {
delete jar
}
fullBuild.dependsOn('toolsJar', 'coreJar', 'generatorsJar', 'MDKZip', 'alltJar', 'apiJar', 'devJar')
artifactory {
contextUrl = System.getenv("MAVEN_URL")
publish {
repository {
repoKey = System.getenv("MAVEN_REPO")
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
maven = true
}
defaults {
publications('mavenJava')
}
publishBuildInfo = false
publishArtifacts = true
publishPom = true
}
resolve {
repository {
repoKey = System.getenv("MAVEN_REPO")
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
maven = true
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = project.archivesBaseName
groupId = project.group
version = project.version
artifacts = [toolsJar, coreJar, generatorsJar, MDKZip, alltJar, apiJar, devJar]
components.java.withVariantsFromConfiguration(configurations.runtimeElements) {
skip()
}
pom {
name.set("Mekanism Community Edition")
description.set('Mekanism is a Minecraft add-on featuring high-tech machinery that can be used to create powerful tools, armor, and weapons.')
url.set('https://github.com/Thorfusion/Mekanism-Community-Edition')
issueManagement {
system.set('github')
url.set('https://github.com/Thorfusion/Mekanism-Community-Edition/issues')
}
licenses {
license {
name.set('EUPL-1.2')
distribution.set('repo')
}
}
}
}
}
}