-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
104 lines (84 loc) · 3.23 KB
/
build.gradle
File metadata and controls
104 lines (84 loc) · 3.23 KB
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
plugins {
id 'net.fabricmc.fabric-loom-remap' version "1.14-SNAPSHOT"
// id "org.ajoberstar.grgit" version "3.1.1"
}
repositories {
maven { url = "https://maven.fabricmc.net/" }
maven { url = "https://minecraft.guntram.de/maven/" }
maven { url = "file:///tmp/mymavenrepo/" }
maven { url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
maven { url = "https://jitpack.io" }
maven { url = "https://maven.shedaniel.me/" }
maven { url = "https://maven.terraformersmc.com/" }
maven { url = 'https://masa.dy.fi/maven' }
}
ext.Version = new Properties()
Version.load(file("version.properties").newReader())
ext.projectVersion = Version['modVersion']
ext.Versions = new Properties()
Versions.load(file("Versionfiles/${Version['minecraftVersion']}.properties").newReader())
version = "${project.projectVersion}-${Version['minecraftVersion']}"
def getBranch() {
if (System.getenv().GIT_BRANCH) {
def branch = System.getenv().GIT_BRANCH
return branch.substring(branch.lastIndexOf("/") + 1)
}
if (grgit == null) {
return "unknown"
}
def branch = grgit.branch.current().name
return branch.substring(branch.lastIndexOf("/") + 1)
}
loom {
mixin.defaultRefmapName = "blockmeter-refmap.json";
}
processResources {
duplicatesStrategy "warn"
inputs.property "version", project.projectVersion
from(sourceSets.main.resources.srcDirs) {
include "fabric.mod.json"
expand "version": project.projectVersion
}
from(sourceSets.main.resources.srcDirs) {
exclude "fabric.mod.json"
}
}
dependencies {
modImplementation("org.bukkit:bukkit:1.15.2-R0.1-SNAPSHOT") {
// This is to fix the error:
// com.google.*:*:* has more than one client module definitions
// in gradle > 4
exclude group: "com.google.guava", module: "guava"
exclude group: "com.google.code.gson", module: "gson"
}
minecraft "com.mojang:minecraft:${Versions['minecraft_version']}"
mappings "net.fabricmc:yarn:${Versions['yarn_mappings']}:v2"
modImplementation "net.fabricmc:fabric-loader:${Versions['loader_version']}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${Versions['fabric_api']}"
modImplementation "com.terraformersmc:modmenu:${Versions['modmenu']}"
modApi("me.shedaniel.cloth:cloth-config-fabric:${Versions['cloth_config']}") {
exclude(group: "net.fabricmc.fabric-api")
}
include "me.shedaniel.cloth:cloth-config-fabric:${Versions['cloth_config']}"
// modImplementation "fi.dy.masa.malilib:malilib-fabric-${Versions['minecraft_version']}:${Versions['malilib']}"
// Testing
testImplementation "org.junit.jupiter:junit-jupiter:5.+"
testImplementation "org.assertj:assertj-core:3.+"
testImplementation "org.mockito:mockito-inline:3.+"
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = "sources"
from sourceSets.main.allSource
}
jar {
from "LICENSE"
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}