-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.gradle.kts
77 lines (62 loc) · 2.42 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
75
76
77
@file:Suppress("UnstableApiUsage")
import org.ajoberstar.reckon.gradle.ReckonExtension
pluginManagement {
repositories {
gradlePluginPortal()
}
}
plugins {
id("org.ajoberstar.reckon.settings") version "0.19.1"
}
configure<ReckonExtension> {
setDefaultInferredScope("patch")
stages("rc", "final")
setScopeCalc(calcScopeFromProp().or(calcScopeFromCommitMessages()))
setStageCalc(calcStageFromProp())
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts") }
// repository providing ua.kasta:jsass
maven { url = uri("https://repo.clojars.org") }
}
}
rootProject.name = "scipamato"
val commonProjects = listOf(
"test", "utils", "entity", "persistence-api", "persistence-jooq-test", "persistence-jooq", "wicket"
)
val coreProjects = listOf(
"entity", "logic", "pubmed-api", "persistence-api", "persistence-jooq", "sync", "web"
)
val publicProjects = listOf("entity", "persistence-api", "persistence-jooq", "web")
fun scipamatoCommonProjects(modules: List<String>) = modules.map { "common-$it" }
fun scipamatoCoreProjects(modules: List<String>) = modules.map { "core-$it" }
fun scipamatoPublicProjects(modules: List<String>) = modules.map { "public-$it" }
fun scipamatoCommon(module: String) = "common".scipamatoModule(module)
fun scipamatoCore(module: String) = "core".scipamatoModule(module)
fun scipamatoPublic(module: String) = "public".scipamatoModule(module)
fun String.scipamatoModule(module: String) = ":$this-$module"
include(scipamatoCommonProjects(commonProjects))
include(scipamatoCoreProjects(coreProjects))
include(scipamatoPublicProjects(publicProjects))
includeBuild("gradle-plugins")
defineProjectPaths()
fun defineProjectPaths() {
mapOf(
"common" to commonProjects,
"core" to coreProjects,
"public" to publicProjects
).forEach { (subDir, projects) ->
projects.forEach { projectName ->
project(subDir.getPath(projectName)).projectDir = file("$subDir/$subDir-$projectName")
}
}
}
fun String.getPath(project: String): String = when (this) {
"common" -> scipamatoCommon(project)
"core" -> scipamatoCore(project)
"public" -> scipamatoPublic(project)
else -> throw IllegalArgumentException("project $project is not handled...")
}