File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,9 @@ jobs:
147
147
- name : Setup Gradle
148
148
uses : gradle/actions/setup-gradle@v4
149
149
150
+ - name : Validate Project List
151
+ run : ./gradlew validateProjectList
152
+
150
153
- name : Run Detekt
151
154
run : ./gradlew detektMain detektTest
152
155
Original file line number Diff line number Diff line change 1
1
plugins {
2
2
id(" usvm.kotlin-conventions" )
3
3
}
4
+
5
+ tasks.register(" validateProjectList" ) {
6
+ group = " verification"
7
+ description = " Checks that the list of subprojects is exactly the expected."
8
+
9
+ doLast {
10
+ // Define the expected subprojects here.
11
+ val expectedProjects = setOf (
12
+ project(" :usvm-core" ),
13
+ project(" :usvm-util" ),
14
+ project(" :usvm-dataflow" ),
15
+ project(" :usvm-sample-language" ),
16
+ project(" :usvm-jvm" ),
17
+ project(" :usvm-jvm-dataflow" ),
18
+ project(" :usvm-jvm-instrumentation" ),
19
+ project(" :usvm-python" ),
20
+ project(" :usvm-ts" ),
21
+ project(" :usvm-ts-dataflow" ),
22
+ )
23
+
24
+ // Gather the actual subprojects from the current root project.
25
+ // Note: 'project.subprojects' is recursive!
26
+ val actualProjects = project.subprojects - project(" :usvm-python" ).subprojects
27
+
28
+ // Compare and throw an error if something is missing or unexpected.
29
+ val missingProjects = expectedProjects - actualProjects
30
+ if (missingProjects.isNotEmpty()) {
31
+ throw GradleException (" Missing subprojects (${missingProjects.size} ): $missingProjects " )
32
+ }
33
+ val unexpectedProjects = actualProjects - expectedProjects
34
+ if (unexpectedProjects.isNotEmpty()) {
35
+ throw GradleException (" Unexpected subprojects (${unexpectedProjects.size} ): $unexpectedProjects " )
36
+ }
37
+ }
38
+ }
You can’t perform that action at this time.
0 commit comments