SF 1580993 Feature Request tied to https://sourceforge.net/forum/forum.php?thread_id=1588018&forum_id=375946 Help discusson adds support for 64 bit dlls.

This commit is contained in:
clay_shooter
2006-10-20 02:55:06 +00:00
parent e56c4f5e5d
commit 719ea199bd
27 changed files with 481 additions and 273 deletions

View File

@@ -1,7 +1,11 @@
JACOB (Java-COM bridge) is hosted on Sourceforge http://sourceforge.net/project/jacob-project
Information about what's new in this release can be found in docs/ReleaseNotes.html
Instructions on building this project can be found in docs/HowToBuild.html
Detailed instructions on creating a build configuration file are in build.xml
This project is hosted on Sourceforge http://sourceforge.net/project/jacob-project
Put the appropriate DLL for your platform into your runtime library path.
jacob for 32 bit windows is located in /x86.
There is no good usage guide at this time.

447
build.xml
View File

@@ -5,7 +5,7 @@
Created Feb 4, 2005 1:23:05 PM as part of migration from ANT
Last Modified October 13, 2005
Tested on Eclipse 3.1.0 with the CDT plugin, Ant 1.6.1 and MS Visual C++ 6.0
Tested on Eclipse 3.2 with the Callisto plugis, Ant 1.6.1 and MS Visual C++ 6.0
Eclipse users are pretty lucky because the whole project
can be built inside eclipse due to their built in ANT support.
@@ -13,144 +13,244 @@
The build proces defined in this build.xml file does support
MS Visual C++ 8.0 (Visual C++ 2005 Express) when combined with the M SDK.
The problem is that SafeArray.cpp will not compile
with that 64 bit aware environment.
with that more advanced (and 64 bit aware) environment.
====================================================================== -->
<project name="jacob" default="default" basedir=".">
<property file="compilation_tools.properties" />
<!-- sets a default for properties that were not in the file -->
<!-- relies on the fact that properties cannot be reset once set -->
<property name="JDK" value="JDK not set in compilation_tools properties file"/>
<property name="MSDEVDIR" value="MSDEVDIR not set in compilation_tools properties file"/>
<property name="MSSDKDIR" value="${MSDEVDIR}"/>
<echo message="MSDEVDIR=${MSDEVDIR} MSSDKDIR=${MSSDKDIR}"/>
<!-- =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!
The file for MS Visual C++ 6.0 looks something like
The file for MS Visual C++ 6.0 building only the 32 bit version
(the only version available through 1.11) looks something like:
JDK=d:/j2sdk1.4.2_09
MSDEVDIR=d:\\apps\\Microsoft Visual Studio\\VC98
version=1.11-pre1
version=1.11-pre2
The file for MS Visual Studio 8 Express with SDK looks something like:
Construction with 64 bit support requires the MS Platform SDK.
compilation_tools.properties in this situation should look
something like:
JDK=d:/j2sdk1.4.2_09
MSDEVDIR=D:\\Apps\\Microsoft Visual Studio 8\\VC
MSDEVDIR=d:\\apps\\Microsoft Visual Studio\\VC98
MSSDKDIR=D:\\Apps\\Microsoft Platform SDK for Windows Server 2003 R2
version=1.11-pre1
version=1.11-pre2
DO NOT check compilation_tools.properties into source control as the
values are specific to YOUR environment.
the version.properties file is now completely autogenerated
=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^ -->
====================================================================== -->
<project name="jacob" default="default" basedir=".">
<!-- ======================================================================
First handle the properties that come from property files
Sets a default for properties that were not in the file.
Relies on the fact that properties cannot be reset once set.
================================================================== -->
<property file="compilation_tools.properties" />
<property name="JDK" value="JDK not set in compilation_tools properties file"/>
<!-- MSDEVDIR is a required parameter so set to a message if its not set -->
<property name="MSDEVDIR" value="MSDEVDIR not set in compilation_tools properties file"/>
<!-- MSSDKDIR is an optional parameter. It is set to the same as MSDEVDIR if not specified
sets it to the "there is a problem" type message if no SDK or DEV was provided -->
<property name="MSSDKDIR" value="${MSDEVDIR}"/>
<echo message="executing with MSDEVDIR=${MSDEVDIR}" />
<echo message="executing with MSSDKDIR=${MSSDKDIR}"/>
<!-- ======================================================================
Now build up all the derived properties
================================================================== -->
<property name="application.title" value="JACOB : Java COM Bridge" />
<property name="application.vendor" value="http://jacob-project.sourceforge.net" />
<property name="java.src.mainpackage" value="com.jacob" />
<property name="src.java.jacob.mainpackage" value="com.jacob" />
<property name="java.class.main" value="com.jacob.com.Jacob" />
<property name="generated_jar" value="jacob.jar" />
<property name="generated_dll" value="jacob.dll" />
<property name="generated_zip" value="jacob_${version}" />
<property name="generated.filename.dll" value="jacob.dll" />
<property name="generated.filename.jar" value="jacob.jar" />
<property name="generated.filename.zip" value="jacob_${version}" />
<property name="install.dir" value="${basedir}\release" />
<property name="java.src" value="${basedir}/src" />
<property name="java.samples" value="${basedir}/samples" />
<property name="java.unittest" value="${basedir}/unittest" />
<property name="java.bin" value="${install.dir}" />
<property name="cpp.src" value="${basedir}/jni" />
<property name="cpp.bin" value="${install.dir}/jni" />
<property name="src.java.jacob" value="${basedir}/src" />
<property name="src.java.samples" value="${basedir}/samples" />
<property name="src.java.unittest" value="${basedir}/unittest" />
<property name="src.cpp" value="${basedir}/jni" />
<property name="jarfile_fullpath" value="${install.dir}\${generated_jar}" />
<property name="dll_fullpath" value="${install.dir}\${generated_dll}" />
<property name="release.dir" value="${basedir}/release" />
<property name="compiler" value="${MSDEVDIR}\bin\cl.exe" />
<property name="linker" value="${MSDEVDIR}\bin\link.exe" />
<property name="release.dir.x86" value="${release.dir}/x86" />
<property name="release.dir.x86.cpp" value="${release.dir.x86}/jni" />
<property name="release.file.x86.dll" value="${release.dir.x86}/${generated.filename.dll}" />
<!-- =================================
target: default
================================= -->
<target name="default" depends="createDirectoryStructure,java_jar_bin,c_dll">
<property name="release.dir.AMD64" value="${release.dir}/AMD64" />
<property name="release.dir.AMD64.cpp" value="${release.dir.AMD64}/jni" />
<property name="release.file.AMD64.dll" value="${release.dir.AMD64}/${generated.filename.dll}" />
<echo message="${application.title} ${version} build ${build.iteration} : finished on ${build.date}" />
</target>
<property name="release.dir.java" value="${release.dir}/java" />
<property name="release.file.jar" value="${release.dir.java}/${generated.filename.jar}" />
<property name="compiler.x86" value="${MSDEVDIR}\bin\cl.exe" />
<property name="linker.x86" value="${MSDEVDIR}\bin\link.exe" />
<property name="include.x86" value="${MSDEVDIR}\include" />
<property name="include.x86.atl" value="${MSDEVDIR}\atl\include" />
<property name="library.x86" value="${MSDEVDIR}\lib" />
<property name="compiler.AMD64" value="${MSSDKDIR}\bin\win64\x86\AMD64\cl.exe" />
<property name="linker.AMD64" value="${MSSDKDIR}\bin\win64\x86\AMD64\link.exe" />
<property name="include.AMD64" value="${MSSDKDIR}\include" />
<property name="library.AMD64" value="${MSSDKDIR}\lib\AMD64" />
<!-- ======================================================================
Writes out a version file to be included in the jar
================================================================== -->
<target name="IncrementBuildNumber">
<!-- sets a default for properties that were not in the file -->
<!-- relies on the fact that properties cannot be reset once set -->
<property name="version" value="version not set in compilation_tools properties file"/>
<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>
<!-- Itanium support not yet implemented -->
<property name="compiler.IA64" value="${MSDEVDIR}\bin\win64\cl.exe" />
<property name="linker.IA64" value="${MSDEVDIR}\bin\win64\link.exe" />
<property name="include.IA64" value="${MSSDKDIR}\include" />
<property name="library.IA64" value="${MSSDKDIR}\lib\IA64" />
<!-- ======================================================================
Create the necessary directory structure (does nothing if it
already there)
================================================================== -->
<target name="createDirectoryStructure">
<mkdir dir="${java.bin}"/>
<mkdir dir="${cpp.bin}"/>
<mkdir dir="${install.dir}"/>
<mkdir dir="${release.dir.java}"/>
<mkdir dir="${release.dir.x86.cpp}"/>
<mkdir dir="${release.dir.AMD64.cpp}"/>
<mkdir dir="${release.dir}"/>
<!-- ======================================================================
Writes out a version file to be included in the jar
================================================================== -->
<property name="version" value="version not set in compilation_tools properties file"/>
<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" />
<!-- ======================================================================
32 bit x86 can only be built on 32 bit because of a JDK library issue.
true if on x86, unset in all other cases.
Assume 64 bit builds are ok if MSDEVDIR and MSSDKDIR are different
================================================================== -->
<condition property="canBuildX86">
<os arch="x86"/>
</condition>
<echo message="canBuildX86=${canBuildX86}" />
<condition property="canBuildAMD64">
<not>
<equals arg1="${MSSDKDIR}" arg2="${MSDEVDIR}"/>
</not>
</condition>
<echo message="canBuildAMD64=${canBuildAMD64}" />
<!-- ======================================================================
Compare the date/time of the DLL against that of the cpp source.
Up to date is only true if dll exists and is later than source
================================================================== -->
<uptodate property="dllUpToDateX86" targetfile="${release.file.x86.dll}">
<srcfiles dir="${src.cpp}" includes="*.cpp" />
<srcfiles dir="${src.cpp}" includes="*.h" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
<echo message="checkDllUpToDateX86= ${dllUpToDateX86}" />
<uptodate property="dllUpToDateAMD64" targetfile="${release.file.AMD64.dll}">
<srcfiles dir="${src.cpp}" includes="*.cpp" />
<srcfiles dir="${src.cpp}" includes="*.h" />
<!-- Check the build file itself as well -->
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
<echo message="checkDllUpToDateAMD64= ${dllUpToDateAMD64}" />
<!-- ======================================================================
We should build if we can build and the dll is not up to date
================================================================== -->
<condition property="shouldBuildX86">
<and>
<isset property="canBuildX86"/>
<not>
<isset property="dllUpToDateX86"/>
</not>
</and>
</condition>
<echo message="shouldBuildX86= ${shouldBuildX86}" />
<condition property="shouldBuildAMD64">
<and>
<isset property="canBuildAMD64"/>
<not>
<isset property="dllUpToDateAMD64"/>
</not>
</and>
</condition>
<echo message="shouldBuildAMD64= ${shouldBuildAMD64}" />
<!--=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=v=v
START of TASKS
=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^=^ -->
<!-- =================================
target: default
================================= -->
<target name="default"
depends="javaJarBin,makeDllX86,makeDllAMD64">
<echo message="${application.title} ${version} build ${build.iteration} : finished on ${build.date}" />
</target>
<!-- ======================================================================
Target (still in development) that removes all bin directories
================================================================== -->
<target name="clean">
<delete>
<fileset dir="${release.dir.java}"/>
<fileset dir="${release.dir.x86.cpp}"/>
<fileset dir="${release.dir.AMD64.cpp}"/>
<fileset dir="${release.dir}"/>
</delete>
</target>
<!-- ======================================================================
Compare the date/time of the JAR against that
of the java source
================================================================== -->
<target name="java_jar_check">
<uptodate property="jarUpToDate" targetfile="${jarfile_fullpath}">
<srcfiles dir="${java.src}">
<include name="com/**/*.java" />
</srcfiles>
<target name="javaJarCheck">
<uptodate property="jarUpToDate" targetfile="${release.file.jar}">
<srcfiles dir="${src.java.jacob}" includes="com/**/*.java" />
<!-- Check the build file itself as well -->
<srcfiles file="${basedir}/build.xml" />
<srcfiles dir="${basedir}" includes="build.xml" />
</uptodate>
<echo message="java_jar_check result: ${jarUpToDate}" />
<echo message="javaJarCheck says jarUpToDate= ${jarUpToDate}" />
</target>
<!-- ======================================================================
Compile the java files
Compile the java files and copy version.properties to be jar'd up
Relies on ant recognizing when a file needs to be compiled
================================================================== -->
<target name="java_compile" depends="createDirectoryStructure,IncrementBuildNumber">
<echo>Building java classes in ${java.bin}...</echo>
<javac srcdir="${java.src}"
destdir="${java.bin}"
listfiles="true" debug="on" source="1.4" />
<echo>Building java sample classes ...</echo>
<javac srcdir="${java.samples}"
destdir="${java.bin}"
listfiles="true" debug="on" source="1.4" />
<echo>Building java test classes...</echo>
<javac srcdir="${java.unittest}"
destdir="${java.bin}"
<target name="javaCompile" >
<echo>Building Jacob , sample and, test classes in ${release.dir.java}</echo>
<javac srcdir="${src.java.jacob}:${src.java.samples}:${src.java.unittest}"
destdir="${release.dir.java}"
listfiles="true" debug="on" source="1.4" />
<copy file="version.properties" todir="${release.dir.java}"/>
</target>
<!-- ======================================================================
Package the classes into a JAR.
Put version.propertes into the jar file so version retrieval method can find it
================================================================== -->
<target name="java_jar_bin" depends="createDirectoryStructure,java_compile,java_jar_check,IncrementBuildNumber" unless="jarUpToDate">
<target name="javaJarBin"
depends="javaCompile,javaJarCheck"
unless="jarUpToDate">
<echo>Removing old jars</echo>
<delete file="${jarfile_fullpath}" />
<delete file="${release.file.jar}" />
<echo>Packaging java classes...</echo>
<jar destfile="${jarfile_fullpath}" basedir="${java.bin}" update="false">
<jar destfile="${release.file.jar}" basedir="${release.dir.java}" update="false">
<exclude name="**/CVS" />
<!-- exclude all unit tests (ending in Test)
and everything in the samples and test packages -->
<exclude name="com/**/*Test.class"/>
<exclude name="com/**/samples/**"/>
<exclude name="com/jacob/samples/**"/>
<exclude name="com/jacob/test/**"/>
<include name="com/**/*.class" />
<include name="version.properties" />
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${java.class.main}"/>
<section name="${java.src.mainpackage}">
<section name="${src.java.jacob.mainpackage}">
<attribute name="Specification-Title" value="${application.title}" />
<attribute name="Specification-Vendor" value="${application.vendor}" />
<attribute name="Implementation-Title" value="${application.title} Java libraries" />
@@ -159,29 +259,14 @@
</manifest>
</jar>
</target>
<!-- ======================================================================
Compare the date/time of the DLL against that
of the cpp source
================================================================== -->
<target name="c_check">
<uptodate property="dllUpToDate" targetfile="${dll_fullpath}">
<srcfiles dir="${cpp.src}">
<include name="*.cpp" />
<include name="*.h" />
</srcfiles>
<!-- Check the build file itself as well -->
<srcfiles file="${basedir}/build.xml" />
</uptodate>
<echo message="c_check result: ${dllUpToDate}" />
</target>
<!-- ======================================================================
Compile the c source files.
================================================================== -->
<target name="c_compile" depends="createDirectoryStructure,c_check,IncrementBuildNumber" unless="dllUpToDate">
<echo>Clean up the target folders and file, for safety</echo>
<delete file="${cpp.bin}/**/*.*" />
<echo>Compiling C++ classes with JDK JNI library ${JDK}</echo>
<apply executable="${compiler}" dir="${cpp.bin}" parallel="false" verbose="true" failonerror="true">
<target name="compileX86" if="shouldBuildX86">
<echo>Clean up the (x86) target folders and file, for safety</echo>
<delete file="${release.dir.x86.cpp}/**/*.*" />
<echo>Compiling (x86) C++ classes with JDK JNI library ${JDK}</echo>
<apply executable="${compiler.x86}" dir="${release.dir.x86.cpp}" parallel="false" verbose="true" failonerror="true">
<arg value="-c" />
<arg value="/nologo" />
<!-- create a multi threaded library -->
@@ -203,53 +288,119 @@
<arg value="${JDK}\include" />
<arg value="-I" />
<arg value="${JDK}\include\win32" />
<arg value="-I" /> <!-- hopefully 6.0 won't barf including same dir twice -->
<!-- hopefully 6.0 won't barf including same dir twice -->
<arg value="-I" />
<arg value="${include.x86}" />
<arg value="-I" />
<arg value="${include.x86.atl}" />
<!-- after SDK because SDK may be more up to date -->
<arg value="-I" />
<arg value="${MSDEVDIR}\Include" />
<fileset dir="${src.cpp}">
<include name="*.cpp" />
</fileset>
</apply>
</target>
<target name="compileAMD64" if="shouldBuildAMD64">
<echo>Clean up the (AMD64) target folders and file, for safety</echo>
<delete file="${release.dir.AMD64.cpp}/**/*.*" />
<echo>Compiling C++ (AMD64) classes with JDK JNI library ${JDK}</echo>
<apply executable="${compiler.AMD64}" dir="${release.dir.AMD64.cpp}" parallel="false" verbose="true" failonerror="true">
<arg value="-c" />
<arg value="/nologo" />
<!-- create a multi threaded library -->
<!-- <arg value="/MT" /> -->
<!-- raise the warning level from the default -->
<arg value="/W3" />
<!-- sets the exception model -->
<arg value="/EHsc" />
<!-- optimize build for speed. (is this VC specific? -->
<arg value="/O2" />
<!-- next two wipe out a lot of deprecated warnings about strings when using VC++ 8.0 and SDK-->
<arg value="/D" />
<arg value="_CRT_SECURE_NO_DEPRECATE" />
<arg value="/D" />
<arg value="_CRT_NONSTDC_NO_DEPRECATE" />
<arg value="/D" />
<arg value="_STATIC_CPPLIB" />
<arg value="-I" />
<arg value="${MSSDKDIR}\Include" />
<arg value="${JDK}\include" />
<arg value="-I" />
<arg value="${MSSDKDIR}\\Include\\ATL" />
<fileset dir="${cpp.src}">
<arg value="${JDK}\include\win32" />
<!-- hopefully 6.0 won't barf including same dir twice -->
<arg value="-I" />
<arg value="${include.AMD64}" />
<arg value="-I" />
<arg value="${include.AMD64}\crt" />
<arg value="-I" />
<arg value="${include.AMD64}\atl" />
<!-- after SDK because SDK may be more up to date -->
<!--
<arg value="-I" />
<arg value="${MSDEVDIR}\Include" />
-->
<fileset dir="${src.cpp}">
<include name="*.cpp" />
</fileset>
</apply>
</target>
<!-- ======================================================================
Link the obj files into a DLL.
Link the obj files into a DLL.
DLL construction matrix (Yes=DLL can be built, No=DLL cannot)
_________________________________________________
Type of machine ANT is running on
32 bit 64 bit
32 bit target Yes No
64 bit target Yes Yes
================================================================== -->
<target name="c_dll" depends="createDirectoryStructure,c_check,c_compile" unless="dllUpToDate">
<target name="makeDllX86" depends="compileX86" if="shouldBuildX86">
<echo>Clean up the target folders and file, for safety</echo>
<delete file="${dll_fullpath}" />
<echo>Creating dll_fullpath</echo>
<apply executable="${linker}" dir="${cpp.bin}" parallel="true" verbose="true" failonerror="true">
<delete file="${release.file.x86.dll}" />
<echo>Creating ${release.file.x86.dll}</echo>
<apply executable="${linker.x86}" dir="${release.dir.x86.cpp}" parallel="true" verbose="true" failonerror="true">
<arg value="/nologo" />
<arg value="/dll" />
<arg value="/version:${version}" />
<arg value="/out:${dll_fullpath}" />
<arg value="/libpath:${MSSDKDIR}/lib" />
<arg value="/out:${release.file.x86.dll}" />
<arg value="/libpath:${library.x86}" />
<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="${cpp.bin}">
<fileset dir="${release.dir.x86.cpp}">
<include name="*.obj" />
</fileset>
</apply>
</target>
<target name="makeDllAMD64" depends="compileAMD64" if="shouldBuildAMD64">
<echo>Clean up the target folders and file, for safety</echo>
<delete file="${release.file.AMD64.dll}" />
<echo>Creating {$release.file.AMD64.dll}</echo>
<apply executable="${linker.AMD64}" dir="${release.dir.AMD64.cpp}" parallel="true" verbose="true" failonerror="true">
<arg value="/nologo" />
<arg value="/dll" />
<arg value="/version:${version}" />
<arg value="/out:${release.file.AMD64.dll}" />
<arg value="/libpath:${library.AMD64}" />
<arg value="/libpath:${library.AMD64}\atlmfc" />
<srcfile />
<arg value="${JDK}\lib\jvm.lib" />
<arg value="bufferoverflowu.lib" />
<fileset dir="${release.dir.AMD64.cpp}">
<include name="*.obj" />
</fileset>
</apply>
</target>
<!-- ======================================================================
Use this target to create javadoc from ${java.src.mainpackage}/*
Use this target to create javadoc from ${src.java.jacob.mainpackage}/*
================================================================== -->
<target name="javadoc">
<target name="generateJavaDoc">
<defaultexcludes add="**/*Test*"/>
<javadoc
packagenames="${java.src.mainpackage}/**"
sourcepath="${java.src}"
destdir="${java.bin}/docs/api"
packagenames="${src.java.jacob.mainpackage}/**"
sourcepath="${src.java.jacob}"
destdir="${release.dir.java}/docs/api"
author="true"
version="true"
use="true"
@@ -257,10 +408,9 @@
<doctitle><![CDATA[<h1>${application.title}</h1>]]></doctitle>
<bottom><![CDATA[<i>${application.vendor}</i>]]></bottom>
<tag name="todo" scope="all" description="To do:" />
<group title="Core COM Communication" packages="${java.src.mainpackage}.com/**"/>
<group title="Higher Level Active X" packages="${java.src.mainpackage}.activeX/**"/>
<group title="API Stub Generator" packages="${java.src.mainpackage}.jacobgen/**"/>
<group title="Core COM Communication" packages="${src.java.jacob.mainpackage}.com/**"/>
<group title="Higher Level Active X" packages="${src.java.jacob.mainpackage}.activeX/**"/>
<group title="API Stub Generator" packages="${src.java.jacob.mainpackage}.jacobgen/**"/>
<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>
@@ -270,38 +420,39 @@
<!-- ======================================================================
Use this target to package all the files for a release
================================================================== -->
<target name="PackageRelease" depends="createDirectoryStructure,c_dll,java_jar_bin,javadoc">
<target name="PackageRelease"
depends="makeDllX86,makeDllAMD64,javaJarBin,generateJavaDoc">
<echo>Packaging release... ${jarfile_fullpath}</echo>
<echo>Packaging release... ${release.file.jar}</echo>
<zip
destfile="${install.dir}/${generated_zip}.zip">
destfile="${release.dir}/${generated.filename.zip}.zip">
<exclude name="**/CVS" />
<exclude name="**/*.obj" />
<exclude name="**/*.class" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="LICENSE.* version.properties" />
<zipfileset dir="${install.dir}" prefix="${generated_zip}" includes="${generated_jar}" />
<zipfileset dir="${install.dir}" prefix="${generated_zip}" includes="${generated_dll}" />
<zipfileset dir="${basedir}/lib" prefix="${generated_zip}" includes="*.jar" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="docs/**" />
<zipfileset dir="${install.dir}" prefix="${generated_zip}" includes="docs/**"/>
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* version.properties README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${release.dir.x86}" prefix="${generated.filename.zip}/x86" includes="${generated.filename.dll}" />
<zipfileset dir="${release.dir.AMD64}" prefix="${generated.filename.zip}/AMD64" includes="${generated.filename.dll}" />
<zipfileset dir="${release.dir.java}" prefix="${generated.filename.zip}" includes="${generated.filename.jar}" />
<zipfileset dir="${release.dir.java}" prefix="${generated.filename.zip}" includes="docs/**"/>
</zip>
<zip
destfile="${install.dir}/${generated_zip}_src.zip">
destfile="${release.dir}/${generated.filename.zip}_src.zip">
<exclude name="**/CVS" />
<exclude name="**/*.obj" />
<exclude name="**/*.class" />
<exclude name="**/*.dll" />
<exclude name="**/*.exp" />
<exclude name="**/*.jar" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="src/**" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="docs/**" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="jni/**" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="samples/**" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="unittest/**" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="vstudio/**" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="lib/**" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="build.xml, README.txt" />
<zipfileset dir="${basedir}" prefix="${generated_zip}" includes="LICENSE.* version.properties" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="src/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="docs/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="jni/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="samples/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="unittest/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="vstudio/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="lib/**" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="build.xml, README.txt" />
<zipfileset dir="${basedir}" prefix="${generated.filename.zip}" includes="LICENSE.* version.properties" />
</zip>
</target>
</project>

View File

@@ -1,7 +1,31 @@
<HTML>
<BODY>
<h1> Overview </h1>
JACOB is built on windows machines using ANT, most commonly from inside of Eclipse.
The main steps for getting a working Jacob build are:
<ol>
<li>Check out the source code or unpack the source zip file from sourceforge</li>
<li>Install the Development Environment</li>
<li>Configure the build by creating a <i>compilation_tools.properties</i> file.</li>
<li>Run Eclipse and load the project into eclipse</li>
<li>Open the build.xml file in Eclipse and run the default ant target </li>
</ol>
<p>
<h1> Repository Organization </h1>
<p>
Unpack the source archive zip file or check the files out of CVS into d:\jacob
or some other familiar place. Source Java and JNI files are located in seperate
packages from the unit tests and the samples.
<p>
The java code is in .\src.<BR>
The C++ code is in .\jni.<br>
Code is compiled into .\release<br>
<p>
The Servlet examples that required j2ee libraries to compile have temporarily
been removed.
<p>
<H1>Development Environment</h1>
The simplest installation involves MS Visual C++ 6.0, Eclipse 3.1 and JDK 1.4.
The simplest build environment involves MS Visual C++ 6.0, Eclipse 3.1 and JDK 1.4.
In that situation, you would just create the <i>compilation_tools.properties</i>
using the example build.xml as a template. All of the releases, up through 1.11,
were built using Visual C++ 6.0.
@@ -10,8 +34,24 @@ were built using Visual C++ 6.0.
<li> Eclipse 3.1 or later from www.eclipse.org.
<li> Java JDK 1.4 (this was built using 1.4.2.09)
</ul>
<p>
64 bit builds are supported with release 1.11. Tools required for 64 bit builds
include:
<UL>
<li> Microsoft Visual C++ 6.0 and it's included library. (installed in D:\apps in my case)
<li> Microsoft SDK 2005R2 with the following components (installed in D:\apps in my case)
<ul>
<li>Windows Core SDK
<li>Microsoft Web Workshop (IE) SDK is required because it is referenced in atlbase.h
<li>(optional) Some folks also install the Debugging tools.
</ul>
<li> Eclipse 3.1 or later from www.eclipse.org.
<li> Java JDK 1.4 (this was built using 1.4.2.09)
</ul>
Compilation using JDK 1.5 has not been tested
<H1>Build Process</H1>
The build process is based on ANT. It cannot be built using MAKE.
You can run ANT from inside of eclipse or from the command line.
@@ -46,45 +86,26 @@ want to use the integrated build process. This is because the unit
tests are files located in the "unittest" directory while
the project source files themselves are in "src" the root directory.
By default, eclipse will add the entire project as source. This
messes up the package naming. A couple small tweaks to the build path
fix this problem.
messes up the package naming. In addition, the build directory should be
set to be the same place the ANT build puts the compiled java classes.
A couple small tweaks to the build path fix these problems:
<p>
Open up the project properties and go to the "Java Build Path" properties panel.
<ul>
<li> Eclipse automatically adds the whole project as a source directory
<li> Remove the root of the project from the build path
<li> Add folders samples, src and unittest to the build path
<li> Exclude *.txt from each of the newly added folders.
<li> Remove the root of the project from the build path</li>
<li> Add folders <code>samples</code>, <code>src</code> and <code>unittest</code>
to the build path in the Source tab.</li>
<li> Exclude *.txt from each of the newly added folders. </li>
<li> Set the build output directory to <code>jacob-project/release/java</code></li>
</ul>
<h1> Repository Organization </h1>
<p>
Unpack the source archive zip file or check the files out of CVS into d:\jacob
or some other familiar place. Source Java and JNI files are located in seperate
packages from the unit tests and the samples.
<p>
The java code is in .\src.<BR>
The C++ code is in .\jni.
<p>
The Servlet examples that required j2ee libraries to compile have temporarily
been removed.
<p>
<h1> 64 bit build support </h1>
<p>
<B>64 bit builds are not supported at this time</b>
<p>
A 64 bit build would involve:
<UL>
<li> Microsoft Visual C++ 6.0 and it's included library. (installed in D:\apps in my case)
<li> Microsoft SDK 2005R2 with the following components
<ul>
<li>Windows Core SDK
<li>Microsoft Web Workshop (IE) SDK is required because it is referenced in atlbase.h
<li>(optional) Some folks also install the Debugging tools.
</ul>
<li> Eclipse 3.1 or later from www.eclipse.org.
<li> Java JDK 1.4 (this was built using 1.4.2.09)
</ul>
<h1> Running Samples and Tests </h1>
Samples and test programs can be found in the source jar or in CVS. The programs
can be run from a bat file or from inside the Eclipse IDE. The java library
path variable must be set to include the directory the jacob.dll is in. The
simplest way to do that is to add it as a command line option.
Last Modified 10/2005

View File

@@ -76,6 +76,10 @@
</tr>
<tr>
<td width="100%" colspan="2"><b>Feature Requests</b></td>
</tr>
<tr>
<td width="13%">1580993</td>
<td width="87%">Modify the build process to support 64 bit dll construction</td>
</tr>
<tr>
<td width="13%">1550628</td>
@@ -624,17 +628,17 @@ native code is replicated there from the jni directory...
<h2>Related Links</h2>
<ul>
<li>
The JACOB mailing list is hosted at yahoo groups:
<a href="http://groups.yahoo.com/group/jacob-project">
http://groups.yahoo.com/group/JACOB-project</a>.
The best way to get support or the latest version of JACOB is on
<a href="http://sourceforge.net/projects/jacob-project">
http://sourceforge.net/projects/jacob-project </a>
<b>This is the preferred way to get support for JACOB</b>. It also
includes an extensive archive. If you are doing any development with
JACOB, please join the list.
JACOB, please join sourceforge.
<li>
Massimiliano Bigatti has developed
<a href="http://www.bigatti.it/projects/jacobgen/">
<a href="http://sourceforge.net/projects/jacob-project">
JACOBgen - a generator that automatically creates JACOB code from
Type Libraries</a>
Type Libraries, now available on sourceforge</a>
</li>
<li>
Steven Lewis is developing a version of Java2Com that supports JACOB

45
docs/UsingJacob.html Normal file
View File

@@ -0,0 +1,45 @@
<HTML>
<BODY>
<h1> Determining the API of the target application </h1>
<p>
Section not yet written.
<p>
<hr>
<h1> Determining the API of the target application </h1>
<p>
Section not yet written.
<p>
<hr>
<h1>Jacob Command Line Settings</h1>
This library supports several different :
<h3>java.library.path</h3>
Used to add the location of the jacob dll to the JVM's library path.
<p>
Example: -Djava.library.path=d:/jacob/release/x86
<h3>com.jacob.autogc </h3>
Determines if automatic garbage collection is enabled. This is the
only way to free up objects created in event callbacks. This
feature is not fully debugged.
<p>
The default value is <strong>false</strong>
<p>
Example: -Dcom.jacob.autogc=false
<h3>com.jacob.debug</h3>
Determines if debug output is enabled to standard out.
The default value is <strong>false</strong>
<p>
Example: -Dcom.jacob.debug=false
<h3>-XCheck:jni</h3>
This turns on additional JVM checking for JNI issues. This is
not strictly a JACOB system property.
<p>
The default is "no additional checking"
Example: -XCheck:jni
Last Modified 10/2005
</BODY>
</HTML>

View File

@@ -1,3 +0,0 @@
1. Make everything check the current thread's mta-ness
2. Write more documentation
3. Get someone to help write the Javadoc

View File

@@ -1,14 +0,0 @@
JAVAC = c:\j2sdk1.4.2_07\bin\javac -O
JAR = c:\j2sdk1.4.2_07\bin\jar -cvf jacob.jar
COM_DIR = com\jacob\com
ACX_DIR = com\jacob\activeX
java: jacob.jar
cd src
$(JAVAC) $(COM_DIR)\*.java $(ACX_DIR)\*.java
$(JAR) $(COM_DIR)\*.class $(ACX_DIR)\*.class
jni: jni\jacob.dll
cd jni
nmake -f makefile all
cd ..\

View File

@@ -23,9 +23,8 @@ import com.jacob.com.*;
import com.jacob.activeX.*;
/**
* May need to run with some command line options. If so, then try these
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=true -Xcheck:jni
* @author joe
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*
*/
class Access

View File

@@ -5,10 +5,9 @@ import com.jacob.activeX.*;
/**
* Sample test program snagged out of a question on the sun discussion area.
* Run options...
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=true
* @author joe
*
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class ExcelDispatchTest {

View File

@@ -11,14 +11,10 @@ import java.awt.event.*;
/**
* Created as part of sourceforge 1386454 to demonstrate returning values in event handlers
* @author miles@rowansoftware.net
*
* <p>
* This file contains the main() that runs the demo
*
* This can be run in Eclipse with options
* <pre>
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false
* -Dcom.jacob.debug=false
* </pre>
* <p>
* Look in the docs area at the Jacob usage document for command line options.
*/
public class VisioDemo extends JFrame implements ActionListener, WindowListener {

View File

@@ -5,11 +5,9 @@ import com.jacob.activeX.ActiveXComponent;
/**
* This exercises the two Dispatch factor methods that let you
* control whether you create a new running COM object or connect to an existing one
*
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=true
*
* @author joe
*
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class ActiveXComponentFactoryTest {
public static void main(String args[]) throws Exception {

View File

@@ -8,10 +8,9 @@ import com.jacob.com.DateUtilities;
/**
* test cases that should exercise the new date conversion code
* run this test with options
* <code>-Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=true -Dcom.jacob.debug=false</code>
* @author joe
*
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class DateUtilitiesTest {

View File

@@ -4,11 +4,14 @@ import java.util.Date;
/**
* Test some of the Dispatch utility methods
* <code>-Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=true -Dcom.jacob.debug=false</code>
* @author joe
* @author joe
*
* May need to run with some command line options (including from inside Eclipse).
* If so, then try these
* <pre>
* -Djava.library.path=d:/jacob/release/x86
* -Dcom.jacob.autogc=false
* -Dcom.jacob.debug=false
* -Xcheck:jni
* </pre>
*/
public class DispatchTest {

View File

@@ -1,12 +1,10 @@
package com.jacob.com;
/**
* @author joe
*
* This will eventually be changed to a unit test.
*
* Run in Eclipse with command line arguments
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class JacobObjectTest {

View File

@@ -7,8 +7,9 @@ package com.jacob.com;
*
* This will eventually be changed to a unit test.
*
* Run in Eclipse with command line arguments
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class ROT2Test
{

View File

@@ -7,8 +7,9 @@ package com.jacob.com;
*
* This will eventually be changed to a unit test.
*
* Run in Eclipse with command line arguments
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class ROT3Test
{

View File

@@ -4,9 +4,9 @@ import com.jacob.com.ROT;
* This trys to exercise ROT's garbage collecion
*
* This will eventually be changed to a unit test.
*
* Run in Eclipse with command line arguments
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class ROTTest {

View File

@@ -6,10 +6,9 @@ import com.jacob.com.Variant;
/**
* test cases that should exercise the new date conversion code
* run this test with options
* <code>-Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=true -Dcom.jacob.debug=false</code>
* @author joe
*
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class VariantDateTest {

View File

@@ -5,7 +5,9 @@ import java.io.*;
/**
* Verifies serialization works for variants.
* Variant serialization is BROKEN and has been since 1.7
* <pre>-Djava.library.path=d:/jacob/release</pre>
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
class VariantSerializationTest {

View File

@@ -5,7 +5,9 @@ import java.util.Date;
/**
* runs through some of the get and set methods on Variant
*
* -Djava.library.path=d:/jacob/release -Dcom.jacob.debug=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
class VariantTest {
public static void main(String[] args) {

View File

@@ -6,9 +6,9 @@ import com.jacob.com.*;
/**
* This example uses the MathTest sample VB COM DLL under
* the MathProj directory
* <pre>
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=true
* </pre>
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
class MathTest {
public static void main(String[] args) {

View File

@@ -11,9 +11,9 @@ import com.jacob.com.Variant;
* This test was lifted from a forum posting and shows how you can't listen to
* Excel events (added post 1.9.1 Eclipse Settings.) This also uses the 1.9.1
* InvocationProxy to receive the events.
* <p> supported command line options with default values are
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false
* -Dcom.jacob.debug=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class ExcelEventTest extends InvocationProxy {

View File

@@ -11,9 +11,9 @@ import com.jacob.activeX.*;
* it listens to as it havigates to web sites.
* contributed by Niels Olof Bouvin mailto:n.o.bouvin@daimi.au.dk
* and Henning Jae jehoej@daimi.au.dk
* <P>
* You can run this in eclipse with the command line options
* <code> -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -DXcheck:jni</code>
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
class IETest

View File

@@ -13,9 +13,9 @@ import com.jacob.com.Variant;
* that the InvocationProxy code works with MS Word Events
* This also uses the 1.10
* InvocationProxy to receive the events.
* <p> supported command line options with default values are
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false
* -Dcom.jacob.debug=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
public class WordEventTest extends InvocationProxy {

View File

@@ -4,9 +4,9 @@ package com.jacob.test.powerpoint;
* $Id$
*
* This is really more of a multi threaded tester
*
* run with
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.ComThread;

View File

@@ -5,7 +5,10 @@ import com.jacob.com.SafeArray;
import com.jacob.com.Variant;
/**
* run with -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=false
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
* <p>
* SF 1085370
In my understatnding, an instance of SafeArray java
class has a

View File

@@ -4,9 +4,9 @@ package com.jacob.test.windowsmedia;
* partial test program from the sourceforge bug report 1453161
* that says you get a random "can't map name to dispid" when
* getting the URL from the player
*
* I run with options
* -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=false -Dcom.jacob.debug=true
* <p>
* May need to run with some command line options (including from inside Eclipse).
* Look in the docs area at the Jacob usage document for command line options.
*/
import com.jacob.activeX.*;