Navigation Menu

Skip to content

Commit

Permalink
Imported Upstream version 3.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
paul cannon committed Nov 6, 2010
1 parent b69cbbd commit 58c4427
Show file tree
Hide file tree
Showing 191 changed files with 73,051 additions and 206 deletions.
Empty file modified LICENSE.txt 100644 → 100755
Empty file.
106 changes: 68 additions & 38 deletions build.xml
Expand Up @@ -22,25 +22,26 @@
<property name="dynlink.native" value="false"/>
<property name="native" location="native"/>
<property name="src" location="src"/>
<property name="contrib" location="contrib"/>
<property name="dist" location="dist"/>
<property name="test.src" location="test"/>
<property name="doc" location="doc"/>
<property name="javadoc" location="${doc}/javadoc"/>
<property name="stylesheet" location="${javadoc}/doc/css/javadoc.css"/>
<property name="vendor" value="JNA Development Team"/>
<property name="copyright"
value="Copyright &amp;copy; 2007-2009 Timothy Wall. All Rights Reserved."/>
value="Copyright &amp;copy; 2007-2010 Timothy Wall. All Rights Reserved."/>
<buildnumber/>
<!-- JNA library release version -->
<property name="jna.major" value="3"/>
<property name="jna.minor" value="2"/>
<property name="jna.revision" value="4"/>
<property name="jna.revision" value="7"/>
<property name="jna.build" value="${build.number}"/>
<property name="jna.version" value="${jna.major}.${jna.minor}.${jna.revision}"/>
<!-- jnidispatch library release version -->
<property name="jni.major" value="3"/>
<property name="jni.minor" value="2"/>
<property name="jni.revision" value="1"/>
<property name="jni.revision" value="2"/>
<property name="jni.build" value="${build.number}"/>
<property name="jni.version" value="${jni.major}.${jni.minor}.${jni.revision}"/>
<property name="jni.md5" value="c870290c36c8d3fdf85db7c782febc3f"/>
Expand All @@ -59,7 +60,8 @@

<target name="default" depends="test" description="Build and Test."/>

<import file="nbproject/profiler-build-impl.xml"/>
<!-- uncomment for netbeans profiling -->
<!--<import file="nbproject/profiler-build-impl.xml"/>-->
<target name="init" depends="-setup"/>
<target name="compile-test-single" depends="compile-tests"/>
<target name="compile-single" depends="compile"/>
Expand Down Expand Up @@ -137,7 +139,7 @@
<condition property="jdk.home" value="${java.home}/..">
<available file="${java.home}/../include"/>
</condition>
<fail unless="jdk.home" message="JAVA_HOME/java.home must be a JDK, not JRE"/>
<fail unless="jdk.home" message="Can't find JNI headers"/>
<condition property="libjsig"
value="${java.home}/lib/${jre.arch}/libjsig.so" else="">
<available file="${java.home}/lib/${jre.arch}/libjsig.so"/>
Expand All @@ -156,7 +158,7 @@
</target>

<target name="-setup" depends="-dynamic-properties">
<path id="compile-test.path">
<path id="compile-test.path">
<pathelement path="${test.src}"/>
<path id="test.libs">
<fileset dir="lib">
Expand All @@ -168,12 +170,11 @@
<path id="src.path">
<pathelement location="${src}"/>
</path>
</path>
</path>
</path>

<path id="test.runpath">
<pathelement path="${build}/${jar}"/>
<pathelement path="${build}/examples.jar"/>
<pathelement path="${test.classes}"/>
<pathelement path="lib/clover.jar"/>
<path refid="test.libs"/>
Expand All @@ -197,8 +198,6 @@
<patternset id="jar-compiled">
<include name="com/sun/jna/*"/>
<include name="com/sun/jna/**/*"/>
<exclude name="com/sun/jna/examples/*"/>
<exclude name="com/sun/jna/examples/**/*"/>
</patternset>
</srcfiles>
</uptodate>
Expand All @@ -209,29 +208,40 @@
<manifest>
<attribute name="Main-Class" value="com.sun.jna.Native"/>
<section name="com/sun/jna/">
<attribute name="Manifest-Version" value="1.0"/>
<attribute name="Implementation-Title" value="${impl.title}"/>
<attribute name="Implementation-Vendor" value="${vendor}"/>
<attribute name="Implementation-Version" value="${impl.version}"/>
<attribute name="Specification-Title" value="${spec.title}"/>
<attribute name="Specification-Vendor" value="${spec.vendor}"/>
<attribute name="Specification-Version" value="${spec.version}"/>
<!-- OSGi Bundle attributes -->
<attribute name="Bundle-ManifestVersion" value="2"/>
<attribute name="Bundle-Name" value="jna"/>
<attribute name="Bundle-Description" value="JNA Library"/>
<attribute name="Bundle-SymbolicName" value="com.sun.jna"/>
<attribute name="Bundle-Version" value="${spec.version}"/>
<attribute name="Bundle-RequiredExecutionEnvironment" value="J2SE-1.4"/>
<attribute name="Bundle-Vendor" value="${vendor}"/>
<attribute name="Bundle-ActivationPolicy" value="lazy"/>
<attribute name="Export-Package" value="com.sun.jna*"/>
</section>
</manifest>
<fileset dir="${classes}" excludes="${jar.omitted}">
<patternset refid="jar-compiled"/>
</fileset>
</jar>
</target>
<target name="examples" depends="jar,native">
<jar jarfile="${build}/examples.jar">
<manifest>
<attribute name="Class-Path" value="jna.jar"/>
<attribute name="Main-Class" value="com.sun.jna.examples.ShapedWindowDemo"/>
</manifest>
<fileset dir="${src}" includes="**/examples/**/*.png"/>
<fileset dir="${classes}" includes="**/examples/*,**/examples/**/*"/>
<fileset dir="${classes}" includes="jnidispatch.dll"/>
</jar>

<target name="contrib-jars" depends="jar" description="Build contrib jars">
<subant target="jar">
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
<property name="libs.junit.classpath" location="lib/junit.jar"/>
<!-- platform.jar needs to be built first -->
<fileset dir="${contrib}" includes="platform/build.xml" />
<fileset dir="${contrib}" includes="*/build.xml" excludes="platform/build.xml"/>
</subant>
</target>

<target name="javah" depends="compile">
Expand Down Expand Up @@ -318,8 +328,8 @@
<target name="native" depends="-setup,javah,-native-api-check,rsrc"
description="Build native libraries. Use 'ant -DCC=xxx' to build using a compiler other than gcc">
<property name="comment" value="# auto-generated by ant"/>
<replaceregexp match="^VERSION=.*"
replace="VERSION=${jni.version} ${comment}"
<replaceregexp match="^JNA_JNI_VERSION=.*"
replace="JNA_JNI_VERSION=${jni.version} ${comment}"
file="native/Makefile" byline="true"/>
<replaceregexp match="^CHECKSUM=.*"
replace="CHECKSUM=${jni.md5} ${comment}"
Expand All @@ -336,6 +346,10 @@
<condition property="make.SDKROOT" value="SDKROOT=${SDKROOT}">
<isset property="SDKROOT"/>
</condition>
<condition property="make.SDKROOT"
value="SDKROOT=/Developer/SDKs/MacOSX10.6.sdk">
<available file="/Developer/SDKs/MacOSX10.6.sdk"/>
</condition>
<condition property="make.SDKROOT"
value="SDKROOT=/Developer/SDKs/MacOSX10.5.sdk">
<available file="/Developer/SDKs/MacOSX10.5.sdk"/>
Expand All @@ -361,6 +375,7 @@
<os name="OpenBSD"/>
</or>
</condition>

<!-- Default make program -->
<property name="make" value="make"/>

Expand All @@ -375,7 +390,7 @@
<arg value="${make.SDKROOT}"/>
<arg value="${make.ARCH}"/>
<arg value="${make.PATH}"/>
<arg value="VERSION=${jni.version}"/>
<arg value="JNA_JNI_VERSION=${jni.version}"/>
<arg value="CHECKSUM=${jni.md5}"/>
</exec>
<mkdir dir="${classes}/com/sun/jna/${os.prefix}"/>
Expand All @@ -400,8 +415,8 @@
</jar>
</target>

<target name="compile-tests" depends="compile,native,jar"
description="Compile all test code">
<target name="compile-tests" depends="compile,native,jar"
description="Compile all test code">
<javac classpathref="compile-test.path"
source="${test.compatibility}"
target="${test.compatibility}"
Expand All @@ -426,18 +441,18 @@
<fileset dir="${build}/jws" includes="jna.jar,jna-test.jar,junit.jar,jnidispatch.jar,clover.jar"/>
</signjar>
</target>

<!-- When running tests from an IDE, be sure to set jna.library.path -->
<!-- to where the test library (testlib) is found. -->
<target name="test" depends="jar,examples,compile-tests"
<target name="test" depends="jar,contrib-jars,compile-tests"
description="Run all unit tests">
<property name="test.fork" value="yes"/>
<property name="reports.junit" location="${reports}/junit"/>
<property name="results.junit" location="${build}/junit-results"/>
<mkdir dir="${results.junit}"/>
<echo>Saving test results in ${results.junit}</echo>
<property name="tests.stdcall" value="**/win32/*StdCallTest.java"/>
<condition property="tests.platform" value="**/win32/*Test.java">
<condition property="tests.platform" value="**/win32/**/*Test.java">
<os family="windows"/>
</condition>
<condition property="tests.exclude" value="**/win32/*StdCallTest.java">
Expand Down Expand Up @@ -471,12 +486,14 @@
<batchtest todir="${results.junit}">
<fileset dir="${test.src}">
<include name="com/sun/jna/*Test.java"/>
<include name="com/sun/jna/examples/*Test.java"/>
<include name="${tests.platform}"/>
<exclude name="${tests.exclude}"/>
</fileset>
</batchtest>
</junit>
<subant target="test">
<fileset dir="${contrib}" includes="platform/build.xml"/>
</subant>
<junitreport todir="${results.junit}">
<fileset dir="${results.junit}">
<include name="TEST-*.xml"/>
Expand All @@ -500,7 +517,7 @@
<mkdir dir="${reports.clover}"/>
<clover-report>
<current outfile="${reports.clover}" title="clover">
<fileset dir="." includes="**/*.java" excludes="**/examples/**/*.java"/>
<fileset dir="." includes="**/*.java" />
<testresults dir="${results.junit}" includes="TEST-*.xml"/>
<format type="html"/>
</current>
Expand All @@ -520,7 +537,7 @@
sourcepathref="src.path"
classpathref="compile.path"
maxmemory="256m"
packagenames="com.sun.jna,com.sun.jna.ptr,com.sun.jna.types,com.sun.jna.examples,com.sun.jna.examples.win32,com.sun.jna.exmaples.unix"
packagenames="com.sun.jna,com.sun.jna.ptr,com.sun.jna.types,com.sun.jna.platform,com.sun.jna.platform.win32,com.sun.jna.exmaples.unix"
overview="${src}/com/sun/jna/overview.html"
destdir="${javadoc}">
<!-- stylesheetfile="${stylesheet}" -->
Expand All @@ -536,15 +553,16 @@
</packageset>

<group title="Java Native Access" packages="com.sun.jna,com.sun.jna.ptr,com.sun.jna.types,com.sun.jna.win32"/>
<group title="Examples" packages="com.sun.jna.examples,com.sun.jna.examples.dnd"/>
<group title="Unix Examples" packages="com.sun.jna.examples.unix"/>
<group title="Windows Examples" packages="com.sun.jna.examples.win32"/>

<group title="Platform Specific" packages="com.sun.jna.platform"/>

<arg value="-notimestamp"/>
</javadoc>
<subant target="javadoc">
<fileset dir="${contrib}" includes="platform/build.xml"/>
</subant>
</target>

<target name="dist" depends="jar,compile-tests,native,examples,javadoc"
<target name="dist" depends="jar,contrib-jars,compile-tests,native,javadoc"
description="Build distribution files">
<jar jarfile="${dist}/jna.jar" duplicate="preserve">
<manifest>
Expand Down Expand Up @@ -602,18 +620,27 @@
<copy todir="${dist}">
<fileset dir="${build}">
<include name="${native.jar}"/>
<include name="examples.jar"/>
</fileset>
<fileset dir="${contrib}/platform/dist">
<include name="platform.jar" />
</fileset>
</copy>
<copy todir="${dist}/jnacontrib" flatten="true">
<fileset dir="${contrib}">
<include name="**/build/demo-*.jar" />
</fileset>
</copy>
<zip zipfile="${dist}/doc.zip">
<zipfileset dir="${javadoc}" prefix="javadoc"/>
<zipfileset dir="${contrib}/platform/dist/javadoc" prefix="platform/javadoc"/>
</zip>
<!-- JNA sources only, for use in Linux build from source/shared libffi -->
<zip zipfile="${dist}/src.zip">
<zipfileset dir="." includes="build.xml,LICENSE.txt"/>
<zipfileset dir="${src}" includes="**/*.java" prefix="src"/>
<zipfileset dir="${test.src}" includes="**/*.java" prefix="test"/>
<zipfileset dir="${native}" excludes="libffi,libffi/**/*" prefix="native"/>
<zipfileset dir="${native}" excludes="libffi,libffi/**/*,build,build/**/*" prefix="native"/>
<zipfileset dir="${contrib}/platform" includes="**/*.java" prefix="contrib/platform"/>
</zip>
<!-- Full sources required to build and test everything -->
<zip zipfile="${dist}/src-full.zip">
Expand All @@ -638,6 +665,9 @@
<fileset dir="${javadoc}"/>
<fileset dir="." includes="*~,**/*~"/>
</delete>
<subant target="clean">
<fileset dir="${contrib}" includes="*/build.xml"/>
</subant>
</target>

</project>
Expand Down
4 changes: 4 additions & 0 deletions contrib/README
@@ -0,0 +1,4 @@
This directory contains code which has been contributed by JNA users. If no
tests are included, you should assume the code has only been checked for
compile-time errors :)

8 changes: 8 additions & 0 deletions contrib/alphamaskdemo/.classpath
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/jna/dist/jna.jar"/>
<classpathentry kind="src" path="/platform"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions contrib/alphamaskdemo/.project
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>alphamaskdemo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

0 comments on commit 58c4427

Please sign in to comment.