| 1 | <project name='REXML' default='build-dist' basedir='.'> |
|---|
| 2 | <property name='previous' value='1198'/> <!-- Previous minor release --> |
|---|
| 3 | <property name='last' value='844'/> <!-- Last major release --> |
|---|
| 4 | <!-- 3.1.0 993 --> |
|---|
| 5 | <!-- 3.0.0 844 --> |
|---|
| 6 | <!-- 2.7.0 806 --> |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | <!-- Build the API docs --> |
|---|
| 10 | <target name='api' depends='docs,properties'> |
|---|
| 11 | <property file='version.txt'/> |
|---|
| 12 | <filter token='ANT_VERSION' value='${tag}'/> |
|---|
| 13 | <filter token='ANT_DATE' value='${date}'/> |
|---|
| 14 | <delete dir='doc'/> |
|---|
| 15 | <mkdir dir='temp'/> |
|---|
| 16 | <copy todir='temp' filtering='true'> <fileset dir='src/rexml'/> </copy> |
|---|
| 17 | <exec executable='rdoc'> |
|---|
| 18 | <arg line='--main temp/rexml.rb --op doc --exclude .svn temp'/> |
|---|
| 19 | </exec> |
|---|
| 20 | <delete dir='temp'/> |
|---|
| 21 | </target> |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | <!-- Build the API doc archives --> |
|---|
| 25 | <target name='api-dist' depends='api,properties'> |
|---|
| 26 | <property file='version.txt'/> |
|---|
| 27 | <!-- Make a distribution directory and copy the docs to it --> |
|---|
| 28 | <mkdir dir='dist'/> |
|---|
| 29 | <mkdir dir='dist/rexml_${tag}'/> |
|---|
| 30 | <mkdir dir='dist/rexml_${tag}/doc'/> |
|---|
| 31 | <copy todir='dist/rexml_${tag}/doc'> <fileset dir='doc'/> </copy> |
|---|
| 32 | <tar tarfile='rexml_api_${tag}.tar' basedir='dist'/> |
|---|
| 33 | <gzip zipfile='rexml_api_${tag}.tgz' src='rexml_api_${tag}.tar'/> |
|---|
| 34 | <zip zipfile='rexml_api_${tag}.zip' basedir='dist'/> |
|---|
| 35 | <delete dir='dist'/> |
|---|
| 36 | <delete> |
|---|
| 37 | <fileset dir='.' includes='*.tar'/> |
|---|
| 38 | </delete> |
|---|
| 39 | </target> |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | <target name='dist.xml' depends='properties'> |
|---|
| 43 | <property file='version.txt'/> |
|---|
| 44 | <filter token='ANT_VERSION' value='${tag}'/> |
|---|
| 45 | <filter token='ANT_DATE' value='${date}'/> |
|---|
| 46 | <copy file='distributions/dist.xml' tofile='dist.xml' filtering='true'/> |
|---|
| 47 | </target> |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | <!-- Builds the distribution archive --> |
|---|
| 51 | <target name='dist' depends='dist.xml,docs,api,properties'> |
|---|
| 52 | <property file='version.txt'/> |
|---|
| 53 | <mkdir dir='dist'/> |
|---|
| 54 | <mkdir dir='dist/rexml_${tag}'/> |
|---|
| 55 | <filter token='ANT_VERSION' value='${tag}'/> |
|---|
| 56 | <filter token='ANT_DATE' value='${date}'/> |
|---|
| 57 | <copy todir='dist/rexml_${tag}'> |
|---|
| 58 | <fileset dir='.' excludes='**/.svn/**,*~' |
|---|
| 59 | includes='benchmarks/**,contrib/**,docs/**,img/**,test/**'/> |
|---|
| 60 | </copy> |
|---|
| 61 | <copy todir='dist/rexml_${tag}' filtering='true'> |
|---|
| 62 | <fileset dir='.' excludes='**/.svn/**,*~' |
|---|
| 63 | includes='dist.xml,src/**,bin/**,*.txt,*.html,README,INSTALL'/> |
|---|
| 64 | </copy> |
|---|
| 65 | <copy todir='dist/rexml_${tag}'> |
|---|
| 66 | <fileset dir='.' includes='doc/**'/> |
|---|
| 67 | </copy> |
|---|
| 68 | <tar tarfile='rexml_${tag}.tar' basedir='dist'/> |
|---|
| 69 | <gzip zipfile='rexml_${tag}.tgz' src='rexml_${tag}.tar'/> |
|---|
| 70 | <zip zipfile='rexml_${tag}.zip' basedir='dist'/> |
|---|
| 71 | <delete dir='dist'/> |
|---|
| 72 | <delete> |
|---|
| 73 | <fileset dir='.' includes='*.tar'/> |
|---|
| 74 | </delete> |
|---|
| 75 | </target> |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | <!-- Build the multi-paged documentation. This downloads the XSL stylesheets |
|---|
| 79 | from the repository (because ant's <style> task is too stupid to use |
|---|
| 80 | URLs), generates the various pages, then deletes the style sheets. --> |
|---|
| 81 | <target name='docs' depends='dist.xml'> |
|---|
| 82 | <get dest='paged.xsl' usetimestamp='true' |
|---|
| 83 | src='http://www.germane-software.com/repositories/public/documentation/paged.xsl'/> |
|---|
| 84 | <copy todir='.' filtering='true'> |
|---|
| 85 | <fileset dir='docs' includes='documentation.xml,tutorial.xml'/> |
|---|
| 86 | </copy> |
|---|
| 87 | |
|---|
| 88 | <echo>Styling index...</echo> |
|---|
| 89 | <exec executable="xsltproc" dir="."> |
|---|
| 90 | <arg value='-o'/> |
|---|
| 91 | <arg value='index.html'/> |
|---|
| 92 | <arg value="paged.xsl"/> |
|---|
| 93 | <arg value="documentation.xml"/> |
|---|
| 94 | </exec> |
|---|
| 95 | |
|---|
| 96 | <echo>Styling tutorial...</echo> |
|---|
| 97 | <exec executable="xsltproc" dir="."> |
|---|
| 98 | <arg value='-o'/> |
|---|
| 99 | <arg value='docs/tutorial.html'/> |
|---|
| 100 | <arg value="paged.xsl"/> |
|---|
| 101 | <arg value="tutorial.xml"/> |
|---|
| 102 | </exec> |
|---|
| 103 | |
|---|
| 104 | <delete> |
|---|
| 105 | <fileset dir='.' includes='paged.xsl,documentation.xml,tutorial.xml'/> |
|---|
| 106 | </delete> |
|---|
| 107 | </target> |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | <target name='web' depends='docs,api,logs,properties'> |
|---|
| 111 | <property file='version.txt'/> |
|---|
| 112 | <delete dir='dist'/> |
|---|
| 113 | <mkdir dir='dist'/> |
|---|
| 114 | <mkdir dir='dist/img'/> |
|---|
| 115 | <copy todir='dist/img' file='img/rexml.png'/> |
|---|
| 116 | <copy todir='dist/img' file='img/rexml_50p.png'/> |
|---|
| 117 | <filter token='ANT_VERSION' value='${tag}'/> |
|---|
| 118 | <filter token='ANT_DATE' value='${date}'/> |
|---|
| 119 | <copy todir='dist' overwrite='yes' filtering='true'> |
|---|
| 120 | <fileset dir='.' includes='rss.xml,dist.xml,*.html,LICENSE.txt,GPL.txt'/> |
|---|
| 121 | </copy> |
|---|
| 122 | <copy todir='dist'> |
|---|
| 123 | <fileset dir='.' includes='doc,docs/sloccount.txt,docs/tutorial.html,benchmarks/index.html'/> |
|---|
| 124 | </copy> |
|---|
| 125 | <copy todir='dist/doc'> <fileset dir='doc'/> </copy> |
|---|
| 126 | <tar tarfile='web.tar' basedir='dist'/> |
|---|
| 127 | <gzip zipfile='web.tgz' src='web.tar'/> |
|---|
| 128 | <delete file='web.tar'/> |
|---|
| 129 | <delete dir='dist'/> |
|---|
| 130 | </target> |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | <target name='clean'> |
|---|
| 134 | <delete> |
|---|
| 135 | <fileset dir='.' includes='dist.xml,*.tgz,*.zip,*.html,*~,version.txt'/> |
|---|
| 136 | </delete> |
|---|
| 137 | <delete> <fileset dir='doc'/> </delete> |
|---|
| 138 | <delete> |
|---|
| 139 | <fileset dir='docs' includes='credits.html,tutorial.html'/> |
|---|
| 140 | </delete> |
|---|
| 141 | </target> |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | <!-- The main task. We don't have to compile anything, so we just |
|---|
| 145 | build a bunch of documentation and some distribution archives. --> |
|---|
| 146 | <target name='build-dist' depends='api-dist,dist,docs,web'/> |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | <target name='logs' depends='properties'> |
|---|
| 150 | <property file='version.txt'/> |
|---|
| 151 | <echo>Generating logs...</echo> |
|---|
| 152 | <echo file='log.xml'><![CDATA[<log><previous>]]></echo> |
|---|
| 153 | <exec executable='svn' output='log.xml' append='true'> |
|---|
| 154 | <arg line='log --xml --incremental -r HEAD:${previous}'/> |
|---|
| 155 | </exec> |
|---|
| 156 | <echo file='log.xml' append='true'><![CDATA[</previous><last>]]></echo> |
|---|
| 157 | <exec executable='svn' output='log.xml' append='true'> |
|---|
| 158 | <arg line='log --xml --incremental -r ${previous}:${last}'/> |
|---|
| 159 | </exec> |
|---|
| 160 | <echo file='log.xml' append='true'><![CDATA[</last></log>]]></echo> |
|---|
| 161 | |
|---|
| 162 | <echo>Creating release document...</echo> |
|---|
| 163 | <style in='log.xml' out='release.html' style='styles/release_html.xsl'> |
|---|
| 164 | <param name='version' expression='${revision}'/> |
|---|
| 165 | <param name='release' expression='${tag}'/> |
|---|
| 166 | <param name='previous' expression='${previous}'/> |
|---|
| 167 | <param name='last' expression='${last}'/> |
|---|
| 168 | </style> |
|---|
| 169 | |
|---|
| 170 | <echo>Creating executive summary...</echo> |
|---|
| 171 | <style in='log.xml' out='executive.txt' style='styles/executive.xsl'> |
|---|
| 172 | <param name='version' expression='${revision}'/> |
|---|
| 173 | <param name='release' expression='${tag}'/> |
|---|
| 174 | <param name='previous' expression='${previous}'/> |
|---|
| 175 | <param name='last' expression='${last}'/> |
|---|
| 176 | </style> |
|---|
| 177 | |
|---|
| 178 | <echo>Creating RSS feed...</echo> |
|---|
| 179 | <echo>Generating RSS...</echo> |
|---|
| 180 | <exec executable="xsltproc" dir="."> |
|---|
| 181 | <arg value='-o'/> |
|---|
| 182 | <arg value='rss.xml'/> |
|---|
| 183 | <arg value="styles/rss.xsl"/> |
|---|
| 184 | <arg value="docs/documentation.xml"/> |
|---|
| 185 | </exec> |
|---|
| 186 | |
|---|
| 187 | <echo>Cleaning up...</echo> |
|---|
| 188 | <delete><fileset dir='.' includes='log.xml'/></delete> |
|---|
| 189 | </target> |
|---|
| 190 | |
|---|
| 191 | |
|---|
| 192 | <target name='properties'> |
|---|
| 193 | <exec executable='ruby' output='version.txt'> |
|---|
| 194 | <arg line='bin/info.rb'/> |
|---|
| 195 | </exec> |
|---|
| 196 | </target> |
|---|
| 197 | |
|---|
| 198 | </project> |
|---|