1. Meikel Brandmeyer
  2. lazymap

Commits

Meikel Brandmeyer  committed 0715942

Switched build system to Ivy

  • Participants
  • Parent commits ebcd7cf
  • Branches default

Comments (0)

Files changed (3)

File build.xml

View file
  • Ignore whitespace
-<project name="lazymap" default="jar">
+<project name="lazymap" default="artifacts"
+    xmlns:ivy="antlib:org.apache.ivy.ant">
 
-	<description>
-		Build with "ant jar".
-	</description>
+    <description>
+        lazymap is an implementation of a lazy map for the Clojure
+        programming language. It is to maps what lazy-seq is for
+        sequences. You can use Ivy to depend on the project. Put
+        the following in your ivy.xml:
+        &lt;dependency org="de.kotka" name="lazymap"/&gt;
 
-	<property environment="env"/>
+        In your ivysettings.xml put the following:
+        &lt;resolvers&gt;
+            &lt;url name="Kotka"&gt;
+                &lt;ivy pattern="http://kotka.de/ivy/[organisation]/[module]/[revision]/ivys/ivy.xml"/&gt;
+                &lt;artifact pattern="http://kotka.de/ivy/[organisation]/[module]/[revision]/jars/[artifact].[ext]"/&gt;
+            &lt;/url&gt;
+        &lt;/resolvers&gt;
 
-	<property name="src" location="src"/>
-	<property name="build" location="classes"/>
-	<property name="lazymap_jar" location="lazymap.jar"/>
-	<property file="local.properties"/>
+        &lt;modules&gt;
+            &lt;module organisation="de.kotka" name="lazymap" resolver="Kotka"/&gt;
+        &lt;/modules&gt;
+    </description>
 
-	<target name="init" depends="clean">
-		<tstamp/>
-		<mkdir dir="${build}"/>
-	</target>
+    <property name="src.dir" location="src"/>
+    <property name="classes.dir" location="classes"/>
+    <property name="build.dir" location="build"/>
+    <property name="lib.dir" location="lib"/>
 
-	<target name="aot" depends="init"
-		description="Compile Clojure sources.">
-		<java classname="clojure.lang.Compile">
-			<classpath>
-				<pathelement location="${build}"/>
-				<pathelement location="${src}"/>
-				<pathelement location="${clojure.jar}"/>
-			</classpath>
-			<sysproperty key="clojure.compile.path" value="${build}"/>
-			<arg value="de.kotka.lazymap.LazyMapEntry"/>
-			<arg value="de.kotka.lazymap.LazyMapSeq"/>
-			<arg value="de.kotka.lazymap.LazyMap"/>
-			<arg value="de.kotka.lazymap"/>
-		</java>
-	</target>
+    <property name="jar.file" location="${build.dir}/lazymap.jar"/>
+    <property name="srcjar.file" location="${build.dir}/lazymap-source.jar"/>
 
-	<target name="jar" depends="aot"
-		description="Create jar file.">
-		<jar jarfile="${lazymap_jar}" basedir="${build}">
-			<fileset file="README.txt"/>
-			<fileset file="LICENSE.txt"/>
-			<fileset dir="${src}" includes="**/*.clj"/>
-			<fileset dir="${build}" includes="de/kotka/**/*.class"/>
-			<manifest>
-				<attribute name="Class-Path" value="."/>
-			</manifest>
-		</jar>
-	</target>
+    <property name="current.version" value="2.2"/>
 
-	<target name="clean"
-		description="Remove autogenerated files and directories.">
-		<delete dir="${build}"/>
-		<delete file="${lazymap_jar}"/>
-	</target>
+    <property file="local.properties"/>
+
+    <target name="init" description="--> create build directories">
+        <tstamp/>
+        <mkdir dir="${classes.dir}"/>
+        <mkdir dir="${build.dir}"/>
+        <mkdir dir="${lib.dir}"/>
+    </target>
+
+    <target name="resolve" depends="init"
+        description="--> resolve dependencies with Ivy">
+        <ivy:retrieve />
+        <ivy:resolve />
+    </target>
+
+    <target name="aot" depends="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.lazymap.LazyMapEntry"/>
+            <arg value="de.kotka.lazymap.LazyMapSeq"/>
+            <arg value="de.kotka.lazymap.LazyMap"/>
+            <arg value="de.kotka.lazymap"/>
+        </java>
+    </target>
+
+    <target name="artifacts" depends="aot"
+        description="--> create source and artifact jars">
+        <jar jarfile="${jar.file}">
+            <fileset file="README.txt"/>
+            <fileset file="LICENSE.txt"/>
+            <fileset dir="${classes.dir}" includes="de/kotka/**/*.class"/>
+            <manifest>
+                <attribute name="Class-Path" value="."/>
+            </manifest>
+        </jar>
+
+        <jar jarfile="${srcjar.file}">
+            <fileset file="README.txt"/>
+            <fileset file="LICENSE.txt"/>
+            <fileset dir="${src.dir}" includes="**/*.clj"/>
+        </jar>
+    </target>
+
+    <target name="clean" description="--> clean generated files">
+        <delete dir="${classes.dir}"/>
+        <delete dir="${build.dir}"/>
+    </target>
+
+    <target name="clean-lib" description="--> clean library files">
+        <delete dir="${lib.dir}"/>
+    </target>
+
+    <target name="clean-local" description="--> clean local repository">
+        <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="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 : -->

File ivy.xml

View file
  • Ignore whitespace
+<ivy-module version="2.0">
+
+    <info organisation="de.kotka" module="lazymap" status="integration"/>
+
+    <configurations>
+        <conf name="default"/>
+        <conf name="dev" extends="default"/>
+    </configurations>
+
+    <publications>
+        <artifact name="lazymap" type="jar" conf="default"/>
+        <artifact name="lazymap-source" type="jar" conf="dev"/>
+    </publications>
+
+    <dependencies>
+        <dependency org="org.clojure" name="clojure-lang" rev="1.0.0"
+            conf="*->default"/>
+    </dependencies>
+
+</ivy-module>

File ivysettings.xml

View file
  • Ignore whitespace
+<ivysettings>
+
+    <!-- Load the standard Ivy settings. Which just extend them for Clojure. -->
+    <include url="${ivy.default.settings.dir}/ivysettings.xml"/>
+    <include url="http://kotka.de/ivy/ivysettings.xml"/>
+
+</ivysettings>