Ignore:
Timestamp:
Feb 17, 2011 12:47:35 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
d59e3f9
Parents:
a3d466e
Message:
  • Build:
    • Add includeAntRuntime=false to all javac targets
    • Add build date, mtn rev, and changed file list to all manifests
    • Add unless=uptodate to all jar and war targets (bob and dtg still todo)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/addressbook/build.xml

    ra3d466e rfd91927c  
    3939        <target name="compile" depends="init, depend">
    4040                <javac debug="true" deprecation="on" source="1.5" target="1.5"
     41                       includeAntRuntime="false"
    4142                       srcdir="${src}" destdir="${build}">
    4243            <compilerarg line="${javac.compilerargs}" />
     
    4849        </target>
    4950
    50         <target name="jar" depends="compile">
     51        <!-- unused for now, as we oddly ship addressbook as a .war -->
     52        <target name="jar" depends="compile, changes">
    5153                <jar basedir="${build}" destfile="${dist}/${jar}">
    5254                        <manifest>
    5355                                <attribute name="Main-Class" value="addressbook.Daemon"/>
     56                                <attribute name="Build-Date" value="${build.timestamp}" />
     57                                <attribute name="Base-Revision" value="${workspace.version}" />
     58                                <attribute name="Workspace-Changes" value="${workspace.changes}" />
    5459                        </manifest>
    5560                </jar>
    5661        </target>
    5762       
    58         <target name="war" depends="compile" unless="war.uptodate">
     63        <target name="war" depends="compile, changes, warUpToDate" unless="war.uptodate">
    5964                <mkdir dir="${dist}/tmp"/>
    6065                <mkdir dir="${dist}/tmp/WEB-INF"/>
     
    6368                        <fileset dir="${build}"/>
    6469                </copy>
    65                 <war basedir="${dist}/tmp" webxml="web.xml" destfile="${dist}/${war}"/>
     70                <war basedir="${dist}/tmp" webxml="web.xml" destfile="${dist}/${war}">
     71                        <manifest>
     72                                <attribute name="Build-Date" value="${build.timestamp}" />
     73                                <attribute name="Base-Revision" value="${workspace.version}" />
     74                                <attribute name="Workspace-Changes" value="${workspace.changes.tr}" />
     75                        </manifest>
     76                </war>
    6677                <delete dir="${dist}/tmp"/>
    6778        </target>
    6879       
    69         <uptodate property="war.uptodate" targetfile="${dist}/${war}">
    70             <srcfiles dir= "." includes="${build}/**/*.class, web.xml"/>
    71         </uptodate>
     80        <target name="warUpToDate">
     81                <uptodate property="war.uptodate" targetfile="${dist}/${war}">
     82                            <srcfiles dir= "." includes="${build}/**/*.class, web.xml"/>
     83                </uptodate>
     84        </target>
    7285
     86        <target name="changes">
     87                <exec executable="mtn" outputproperty="workspace.changes" errorproperty="mtn.error2" failifexecutionfails="false" >
     88                    <arg value="list" />
     89                    <arg value="changed" />
     90                    <arg value="." />
     91                </exec>
     92                <!-- \n in an attribute value generates an invalid manifest -->
     93                <exec executable="tr" inputstring="${workspace.changes}" outputproperty="workspace.changes.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
     94                        <arg value="-s" />
     95                        <arg value="[:space:]" />
     96                        <arg value="," />
     97                </exec>
     98        </target>
    7399</project>
Note: See TracChangeset for help on using the changeset viewer.