1- import org.labkey.gradle.util.BuildUtils ;
1+ import org.labkey.gradle.plugin.TeamCity
2+ import org.labkey.gradle.plugin.extension.ServerDeployExtension
3+ import org.labkey.gradle.plugin.extension.TeamCityExtension
4+ import org.labkey.gradle.util.BuildUtils
5+ import org.labkey.gradle.util.GroupNames
6+ import org.labkey.gradle.util.PropertiesUtils
7+
8+ import java.util.regex.Matcher
29
310repositories {
411 jcenter()
@@ -22,4 +29,34 @@ dependencies {
2229 external(" com.github.broadinstitute:picard:2.18.4" ) {
2330 exclude group : " javax.servlet" , module : " servlet-api"
2431 }
32+ }
33+
34+ if (project. findProject(BuildUtils . getTestProjectPath(project. gradle)) != null && project. hasProperty(" teamcity" ))
35+ {
36+ def testProject = project. findProject(BuildUtils . getTestProjectPath(project. gradle))
37+ def createPipelineConfigTask = project. tasks. register(" createPipelineConfig" , Copy ) {
38+ Copy task ->
39+ task. group = GroupNames . TEST_SERVER
40+ task. description = " Create pipeline configs for running tests on the test server"
41+ task. from project. file(" test/configs" )
42+ task. include " pipelineConfig.xml"
43+ task. filter({ String line ->
44+ Matcher matcher = PropertiesUtils . PROPERTY_PATTERN . matcher(line)
45+ def extension = testProject. extensions. findByType(TeamCityExtension . class)
46+ String newLine = line
47+ while (matcher. find())
48+ {
49+ if (matcher. group(1 ). equals(" SEQUENCEANALYSIS_CODELOCATION" ) || matcher. group(1 ). equals(" SEQUENCEANALYSIS_TOOLS" ))
50+ newLine = newLine. replace(matcher. group(), extension. getTeamCityProperty(" additional.pipeline.tools" ))
51+ else if (matcher. group(1 ). equals(" SEQUENCEANALYSIS_EXTERNALDIR" ))
52+ newLine = newLine. replace(matcher. group(), project. file(" pipeline_code/external" ). getAbsolutePath())
53+ }
54+ return newLine
55+
56+ })
57+ task. destinationDir = new File (" ${ ServerDeployExtension.getServerDeployDirectory(project)} /config" )
58+ }
59+ testProject. tasks. named(" startTomcat" ). configure {
60+ dependsOn(createPipelineConfigTask)
61+ }
2562}
0 commit comments