1 <!-- |
|
2 # |
|
3 # Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 # All rights reserved. |
|
5 # This component and the accompanying materials are made available |
|
6 # under the terms of "Eclipse Public License v1.0" |
|
7 # which accompanies this distribution, and is available |
|
8 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 # |
|
10 # Initial Contributors: |
|
11 # Nokia Corporation - initial contribution. |
|
12 # |
|
13 # Contributors: |
|
14 # |
|
15 # Description: |
|
16 # |
|
17 --> |
|
18 <project name="OstTraceCompiler" default="build" basedir=".."> |
|
19 |
|
20 <condition property="isLinux"> |
|
21 <os name="linux"/> |
|
22 </condition> |
|
23 |
|
24 <condition property="isWindows"> |
|
25 <not> |
|
26 <os name="linux"/> |
|
27 </not> |
|
28 </condition> |
|
29 |
|
30 <condition property="isRel"> |
|
31 <matches string="${epoc.rel}" pattern="^.*rel$"/> |
|
32 </condition> |
|
33 |
|
34 <condition property="isDeb"> |
|
35 <matches string="${epoc.rel}" pattern="^.*deb$"/> |
|
36 </condition> |
|
37 |
|
38 |
|
39 <target name="init" > |
|
40 <property environment="env" /> |
|
41 <property name="epoc.root" value="${env.EPOCROOT}/" /> |
|
42 <property name="src.dir" value="src" /> |
|
43 <property name="jar.dir" value="jar" /> |
|
44 <property name="dest.dir" value="${tools.rel}/tracecompiler" /> |
|
45 <property name="build.dir" value="${epoc.root}epoc32/build/ost/tracecompiler" /> |
|
46 </target> |
|
47 |
|
48 |
|
49 <target name="clean" depends="init" if="isRel"> |
|
50 <echo>Cleaning the ${build.dir}</echo> |
|
51 <delete dir="${build.dir}"/> |
|
52 <echo>Creating the build directory</echo> |
|
53 <mkdir dir="${build.dir}"/> |
|
54 |
|
55 <echo>Deleting *.xml_ files</echo> |
|
56 <delete> |
|
57 <fileset dir="${epoc.root}epoc32/build" includes="**/*.xml_"/> |
|
58 </delete> |
|
59 <delete dir="${dest.dir}"/> |
|
60 <delete file="tracecompiler/tracecompiler.zip"/> |
|
61 </target> |
|
62 |
|
63 |
|
64 <target name="what" depends="init" description="Prints out all releasables"> |
|
65 <pathconvert pathsep="${line.separator}" property="output"> |
|
66 <fileset dir="${dest.dir}" casesensitive="no"/> |
|
67 </pathconvert> |
|
68 <echo message="${output}" /> |
|
69 </target> |
|
70 |
|
71 |
|
72 <target name="build" if="isRel" depends="clean"> |
|
73 <javac srcdir="${src.dir}" destdir="${build.dir}" debug="true" target="1.5"></javac> |
|
74 |
|
75 <echo> Copying html and properties files from src/com.nokia.tracecompiler/src to ${build.dir} </echo> |
|
76 <copy todir="${build.dir}"> |
|
77 <fileset dir="src/com.nokia.tracecompiler/src" includes="**/*.properties"/> |
|
78 <fileset dir="src/com.nokia.tracecompiler/src" includes="**/*.html"/> |
|
79 <fileset dir="src/com.nokia.tracecompiler/src" includes="**/*.lic"/> |
|
80 </copy> |
|
81 |
|
82 <antcall target="change_windows_file_attributes"></antcall> |
|
83 |
|
84 <antcall target="change_linux_file_attributes"></antcall> |
|
85 |
|
86 <echo>Zip TraceCompiler binaries</echo> |
|
87 <zip destfile="tracecompiler/tracecompiler.zip" update="true"> |
|
88 <zipfileset dir="${build.dir}"/> |
|
89 </zip> |
|
90 |
|
91 <echo>Unzip recompiled TraceCompiler binaries intop epoc32/tools/tracecompiler</echo> |
|
92 <unzip src="tracecompiler/tracecompiler.zip" dest="${dest.dir}" overwrite="true"/> |
|
93 |
|
94 <mkdir dir="${jar.dir}"/> |
|
95 <jar destfile="${jar.dir}/tracecompiler.jar" basedir="${build.dir}"> |
|
96 <fileset dir="src/com.nokia.tracecompiler/src" includes="**/*.properties"/> |
|
97 <manifest> |
|
98 <attribute name="Main-Class" value="com.nokia.tracecompiler.TraceCompilerMain"/> |
|
99 </manifest> |
|
100 </jar> |
|
101 </target> |
|
102 |
|
103 <target name="change_windows_file_attributes" if="isWindows"> |
|
104 <echo message="Change tracecompiler.zip file attributes in Windows"/> |
|
105 <exec executable="attrib"> |
|
106 <arg value="-r"/> |
|
107 <arg value="tracecompiler/tracecompiler.zip"/> |
|
108 </exec> |
|
109 </target> |
|
110 |
|
111 <target name="change_linux_file_attributes" if="isLinux"> |
|
112 <echo message="Change tracecompiler.zip file attributes in Linux"/> |
|
113 <exec executable="chmod"> |
|
114 <arg value="777"/> |
|
115 <arg value="tracecompiler/tracecompiler.zip"/> |
|
116 </exec> |
|
117 </target> |
|
118 |
|
119 </project> |
|