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