aboutsummaryrefslogtreecommitdiffstats
path: root/fop/releasedist.xml
blob: be214d2c67d46baf567400276039f95288fdd8c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<project basedir="." name="fop">

  <property name="name" value="fop"/>
  <property name="version" value="2.10.0-SNAPSHOT"/>
  <property name="dist.bin.dir" value="${basedir}/dist-bin"/>
  <property name="dist.src.dir" value="${basedir}/dist-src"/>
  <property name="dist.bin.result.dir" value="${dist.bin.dir}/${name}-${version}"/>
  <property name="dist.src.result.dir" value="${dist.src.dir}/${name}-${version}"/>
  
  <property name="build.dir" value="${basedir}/build"/>
  <property name="build.javadocs.dir" value="${basedir}/../fop-core/target/site/apidocs"/>

  <fileset dir="${basedir}/.." id="dist.bin">
    <include name="KEYS"/>
    <include name="LICENSE"/>
    <include name="NOTICE"/>
    <include name="README"/>
    <include name="fop/conf/**"/>
    <include name="fop/examples/**"/>
    <include name="fop/fop"/>
    <include name="fop/fop.bat"/>
    <include name="fop/fop.cmd"/>
    <include name="fop/fop.js"/>
    <include name="fop/status.xml"/>
  </fileset>
  <fileset dir="${basedir}/.." id="dist.bin.lib">
    <patternset id="dist.lib">
      <include name="fop/lib/README*"/>
      <include name="fop/lib/batik*.txt"/>
      <include name="fop/lib/commons-io*.txt"/>
      <include name="fop/lib/commons-logging*.txt"/>
      <include name="fop/lib/xml-apis*.txt"/>
      <include name="fop/lib/xml-apis*.html"/>
      <include name="fop/lib/xmlgraphics-commons*.txt"/>
    </patternset>
  </fileset>
  <fileset id="dist.lib2" dir="${basedir}/..">
    <include name="fop/target/dependency/batik*"/>
    <include name="fop/target/dependency/commons-io*"/>
    <include name="fop/target/dependency/commons-logging*"/>
    <include name="fop/target/dependency/fontbox*"/>
    <include name="fop/target/dependency/serializer*"/>
    <include name="fop/target/dependency/xalan*"/>
    <include name="fop/target/dependency/xerces*"/>
    <include name="fop/target/dependency/xml-apis*"/>
    <include name="fop/target/dependency/xmlgraphics-commons*"/>
  </fileset>
  <patternset id="dist.src.lib.build">
    <include name="fop/lib/build/*.txt"/>
    <exclude name="fop/lib/build/asm*"/>
    <exclude name="fop/lib/build/jaxen*"/>
    <exclude name="fop/lib/build/pmd*"/>
  </patternset>
  <fileset id="dist.src.lib.build2" dir="${basedir}/..">
    <include name="fop*/target/dependency/hamcrest*"/>
    <include name="fop*/target/dependency/mockito*"/>
    <include name="fop*/target/dependency/objenesis*"/>
    <include name="fop*/target/dependency/qdox*"/>
    <include name="fop*/target/dependency/xmlunit*"/>
  </fileset>  
  <fileset dir="${basedir}/.." id="dist.src">
    <include name="KEYS"/>
    <include name="LICENSE"/>
    <include name="NOTICE"/>
    <include name="README"/>
    <include name="fop/build.*"/>
    <include name="fop/checkstyle*"/>
    <exclude name="fop/checkstyle-noframes.xsl"/>
    <include name="fop/conf/**"/>
    <include name="fop/examples/**"/>
    <include name="fop/findbugs*"/>
    <include name="fop/fop"/>
    <include name="fop/fop.bat"/>
    <include name="fop/fop.cmd"/>
    <include name="fop/fop.js"/>
    <include name="fop/forrest.*"/>
    <include name="fop/hyph/hyphenation.dtd"/>
    <include name="fop/hyph/readme"/>
    <include name="fop/jacoco*"/>
    <include name="fop/known-issues.xml"/>
    <include name="fop/lib/servlet*"/>
    <include name="fop/status.xml"/>
    <include name="fop*/pom.xml"/>
    <include name="pom.xml"/>
    <include name="*/src/**"/>
    <include name="fop/test/**"/>
    <patternset refid="dist.lib"/>
    <patternset refid="dist.src.lib.build"/>
  </fileset>  
  
  <target name="release-dist" depends="dist" description="Generates the distribution package and signs the release">
    <property name="bin.suffix" value="bin"/>
    <input message="Passphrase for your default private key" addproperty="pwd">
        <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
    </input>
    <antcall target="sha512">
      <param name="sign.archive" value="${name}-${version}-src.zip"/>
    </antcall>
    <antcall target="sign-file">
      <param name="sign.archive" value="${name}-${version}-src.zip"/>
      <param name="pwd" value="${pwd}"/>
    </antcall>
    <antcall target="sha512">
      <param name="sign.archive" value="${name}-${version}-src.tar.gz"/>
    </antcall>
    <antcall target="sign-file">
      <param name="sign.archive" value="${name}-${version}-src.tar.gz"/>
      <param name="pwd" value="${pwd}"/>
    </antcall>
    <antcall target="sha512">
      <param name="sign.archive" value="${name}-${version}-${bin.suffix}.zip"/>
    </antcall>
    <antcall target="sign-file">
      <param name="sign.archive" value="${name}-${version}-${bin.suffix}.zip"/>
      <param name="pwd" value="${pwd}"/>
    </antcall>
    <antcall target="sha512">
      <param name="sign.archive" value="${name}-${version}-${bin.suffix}.tar.gz"/>
    </antcall>
    <antcall target="sign-file">
      <param name="sign.archive" value="${name}-${version}-${bin.suffix}.tar.gz"/>
      <param name="pwd" value="${pwd}"/>
    </antcall>
  </target>
  
  <target name="sha512">
    <property name="sha512.exec" value="sha512sum"/>
    <property name="sha512.options" value=""/>
    <exec executable="${sha512.exec}" output="${sign.archive}.sha512">
      <arg line="${sha512.options} ${sign.archive}"/>
    </exec>
  </target>
  
  <target name="sign-file">
    <property name="gpg.exec" value="gpg"/>
    <property name="gpg.options" value="--armor --detach-sign --force-v3-sigs --batch --verbose --passphrase-fd 0"/>
    <delete file="${sign.archive}.asc"/>
    <exec executable="${gpg.exec}" inputstring="${pwd}">
      <arg line="${gpg.options} ${sign.archive}"/>
    </exec>
  </target>  
  
  <target name="dist" depends="mvn-build,dist-src,dist-bin" description="Generates the distribution package"/>
  
  <target name="dist-bin">
    <echo message="Building the binary distribution files (zip,tar)"/>
    <mkdir dir="${dist.bin.result.dir}"/>
    <copy todir="${dist.bin.result.dir}/fop/lib" flatten="true">
      <fileset refid="dist.lib2"/>
    </copy>
    <copy todir="${dist.bin.result.dir}">
      <fileset refid="dist.bin"/>
      <fileset refid="dist.bin.lib"/>
    </copy>
    <copy todir="${dist.bin.result.dir}/javadocs">
      <fileset dir="${build.javadocs.dir}"/>
    </copy>
    <mkdir dir="${dist.bin.result.dir}/fop/build"/>
    <copy todir="${dist.bin.result.dir}/fop/build" flatten="true">
      <fileset dir="target">
        <include name="fop-*${version}.jar"/>
      </fileset>
    </copy>
    <chmod file="${dist.bin.result.dir}/fop/fop" perm="ugo+rx"/>
    <zip zipfile="${name}-${version}-bin.zip" basedir="${dist.bin.dir}" includes="**"/>
    <tar longfile="gnu" destfile="${name}-${version}-bin.tar">
      <tarfileset dir="${dist.bin.dir}" filemode="755">
        <include name="${name}-${version}/fop/fop"/>
      </tarfileset>
      <tarfileset dir="${dist.bin.dir}">
        <include name="**"/>
        <exclude name="${name}-${version}/fop/fop"/>
      </tarfileset>
    </tar>
    <gzip zipfile="${name}-${version}-bin.tar.gz" src="${name}-${version}-bin.tar"/>
    <delete file="${name}-${version}-bin.tar"/>
  </target>  
  
  <target name="dist-src">
    <echo message="Building the source distribution files (zip,tar)"/>
    <mkdir dir="${dist.src.result.dir}"/>
    <copy todir="${dist.src.result.dir}/fop/lib" flatten="true">
      <fileset refid="dist.lib2"/>
    </copy>
    <copy todir="${dist.src.result.dir}/fop/lib/build" flatten="true">
      <fileset refid="dist.src.lib.build2"/>
    </copy>
    <copy todir="${dist.src.result.dir}">
      <fileset refid="dist.src"/>
    </copy>
    <chmod file="${dist.src.result.dir}/fop/fop" perm="ugo+rx"/>
    <zip zipfile="${name}-${version}-src.zip" basedir="${dist.src.dir}" includes="**"/>
    <tar longfile="gnu" destfile="${name}-${version}-src.tar">
      <tarfileset dir="${dist.src.dir}" filemode="755">
        <include name="${name}-${version}/fop/fop"/>
      </tarfileset>
      <tarfileset dir="${dist.src.dir}">
        <include name="**"/>
        <exclude name="${name}-${version}/fop/fop"/>
      </tarfileset>
    </tar>
    <gzip zipfile="${name}-${version}-src.tar.gz" src="${name}-${version}-src.tar"/>
    <delete file="${name}-${version}-src.tar"/>
  </target>
  
  <target name="mvn-build">
    <exec executable="mvn" dir="${basedir}/.." failonerror="true">
      <arg value="clean"/>
      <arg value="install"/>
      <arg value="javadoc:javadoc"/>
      <arg value="dependency:copy-dependencies"/>
      <arg value="-DskipTests"/>
    </exec>
  </target>  
  
</project>