Meikel  Brandmeyer avatar Meikel Brandmeyer committed accc065

Switched build system to Ivy

Comments (0)

Files changed (3)

-<project name="vimclojure" default="all">
+<project name="vimclojure" default="all"
+    xmlns:ivy="antlib:org.apache.ivy.ant">
 
-	<description>
-		Build with "ant all".
-	</description>
+    <property name="src.dir" location="src"/>
+    <property name="classes.dir" location="classes"/>
+    <property name="build.dir" location="build"/>
+    <property name="lib.dir" location="lib"/>
 
-	<property name="src" location="src"/>
-	<property name="build" location="classes"/>
-	<property name="jarfile" location="vimclojure.jar"/>
+    <property name="jar.file" location="${build.dir}/vimclojure.jar"/>
+    <property name="srcjar.file" location="${build.dir}/vimclojure-source.jar"/>
 
-	<property file="local.properties"/>
+    <property name="current.version" value="2.0"/>
 
-	<target name="init" depends="clean">
-		<tstamp/>
-		<mkdir dir="${build}"/>
-	</target>
+    <property file="local.properties"/>
 
-	<target name="aot" depends="init,nailgun-server"
-		description="Compile Clojure sources.">
-		<java classname="clojure.lang.Compile">
-			<classpath>
-				<pathelement location="${build}"/>
-				<pathelement location="${src}"/>
-				<pathelement location="${clojure.jar}"/>
-				<pathelement location="${clojure-contrib.jar}"/>
-			</classpath>
-			<sysproperty key="clojure.compile.path" value="${build}"/>
-			<arg value="de.kotka.vimclojure.gencompletions"/>
-			<arg value="de.kotka.vimclojure.util"/>
-			<arg value="de.kotka.vimclojure.repl"/>
-			<arg value="de.kotka.vimclojure.backend"/>
-			<arg value="de.kotka.vimclojure.nails"/>
-		</java>
-	</target>
+    <target name="init" description="--> create build directories">
+        <tstamp/>
+        <mkdir dir="${classes.dir}"/>
+        <mkdir dir="${build.dir}"/>
+        <mkdir dir="${lib.dir}"/>
+    </target>
 
-	<target name="nailgun-server" depends="init"
-		description="Compile the nailgun server.">
-		<javac destdir="${build}" srcdir="${src}"
-			includes="org/apache/**/*.java">
-		</javac>
-		<javac destdir="${build}" srcdir="${src}"
-			includes="com/martiansoftware/**/*.java">
-		</javac>
-		<copy todir="${build}">
-			<fileset dir="${src}" includes="com/martiansoftware/**"
-				excludes="com/martiansoftware/**/*.java"/>
-		</copy>
-	</target>
+    <target name="resolve" depends="init"
+        description="--> resolve dependencies with Ivy">
+        <ivy:retrieve />
+        <ivy:resolve />
+    </target>
 
-	<target name="nailgun-client" if="nailgun-client"
-		description="Compile the nailgun client using make.">
-		<exec executable="make">
-			<arg value="${nailgun-client}"/>
-		</exec>
-	</target>
+    <target name="aot" depends="nailgun-server,resolve,init"
+        description="--> AOT compile clojure sources">
+        <java classname="clojure.lang.Compile">
+            <classpath>
+                <path location="${classes.dir}"/>
+                <path location="${src.dir}"/>
+                <fileset dir="${lib.dir}" includes="**/*.jar"/>
+            </classpath>
+            <sysproperty key="clojure.compile.path" value="${classes.dir}"/>
+            <arg value="de.kotka.vimclojure.gencompletions"/>
+            <arg value="de.kotka.vimclojure.util"/>
+            <arg value="de.kotka.vimclojure.repl"/>
+            <arg value="de.kotka.vimclojure.backend"/>
+            <arg value="de.kotka.vimclojure.nails"/>
+        </java>
+    </target>
 
-	<target name="jar" depends="aot,nailgun-server"
-		description="Create jar file.">
-		<jar jarfile="${jarfile}">
-			<path location="README.txt"/>
-			<path location="LICENSE.txt"/>
-			<fileset dir="${src}" includes="**/*.clj"/>
-			<fileset dir="${build}" includes="de/kotka/**"/>
-			<fileset dir="${build}" includes="org/apache/**"/>
-			<fileset dir="${build}" includes="com/martiansoftware/**"/>
-			<fileset dir="${build}" includes="clojure/proxy/**"/>
-			<manifest>
-				<attribute name="Class-Path" value="."/>
-			</manifest>
-		</jar>
-	</target>
+    <target name="nailgun-server" depends="resolve,init"
+        description="--> compile the nailgun server">
+        <javac destdir="${classes.dir}" srcdir="${src.dir}"
+            includes="org/apache/**/*.java"/>
+        <javac destdir="${classes.dir}" srcdir="${src.dir}"
+            includes="com/martiansoftware/**/*.java"/>
+        <copy todir="${classes.dir}">
+            <fileset dir="${src.dir}" includes="com/martiansoftware/**"
+                excludes="com/martiansoftware/**/*.java"/>
+        </copy>
+    </target>
 
-	<target name="all" depends="jar,nailgun-client"/>
+    <target name="nailgun-client" if="nailgun-client"
+        description="--> compile the nailgun client using make">
+        <exec executable="make">
+            <arg value="${nailgun-client}"/>
+        </exec>
+    </target>
 
-	<target name="clean"
-		description="Remove autogenerated files and directories.">
-		<delete dir="${build}"/>
-		<delete file="${jarfile}"/>
-		<delete file="${nailgun-client}"/>
-	</target>
+    <target name="artifacts" depends="aot,nailgun-server"
+        description="--> create source and artifact jars">
+        <jar jarfile="${jar.file}">
+            <path location="README.txt"/>
+            <path location="LICENSE.txt"/>
+            <fileset dir="${classes.dir}" includes="de/kotka/**"/>
+            <fileset dir="${classes.dir}" includes="org/apache/**"/>
+            <fileset dir="${classes.dir}" includes="com/martiansoftware/**"/>
+            <fileset dir="${classes.dir}" includes="clojure/proxy/**"/>
+            <manifest>
+                <attribute name="Class-Path" value="."/>
+            </manifest>
+        </jar>
+        <jar jarfile="${srcjar.file}">
+            <path location="README.txt"/>
+            <path location="LICENSE.txt"/>
+            <fileset dir="${src.dir}" includes="**/*"/>
+        </jar>
+    </target>
 
-	<target name="install" if="vimdir"
-		description="Install the vim plugin.">
-		<mkdir dir="${vimdir}/autoload"/>
-		<mkdir dir="${vimdir}/doc"/>
-		<mkdir dir="${vimdir}/indent"/>
-		<mkdir dir="${vimdir}/syntax"/>
-		<mkdir dir="${vimdir}/ftdetect"/>
-		<mkdir dir="${vimdir}/ftplugin"/>
-		<mkdir dir="${vimdir}/ftplugin/clojure"/>
+    <target name="all" depends="artifacts,nailgun-client"
+        description="--> build the whole project"/>
 
-		<copy todir="${vimdir}/autoload">
-			<fileset dir="autoload" includes="vimclojure.vim"/>
-		</copy>
-		<copy todir="${vimdir}/doc">
-			<fileset dir="doc" includes="clojure.txt"/>
-		</copy>
-		<copy todir="${vimdir}/indent">
-			<fileset dir="indent" includes="clojure.vim"/>
-		</copy>
-		<copy todir="${vimdir}/syntax">
-			<fileset dir="syntax" includes="clojure.vim"/>
-		</copy>
-		<copy todir="${vimdir}/ftdetect">
-			<fileset dir="ftdetect" includes="clojure.vim"/>
-		</copy>
-		<copy todir="${vimdir}/ftplugin">
-			<fileset dir="ftplugin" includes="clojure.vim"/>
-		</copy>
-		<copy todir="${vimdir}/ftplugin/clojure">
-			<fileset dir="ftplugin/clojure" includes="*.txt"/>
-		</copy>
-	</target>
+    <target name="clean" description="--> clean generated files">
+        <delete dir="${classes.dir}"/>
+        <delete dir="${build.dir}"/>
+        <delete file="${nailgun-client}"/>
+    </target>
+
+    <target name="clean-lib" description="--> clean library files">
+        <delete dir="${lib.dir}"/>
+    </target>
+
+    <target name="clean-local" description="--> clean local repository files">
+        <ivy:info />
+        <delete dir="${ivy.local.default.root}/${ivy.organisation}/${ivy.module}"/>
+    </target>
+
+    <target name="clean-all" depends="clean,clean-lib,clean-local"
+        description="--> clean all project files"/>
+
+    <target name="install" if="vimdir"
+        description="--> install the vim plugin">
+        <mkdir dir="${vimdir}/autoload"/>
+        <mkdir dir="${vimdir}/doc"/>
+        <mkdir dir="${vimdir}/indent"/>
+        <mkdir dir="${vimdir}/syntax"/>
+        <mkdir dir="${vimdir}/ftdetect"/>
+        <mkdir dir="${vimdir}/ftplugin"/>
+        <mkdir dir="${vimdir}/ftplugin/clojure"/>
+
+        <copy todir="${vimdir}/autoload">
+            <fileset dir="autoload" includes="vimclojure.vim"/>
+        </copy>
+        <copy todir="${vimdir}/doc">
+            <fileset dir="doc" includes="clojure.txt"/>
+        </copy>
+        <copy todir="${vimdir}/indent">
+            <fileset dir="indent" includes="clojure.vim"/>
+        </copy>
+        <copy todir="${vimdir}/syntax">
+            <fileset dir="syntax" includes="clojure.vim"/>
+        </copy>
+        <copy todir="${vimdir}/ftdetect">
+            <fileset dir="ftdetect" includes="clojure.vim"/>
+        </copy>
+        <copy todir="${vimdir}/ftplugin">
+            <fileset dir="ftplugin" includes="clojure.vim"/>
+        </copy>
+        <copy todir="${vimdir}/ftplugin/clojure">
+            <fileset dir="ftplugin/clojure" includes="*.txt"/>
+        </copy>
+    </target>
+
+    <target name="publish"
+        description="--> publish artifacts in the shared repository">
+        <ivy:info />
+        <ivy:buildnumber
+            organisation="${ivy.organisation}"
+            module="${ivy.module}"
+            revision="${current.version}"/>
+        <ivy:publish
+            resolver="shared"
+            artifactspattern="${build.dir}/[artifact].[ext]"
+            pubrevision="${ivy.new.revision}"
+            status="release"/>
+    </target>
+
+    <target name="publish-local"
+        description="--> publish artifacts in the local repository">
+        <tstamp>
+            <format property="now" pattern="yyyyMMddHHmmss"/>
+        </tstamp>
+        <ivy:info />
+        <ivy:publish
+            resolver="local"
+            artifactspattern="${build.dir}/[artifact].[ext]"
+            pubrevision="${now}"
+            pubdate="${now}"
+            status="integration"
+            forcedeliver="true"/>
+    </target>
 
 </project>
-<!-- vim: set ts=4 sw=4 : -->
+<ivy-module version="2.0">
+
+    <info organisation="de.kotka" module="vimclojure" status="integration"/>
+
+    <configurations>
+        <conf name="default"/>
+        <conf name="dev" extends="default"/>
+    </configurations>
+
+    <publications>
+        <artifact name="vimclojure" type="jar" conf="default"/>
+        <artifact name="vimclojure-source" type="jar" conf="dev"/>
+    </publications>
+
+    <dependencies>
+        <dependency org="org.clojure" name="clojure-lang" rev="1.0.0"
+            conf="*->default"/>
+        <dependency org="org.clojure" name="clojure-contrib"
+            rev="1.0.0" conf="*->def,pprint"/>
+    </dependencies>
+
+</ivy-module>
+<ivysettings>
+
+    <!-- Load the standard Ivy settings. Which just extend them for Clojure. -->
+    <include url="${ivy.default.settings.dir}/ivysettings.xml"/>
+
+    <!-- Include the Kotka ivyrep for Clojure and Contrib -->
+    <include url="http://kotka.de/ivy/ivysettings.xml"/>
+
+</ivysettings>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.