Skip to content

Commit c506bf3

Browse files
committed
build: update for current gradle
1 parent 942944b commit c506bf3

File tree

5 files changed

+7
-21
lines changed

5 files changed

+7
-21
lines changed

platform/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ subprojects {
163163
useJUnitPlatform()
164164

165165
val isIntegrationProfile = System.getProperty("test.profile") == "integration"
166-
val runningSpecificTests = gradle.startParameter.taskNames.contains("--tests")
166+
val runningSpecificTests = gradle.startParameter.taskRequests.isNotEmpty()
167167
if (!isIntegrationProfile && !runningSpecificTests) {
168168
//exclude integration tests unless requested
169169
exclude("integration/**", "**/*IntegrationTest.class", "**/*ITTest.class")

platform/core/build.gradle.kts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,10 @@ tasks.getByName("assemble").dependsOn("shadowJar")
134134
tasks {
135135
test {
136136
val isIntegrationProfile = System.getProperty("test.profile") == "integration"
137-
val testsIndex = gradle.startParameter.taskNames.indexOf("--tests")
138-
var runningIntegrationTests = false
139-
if (testsIndex != -1) {
140-
val testName = gradle.startParameter.taskNames[testsIndex + 1]
141-
if (testName.contains("integration.") || testName.endsWith("IT")) {
142-
runningIntegrationTests = true
143-
}
144-
}
137+
val runningSpecificTests = gradle.startParameter.taskRequests.isNotEmpty()
145138

146139
//exclude attaching probe to self unless requested
147-
if (isIntegrationProfile || runningIntegrationTests) {
140+
if (isIntegrationProfile || runningSpecificTests) {
148141
dependsOn(":probes:jvm:boot:jar")
149142

150143
val probeJar = "${project(":probes:jvm:boot").buildDir}/libs/spp-probe-$version.jar"

platform/processor/live-insight/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ tasks {
9595

9696
//todo: should have way to distinguish tests that just need platform and tests that attach to self
9797
val isIntegrationProfile = System.getProperty("test.profile") == "integration"
98-
val runningSpecificTests = gradle.startParameter.taskNames.contains("--tests")
98+
val runningSpecificTests = gradle.startParameter.taskRequests.isNotEmpty()
9999

100100
//exclude attaching probe to self unless requested
101101
if (isIntegrationProfile || runningSpecificTests) {

platform/processor/live-instrument/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ tasks {
5656

5757
//todo: should have way to distinguish tests that just need platform and tests that attach to self
5858
val isIntegrationProfile = System.getProperty("test.profile") == "integration"
59-
val runningSpecificTests = gradle.startParameter.taskNames.contains("--tests")
59+
val runningSpecificTests = gradle.startParameter.taskRequests.isNotEmpty()
6060

6161
//exclude attaching probe to self unless requested
6262
if (isIntegrationProfile || runningSpecificTests) {

platform/processor/live-view/build.gradle.kts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,10 @@ dependencies {
7474
tasks {
7575
test {
7676
val isIntegrationProfile = System.getProperty("test.profile") == "integration"
77-
val testsIndex = gradle.startParameter.taskNames.indexOf("--tests")
78-
var runningIntegrationTests = false
79-
if (testsIndex != -1) {
80-
val testName = gradle.startParameter.taskNames[testsIndex + 1]
81-
if (testName.contains("integration.") || testName.endsWith("IT")) {
82-
runningIntegrationTests = true
83-
}
84-
}
77+
val runningSpecificTests = gradle.startParameter.taskRequests.isNotEmpty()
8578

8679
//exclude attaching probe to self unless requested
87-
if (isIntegrationProfile || runningIntegrationTests) {
80+
if (isIntegrationProfile || runningSpecificTests) {
8881
dependsOn(":probes:jvm:boot:jar")
8982

9083
val probeJar = "${project(":probes:jvm:boot").buildDir}/libs/spp-probe-$version.jar"

0 commit comments

Comments
 (0)