Ignore:
Timestamp:
2013-03-30T01:44:44+01:00 (11 years ago)
Author:
stoecker
Message:

fix build file again

File:
1 edited

Legend:

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

    r29435 r29438  
    11<?xml version="1.0" encoding="utf-8"?>
    22<!--
    3 ***** Please do not update this file!!!! *****
    4 ** It is an 'oddball' build, therefore the standard template will not work **
     3** This is a template build file for a JOSM  plugin.
     4**
     5** Maintaining versions
     6** ====================
     7** See README.template
     8**
     9** Usage
     10** =====
     11** Call "ant help" to get possible build targets.
     12**
    513-->
    6 <project name="SeaMapEditor" basedir=".">
     14<project name="SeaMapEditor" default="dist" basedir=".">
    715    <!-- enter the SVN commit message -->
    816    <property name="commit.message" value="New release"/>
     
    1018    <property name="plugin.main.version" value="4394"/>
    1119    <!-- should not be necessary to change the following properties -->
    12     <property name="josm" location="../../core/dist/josm-custom.jar"/>
    13     <property name="plugin.build.dir" value="build/"/>
    14     <property name="plugin.src.dir" value="src/"/>
    15     <property name="smed.dist.dir" value="dist/"/>
    16     <!-- this is the directory where the plugin jar is copied to -->
    17     <property name="plugin.dist.dir" value="../../dist/"/>
    18     <property name="smed_core.dist.dir" value="core/dist/"/>
    19     <property name="ant.build.javac.target" value="1.5"/>
    20     <property name="plugin.jar" value="${plugin.dist.dir}${ant.project.name}.jar"/>
    21     <!--
    22     **********************************************************
    23     ** init - initializes the build
    24     **********************************************************
    25     -->
    26     <target name="init">
    27         <mkdir dir="${plugin.build.dir}"/>
    28         <mkdir dir="${smed_core.dist.dir}"/>
    29         <mkdir dir="${smed.dist.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" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
    39             <compilerarg value="-Xlint:deprecation"/>
    40             <compilerarg value="-Xlint:unchecked"/>
    41         </javac>
    42     </target>
    43     <!--
    44     **********************************************************
    45     ** dist - creates the plugin jar
    46     **********************************************************
    47     -->
    48     <target name="dist" depends="compile, revision">
    49         <echo message="creating ${ant.project.name}.jar ... "/>
    50         <copy todir="${plugin.build.dir}/images">
    51             <fileset dir="images"/>
    52         </copy>
    53         <copy todir="${plugin.build.dir}/data">
    54             <fileset dir="data"/>
    55         </copy>
     20
     21    <property name="plugin.author" value="Werner, Malcolm"/>
     22    <property name="plugin.class" value="smed.Smed"/>
     23    <property name="plugin.description" value="Create and edit seamaps for OpenSeaMap"/>
     24    <property name="plugin.icon" value="images/Smed.png"/>
     25    <property name="plugin.link" value="http://openseamap.org/"/>
     26
     27    <!-- ** include targets that all plugins have in common ** -->
     28    <import file="../build-common.xml"/>
     29
     30    <target name="setup-dist">
     31        <antcall target="setup-dist-default" />
    5632        <copy todir="${plugin.build.dir}/smed/msg">
    5733            <fileset dir="${plugin.src.dir}/smed/msg"/>
    5834        </copy>
    59         <copy todir="${plugin.build.dir}">
    60             <fileset dir="${smed.dist.dir}"/>
    61         </copy>
    62         <copy todir="${plugin.build.dir}">
    63             <fileset dir=".">
    64                 <include name="*.txt"/>
    65             </fileset>
    66         </copy>
    67         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    68             <!--
    69         ************************************************
    70         ** configure these properties. Most of them will be copied to the plugins
    71         ** manifest file. Property values will also show up in the list available
    72         ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
    73         **
    74         ************************************************
    75     -->
    76             <manifest>
    77                 <attribute name="Author" value="Werner, Malcolm"/>
    78                 <attribute name="Plugin-Class" value="smed.Smed"/>
    79                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    80                 <attribute name="Plugin-Description" value="Create and edit seamaps for OpenSeaMap"/>
    81                 <attribute name="Plugin-Icon" value="images/Smed.png"/>
    82                 <attribute name="Plugin-Link" value="http://openseamap.org/"/>
    83                 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
    84                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    85             </manifest>
    86         </jar>
    87         <!-- install interface -->
    88         <copy file="${plugin.jar}" todir="${smed_core.dist.dir}"/>
    8935    </target>
    90     <!--
    91     **********************************************************
    92     ** revision - extracts the current revision number for the
    93     **    file build.number and stores it in the XML property
    94     **    version.*
    95     **********************************************************
    96     -->
    97     <target name="revision">
    98         <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    99             <env key="LANG" value="C"/>
    100             <arg value="info"/>
    101             <arg value="--xml"/>
    102             <arg value="."/>
    103         </exec>
    104         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    105         <delete file="REVISION"/>
    106     </target>
    107     <!--
    108     **********************************************************
    109     ** clean - clean up the build environment
    110     **********************************************************
    111     -->
    112     <target name="clean">
    113         <delete dir="${plugin.build.dir}"/>
    114         <delete dir="${smed_core.dist.dir}"/>
    115         <delete file="${plugin.jar}"/>
    116     </target>
    117     <!--
    118     **********************************************************
    119     ** install - install the plugin in your local JOSM installation
    120     **********************************************************
    121     -->
    122     <target name="install" depends="dist">
    123         <property environment="env"/>
    124         <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    125             <and>
    126                 <os family="windows"/>
    127             </and>
    128         </condition>
    129         <delete dir="${josm.plugins.dir}/splug"/>
    130         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    131     </target>
    132     <!--
    133     ************************** Publishing the plugin ***********************************
    134     -->
    135     <!--
    136     ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    137     ** property ${coreversion.info.entry.revision}
    138     -->
    139     <target name="core-info">
    140         <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
    141             <env key="LANG" value="C"/>
    142             <arg value="info"/>
    143             <arg value="--xml"/>
    144             <arg value="../../core"/>
    145         </exec>
    146         <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
    147         <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
    148         <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    149         <delete file="core.info.xml"/>
    150     </target>
    151     <!-- commits the source tree for this plugin -->
    152     <target name="commit-current">
    153         <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
    154         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    155             <env key="LANG" value="C"/>
    156             <arg value="commit"/>
    157             <arg value="-m '${commit.message}'"/>
    158             <arg value="."/>
    159         </exec>
    160     </target>
    161     <!-- updates (svn up) the source tree for this plugin -->
    162     <target name="update-current">
    163         <echo>Updating plugin source ...</echo>
    164         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    165             <env key="LANG" value="C"/>
    166             <arg value="up"/>
    167             <arg value="."/>
    168         </exec>
    169         <echo>Updating ${plugin.jar} ...</echo>
    170         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    171             <env key="LANG" value="C"/>
    172             <arg value="up"/>
    173             <arg value="../dist/${plugin.jar}"/>
    174         </exec>
    175     </target>
    176     <!-- commits the plugin.jar -->
    177     <target name="commit-dist">
    178         <echo>
    179     ***** Properties of published ${plugin.jar} *****
    180     Commit message    : '${commit.message}'                   
    181     Plugin-Mainversion: ${plugin.main.version}
    182     JOSM build version: ${coreversion.info.entry.revision}
    183     Plugin-Version    : ${version.entry.commit.revision}
    184     ***** / Properties of published ${plugin.jar} *****                   
    185                        
    186     Now commiting ${plugin.jar} ...
    187     </echo>
    188         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    189             <env key="LANG" value="C"/>
    190             <arg value="-m '${commit.message}'"/>
    191             <arg value="commit"/>
    192             <arg value="${plugin.jar}"/>
    193         </exec>
    194     </target>
    195     <!-- make sure svn is present as a command line tool -->
    196     <target name="ensure-svn-present">
    197         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
    198             <env key="LANG" value="C"/>
    199             <arg value="--version"/>
    200         </exec>
    201         <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
    202             <!-- return code not set at all? Most likely svn isn't installed -->
    203             <condition>
    204                 <not>
    205                     <isset property="svn.exit.code"/>
    206                 </not>
    207             </condition>
    208         </fail>
    209         <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
    210             <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
    211             <condition>
    212                 <isfailure code="${svn.exit.code}"/>
    213             </condition>
    214         </fail>
    215     </target>
    216     <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
    217     </target>
     36
    21837</project>
Note: See TracChangeset for help on using the changeset viewer.