Ignore:
Timestamp:
2014-04-26T19:58:37+02:00 (10 years ago)
Author:
donvip
Message:

[josm_proj4j] fix build

File:
1 edited

Legend:

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

    r30416 r30417  
    11<?xml version="1.0" encoding="utf-8"?>
    22<project name="proj4j" default="dist" basedir=".">
    3     <!-- read build.properties for local settings -->
    4     <property file="build.properties"/>
    5     <!-- enter the SVN command file name -->
    6     <property name="svn" value="svn"/>
    73    <!-- enter the SVN commit message -->
    84    <property name="commit.message" value="Commit message"/>
    95    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    106    <property name="plugin.main.version" value="7001"/>
    11     <!--
    12       ************************************************
    13       ** should not be necessary to change the following properties
    14      -->
    15     <property name="josm" location="../../core/dist/josm-custom.jar"/>
    16     <property name="plugin.build.dir" value="build"/>
    17     <property name="plugin.src.dir" value="src"/>
    18     <!-- this is the directory where the plugin jar is copied to -->
    19     <property name="plugin.dist.dir" value="../../dist"/>
    20     <property name="ant.build.javac.target" value="1.7"/>
    21     <property name="plugin.dist.dir" value="../../dist"/>
    22     <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    23     <!--
    24     **********************************************************
    25     ** init - initializes the build
    26     **********************************************************
    27     -->
    28     <target name="init">
    29         <mkdir dir="${plugin.build.dir}"/>
    30     </target>
    31     <!--
    32     **********************************************************
    33     ** compile - complies the source tree
    34     **********************************************************
    35     -->
    36     <target name="compile" depends="init">
    37         <echo message="compiling sources for  ${plugin.jar} ... "/>
    38         <javac srcdir="src" debug="true" destdir="${plugin.build.dir}">
    39             <classpath>
    40                 <pathelement location="${josm}"/>
    41             </classpath>
    42             <compilerarg value="-Xlint:deprecation"/>
    43             <compilerarg value="-Xlint:unchecked"/>
    44         </javac>
    45     </target>
    46     <!--
    47     **********************************************************
    48     ** dist - creates the plugin jar
    49     **********************************************************
    50     -->
    51     <target name="dist" depends="compile,revision">
    52         <echo message="creating ${ant.project.name}.jar ... "/>
    53         <copy todir="${plugin.build.dir}/resources">
    54             <fileset dir="resources" excludes="nad/"/>
    55         </copy>
    56         <copy todir="${plugin.build.dir}/nad">
    57             <fileset dir="resources/nad"/>
    58         </copy>
    59         <copy todir="${plugin.build.dir}/images">
    60             <fileset dir="images"/>
    61         </copy>
    62         <copy todir="${plugin.build.dir}/data">
    63             <fileset dir="data"/>
    64         </copy>
    65         <copy todir="${plugin.build.dir}">
    66             <fileset dir=".">
    67                 <include name="README"/>
    68                 <include name="LICENSE"/>
    69             </fileset>
    70         </copy>
    71         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    72             <!-- All jar files necessary to run plugin (no tests) -->
    73             <!--
    74         ************************************************
    75         ** configure these properties. Most of them will be copied to the plugins
    76         ** manifest file. Property values will also show up in the list available
    77         ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
    78         **
    79         ************************************************
    80     -->
    81             <manifest>
    82                 <attribute name="Author" value="Josh Doe &lt;josh@joshdoe.com&gt;"/>
    83                 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.proj4j.Proj4J"/>
    84                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    85                 <attribute name="Plugin-Description" value="adds projections from Proj4J"/>
    86                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Proj4J"/>
    87                 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    88                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    89                 <attribute name="Plugin-Early" value="true"/>
    90             </manifest>
    91         </jar>
    92     </target>
    93     <!--
    94     **********************************************************
    95     ** revision - extracts the current revision number for the
    96     **    file build.number and stores it in the XML property
    97     **    version.*
    98     **********************************************************
    99     -->
    100     <target name="revision">
    101         <exec append="false" output="REVISION" executable="${svn}" failifexecutionfails="false">
    102             <env key="LANG" value="C"/>
    103             <arg value="info"/>
    104             <arg value="--xml"/>
    105             <arg value="."/>
    106         </exec>
    107         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    108         <delete file="REVISION"/>
    109     </target>
    110     <!--
    111     **********************************************************
    112     ** clean - clean up the build environment
    113     **********************************************************
    114     -->
    115     <target name="clean">
    116         <delete dir="${plugin.build.dir}"/>
    117         <delete file="${plugin.jar}"/>
    118     </target>
    119     <!--
    120     **********************************************************
    121     ** install - install the plugin in your local JOSM installation
    122     **********************************************************
    123     -->
    124     <target name="install" depends="dist">
    125         <property environment="env"/>
    126         <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    127             <and>
    128                 <os family="windows"/>
    129             </and>
    130         </condition>
    131         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    132     </target>
    133     <!--
    134     ************************** Publishing the plugin ***********************************
    135     -->
    136     <!--
    137         ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    138         ** property ${coreversion.info.entry.revision}
    139         **
    140         -->
    141     <target name="core-info">
    142         <exec append="false" output="core.info.xml" executable="${svn}" failifexecutionfails="false">
    143             <env key="LANG" value="C"/>
    144             <arg value="info"/>
    145             <arg value="--xml"/>
    146             <arg value="../../core"/>
    147         </exec>
    148         <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
    149         <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
    150         <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    151         <delete file="core.info.xml"/>
    152     </target>
    153     <!--
    154         ** commits the source tree for this plugin
    155         -->
    156     <target name="commit-current">
    157         <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
    158         <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
    159             <env key="LANG" value="C"/>
    160             <arg value="commit"/>
    161             <arg value="-m '${commit.message}'"/>
    162             <arg value="."/>
    163             <arg value="${svn.username_arg}"/>
    164             <arg value="${svn.username}"/>
    165             <arg value="${svn.password_arg}"/>
    166             <arg value="${svn.password}"/>
    167         </exec>
    168     </target>
    169     <!--
    170         ** updates (svn up) the source tree for this plugin
    171         -->
    172     <target name="update-current">
    173         <echo>Updating plugin source ...</echo>
    174         <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
    175             <env key="LANG" value="C"/>
    176             <arg value="up"/>
    177             <arg value="."/>
    178         </exec>
    179         <echo>Updating ${plugin.jar} ...</echo>
    180         <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
    181             <env key="LANG" value="C"/>
    182             <arg value="up"/>
    183             <arg value="../dist/${plugin.jar}"/>
    184         </exec>
    185     </target>
    186     <!--
    187         ** commits the plugin.jar
    188         -->
    189     <target name="commit-dist">
    190         <echo>
    191     ***** Properties of published ${plugin.jar} *****
    192     Commit message    : '${commit.message}'                   
    193     Plugin-Mainversion: ${plugin.main.version}
    194     JOSM build version: ${coreversion.info.entry.revision}
    195     Plugin-Version    : ${version.entry.commit.revision}
    196     ***** / Properties of published ${plugin.jar} *****                   
    197                        
    198     Now commiting ${plugin.jar} ...
    199     </echo>
    200         <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false">
    201             <env key="LANG" value="C"/>
    202             <arg value="-m '${commit.message}'"/>
    203             <arg value="commit"/>
    204             <arg value="${plugin.jar}"/>
    205             <arg value="${svn.username_arg}"/>
    206             <arg value="${svn.username}"/>
    207             <arg value="${svn.password_arg}"/>
    208             <arg value="${svn.password}"/>
    209         </exec>
    210     </target>
    211     <!-- ** make sure svn is present as a command line tool ** -->
    212     <target name="ensure-svn-present">
    213         <exec append="true" output="svn.log" executable="${svn}" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
    214             <env key="LANG" value="C"/>
    215             <arg value="--version"/>
    216         </exec>
    217         <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
    218             <!-- return code not set at all? Most likely svn isn't installed -->
    219             <condition>
    220                 <not>
    221                     <isset property="svn.exit.code"/>
    222                 </not>
    223             </condition>
    224         </fail>
    225         <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
    226             <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
    227             <condition>
    228                 <isfailure code="${svn.exit.code}"/>
    229             </condition>
    230         </fail>
    231     </target>
    232     <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
    233     </target>
     7       
     8    <property name="plugin.author" value="Josh Doe &lt;josh@joshdoe.com&gt;"/>
     9    <property name="plugin.class"  value="org.openstreetmap.josm.plugins.proj4j.Proj4J"/>
     10    <property name="plugin.description" value="adds projections from Proj4J"/>
     11    <property name="plugin.link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Proj4J"/>
     12        <property name="plugin.early" value="true"/>
     13
     14    <!-- ** include targets that all plugins have in common ** -->
     15    <import file="../build-common.xml"/>
     16
    23417</project>
Note: See TracChangeset for help on using the changeset viewer.