source: java/client_3D/build.xml @ 1058

Last change on this file since 1058 was 66, checked in by Maciej Komosinski, 13 years ago

set 'eol-style' to 'native'

  • Property svn:eol-style set to native
File size: 5.0 KB
Line 
1<?xml version="1.0" encoding="iso-8859-2"?>
2<project name="framsticks-client-3d" basedir=".">
3        <description>
4           This buildfile prepares distributions of the Framsticks 3D Client for windows, mac and linux.
5        </description>
6        <property name="src" value="src"/>
7        <property name="build" value="build"/>
8        <property name="build-classes" value="build/classes"/>
9        <property name="build-lib" value="build/lib"/>
10        <property name="jar-file" value="framsticks-jogl.jar" />
11        <property name="build-jar" value="build/${jar-file}"/>
12        <property name="dist" value="dist"/>
13        <property name="dist-src-zip" value="dist/client3d-src.zip"/>
14        <property name="dist-osx" value="dist/osx"/>
15        <property name="dist-osx-lib" value="dist/osx/Client3d.app/Contents/Resources/Java"/>
16        <property name="dist-osx-res" value="dist/osx/Client3d.app/Contents/Resources/Java/res"/>
17        <property name="dist-osx-java-runner" value="dist/osx/Client3d.app/Contents/MacOS/JavaApplicationStub"/>
18        <property name="dist-osx-zip" value="dist/client3d-osx.zip"/>
19        <property name="dist-osx-dmg" value="dist/client3d-osx.dmg"/>
20        <property name="dist-win" value="dist/win"/>
21        <property name="dist-win-lib" value="dist/win/lib"/>
22        <property name="dist-win-res" value="dist/win/res"/>
23        <property name="dist-win-zip" value="dist/client3d-win.zip"/>
24        <property name="dist-other" value="dist/other"/>
25        <property name="dist-other-lib" value="dist/other/lib"/>
26        <property name="dist-other-res" value="dist/other/res"/>
27        <property name="dist-other-zip" value="dist/client3d-other.zip"/>
28        <property name="static" value="static"/>
29        <property name="static-osx" value="static/osx"/>
30        <property name="static-win" value="static/win"/>
31        <property name="static-shared-res" value="static/shared/res"/>
32        <property name="static-shared-lib" value="static/shared/lib"/>
33       
34        <target name="init">
35                <mkdir dir="${build-classes}" />
36        <mkdir dir="${dist-osx-lib}" />
37        <mkdir dir="${dist-osx-res}" />
38        <mkdir dir="${dist-win-lib}" />
39        <mkdir dir="${dist-win-res}" />
40                <mkdir dir="${dist-other-lib}" />
41        <mkdir dir="${dist-other-res}" />
42        </target>
43       
44        <target name="clean">
45                <delete failonerror="false" includeemptydirs="true">
46                        <fileset dir="${build}"/>
47                        <fileset dir="${dist}" />
48                </delete>
49        </target>
50       
51        <target name="compile" depends="init" >
52        <javac srcdir="${src}" destdir="${build-classes}" target="1.5">
53                <classpath>
54                        <fileset dir="${static-shared-lib}" />
55                </classpath>
56                </javac>
57    </target>
58       
59        <target name="jar" depends="compile">
60                <jar destfile="${build-jar}" >
61                        <fileset dir="${build-classes}" />
62                </jar>
63        </target>
64       
65        <target name="dist-osx" depends="jar">
66                <copy todir="${dist-osx}">
67                        <fileset dir="${static-osx}"/>
68                </copy>
69                <!--
70                        Eleganckie rozwiazanie z Client3d.app wymaga aby plik uruchomiajacy jave byl plikiem wykonywalnym
71                        Problem pojawia sie jezeli kompilacja bedzie przebiegac pod windowsem bo nie ma tam jak takich uprawinien ustawic
72                        Pozostaje skladanie paczki pod unix-owym systemem albo rozwiazanie ze skryptem uruchomiajacym tak jak run.bat dla win
73                 -->
74                <chmod perm="u+x">
75                          <fileset file="${dist-osx-java-runner}/" />
76                </chmod>
77                <copy todir="${dist-osx-lib}">
78                        <fileset file="${build-jar}"/>
79                        <fileset dir="${static-shared-lib}"/>
80                </copy>
81                <copy todir="${dist-osx-res}">
82                        <fileset dir="${static-shared-res}" />
83                </copy>
84        </target>
85       
86        <target name="dist-win" depends="jar">
87                <copy todir="${dist-win}">
88                        <fileset dir="${static-win}"/>
89                </copy>
90                <copy todir="${dist-win-lib}">
91                        <fileset file="${build-jar}"/>
92                        <fileset dir="${static-shared-lib}"/>
93                </copy>
94                <copy todir="${dist-win-res}">
95                        <fileset dir="${static-shared-res}" />
96                </copy>
97        </target>
98       
99        <target name="dist-other" depends="jar">
100                <copy todir="${dist-other-lib}">
101                        <fileset file="${build-jar}"/>
102                        <fileset dir="${static-shared-lib}"/>
103                </copy>
104                <copy todir="${dist-other-res}">
105                        <fileset dir="${static-shared-res}" />
106                </copy>
107        </target>
108       
109        <target name="dist" depends="dist-osx, dist-win, dist-other"
110                description="dist-osx, dist-win, dist-other">
111        </target>
112       
113        <target name="pack"  depends="dist">
114                <!--
115                        Tutaj pojawia sie ten sam problem z plikiem wykonywalnym
116                        Nie mozna sobie po prostu zrobic zip'a (ant nie zachowuje uprawnien plikow)
117                        Tworzymy obraz dysku z nasza aplikacja (standardowy sposob dystrybucji aplikacji pod Mac OS X )
118                -->
119                <exec executable="hdiutil" os="Mac OS X">
120                        <arg line="create -srcfolder ${dist-osx} ${dist-osx-dmg}"/>
121                </exec>
122                <zip destfile="${dist-win-zip}">
123                    <fileset dir="${dist-win}"/>
124                </zip>
125                <zip destfile="${dist-other-zip}">
126                    <fileset dir="${dist-other}"/>
127                </zip>
128                <!-- sources available on public SVN
129                <zip destfile="${dist-src-zip}">
130                        <zipfileset dir="${src}" prefix="${src}"/>
131                        <zipfileset dir="${static}" prefix="${static}"/>
132                        <fileset file=".classpath"/>
133                        <fileset file=".project"/>
134                        <fileset file="build.xml"/>
135                </zip-->
136        </target>
137       
138        <target name="default" depends="clean, init, compile, jar, dist, pack"
139                description="clean, init, compile, jar, dist, pack">
140        </target>
141       
142</project>
Note: See TracBrowser for help on using the repository browser.