-
Notifications
You must be signed in to change notification settings - Fork 2
/
buildRelease.xml
118 lines (103 loc) · 3.63 KB
/
buildRelease.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<project basedir="." default="release">
<description>
This Ant build file generates a release package including only the
components required by end users to process ODDs, along with end-user
documentation.
</description>
<!-- Include ant-contrib. -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<!-- Used to make messages easier to separate. -->
<property name="echo.separator" value="************************************************"/>
<!-- Handy property for today's date (in W3C)-->
<tstamp>
<format property="today" pattern="yyyy-MM-dd"/>
</tstamp>
<!-- Get the current version number. -->
<loadfile property="versionRaw" srcfile="${basedir}/VERSION.txt"/>
<!-- Make it usable. -->
<propertyregex property="versionUntrimmed"
input="${versionRaw}"
regexp="\."
replace="_"
global="true" />
<!-- Trim any whitespace. -->
<propertyregex property="version"
input="${versionUntrimmed}"
regexp="\s+"
replace=""
defaultvalue="${versionUntrimmed}"
global="true" />
<echo message="${version}"/>
<!-- Build the folder/filename using date and version. -->
<property name="fName" value="atop_${version}_${today}"/>
<!-- Fileset of all the files we need for processing. -->
<fileset id="processingFiles" dir="${basedir}">
<include name="README.md"/>
<include name="VERSION.txt"/>
<include name="Util/**"/>
<include name="build.xml"/>
<include name="buildGlobals.xml"/>
<include name="LICENSE.md"/>
<include name="XSLT/assemble_relaxng.xslt"/>
<include name="XSLT/extract_schematron.xslt"/>
<include name="XSLT/transpile.xslt"/>
<include name="XSLT/modules/functions_module.xslt"/>
<include name="Schemas/ploddSchemaSpecification.rng"/>
<include name="Schemas/pre-transpile.sch"/>
<include name="Schemas/relaxng.rnc"/>
<include name="Schemas/schematron.rnc"/>
<include name="Schemas/schematron.sch"/>
<include name="Lib/**"/>
<exclude name="Lib/xspec/**"/>
</fileset>
<!-- Fileset of end-user documentation. TO BE CREATED. -->
<fileset id="documentation" dir="${basedir}">
<include name="Documentation/end-user/**"/>
</fileset>
<target name="clean">
<description>
TARGET clean
This creates the release folder if needed, or empties it
if it already exists.
</description>
<echo message="${echo.separator}"/>
<echo message="Setting up release build in release/${fName}..."/>
<mkdir dir="${basedir}/release/${fName}"/>
<delete includeemptydirs="true">
<fileset dir="${basedir}/release/${fName}">
<include name="*"/>
<include name="**/*"/>
</fileset>
</delete>
</target>
<target name="copyFiles">
<description>
TARGET copyFiles
Copies all required files to the release folder.
</description>
<echo message="${echo.separator}"/>
<echo message="Copying files..."/>
<copy todir="${basedir}/release/${fName}">
<fileset refid="processingFiles"/>
<fileset refid="documentation"/>
</copy>
</target>
<target name="zipResults">
<description>
TARGET zipResults
This creates a zip archive of the release package.
</description>
<echo message="${echo.separator}"/>
<echo message="Creating a zip archive."/>
<zip destfile="${basedir}/release/${fName}.zip" basedir="${basedir}/release/${fName}"/>
</target>
<target name="release">
<description>
TARGET release
This runs the entire process.
</description>
<antcall target="clean"/>
<antcall target="copyFiles"/>
<antcall target="zipResults"/>
</target>
</project>