| 1 |
<!-- Define a number of tasks and macros |
|---|
| 2 |
deftasks: define someuseful build tasks |
|---|
| 3 |
projectDefs: standard project definitions |
|---|
| 4 |
xMsg: x=info,debug etc. For message output |
|---|
| 5 |
|
|---|
| 6 |
Authors: Mike Douglass douglm rpi.edu |
|---|
| 7 |
--> |
|---|
| 8 |
|
|---|
| 9 |
<project name="do.deftasks" basedir="." default=""> |
|---|
| 10 |
<macrodef name="deftasks"> |
|---|
| 11 |
<sequential> |
|---|
| 12 |
<path id="build.cp"> |
|---|
| 13 |
<fileset dir="${build.dir}"> |
|---|
| 14 |
<include name="*.jar"/> |
|---|
| 15 |
</fileset> |
|---|
| 16 |
</path> |
|---|
| 17 |
|
|---|
| 18 |
<taskdef name="forEachApp" |
|---|
| 19 |
classname="org.bedework.deployment.ForEachAppTask"> |
|---|
| 20 |
<classpath refid="build.cp"/> |
|---|
| 21 |
</taskdef> |
|---|
| 22 |
|
|---|
| 23 |
<taskdef name="resolveFile" |
|---|
| 24 |
classname="org.bedework.deployment.ResolveFile"> |
|---|
| 25 |
<classpath refid="build.cp"/> |
|---|
| 26 |
</taskdef> |
|---|
| 27 |
|
|---|
| 28 |
<taskdef name="makeLangXsl" |
|---|
| 29 |
classname="org.bedework.deployment.MakeLangXsl"> |
|---|
| 30 |
<classpath refid="build.cp"/> |
|---|
| 31 |
</taskdef> |
|---|
| 32 |
|
|---|
| 33 |
<taskdef name="applicationXml" |
|---|
| 34 |
classname="org.bedework.deployment.ApplicationXmlTask"> |
|---|
| 35 |
<classpath refid="build.cp"/> |
|---|
| 36 |
</taskdef> |
|---|
| 37 |
</sequential> |
|---|
| 38 |
</macrodef> |
|---|
| 39 |
|
|---|
| 40 |
<macrodef name="projectDefs"> |
|---|
| 41 |
<attribute name="name"/> |
|---|
| 42 |
<attribute name="version"/> |
|---|
| 43 |
<attribute name="deployment-name" default=""/> |
|---|
| 44 |
<attribute name="no-default-libs" default="true"/> |
|---|
| 45 |
<attribute name="subproject" default="false"/> |
|---|
| 46 |
<sequential> |
|---|
| 47 |
<property name="project.name" value="@{name}"/> |
|---|
| 48 |
|
|---|
| 49 |
<property name="project.version" value="@{version}"/> |
|---|
| 50 |
|
|---|
| 51 |
<property name="dist.home" location="${project.home}/dist"/> |
|---|
| 52 |
<property name="lib.dir" location="${project.home}/lib"/> |
|---|
| 53 |
|
|---|
| 54 |
<property name="build.dir" location="${bedework.home}/build"/> |
|---|
| 55 |
|
|---|
| 56 |
<property name="buildjar" location="${build.dir}/buildTools/buildjar.xml"/> |
|---|
| 57 |
<property name="buildwar" location="${build.dir}/buildwar.xml"/> |
|---|
| 58 |
<property name="buildsh" location="${build.dir}/buildsh.xml"/> |
|---|
| 59 |
|
|---|
| 60 |
<property name="resources.dir" location="${project.home}/resources"/> |
|---|
| 61 |
|
|---|
| 62 |
<property name="org.bedework.libcache.dir" |
|---|
| 63 |
location="${bedework.home}/libcache"/> |
|---|
| 64 |
|
|---|
| 65 |
<if> |
|---|
| 66 |
<istrue value="@{subproject}" /> |
|---|
| 67 |
<then> |
|---|
| 68 |
<property name="source.home" location="${project.home}/src"/> |
|---|
| 69 |
</then> |
|---|
| 70 |
<else> |
|---|
| 71 |
<property name="org.bedework.temp.dir" |
|---|
| 72 |
location="${dist.home}/temp" /> |
|---|
| 73 |
|
|---|
| 74 |
<delete dir="${org.bedework.temp.dir}" /> |
|---|
| 75 |
<mkdir dir="${org.bedework.temp.dir}" /> |
|---|
| 76 |
|
|---|
| 77 |
<property name="org.bedework.deployment.name" |
|---|
| 78 |
value="@{deployment-name}" /> |
|---|
| 79 |
|
|---|
| 80 |
<property name="propval.app.no.defaultlibs" |
|---|
| 81 |
value="@{no-default-libs}" /> |
|---|
| 82 |
|
|---|
| 83 |
<deftasks/> |
|---|
| 84 |
</else> |
|---|
| 85 |
</if> |
|---|
| 86 |
</sequential> |
|---|
| 87 |
</macrodef> |
|---|
| 88 |
|
|---|
| 89 |
<macrodef name="build-jar"> |
|---|
| 90 |
<attribute name="module-base"/> |
|---|
| 91 |
<attribute name="jar-file"/> |
|---|
| 92 |
<attribute name="jar-dependency" default=""/> |
|---|
| 93 |
<attribute name="generated-sources" default=""/> |
|---|
| 94 |
<attribute name="property-resources" default=""/> |
|---|
| 95 |
|
|---|
| 96 |
<sequential> |
|---|
| 97 |
<if> |
|---|
| 98 |
<equals arg1="@{generated-sources}" arg2="" /> |
|---|
| 99 |
<then> |
|---|
| 100 |
<fileset id="buildjar.generated.java.sources" refid="empty.fileset" /> |
|---|
| 101 |
</then> |
|---|
| 102 |
<else> |
|---|
| 103 |
<fileset id="buildjar.generated.java.sources" dir="@{generated-sources}" > |
|---|
| 104 |
<include name="org/bedework/**/*.java"/> |
|---|
| 105 |
</fileset> |
|---|
| 106 |
</else> |
|---|
| 107 |
</if> |
|---|
| 108 |
|
|---|
| 109 |
<if> |
|---|
| 110 |
<equals arg1="@{property-resources}" arg2="" /> |
|---|
| 111 |
<then> |
|---|
| 112 |
<fileset id="buildjar.resource.files" refid="empty.fileset" /> |
|---|
| 113 |
</then> |
|---|
| 114 |
<else> |
|---|
| 115 |
<fileset id="buildjar.resource.files" dir="@{property-resources}" > |
|---|
| 116 |
<include name="**/*.properties"/> |
|---|
| 117 |
</fileset> |
|---|
| 118 |
</else> |
|---|
| 119 |
</if> |
|---|
| 120 |
|
|---|
| 121 |
<fileset id="buildjar.java.sources" dir="@{module-base}/src" > |
|---|
| 122 |
<include name="**/*.java"/> |
|---|
| 123 |
</fileset> |
|---|
| 124 |
|
|---|
| 125 |
<patternset id="base.class.patternset"> |
|---|
| 126 |
<include name="**/*.class"/> |
|---|
| 127 |
</patternset> |
|---|
| 128 |
|
|---|
| 129 |
<if> |
|---|
| 130 |
<not> |
|---|
| 131 |
<equals arg1="@{jar-dependency}" arg2="" /> |
|---|
| 132 |
</not> |
|---|
| 133 |
<then> |
|---|
| 134 |
<property name="build.jar.dependency" value="@{jar-dependency}" /> |
|---|
| 135 |
</then> |
|---|
| 136 |
</if> |
|---|
| 137 |
|
|---|
| 138 |
<ant antfile="${buildjar}" inheritRefs="true" target="build" > |
|---|
| 139 |
<property name="build.jar.file" location="@{jar-file}" /> |
|---|
| 140 |
</ant> |
|---|
| 141 |
</sequential> |
|---|
| 142 |
</macrodef> |
|---|
| 143 |
|
|---|
| 144 |
<macrodef name="infoMsg"> |
|---|
| 145 |
<attribute name="message"/> |
|---|
| 146 |
<sequential> |
|---|
| 147 |
<if> |
|---|
| 148 |
<not> |
|---|
| 149 |
<istrue value="${org.bedework.build.silent}" /> |
|---|
| 150 |
</not> |
|---|
| 151 |
<then> |
|---|
| 152 |
<echo message="@{message}" /> |
|---|
| 153 |
</then> |
|---|
| 154 |
</if> |
|---|
| 155 |
</sequential> |
|---|
| 156 |
</macrodef> |
|---|
| 157 |
|
|---|
| 158 |
<macrodef name="noisyMsg"> |
|---|
| 159 |
<attribute name="message"/> |
|---|
| 160 |
<sequential> |
|---|
| 161 |
<if> |
|---|
| 162 |
<istrue value="${org.bedework.build.noisy}" /> |
|---|
| 163 |
<then> |
|---|
| 164 |
<echo message="@{message}" /> |
|---|
| 165 |
</then> |
|---|
| 166 |
</if> |
|---|
| 167 |
</sequential> |
|---|
| 168 |
</macrodef> |
|---|
| 169 |
|
|---|
| 170 |
<macrodef name="debugMsg"> |
|---|
| 171 |
<attribute name="message"/> |
|---|
| 172 |
<sequential> |
|---|
| 173 |
<if> |
|---|
| 174 |
<istrue value="${org.bedework.build.debug}" /> |
|---|
| 175 |
<then> |
|---|
| 176 |
<echo message="@{message}" /> |
|---|
| 177 |
</then> |
|---|
| 178 |
</if> |
|---|
| 179 |
</sequential> |
|---|
| 180 |
</macrodef> |
|---|
| 181 |
|
|---|
| 182 |
<macrodef name="debugCpid"> |
|---|
| 183 |
<attribute name="idpar"/> |
|---|
| 184 |
<sequential> |
|---|
| 185 |
<if> |
|---|
| 186 |
<istrue value="${org.bedework.build.debug}" /> |
|---|
| 187 |
<then> |
|---|
| 188 |
<property name="cp" refid="@{idpar}" /> |
|---|
| 189 |
<echo message="***************cp: ${cp}"/> |
|---|
| 190 |
</then> |
|---|
| 191 |
</if> |
|---|
| 192 |
</sequential> |
|---|
| 193 |
</macrodef> |
|---|
| 194 |
</project> |
|---|