| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!-- |
| 3 |
Copyright (c) 2009, Takeyuki Nagao |
| 4 |
All rights reserved. |
| 5 |
|
| 6 |
Redistribution and use in source and binary forms, with or |
| 7 |
without modification, are permitted provided that the |
| 8 |
following conditions are met: |
| 9 |
|
| 10 |
* Redistributions of source code must retain the above |
| 11 |
copyright notice, this list of conditions and the |
| 12 |
following disclaimer. |
| 13 |
* Redistributions in binary form must reproduce the above |
| 14 |
copyright notice, this list of conditions and the |
| 15 |
following disclaimer in the documentation and/or other |
| 16 |
materials provided with the distribution. |
| 17 |
|
| 18 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND |
| 19 |
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 20 |
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 21 |
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 22 |
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
| 23 |
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 |
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 25 |
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 26 |
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 27 |
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 28 |
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 29 |
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE |
| 30 |
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY |
| 31 |
OF SUCH DAMAGE. |
| 32 |
--> |
| 33 |
<project basedir="." default="clean-package" name="dvibrowser"> |
| 34 |
<tstamp /> |
| 35 |
<property environment="env" /> |
| 36 |
<property name="build.dir" value="build" /> |
| 37 |
<property name="dist.dir" value="${build.dir}/dist" /> |
| 38 |
<property name="resource.dir" value="res" /> |
| 39 |
<property name="package-template.dir" value="${resource.dir}/package-template" /> |
| 40 |
<property name="pkg.zip.dir" value="${build.dir}/packages/dvibrowser" /> |
| 41 |
<property name="classes.dir" value="${build.dir}/classes" /> |
| 42 |
<property name="debuglevel" value="source,lines,vars" /> |
| 43 |
<property name="target" value="1.5" /> |
| 44 |
<property name="source" value="1.5" /> |
| 45 |
<property name="dvibrowser-app.jar" value="${dist.dir}/dvibrowser-app.jar" /> |
| 46 |
<property name="dvicore.jar" value="${dist.dir}/dvicore.jar" /> |
| 47 |
<property name="dvibrowser.jar" value="${dist.dir}/dvibrowser.jar" /> |
| 48 |
<property name="dvibrowser.zip" value="${dist.dir}/dvibrowser--build-${DSTAMP}-${TSTAMP}.zip" /> |
| 49 |
<property name="buildinfo.properties" value="${classes.dir}/dvi/browser/buildinfo.properties" /> |
| 50 |
|
| 51 |
<patternset id="files.dvibrowser-app"> |
| 52 |
<include name="dvi/browser/**" /> |
| 53 |
<exclude name="dvi/v2/**" /> |
| 54 |
<exclude name="dvi/browser/v2/**" /> |
| 55 |
<exclude name="test/**" /> |
| 56 |
</patternset> |
| 57 |
<patternset id="files.dvicore"> |
| 58 |
<include name="dvi/**" /> |
| 59 |
<exclude name="dvi/browser/**" /> |
| 60 |
<exclude name="dvi/launcher/**" /> |
| 61 |
<exclude name="dvi/v2/**" /> |
| 62 |
<exclude name="dvi/browser/v2/**" /> |
| 63 |
<exclude name="test/**" /> |
| 64 |
</patternset> |
| 65 |
<patternset id="files.dvibrowser"> |
| 66 |
<include name="dvi/util/*.*" /> |
| 67 |
<include name="dvi/*.*" /> |
| 68 |
<include name="dvi/api/*.*" /> |
| 69 |
<include name="dvi/launcher/**" /> |
| 70 |
<exclude name="dvi/v2/**" /> |
| 71 |
<exclude name="dvi/broswer/v2/**" /> |
| 72 |
<exclude name="test/**" /> |
| 73 |
</patternset> |
| 74 |
|
| 75 |
<path id="dvibrowser.classpath"> |
| 76 |
<pathelement location="${classes.dir}" /> |
| 77 |
</path> |
| 78 |
<target name="init"> |
| 79 |
<mkdir dir="${pkg.zip.dir}" /> |
| 80 |
<mkdir dir="${build.dir}" /> |
| 81 |
<mkdir dir="${classes.dir}" /> |
| 82 |
<copy includeemptydirs="false" todir="${classes.dir}"> |
| 83 |
<fileset dir="dvicore/java"> |
| 84 |
<exclude name="**/*.launch" /> |
| 85 |
<exclude name="**/*.java" /> |
| 86 |
</fileset> |
| 87 |
</copy> |
| 88 |
<copy includeemptydirs="false" todir="${classes.dir}"> |
| 89 |
<fileset dir="dvibrowser/java"> |
| 90 |
<exclude name="**/*.launch" /> |
| 91 |
<exclude name="**/*.java" /> |
| 92 |
</fileset> |
| 93 |
</copy> |
| 94 |
</target> |
| 95 |
<target name="clean"> |
| 96 |
<delete dir="${pkg.zip.dir}" /> |
| 97 |
<delete dir="${build.dir}" /> |
| 98 |
<delete dir="${classes.dir}" /> |
| 99 |
<delete dir="${dist.dir}" /> |
| 100 |
</target> |
| 101 |
<target depends="clean" name="cleanall" /> |
| 102 |
<target depends="build-subprojects,build-project" name="build" /> |
| 103 |
<target name="build-subprojects" /> |
| 104 |
<target depends="init" name="build-project"> |
| 105 |
<echo message="${ant.project.name}: ${ant.file}" /> |
| 106 |
<javac debug="true" debuglevel="${debuglevel}" destdir="${classes.dir}" source="${source}" target="${target}"> |
| 107 |
<src path="dvicore/java"> |
| 108 |
</src> |
| 109 |
<exclude name="test/**" /> |
| 110 |
<classpath refid="dvibrowser.classpath" /> |
| 111 |
</javac> |
| 112 |
<javac debug="true" debuglevel="${debuglevel}" destdir="${classes.dir}" source="${source}" target="${target}"> |
| 113 |
<src path="dvibrowser/java"> |
| 114 |
</src> |
| 115 |
<exclude name="test/**" /> |
| 116 |
<classpath refid="dvibrowser.classpath" /> |
| 117 |
</javac> |
| 118 |
<javac debug="true" debuglevel="${debuglevel}" destdir="${classes.dir}" source="${source}" target="${target}"> |
| 119 |
<src path="scratch/java"> |
| 120 |
</src> |
| 121 |
<exclude name="test/**" /> |
| 122 |
<classpath refid="dvibrowser.classpath" /> |
| 123 |
</javac> |
| 124 |
<propertyfile file="${buildinfo.properties}"> |
| 125 |
<entry key='build-id' value='${DSTAMP}-${TSTAMP}' /> |
| 126 |
</propertyfile> |
| 127 |
</target> |
| 128 |
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects" /> |
| 129 |
<target name="clean-package" depends="clean,package"> |
| 130 |
</target> |
| 131 |
<target name="package" depends="build"> |
| 132 |
<mkdir dir="${dist.dir}" /> |
| 133 |
<jar jarfile="${dvibrowser.jar}" manifest="${resource.dir}/dvibrowser.manifest"> |
| 134 |
<fileset dir="${classes.dir}"> |
| 135 |
<patternset refid="files.dvibrowser"/> |
| 136 |
</fileset> |
| 137 |
</jar> |
| 138 |
<jar jarfile="${dvibrowser-app.jar}"> |
| 139 |
<fileset dir="${classes.dir}"> |
| 140 |
<patternset refid="files.dvibrowser-app"/> |
| 141 |
</fileset> |
| 142 |
</jar> |
| 143 |
<jar jarfile="${dvicore.jar}"> |
| 144 |
<fileset dir="${classes.dir}"> |
| 145 |
<patternset refid="files.dvicore"/> |
| 146 |
</fileset> |
| 147 |
</jar> |
| 148 |
<copy todir="${pkg.zip.dir}"> |
| 149 |
<fileset dir="${package-template.dir}" /> |
| 150 |
<fileset file="${dvibrowser.jar}" /> |
| 151 |
</copy> |
| 152 |
<copy todir="${pkg.zip.dir}/lib/java"> |
| 153 |
<fileset file="${dvibrowser-app.jar}" /> |
| 154 |
<fileset file="${dvicore.jar}" /> |
| 155 |
</copy> |
| 156 |
<zip destfile="${dvibrowser.zip}" update='true'> |
| 157 |
<fileset dir="${pkg.zip.dir}" /> |
| 158 |
</zip> |
| 159 |
</target> |
| 160 |
</project> |