Skip to content

Commit 00a76b8

Browse files
Heng CuiHeng Cui
authored andcommitted
update gradle for automatic DeploymentOutput update
1 parent 0ab53b6 commit 00a76b8

1 file changed

Lines changed: 13 additions & 24 deletions

File tree

candyfloss/build.gradle

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,22 @@ dependencies {
6464

6565
test {
6666
useJUnitPlatform()
67+
systemProperty 'candyfloss.updateDeploymentResource', project.findProperty('updateDeploymentResource') ?: 'false'
6768
finalizedBy jacocoTestReport
6869
}
6970

71+
tasks.register('updateDeploymentResource', Test) {
72+
group = 'verification'
73+
description = 'Runs deployment tests and rewrites existing output files'
74+
useJUnitPlatform()
75+
testClassesDirs = sourceSets.test.output.classesDirs
76+
classpath = sourceSets.test.runtimeClasspath
77+
systemProperty 'candyfloss.updateDeploymentResource', 'true'
78+
filter {
79+
includeTestsMatching 'com.swisscom.daisy.cosmos.candyfloss.DeploymentTest'
80+
}
81+
}
82+
7083
jacocoTestReport {
7184
dependsOn test // tests are required to run before generating the report
7285
}
@@ -104,27 +117,3 @@ jib {
104117
mainClass = 'com.swisscom.daisy.cosmos.candyfloss.CandyflossKStreamsApplication'
105118
}
106119
}
107-
108-
/**
109-
* usage:
110-
* ./gradlew runPipelineRefinement --args="deployment application.dev.conf"
111-
* or
112-
* ./gradlew runPipelineRefinement --args="deployment-ietf-telemetry-message application.ietf.dev.conf"
113-
*/
114-
tasks.register('runPipelineRefinement', JavaExec) {
115-
group = 'devtools'
116-
description = 'Runs PipelineRefinement Helper'
117-
classpath = sourceSets.test.runtimeClasspath
118-
mainClass = 'com.swisscom.daisy.cosmos.candyfloss.PipelineRefinementHelper'
119-
120-
dependsOn tasks.testClasses
121-
122-
systemProperty 'testResourcesDir', file('src/test/resources').absolutePath
123-
124-
if (System.getProperty('deployment')) {
125-
systemProperty 'deployment', System.getProperty('deployment')
126-
}
127-
if (System.getProperty('config')) {
128-
systemProperty 'config', System.getProperty('config')
129-
}
130-
}

0 commit comments

Comments
 (0)