-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.gradle.kts
65 lines (59 loc) · 2.72 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
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/6.7/userguide/multi_project_builds.html
*/
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
}
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "jooqx-parent"
val profile: String by settings
val supportDatabases = arrayOf("db2", "h2", "mssql", "mysql", "oracle", "postgres", "sqlite")
var pp: Array<String> = arrayOf()
val pools = mutableMapOf(
"jpa" to arrayOf(":jpa-ext"),
"jooqx" to arrayOf(":jooqx", ":spi"),
"rsql" to arrayOf(":rsql:core", ":rsql:jooq"),
"integtest" to supportDatabases.map { ":integtest:${it}" }.toTypedArray(),
"sample" to arrayOf(":sample:web"),
)
val jooqxDocs = arrayOf(":docs:asciidoc", ":docs:testing-asciidoc")
val rsqlDocs = arrayOf(":rsql:asciidoc")
val excludeCISonar = jooqxDocs + rsqlDocs
val excludeCIBuild = pools["sample"]!! + pools["integtest"]!! + excludeCISonar
pools.putAll(
mapOf(
"jooqx:sonar" to pools["jooqx"]!!.plus(pools["integtest"]!!),
"jooqx:docs" to pools["jooqx"]!!.plus(":integtest:postgres").plus(jooqxDocs),
"rsql:sonar" to pools["rsql"]!!,
"rsql:docs" to pools["rsql"]!!.plus(pools["jooqx"]!!).plus(":integtest:postgres").plus(rsqlDocs)
)
)
fun flatten(): List<String> = pools.values.toTypedArray().flatten()
pp = when {
profile == "all" || profile.isBlank() -> flatten().toTypedArray()
profile == "ciBuild" -> flatten().filter { !excludeCIBuild.contains(it) }.toTypedArray()
else -> pools.getOrElse(profile) { throw IllegalArgumentException("Not found profile[$profile]") }
}
pp.forEach { include(it) }
if (pp.contains(":jooqx")) {
project(":jooqx").projectDir = file("core")
}
if (gradle is ExtensionAware) {
val extensions = (gradle as ExtensionAware).extensions
extensions.add("PROJECT_POOL", pools.toMap())
extensions.add("SKIP_PUBLISH", excludeCIBuild + arrayOf(":docs", ":rsql", ":sample", ":integtest"))
extensions.add("SAKILA_DB2", "${rootProject.projectDir}/sakila/db2-sakila-db")
extensions.add("SAKILA_ORACLE", "${rootProject.projectDir}/sakila/oracle-sakila-db")
extensions.add("SAKILA_MSSQL", "${rootProject.projectDir}/sakila/sql-server-sakila-db")
extensions.add("SAKILA_MYSQL", "${rootProject.projectDir}/sakila/mysql-sakila-db")
extensions.add("SAKILA_PG", "${rootProject.projectDir}/sakila/postgres-sakila-db")
extensions.add("SAKILA_SQLITE", "${rootProject.projectDir}/sakila/sqlite-sakila-db")
}