-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathbuild.gradle.kts
38 lines (34 loc) · 1.42 KB
/
build.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
plugins {
id("usvm.kotlin-conventions")
}
tasks.register("validateProjectList") {
group = "verification"
description = "Checks that the list of subprojects is exactly the expected."
doLast {
// Define the expected subprojects here.
val expectedProjects = setOf(
project(":usvm-core"),
project(":usvm-util"),
project(":usvm-dataflow"),
project(":usvm-sample-language"),
project(":usvm-jvm"),
project(":usvm-jvm-dataflow"),
project(":usvm-jvm-instrumentation"),
project(":usvm-python"),
project(":usvm-ts"),
project(":usvm-ts-dataflow"),
)
// Gather the actual subprojects from the current root project.
// Note: 'project.subprojects' is recursive!
val actualProjects = project.subprojects - project(":usvm-python").subprojects
// Compare and throw an error if something is missing or unexpected.
val missingProjects = expectedProjects - actualProjects
if (missingProjects.isNotEmpty()) {
throw GradleException("Missing subprojects (${missingProjects.size}): $missingProjects")
}
val unexpectedProjects = actualProjects - expectedProjects
if (unexpectedProjects.isNotEmpty()) {
throw GradleException("Unexpected subprojects (${unexpectedProjects.size}): $unexpectedProjects")
}
}
}