Repository navigation
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
72 lines (64 loc) · 2.33 KB
/
Copy pathsettings.gradle.kts
File metadata and controls
72 lines (64 loc) · 2.33 KB
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
// (C) A.Voß, a.voss@fh-aachen.de, info@codebasedlearning.dev
import kotlin.io.path.*
pluginManagement {
// Our convention plugin 'fhac.android.conventions' (see build-logic). It sets compileSdk, minSdk,
// targetSdk and the JVM toolchain for all apps and libs; the values come from gradle.properties.
// An included build that provides plugins belongs here, inside pluginManagement.
includeBuild("build-logic")
repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Android-Concepts"
fun includeConcepts(vararg unitRoots: String) {
unitRoots.forEach { root ->
val rootPath = file("concepts/$root").toPath()
if (!rootPath.exists() || !rootPath.isDirectory()) return@forEach
rootPath.toFile().listFiles { f -> f.isDirectory }?.forEach { modDir ->
val hasBuild = modDir.toPath().resolve("build.gradle.kts").exists() ||
modDir.toPath().resolve("build.gradle").exists()
if (hasBuild) {
val gradlePath = ":$root-${modDir.name}"
println("found: $gradlePath")
include(gradlePath)
project(gradlePath).projectDir = modDir
}
}
}
}
includeConcepts(
"android_starters", "project_starters",
"composables", "navigation", "permissions",
"rest", "sensors", "database", "models", "preferences",
"dialogs", "testing", // [review] new: concepts/testing
"lifecycle", // [review] new: concepts/lifecycle
"libs"
)
/*
* For simple modules we usually have
* include(":FancyApp", ":Widgets", ":Db")
*
* In a project with folders we can use
* include(":FancyApp", ":Widgets", ":Db")
* project(":FancyApp").projectDir = file("Unit0x00/FancyApp")
* ...
* This is basically what includeConcepts does, it collects modules in folders.
*/