forked from armilp02/Voiceless-Survival
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
101 lines (84 loc) · 2.99 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
plugins {
id 'fabric-loom' version '1.10-SNAPSHOT' apply false
id "com.modrinth.minotaur" version "2.+" apply false
id 'net.darkhax.curseforgegradle' version '1.1.+' apply false
}
subprojects {
if (project.name == "modules") {
tasks.configureEach {
enabled = false
}
return
}
// Apply the Java plugin to each sub-project
apply plugin: 'java'
// Java toolchain configuration
java {
toolchain {
// Set Java 17 for versions <= 1.20.1 for both main and test tasks
if (name == 'fabric_1.18.2' || name == 'fabric_1.19.2' || name == 'fabric_1.20.1') {
languageVersion = JavaLanguageVersion.of(17)
}
// Set Java 21 for versions >= 1.21+
else if (name.startsWith('fabric_1.') && name >= 'fabric_1.21') {
languageVersion = JavaLanguageVersion.of(21)
}
}
}
// Ensuring the correct Java version for the compileJava and compileTestJava tasks
tasks.withType(JavaCompile).configureEach {
if (project.name == 'fabric_1.18.2' || project.name == 'fabric_1.19.2' || project.name == 'fabric_1.20.1') {
it.options.release = 17
} else if (project.name.startsWith('fabric_1.') && project.name >= 'fabric_1.21') {
it.options.release = 21
}
}
// Configure repositories
repositories {
mavenCentral()
maven {
// Add curse maven to repositories
name = "Curse Maven"
url = "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
name = "Maxhenkel Repo"
url = 'https://maven.maxhenkel.de/repository/public'
}
maven {
name = "ImpactDev Repo"
url = 'https://maven.impactdev.net/repository/development/'
}
maven {
name = "Fuzs Mod Repo"
url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/"
}
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
maven { url = "https://mvn.devos.one/releases/" }
maven {
name = 'Sponge / Mixin'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
}
}
// Define the task to run the publicModdedSite task for specific subprojects
tasks.register('publicMod') {
group = "publishing"
description = "Runs the publicModdedSite task for specific subprojects"
def targetSubprojects = ["fabric_1.18.2", "fabric_1.19.2", "fabric_1.20.1", "fabric_1.21.1", "fabric_1.21.4"]
// Add dependencies for the specific subprojects
dependsOn subprojects.findAll { subproject ->
targetSubprojects.contains(subproject.name)
}.collect { subproject ->
":${subproject.path}:publicModdedSite"
}
}