Fix build.
[cyberduck.git] / build-linux.xml
blob1259f22a2c8c52d67d9f58489153dc187a260a29
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  *      $Revision$
4  *      $Date$
5  *
6  *  Copyright (c) 2005-2012 David Kocher. All rights reserved.
7  *  http://cyberduck.io/
8  *
9  *      This program is free software; you can redistribute it and/or modify
10  *      it under the terms of the GNU General Public License as published by
11  *      the Free Software Foundation; either version 2 of the License, or
12  *      (at your option) any later version.
13  *
14  *      This program is distributed in the hope that it will be useful,
15  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *      GNU General Public License for more details.
18  *
19  *      Bug fixes, suggestions and comments should be sent to:
20  *      dkocher@cyberduck.io
21  -->
22 <project name="Cyberduck for Linux" basedir="."
23          xmlns:fx="javafx:com.sun.javafx.tools.ant">
25     <import file="build.xml"/>
27     <property name="jvm.runtime.bin" value="${java.home}/bin"/>
29     <property name="cli.bundles" value="all"/>
30     <property name="app.icon" value="cyberduck-application.png"/>
31     <property name="rpm.spec" value="${build.bundles}/package/linux"/>
32     <property name="deb.control" value="${build.bundles}/package/linux/control"/>
33     <property name="deb.postinstall" value="${build.bundles}/package/linux/postinst"/>
34     <property name="deb.postrm" value="${build.bundles}/package/linux/postrm"/>
36     <target name="_build"/>
38     <target name="_cli">
39         <copy file="${setup}/rpm/duck.spec" todir="${rpm.spec}"/>
40         <copy file="${setup}/deb/duck.control" tofile="${deb.control}"/>
41         <copy file="${setup}/deb/duck.postinstall" tofile="${deb.postinstall}"/>
42         <copy file="${setup}/deb/duck.postrm" tofile="${deb.postrm}"/>
43         <replace file="${rpm.spec}/duck.spec" summary="true" encoding="UTF-8">
44             <replacefilter token="${VERSION}" value="${version}"/>
45             <replacefilter token="${REVISION}" value="${revision}"/>
46         </replace>
47         <path id="javafx.classpath">
48             <!-- Includes linuxrpmbuilder for given architecture -->
49             <pathelement path="${lib.ext}/ant-javafx.${sun.arch.data.model}.jar"/>
50             <pathelement path="${build.bundles}"/>
51         </path>
52         <copy todir="${build}">
53             <fileset dir="${lib}">
54                 <!-- Include libjnidispatch.so -->
55                 <include name="*.${sun.arch.data.model}.so"/>
56             </fileset>
57             <mapper type="glob" from="*.${sun.arch.data.model}.so" to="*.so"/>
58         </copy>
59         <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
60                  uri="javafx:com.sun.javafx.tools.ant">
61             <classpath refid="javafx.classpath"/>
62         </taskdef>
63         <echo>Create native bundles, classpath: ${toString:javafx.classpath}</echo>
64         <fx:deploy nativeBundles="${cli.bundles}"
65                    outdir="${build.deploy}"
66                    outfile="${app.name}-${version}"
67                    offlineAllowed="true"
68                    verbose="true">
69             <fx:preferences shortcut="false" menu="false"
70                             install="true"/>
71             <fx:platform basedir="${java.home}">
72                 <fx:jvmarg value="-Djna.nounpack=true"/>
73                 <fx:jvmarg value="-Djna.noclasspath=true"/>
74                 <fx:jvmarg value="-Djava.awt.headless=true"/>
75                 <fx:jvmarg value="-Dsun.jnu.encoding=utf-8"/>
76                 <fx:jvmarg value="-Dfile.encoding=utf-8"/>
77             </fx:platform>
78             <fx:application
79                     name="duck" version="${version}.${revision}"
80                     mainClass="ch.cyberduck.cli.Terminal"/>
81             <fx:info title="${app.name}" license="GPL" copyright="${copyright}"
82                      description="${app.name}"
83                      vendor="cyberduck.io">
84                 <fx:icon href="${app.icon}"/>
85             </fx:info>
86             <fx:resources>
87                 <fx:fileset dir="${build}" type="jar">
88                     <include name="config.jar"/>
89                     <include name="core.jar"/>
90                     <include name="cli.jar"/>
91                 </fx:fileset>
92                 <fx:fileset dir="${lib}" type="jar">
93                     <include name="*.jar"/>
94                 </fx:fileset>
95                 <fx:fileset dir="${build}" type="data">
96                     <include name="*.so"/>
97                 </fx:fileset>
98                 <fx:fileset dir="." type="icon">
99                     <include name="*.ico"/>
100                 </fx:fileset>
101                 <fx:fileset type="license" file="LICENSE.txt"/>
102                 <fx:fileset dir="${home}" type="data">
103                     <include name="profiles/Rackspace US.cyberduckprofile"/>
104                 </fx:fileset>
105             </fx:resources>
106         </fx:deploy>
107     </target>
108 </project>