Initial commit of jsword-minimalbible

Split off from the jsword-minimalbible folder in MinimalBible
This commit is contained in:
Bradlee Speice 2014-04-23 22:39:40 -04:00
commit 2b091f4a2b
6 changed files with 228 additions and 0 deletions

6
.classpath Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
/bin
/build
/distribution
/ivy
/tools

17
.project Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>jsword-minimalbible</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>

167
build.xml Normal file
View File

@ -0,0 +1,167 @@
<project name="buildJswordTweakedJar" default="copyJarsToMinimalBible"
basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- Much of this code taken lovingly from https://github.com/mjdenham/and-bible/blob/master/jsword-tweaks/build.xml -->
<property name="jsword.project" location="../jsword" />
<property name="jsword.src" location="${jsword.project}/src/main/java" />
<property name="jsword.resources" location="${jsword.project}/src/main/resources" />
<property name="minbible.jsword.src" location="src/main/java/jsword" />
<property name="build.src" location="build/src" />
<property name="build.class" location="build/class" />
<property name="distribution" location="distribution" />
<property name="MinimalBible" location="../MinimalBible" />
<dirname property="core.basedir" file="${ant.file.core}" />
<property name="jsword-tweaks.home" location="${core.basedir}" />
<property name="jsword-dependencydir" location="${jsword-tweaks.home}/lib/jars" />
<path id="classpath">
<!-- First set of jars is given us by ivy -->
<fileset dir="${jsword-dependencydir}" includes="*.jar" />
<fileset dir="./libs" includes="*.jar" />
</path>
<target name="clean">
<delete dir="${build.src}" />
<delete dir="${build.class}" />
<delete dir="${distribution}" />
<delete dir="${jsword-dependencydir}" />
</target>
<target name="init" depends="clean">
<tstamp />
<mkdir dir="${build.src}" />
<mkdir dir="${build.class}" />
<mkdir dir="${distribution}" />
<mkdir dir="${jsword-dependencydir}" />
</target>
<target name="mergeCode" depends="init">
<copy todir="${build.src}">
<fileset dir="${jsword.src}" />
<fileset dir="${jsword.resources}">
<exclude name="org/crosswire/jsword/versification/**" />
</fileset>
</copy>
<copy todir="${build.src}" filtering="yes">
<fileset dir="${jsword.resources}">
<include name="org/crosswire/jsword/versification/**" />
</fileset>
<!-- zerosUnmapped causes exceptions and does not map verse 0 so comment
it out -->
<filterchain>
<tokenfilter>
<replaceregex pattern="!zerosUnmapped"
replace="#!zerosUnmapped // commented out" />
</tokenfilter>
</filterchain>
</copy>
<!-- switch the Chinese localisation defaults around so default CN is simplified
and TW is Traditional -->
<copy file="${jsword.resources}/BibleNames_zh.properties" tofile="${build.src}/BibleNames_zh_TW.properties" />
<copy file="${jsword.resources}/BibleNames_zh_CN.properties"
tofile="${build.src}/BibleNames_zh.properties" overwrite="true" />
<!--
<copy todir="${build.src}" overwrite="true">
<fileset dir="${minbible.jsword.src}" />
</copy>
-->
</target>
<target name="compile" depends="mergeCode, ivy">
<javac srcdir="${build.src}" destdir="${build.class}"
classpathref="classpath" debug="true" source="1.6" target="1.6" />
</target>
<target name="jar" depends="compile">
<!-- And use JarJar to shade the HttpClient -->
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${jsword-dependencydir}/jarjar-1.3.jar" />
<jarjar jarfile="${distribution}/jsword.jar">
<fileset dir="${build.class}" />
<!-- need to include the .properties and .plugin files -->
<fileset dir="${build.src}">
<exclude name="**/*.java" />
<exclude name="**/*.html" />
</fileset>
<zipgroupfileset dir="${jsword-dependencydir}" includes="*.jar" excludes="junit-*.jar, hamcrest-*.jar, jarjar-*.jar" />
<rule pattern="org.apache.http.**" result="org.apache.shaded.http.@1" />
</jarjar>
<!-- We can use regular jar to build the src -->
<jar jarfile="${distribution}/jsword-src.jar" basedir="${build.src}" />
</target>
<target name="copyJarsToMinimalBible" depends="jar"
description="Copy generated jars to And Bible for use">
<copy todir="${MinimalBible}/libs">
<fileset dir="${distribution}" includes="*.jar" excludes="*-src.jar" />
<!-- We only need to include jsword.jar, the jarjar already included dependencies. -->
</copy>
<copy todir="${MinimalBible}/libs-src">
<fileset dir="${distribution}" includes="*-src.jar" />
</copy>
</target>
<!--=======================================================================
== Use ivy to manage external jars. == These are properties related to ivy.
========================================================================= -->
<property name="ivy.version" value="2.3.0" />
<property name="tools.home" location="${jsword-tweaks.home}/tools" />
<property name="ivy.home" location="${tools.home}/ivy" />
<property name="ivy.url"
value="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" />
<property name="ivy.jar.file" location="${ivy.home}/ivy-${ivy.version}.jar" />
<property name="ivy.quiet" value="default" /> <!-- default or quiet -->
<property name="ivy.sync" value="false" /> <!-- true or false -->
<property name="ivy.project.dir" location="${jsword-tweaks.home}" />
<property name="ivy.lib.dir" location="${ivy.project.dir}/lib" />
<property name="ivy.dep.file" location="${ivy.project.dir}/ivy.xml" />
<property name="ivy.default.ivy.user.dir" location="${ivy.project.dir}/ivy" />
<!-- Ivy.sync controls whether only the current version of jar is allowed.
== This is good when updating the project, but not from day-to-day == since
we build extra stuff into the same location. Having sync="true" == causes
that to be deleted and need to be restored. -->
<target name="ivy" description="Retrieve dependencies with ivy"
depends="ivy.task">
<ivy:retrieve sync="${ivy.sync}"
pattern="${ivy.lib.dir}/[type]s/[artifact]-[revision].[ext]" log="${ivy.quiet}" />
<ivy:cachepath pathid="default.path" />
</target>
<target name="ivy.clean" description="Remove the ivy installation">
<delete dir="${ivy.home}" />
</target>
<target name="ivy.clean-cache" description="Remove dependent jars that ivy manages"
depends="ivy.task">
<ivy:cleancache />
</target>
<!-- Make ivy visible to Ant -->
<target name="ivy.task" depends="ivy.download">
<path id="ivy.lib.path">
<fileset dir="${ivy.home}" includes="*.jar" />
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant"
classpathref="ivy.lib.path" />
</target>
<!-- Download ivy -->
<target name="ivy.download" depends="ivy.check" unless="ivy.present">
<mkdir dir="${ivy.home}" />
<!-- download Ivy from web site so that it can be used even without any
special installation -->
<get src="${ivy.url}" dest="${ivy.jar.file}" usetimestamp="true" />
</target>
<!-- See if Ivy is installed -->
<target name="ivy.check">
<available file="${ivy.jar.file}" type="file" property="ivy.present" />
</target>
</project>

30
ivy.xml Normal file
View File

@ -0,0 +1,30 @@
<ivy-module version="2.0">
<info organisation="org.crosswire" module="jsword"/>
<dependencies>
<dependency org="commons-codec" name="commons-codec" rev="1.9" conf="default->master,sources" />
<dependency org="commons-net" name="commons-net" rev="3.3" conf="default->master,sources" />
<dependency org="org.apache.commons" name="commons-compress" rev="1.7" conf="default->master,sources" />
<dependency org="org.tukaani" name="xz" rev="1.4" conf="default->master,sources" />
<dependency org="org.apache.httpcomponents" name="httpcore" rev="4.3.2" conf="default->master,sources" />
<dependency org="org.apache.httpcomponents" name="httpclient" rev="4.3.2" conf="default->master,sources" />
<dependency org="org.jdom" name="jdom2" rev="2.0.5" conf="default->master,sources" />
<dependency org="org.apache.lucene" name="lucene-core" rev="3.0.3" conf="default->master,sources" />
<dependency org="org.apache.lucene" name="lucene-analyzers" rev="3.0.3" conf="default->master,sources" />
<dependency org="org.apache.lucene" name="lucene-smartcn" rev="3.0.3" conf="default->master,sources" />
<dependency org="org.apache.lucene" name="lucene-snowball" rev="3.0.3" conf="default->master,sources" />
<dependency org="junit" name="junit" rev="4.11" conf="default->master,sources" />
<dependency org="org.hamcrest" name="hamcrest-library" rev="1.3"/>
<dependency org="com.ibm.icu" name="icu4j" rev="52.1" conf="default->master,sources" />
<dependency org="org.slf4j" name="slf4j-api" rev="1.7.6" conf="default->master,sources" />
<dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.7.6" conf="default->master,sources" />
<dependency org="org.slf4j" name="slf4j-jdk14" rev="1.7.6" conf="default->master,sources" />
<!-- dependency org="xalan" name="xalan" rev="2.7.1" conf="default->master,sources" / -->
<!-- dependency org="xalan" name="serializer" rev="2.7.1" conf="default->master,sources" / -->
<!-- dependency org="xerces" name="xercesImpl" rev="2.11.0" conf="default->master,sources" / -->
<!-- And to fix the HttpClient shenanigans...
http://stackoverflow.com/questions/20238421/java-lang-nosuchfielderror-org-apache-http-message-basiclineformatter-instance -->
<dependency org="com.googlecode.jarjar" name="jarjar" rev="1.3" />
</dependencies>
</ivy-module>

3
lib/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/javadocs
/sources
/jars