[35926] | 1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
| 2 | <!--
|
---|
| 3 | ** Usage
|
---|
| 4 | ** =====
|
---|
| 5 | ** Call "ant help" to get possible build targets.
|
---|
| 6 | **
|
---|
| 7 | -->
|
---|
| 8 | <project xmlns:if="ant:if" xmlns:unless="ant:unless" name="lwjgl" default="dist" basedir=".">
|
---|
| 9 | <!-- enter the SVN commit message -->
|
---|
| 10 | <property name="commit.message" value="Commit message"/>
|
---|
| 11 | <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
|
---|
| 12 | <property name="plugin.main.version" value="10580"/>
|
---|
| 13 | <property name="plugin.author" value="Taylor Smock"/>
|
---|
| 14 | <property name="plugin.class" value="org.openstreetmap.josm.plugins.lwjgl.LWJGLPlugin"/>
|
---|
| 15 | <property name="plugin.description" value="Provides the common LWJGL interfaces for other plugins"/>
|
---|
| 16 | <property name="plugin.canloadatruntime" value="true"/>
|
---|
| 17 | <property name="plugin.requires" value="lwjgl-natives"/>
|
---|
| 18 | <!--<property name="plugin.icon" value="..."/>-->
|
---|
| 19 | <!--<property name="plugin.link" value="..."/>-->
|
---|
| 20 |
|
---|
| 21 | <property name="skip-javadoc" value="true"/>
|
---|
| 22 |
|
---|
| 23 | <property name="plugin.jar" location="${plugin.dist.dir}/${ant.project.name}-windows.jar" if:set="isWindows"/>
|
---|
| 24 | <property name="plugin.jar" location="${plugin.dist.dir}/${ant.project.name}-osx.jar" if:set="isMac"/>
|
---|
| 25 | <property name="plugin.jar" location="${plugin.dist.dir}/${ant.project.name}-unixoid.jar" if:set="isUnix"/>
|
---|
| 26 | <!-- ** include targets that all plugins have in common ** -->
|
---|
| 27 | <property name="plugin.test.dir" location="src/test/java"/>
|
---|
| 28 | <property name="plugin.src.dir" location="src/main/java"/>
|
---|
| 29 | <property name="plugin.resources.dir" location="src/main/resources"/>
|
---|
| 30 | <import file="../build-common.xml"/>
|
---|
| 31 | <!-- include fetch_dependencies task -->
|
---|
| 32 | <target name="pre-compile" depends="fetch_dependencies"/>
|
---|
| 33 | <!-- Exists to avoid ant failure -->
|
---|
| 34 | <target name="pre-javadoc">
|
---|
| 35 | <mkdir dir="${plugin.doc.dir}"/>
|
---|
| 36 | </target>
|
---|
| 37 |
|
---|
| 38 | <macrodef name="build-native-manifest">
|
---|
| 39 | <attribute name="manifest"/>
|
---|
| 40 | <attribute name="platform"/>
|
---|
| 41 | <sequential>
|
---|
| 42 | <copy file="MANIFEST" tofile="@{manifest}"/>
|
---|
| 43 | <manifest file="@{manifest}" mode="update">
|
---|
| 44 | <attribute name="Plugin-Platform" value="@{platform}"/>
|
---|
| 45 | <attribute name="Plugin-Provides" value="lwjgl-natives"/>
|
---|
| 46 | <attribute name="Plugin-Description" value="Provides LWJGL natives for @{platform}"/>
|
---|
| 47 | <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.lwjgl.LWJGLNativesPlugin"/>
|
---|
| 48 | <attribute name="Plugin-Requires" value=""/>
|
---|
| 49 | </manifest>
|
---|
| 50 | </sequential>
|
---|
| 51 | </macrodef>
|
---|
| 52 |
|
---|
| 53 | <target name="additional-manifest">
|
---|
| 54 | <build-native-manifest platform="Windows" manifest="${manifest.windows}"/>
|
---|
| 55 | <build-native-manifest platform="Unixoid" manifest="${manifest.unixoid}"/>
|
---|
| 56 | <build-native-manifest platform="Osx" manifest="${manifest.osx}"/>
|
---|
| 57 | </target>
|
---|
| 58 |
|
---|
| 59 | <macrodef name="build-native-jar">
|
---|
| 60 | <attribute name="jar"/>
|
---|
| 61 | <attribute name="manifest"/>
|
---|
| 62 | <attribute name="qualifier"/>
|
---|
| 63 | <sequential>
|
---|
| 64 | <echo>Building @{qualifier} jar...</echo>
|
---|
| 65 | <local name="unix"/>
|
---|
| 66 | <local name="mac"/>
|
---|
| 67 | <local name="windows"/>
|
---|
| 68 | <condition property="unix"><equals arg1="@{qualifier}" arg2="linux"/></condition>
|
---|
| 69 | <condition property="mac"><equals arg1="@{qualifier}" arg2="mac"/></condition>
|
---|
| 70 | <condition property="windows"><equals arg1="@{qualifier}" arg2="win"/></condition>
|
---|
| 71 | <jar destfile="@{jar}" manifest="@{manifest}" manifestencoding="UTF-8" level="9" index="true">
|
---|
| 72 | <fileset dir="${plugin.build.dir}">
|
---|
| 73 | <include name="**/*Natives*.class"/>
|
---|
| 74 | </fileset>
|
---|
| 75 | <restrict>
|
---|
| 76 | <not><or>
|
---|
| 77 | <name name="META-INF/maven/*"/>
|
---|
| 78 | <name name="META-INF/DEPENDENCIES"/>
|
---|
| 79 | <name name="META-INF/*.RSA"/>
|
---|
| 80 | <name name="META-INF/*.SF"/>
|
---|
| 81 | <name name="META-INF/INDEX.LIST"/>
|
---|
| 82 | <name name="META-INF/versions/9/module-info.class"/>
|
---|
| 83 | <name name="module-info.class"/>
|
---|
| 84 | </or></not>
|
---|
| 85 | <archives>
|
---|
| 86 | <zips>
|
---|
| 87 | <fileset dir="${plugin.lib.dir}" includes="*-natives-linux*.jar" excludes="*-sources.jar, *-javadoc.jar,*-natives-mac*.jar, *-natives-windows*.jar" erroronmissingdir="no" if:set="unix"/>
|
---|
| 88 | <fileset dir="${plugin.lib.dir}" includes="*-natives-mac*.jar" excludes="*-sources.jar, *-javadoc.jar, *-natives-linux*.jar, *-natives-windows*.jar" erroronmissingdir="no" if:set="mac"/>
|
---|
| 89 | <fileset dir="${plugin.lib.dir}" includes="*-natives-windows*.jar" excludes="*-sources.jar, *-javadoc.jar, *-natives-linux*.jar, *-natives-mac*.jar" erroronmissingdir="no" if:set="windows"/>
|
---|
| 90 | </zips>
|
---|
| 91 | </archives>
|
---|
| 92 | </restrict>
|
---|
| 93 | </jar>
|
---|
| 94 | <delete dir="${plugin.lib.dir}/@{qualifier}" failonerror="false"/>
|
---|
| 95 | </sequential>
|
---|
| 96 | </macrodef>
|
---|
| 97 |
|
---|
| 98 | <macrodef name="build-common-jar">
|
---|
| 99 | <attribute name="qualifier" default="common"/>
|
---|
| 100 | <attribute name="manifest" default="${manifest}"/>
|
---|
| 101 | <attribute name="jar" default="${plugin.jar}"/>
|
---|
| 102 | <sequential>
|
---|
| 103 | <echo>Building lwjgl @{qualifier} jar...</echo>
|
---|
| 104 | <jar destfile="@{jar}" manifest="@{manifest}" manifestencoding="UTF-8" level="9" index="true">
|
---|
| 105 | <fileset dir="${plugin.build.dir}">
|
---|
| 106 | <exclude name="**/*Natives*"/>
|
---|
| 107 | </fileset>
|
---|
| 108 | <restrict>
|
---|
| 109 | <not><or>
|
---|
| 110 | <name name="META-INF/maven/*"/>
|
---|
| 111 | <name name="META-INF/DEPENDENCIES"/>
|
---|
| 112 | <name name="META-INF/*.RSA"/>
|
---|
| 113 | <name name="META-INF/*.SF"/>
|
---|
| 114 | <name name="META-INF/INDEX.LIST"/>
|
---|
| 115 | <name name="META-INF/versions/9/module-info.class"/>
|
---|
| 116 | <name name="module-info.class"/>
|
---|
| 117 | </or></not>
|
---|
| 118 | <archives>
|
---|
| 119 | <zips>
|
---|
| 120 | <fileset dir="${plugin.lib.dir}" includes="*.jar" excludes="*-sources.jar, *-javadoc.jar, *-natives*.jar" erroronmissingdir="no"/>
|
---|
| 121 | </zips>
|
---|
| 122 | </archives>
|
---|
| 123 | </restrict>
|
---|
| 124 | </jar>
|
---|
| 125 | <delete dir="${plugin.lib.dir}/@{qualifier}" failonerror="false"/>
|
---|
| 126 | </sequential>
|
---|
| 127 | </macrodef>
|
---|
| 128 |
|
---|
| 129 | <target name="build-jar">
|
---|
| 130 | <build-common-jar/>
|
---|
| 131 | <build-native-jar jar="${plugin.unixoid.jar}" manifest="${manifest.unixoid}" qualifier="linux"/>
|
---|
| 132 | <build-native-jar jar="${plugin.windows.jar}" manifest="${manifest.windows}" qualifier="win"/>
|
---|
| 133 | <build-native-jar jar="${plugin.osx.jar}" manifest="${manifest.osx}" qualifier="mac"/>
|
---|
| 134 | </target>
|
---|
| 135 | </project>
|
---|