-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-Buildfile.xml
50 lines (30 loc) · 2.26 KB
/
build-Buildfile.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Buildfile" >
<target name="help" description="Help for managing build files">
<echo>
-- Build file management --
freeze: Create a standalone version of the project by replacing the current build file
by a standalone core build file.
The existing build.xml file is renamed into "build.alternate"
This is usefull for making a project independent from the Hmi build framework,
and can be used for "finalized/frozen" projects, or for standalone student projects.
alternate: "swaps" the current build.xml and build.alternate files.
Useful for switching between two different build systems,
like the Netbeans build and the ant build,
or for testing the standalone version created by means of "ant freeze".
</echo>
</target>
<property name="alternate.build.file" value="build.alternate"/>
<available property="alternate.available" file="${alternate.build.file}"/>
<target name="freeze" depends="init" description="Replaces current local build file by standalone core build file">
<fail message="Existing ${alternate.build.file} found" if="alternate.available"/>
<move file="build.xml" tofile="${alternate.build.file}" failonerror="false" />
<copy file="${shared.ant.dir}/build-${language}.xml" tofile="build-${language}.xml" overwrite="false"/>
<copy file="${shared.ant.dir}/build-Util.xml" tofile="build-Util.xml" overwrite="false"/>
<copy file="${shared.ant.dir}/build_frozen.xml" tofile="build.xml" overwrite="false"/>
<copy file="${shared.ant.dir}/ant-contrib-1.0b3.jar" tofile="ant-contrib-1.0b3.jar" overwrite="false"/>
<replaceregexp file="build.xml" match="(<project[ ]+name=")(.*?)"" replace="\1${ant.project.name}"" byline="true" flags="g" />
<replaceregexp file="build-${language}.xml" match="(<project[ ]+name=")(.*?)"" replace="\1${ant.project.name}"" byline="true" flags="g" />
<replaceregexp file="build-Util.xml" match="(<project[ ]+name=")(.*?)"" replace="\1${ant.project.name}"" byline="true" flags="g" />
</target>
</project>