Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
James Watson committed Mar 31, 2016
1 parent 1ec141e commit 074231c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 28 deletions.
79 changes: 61 additions & 18 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="solrmongoimporter" default="jar">
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="solr-mongo-importer" default="build"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="antlib:org.apache.ivy.ant ">

<property file="build.properties"/>
<property name="version" value="1.1.0"/>
<property name="build.dir" value="build"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="classes.dir" value="${build.dir}/classes"/>

<target name="clean">
<delete dir="build"/>
</target>

<target name="init" depends="clean">
<mkdir dir="build"/>
<!-- <ivy:retrieve /> -->
</target>
<property name="ivy.install.version" value="2.1.0-rc2"/>
<condition property="ivy.home" value="${env.IVY_HOME}">
<isset property="env.IVY_HOME"/>
</condition>
<property name="ivy.home" value="${user.home}/.ant"/>
<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>

<path id="build.classpath">
<fileset dir=".">
<include name="lib/*.jar"/>
</fileset>
</path>

<path id="jars">
<fileset dir="lib" includes="**/*.jar"/>
</path>

<pathconvert property="mf.classpath" pathsep=" ">
<path refid="build.classpath"/>
<mapper>
Expand All @@ -28,20 +35,56 @@
</mapper>
</pathconvert>

<target name="clean">
<delete dir="${build.dir}"/>

<path id="jars">
<fileset dir="lib" includes="**/*.jar"/>
</path>
</target>

<target name="compile" depends="init">
<target name="resolve" description="Use ivy to resolve classpaths">
<ivy:resolve/>
<ivy:report todir='${build.dir}/ivy' graph='false' xml='false'/>
<ivy:cachepath pathid="compile.path" conf="compile"/>
</target>

<mkdir dir="build"/>
<javac srcdir="src" destdir="build" classpathref="jars" debug="on"/>
<target name="init" depends="ivy-init, clean">
<mkdir dir="${build.dir}"/>
<mkdir dir="${jar.dir}"/>
<mkdir dir="${classes.dir}"/>
</target>

<target name="compile">
<ivy:retrieve/>
<javac srcdir="src" destdir="${classes.dir}" classpathref="jars" debug="on" includeantruntime="false"/>
<jar basedir="${classes.dir}" destfile="${jar.dir}/${ant.project.name}-${version}.jar"/>
</target>


<target name="jar" depends="compile">
<jar basedir="build" destfile="dest/solr-mongo-importer.jar" />
<target name="build" depends="init, resolve, compile">

</target>


<target name="ivy-init" depends="ivy-install" unless="skip.ivy">
<ivy:settings file="ivy-settings.xml"/>
</target>


<target name="ivy-download" unless="offline">
<mkdir dir="${ivy.jar.dir}"/>
<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>

<target name="ivy-install" depends="ivy-download">
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>

</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>

<target name="ivy-clean">
<ivy:cleancache/>
</target>
</project>
15 changes: 15 additions & 0 deletions ivy-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
<settings defaultResolver="custom-chain"/>
<resolvers>
<chain name="custom-chain">
<ibiblio name="restlet" m2compatible="true" root="http://maven.restlet.com"/>
<ibiblio name="central" m2compatible="true"/>
</chain>
</resolvers>
<modules>
<module organization="org.restlet.jee" resolver="restlet"/>
<module organization="restlet" resolver="restlet"/>
<module organization="org.restlet" resolver="restlet"/>
</modules>
</ivysettings>
17 changes: 7 additions & 10 deletions ivy.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0">
<info organisation="com.example" module="common-libs"/>
<info organisation="neso.solr" module="solr-mongo-importer"/>
<configurations>
<conf name="runtime" transitive="true" visibility="public" />
<conf name="master" transitive="true" visibility="public" />
<conf name="compile" transitive="true" visibility="public" />
<conf name="default" transitive="true" visibility="public" extends="master" />
<conf name="compile" transitive="true" visibility="public"/>
</configurations>
<dependencies>
<dependency org="org.mongodb" name="mongo-java-driver" rev="2.11.1"
conf="compile->compile(*),master(*);runtime->runtime(*);master->master(*)"/>
<dependency org="org.apache.solr" name="solr-dataimporthandler" rev="3.6.0"
conf="compile->compile(*),master(*);runtime->runtime(*);master->master(*)"/>
conf="compile->default"/>
<dependency org="junit" name="junit" rev="4.3"
conf="compile->compile(*),master(*);runtime->runtime(*);master->master(*)"/>
conf="compile->default"/>
<dependency org="org.apache.solr" name="solr-dataimporthandler" rev="5.5.0"
conf="compile->default"/>
</dependencies>
</ivy-module>

0 comments on commit 074231c

Please sign in to comment.