Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 180 lines (151 sloc) 5.117 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
<?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>
Something went wrong with that request. Please try again.