-
Notifications
You must be signed in to change notification settings - Fork 29
/
build.gradle
132 lines (112 loc) · 3.89 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
allprojects {
repositories {
mavenCentral()
maven {
name = "swt-repo"
url = "https://maven-eclipse.github.io/maven"
}
maven {
name = "jitpack.io"
url = "https://jitpack.io"
}
maven {
name = "brigadier"
url = "https://libraries.minecraft.net"
}
maven {
name = "tigr.dev"
url = "https://maven.tigr.dev"
metadataSources { // needed for baritone
mavenPom()
artifact()
ignoreGradleMetadataRedirection()
}
}
maven {
name = "spongepowered-repo"
url = "https://repo.spongepowered.org/repository/maven-public/"
}
maven {
name = "impactdevelopment-repo"
url = "https://impactdevelopment.github.io/maven/"
}
maven {
name = "Fabric"
url = "https://maven.fabricmc.net/"
}
}
}
subprojects {
apply plugin: "java"
group = project.modGroup
archivesBaseName = project.name
version = project.aresVersion
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_16
// copy artifacts to root build folder after build
tasks.getByName("build").doLast {
String version = project.name == "ares-installer" ? project.installerVersion : project.aresVersion
copy {
from "${project.rootProject.rootDir}/${project.name}/build/libs/${project.name}-$version-release.jar"
into "${project.rootProject.rootDir}/build"
}
}
}
task testForge(type: GradleBuild) {
group = "ares"
description = "builds the forge version of Ares, then copies the jar into the mods folder"
tasks = [":ares-forge:build"]
doLast {
copy {
from "build/ares-forge-${project.aresVersion}-release.jar"
into getModsFolder()
}
}
}
task testFabric(type: GradleBuild) {
group = "ares"
description = "builds the fabric version of Ares, then copies the jar into the mods folder"
tasks = [":ares-fabric:build"]
doLast {
copy {
from "build/ares-fabric-${project.aresVersion}-release.jar"
into getModsFolder()
}
}
}
task testFabric_1_16(type: GradleBuild) {
group = "ares"
description = "builds the fabric 1.16 version of Ares, then copies the jar into the mods folder"
tasks = [":ares-fabric-1.16:build"]
doLast {
copy {
from "build/ares-fabric-1.16-${project.aresVersion}-release.jar"
into getModsFolder()
}
}
}
task testFabric_1_17(type: GradleBuild) {
group = "ares"
description = "builds the fabric 1.17 version of Ares, then copies the jar into the mods folder"
tasks = [":ares-fabric-1.17:build"]
doLast {
copy {
from "build/ares-fabric-1.17-${project.aresVersion}-release.jar"
into getModsFolder()
}
}
}
task setupWorkspace(type: GradleBuild) {
group = "ares"
description = "sets up all development environments for all versions of ares"
tasks = [":ares-forge:classes", ":ares-fabric:genSources", ":ares-fabric-1.16:genSources", ":ares-fabric-1.17:genSources"]
}
private static String getModsFolder() {
if(System.getProperty("os.name").toLowerCase().contains("nux")) {
return System.getProperty("user.home") + "/.minecraft/mods/"
} else if(System.getProperty("os.name").toLowerCase().contains("darwin") || System.getProperty("os.name").toLowerCase().contains("mac")) {
return System.getProperty("user.home") + "/Library/Application Support/minecraft/mods/"
} else if(System.getProperty("os.name").toLowerCase().contains("win")) {
return System.getenv("APPDATA") + File.separator + ".minecraft" + File.separator + "mods" + File.separator
}
throw new RuntimeException("OS NOT FOUND")
}