Changeset 30562 in osm for applications/editors/josm/plugins/build-common.xml
- Timestamp:
- 2014-08-05T13:21:35+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/build-common.xml
r30561 r30562 97 97 <antcall target="add-manifest-attribute"> 98 98 <param name="manifest.attribute" value="Plugin-Link"/> 99 <param name="proper y.name" value="plugin.link"/>100 <param name="proper y.value" value="${plugin.link}"/>99 <param name="property.name" value="plugin.link"/> 100 <param name="property.value" value="${plugin.link}"/> 101 101 </antcall> 102 102 <antcall target="add-manifest-attribute"> 103 103 <param name="manifest.attribute" value="Plugin-Icon"/> 104 <param name="proper y.name" value="plugin.icon"/>105 <param name="proper y.value" value="${plugin.icon}"/>104 <param name="property.name" value="plugin.icon"/> 105 <param name="property.value" value="${plugin.icon}"/> 106 106 </antcall> 107 107 <antcall target="add-manifest-attribute"> 108 108 <param name="manifest.attribute" value="Plugin-Early"/> 109 <param name="proper y.name" value="plugin.early"/>110 <param name="proper y.value" value="${plugin.early}"/>109 <param name="property.name" value="plugin.early"/> 110 <param name="property.value" value="${plugin.early}"/> 111 111 </antcall> 112 112 <antcall target="add-manifest-attribute"> 113 113 <param name="manifest.attribute" value="Plugin-Requires"/> 114 <param name="proper y.name" value="plugin.requires"/>115 <param name="proper y.value" value="${plugin.requires}"/>114 <param name="property.name" value="plugin.requires"/> 115 <param name="property.value" value="${plugin.requires}"/> 116 116 </antcall> 117 117 <antcall target="add-manifest-attribute"> 118 118 <param name="manifest.attribute" value="Plugin-Stage"/> 119 <param name="proper y.name" value="plugin.stage"/>120 <param name="proper y.value" value="${plugin.stage}"/>119 <param name="property.name" value="plugin.stage"/> 120 <param name="property.value" value="${plugin.stage}"/> 121 121 </antcall> 122 122 <antcall target="additional-manifest" /> … … 130 130 <!-- to be overidden by plugins that need to perform additional tasks on resulting jar --> 131 131 </target> 132 <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${proper y.name}">132 <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${property.name}"> 133 133 <manifest file="MANIFEST" mode="update"> 134 <attribute name="${manifest.attribute}" value="${proper y.value}" />134 <attribute name="${manifest.attribute}" value="${property.value}" /> 135 135 </manifest> 136 136 </target> … … 139 139 </target> 140 140 <target name="check-manifest-attribute"> 141 <condition property="have-${proper y.name}">141 <condition property="have-${property.name}"> 142 142 <and> 143 <isset property="${proper y.name}"/>143 <isset property="${property.name}"/> 144 144 <not> 145 <equals arg1="${proper y.value}" arg2=""/>145 <equals arg1="${property.value}" arg2=""/> 146 146 </not> 147 147 <not> 148 <equals arg1="${proper y.value}" arg2="..."/>148 <equals arg1="${property.value}" arg2="..."/> 149 149 </not> 150 150 </and> … … 200 200 </not> 201 201 </condition> 202 </target>202 </target> 203 203 <!-- 204 204 ** Initializes the REVISION.XML file from git (w/o svn) information. … … 369 369 <pathelement path="${groovy.jar}"/> 370 370 </path> 371 <condition property="plugin.requires.jars.set"> 372 <isreference refid="plugin.requires.jars"/> 373 </condition> 371 374 <macrodef name="init-test-preferences"> 372 <attribute name="testfamily"/>373 375 <sequential> 374 <copy file="${plugin.test.dir}/config/preferences.template.xml" tofile="${plugin.test.dir}/config/ @{testfamily}-josm.home/preferences.xml"/>375 <replace file="${plugin.test.dir}/config/ @{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/>376 <replace file="${plugin.test.dir}/config/ @{testfamily}-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/>376 <copy file="${plugin.test.dir}/config/preferences.template.xml" tofile="${plugin.test.dir}/config/unit-josm.home/preferences.xml"/> 377 <replace file="${plugin.test.dir}/config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_USERNAME@" value="${osm.username}"/> 378 <replace file="${plugin.test.dir}/config/unit-josm.home/preferences.xml" encoding="UTF-8" token="@OSM_PASSWORD@" value="${osm.password}"/> 377 379 </sequential> 378 380 </macrodef> … … 381 383 <mkdir dir="${plugin.test.dir}/build/unit"/> 382 384 <mkdir dir="${plugin.test.dir}/report"/> 383 <init-test-preferences testfamily="unit"/>385 <init-test-preferences/> 384 386 </target> 385 387 <target name="test-clean"> … … 391 393 </target> 392 394 <macrodef name="call-groovyc"> 393 <attribute name="testfamily"/>394 395 <element name="cp-elements"/> 395 396 <sequential> 396 <groovyc srcdir="${plugin.test.dir}/ @{testfamily}" destdir="${plugin.test.dir}/build/@{testfamily}" encoding="UTF-8">397 <groovyc srcdir="${plugin.test.dir}/unit" destdir="${plugin.test.dir}/build/unit" encoding="UTF-8"> 397 398 <classpath> 398 399 <cp-elements/> 400 <path refid="test.classpath"/> 399 401 </classpath> 400 <javac target="1.7" source="1.7" debug="on" >402 <javac target="1.7" source="1.7" debug="on" encoding="UTF-8"> 401 403 <compilerarg value="-Xlint:all"/> 402 404 <compilerarg value="-Xlint:-serial"/> … … 405 407 </sequential> 406 408 </macrodef> 409 <target name="call-groovyc-extended" if="plugin.requires.jars.set"> 410 <call-groovyc> 411 <cp-elements> 412 <fileset refid="plugin.requires.jars"/> 413 </cp-elements> 414 </call-groovyc> 415 </target> 416 <target name="call-groovyc-base" unless="plugin.requires.jars.set"> 417 <call-groovyc> 418 <cp-elements/> 419 </call-groovyc> 420 </target> 407 421 <target name="test-compile" depends="test-init,dist"> 408 422 <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpath="${groovy.jar}"/> 409 <call-groovyc testfamily="unit"> 410 <cp-elements> 411 <path refid="test.classpath"/> 412 </cp-elements> 413 </call-groovyc> 423 <antcall target="call-groovyc-base"/> 424 <antcall target="call-groovyc-extended"/> 414 425 </target> 415 426 <macrodef name="call-junit"> 416 < attribute name="testfamily"/>427 <element name="cp-elements"/> 417 428 <sequential> 418 <echo message="Running @{testfamily}tests with JUnit"/>429 <echo message="Running unit tests with JUnit"/> 419 430 <jacoco:coverage destfile="${plugin.test.dir}/jacoco.exec"> 420 431 <junit printsummary="yes" fork="true" forkmode="once" dir="${basedir}"> 421 <sysproperty key="josm.home" value="${plugin.test.dir}/config/@{testfamily}-josm.home"/> 432 <jvmarg value="-Dfile.encoding=UTF-8"/> 433 <sysproperty key="josm.home" value="${plugin.test.dir}/config/unit-josm.home"/> 422 434 <sysproperty key="josm.test.data" value="${plugin.test.dir}/data"/> 423 435 <sysproperty key="java.awt.headless" value="true"/> 424 436 <sysproperty key="suppressPermanentFailure" value="${suppressPermanentFailure}"/> 425 437 <classpath> 438 <cp-elements/> 426 439 <path refid="test.classpath"/> 427 440 <pathelement path="${plugin.test.dir}/build/unit"/> 428 <pathelement path="${plugin.test.dir}/build/@{testfamily}"/>429 <pathelement path="${plugin.test.dir}/config"/>430 441 </classpath> 431 442 <formatter type="plain"/> 432 443 <formatter type="xml"/> 433 444 <batchtest fork="yes" todir="${plugin.test.dir}/report"> 434 <fileset dir="${plugin.test.dir}/build/ @{testfamily}" includes="**/*Test.class"/>445 <fileset dir="${plugin.test.dir}/build/unit" includes="**/*Test.class"/> 435 446 </batchtest> 436 447 </junit> … … 438 449 </sequential> 439 450 </macrodef> 440 <target name="test" depends="test-compile" 451 <target name="call-junit-extended" if="plugin.requires.jars.set"> 452 <call-junit> 453 <cp-elements> 454 <fileset refid="plugin.requires.jars"/> 455 </cp-elements> 456 </call-junit> 457 </target> 458 <target name="call-junit-base" unless="plugin.requires.jars.set"> 459 <call-junit> 460 <cp-elements/> 461 </call-junit> 462 </target> 463 <target name="test" depends="dist, test-compile" 441 464 description="Run unit tests. OSM API (TEST) account shall be set with -Dosm.username and -Dosm.password"> 442 465 <taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml" classpath="../00_core_tools/jacocoant.jar" /> 443 <call-junit testfamily="unit"/> 466 <antcall target="call-junit-base"/> 467 <antcall target="call-junit-extended"/> 444 468 </target> 445 469
Note:
See TracChangeset
for help on using the changeset viewer.