Ignore:
Timestamp:
2007-10-28T11:34:37+01:00 (17 years ago)
Author:
ulf
Message:
  • find the JOSM home dir independent of the platform
  • some cleanup
  • some minor fixes (e.g. clean_install)
File:
1 edited

Legend:

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

    r5197 r5207  
    11<project name="mappaint" default="dist" basedir=".">
    22
     3  <!-- josm "user home" directory depends on the platform used (windows has a different place than unix/linux) -->
     4  <property environment="env"/>
     5  <condition property="josm.home.dir" value="${env.APPDATA}/JOSM" else="${user.home}/.josm">
     6    <and>
     7      <os family="windows"/>
     8    </and>
     9  </condition>
     10
    311  <!-- compilation properties -->
    4   <property name="josm.build.dir"       value="../../core"/>
    5   <property name="josm.home.dir"        value="${user.home}/.josm"/>
    6   <property name="josm"                 location="../../core/dist/josm-custom.jar" />
    7   <property name="plugin.build.dir"     value="build"/>
    8   <property name="plugin.dist.dir"      value="../dist"/>
    9   <property name="plugin.name"          value="${ant.project.name}"/>
    10   <property name="plugin.jar"           value="../dist/${plugin.name}.jar"/>
    11  
    12   <!-- There's no josm.jar in the svn, so point "josm" to a local copy of your JOSM binary -->
    13   <property name="josm" location="../../core/dist/josm-custom.jar" />
    14   <!--<property name="josm" location="../josm/josm-latest.jar" ></property>-->
    15  
    16   <!-- target directory to place the plugin in -->
    17   <!-- Windows has a different home directory scheme then unix/linux -->
    18   <!-- I don't know an automatic way to find it with ant :-(, if you know, please fix -->
    19   <property name="plugins" location="${user.home}/.josm/plugins" ></property>
    20   <!--<property name="plugins" location="${user.home}/Anwendungsdaten/JOSM/plugins" ></property>-->
     12  <property name="josm.build.dir"   value="../../core"/>
     13  <property name="josm.plugins.dir" value="${josm.home.dir}/plugins"/>
     14  <property name="josm.jar"         location="../../core/dist/josm-custom.jar" />
     15  <property name="plugin.build.dir" value="build"/>
     16  <property name="plugin.dist.dir"  value="../dist"/>
     17  <property name="plugin.name"      value="${ant.project.name}"/>
     18  <property name="plugin.jar"       value="../dist/${plugin.name}.jar"/>
     19
    2120
    2221  <!-- you should not need to modify anything below this! -->
    2322
    24   <property name="ant.build.javac.target" value="1.5"/>
    25 
    26 
    27   <target name="init">
    28     <mkdir dir="build"></mkdir>
    29     <mkdir dir="dist"></mkdir>
    30   </target>
    31 
    32   <target name="compile" depends="init">
    33     <javac srcdir="src" classpath="${josm}" destdir="build" debug="true" source="1.5" target="1.5">
     23  <target name="compile">
     24    <mkdir dir="${plugin.build.dir}"></mkdir>
     25    <javac srcdir="src" classpath="${josm.jar}" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
    3426      <include name="**/*.java" />
     27          <!--compilerarg value="-Xlint:deprecation"/-->
    3528    </javac>
    3629  </target>
    3730
    3831  <target name="dist" depends="compile">
    39     <copy todir="build/standard">
     32    <!-- copy the "standard" mappaint style -->
     33    <copy todir="${plugin.build.dir}/standard">
    4034      <fileset dir="styles/standard"></fileset>
    4135    </copy>
     36    <!-- define the version of the jar file -->
    4237    <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    4338      <env key="LANG" value="C"/>
     
    4742    </exec>
    4843    <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
     44        <!-- delete intermediate file -->
    4945    <delete file="REVISION"/>
    50     <jar destfile="${plugin.jar}" basedir="build">
     46    <!-- create jar file with manifest -->
     47    <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    5148      <manifest>
    52         <attribute name="Plugin-Class" value="mappaint.MapPaintPlugin" />
    53         <attribute name="Plugin-Description" value="An alternative render for the map with colouring, line thickness and icons.&lt;br&gt;" />
    54         <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    55         <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    56         <attribute name="Author" value="Nick Whitelegg / Ulf Lamping"/>
     49        <attribute name="Plugin-Class" value="mappaint.MapPaintPlugin" />
     50        <attribute name="Plugin-Description" value="An alternative render for the map with colouring, line thickness and icons.&lt;br&gt;" />
     51        <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     52        <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
     53        <attribute name="Author" value="Nick Whitelegg / Ulf Lamping"/>
    5754      </manifest>
    5855    </jar>
     
    6562
    6663  <target name="clean_install">
    67     <delete file="${plugins}/mappaint.jar" />
     64    <delete file="${josm.plugins.dir}/${plugin.name}.jar" />
    6865  </target>
    6966
    7067  <target name="install" depends="dist">
    71     <copy file="${plugin.jar}" todir="${plugins}"/>
     68    <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    7269  </target>
    7370
Note: See TracChangeset for help on using the changeset viewer.