Changeset 2845

Show
Ignore:
Timestamp:
05/07/07 16:58:31 (5 years ago)
Author:
michael
Message:

Tidy up dependencies and build process

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build.xml

    r2800 r2845  
    44        <property name="ant.server" value="http://ant.sarugo.org" /> 
    55        <property name="sarugo.ant.file" value="${ant.lib.dir}/common-build.xml" /> 
     6        <!-- Ant-Eclipse --> 
     7        <property name="ant.eclipse.url" value="http://trac.sarugo.org/ant-eclipse/attachment/wiki/WikiStart/ant-eclipse.jar?format=raw" /> 
     8        <property name="ant.eclipse.file" value="${ant.lib.dir}/ant-eclipse.jar" /> 
     9        <condition property="download-ant.eclipse.required"> 
     10                <not> 
     11                        <available file="${ant.eclipse.file}" type="file" /> 
     12                </not> 
     13        </condition> 
    614        <!-- Ivy configuration --> 
    715        <property name="ivy.server" value="${ant.server}/ivy" /> 
     
    1321                </not> 
    1422        </condition> 
    15         <!-- Project directories --> 
     23        <!-- Project Configuration --> 
    1624        <property name="src.dir" value="src" /> 
    1725        <property name="build.dir" value="build" /> 
    1826        <property name="dist.dir" value="dist" /> 
    1927        <property name="lib.dir" value="lib" /> 
     28        <property file="build.properties"/> 
    2029        <condition property="bootstrap.required"> 
    2130                <not> 
     
    3140                <get src="${ivy.server}/${ivy.version}/ivy-${ivy.version}.jar" dest="${ivy.dest.file}" usetimestamp="true" /> 
    3241        </target> 
    33  
     42         
     43        <target name="download-ant.eclipse" if="download-ant.eclipse.required"> 
     44                <get src="${ant.eclipse.url}" dest="${ant.eclipse.file}"/> 
     45        </target> 
     46         
    3447        <target name="bootstrap" description="Downloads common ant scripts and libraries"> 
    3548                <mkdir dir="${ant.lib.dir}" /> 
    3649                <antcall target="download-ivy" /> 
    37                 <path id="ivy.lib.path"> 
    38                         <fileset file="${ivy.dest.file}" /> 
    39                 </path> 
    40                 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" /> 
     50                <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.dest.file}" /> 
    4151                <ivy:configure file="ivysettings.xml" /> 
    4252                <ivy:resolve file="ivy.xml" /> 
    4353                <ivy:retrieve pattern="${lib.dir}/[artifact]-[revision].[ext]" /> 
     54                <antcall target="download-ant.eclipse" /> 
     55                <taskdef name="eclipse" classname="org.sarugo.ant.eclipse.EclipseTask" classpath="${ant.eclipse.file}" /> 
     56                <eclipse> 
     57                        <sourcepath> 
     58                                <dirset dir="${src.dir}" includes="main/*" /> 
     59                                <dirset dir="${src.dir}" includes="test/*" /> 
     60                        </sourcepath> 
     61                        <globmapper from="${src.dir}/*" to="${build.dir}/*"/> 
     62                        <classpath> 
     63                                <fileset dir="${lib.dir}" includes="**/*.jar" /> 
     64                        </classpath> 
     65                </eclipse> 
    4466        </target> 
    4567 
    46         <target name="init" if="bootstrap.required"> 
     68        <target name="pre-init" if="bootstrap.required"> 
    4769                <fail message="You need to run ant bootstrap" /> 
     70        </target> 
     71         
     72        <target name="init" depends="pre-init"> 
     73                <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.dest.file}" /> 
    4874        </target> 
    4975 
     
    89115                        <batchtest> 
    90116                                <fileset dir="${src.dir}/test/java"> 
     117                                        <include name="**/*Test.java" /> 
    91118                                        <include name="**/*Tests.java" /> 
    92119                                </fileset> 
     
    97124        <target name="package" depends="compile" description="Build distribution files"> 
    98125                <mkdir dir="${dist.dir}" /> 
    99                 <jar destfile="${dist.dir}/xtc.jar"> 
     126                <jar destfile="${dist.dir}/${project.name}-${project.rev}.jar"> 
    100127                        <fileset dir="${build.dir}/main/java" /> 
    101128                        <fileset dir="${build.dir}/main/resources" /> 
    102129                </jar> 
    103130                <!-- Use ivy to copy the runtime dependencies to distribution directory --> 
    104                 <path id="ivy.lib.path"> 
    105                         <fileset file="${ivy.dest.file}" /> 
    106                 </path> 
    107                 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path" /> 
    108131                <ivy:configure file="ivysettings.xml" /> 
    109132                <ivy:resolve file="ivy.xml" /> 
     
    114137        </target> 
    115138         
    116         <target name="publish" depends="package" description="Publish distribution to repository"> 
    117                 <ivy:publish resolver="local" artifactspattern="${dist.dir}/[artifact].[ext]" /> 
     139        <target name="publish" depends="package" description="Publish distribution to Ivy repository"> 
     140                <ivy:configure file="ivysettings.xml" /> 
     141                <ivy:resolve file="ivy.xml" /> 
     142                <ivy:publish resolver="local" artifactspattern="${dist.dir}/[artifact]-[revision].[ext]" /> 
    118143        </target> 
    119144 
  • trunk/ivy.xml

    r2800 r2845  
    11<ivy-module version="1.3"> 
    2   <info organisation="sarugo" module="xtc" revision="1.0.0" status="integration"> 
     2  <info organisation="sarugo" module="${project.name}" revision="${project.rev}" status="${project.status}"> 
    33    <license name="CDDL" url="http://www.sun.com/cddl/"/> 
    44  </info> 
     
    99  </configurations> 
    1010  <dependencies> 
    11     <dependency org="org.restlet" name="org.restlet" rev="1.0.1" conf="default,compile->default"/> 
    12     <dependency org="com.noelios.restlet" name="com.noelios.restlet.ext.simple" rev="1.0.1" conf="default"/> 
     11    <dependency org="org.restlet" name="org.restlet" rev="1.0.2" conf="default,compile->default"/> 
     12    <dependency org="com.noelios.restlet" name="com.noelios.restlet.ext.simple" rev="1.0.2" conf="test->default"/> 
    1313    <dependency org="de.odysseus.juel" name="juel" rev="2.1.0" conf="default,compile->default"/> 
    1414    <dependency org="junit" name="junit" rev="3.8.1" conf="test->default"/>