source: trunk/components/common.xml @ 5733

Revision 5733, 2.5 KB checked in by curtis, 10 years ago (diff)

Fix a problem with source tree paths containing spaces.

Line 
1<!--
2common.xml
3
4Ant build file for logic common to every component.
5All component build files inherit from this build file.
6Download Apache Ant from http://ant.apache.org/.
7Type "ant -p" for a list of targets.
8-->
9
10<project>
11  <import file="${root.dir}/global.xml"/>
12  <property file="${root.dir}/components/common.properties"/>
13
14  <!-- Main build targets -->
15
16  <target name="clean" description="remove all build files except artifacts">
17    <delete dir="${build.dir}"/>
18  </target>
19
20  <!-- Internal build targets -->
21
22  <target name="init-timestamp">
23    <tstamp>
24      <format property="DATE" pattern="d MMMMM yyyy"/>
25      <format property="YEAR" pattern="yyyy"/>
26    </tstamp>
27  </target>
28
29  <target name="init-revision">
30    <!-- determine SVN revision number -->
31    <if>
32      <isset property="svn.revision"/>
33      <else>
34        <!--
35        Thanks to Chris Collins for this code snippet:
36          http://ccollins.wordpress.com/2008/01/30/
37            getting-subversion-revision-in-ant/
38        -->
39        <exec executable="svn" outputproperty="svn.log"
40          failifexecutionfails="false">
41          <arg line="info &quot;${basedir}&quot;"/>
42        </exec>
43        <if>
44          <isset property="svn.log"/>
45          <then>
46            <propertyregex property="svn.revision"
47              input="${svn.log}" select="\1">
48              <regexp pattern="Revision: ([0-9]*)"/>
49            </propertyregex>
50            <!--<echo>SVN revision: ${svn.revision}</echo>-->
51          </then>
52        </if>
53      </else>
54    </if>
55  </target>
56
57  <target name="init-release">
58    <exec executable="svn" outputproperty="release.version"
59      failifexecutionfails="false">
60      <arg line="info &quot;${basedir}&quot;"/>
61    </exec>
62    <if>
63      <isset property="release.version"/>
64      <then>
65        <propertyregex property="svn.root"
66          input="${release.version}" select="\1">
67          <regexp pattern="Repository Root: (.*)"/>
68        </propertyregex>
69        <propertyregex property="release.version" override="true"
70          input="${release.version}" select="\1">
71          <regexp pattern="URL: ${svn.root}/(.*)/components/(.*)"/>
72        </propertyregex>
73        <propertyregex property="release.version" override="true"
74          input="${release.version}" regexp="branches/(.*)" replace="stable \1"
75          defaultValue="trunk"/>
76        <echo>Release version: ${release.version}</echo><!--TEMP-->
77        <!--<echo>Release version: ${release.version}</echo>-->
78      </then>
79    </if>
80  </target>
81
82</project>
Note: See TracBrowser for help on using the repository browser.