refactor version replacement stuff to a single target

This commit is contained in:
Doug MacEachern 2005-12-14 23:42:22 +00:00
parent 4f428bddaf
commit 56b9152e93
1 changed files with 41 additions and 17 deletions

View File

@ -87,26 +87,21 @@
</javac>
</target>
<target name="sigar-version">
<tstamp>
<format property="BUILD_DATE" pattern="MM/dd/yyyy hh:mm aa"/>
</tstamp>
<target name="version-file">
<property name="version.file.srcdir"
value="."/>
<property name="version.file.dstdir"
value="."/>
<property name="version.tofile"
value="${build}/${version.file.dstdir}/${version.file}"/>
<property name="version.file"
value="src/net/hyperic/sigar/SigarVersion.java"/>
<copy file="${version.file.srcdir}/${version.file}.in"
tofile="${version.tofile}"/>
<copy file="${version.file}.in"
tofile="${build}/${version.file}"/>
<replace file="${build}/${version.file}">
<replace file="${version.tofile}">
<replacefilter token="@@BUILD_DATE@@" value="${BUILD_DATE}"/>
<replacefilter token="@@VERSION_STRING@@" value="${sigar.version}"/>
</replace>
<copy file="../../src/os/netware/sigar.def.in"
tofile="${build}/sigar.def"/>
<replace file="${build}/sigar.def">
<replacefilter token="@@ARCHNAME@@" value="${jni.project.archname}"/>
<replacefilter token="@@VERSION_MAJOR@@" value="${version.major}"/>
<replacefilter token="@@VERSION_MINOR@@" value="${version.minor}"/>
<replacefilter token="@@VERSION_MAINT@@" value="${version.maint}"/>
@ -114,6 +109,35 @@
</replace>
</target>
<target name="sigar-version">
<tstamp>
<format property="BUILD_DATE" pattern="MM/dd/yyyy hh:mm aa"/>
</tstamp>
<antcall target="version-file">
<param name="version.file"
value="src/net/hyperic/sigar/SigarVersion.java"/>
</antcall>
<antcall target="version-file">
<param name="version.file.srcdir"
value="../.."/>
<param name="version.file.dstdir"
value="${jni.libarch}"/>
<param name="version.file"
value="src/sigar_version.c"/>
</antcall>
<antcall target="version-file">
<param name="version.file.srcdir"
value="../.."/>
<param name="version.file"
value="src/os/netware/sigar.def"/>
<param name="version.tofile"
value="${build}/src/sigar.def"/>
</antcall>
</target>
<target name="prepare-src" depends="sigar-version">
<mkdir dir="${build}/src"/>
@ -131,9 +155,9 @@
<include name="src/*.c"/>
<include name="src/os/${jni.src}/*.c"/>
<include name="bindings/java/src/jni/*.c"/>
<exclude name="bindings/java/src/jni/javasigar_generated.c"/>
<include name="bindings/java/src/${win32.jni}/*.cpp"/>
<include name="bindings/java/src/${win32.jni}/*.c"/>
<include name="bindings/java/build/${jni.libarch}/src/*.c"/>
</patternset>
<path id="jni.include.dirs">