1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <project name="geotools" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant" xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">
|
---|
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="19044"/>
|
---|
7 |
|
---|
8 | <property name="plugin.author" value="Don-vip"/>
|
---|
9 | <property name="plugin.class" value="org.openstreetmap.josm.plugins.geotools.GeoToolsPlugin"/>
|
---|
10 | <property name="plugin.description" value="Provides parts of the GeoTools library for other JOSM plugins. Not meant to be installed directly by users, but rather as a dependency for other plugins."/>
|
---|
11 | <property name="plugin.icon" value="images/compass.png"/>
|
---|
12 | <property name="plugin.canloadatruntime" value="true"/>
|
---|
13 | <property name="plugin.requires" value="apache-commons;ejml;jackson;jaxb;jts"/>
|
---|
14 | <property name="plugin.stage" value="20"/>
|
---|
15 |
|
---|
16 | <!-- ** include targets that all plugins have in common ** -->
|
---|
17 | <import file="../build-common.xml"/>
|
---|
18 |
|
---|
19 | <target name="pre-compile" depends="fetch_dependencies">
|
---|
20 | <!-- include fetch_dependencies task -->
|
---|
21 | </target>
|
---|
22 |
|
---|
23 | <fileset id="plugin.requires.jars" dir="${plugin.dist.dir}">
|
---|
24 | <include name="apache-commons.jar"/>
|
---|
25 | <include name="ejml.jar"/>
|
---|
26 | <include name="jaxb.jar"/>
|
---|
27 | <include name="jts.jar"/>
|
---|
28 | <!-- jackson causes issues if it is on the compile-time path. Since we don't actually use jackson in our code, we can just not have it in the requires.jars array. -->
|
---|
29 | <!--<include name="jackson.jar"/>-->
|
---|
30 | </fileset>
|
---|
31 | <macrodef name="merge-text-files">
|
---|
32 | <attribute name="mergefile"/>
|
---|
33 | <attribute name="targetdir"/>
|
---|
34 | <sequential>
|
---|
35 | <concat destfile="@{targetdir}/@{mergefile}">
|
---|
36 | <restrict>
|
---|
37 | <rsel:name name="@{mergefile}"/>
|
---|
38 | <archives>
|
---|
39 | <zips>
|
---|
40 | <fileset dir="${plugin.lib.dir}" includes="*.jar" excludes="*-sources.jar, *-javadoc.jar" erroronmissingdir="no"/>
|
---|
41 | </zips>
|
---|
42 | </archives>
|
---|
43 | </restrict>
|
---|
44 | </concat>
|
---|
45 | </sequential>
|
---|
46 | </macrodef>
|
---|
47 |
|
---|
48 | <target name="merge-geotools-services" depends="fetch_dependencies">
|
---|
49 | <taskdef resource="org/pescuma/mergeservices/antlib.xml" classpath="tools/merge-services.jar" />
|
---|
50 | <delete dir="jar/"/>
|
---|
51 | <mkdir dir="jar"/>
|
---|
52 | <merge-services dest="jar">
|
---|
53 | <fileset dir="lib">
|
---|
54 | <include name="**/*.jar" />
|
---|
55 | <exclude name="**/*-javadoc.jar" />
|
---|
56 | <exclude name="**/*-source.jar" />
|
---|
57 | </fileset>
|
---|
58 | </merge-services>
|
---|
59 | <!-- We currently don't like shipping maven pom files or other "useless" files (see #21667) -->
|
---|
60 | <delete includeEmptyDirs="true">
|
---|
61 | <fileset dir="jar">
|
---|
62 | <include name="META-INF/maven/**/*"/>
|
---|
63 | <include name="META-INF/maven"/>
|
---|
64 | <include name="META-INF/ECLIPSE*"/>
|
---|
65 | <include name="META-INF/eclipse*"/>
|
---|
66 | <include name="META-INF/INDEX.LIST"/>
|
---|
67 | <include name="META-INF/MANIFEST.MF"/>
|
---|
68 | <include name="META-INF/**/module-info.class"/>
|
---|
69 | </fileset>
|
---|
70 | </delete>
|
---|
71 |
|
---|
72 | <merge-text-files mergefile="META-INF/javax.media.jai.registryFile.jai" targetdir="jar"/>
|
---|
73 | <merge-text-files mergefile="META-INF/registryFile.jai" targetdir="jar"/>
|
---|
74 | <merge-text-files mergefile="META-INF/registryFile.jaiext" targetdir="jar"/>
|
---|
75 | </target>
|
---|
76 |
|
---|
77 | <!--
|
---|
78 | **********************************************************
|
---|
79 | ** post-dist - replaces files from the generated jar
|
---|
80 | **********************************************************
|
---|
81 | -->
|
---|
82 | <target name="post-dist" depends="merge-geotools-services">
|
---|
83 | <move file="${plugin.jar}" todir="${plugin.build.dir}" />
|
---|
84 | <jar destfile="${plugin.jar}" filesetmanifest="merge" manifestencoding="UTF-8">
|
---|
85 | <fileset dir="jar"/>
|
---|
86 | <zipfileset src="${plugin.build.dir}/${ant.project.name}.jar">
|
---|
87 | <exclude name="*.class"/>
|
---|
88 | <exclude name="*.html"/>
|
---|
89 | <exclude name="META-INF/**/*"/>
|
---|
90 | <exclude name="javax/*.txt"/>
|
---|
91 | </zipfileset>
|
---|
92 | <zipfileset src="${plugin.build.dir}/${ant.project.name}.jar">
|
---|
93 | <include name="META-INF/MANIFEST.MF"/>
|
---|
94 | <include name="META-INF/javax.media.jai.registryFile.jai"/>
|
---|
95 | </zipfileset>
|
---|
96 | </jar>
|
---|
97 | <delete file="${plugin.build.dir}/${ant.project.name}.jar" />
|
---|
98 | <delete dir="jar" />
|
---|
99 | </target>
|
---|
100 |
|
---|
101 | <!--
|
---|
102 | **********************************************************
|
---|
103 | ** additional-manifest - add additional manifest entries
|
---|
104 | **********************************************************
|
---|
105 | -->
|
---|
106 | <target name="additional-manifest">
|
---|
107 | <manifest file="MANIFEST" mode="update">
|
---|
108 | <!-- JAI requires a vendor name for some of its deep internals,
|
---|
109 | see https://stackoverflow.com/a/18495658/2257172 -->
|
---|
110 | <attribute name="Specification-Title" value="JOSM GeoTools plugin"/>
|
---|
111 | <attribute name="Specification-Version" value="${gt.version}"/>
|
---|
112 | <attribute name="Specification-Vendor" value="JOSM developers" />
|
---|
113 | <attribute name="Implementation-Title" value="org.openstreetmap.josm.plugins.geotools" />
|
---|
114 | <attribute name="Implementation-Version" value="${gt.version}" />
|
---|
115 | <attribute name="Implementation-Vendor" value="JOSM developers"/>
|
---|
116 | </manifest>
|
---|
117 | </target>
|
---|
118 | </project>
|
---|