Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 180 lines (151 sloc) 5.117 kB
<?xml version="1.0" encoding="UTF-8"?>
<project name="libhyphenjna" default="jar" basedir=".">
<description>Builds the java bindings for hyphen.</description>
<path id="classpath">
<fileset dir="lib" includes="**/*.jar" />
</path>
<target name="clean">
<delete dir="build" />
</target>
<target name="compile">
<mkdir dir="build/classes" />
<javac srcdir="src" destdir="build/classes" debug="true" includeantruntime="false">
<classpath>
<path refid="classpath" />
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="build/jar" />
<jar destfile="build/jar/hyphen.jar">
<fileset dir="build/classes" />
<fileset dir="native-lib" />
</jar>
</target>
<target name="webstart" depends="jar"> <!-- untested - bpeter -->
<!--
Split the monolithic jna file into a shared one with java code and
platform sepecifc ones for each supported platform, this is needed for
webstart that handles native libs
-->
<zip destfile="build/jar/jna-jws.jar">
<zipfileset src="lib/jna.jar">
<exclude name="**/*.dll" />
<exclude name="**/*.so" />
<exclude name="**/*.jnilib" />
<exclude name="**/*.dylib" />
</zipfileset>
</zip>
<zip destfile="build/jar/jna-linux-i386.jar">
<zipfileset src="lib/jna.jar" includes="com/sun/jna/linux-i386/libjnidispatch.so" fullpath="libjnidispatch.so" />
</zip>
<zip destfile="build/jar/jna-linux-amd64.jar">
<zipfileset src="lib/jna.jar" includes="com/sun/jna/linux-amd64/libjnidispatch.so" fullpath="libjnidispatch.so" />
</zip>
<zip destfile="build/jar/jna-darwin.jar">
<zipfileset src="lib/jna.jar" includes="com/sun/jna/darwin/libjnidispatch.jnilib" fullpath="libjnidispatch.jnilib" />
</zip>
<zip destfile="build/jar/jna-win32-x86.jar">
<zipfileset src="lib/jna.jar" includes="com/sun/jna/win32-x86/jnidispatch.dll" fullpath="jnidispatch.dll" />
</zip>
<zip destfile="build/jar/jna-win32-amd64.jar">
<zipfileset src="lib/jna.jar" includes="com/sun/jna/win32-amd64/jnidispatch.dll" fullpath="jnidispatch.dll" />
</zip>
<!--
Create separate jar files with the hyphen natives as well.
-->
<jar destfile="build/jar/hyphen-jws.jar">
<fileset dir="build/classes" />
</jar>
<zip destfile="build/jar/hyphen-win32-x86.jar">
<fileset dir="native-lib">
<filename name="hyphen-win-x86-32.dll" />
</fileset>
</zip>
<zip destfile="build/jar/hyphen-win32-amd64.jar">
<fileset dir="native-lib">
<filename name="hyphen-win-x86-64.dll" />
</fileset>
</zip>
<zip destfile="build/jar/hyphen-linux-i386.jar">
<fileset dir="native-lib">
<filename name="libhyphen-linux-x86-32.so" />
</fileset>
</zip>
<zip destfile="build/jar/hyphen-linux-amd64.jar">
<fileset dir="native-lib">
<filename name="libhyphen-linux-x86-64.so" />
</fileset>
</zip>
<zip destfile="build/jar/hypen-linux-amd64.jar">
<fileset dir="native-lib">
<filename name="libhyphen-linux-x86-64.so" />
</fileset>
</zip>
<zip destfile="build/jar/hyphen-darwin-i386.jar">
<fileset dir="native-lib">
<filename name="hyphen-darwin-x86-32.*" />
</fileset>
</zip>
<zip destfile="build/jar/hyphen-darwin-amd64.jar">
<fileset dir="native-lib">
<filename name="hyphen-darwin-x86-64.*" />
</fileset>
</zip>
<zip destfile="build/jar/hyphen-darwin-ppc.jar">
<fileset dir="native-lib">
<filename name="hyphen-darwin-ppc-32.*" />
</fileset>
</zip>
</target>
<target name="dist" depends="webstart">
<zip destfile="build/hypen-jna-${version}.zip">
<fileset dir="build/jar" />
<fileset dir="lib" />
<fileset dir="." includes="src" />
</zip>
</target>
<target name="sign" depends="webstart">
<signjar alias="testonly" keystore="testkeystore" storepass="testtest" lazy="true">
<fileset dir="build/jar" includes="**/*.jar" />
</signjar>
</target>
<target name="native">
<exec executable="./native-build.pl" />
</target>
<target name="run" depends="jar">
<exec executable="java">
<arg value="-cp" />
<arg value="lib/jna.jar:build/jar/hyphen.jar" />
<arg value="name.benjaminpeter.hyphen.HyphenMain" />
<arg value="test/resources/hyph_mini_de.dic" />
<arg value="danke" />
</exec>
</target>
<target name="test" depends="compile">
<mkdir dir="build/test/classes" />
<delete>
<fileset dir="build/test/classes" includes="*.class"/>
</delete>
<javac srcdir="test/src" destdir="build/test/classes" debug="true" includeantruntime="false">
<classpath>
<path refid="classpath" />
<pathelement location="build/classes" />
</classpath>
</javac>
<junit>
<classpath>
<pathelement location="build/classes" />
<pathelement location="native-lib" />
<pathelement location="build/test/classes" />
<path refid="classpath" />
</classpath>
<formatter type="plain" usefile="false" /> <!-- to screen -->
<batchtest fork="yes">
<fileset dir="test/src">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.