Ignore:
Timestamp:
2010-01-30T17:53:33+01:00 (15 years ago)
Author:
bastik
Message:

'josm plugin photo_geotagging: update'

File:
1 edited

Legend:

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

    r19671 r19672  
    1414** dialog. You have to check it in first.
    1515**
     16** Use the ant target 'publish' to check in the plugin and make it available to other
     17** JOSM users:
     18**    set the properties commit.message and plugin.main.version
     19** and run
     20**    > ant  publish
     21**
     22**
    1623-->
    1724<project name="photo_geotagging" default="dist" basedir=".">
    18     <!--
     25
     26        <!-- enter the SVN commit message -->
     27        <property name="commit.message" value="josm plugin photo_geotagging: update" />
     28        <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     29        <property name="plugin.main.version" value="2904" />
     30
     31
     32        <!--
    1933      ************************************************
    2034      ** should not be necessary to change the following properties
    2135     -->
    22     <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
    23     <property name="plugin.build.dir"       value="build"/>
    24     <property name="plugin.src.dir"         value="src"/>
    25     <!-- this is the directory where the plugin jar is copied to -->
    26     <property name="plugin.dist.dir"        value="../../dist"/>
    27     <property name="ant.build.javac.target" value="1.5"/>
    28     <property name="plugin.dist.dir"        value="../../dist"/>
    29     <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    30 
    31     <!--
     36        <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
     37        <property name="plugin.build.dir"       value="build"/>
     38        <property name="plugin.src.dir"         value="src"/>
     39        <!-- this is the directory where the plugin jar is copied to -->
     40        <property name="plugin.dist.dir"        value="../../dist"/>
     41        <property name="ant.build.javac.target" value="1.5"/>
     42        <property name="plugin.dist.dir"        value="../../dist"/>
     43        <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
     44
     45        <!--
    3246    **********************************************************
    3347    ** init - initializes the build
    3448    **********************************************************
    3549    -->
    36     <target name="init">
    37         <mkdir dir="${plugin.build.dir}"/>
    38     </target>
    39 
    40     <!--
     50        <target name="init">
     51                <mkdir dir="${plugin.build.dir}"/>
     52        </target>
     53
     54        <!--
    4155    **********************************************************
    4256    ** compile - complies the source tree
    4357    **********************************************************
    4458    -->
    45     <target name="compile" depends="init">
    46         <echo message="compiling sources for  ${plugin.jar} ... "/>
    47         <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
    48             <compilerarg value="-Xlint:deprecation"/>
    49             <compilerarg value="-Xlint:unchecked"/>
    50         </javac>
    51     </target>
    52 
    53     <!--
     59        <target name="compile" depends="init">
     60                <echo message="compiling sources for  ${plugin.jar} ... "/>
     61                <javac srcdir="src" classpath="${josm}" debug="true" destdir="${plugin.build.dir}">
     62                        <compilerarg value="-Xlint:deprecation"/>
     63                        <compilerarg value="-Xlint:unchecked"/>
     64                </javac>
     65        </target>
     66
     67        <!--
    5468    **********************************************************
    5569    ** dist - creates the plugin jar
    5670    **********************************************************
    5771    -->
    58     <target name="dist" depends="compile,revision">
    59         <echo message="creating ${ant.project.name}.jar ... "/>
    60         <copy todir="${plugin.build.dir}/images">
    61             <fileset dir="images"/>
    62         </copy>
    63         <copy todir="${plugin.build.dir}">
    64             <fileset dir=".">
    65                 <include name="README" />
    66             </fileset>
    67         </copy>
    68         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    69     <!--
     72        <target name="dist" depends="compile,revision">
     73                <echo message="creating ${ant.project.name}.jar ... "/>
     74                <copy todir="${plugin.build.dir}/images">
     75                        <fileset dir="images"/>
     76                </copy>
     77                <copy todir="${plugin.build.dir}">
     78                        <fileset dir=".">
     79                                <include name="README" />
     80                        </fileset>
     81                </copy>
     82                <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
     83                        <!--
    7084        ************************************************
    7185        ** configure these properties. Most of them will be copied to the plugins
     
    7589        ************************************************
    7690    -->
    77             <manifest>
    78                 <attribute name="Author" value="Sebastian Klein"/>
    79                 <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingPlugin"/>
    80                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    81                 <attribute name="Plugin-Description" value="Write gps position info to the image file header. Run this feature from the right click menu of the image layer."/>
    82                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Photo_Geotagging"/>
    83                 <attribute name="Plugin-Mainversion" value="2904"/>
    84                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    85             </manifest>
    86         </jar>
    87     </target>
    88 
    89     <!--
     91                        <manifest>
     92                                <attribute name="Author" value="Sebastian Klein"/>
     93                                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.photo_geotagging.GeotaggingPlugin"/>
     94                                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
     95                                <attribute name="Plugin-Description" value="Write gps position info to the image file header. Run this feature from the right click menu of the image layer."/>
     96                                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Photo_Geotagging"/>
     97                                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
     98                                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     99                        </manifest>
     100                </jar>
     101        </target>
     102
     103        <!--
    90104    **********************************************************
    91105    ** revision - extracts the current revision number for the
     
    94108    **********************************************************
    95109    -->
    96     <target name="revision">
    97 
    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     <!--
     110        <target name="revision">
     111
     112                <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
     113                        <env key="LANG" value="C"/>
     114                        <arg value="info"/>
     115                        <arg value="--xml"/>
     116                        <arg value="."/>
     117                </exec>
     118                <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
     119                <delete file="REVISION"/>
     120        </target>
     121
     122        <!--
    109123    **********************************************************
    110124    ** clean - clean up the build environment
    111125    **********************************************************
    112126    -->
    113     <target name="clean">
    114         <delete dir="${plugin.build.dir}"/>
    115         <delete file="${plugin.jar}"/>
    116     </target>
    117 
    118     <!--
     127        <target name="clean">
     128                <delete dir="${plugin.build.dir}"/>
     129                <delete file="${plugin.jar}"/>
     130        </target>
     131
     132        <!--
    119133    **********************************************************
    120134    ** install - install the plugin in your local JOSM installation
    121135    **********************************************************
    122136    -->
    123     <target name="install" depends="dist">
    124         <property environment="env"/>
    125         <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
    126             <and>
    127                 <os family="windows"/>
    128             </and>
    129         </condition>
    130         <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    131     </target>
     137        <target name="install" depends="dist">
     138                <property environment="env"/>
     139                <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
     140                        <and>
     141                                <os family="windows"/>
     142                        </and>
     143                </condition>
     144                <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
     145        </target>
     146
     147
     148        <!--
     149        ************************** Publishing the plugin ***********************************
     150        -->
     151        <!--
     152                ** extracts the JOSM release for the JOSM version in ../core and saves it in the
     153                ** property ${coreversion.info.entry.revision}
     154                **
     155                -->
     156        <target name="core-info">
     157                <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
     158                        <env key="LANG" value="C"/>
     159                        <arg value="info"/>
     160                        <arg value="--xml"/>
     161                        <arg value="../../core"/>
     162                </exec>
     163                <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
     164                <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
     165                <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
     166                <delete file="core.info.xml" />
     167        </target>
     168
     169        <!--
     170                ** commits the source tree for this plugin
     171                -->
     172        <target name="commit-current">
     173                <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
     174                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     175                        <env key="LANG" value="C"/>
     176                        <arg value="commit"/>
     177                        <arg value="-m '${commit.message}'"/>
     178                        <arg value="."/>
     179                </exec>
     180        </target>
     181
     182        <!--
     183                ** updates (svn up) the source tree for this plugin
     184                -->
     185        <target name="update-current">
     186                <echo>Updating plugin source ...</echo>
     187                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     188                        <env key="LANG" value="C"/>
     189                        <arg value="up"/>
     190                        <arg value="."/>
     191                </exec>
     192                <echo>Updating ${plugin.jar} ...</echo>
     193                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     194                        <env key="LANG" value="C"/>
     195                        <arg value="up"/>
     196                        <arg value="../dist/${plugin.jar}"/>
     197                </exec>
     198        </target>
     199
     200        <!--
     201                ** commits the plugin.jar
     202                -->
     203        <target name="commit-dist">
     204                <echo>
     205        ***** Properties of published ${plugin.jar} *****
     206        Commit message    : '${commit.message}'                                 
     207        Plugin-Mainversion: ${plugin.main.version}
     208        JOSM build version: ${coreversion.info.entry.revision}
     209        Plugin-Version    : ${version.entry.commit.revision}
     210        ***** / Properties of published ${plugin.jar} *****                                     
     211                                               
     212        Now commiting ${plugin.jar} ...
     213        </echo>
     214                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
     215                        <env key="LANG" value="C"/>
     216                        <arg value="-m '${commit.message}'"/>
     217                        <arg value="commit"/>
     218                        <arg value="${plugin.jar}"/>
     219                </exec>
     220        </target>
     221
     222        <!-- ** make sure svn is present as a command line tool ** -->
     223        <target name="ensure-svn-present">
     224                <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
     225                        <env key="LANG" value="C" />
     226                        <arg value="--version" />
     227                </exec>
     228                <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
     229                        <!-- return code not set at all? Most likely svn isn't installed -->
     230                        <condition>
     231                                <not>
     232                                        <isset property="svn.exit.code" />
     233                                </not>
     234                        </condition>
     235                </fail>
     236                <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
     237                        <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
     238                        <condition>
     239                                <isfailure code="${svn.exit.code}" />
     240                        </condition>
     241                </fail>
     242        </target>
     243
     244        <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
     245        </target>
    132246</project>
Note: See TracChangeset for help on using the changeset viewer.