Ignore:
Timestamp:
2012-04-14T13:21:23+02:00 (13 years ago)
Author:
stoecker
Message:

add sds plugin to build

Location:
applications/editors/josm/plugins/sds
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/sds

    • Property svn:ignore set to
      build
  • applications/editors/josm/plugins/sds/build.xml

    r28160 r28291  
    11<?xml version="1.0" encoding="utf-8"?>
    22<!--
    3 ** This is the build.xml for the SDS plugin
     3** Maintaining versions
     4** ====================
     5** see README.template
    46**
    57** Usage
     
    79** To build it run
    810**
    9 **    > ant  dist
     11**    > ant
     12** or
     13**    > ant clean dist
    1014**
    11 ** To install the generated plugin locally (in your default plugin directory) run
     15** To install the generated plugin locally (in you default plugin directory) run
    1216**
    13 **    > ant  install
     17**    > ant install
    1418**
    15 ** To build against the core in ../../core, create a correct manifest and deploy to
    16 ** SVN,
     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:
    1724**    set the properties commit.message and plugin.main.version
    1825** and run
     
    2229-->
    2330<project name="sds" default="dist" basedir=".">
     31
     32    <!-- enter the SVN commit message -->
     33    <property name="commit.message" value=""/>
     34    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     35    <property name="plugin.main.version" value="4549"/>
     36
    2437    <!--
    25       ** update before publishing
     38    **********************************************************
     39    ** include targets that all plugins have in common
     40    **********************************************************
    2641    -->
    27     <property name="commit.message" value=""/>
    28     <property name="plugin.main.version" value="4549"/>
    29     <property name="josm" location="../josm/build" />
    30     <property name="plugin.dist.dir" value="."/>
    31     <property name="plugin.build.dir" value="build"/>
    32     <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    33     <property name="ant.build.javac.target" value="1.5"/>
    34     <target name="init">
    35         <mkdir dir="${plugin.build.dir}"/>
    36     </target>
    37     <target name="compile" depends="init">
    38         <echo message="creating ${plugin.jar}"/>
    39         <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
    40             <compilerarg value="-Xlint:deprecation"/>
    41             <compilerarg value="-Xlint:unchecked"/>
    42         </javac>
    43     </target>
     42    <import file="../build-common.xml"/>
     43
    4444    <target name="dist" depends="compile,revision">
    4545        <copy todir="${plugin.build.dir}/images">
     
    6262        </jar>
    6363    </target>
    64     <target name="revision">
    65     <!--
    66         <exec append="false" error="/dev/null" output="REVISION" executable="svn" failifexecutionfails="false">
    67             <env key="LANG" value="C"/>
    68             <arg value="info"/>
    69             <arg value="__xml"/>
    70             <arg value="."/>
    71         </exec>
    72         -->
    73         <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    74         <!--
    75         <delete file="REVISION"/>
    76         -->
    77     </target>
    78     <target name="clean">
    79         <delete dir="${plugin.build.dir}"/>
    80         <delete file="${plugin.jar}"/>
    81     </target>
    82     <target name="install" depends="dist">
    83         <property environment="env"/>
    84         <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    85             <and>
    86                 <os family="windows"/>
    87             </and>
    88         </condition>
    89         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    90     </target>
    91     <!--
    92      ************************** Publishing the plugin ***********************************
    93     -->
    94     <!--
    95     ** extracts the JOSM release for the JOSM version in ../core and saves it in the
    96     ** property ${coreversion.info.entry.revision}
    97     **
    98     -->
    99     <target name="core-info">
    100         <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
    101             <env key="LANG" value="C"/>
    102             <arg value="info"/>
    103             <arg value="--xml"/>
    104             <arg value="../../core"/>
    105         </exec>
    106         <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
    107         <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
    108         <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
    109         <delete file="core.info.xml"/>
    110     </target>
    111     <!--
    112     ** commits the source tree for this plugin
    113     -->
    114     <target name="commit-current">
    115         <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
    116         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    117             <env key="LANG" value="C"/>
    118             <arg value="-m '${commit.message}'"/>
    119             <arg value="commit"/>
    120             <arg value="."/>
    121         </exec>
    122     </target>
    123     <!--
    124     ** updates (svn up) the source tree for this plugin
    125     -->
    126     <target name="update-current">
    127         <echo>Updating plugin source ...</echo>
    128         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    129             <env key="LANG" value="C"/>
    130             <arg value="up"/>
    131             <arg value="."/>
    132         </exec>
    133         <echo>Updating ${plugin.jar} ...</echo>
    134         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    135             <env key="LANG" value="C"/>
    136             <arg value="up"/>
    137             <arg value="../dist/${plugin.jar}"/>
    138         </exec>
    139     </target>
    140     <!--
    141     ** commits the plugin.jar
    142     -->
    143     <target name="commit-dist">
    144         <echo>
    145 ***** Properties of published ${plugin.jar} *****
    146 Commit message    : '${commit.message}'
    147 Plugin-Mainversion: ${plugin.main.version}
    148 JOSM build version: ${coreversion.info.entry.revision}
    149 Plugin-Version    : ${version.entry.commit.revision}
    150 ***** / Properties of published ${plugin.jar} *****
    151 
    152 Now commiting ${plugin.jar} ...
    153 </echo>
    154         <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
    155             <env key="LANG" value="C"/>
    156             <arg value="-m '${commit.message}'"/>
    157             <arg value="commit"/>
    158             <arg value="${plugin.jar}"/>
    159         </exec>
    160     </target>
    161     <!-- ** make sure svn is present as a command line tool ** -->
    162     <target name="ensure-svn-present">
    163         <exec append="true" output="svn.log" executable="svn" failonerror="false" resultproperty="svn.exit.code">
    164             <env key="LANG" value="C"/>
    165             <arg value="--version"/>
    166         </exec>
    167         <fail message="Fatal: command 'svn' not found. Please make sure svn is installed on your system.">
    168             <condition>
    169                 <isfailure code="${svn.exit.code}"/>
    170             </condition>
    171         </fail>
    172     </target>
    173     <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
    174     </target>
    17564</project>
Note: See TracChangeset for help on using the changeset viewer.