aboutsummaryrefslogtreecommitdiff
path: root/textproc/fop/files/patch-build.xml
blob: 0b9c20f20c58231589cfb249030ac0d4ac43b92d (plain) (blame)
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
This patch reverts FOP-2895 to avoid dependency on maven.

--- fop/build.xml.orig	2020-05-05 09:42:05 UTC
+++ fop/build.xml
@@ -207,7 +207,7 @@ list of possible build targets.
   <property name="lib.dir" value="${basedir}/lib"/>
   <property name="user.hyph.dir" value="${basedir}/hyph"/>
   <property name="unidata.dir" value="${basedir}/UNIDATA"/>
-  <property name="hyph.stacksize" value="512k"/>
+  <property name="hyph.stacksize" value="1024k"/>
   <property name="test.dir" value="${basedir}/test"/>
   <property name="test.java.dir" value="${src.dir}/test/java"/>
   <property name="test.resources.dir" value="${src.dir}/test/resources"/>
@@ -347,7 +347,7 @@ list of possible build targets.
   <target name="compile-java" depends="init, codegen">
 <!-- create directories -->
     <mkdir dir="${build.classes.dir}"/>
-    <javac destdir="${build.classes.dir}" includeAntRuntime="true">
+    <javac destdir="${build.classes.dir}" includeAntRuntime="true" encoding="utf-8">
       <src path="${build.gensrc.dir}"/>
       <src path="${core.src.java.dir}"/>
       <src path="${events.src.java.dir}"/>
@@ -606,6 +606,59 @@ list of possible build targets.
       </lib>
     </war>
   </target>
+  <patternset id="transcoder-classes">
+<!-- General classes -->
+    <patternset>
+      <include name="org/apache/fop/Version.class"/>
+      <include name="org/apache/fop/accessibility/StructureTreeElement.class"/>
+      <include name="org/apache/fop/apps/Fop.class"/>
+      <include name="org/apache/fop/apps/FOPException.class"/>
+      <include name="org/apache/fop/apps/io/**"/>
+      <include name="org/apache/fop/area/AreaTreeControl*"/>
+      <include name="org/apache/fop/complexscripts/bidi/BidiClass.class"/>
+      <include name="org/apache/fop/complexscripts/bidi/BidiConstants.class"/>
+      <include name="org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.class"/>
+      <include name="org/apache/fop/complexscripts/fonts/*.class"/>
+      <include name="org/apache/fop/complexscripts/util/GlyphTester.class"/>
+      <include name="org/apache/fop/events/EventProducer.class"/>
+      <include name="org/apache/fop/fo/Constants.class"/>
+      <include name="org/apache/fop/fo/FOTreeBuilder.class"/>
+      <include name="org/apache/fop/image/loader/batik/BatikImageFlavors*.class"/>
+      <include name="org/apache/fop/svg/**"/>
+      <include name="org/apache/fop/fonts/**"/>
+      <include name="org/apache/fop/render/gradient/**"/>
+      <include name="org/apache/fop/traits/Direction.class"/>
+      <include name="org/apache/fop/traits/MinOptMax.class"/>
+      <include name="org/apache/fop/traits/TraitEnum.class"/>
+      <include name="org/apache/fop/util/CMYKColorSpace*.class"/>
+      <include name="org/apache/fop/util/Color*.class"/>
+      <include name="org/apache/fop/util/ASCII*.class"/>
+      <include name="org/apache/fop/util/*OutputStream.class"/>
+      <include name="org/apache/fop/util/SubInputStream.class"/>
+      <include name="org/apache/fop/util/Finalizable.class"/>
+      <include name="org/apache/fop/util/CharUtilities*.class"/>
+      <include name="org/apache/fop/util/DecimalFormatCache*.class"/>
+      <include name="org/apache/fop/util/ImageObject.class"/>
+      <include name="org/apache/fop/util/HexEncoder.class"/>
+      <include name="org/apache/fop/configuration/**"/>
+    </patternset>
+<!-- PDF transcoder -->
+    <patternset>
+      <include name="org/apache/fop/render/pdf/**"/>
+      <exclude name="org/apache/fop/render/pdf/PDFRenderer.class"/>
+      <exclude name="org/apache/fop/render/pdf/PDFXMLHandler*"/>
+      <include name="org/apache/fop/render/intermediate/IFDocumentHandlerConfigurator.class"/>
+      <include name="org/apache/fop/render/**Config**"/>
+      <include name="org/apache/fop/util/AbstractPaintingState**"/>
+      <include name="org/apache/fop/pdf/**"/>
+    </patternset>
+<!-- PS transcoder -->
+    <patternset>
+      <include name="org/apache/fop/render/ps/**"/>
+      <exclude name="org/apache/fop/render/pdf/PSRenderer.class"/>
+      <exclude name="org/apache/fop/render/pdf/PSXMLHandler*"/>
+    </patternset>
+  </patternset>
   <fileset dir="${build.classes.dir}" id="transcoder-classes-files">
     <patternset refid="transcoder-classes"/>
   </fileset>
@@ -614,15 +667,60 @@ list of possible build targets.
     <include name="commons-logging*.jar"/>
     <include name="xmlgraphics-commons*.jar"/>
   </fileset>
-  <target name="transcoder-pkg" depends="remove-cache" description="Generates the jar for the transcoder package for Batik">
-    <exec executable="mvn" dir="${basedir}/.." failonerror="true">
-      <env key="MAVEN_OPTS" value="-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2"/>
-      <arg value="clean"/>
-      <arg value="install"/>
-      <arg value="-DskipTests"/>
-    </exec>
-    <copy file="${basedir}/../fop-transcoder/target/fop-transcoder-${version}.jar" tofile="${build.dir}/fop-transcoder.jar"/>
-    <copy file="${basedir}/../fop-transcoder-allinone/target/fop-transcoder-allinone-${version}.jar" tofile="${build.dir}/fop-transcoder-allinone.jar"/>
+  <target name="uptodate-transcoder-pkg" depends="compile">
+    <uptodate property="transcoder.pkg.uptodate" targetfile="${build.dir}/fop-transcoder.jar">
+      <srcfiles refid="transcoder-classes-files"/>
+      <srcfiles refid="transcoder-lib-files"/>
+    </uptodate>
+  </target>
+  <target name="transcoder-pkg" depends="remove-cache, uptodate-transcoder-pkg, compile" description="Generates the jar for the transcoder package for Batik" unless="transcoder.pkg.uptodate">
+    <echo message="Creating the jar file ${build.dir}/fop-transcoder.jar"/>
+    <property name="fop-transcoder.name" value="FOP Transcoder Package"/>
+    <property name="fop-transcoder.version" value="${version}"/>
+    <tstamp>
+      <format property="ts" pattern="yyyyMMdd-HHmmss-z"/>
+    </tstamp>
+<!-- lean transcoder jar -->
+    <jar jarfile="${build.dir}/fop-transcoder.jar">
+      <fileset refid="transcoder-classes-files"/>
+      <manifest>
+        <attribute name="Implementation-Title" value="${fop-transcoder.name}"/>
+        <attribute name="Implementation-Version" value="${fop-transcoder.version}"/>
+        <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
+        <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}, Target Java ${javac.target}])"/>
+      </manifest>
+      <metainf dir="${basedir}/.." includes="LICENSE,NOTICE"/>
+    </jar>
+<!-- all-in-one transcoder jar -->
+    <property name="transcoder-deps" value="${build.dir}/transcoder-dependencies"/>
+    <mkdir dir="${transcoder-deps}"/>
+    <unjar dest="${transcoder-deps}">
+      <patternset>
+        <include name="org/apache/commons/logging/**"/>
+        <include name="org/apache/commons/io/*.class"/>
+        <include name="org/apache/commons/io/filefilter/*.class"/>
+        <include name="org/apache/commons/io/output/*.class"/>
+      </patternset>
+      <fileset refid="transcoder-lib-files"/>
+    </unjar>
+    <mkdir dir="${transcoder-deps}/legal"/>
+    <copy todir="${transcoder-deps}/legal">
+      <fileset dir="${lib.dir}">
+        <include name="commons-io.LICENSE.txt"/>
+        <include name="commons-logging.LICENSE.txt"/>
+      </fileset>
+    </copy>
+    <jar jarfile="${build.dir}/fop-transcoder-allinone.jar">
+      <fileset refid="transcoder-classes-files"/>
+      <fileset dir="${transcoder-deps}"/>
+      <manifest>
+        <attribute name="Implementation-Title" value="${fop-transcoder.name}"/>
+        <attribute name="Implementation-Version" value="${fop-transcoder.version}"/>
+        <attribute name="Implementation-Vendor" value="The Apache Software Foundation (http://xmlgraphics.apache.org/fop/)"/>
+        <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}, Target Java ${javac.target}])"/>
+      </manifest>
+      <metainf dir="${basedir}/.." includes="LICENSE,NOTICE"/>
+    </jar>
   </target>
   <target name="all" depends="package, servlet, transcoder-pkg, junit"/>
 <!-- "all" target for us Makefile converts ;-) -->