File: build.xml

package info (click to toggle)
pauker 1.8+dfsg-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 96,040 kB
  • ctags: 2,878
  • sloc: java: 16,017; xml: 2,034; haskell: 136; makefile: 15; sh: 2
file content (262 lines) | stat: -rw-r--r-- 12,964 bytes parent folder | download
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="Pauker" default="default" basedir=".">
    <description>Builds, tests, and runs the project Pauker.</description>
    <import file="nbproject/build-impl.xml"/>
    <import file="nbproject/profiler-build-impl.xml"/>
    
    <!-- load the strings properties to get access to the Pauker version -->
    <target name="-load-properties">
        <property file="src/pauker/Strings.properties"/>
        <property name="dist.dir.resolved" location="${dist.dir}"/>
        <property name="dist.jar.resolved" location="${dist.dir}/pauker-${Pauker_Version}.jar"/>
    </target>

    <!-- creates the Pauker.exe via JSmooth running on wine -->
    <target name="exe" depends="create-jar">
        <property name="jsmooth_file" 
        value="/home/ronny/.wine/drive_c/windows/profiles/ronny/Eigene Dateien/persoenliches/Programme/Pauker/project/pauker.jsmooth"/>
        <!-- set correct version number -->
        <replaceregexp
            file="${jsmooth_file}"
            match="&lt;jarLocation&gt;.*&lt;/jarLocation&gt;"
            replace="&lt;jarLocation&gt;${dist.dir}/pauker-${Pauker_Version}.jar&lt;/jarLocation&gt;"
        />
        <!-- run jsmoothgen -->
        <exec executable="wine">
            <arg value="/home/ronny/.wine/drive_c/Programme/JSmooth 0.9.9-7/jsmoothcmd.exe"/>
            <arg value="${jsmooth_file}"/>
        </exec>
        <move file="pauker.exe" tofile="${dist.dir}/pauker-${Pauker_Version}.exe"/>
    </target>
    
    <!-- copies the jar file for the Java Web Start Testversion to the right place -->
    <target name="2_deploy_webstart">
        <exec executable="scp" dir="dist">
            <arg line="pauker_testing.jar ronnystandtke,pauker@web.sourceforge.net:/home/groups/p/pa/pauker/htdocs/webstart"/>
        </exec>
    </target>
    
    <!-- copies the credits files to the right place -->
    <target name="3_new_credits">
        <exec executable="scp" dir="/home/ronny/persoenliches/Programme/Pauker/paukerweb/web/packets/de">
            <arg line="credits.html ronnystandtke,pauker@web.sourceforge.net:/home/groups/p/pa/pauker/packets/de"/>
        </exec>
        <exec executable="scp" dir="/home/ronny/persoenliches/Programme/Pauker/paukerweb/web/packets/en">
            <arg line="credits.html ronnystandtke,pauker@web.sourceforge.net:/home/groups/p/pa/pauker/packets/en"/>
        </exec>
    </target>
    
    <!-- copies the lesson files to the right place -->
    <target name="4_new_lessons">
        <exec executable="scp" dir="/home/ronny/persoenliches/Programme/Pauker/paukerweb/web/packets/de">
            <arg line="lessons.html ronnystandtke,pauker@web.sourceforge.net:/home/groups/p/pa/pauker/packets/de"/>
        </exec>
        <exec executable="scp" dir="/home/ronny/persoenliches/Programme/Pauker/paukerweb/web/packets/en">
            <arg line="lessons.html ronnystandtke,pauker@web.sourceforge.net:/home/groups/p/pa/pauker/packets/en"/>
        </exec>
    </target>

    <!-- copies the documentation PDF files to the right place -->
    <target name="5_copy_pdfs">
        <exec executable="scp" dir="/home/ronny/persoenliches/Programme/Pauker/project">
            <arg line="Pauker_de.pdf ronnystandtke,pauker@web.sourceforge.net:/home/groups/p/pa/pauker/htdocs/de"/>
        </exec>
        <exec executable="scp" dir="/home/ronny/persoenliches/Programme/Pauker/project">
            <arg line="Pauker_en.pdf ronnystandtke,pauker@web.sourceforge.net:/home/groups/p/pa/pauker/htdocs/en"/>
        </exec>
    </target>
    <target name="8_upload_release" depends="init,-load-properties">
        <exec executable="scp" dir="${dist.dir.resolved}">
            <arg line="
                pauker-${Pauker_Version}.jar
                pauker-${Pauker_Version}.exe
                pauker-${Pauker_Version}.src.jar
                ronnystandtke@frs.sourceforge.net:/incoming/r/ro/ronnystandtke/uploads"/>
        </exec>
    </target>
    
    <!-- Our own Jar Building Target -->
    <target name="jar" depends="create-jar"/>
    <target name="7_new_release" depends="create-source-jar,exe"/>
    
    <!-- create standard jar file for binary distribution -->
    <target name="create-jar" depends="init,compile,-pre-pre-jar,-load-properties">
        <jar destfile="${dist.jar.resolved}"
             basedir="build/classes/"
             includes="pauker/**,tools/**"
             excludes="pauker/Changes.txt,pauker/TODO.txt,**/*BeanInfo*,**/GraphicalStatisticPanel.gif">
            <manifest>
                <attribute name="Main-Class" value="pauker.program.gui.swing.PaukerFrame"/>
                <attribute name="SplashScreen-Image" value="pauker/icons/Splash.png"/>
            </manifest>
        </jar>
        
        <!-- sign binary jar -->
        <available file="myKeystore" property="myKeystore.available"/>
        <antcall target="sign-jar"/>
        
        <!-- always create a jar file for the Java Web Start Testversion -->
        <copy file="${dist.jar.resolved}" tofile="${dist.dir}/pauker_testing.jar"/>
        <echo>To run this application from the command line without Ant, try:</echo>
        <echo>java -jar "${dist.jar.resolved}"</echo>
    </target>
    <target name="sign-jar" if="myKeystore.available">
        <signjar jar="${dist.jar.resolved}"
        keystore="myKeystore" alias="myself" storepass="passwd"/>
    </target>
    
    <!-- create jar with source code -->
    <target name="create-source-jar" depends="init,-pre-pre-jar,-load-properties">
        <jar destfile="${dist.dir}/pauker-${Pauker_Version}.src.jar"
             basedir=""
             includes="doc/**,libs/**,nbproject/**,src/**,test/**,Splash.xcf,build.xml,Übersetzer.txt"/>
    </target>
    <target name="1_create-docs" depends="-load-properties">
        <!-- update common images -->
        <!-- hint: do NOT delete the complete directory, this will break CVS -->
        <echo>Updating images common to all translations...</echo>
        <delete>
            <fileset dir="src/pauker/help/images" includes="*"/>
        </delete>
        <copy todir="src/pauker/help/images">
            <fileset dir="doc/docbook/images" includes="*"/>
        </copy>
        <echo>Generating German documentation...</echo>
        <antcall target="create-doc">
            <param name="doc_language" value="de"/>
        </antcall>
        <antcall target="create-pdf">
            <param name="doc_language" value="de"/>
        </antcall>
        <echo>Generating Swiss German documentation...</echo>
        <!-- copy German docs and replace (almost) all occurances of "ß" with "ss" -->
        <copy overwrite="yes" file="doc/docbook/de/Pauker.docbook"
              tofile="doc/docbook/de_CH/Pauker.docbook"/>
        <replace summary="yes" file="doc/docbook/de_CH/Pauker.docbook"
                 token="&gt;ß&lt;" value="&gt;DO_NOT_REPLACE_1&lt;"/>
        <replace summary="yes" file="doc/docbook/de_CH/Pauker.docbook"
                 token="&gt;Größe&lt;" value="&gt;DO_NOT_REPLACE_2&lt;"/>
        <replace summary="yes" file="doc/docbook/de_CH/Pauker.docbook"
                 token="ß" value="ss"/>
        <replace summary="yes" file="doc/docbook/de_CH/Pauker.docbook"
                 token="&gt;DO_NOT_REPLACE_1&lt;" value="&gt;ß&lt;"/>
        <replace summary="yes" file="doc/docbook/de_CH/Pauker.docbook"
                 token="&gt;DO_NOT_REPLACE_2&lt;" value="&gt;Größe&lt;"/>
        <antcall target="create-doc">
            <param name="doc_language" value="de_CH"/>
        </antcall>
        <antcall target="create-pdf">
            <param name="doc_language" value="de_CH"/>
        </antcall>
        <echo>Generating English documentation...</echo>
        <antcall target="create-doc">
            <param name="doc_language" value="en"/>
        </antcall>
        <antcall target="create-pdf">
            <param name="doc_language" value="en"/>
        </antcall>
        <echo>Generating French documentation...</echo>
        <antcall target="create-doc">
            <param name="doc_language" value="fr"/>
        </antcall>
        <antcall target="create-pdf">
            <param name="doc_language" value="fr"/>
        </antcall>
        <echo>All documentation generated. Must rebuild project now...</echo>
        <antcall target="clean"/>
        <antcall target="compile"/>
    </target>
    <target name="create-doc">
        
        <!-- update version tag -->
        <replaceregexp
            file="doc/docbook/${doc_language}/Pauker.docbook"
            match="&lt;releaseinfo&gt;.*&lt;/releaseinfo&gt;"
            replace="&lt;releaseinfo&gt;Version ${Pauker_Version}&lt;/releaseinfo&gt;"
        />
        
        <!-- remove old docs -->
        <!-- hint: do NOT remove the complete directory, this will break CVS -->
        <delete>
            <fileset dir="src/pauker/help/${doc_language}" includes="*"/>
        </delete>
        
        <!-- create javahelp stuff
        - unfortunately does not include navigation
        - this gets fixed by the next task
        -->
        <exec dir="doc/docbook/${doc_language}" executable="xsltproc">
            <arg line="
                 --stringparam use.id.as.filename 1
                 -o ../../../src/pauker/help/${doc_language}/
                 /usr/share/xml/docbook/stylesheet/nwalsh/javahelp/javahelp.xsl
            Pauker.docbook"/>
        </exec>
        
        <!-- remove javahelp stuff that we do better ourself -->
        <delete>
            <fileset dir="src/pauker/help/${doc_language}" includes="jhelpset.hs"/>
        </delete>
        
        <!-- create html docs with navigation
        - updates the html files created by the task above
        -->
        <exec dir="doc/docbook/${doc_language}" executable="xsltproc">
            <arg line="
                 --stringparam use.id.as.filename 1
                 --stringparam chunker.output.encoding UTF-8
                 --stringparam section.autolabel 1
                 --stringparam section.label.includes.component.label 1
                 --stringparam admon.graphics 1
                 --stringparam admon.graphics.path ../images/
                 --stringparam chunker.output.indent yes
                 -o ../../../src/pauker/help/${doc_language}/
                 /usr/share/xml/docbook/stylesheet/nwalsh/html/chunk.xsl
            Pauker.docbook"/>
        </exec>
        
        <!-- copy language specific pictures -->
        <copy todir="src/pauker/help/${doc_language}">
            <fileset dir="doc/docbook/${doc_language}" includes="*.png,*.jpg"/>
        </copy>
        
        <!-- update javahelp index -->
        <echo>Updating the JavaHelp index files...</echo>
        <delete dir="src/pauker/help/${doc_language}/CVS/RevisionCache"/>
        <exec dir="src/pauker/help" executable="/opt/java/jh2.0/javahelp/bin/jhindexer">
            <arg line="-verbose -locale ${doc_language} -db JavaHelpSearch_${doc_language} ${doc_language}"/>
        </exec>
    </target>
    <target name="create-pdf">
        <!-- create fo output -->
        <exec dir="doc/docbook/${doc_language}" executable="xsltproc" output="doc/docbook/${doc_language}/Pauker.fo" error="error.txt">
            <arg line="
                 --stringparam paper.type  A4
                 --stringparam dingbat.font.family dejavu
                 --stringparam section.autolabel 1
                 --stringparam section.label.includes.component.label 1
                 --stringparam admon.graphics 1
                 --stringparam admon.graphics.path ../images/
                 --stringparam menuchoice.menu.separator &#xA0;>&#xA0;
                 --stringparam insert.xref.page.number yes
                 --stringparam insert.link.page.number yes
                 /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl
            Pauker.docbook"/>
        </exec>
        <delete file="error.txt"/>
        <!-- correct image scaling for pdf -->
        <replace summary="yes" file="doc/docbook/${doc_language}/Pauker.fo"
                 token="width=&quot;auto&quot; height=&quot;auto&quot; content-width=&quot;auto&quot; content-height=&quot;auto&quot;"
                 value="width=&quot;100%&quot; content-width=&quot;scale-to-fit&quot; content-height=&quot;100%&quot; scaling=&quot;uniform&quot;"/>
        <!-- convert to PDF -->
        <echo>calling fop...</echo>
        <exec dir="doc/docbook/${doc_language}" executable="/home/archiv/fop/fop-0.95/fop">
            <arg line="Pauker.fo Pauker.pdf"/>
        </exec>
        <delete file="doc/docbook/${doc_language}/Pauker.fo"/>
        <move file="doc/docbook/${doc_language}/Pauker.pdf" tofile="Pauker_${doc_language}.pdf"/>
    </target>
</project>