-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsettings.gradle.kts
73 lines (65 loc) · 2.14 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
import me.champeau.gradle.igp.gitRepositories
import org.eclipse.jgit.api.Git
import java.io.FileInputStream
import java.util.Properties
include(":skill")
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
// not using version catalog because it is not available in settings.gradle.kts
id("me.champeau.includegit") version "0.1.6"
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
val localProperties = Properties().apply {
try {
load(FileInputStream(File(rootDir, "local.properties")))
} catch (e: Throwable) {
println("Warning: can't read local.properties: $e")
}
}
if (localProperties.getOrDefault("useLocalDicioLibraries", "") == "true") {
includeBuild("../dicio-numbers") {
dependencySubstitution {
substitute(module("git.included.build:dicio-numbers"))
.using(project(":numbers"))
}
}
} else {
// if the repo has already been cloned, the gitRepositories plugin is buggy and doesn't
// fetch the remote repo before trying to checkout the commit (in case the commit has changed),
// so we need to do it manually
val file = File("$rootDir/checkouts/dicio-numbers")
if (file.isDirectory) {
Git.open(file).fetch().call()
}
gitRepositories {
include("dicio-numbers") {
uri.set("https://github.com/Stypox/dicio-numbers")
// use the dummy version, except when specified differently in local.properties
val overrideCommit = localProperties.getOrDefault("dicioNumbersCommit", "").toString()
if (overrideCommit.isBlank()) {
tag.set("dummy-3")
} else {
commit.set(overrideCommit)
}
autoInclude.set(false)
includeBuild("") {
dependencySubstitution {
substitute(module("git.included.build:dicio-numbers"))
.using(project(":numbers"))
}
}
}
}
}