Changeset 30747 in osm


Ignore:
Timestamp:
2014-10-19T14:38:47+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] refactor common build file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/build-common.xml

    r30721 r30747  
    3737    </target>
    3838
     39    <!-- To be overriden in plugin build file before inclusion if other plugins are required -->
     40    <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}" includes="nothing"/>
     41
    3942    <!--
    4043    **********************************************************
     
    6063                    <include name="**/*.jar"/>
    6164                </fileset>
     65                <fileset refid="plugin.requires.jars"/>
    6266            </classpath>
    6367        </javac>
     
    380384        <pathelement path="${groovy.jar}"/>
    381385    </path>
    382     <condition property="plugin.requires.jars.set">
    383         <isreference refid="plugin.requires.jars"/>
    384     </condition>
    385386    <macrodef name="init-test-preferences">
    386387        <sequential>
     
    403404        <delete dir="${plugin.test.dir}/config/unit-josm.home/cache" failonerror="false"/>
    404405    </target>
    405     <macrodef name="call-groovyc">
    406         <element name="cp-elements"/>
     406    <target name="test-compile" depends="test-init,dist">
     407        <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/>
    407408        <sequential>
    408409            <groovyc srcdir="${plugin.test.dir}/unit" destdir="${plugin.test.dir}/build/unit" encoding="UTF-8">
    409410                <classpath>
    410                     <cp-elements/>
     411                    <fileset refid="plugin.requires.jars"/>
    411412                    <path refid="test.classpath"/>
    412413                </classpath>
     
    417418            </groovyc>
    418419        </sequential>
    419     </macrodef>
    420     <target name="call-groovyc-extended" if="plugin.requires.jars.set">
    421         <call-groovyc>
    422             <cp-elements>
    423                 <fileset refid="plugin.requires.jars"/>
    424             </cp-elements>
    425         </call-groovyc>
    426     </target>
    427     <target name="call-groovyc-base" unless="plugin.requires.jars.set">
    428         <call-groovyc>
    429             <cp-elements/>
    430         </call-groovyc>
    431     </target>
    432     <target name="test-compile" depends="test-init,dist">
    433         <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/>
    434         <antcall target="call-groovyc-base"/>
    435         <antcall target="call-groovyc-extended"/>
    436     </target>
    437     <macrodef name="call-junit">
    438         <element name="cp-elements"/>
     420    </target>
     421    <target name="test" depends="dist, test-compile"
     422        description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
     423        <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="../00_core_tools/jacocoant.jar" />
    439424        <sequential>
    440425            <echo message="Running unit tests with JUnit"/>
     
    447432                    <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/>
    448433                    <classpath>
    449                         <cp-elements/>
     434                        <fileset refid="plugin.requires.jars"/>
    450435                        <path refid="test.classpath"/>
    451436                        <pathelement path="${plugin.test.dir}/build/unit"/>
     
    459444            </jacoco:coverage>
    460445        </sequential>
    461     </macrodef>
    462     <target name="call-junit-extended" if="plugin.requires.jars.set">
    463         <call-junit>
    464             <cp-elements>
    465                 <fileset refid="plugin.requires.jars"/>
    466             </cp-elements>
    467         </call-junit>
    468     </target>
    469     <target name="call-junit-base" unless="plugin.requires.jars.set">
    470         <call-junit>
    471             <cp-elements/>
    472         </call-junit>
    473     </target>
    474     <target name="test" depends="dist, test-compile"
    475         description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password">
    476         <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="../00_core_tools/jacocoant.jar" />
    477         <antcall target="call-junit-base"/>
    478         <antcall target="call-junit-extended"/>
    479446    </target>
    480447       
Note: See TracChangeset for help on using the changeset viewer.