source: subversion/applications/editors/josm/plugins/turnrestrictions/build.xml @ 29801

Last change on this file since 29801 was 29435, checked in by Dirk Stoecker, 7 years ago

i18n update

  • Property svn:mime-type set to text/xml
File size: 7.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!--
3** This is the build file for the turnrestrictions plugin
4**
5** Maintaining versions
6** ====================
7** see README.template
8**
9** Usage
10** =====
11** To build it run
12**
13**    > ant  dist
14**
15** To install the generated plugin locally (in you default plugin directory) run
16**
17**    > ant  install
18**
19** The generated plugin jar is not automatically available in JOSMs plugin configuration
20** dialog. You have to check it in first.
21**
22** Use the ant target 'publish' to check in the plugin and make it available to other
23** JOSM users:
24**    set the properties commit.message and plugin.main.version
25** and run
26**    > ant  publish
27**
28**
29-->
30<project name="turnrestrictions" default="dist" basedir=".">
31    <!-- enter the SVN commit message -->
32    <property name="commit.message" value="Adapt to JOSM core change (DefaultNameFormatter)"/>
33    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
34    <property name="plugin.main.version" value="4980"/>
35
36    <property name="test.build.dir" value="test/build"/>
37    <property name="eclipse.plugin.dir" value="C:\software\eclipse-3.6.1\plugins"/>
38
39    <!--
40    **********************************************************
41    ** include targets that all plugins have in common
42    **********************************************************
43    -->
44    <import file="../build-common.xml"/>
45 
46    <!--
47    **********************************************************
48    ** init - initializes the build
49    **********************************************************
50    -->
51    <target name="init">
52        <mkdir dir="${plugin.build.dir}"/>
53        <mkdir dir="${test.build.dir}"/>
54    </target>
55
56    <!--
57    **********************************************************
58    ** clean - clean up the build environment
59    **********************************************************
60    -->
61    <target name="clean">
62        <delete dir="${plugin.build.dir}"/>
63        <delete dir="${test.build.dir}"/>
64        <delete file="${plugin.jar}"/>
65    </target>
66
67    <!--
68    **********************************************************
69    ** dist - creates the plugin jar
70    **********************************************************
71    -->
72    <target name="dist" depends="compile,revision">
73        <echo message="creating ${ant.project.name}.jar ... "/>
74        <copy todir="${plugin.build.dir}/resources">
75            <fileset dir="resources"/>
76        </copy>
77        <copy todir="${plugin.build.dir}/images">
78            <fileset dir="images"/>
79        </copy>
80        <copy todir="${plugin.build.dir}/data">
81            <fileset dir="data"/>
82        </copy>
83        <copy todir="${plugin.build.dir}">
84            <fileset dir=".">
85                <include name="README"/>
86                <include name="LICENSE"/>
87            </fileset>
88        </copy>
89        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
90        <!--
91        ************************************************
92        ** configure these properties. Most of them will be copied to the plugins
93        ** manifest file. Property values will also show up in the list available
94        ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
95        **
96        ************************************************
97        -->
98            <manifest>
99                <attribute name="Author" value="Karl Guggisberg"/>
100                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.turnrestrictions.TurnRestrictionsPlugin"/>
101                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
102                <attribute name="Plugin-Description" value="The turnrestrictions plugin allows to enter maintain information about turn restrictions in the OpenStreetMap database."/>
103                <attribute name="Plugin-Icon" value="images/preferences/turnrestrictions.png"/>
104                <attribute name="Plugin-Link" value="http://josm.openstreetmap.de/wiki/Help/Plugin/TurnRestrictions"/>
105                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
106                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
107            </manifest>
108        </jar>
109    </target>
110
111    <!-- ************************************************************************************ -->
112    <!-- * Targets for compiling and running tests                                            -->
113    <!-- ************************************************************************************ -->
114    <path id="groovy.path">
115        <pathelement location="${eclipse.plugin.dir}/org.codehaus.groovy_1.7.5.xx-20100926-2000-e36-RC1\lib\groovy-all-1.7.5.jar"/>
116    </path>
117    <path id="junit.path">
118        <pathelement location="${eclipse.plugin.dir}/org.junit_4.8.1.v4_8_1_v20100427-1100\junit.jar"/>
119    </path>
120    <path id="fest.library.path">
121        <fileset dir="test/lib">
122            <include name="fest-*.jar"/>
123            <include name="jcp-*.jar"/>
124        </fileset>
125    </path>
126    <path id="test.class.path">
127        <pathelement location="${josm}"/>
128        <pathelement location="${plugin.build.dir}"/>
129        <path refid="groovy.path"/>
130        <path refid="junit.path"/>
131        <path refid="fest.library.path"/>
132    </path>
133    <path id="groovyc.path">
134        <path refid="junit.path"/>
135        <path refid="groovy.path"/>
136        <path refid="fest.library.path"/>
137        <pathelement location="${josm}"/>
138        <pathelement location="${test.build.dir}"/>
139        <pathelement location="${plugin.build.dir}"/>
140        <!-- if we didn't explicitly put hamcrest on the class path, groovyc would
141             abort and report it is missing a hamcrest class -->
142        <pathelement location="test/lib/hamcrest-all-1.2.jar"/>
143    </path>
144    <target name="test-clean">
145        <delete dir="${test.build.dir}"/>
146        <mkdir dir="${test.build.dir}"/>
147    </target>
148    <target name="test-compile" depends="compile,test-clean" description="Compiles the test files">
149        <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovy.path"/>
150        <echo message="compiling test infrastructor for ${plugin.jar} ... "/>
151        <javac srcdir="test/src" classpathref="test.class.path" debug="true" destdir="${test.build.dir}" includes="org/openstreetmap/josm/plugins/turnrestrictions/fixtures/**/*">
152            <compilerarg value="-Xlint:deprecation"/>
153            <compilerarg value="-Xlint:unchecked"/>
154        </javac>
155        <echo message="compiling groovy test cases for ${plugin.jar} ... "/>
156        <groovyc srcdir="test/src" destdir="${test.build.dir}" classpathref="groovyc.path">
157        </groovyc>
158        <echo message="compiling java test cases for ${plugin.jar} ... "/>
159        <javac srcdir="test/src" classpathref="test.class.path" debug="true" destdir="${test.build.dir}">
160            <compilerarg value="-Xlint:deprecation"/>
161            <compilerarg value="-Xlint:unchecked"/>
162        </javac>
163    </target>
164    <target name="test-run" depends="test-compile" description="Runs the junit tests">
165        <delete dir="test/output"/>
166        <mkdir dir="test/output"/>
167        <junit printsummary="true" failureproperty="junit.failure">
168            <classpath>
169                <path refid="groovyc.path"/>
170                <pathelement location="test/config"/>
171                <!-- required for test config file -->
172                <pathelement location="."/>
173                <!-- required to load images from subdir 'images/' -->
174            </classpath>
175            <test todir="test/output" name="org.openstreetmap.josm.plugins.turnrestrictions.AllUnitTests">
176                <formatter type="xml"/>
177            </test>
178        </junit>
179    </target>
180</project>
Note: See TracBrowser for help on using the repository browser.