0
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<project name="com.nokia.s60tools.metadataeditor" default="cc" basedir=".">
|
|
3 |
|
|
4 |
<property name="basews" value="${ws}"/>
|
|
5 |
<property name="baseos" value="${os}"/>
|
|
6 |
<property name="basearch" value="${arch}"/>
|
|
7 |
<property name="basenl" value="${nl}"/>
|
|
8 |
|
|
9 |
<!-- Compiler settings -->
|
|
10 |
<property name="javacFailOnError" value="true"/>
|
|
11 |
<property name="javacDebugInfo" value="on"/>
|
|
12 |
<property name="javacVerbose" value="false"/>
|
|
13 |
<property name="logExtension" value=".log"/>
|
|
14 |
<property name="compilerArg" value=""/>
|
|
15 |
<property name="javacSource" value="5"/>
|
|
16 |
<property name="javacTarget" value="5"/>
|
|
17 |
|
|
18 |
<property name="bootclasspath" refid="path_bootclasspath"/>
|
|
19 |
<property name="bundleJavacSource" value="${javacSource}"/>
|
|
20 |
<property name="bundleJavacTarget" value="${javacTarget}"/>
|
|
21 |
<property name="bundleBootClasspath" value="${bootclasspath}"/>
|
|
22 |
|
|
23 |
<property name="help.project.name" value="${ant.project.name}.doc.user"/>
|
|
24 |
<property name="feature.project.folder" location="../com.nokia.carbide.extensions.metadataeditor"/>
|
|
25 |
<property name="feature.name" value="MetadataEditor"/>
|
|
26 |
|
|
27 |
<property name="jar.filename" value="${ant.project.name}.jar"/>
|
|
28 |
<property name="help.jar.filename" value="${help.project.name}.jar"/>
|
|
29 |
|
|
30 |
<!-- Folder definitions -->
|
|
31 |
<property name="carbide.plugins" location="c:/Carbide_internal/plugins"/>
|
|
32 |
<property name="test.folder" location="../com.nokia.s60tools.metadataeditor.tests"/>
|
|
33 |
<property name="dist.folder" location="c:/Carbide_internal/plugins"/>
|
|
34 |
|
|
35 |
<property name="reports.folder" location="reports"/>
|
|
36 |
<property name="reports.emma" location="${reports.folder}/emma"/>
|
|
37 |
<property name="instr.folder" location="instr"/>
|
|
38 |
|
|
39 |
|
|
40 |
<!-- EMMA configuration -->
|
|
41 |
<path id="emma.lib" >
|
|
42 |
<pathelement location="${ant.home}/lib/emma.jar" />
|
|
43 |
<pathelement location="${ant.home}/lib/emma_ant.jar" />
|
|
44 |
</path>
|
|
45 |
|
|
46 |
<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
|
|
47 |
|
|
48 |
<!-- PMD configuration -->
|
|
49 |
<path id="pmd.lib" >
|
|
50 |
<pathelement location="${ant.home}/lib/pmd-4.2.jar" />
|
|
51 |
<pathelement location="${ant.home}/lib/asm-3.1.jar" />
|
|
52 |
<pathelement location="${ant.home}/lib/jaxen-1.1.1.jar" />
|
|
53 |
</path>
|
|
54 |
|
|
55 |
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib" />
|
|
56 |
|
|
57 |
<path id="path_bootclasspath">
|
|
58 |
<fileset dir="${java.home}/lib">
|
|
59 |
<include name="*.jar"/>
|
|
60 |
</fileset>
|
|
61 |
</path>
|
|
62 |
|
|
63 |
<path id="build_classpath">
|
|
64 |
<path refid="carbide_classpath"/>
|
|
65 |
</path>
|
|
66 |
|
|
67 |
<path id="carbide_classpath">
|
|
68 |
<fileset dir="${carbide.plugins}" includes="**/*.jar" />
|
|
69 |
</path>
|
|
70 |
|
|
71 |
<target name="properties" if="eclipse.running">
|
|
72 |
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
73 |
</target>
|
|
74 |
|
|
75 |
<!-- Initialization -->
|
|
76 |
<target name="init" depends="properties">
|
|
77 |
<condition property="pluginTemp" value="${buildTempFolder}/plugins">
|
|
78 |
<isset property="buildTempFolder"/>
|
|
79 |
</condition>
|
|
80 |
<property name="pluginTemp" value="${basedir}"/>
|
|
81 |
<condition property="build.result.folder" value="${pluginTemp}/${ant.project.name}">
|
|
82 |
<isset property="buildTempFolder"/>
|
|
83 |
</condition>
|
|
84 |
<property name="build.result.folder" value="${basedir}"/>
|
|
85 |
<property name="temp.folder" value="${basedir}/temp.folder"/>
|
|
86 |
<property name="plugin.destination" value="${basedir}"/>
|
|
87 |
|
|
88 |
<property name="jar.filename" value="${ant.project.name}.jar"/>
|
|
89 |
|
|
90 |
<delete dir="${temp.folder}"/>
|
|
91 |
<mkdir dir="${temp.folder}"/>
|
|
92 |
|
|
93 |
<delete dir="${temp.folder}/bin"/>
|
|
94 |
<mkdir dir="${temp.folder}/bin"/>
|
|
95 |
|
|
96 |
<delete dir="${reports.folder}"/>
|
|
97 |
<mkdir dir="${reports.folder}"/>
|
|
98 |
|
|
99 |
<exec executable="svn" dir="../.">
|
|
100 |
<arg line="up"/>
|
|
101 |
</exec>
|
|
102 |
</target>
|
|
103 |
|
|
104 |
<!-- Build target -->
|
|
105 |
<target name="build" depends="init" description="Build the source">
|
|
106 |
<!-- Build the source -->
|
|
107 |
<javac destdir="${temp.folder}/bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}">
|
|
108 |
<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
|
|
109 |
<classpath refid="build_classpath" />
|
|
110 |
<src path="src/" />
|
|
111 |
<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
112 |
<compilerarg line="-log '${temp.folder}/bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
113 |
</javac>
|
|
114 |
|
|
115 |
<!-- Copy necessary resources -->
|
|
116 |
<copy todir="${temp.folder}/bin" failonerror="true" overwrite="false">
|
|
117 |
<fileset dir="src/" excludes="**/*.java, **/package.htm*" />
|
|
118 |
</copy>
|
|
119 |
|
|
120 |
<!-- Create build result folder -->
|
|
121 |
<mkdir dir="${build.result.folder}"/>
|
|
122 |
|
|
123 |
<!-- Copy classes from the temporary folder to bin -->
|
|
124 |
<copy todir="${build.result.folder}" failonerror="true" overwrite="false">
|
|
125 |
<fileset dir="${temp.folder}/bin" />
|
|
126 |
</copy>
|
|
127 |
|
|
128 |
<!-- Delete temporary folder -->
|
|
129 |
<delete dir="${temp.folder}/bin"/>
|
|
130 |
</target>
|
|
131 |
|
|
132 |
<!-- Clean target -->
|
|
133 |
<target name="clean" description="Clean" depends="clean-test">
|
|
134 |
<delete dir="${build.result.folder}" />
|
|
135 |
<delete>
|
|
136 |
<fileset dir="${dist.folder}" includes="*.jar"/>
|
|
137 |
</delete>
|
|
138 |
</target>
|
|
139 |
|
|
140 |
<!-- Analyze target -->
|
|
141 |
<target name="analyze">
|
|
142 |
<!-- PMD -->
|
|
143 |
<pmd>
|
|
144 |
<!-- Rules -->
|
|
145 |
<ruleset>basic</ruleset>
|
|
146 |
<ruleset>codesize</ruleset>
|
|
147 |
<ruleset>coupling</ruleset>
|
|
148 |
<ruleset>design</ruleset>
|
|
149 |
<ruleset>strictexception</ruleset>
|
|
150 |
<ruleset>strings</ruleset>
|
|
151 |
<ruleset>sunsecure</ruleset>
|
|
152 |
|
|
153 |
<!-- XML output -->
|
|
154 |
<formatter type="xml" toFile="${reports.folder}/report.pmd.xml"/>
|
|
155 |
|
|
156 |
<!-- Files to analyze -->
|
|
157 |
<fileset dir="src/">
|
|
158 |
<include name="**/*.java"/>
|
|
159 |
</fileset>
|
|
160 |
</pmd>
|
|
161 |
</target>
|
|
162 |
|
|
163 |
<!-- Instrumentation target, depends on JAR -->
|
|
164 |
<target name="instr" depends="jar">
|
|
165 |
<!-- Instrument the source code -->
|
|
166 |
<emma>
|
|
167 |
<instr instrpath="${dist.folder}/${jar.filename}" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/>
|
|
168 |
</emma>
|
|
169 |
</target>
|
|
170 |
|
|
171 |
<!-- JAR target -->
|
|
172 |
<target name="jar" depends="build" description="Create JAR">
|
|
173 |
|
|
174 |
<delete dir="binaries"/>
|
|
175 |
<mkdir dir="binaries"/>
|
|
176 |
|
|
177 |
<copy todir="binaries" failonerror="true" overwrite="false">
|
|
178 |
<fileset dir="${build.result.folder}" />
|
|
179 |
</copy>
|
|
180 |
|
|
181 |
|
|
182 |
<!-- Delete temporary folder -->
|
|
183 |
<delete dir="binaries/src"/>
|
|
184 |
<delete dir="binaries/reports"/>
|
|
185 |
<delete dir="binaries/instr"/>
|
|
186 |
<delete dir="binaries/temp.folder"/>
|
|
187 |
<delete dir="binaries/bin"/>
|
|
188 |
<!--<delete dir="binaries/bin"/>-->
|
|
189 |
<delete file="binaries/ccbuild.xml"/>
|
|
190 |
<delete file="binaries/ccbuild3.xml"/>
|
|
191 |
<delete file="binaries/ReleaseNotes.txt"/>
|
|
192 |
<delete file="binaries/.classpath"/>
|
|
193 |
<delete file="binaries/build.properties"/>
|
|
194 |
<delete file="binaries/ccbuild.xml.bak"/>
|
|
195 |
<delete file="binaries/.project"/>
|
|
196 |
|
|
197 |
|
|
198 |
<!-- Create JAR -->
|
|
199 |
<zip destfile="${dist.folder}/${jar.filename}" basedir="binaries" />
|
|
200 |
</target>
|
|
201 |
|
|
202 |
<!-- Clean tests target -->
|
|
203 |
<target name="clean-test" description="Clean test">
|
|
204 |
<delete>
|
|
205 |
<fileset dir="${test.folder}" includes="**/*.class" />
|
|
206 |
</delete>
|
|
207 |
<delete dir="${instr.folder}"/>
|
|
208 |
<delete dir="${reports.folder}"/>
|
|
209 |
</target>
|
|
210 |
|
|
211 |
<!-- Feature target -->
|
|
212 |
<target name="feature" depends="jar" description="Create feature">
|
|
213 |
<property name="feature.folder" location="${dist.folder}/feature"/>
|
|
214 |
|
|
215 |
<mkdir dir="${feature.folder}"/>
|
|
216 |
<mkdir dir="${feature.folder}/plugins"/>
|
|
217 |
<mkdir dir="${feature.folder}/features"/>
|
|
218 |
|
|
219 |
<!-- Create help JAR -->
|
|
220 |
<jar destfile="${carbide.plugins}/${help.jar.filename}" basedir="../${help.project.name}" excludes="src/,.*"/>
|
|
221 |
|
|
222 |
<!-- Copy feature stuff to the temp folder -->
|
|
223 |
<copy todir="${feature.folder}/features" file="${feature.project.folder}/feature.xml"/>
|
|
224 |
<copy todir="${feature.folder}/features" file="${feature.project.folder}/license.txt"/>
|
|
225 |
|
|
226 |
<!-- Copy the actual plug-in to the temp folder -->
|
|
227 |
<copy todir="${feature.folder}/plugins" file="${dist.folder}/${jar.filename}"/>
|
|
228 |
|
|
229 |
<!-- Create the feature zip -->
|
|
230 |
<zip destfile="${dist.folder}/${feature.name}.zip" basedir="${feature.folder}"/>
|
|
231 |
|
|
232 |
<deltree dir="${feature.folder}"/>
|
|
233 |
|
|
234 |
<!-- Nightly build -->
|
|
235 |
<tstamp>
|
|
236 |
<format property="timestamp" pattern="dd-MM-yyyy" />
|
|
237 |
</tstamp>
|
|
238 |
|
|
239 |
<copy tofile="../../nightly_builds/${feature.name}/${feature.name}-${timestamp}.zip" file="${dist.folder}/${feature.name}.zip"/>
|
|
240 |
</target>
|
|
241 |
|
|
242 |
|
|
243 |
<target name="cc" depends="jar, analyze, feature" description="Build, instrument, run unit tests and analyze code"/>
|
|
244 |
</project>
|