-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathsettings.gradle
113 lines (107 loc) · 3.67 KB
/
settings.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
pluginManagement {
repositories {
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'Forge'
url = 'https://maven.minecraftforge.net/'
}
maven {
name = 'NeoForge'
url = 'https://maven.neoforged.net/releases'
}
maven {
name = 'Parchment'
url = 'https://maven.parchmentmc.org/'
}
maven {
name = 'Spongepowered (Mixin)'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
name = 'ModPublisher https://github.com/firstdarkdev/modpublisher'
url "https://maven.firstdark.dev/releases"
}
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}
rootProject.name = "${mod_id}"
if(file("${rootDir}/api").exists()) {//Check if API folder exists, if it does, include it
include 'api'
}
include 'common'
include 'fabric'
include 'forge'
include 'neoforge'
if (!"${mod_id}".toString().equals("ichunutil")) { // We're either a mod that depends on iChunUtil or we're in a composite build for multiple mods
if ("${mod_id}".toString().equals("all")) {
def excludedMods = [
// "BetterThanBunnies",
// "BetterThanLlamas",
// "CCI1.x",
// "ContentCreatorIntegration",
// "DeathCounter",
// "Ding",
// "HotbarSwapper",
// "LetSleepingDogsLie",
// "LimitedLives",
// "PartyParrots",
// "ServerPause",
"ZeePlaceholder"
]
gradle.ext.projectSubMods = []
file("${rootDir}/..").eachDir {
if(!it.equals(rootDir) && !it.name.toLowerCase(Locale.ROOT).startsWith("temp") && !excludedMods.contains(it.name) && file("${rootDir}/../${it.name}/build.gradle").exists() && file("${rootDir}/../${it.name}/build.cmd").exists()) {
println "Including ${it.name} in build!"
gradle.ext.projectSubMods.add(it.name)
}
}
}
else {
gradle.ext {
// Add any mods if you'd like if you're not in an "all" composite build. Just be aware it will add to gradle setup time.
projectSubMods = [
"iChunUtil" // Do not comment out - You will have a bad time.
]
}
}
if (!gradle.ext.projectSubMods.contains("iChunUtil") || !file("../iChunUtil").exists()) {
println "\u001B[31m=====================================================================\u001B[0m"
println "\u001B[31mCannot find iChunUtil in list of sub-mods! \u001B[0m"
println "\u001B[31mDouble check your settings.gradle file and make sure iChunUtil exists\u001B[0m"
println "\u001B[31m=====================================================================\u001B[0m"
}
else {
gradle.ext.projectSubMods.forEach { mod ->
if (file("../${mod}").exists()) {
includeBuild("../${mod}") {
def modIdLowerCase = "${mod}".toString().toLowerCase(Locale.ROOT)
name = modIdLowerCase
dependencySubstitution {
//I won't know the mod version. We special case for composite builds anyway
if(file("../${mod}/api").exists()) {
substitute module("me.ichun.mods:${modIdLowerCase}:api") using project(":api")
}
substitute module("me.ichun.mods:${modIdLowerCase}:common") using project(":common")
substitute module("me.ichun.mods:${modIdLowerCase}:fabric") using project(":fabric")
substitute module("me.ichun.mods:${modIdLowerCase}:forge") using project(":forge")
substitute module("me.ichun.mods:${modIdLowerCase}:neoforge") using project(":neoforge")
}
}
}
else {
println "${mod} defined as included build in composite build but directory cannot be found!"
}
}
}
}
// If this repo exists then we pull out changelogs and versions from here - allows for centralized repo for them. Yes, I'm lazy
if (file("../AllChangelogs").exists()) {
includeBuild("../AllChangelogs")
}