Changeset 34703 in osm for applications/editors/josm/plugins/javafx
- Timestamp:
- 2018-10-29T14:52:21+01:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/javafx
- Files:
-
- 3 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/javafx/build.xml
r34701 r34703 1 1 <?xml version="1.0" encoding="utf-8"?> 2 <project name="javafx" default="dist" basedir="."> 2 <project name="javafx" default="dist" basedir="." xmlns:if="ant:if" xmlns:unless="ant:unless"> 3 3 <!-- enter the SVN commit message --> 4 4 <property name="commit.message" value="Commit message"/> … … 6 6 <property name="plugin.main.version" value="14234"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). 9 9 See https://josm.openstreetmap.de/wiki/DevelopersGuide/DevelopingPlugins 10 10 --> 11 11 <property name="plugin.author" value="Don-vip"/> 12 <property name="plugin.class" value="org.openstreetmap.josm.plugins.javafx.JavaFxPlugin"/> 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"/> 13 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."/> 14 16 <property name="plugin.minimum.java.version" value="11"/> … … 23 25 <import file="../build-common.xml"/> 24 26 25 26 27 27 <target name="pre-compile" depends="fetch_dependencies"> 28 <!-- include fetch_dependencies task --> 29 </target> 28 30 29 <!-- Override build-jar target to speed up merging from 16 minutes to 7 minutes --> 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="${property.value}" /> 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 30 84 <target name="build-jar"> 31 <echo>Building commong jar...</echo> 32 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="MANIFEST" manifestencoding="UTF-8" duplicate="preserve" level="9"> 33 <restrict> 34 <not><or> 35 <name name="META-INF/maven/*"/> 36 <name name="META-INF/DEPENDENCIES"/> 37 <name name="META-INF/LICENSE"/> 38 <name name="META-INF/NOTICE"/> 39 <name name="META-INF/*.RSA"/> 40 <name name="META-INF/*.SF"/> 41 <name name="module-info.class"/> 42 </or></not> 43 <archives> 44 <zips> 45 <fileset dir="${plugin.lib.dir}" includes="*-linux.jar"/> 46 </zips> 47 </archives> 48 </restrict> 49 </jar> 50 <echo>Adding macOS artifacts...</echo> 51 <jar destfile="${plugin.jar}" update="true" duplicate="preserve" level="9"> 52 <restrict> 53 <or> 54 <name name="*.dylib"/> 55 <name name="com/sun/glass/events/mac/**"/> 56 <name name="com/sun/glass/ui/mac/**"/> 57 <name name="com/sun/media/jfxmediaimpl/platform/osx/**"/> 58 <name name="com/sun/prism/es2/**"/> 59 </or> 60 <archives> 61 <zips> 62 <fileset dir="${plugin.lib.dir}" includes="*-mac.jar"/> 63 </zips> 64 </archives> 65 </restrict> 66 </jar> 67 <echo>Adding Windows artifacts...</echo> 68 <jar destfile="${plugin.jar}" update="true" duplicate="preserve" level="9"> 69 <restrict> 70 <or> 71 <name name="*.dll"/> 72 <name name="com/sun/glass/ui/win/**"/> 73 <name name="com/sun/prism/d3d/**"/> 74 <name name="com/sun/scenario/effect/impl/hw/d3d/**"/> 75 </or> 76 <archives> 77 <zips> 78 <fileset dir="${plugin.lib.dir}" includes="*-win.jar"/> 79 </zips> 80 </archives> 81 </restrict> 82 </jar> 83 <echo>Adding Monocle artifacts...</echo> 84 <jar destfile="${plugin.jar}" update="true" duplicate="preserve" level="9"> 85 <restrict> 86 <archives> 87 <zips> 88 <fileset dir="${plugin.lib.dir}" includes="*-monocle*.jar"/> 89 </zips> 90 </archives> 91 </restrict> 92 </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" /> 93 88 </target> 94 89 </project> -
applications/editors/josm/plugins/javafx/src/org/openstreetmap/josm/plugins/javafx/JavaFxPlugin.java
r34701 r34703 27 27 import org.openstreetmap.josm.plugins.javafx.io.audio.JavaFxMediaPlayer; 28 28 import org.openstreetmap.josm.tools.Logging; 29 import org.openstreetmap.josm.tools.PlatformManager;30 29 31 30 /** 32 31 * OpenJFX plugin brings OpenJFX (JavaFX) to other plugins. 33 32 */ 34 publicclass JavaFxPlugin extends Plugin {33 abstract class JavaFxPlugin extends Plugin { 35 34 36 35 /** 37 36 * Constructs a new {@code OpenJfxPlugin}. 38 37 * @param info plugin info 38 * @param ext native libraries extension 39 39 */ 40 p ublicJavaFxPlugin(PluginInformation info) {40 protected JavaFxPlugin(PluginInformation info, String ext) { 41 41 super(info); 42 42 AudioPlayer.setSoundPlayerClass(JavaFxMediaPlayer.class); 43 String ext = null;44 if (PlatformManager.isPlatformWindows()) {45 ext = ".dll";46 } else if (PlatformManager.isPlatformUnixoid()) {47 ext = ".so";48 } else if (PlatformManager.isPlatformOsx()) {49 ext = ".dylib";50 }51 43 extractNativeLibs(ext); 52 44 loadNativeLibs(ext);
Note:
See TracChangeset
for help on using the changeset viewer.