-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.gradle.kts
74 lines (63 loc) · 2.32 KB
/
settings.gradle.kts
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
pluginManagement {
repositories {
maven {
name = "Quilt"
setUrl("https://maven.quiltmc.org/repository/release/")
}
maven {
name = "Quilt Snapshot"
setUrl("https://maven.quiltmc.org/repository/snapshot/")
}
maven {
name = "Fabric"
setUrl("https://maven.fabricmc.net/")
}
maven {
name = "Forge"
setUrl("https://files.minecraftforge.net/maven/")
}
maven {
name = "Jitpack"
setUrl("https://jitpack.io/")
}
mavenCentral()
gradlePluginPortal()
}
}
rootProject.name = "Configurable Everything"
localRepository("FrozenLib", "maven.modrinth:frozenlib", true)
fun localRepository(repo: String, dependencySub: String, kotlin: Boolean) {
println("Attempting to include local repo $repo")
val github = System.getenv("GITHUB_ACTIONS") == "true"
val allowLocalRepoUse = false
val allowLocalRepoInConsoleMode = true
val androidInjectedInvokedFromIde by extra("android.injected.invoked.from.ide")
val xpcServiceName by extra("XPC_SERVICE_NAME")
val ideaInitialDirectory by extra("IDEA_INITIAL_DIRECTORY")
val isIDE = androidInjectedInvokedFromIde != "" || (System.getenv(xpcServiceName) ?: "").contains("intellij") || (System.getenv(xpcServiceName) ?: "").contains(".idea") || System.getenv(ideaInitialDirectory) != null
var path = "../$repo"
var file = File(path)
val prefixedRepoName = ":$repo"
if (allowLocalRepoUse && (isIDE || allowLocalRepoInConsoleMode)) {
if (github) {
path = repo
file = File(path)
println("Running on GitHub")
}
if (file.exists()) {
/*includeBuild(path) {
dependencySubstitution {
if (dependencySub != "") {
substitute(module(dependencySub)).using(project(":"))
}
}
}*/
include(prefixedRepoName)
project(prefixedRepoName).projectDir = file
project(prefixedRepoName).buildFileName = "./build.gradle" + if (kotlin) ".kts" else ""
println("Included local repo $repo")
} else {
println("Local repo $repo not found")
}
}
}