Changeset 2776
- Timestamp:
- 14/06/07 10:20:43 (5 years ago)
- Files:
-
- trunk/build.xml (modified) (3 diffs)
- trunk/ivy.xml (modified) (1 diff)
- trunk/ivysettings.xml (moved) (moved from trunk/ivyconf.xml) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build.xml
r2750 r2776 1 <project name="xtc" default="dist" xmlns:ivy="antlib:fr.jayasoft.ivy.ant"> 1 <project name="xtc" default="help" xmlns:ivy="antlib:org.apache.ivy.ant"> 2 <!-- Sarugo common ant configuration --> 3 <property name="ant.lib.dir" value="ant"/> 4 <property name="ant.server" value="http://ant.sarugo.org"/> 5 <property name="sarugo.ant.file" value="${ant.lib.dir}/common-build.xml"/> 2 6 <!-- Ivy configuration --> 3 <property name="ivy.install.version" value="1.4.1"/> 4 <property name="ivy.jar.dir" value="ivy"/> 5 <property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/> 7 <property name="ivy.server" value="${ant.server}/ivy"/> 8 <property name="ivy.version" value="2.0.0-alpha-1-incubating"/> 9 <property name="ivy.dest.file" value="${ant.lib.dir}/ivy-${ivy.version}.jar"/> 10 <condition property="download-ivy.required"> 11 <not><available file="${ivy.dest.file}" type="file"/></not> 12 </condition> 6 13 <!-- Project directories --> 7 <property name="lib.dir" value="lib"/>8 14 <property name="src.dir" value="src"/> 9 15 <property name="build.dir" value="build"/> 10 <property name="dist.dir" value="distrib"/> 16 <property name="dist.dir" value="dist"/> 17 <property name="lib.dir" value="lib"/> 18 <condition property="bootstrap.required"> 19 <not><and> 20 <available file="${ant.lib.dir}" type="dir"/> 21 <available file="${lib.dir}" type="dir"/> 22 </and></not> 23 </condition> 11 24 12 13 <target name="install-ivy" description="Install Ivy dependency manager"> 14 <mkdir dir="${ivy.jar.dir}"/> 25 <target name="download-ivy" if="download-ivy.required"> 15 26 <!-- download Ivy from web site so that it can be used even without any special installation --> 16 <get src="http://www.jayasoft.org/downloads/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/> 17 <path id="ivy.lib.path"> 18 <fileset dir="${ivy.jar.dir}" includes="*.jar"/> 19 </path> 20 <taskdef resource="fr/jayasoft/ivy/ant/antlib.xml" uri="antlib:fr.jayasoft.ivy.ant" classpathref="ivy.lib.path"/> 27 <get src="${ivy.server}/${ivy.version}/ivy-${ivy.version}.jar" dest="${ivy.dest.file}" usetimestamp="true"/> 21 28 </target> 22 29 23 <target name="install-libs" depends="install-ivy" description="Install 3rd party dependencies to local repository"> 24 <ivy:retrieve /> 30 <target name="bootstrap" description="Downloads common ant scripts and libraries"> 31 <mkdir dir="${ant.lib.dir}"/> 32 <antcall target="download-ivy"/> 33 <path id="ivy.lib.path"> 34 <fileset file="${ivy.dest.file}"/> 35 </path> 36 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/> 37 <ivy:configure file="ivysettings.xml"/> 38 <ivy:resolve file="ivy.xml"/> 39 <ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]"/> 25 40 </target> 26 41 27 <target name="compile" depends="install-libs" description="Compile the library"> 42 <target name="init" if="bootstrap.required"> 43 <fail message="You need to run ant bootstrap"/> 44 </target> 45 46 <target name="compile" depends="init" description="Compile the library"> 28 47 <mkdir dir="${build.dir}/main/java" /> 29 48 <javac source="1.5" target="1.5" destdir="${build.dir}/main/java"> … … 31 50 <classpath> 32 51 <pathelement path="${build.dir}/main/java"/> 33 <fileset dir="${lib.dir}"> 34 <include name="**/*.jar"/> 35 </fileset> 52 <fileset dir="${lib.dir}" includes="**/*.jar"/> 36 53 </classpath> 37 54 </javac> 38 55 </target> 39 56 40 <target name="dist" depends="compile" description="Build distribution files and upload to repository"> 57 <target name="test" depends="compile" description="Build and run unit tests"> 58 <mkdir dir="${build.dir}/test/java" /> 59 <javac source="1.5" target="1.5" destdir="${build.dir}/test/java"> 60 <src path="${src.dir}/test/java"/> 61 <classpath> 62 <pathelement path="${build.dir}/main/java"/> 63 <pathelement path="${build.dir}/test/java"/> 64 <fileset dir="${lib.dir}" includes="**/*.jar"/> 65 </classpath> 66 </javac> 67 </target> 68 69 <target name="package" depends="compile" description="Build distribution files"> 41 70 <mkdir dir="${dist.dir}"/> 42 71 <jar destfile="${dist.dir}/xtc.jar"> … … 44 73 <fileset dir="${src.dir}/main/resources" /> 45 74 </jar> 75 <!-- Use ivy to copy the runtime dependencies to distribution directory --> 76 <path id="ivy.lib.path"> 77 <fileset file="${ivy.dest.file}"/> 78 </path> 79 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/> 80 <ivy:configure file="ivysettings.xml"/> 81 <ivy:resolve file="ivy.xml"/> 82 <ivy:retrieve pattern="${dist.dir}/[artifact]-[revision].[ext]" conf="default"/> 83 </target> 84 85 <target name="integration-test" depends="package" description="Test distribution files"> 46 86 </target> 47 87 48 88 <target name="clean" description="Clean the project built files (not dist)"> 49 <delete includeemptydirs="true" >89 <delete includeemptydirs="true" failonerror="false"> 50 90 <fileset dir="${build.dir}"/> 51 91 </delete> 52 92 </target> 53 93 54 <target name="clean-dist" depends="clean" description="Clean all generated (or downloaded) files"> 55 <delete includeemptydirs="true"> 56 <fileset dir="${lib.dir}"/> 94 <target name="clean-dist" depends="clean" description="Clean compiled, packaged and downloaded library files"> 95 <delete includeemptydirs="true" failonerror="false"> 57 96 <fileset dir="${dist.dir}"/> 58 97 </delete> 59 98 </target> 60 99 100 <target name="clean-all" depends="clean-dist" description="Clean all generated (or downloaded) files"> 101 <delete includeemptydirs="true" failonerror="false"> 102 <fileset dir="${ant.lib.dir}"/> 103 <fileset dir="${lib.dir}"/> 104 </delete> 105 </target> 106 107 <target name="help"> 108 <echo message="Run ant -p to see a list of targets."/> 109 <echo message="Most likely you want to test or package."/> 110 </target> 111 61 112 </project> trunk/ivy.xml
r2750 r2776 1 1 <ivy-module version="1.3"> 2 <info organisation="sarugo" module="xtc"/> 2 <info organisation="sarugo" module="xtc" revision="1.0.0" status="integration"> 3 <license name="CDDL" url="http://www.sun.com/cddl/"/> 4 </info> 5 <configurations> 6 <conf name="default" description="Runtime configuration"/> 7 <conf name="compile" visibility="private"/> 8 <conf name="test" visibility="private" extends="default,compile"/> 9 </configurations> 3 10 <dependencies> 4 <dependency org="org.restlet" name="org.restlet" rev="1.0.1" conf="default"/> 11 <dependency org="org.restlet" name="org.restlet" rev="1.0.1" conf="compile->default"/> 12 <dependency org="com.noelios.restlet" name="com.noelios.restlet.ext.simple" rev="1.0.1" conf="default"/> 13 <dependency org="de.odysseus.juel" name="juel" rev="2.1.0" conf="default,compile->default"/> 14 <dependency org="junit" name="junit" rev="3.8.2" conf="test->default"/> 5 15 </dependencies> 6 16 </ivy-module> trunk/ivysettings.xml
r2750 r2776 1 <ivy conf>2 < confdefaultResolver="maven" />1 <ivysettings> 2 <settings defaultResolver="maven" /> 3 3 <resolvers> 4 <chain name="maven" >4 <chain name="maven" returnFirst="true"> 5 5 <ibiblio name="restlet" root="http://maven.restlet.org/" m2compatible="true" /> 6 <i vyrep name="ivyrep" />6 <ibiblio name="ibiblio" m2compatible="true" /> 7 7 </chain> 8 <filesystem name="public"> 9 <ivy pattern="${dist.dir}/publish/[organisation]/[module]/[revision]/ivy-[revision].xml"/> 10 <artifact pattern="${dist.dir}/publish/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/> 11 </filesystem> 8 12 </resolvers> 9 </ivyconf> 13 <modules> 14 <module organisation="sarugo" name=".*" resolver="public"/> 15 </modules> 16 </ivysettings>
