forked from FabricMC/fabric-loom
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.gradle
217 lines (192 loc) · 6.71 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
plugins {
id 'maven-publish'
id 'java-gradle-plugin'
id 'idea'
id 'eclipse'
id 'com.github.johnrengelman.shadow' version '4.0.4' apply false
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'net.fabricmc'
archivesBaseName = project.name
version = '0.2.7-SNAPSHOT'
def build = "local"
def ENV = System.getenv()
if (ENV.BUILD_NUMBER) {
build = "jenkins #${ENV.BUILD_NUMBER}"
} else {
def process = 'git rev-parse --short HEAD'.execute()
process.waitFor()
if (!process.exitValue()) build = "Sin² ${process.text.trim()}"
}
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/groups/public/'
}
maven {
name = "Fabric"
url = 'https://maven.fabricmc.net/'
}
maven {
name = "Jitpack"
url 'https://jitpack.io/'
}
maven {
url "https://repo.gradle.org/gradle/libs-releases-local"
}
}
configurations {
shade
compileOnly.extendsFrom shade
runtimeClasspath.extendsFrom shade
}
dependencies {
compileOnly "org.gradle:gradle-core-api:6.1"
// libraries
implementation ('commons-io:commons-io:2.6')
implementation ('org.zeroturnaround:zt-zip:1.13')
implementation ('com.google.code.gson:gson:2.8.6')
implementation ('com.google.guava:guava:30.1-jre')
// game handling utils
implementation ('com.github.Chocohead:Stitch:8085309') {
exclude module: 'enigma'
exclude module: 'tiny-mappings-parser'
}
implementation ('com.github.Chocohead:Tiny-Mappings-Parser:d96d407') {
exclude module: 'sponge-mixin'
}
implementation ('com.github.Chocohead:OptiSine:cc6da75') {//Keep consistent with Openfine.VERSION
transitive = false
}
// tinyfile management
implementation ('com.github.Chocohead:tiny-remapper:ab144ea') {
transitive = false
}
compileOnly 'cuchaz:enigma:0.27.1'
implementation 'cuchaz:enigma-cli:0.27.1'
// decompilers
//implementation ('org.benf:cfr:0.151')
implementation ('com.github.Chocohead:VineFlower:9316a4c')
// source code remapping
implementation ('org.cadixdev:mercury:[0.1.0-rc1]')
shade ('org.cadixdev:mercurymixin:0.1.0-SNAPSHOT') {
transitive = false
}
// Mercury pulls all of these deps in, however eclipse does not specify the exact version to use so they can get updated without us knowing.
// Depend specifically on these versions to prevent them from being updated under our feet.
implementation ('org.eclipse.jdt:org.eclipse.jdt.core:[3.21.0]')
implementation ('org.eclipse.platform:org.eclipse.compare.core:[3.6.1000]')
implementation ('org.eclipse.platform:org.eclipse.core.commands:[3.9.800]')
implementation ('org.eclipse.platform:org.eclipse.core.contenttype:[3.7.900]')
implementation ('org.eclipse.platform:org.eclipse.core.expressions:[3.7.100]')
implementation ('org.eclipse.platform:org.eclipse.core.filesystem:[1.7.700]')
implementation ('org.eclipse.platform:org.eclipse.core.jobs:[3.10.1100]')
implementation ('org.eclipse.platform:org.eclipse.core.resources:[3.14.0]')
implementation ('org.eclipse.platform:org.eclipse.core.runtime:[3.20.100]')
implementation ('org.eclipse.platform:org.eclipse.equinox.app:[1.5.100]')
implementation ('org.eclipse.platform:org.eclipse.equinox.common:[3.14.100]')
implementation ('org.eclipse.platform:org.eclipse.equinox.preferences:[3.8.200]')
implementation ('org.eclipse.platform:org.eclipse.equinox.registry:[3.10.100]')
implementation ('org.eclipse.platform:org.eclipse.osgi:[3.16.200]')
implementation ('org.eclipse.platform:org.eclipse.team.core:[3.8.1100]')
implementation ('org.eclipse.platform:org.eclipse.text:[3.11.0]')
}
jar {
classifier = 'unshaded'
manifest {
attributes 'Implementation-Title': "Loom $version"
attributes 'Implementation-Version': "$version Build($build)"
}
}
task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
dependsOn 'jar'
from(zipTree(jar.archivePath))
classifier ''
manifest.inheritFrom jar.manifest
configurations = [project.configurations.shade]
relocate 'org.cadixdev.mercury.mixin', 'com.chocohead.shade.mercury.mixin'
exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'module-info.class')
}
assemble.dependsOn shadowJar
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
apply from: 'https://github.com/FabricMC/fabric-docs-old/raw/master/gradle/license.gradle'
license {
exclude '**/loom/YarnGithubResolver.java'
exclude '**/loom/util/DownloadUtil.java'
exclude '**/loom/task/RemappingJar.java'
exclude '**/loom/util/AccessTransformerHelper.java'
exclude '**/loom/dependencies/ArtifactDependencyProvider.java'
exclude '**/loom/dependencies/ArtifactInfo.java'
exclude '**/loom/dependencies/ComputedDependency.java'
exclude '**/loom/dependencies/DependencyGraph.java'
exclude '**/loom/dependencies/LogicalDependencyProvider.java'
exclude '**/loom/dependencies/PhysicalDependencyProvider.java'
exclude '**/loom/providers/JarNameFactory.java'
exclude '**/loom/providers/JarNamingStrategy.java'
exclude '**/loom/providers/MappedModsCollector.java'
exclude '**/loom/providers/MappedModsCollectors.java'
exclude '**/loom/providers/MappedModsProvider.java'
exclude '**/loom/providers/MappedModsResolver.java'
exclude '**/loom/providers/MappingsProvider.java'
exclude '**/loom/providers/MinecraftProvider.java'
exclude '**/loom/providers/MinecraftVersionAdaptable.java'
exclude '**/loom/providers/LazyMappings.java'
exclude '**/loom/providers/SpecialCases.java'
exclude '**/loom/providers/StackedMappingsProvider.java'
exclude '**/loom/providers/mappings/*.java'
exclude '**/loom/providers/openfine/*.java'
exclude '**/loom/util/Closer.java'
exclude '**/loom/util/HexaFunction.java'
exclude '**/loom/util/MinecraftVersionInfo.java'
exclude '**/loom/util/OperatingSystem.java'
exclude '**/loom/util/ThrowingIntObjConsumer.java'
exclude '**/loom/util/progress/ProgressLoggerImpl.java'
exclude '**/loom/util/progress/ProgressLoggerShim.java'
exclude '**/loom/decompilers/fernflower/JavadocProvider.java'
exclude '**/loom/task/lvt/*.java'
}
wrapper {
gradleVersion = '4.9'
}
gradlePlugin {
plugins {
fabricLoom {
id = "fabric-loom"
implementationClass = "net.fabricmc.loom.LoomGradlePlugin"
}
}
}
publishing {
publications {
plugin(MavenPublication) { publication ->
groupId project.group
artifactId project.archivesBaseName
version project.version
from components["java"]
artifact shadowJar
artifact sourcesJar
//artifact javadocJar
}
}
repositories {
maven {
if (project.hasProperty('mavenPass')) {
url "http://mavenupload.modmuss50.me/"
credentials {
username 'buildslave'
password project.getProperty('mavenPass')
}
} else {
url "$buildDir/repo"
}
}
}
}