Changeset 34703 in osm
- Timestamp:
- 2018-10-29T14:52:21+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/build-common.xml
r34682 r34703 33 33 <property name="plugin.dist.dir" location="../../dist"/> 34 34 <property name="java.lang.version" value="1.8" /> 35 <property name="manifest" value="MANIFEST"/> 36 <property name="manifest.unixoid" value="MANIFEST-unixoid"/> 37 <property name="manifest.windows" value="MANIFEST-windows"/> 38 <property name="manifest.osx" value="MANIFEST-osx"/> 35 39 <property name="plugin.jar" location="${plugin.dist.dir}/${ant.project.name}.jar"/> 40 <property name="plugin.unixoid.jar" location="${plugin.dist.dir}/${ant.project.name}-unixoid.jar"/> 41 <property name="plugin.windows.jar" location="${plugin.dist.dir}/${ant.project.name}-windows.jar"/> 42 <property name="plugin.osx.jar" location="${plugin.dist.dir}/${ant.project.name}-osx.jar"/> 36 43 <property name="plugin.sources.jar" location="${plugin.dist.dir}/${ant.project.name}-sources.jar"/> 37 44 <property name="plugin.javadoc.jar" location="${plugin.dist.dir}/${ant.project.name}-javadoc.jar"/> … … 41 48 <property name="ivy.version" value="2.5.0-rc1"/> 42 49 43 <!-- For Windows-specific stuff -->44 <condition property="isWindows"> 45 Windows"/>46 </condition> 50 <!-- For platform-specific stuff --> 51 <condition property="isWindows"><os family="Windows"/></condition> 52 <condition property="isUnix"><os family="Unix"/></condition> 53 <condition property="isMac"><os family="Mac"/></condition> 47 54 <!-- For Java specific stuff by version --> 48 55 <condition property="isJava9"><matches string="${ant.java.version}" pattern="(1.)?(9|1[0-9])" /></condition> … … 75 82 <exclude name="**/*-sources.jar"/> 76 83 <exclude name="**/*-javadoc.jar"/> 84 <exclude name="**/*-unixoid.jar" unless="isUnix"/> 85 <exclude name="**/*-windows.jar" unless="isWindows"/> 86 <exclude name="**/*-osx.jar" unless="isMac"/> 77 87 </fileset> 78 88 <fileset refid="plugin.requires.jars"/> … … 150 160 <echo message="creating ${ant.project.name}.jar ... "/> 151 161 <antcall target="setup-dist" /> 152 <delete file="MANIFEST" failonerror="no"/> 153 <manifest file="MANIFEST" mode="update"> 162 <delete failonerror="no"> 163 <fileset dir="." includes="${manifest}*" /> 164 </delete> 165 <manifest file="${manifest}" mode="update"> 154 166 <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/> 155 167 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> … … 198 210 <jar destfile="${plugin.sources.jar}" basedir="${plugin.src.dir}" level="9"/> 199 211 <jar destfile="${plugin.javadoc.jar}" basedir="${plugin.doc.dir}" level="9"/> 200 <delete file="MANIFEST" failonerror="no"/> 212 <delete failonerror="no"> 213 <fileset dir="." includes="${manifest}*" /> 214 </delete> 201 215 <antcall target="post-dist" /> 202 216 </target> 203 217 <target name="build-jar"> 204 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest=" MANIFEST" manifestencoding="UTF-8" duplicate="preserve" level="9">218 <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}" manifest="${manifest}" manifestencoding="UTF-8" duplicate="preserve" level="9"> 205 219 <restrict> 206 220 <not><or> … … 225 239 </target> 226 240 <target name="add-manifest-attribute" depends="check-manifest-attribute" if="have-${property.name}"> 227 <manifest file=" MANIFEST" mode="update">241 <manifest file="${manifest}" mode="update"> 228 242 <attribute name="${manifest.attribute}" value="${property.value}" /> 229 243 </manifest> … … 549 563 <path refid="test.classpath"/> 550 564 </classpath> 551 552 565 <compilerarg value="-Xlint:all"/> 566 <compilerarg value="-Xlint:-serial"/> 553 567 </javac> 554 568 </sequential> … … 611 625 org/marvinproject/**/*.java, 612 626 org/netbeans/**/*.java, 613 614 615 616 627 org/openstreetmap/josm/plugins/dataimport/io/tcx/**/*.java, 628 org/openstreetmap/josm/plugins/ohe/parser/**/*.java, 629 org/openstreetmap/josm/plugins/pdfimport/pdfbox/operators/**/*.java 630 org/openstreetmap/josm/plugins/roadsigns/javacc/**/*.java, 617 631 org/osgeo/**/*.java, 618 632 "/> 619 633 <fileset dir="${basedir}/test" includes="**/*.java" erroronmissingdir="false"/> 620 634 <formatter type="xml" toFile="checkstyle-josm-${ant.project.name}.xml"/> … … 688 702 <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/> 689 703 </target> 690 691 692 693 694 695 696 697 698 699 700 701 702 704 <target name="clean_ivy"> 705 <delete failonerror="false"> 706 <fileset dir="${plugin.lib.dir}"> 707 <include name="**/*.jar"/> 708 <exclude name="**/*-custom.jar" /> 709 </fileset> 710 </delete> 711 </target> 712 <target name="fetch_dependencies" depends="clean_ivy, init-ivy"> 713 <echo>fetching dependencies with ivy</echo> 714 <ivy:settings file="ivy_settings.xml" /> 715 <ivy:retrieve pattern="${plugin.lib.dir}/[artifact]-[revision](-[classifier]).[ext]" conf="default" /> 716 </target> 703 717 </project> -
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.