-
Notifications
You must be signed in to change notification settings - Fork 7
/
settings.gradle.kts
56 lines (50 loc) · 2.03 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
/*
* Copyright © 2020 TomTom NV. All rights reserved.
*
* This software is the proprietary copyright of TomTom NV and its subsidiaries and may be
* used for internal evaluation purposes or commercial use strictly subject to separate
* license agreement between you and TomTom NV. If you are the licensee, you are only permitted
* to use this software in accordance with the terms of your license agreement. If you are
* not the licensee, you are not authorized to use this software in any manner and should
* immediately return or destroy it.
*/
rootProject.name = "IVI_Examples"
apply(from = "build-logic/repositories.gradle.kts")
apply(from = "build-logic/libraries.versioncatalog.gradle.kts")
apply(from = "build-logic/ividependencies.versioncatalog.gradle.kts")
/**
* Note:
* This configuration file is intended for TomTom internal use and not relevant
* to an external developer so it can be removed
*/
val cacheConfig: File = file("build-logic/cache.gradle.kts")
if (cacheConfig.exists()) {
apply(from = cacheConfig.path)
}
val templateAppDir = File(rootProject.projectDir, "template")
fileTree(templateAppDir)
.matching { include("**/build.gradle.kts") }
.forEach { file ->
val projectName = ":" + file.toProjectName(templateAppDir.parentFile)
include(projectName)
project(projectName).projectDir = file.parentFile
}
val optInToAlexaExamples = (extra.get("optInToAlexaExamples") as String).toBoolean()
val examplesDir = File(rootProject.projectDir, "examples")
if (examplesDir.exists()) {
fileTree(examplesDir)
.matching {
include("**/build.gradle.kts")
if (!optInToAlexaExamples) {
exclude("alexa/**")
}
}
.forEach { file ->
val projectName = ":" + file.toProjectName(examplesDir.parentFile)
include(projectName)
project(projectName).projectDir = file.parentFile
}
}
fun File.toProjectName(dir: File): String = dir.toPath()
.relativize(parentFile.toPath())
.joinToString("_")