-
Notifications
You must be signed in to change notification settings - Fork 6
/
fabric.gradle
134 lines (110 loc) · 2.9 KB
/
fabric.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
def branch = project.findProperty("commonGradleBranch") ?: "master"
def includeClothConfig = !project.hasProperty("includeClothConfig") || project.includeClothConfig
def testMod = project.findProperty("testMod")
ext {
useSpotBugs = false
testing = false
defaultCompileDependencies = false
includeLicense = false
buildSourcesJar = false
registerDefaultMavenPublication = false
}
apply from: "https://raw.githubusercontent.com/TheRandomLabs/Common-Gradle/$branch/build.gradle"
if (testMod) {
sourceSets {
testmod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}
}
repositories {
if (project.hasProperty("clothConfigVersion")) {
maven {
url "https://dl.bintray.com/shedaniel/cloth-config-2"
}
}
if (project.hasProperty("autoConfigVersion")) {
maven {
url "https://dl.bintray.com/shedaniel/autoconfig1u"
}
}
if (project.hasProperty("autoConfigTOMLVersion")) {
maven {
url "https://jitpack.io"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraftVersion}"
mappings "net.fabricmc:yarn:${project.yarnMappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loaderVersion}"
if (project.hasProperty("fabricAPIVersion")) {
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabricAPIVersion}"
}
if (project.hasProperty("modMenuVersion")) {
modImplementation "io.github.prospector:modmenu:${project.modMenuVersion}"
}
if (project.hasProperty("clothConfigVersion")) {
modImplementation("me.shedaniel.cloth:config-2:${project.clothConfigVersion}") {
exclude(module: "fabric-api")
}
if (includeClothConfig) {
include "me.shedaniel.cloth:config-2:${project.clothConfigVersion}"
}
}
if (project.hasProperty("autoConfigVersion")) {
modImplementation("me.sargunvohra.mcmods:autoconfig1u:${project.autoConfigVersion}") {
exclude(module: "fabric-api")
}
if (includeClothConfig) {
include "me.sargunvohra.mcmods:autoconfig1u:${project.autoConfigVersion}"
}
}
if (project.hasProperty("autoConfigTOMLVersion")) {
modImplementation "com.github.TheRandomLabs:AutoConfig-TOML:${project.autoConfigTOMLVersion}"
include "com.github.TheRandomLabs:AutoConfig-TOML:${project.autoConfigTOMLVersion}"
}
if (testMod) {
afterEvaluate {
testmodImplementation(sourceSets.main.output)
}
}
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
java {
withSourcesJar()
}
jar {
from("LICENSE") {
rename {
"${it}_${project.archivesBaseName}"
}
}
}
if (testMod) {
runClient {
classpath(sourceSets.testmod.runtimeClasspath)
}
runServer {
classpath(sourceSets.testmod.runtimeClasspath)
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
artifact javadocJar
}
}
}