11<?xml version =" 1.0" encoding =" UTF-8" ?>
22<project default =" xar" name =" conferences" basedir =" ." >
3- <xmlproperty file =" build.properties.xml" semanticAttributes =" true" keepRoot =" false" />
4- <property name =" build.dir" value =" build" />
5- <property name =" git.repo.path" value =" ${ basedir } /.git" />
6- <available file =" ${ git.repo.path } " type =" dir" property =" git.present" />
3+ <xmlproperty file =" build.properties.xml" semanticAttributes =" true" keepRoot =" false" />
4+ <property name =" build.dir" value =" build" />
5+ <property name =" git.repo.path" value =" ${ basedir } /.git" />
6+ <available file =" ${ git.repo.path } " type =" dir" property =" git.present" />
7+
8+ <condition property =" is-release" >
9+ <equals arg1=" ${ release } " arg2=" true" />
10+ </condition >
11+
12+ <target name =" release.true" if =" is-release" >
13+ <echo >Calculating git revision info for release</echo >
14+ </target >
15+
16+ <target name =" release.false" unless =" is-release" >
17+ <echo >Not a release, moving on ...</echo >
18+ </target >
19+
20+ <target name =" check-release" depends =" release.true, release.false" >
21+ </target >
722
823 <target name =" clean" >
9- <echo message =" Deleting xar files..." />
10- <delete dir =" ${ build.dir } " failonerror =" false" />
11- <delete file =" ${ basedir } /expath-pkg.xml" failonerror =" false" />
12- <delete file =" ${ basedir } /repo.xml" failonerror =" false" />
24+ <echo message =" Deleting xar files..." />
25+ <delete dir =" ${ build.dir } " failonerror =" false" />
1326 </target >
14-
15- <target name =" xar" depends =" clean,git.revision" description =" create xar file" >
16- <echo message =" Creating build folder..." />
17- <mkdir dir =" ${ build.dir } " />
1827
19- <echo message =" Apply values to expath-pkg.xml..." />
28+ <target name =" templates" description =" process template files" if =" is-release"
29+ depends =" git.revision" >
30+ <echo message =" Apply values to .tmpl ..." />
2031 <copy todir =" ${ basedir } " overwrite =" true" verbose =" true" >
21- <fileset file =" *.xml.tmpl" />
32+ <fileset file =" *.xml.tmpl" />
2233 <filterchain >
2334 <replacetokens >
24- <token key =" name" value =" ${ app.name } " />
25- <token key =" version" value =" ${ app.version } " />
26- <token key =" url" value =" ${ app.url } " />
27- <token key =" title" value =" ${ app.title } " />
28- <token key =" commit-id" value =" ${ git.revision } " />
29- <token key =" commit-time" value =" ${ git.time } " />
35+ <token key =" name" value =" ${ app.name } " />
36+ <token key =" version" value =" ${ app.version } " />
37+ <token key =" url" value =" ${ app.url } " />
38+ <token key =" title" value =" ${ app.title } " />
39+ <token key =" commit-id" value =" ${ git.revision } " />
40+ <token key =" commit-time" value =" ${ git.time } " />
3041 </replacetokens >
3142 <tokenfilter >
32- <!-- until we move template processing to XSLT, take care with reserved characters -->
33- <replacestring from =" &" to =" &amp;" />
43+ <!-- until we move template processing to XSLT, take care with reserved
44+ characters -->
45+ <replacestring from =" &" to =" &amp;" />
3446 </tokenfilter >
3547 </filterchain >
36- <globmapper from =" *.tmpl" to =" *" />
48+ <globmapper from =" *.tmpl" to =" *" />
3749 </copy >
50+ </target >
51+
52+ <target name =" xar" depends =" clean,check-release,git.revision,templates"
53+ description =" create xar file" >
54+ <echo message =" Creating build folder..." />
55+ <mkdir dir =" ${ build.dir } " />
56+
57+ <echo message =" ------------------------------------------------------------" />
58+ <echo message =" Creating xar file..." />
59+ <echo message =" ------------------------------------------------------------" />
3860
39- <echo message =" ------------------------------------------------------------" />
40- <echo message =" Creating xar file..." />
41- <echo message =" ------------------------------------------------------------" />
42-
4361 <zip basedir =" ${ basedir } " destfile =" ${ build.dir } /${ app.name } .xar" >
44- <exclude name =" ${ build.dir } /**" />
45- <exclude name =" *.tmpl" />
46- <exclude name =" .github/**" />
47- <exclude name =" test/**" />
48- <exclude name =" node_modules/**" />
62+ <exclude name =" ${ build.dir } /**" />
63+ <exclude name =" *.tmpl" />
64+ <exclude name =" .github/**" />
65+ <exclude name =" test/**" />
66+ <exclude name =" node_modules/**" />
4967 </zip >
50- <echo >Version: ${ app.version } </echo >
68+ <echo >Version: ${ app.version } </echo >
5169 </target >
5270
53- <target name =" git.revision" description =" Store git revision in ${ repository.version } " if =" git.present" >
54- <exec executable =" git" outputproperty =" git.revision" failifexecutionfails =" false" errorproperty =" " >
55- <arg value =" --git-dir=${ git.repo.path } " />
56- <arg value =" rev-parse" />
57- <arg value =" HEAD" />
71+ <target name =" git.revision" description =" Store git revision in ${ repository.version } "
72+ if =" is-release" depends =" check-release" >
73+ <exec executable =" git" outputproperty =" git.revision" failifexecutionfails =" false"
74+ errorproperty =" " >
75+ <arg value =" --git-dir=${ git.repo.path } " />
76+ <arg value =" rev-parse" />
77+ <arg value =" HEAD" />
5878 </exec >
5979 <condition property =" repository.version" value =" ${ git.revision } " else =" unknown" >
6080 <and >
61- <isset property =" git.revision" />
62- <length string =" ${ git.revision } " trim =" yes" length =" 0" when =" greater" />
81+ <isset property =" git.revision" />
82+ <length string =" ${ git.revision } " trim =" yes" length =" 0" when =" greater" />
6383 </and >
6484 </condition >
6585 <echo >Git repo: ${ repository.version } </echo >
66-
67- <exec executable =" git" outputproperty =" git.time" failifexecutionfails =" false" errorproperty =" " >
68- <arg value =" --git-dir=${ git.repo.path } " />
69- <arg value =" show" />
70- <arg value =" -s" />
71- <arg value =" --format=%ct" />
72- <arg value =" ${ git.revision } " />
86+
87+ <exec executable =" git" outputproperty =" git.time" failifexecutionfails =" false"
88+ errorproperty =" " >
89+ <arg value =" --git-dir=${ git.repo.path } " />
90+ <arg value =" show" />
91+ <arg value =" -s" />
92+ <arg value =" --format=%ct" />
93+ <arg value =" ${ git.revision } " />
7394 </exec >
7495 <echo >Git time: ${ git.time } </echo >
75- </target >
76- </project >
96+
97+ </target >
98+ </project >
0 commit comments