source: osm/applications/editors/josm/plugins/javafx/build.xml@ 34711

Last change on this file since 34711 was 34705, checked in by donvip, 6 years ago

see #josm16912 - fix manifest

File size: 4.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<project name="javafx" default="dist" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless">
3 <!-- enter the SVN commit message -->
4 <property name="commit.message" value="Commit message"/>
5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
6 <property name="plugin.main.version" value="14234"/>
7
8 <!-- Configure these properties (replace "..." accordingly).
9 See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins
10 -->
11 <property name="plugin.author" value="Don-vip"/>
12 <property name="plugin.class.windows" value="org.openstreetmap.josm.plugins.javafx.JavaFxPluginWindows"/>
13 <property name="plugin.class.unixoid" value="org.openstreetmap.josm.plugins.javafx.JavaFxPluginUnixoid"/>
14 <property name="plugin.class.osx" value="org.openstreetmap.josm.plugins.javafx.JavaFxPluginOsx"/>
15 <property name="plugin.description" value="Provides the OpenJFX (JavaFX) library for JOSM core and other JOSM plugins. Provides additional features such as MP3 audio playback."/>
16 <property name="plugin.minimum.java.version" value="11"/>
17 <property name="plugin.provides" value="javafx"/>
18 <!--<property name="plugin.icon" value="..."/>-->
19 <!--<property name="plugin.link" value="..."/>-->
20 <property name="plugin.early" value="true"/>
21 <!--<property name="plugin.requires" value="..."/>-->
22 <property name="plugin.stage" value="5"/>
23
24 <!-- ** include targets that all plugins have in common ** -->
25 <import file="../build-common.xml"/>
26
27 <target name="pre-compile" depends="fetch_dependencies">
28 <!-- include fetch_dependencies task -->
29 </target>
30
31 <macrodef name="build-native-manifest">
32 <attribute name="class"/>
33 <attribute name="manifest"/>
34 <attribute name="platform"/>
35 <sequential>
36 <copy file="MANIFEST" tofile="@{manifest}" />
37 <manifest file="@{manifest}" mode="update">
38 <attribute name="Plugin-Class" value="@{class}" />
39 <attribute name="Plugin-Platform" value="@{platform}" />
40 </manifest>
41 </sequential>
42 </macrodef>
43
44 <target name="additional-manifest">
45 <build-native-manifest platform="Windows" class="${plugin.class.windows}" manifest="${manifest.windows}"/>
46 <build-native-manifest platform="Unixoid" class="${plugin.class.unixoid}" manifest="${manifest.unixoid}" />
47 <build-native-manifest platform="Osx" class="${plugin.class.osx}" manifest="${manifest.osx}" />
48 </target>
49
50 <macrodef name="build-native-jar">
51 <attribute name="jar"/>
52 <attribute name="manifest"/>
53 <attribute name="qualifier"/>
54 <attribute name="copy"/>
55 <sequential>
56 <echo>Building @{qualifier} jar...</echo>
57 <!-- Building the JAR file directly from javafx jar files is awfully slow,
58 see https://bz.apache.org/bugzilla/show_bug.cgi?id=43144 -->
59 <mkdir dir="${plugin.lib.dir}/@{qualifier}"/>
60 <unzip dest="${plugin.lib.dir}/@{qualifier}">
61 <patternset>
62 <exclude name="META-INF/maven/*"/>
63 <exclude name="META-INF/DEPENDENCIES"/>
64 <exclude name="META-INF/LICENSE"/>
65 <exclude name="META-INF/NOTICE"/>
66 <exclude name="META-INF/*.RSA"/>
67 <exclude name="META-INF/*.SF"/>
68 <exclude name="module-info.class"/>
69 </patternset>
70 <fileset dir="${plugin.lib.dir}">
71 <include name="*-@{qualifier}.jar"/>
72 <include name="*-monocle*.jar"/>
73 </fileset>
74 </unzip>
75 <jar destfile="@{jar}" manifest="@{manifest}" manifestencoding="UTF-8" level="9">
76 <fileset dir="${plugin.build.dir}"/>
77 <fileset dir="${plugin.lib.dir}/@{qualifier}"/>
78 </jar>
79 <delete dir="${plugin.lib.dir}/@{qualifier}" failonerror="false" />
80 <copy file="@{jar}" tofile="${plugin.jar}" if:set="@{copy}" />
81 </sequential>
82 </macrodef>
83
84 <target name="build-jar">
85 <build-native-jar jar="${plugin.unixoid.jar}" manifest="${manifest.unixoid}" qualifier="linux" copy="isUnix" />
86 <build-native-jar jar="${plugin.windows.jar}" manifest="${manifest.windows}" qualifier="win" copy="isWindows" />
87 <build-native-jar jar="${plugin.osx.jar}" manifest="${manifest.osx}" qualifier="mac" copy="isMac" />
88 </target>
89</project>
Note: See TracBrowser for help on using the repository browser.