Skip to content

Commit b601101

Browse files
committed
quarkus-resteasy-reactive
1 parent c7c66ea commit b601101

File tree

2 files changed

+41
-19
lines changed

2 files changed

+41
-19
lines changed

instrumentation/quarkus-resteasy-reactive/quarkus2-testing/build.gradle.kts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,20 @@ val quarkusTestBaseRuntimeClasspathConfiguration by configurations.creating {
3838
val quarkusTestCompileOnlyConfiguration by configurations.creating {
3939
}
4040

41-
val testModelPath = layout.buildDirectory.file("quarkus-app-test-model.dat").get().asFile.toPath()
41+
val testModelPath = layout.buildDirectory.file("quarkus-app-test-model.dat")
4242

43-
val buildModel = tasks.register("buildModel") {
44-
dependsOn(configurations.named("testRuntimeClasspath"))
45-
46-
if (testModelPath.notExists()) {
43+
val buildModel = if (findProperty("skipTests") as String? != "true") {
44+
tasks.register("buildModel") {
45+
val modelPath = testModelPath.get().asFile.toPath()
46+
47+
inputs.files(configurations.named("testRuntimeClasspath"))
48+
outputs.file(testModelPath)
49+
50+
// Quarkus GradleApplicationModelBuilder requires Project at execution time
51+
notCompatibleWithConfigurationCache("Quarkus GradleApplicationModelBuilder.buildAll() requires Project reference")
52+
53+
onlyIf { modelPath.notExists() }
54+
4755
doLast {
4856
val modelParameter = ModelParameterImpl()
4957
modelParameter.mode = LaunchMode.TEST.toString()
@@ -52,17 +60,20 @@ val buildModel = tasks.register("buildModel") {
5260
modelParameter,
5361
project
5462
)
55-
BootstrapUtils.serializeAppModel(model as ApplicationModel?, testModelPath)
63+
BootstrapUtils.serializeAppModel(model as ApplicationModel?, modelPath)
5664
}
5765
}
58-
outputs.file(testModelPath)
66+
} else {
67+
null
5968
}
6069

6170
tasks {
6271
test {
63-
dependsOn(buildModel)
72+
if (buildModel != null) {
73+
dependsOn(buildModel)
74+
}
6475

65-
systemProperty("quarkus-internal-test.serialized-app-model.path", testModelPath.toString())
76+
systemProperty("quarkus-internal-test.serialized-app-model.path", testModelPath.get().asFile.toString())
6677
}
6778

6879
if (findProperty("denyUnsafe") as Boolean) {

instrumentation/quarkus-resteasy-reactive/quarkus3-testing/build.gradle.kts

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,20 @@ val quarkusTestBaseRuntimeClasspathConfiguration by configurations.creating {
4545
val quarkusTestCompileOnlyConfiguration by configurations.creating {
4646
}
4747

48-
val testModelPath = layout.buildDirectory.file("quarkus-app-test-model.dat").get().asFile.toPath()
49-
50-
val buildModel = tasks.register("buildModel") {
51-
dependsOn(configurations.named("testRuntimeClasspath"))
52-
53-
if (testModelPath.notExists()) {
48+
val testModelPath = layout.buildDirectory.file("quarkus-app-test-model.dat")
49+
50+
val buildModel = if (findProperty("skipTests") as String? != "true") {
51+
tasks.register("buildModel") {
52+
val modelPath = testModelPath.get().asFile.toPath()
53+
54+
inputs.files(configurations.named("testRuntimeClasspath"))
55+
outputs.file(testModelPath)
56+
57+
// Quarkus GradleApplicationModelBuilder requires Project at execution time
58+
notCompatibleWithConfigurationCache("Quarkus GradleApplicationModelBuilder.buildAll() requires Project reference")
59+
60+
onlyIf { modelPath.notExists() }
61+
5462
doLast {
5563
val modelParameter = ModelParameterImpl()
5664
modelParameter.mode = LaunchMode.TEST.toString()
@@ -59,17 +67,20 @@ val buildModel = tasks.register("buildModel") {
5967
modelParameter,
6068
project
6169
)
62-
BootstrapUtils.serializeAppModel(model as ApplicationModel?, testModelPath)
70+
BootstrapUtils.serializeAppModel(model as ApplicationModel?, modelPath)
6371
}
6472
}
65-
outputs.file(testModelPath)
73+
} else {
74+
null
6675
}
6776

6877
tasks {
6978
test {
70-
dependsOn(buildModel)
79+
if (buildModel != null) {
80+
dependsOn(buildModel)
81+
}
7182

72-
systemProperty("quarkus-internal-test.serialized-app-model.path", testModelPath.toString())
83+
systemProperty("quarkus-internal-test.serialized-app-model.path", testModelPath.get().asFile.toString())
7384
}
7485

7586
if (findProperty("denyUnsafe") as Boolean) {

0 commit comments

Comments
 (0)