Ignore:
Timestamp:
2009-03-08T12:02:49+01:00 (15 years ago)
Author:
stoecker
Message:

cleanup build scripts and manifests

File:
1 edited

Legend:

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

    r12780 r14003  
    11<project name="colorscheme" default="dist" basedir=".">
    2 <!-- compilation properties -->
    3     <property name="josm.build.dir"   value="../../core"/>
    4     <property name="josm.home.dir"    value="${user.home}/.josm"/>
    5     <property name="josm"         location="../../core/dist/josm-custom.jar" />
    6     <property name="plugin.build.dir" value="build"/>
    7     <property name="plugin.dist.dir"  value="../../dist"/>
    8     <property name="plugin.name"      value="${ant.project.name}"/>
    9     <property name="plugin.jar"       value="../../dist/${plugin.name}.jar"/>
    10     <property name="plugin.description" value="Allows the user to create different color schemes and to switch between them. Just change the colors and create a new scheme. Used to switch to a white background with matching colors for better visibility in bright sunlight. See dialog in JOSM's preferences and 'Map Settings' (strange but true :-) (V${plugin.version})."/>
    11     <property name="plugin.class" value="at.dallermassl.josm.plugin.colorscheme.ColorSchemePlugin"/>
    12 <!-- update site meta data -->
    13     <property name="plugin.site.file" value="josm-site.xml"/>
    14     <property name="plugin.site.description" value="Josm's ColorScheme Plugin Update Site"/>
    15     <property name="plugin.site.url" value="http://www.tegmento.org/~cdaller/josm/colorscheme/"/>
    16     <property name="plugin.site.upload.target" value="cdaller@www.tegmento.org:public_html/josm/colorscheme/"/>
     2    <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
     3    <property name="plugin.dist.dir"        value="../../dist"/>
     4    <property name="plugin.build.dir"       value="build"/>
     5    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    176    <property name="ant.build.javac.target" value="1.5"/>
    18     <target name="dist" depends="compile, site">
     7    <target name="init">
     8        <mkdir dir="${plugin.build.dir}"/>
     9    </target>
     10    <target name="compile" depends="init">
    1911        <echo message="creating ${plugin.jar}"/>
    20 <!-- images -->
    21 <!--
    22      <copy todir="${plugin.build.dir}/images">
    23        <fileset dir="src/images" />
    24      </copy>
    25      -->
    26 <!-- copy configuration xml files -->
     12        <javac srcdir="src" classpath="${josm}" debug="false" destdir="${plugin.build.dir}">
     13            <compilerarg value="-Xlint:deprecation"/>
     14            <compilerarg value="-Xlint:unchecked"/>
     15        </javac>
     16    </target>
     17    <target name="dist" depends="compile,revision">
    2718        <copy todir="${plugin.build.dir}">
    2819            <fileset dir="src">
     
    3021            </fileset>
    3122        </copy>
     23        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
     24            <manifest>
     25                <attribute name="Author" value="Christof Dallermassl"/>
     26                <attribute name="Plugin-Class" value="at.dallermassl.josm.plugin.colorscheme.ColorSchemePlugin" />
     27                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
     28                <attribute name="Plugin-Description" value="Allows the user to create different color schemes and to switch between them. Just change the colors and create a new scheme. Used to switch to a white background with matching colors for better visibility in bright sunlight. See dialog in JOSM's preferences and 'Map Settings' (strange but true :-)" />
     29                <attribute name="Plugin-Mainversion" value="1180"/>
     30                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
     31            </manifest>
     32        </jar>
     33    </target>
     34    <target name="revision">
    3235        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
    3336            <env key="LANG" value="C"/>
     
    3841        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
    3942        <delete file="REVISION"/>
    40 <!-- create jar file -->
    41         <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
    42             <manifest>
    43                 <attribute name="Plugin-Class" value="${plugin.class}" />
    44                 <attribute name="Plugin-Description" value="${plugin.description}" />
    45                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    46                 <attribute name="Plugin-Mainversion" value="1180"/>
    47                 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    48             </manifest>
    49         </jar>
    5043    </target>
    51     <target name="compile" depends="init">
    52         <mkdir dir="${plugin.build.dir}"/>
    53         <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
    54             <classpath>
    55                 <pathelement path="${josm.build.dir}/build"/>
    56                 <fileset dir="${josm.build.dir}/lib">
    57                     <include name="**/*.jar"/>
    58                 </fileset>
    59             </classpath>
    60         </javac>
     44    <target name="clean">
     45        <delete dir="${plugin.build.dir}"/>
     46        <delete file="${plugin.jar}"/>
    6147    </target>
    6248    <target name="install" depends="dist">
    63         <copy file="${plugin.jar}" todir="${josm.home.dir}/plugins" />
    64     </target>
    65     <target name="init">
    66         <echo>java version: ${java.version}</echo>
    67     </target>
    68     <target name="clean">
    69         <delete dir="${plugin.site.file}" />
    70         <delete dir="${plugin.build.dir}" />
    71         <delete file="${plugin.jar}" />
    72     </target>
    73 <!-- write site description for the given plugin so josm will accept it -->
    74     <target name="site">
    75         <echo message="creating site description in ${plugin.site.file}"/>
    76         <echo file="${plugin.site.file}">&lt;!-- plugins available on this site -->
    77   &lt;plugins>
    78   &lt;plugin id="${ant.project.name}" version="${plugin.version}">
    79   &lt;name>${ant.project.name}&lt;/name>
    80   &lt;description>${plugin.description}&lt;/description>
    81   &lt;resource>${plugin.site.url}${plugin.jar}&lt;/resource>
    82   &lt;/plugin>
    83   &lt;/plugins>
    84 </echo>
    85     </target>
    86 <!-- write site description for the given plugin (not implemented in JOSM as full version yet!) -->
    87     <target name="site-full-donotuse">
    88         <echo message="creating site description in ${plugin.site.file}"/>
    89         <echo file="${plugin.site.file}">&lt;?xml version="1.0"?>
    90     &lt;site version="1.0">
    91     &lt;!-- meta data of site -->
    92 &lt;site-info>
    93 &lt;site-name>${plugin.site.description}&lt;/site-name>
    94 &lt;site-url>${plugin.site.url}&lt;/site-url>
    95 &lt;/site-info>
    96 
    97 &lt;!-- plugins available on this site -->
    98 &lt;plugins>
    99 &lt;plugin id="${ant.project.name}" version="${plugin.version}">
    100 &lt;name>${ant.project.name}&lt;/name>
    101 &lt;description>${plugin.description}&lt;/description>
    102 &lt;resources>
    103 &lt;resource src="${plugin.site.url}${plugin.jar}"
    104 target="${josm.home.dir}/plugins/${plugin.jar}"/>
    105 &lt;/resources>
    106 &lt;/plugin>
    107 &lt;/plugins>
    108 &lt;/site>
    109 </echo>
    110     </target>
    111 <!-- upload the site description and the jar file via ssh -->
    112     <target name="upload" depends="dist,site">
    113         <echo message="uploading jar and site description to ${plugin.site.upload.target}"/>
    114         <exec executable="scp">
    115             <arg value="${plugin.jar}"/>
    116             <arg value="${plugin.site.file}"/>
    117             <arg value="${plugin.site.upload.target}"/>
    118         </exec>
     49        <property environment="env"/>
     50        <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
     51            <and>
     52                <os family="windows"/>
     53            </and>
     54        </condition>
     55        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
    11956    </target>
    12057</project>
Note: See TracChangeset for help on using the changeset viewer.