forked from SoftwareAG/webmethods-sample-project-layout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·85 lines (67 loc) · 3.77 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0"?>
<project name="testBuild" default="buildDeployTest" basedir=".">
<!-- project.properties -->
<property file="project.properties" />
<property name="testPackageNamePattern" value="*_Test" />
<target name="init.loadExternalProperties">
<description>We use this task to map externally defined environment variables and overwrite internal properties.
All environment variables which are prefixed with "ext." are loaded and stored as a property without the "ext." prefix.
This comes handy for example in Jenkins projects where you can now parameterize a build and thus override internal properties without having to change properties in the project itself each time.</description>
<echo message="Loading environment variables prefixed with 'ext.' as ant properties..."/>
<property environment="env" />
<echoproperties prefix="env"></echoproperties>
<!-- read in all properties which are prefixed with "ext." -->
<propertyset id="externalProperties">
<propertyref prefix="env.ext"/>
<mapper type="glob" from="env.ext.*" to="*"/>
</propertyset>
<script language="javascript">
project.references.externalProperties.getProperties().forEach(function(key, value) {
// replace property with new value from ext. property
project.setProperty(key, value);
});
</script>
</target>
<target name="init" depends="init.loadExternalProperties">
<echo message="---- init deployment" />
<echo message="---- Using deployment scripts from '${SAG_CI_HOME}'"/>
<echo message="---- Environment variables:"/>
<!-- remap the VCS structure defined in project.properties to have absolute paths -->
<property name="isProjectsDir" location="${config.assets.isPackages}" />
<property name="isTestDir" location="${config.assets.isTests}" />
<property name="bpmProjectsDir" location="${config.assets.bpmProjects}" />
<property name="mwsProjectsDir" location="${config.assets.mwsProjects}" />
<property name="rulesProjectsDir" location="${config.assets.rulesProjects}" />
<property name="umProjectsDir" location="${config.assets.umExport}" />
<property name="varsubDir" location="${config.deployer.varsubDir}" />
<property name="environmentsDefinition" location="${config.environments}"/>
<echoproperties prefix="env"/>
</target>
<target name="buildDeployTest" depends="init">
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="buildDeployTest" inheritAll="true" />
</target>
<target name="build" depends="init">
<echo message="---- starting build" />
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="build" inheritAll="true" />
</target>
<target name="prepareArtifactoryDownloadSpec" depends="init">
<echo message="---- Preparing file spec for Deployment" />
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="prepareArtifactoryDownloadSpec" inheritAll="true" />
</target>
<target name="prepareArtifactoryUploadSpec" depends="init">
<echo message="---- Preparing file spec for Publish" />
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="prepareArtifactoryUploadSpec" inheritAll="true" />
</target>
<target name="deploy" depends="init">
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="deploy" inheritAll="true" />
</target>
<target name="staticCodeAnalysis" depends="init">
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="staticCodeAnalysis" inheritAll="true" />
</target>
<target name="test" depends="init">
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="test" inheritAll="true" />
</target>
<target name="_TEST_test" depends="init">
<ant dir="${SAG_CI_HOME}" antfile="${SAG_CI_HOME}/build.xml" target="_TEST_startTest" inheritAll="true" />
</target>
</project>