merged R-1_9 release tag against the root-B-1_9
This commit is contained in:
267
build.xml
Normal file
267
build.xml
Normal file
@@ -0,0 +1,267 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- ======================================================================
|
||||
Feb 4, 2005 1:23:05 PM
|
||||
|
||||
Ant build file for JACOB.
|
||||
Tested on Eclipse 3.0.0 and Ant 1.6.1, with MS Visual C++ 6.0
|
||||
|
||||
Eclipse users are pretty lucky. This works with the version of ANT
|
||||
that comes with Eclipse 3.0.1 (maybe 3.0.0). The whole project
|
||||
can be built inside eclipse.
|
||||
|
||||
If you do not have a C++ environment check out the following sites
|
||||
http://msdn.microsoft.com/visualc/vctoolkit2003/
|
||||
http://www.eclipse.org/cdt/
|
||||
http://eclipsewiki.editme.com/InstallingCDTWithMSVisualC
|
||||
|
||||
====================================================================== -->
|
||||
<project name="jacob" default="default" basedir=".">
|
||||
<property file="compilation_tools.properties" />
|
||||
<!-- =v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=v=
|
||||
YOU MUST define a file named compilation_tools.properties
|
||||
and looking like this:
|
||||
|
||||
JDK=D:/J2SDK-1_4_2
|
||||
MSDEVDIR=C:/Program Files/Microsoft Visual Studio/VC98
|
||||
version=1.9
|
||||
|
||||
DO NOT check this file into source control as the values are specific
|
||||
to YOUR environment.
|
||||
|
||||
the version.properties file is now completely autogenerated
|
||||
|
||||
=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^ -->
|
||||
|
||||
<property name="application.title" value="JACOB : Java COM Bridge" />
|
||||
<property name="application.vendor" value="http://jacob-project.sourceforge.net, created by Dan Adler (http://danadler.com)" />
|
||||
<property name="install.dir" value="${basedir}/release" />
|
||||
|
||||
<property name="jacob_java.src" value="${basedir}/src" />
|
||||
<property name="jacob_java.samples" value="${basedir}/samples" />
|
||||
<property name="jacob_java.unittest" value="${basedir}/unittest" />
|
||||
<property name="jacob_java.bin" value="${install.dir}" />
|
||||
<property name="jacob_cpp.src" value="${basedir}/jni" />
|
||||
<property name="jacob_cpp.bin" value="${install.dir}/jni" />
|
||||
|
||||
<property name="jacob.jar" value="${install.dir}/jacob.jar" />
|
||||
<property name="jacob.dll" value="${install.dir}/jacob.dll" />
|
||||
|
||||
<property name="compiler" value="${MSDEVDIR}\bin\cl.exe" />
|
||||
<property name="linker" value="${MSDEVDIR}\bin\link.exe" />
|
||||
|
||||
<!-- =================================
|
||||
target: default
|
||||
================================= -->
|
||||
<target name="default" depends="createDirectoryStructure,jacob_java_jar_bin,jacob_c_dll">
|
||||
|
||||
<echo message="Jacob ${version} build ${build.iteration} : finished on ${build.date}" />
|
||||
</target>
|
||||
|
||||
<!-- ======================================================================
|
||||
Writes out a version file to be included in the jar
|
||||
================================================================== -->
|
||||
<target name="IncrementBuildNumber">
|
||||
<propertyfile file="version.properties">
|
||||
<entry key="version" type="string" value="${version}" />
|
||||
<entry key="build.iteration" type="int" operation="+" value="1" pattern="00" />
|
||||
<entry key="build.date" type="date" value="now" operation="=" pattern="dd-MMMM-yyyy HH:mm:ss" />
|
||||
</propertyfile>
|
||||
<property file="version.properties" />
|
||||
</target>
|
||||
|
||||
<!-- ======================================================================
|
||||
Create the necessary directory structure (does nothing if it
|
||||
already there)
|
||||
================================================================== -->
|
||||
<target name="createDirectoryStructure">
|
||||
<mkdir dir="${jacob_java.bin}"/>
|
||||
<mkdir dir="${jacob_cpp.bin}"/>
|
||||
<mkdir dir="${install.dir}"/>
|
||||
</target>
|
||||
|
||||
<!-- ======================================================================
|
||||
Compare the date/time of the jacob JAR against that
|
||||
of the jacob java source
|
||||
================================================================== -->
|
||||
<target name="jacob_java_jar_check">
|
||||
<uptodate property="jarUpToDate" targetfile="${jacob.jar}">
|
||||
<srcfiles dir="${jacob_java.src}">
|
||||
<include name="com/**/*.java" />
|
||||
</srcfiles>
|
||||
<!-- Check the build file itself as well -->
|
||||
<srcfiles file="${basedir}/build.xml" />
|
||||
</uptodate>
|
||||
<echo message="jacob_java_jar_check result: ${jarUpToDate}" />
|
||||
</target>
|
||||
<!-- ======================================================================
|
||||
Compile the java files
|
||||
Relies on ant recognizing when a file needs to be compiled
|
||||
================================================================== -->
|
||||
<target name="jacob_java_compile" depends="createDirectoryStructure,IncrementBuildNumber">
|
||||
<echo>Building java classes...</echo>
|
||||
<javac srcdir="${jacob_java.src}"
|
||||
destdir="${jacob_java.bin}"
|
||||
listfiles="true" debug="on" fork="yes" />
|
||||
<echo>Building java sample classes...</echo>
|
||||
<javac srcdir="${jacob_java.samples}"
|
||||
destdir="${jacob_java.bin}"
|
||||
excludes="com/jacob/samples/servlet/**/*.java"
|
||||
listfiles="true" debug="on" fork="yes" />
|
||||
<echo>Building java test classes...</echo>
|
||||
<javac srcdir="${jacob_java.unittest}"
|
||||
destdir="${jacob_java.bin}"
|
||||
listfiles="true" debug="on" fork="yes" />
|
||||
</target>
|
||||
<!-- ======================================================================
|
||||
Package the classes into a JAR.
|
||||
Put version.propertes into the jar file so getJacobVersion() can find it
|
||||
================================================================== -->
|
||||
<target name="jacob_java_jar_bin" depends="createDirectoryStructure,jacob_java_compile,jacob_java_jar_check,IncrementBuildNumber" unless="jarUpToDate">
|
||||
<echo>Removing old jars</echo>
|
||||
<delete file="${jacob.jar}" />
|
||||
<echo>Packaging java classes...</echo>
|
||||
<jar destfile="${jacob.jar}" basedir="${jacob_java.bin}" update="false">
|
||||
<exclude name="**/CVS" />
|
||||
<exclude name="com/**/*Test.class"/>
|
||||
<exclude name="com/jacob/samples/**"/>
|
||||
<include name="com/**/*.class" />
|
||||
<include name="version.properties" />
|
||||
<manifest>
|
||||
<attribute name="Built-By" value="${user.name}" />
|
||||
<section name="com.jacob">
|
||||
<attribute name="Specification-Title" value="${application.title}" />
|
||||
<attribute name="Specification-Vendor" value="${application.vendor}" />
|
||||
<attribute name="Implementation-Title" value="${application.title} Java libraries" />
|
||||
<attribute name="Implementation-Version" value="${version} build ${build.iteration} on ${build.date}" />
|
||||
</section>
|
||||
</manifest>
|
||||
</jar>
|
||||
</target>
|
||||
<!-- ======================================================================
|
||||
Compare the date/time of the jacob DLL against that
|
||||
of the jacob cpp source
|
||||
================================================================== -->
|
||||
<target name="jacob_c_check">
|
||||
<uptodate property="dllUpToDate" targetfile="${jacob.dll}">
|
||||
<srcfiles dir="${jacob_cpp.src}">
|
||||
<include name="*.cpp" />
|
||||
<include name="*.h" />
|
||||
</srcfiles>
|
||||
<!-- Check the build file itself as well -->
|
||||
<srcfiles file="${basedir}/build.xml" />
|
||||
</uptodate>
|
||||
<echo message="jacob_c_check result: ${dllUpToDate}" />
|
||||
</target>
|
||||
<!-- ======================================================================
|
||||
Compile the c source files.
|
||||
================================================================== -->
|
||||
<target name="jacob_c_compile" depends="createDirectoryStructure,jacob_c_check,IncrementBuildNumber" unless="dllUpToDate">
|
||||
<echo>Clean up the target folders and file, for safety</echo>
|
||||
<delete file="${jacob_cpp.bin}/**/*.*" />
|
||||
<echo>Compiling C++ classes</echo>
|
||||
<apply executable="${compiler}" dir="${jacob_cpp.bin}" parallel="false" verbose="true" failonerror="true">
|
||||
<arg value="-c" />
|
||||
<arg value="/nologo" />
|
||||
<!-- optimize build for speed. (is this VC specific? -->
|
||||
<arg value="/O2" />
|
||||
<arg value="-I" />
|
||||
<arg value="${JDK}\include" />
|
||||
<arg value="-I" />
|
||||
<arg value="${JDK}\include\win32" />
|
||||
<arg value="-I" />
|
||||
<arg value="${MSDEVDIR}\Include" />
|
||||
<arg value="-I" />
|
||||
<arg value="${MSDEVDIR}\ATL\Include" />
|
||||
<fileset dir="${jacob_cpp.src}">
|
||||
<include name="*.cpp" />
|
||||
</fileset>
|
||||
</apply>
|
||||
</target>
|
||||
<!-- ======================================================================
|
||||
Link the obj files into a DLL.
|
||||
================================================================== -->
|
||||
<target name="jacob_c_dll" depends="createDirectoryStructure,jacob_c_check,jacob_c_compile" unless="dllUpToDate">
|
||||
<echo>Clean up the target folders and file, for safety</echo>
|
||||
<delete file="${jacob.dll}" />
|
||||
<echo>Creating jacob.dll</echo>
|
||||
<apply executable="${linker}" dir="${jacob_cpp.bin}" parallel="true" verbose="true" failonerror="true">
|
||||
<arg value="/nologo" />
|
||||
<arg value="/dll" />
|
||||
<arg value="/version:${version}" />
|
||||
<arg value="/out:${jacob.dll}" />
|
||||
<arg value="/libpath:${MSDEVDIR}/lib" />
|
||||
<srcfile />
|
||||
<arg value="${JDK}\lib\jvm.lib" />
|
||||
<arg value="oleaut32.lib" />
|
||||
<arg value="ole32.lib" />
|
||||
<arg value="uuid.lib" />
|
||||
<arg value="kernel32.lib" />
|
||||
<arg value="shell32.lib" />
|
||||
<arg value="user32.lib" />
|
||||
<fileset dir="${jacob_cpp.bin}">
|
||||
<include name="*.obj" />
|
||||
</fileset>
|
||||
</apply>
|
||||
</target>
|
||||
|
||||
<!-- ======================================================================
|
||||
Use this target to create javadoc from com.jacob.*
|
||||
================================================================== -->
|
||||
<target name="javadoc">
|
||||
<defaultexcludes add="**/*Test*"/>
|
||||
<javadoc
|
||||
packagenames="com.jacob/**"
|
||||
sourcepath="${jacob_java.src}"
|
||||
destdir="${jacob_java.bin}/docs/api"
|
||||
author="true"
|
||||
version="true"
|
||||
use="true"
|
||||
windowtitle="Jacob API Docs">
|
||||
|
||||
<doctitle><![CDATA[<h1>Java Com Bridge (Jacob)</h1>]]></doctitle>
|
||||
<bottom><![CDATA[<i>See Jacob-project on Sourceforge for more info</i>]]></bottom>
|
||||
<tag name="todo" scope="all" description="To do:" />
|
||||
<group title="Jacob COM" packages="com.jacob.com/**"/>
|
||||
<group title="Higher Level Active X" packages="com.jacob.activeX/**"/>
|
||||
<link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api/" packagelistLoc="C:\tmp"/>
|
||||
<link href="http://java.sun.com/j2se/1.4.2/docs/api/"/>
|
||||
</javadoc>
|
||||
<defaultexcludes default="true"/>
|
||||
</target>
|
||||
|
||||
<!-- ======================================================================
|
||||
Use this target to package all the files for a release
|
||||
================================================================== -->
|
||||
<target name="PackageRelease" depends="createDirectoryStructure,jacob_c_dll,jacob_java_jar_bin,javadoc">
|
||||
|
||||
<echo>Packaging release...</echo>
|
||||
<zip
|
||||
destfile="${install.dir}/jacob_${version}.zip">
|
||||
<exclude name="**/CVS" />
|
||||
<exclude name="**/*.obj" />
|
||||
<exclude name="**/*.class" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="LICENSE.* version.properties" />
|
||||
<zipfileset dir="${install.dir}" prefix="jacob_${version}" includes="jacob.jar jacob.dll"/>
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="docs/**" />
|
||||
<zipfileset dir="${install.dir}" prefix="jacob_${version}" includes="docs/**"/>
|
||||
</zip>
|
||||
<zip
|
||||
destfile="${install.dir}/jacob_${version}_src.zip">
|
||||
<exclude name="**/CVS" />
|
||||
<exclude name="**/*.obj" />
|
||||
<exclude name="**/*.class" />
|
||||
<exclude name="**/*.dll" />
|
||||
<exclude name="**/*.exp" />
|
||||
<exclude name="**/*.jar" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="src/**" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="docs/**" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="jni/**" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="samples/**" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="unittest/**" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="vstudio/**" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="build.xml, RELEASE.txt" />
|
||||
<zipfileset dir="${basedir}" prefix="jacob_${version}" includes="LICENSE.* version.properties" />
|
||||
</zip>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user