18 |
18 |
19 Description: |
19 Description: |
20 |
20 |
21 ============================================================================ |
21 ============================================================================ |
22 --> |
22 --> |
|
23 <!--* @package compile --> |
23 <project name="compile" xmlns:hlm="http://www.nokia.com/helium"> |
24 <project name="compile" xmlns:hlm="http://www.nokia.com/helium"> |
24 <description> |
25 <description> |
25 Targets related to compile stage. It includes cmaker, |
26 Targets related to compile stage. It includes cmaker, |
26 ec, ebs, sbs, sbs-ec build system. |
27 ec, ebs, sbs, sbs-ec build system. |
27 </description> |
28 </description> |
|
29 |
|
30 <!--* @property sysdef.configurations.list |
|
31 Comma-separated list of System Definition configuration names to be built in the compile-main stage. |
|
32 @type string |
|
33 @editable required |
|
34 @scope public |
|
35 --> |
28 |
36 |
29 <!-- Property declaration --> |
37 <!-- Property declaration --> |
|
38 <!-- Suffix used in genxml related output files. This value is added into file names to show that they are genxml related. Used in log files, genxml output files and component list for EE images. Normally does not need to be set. |
|
39 @type string |
|
40 @scope private |
|
41 --> |
30 <property name="genxml.output.file.suffix" value="genxml" /> |
42 <property name="genxml.output.file.suffix" value="genxml" /> |
|
43 <!-- Path of sysdef dtd |
|
44 @type string |
|
45 --> |
31 <property name="compile.sysdef.dtd.stub" location="${helium.dir}/tools/common/dtd/sysdef_dtd_1_4_0.xml" /> |
46 <property name="compile.sysdef.dtd.stub" location="${helium.dir}/tools/common/dtd/sysdef_dtd_1_4_0.xml" /> |
|
47 <!-- Name of the signal input to be able to override the compile-main target. |
|
48 @type string |
|
49 @scope private |
|
50 --> |
32 <property name="compile.signal.input" value="compileSignalInput" /> |
51 <property name="compile.signal.input" value="compileSignalInput" /> |
33 <property name="diamonds.compile.summary" location="${build.log.dir}/${build.id}_compile_diamonds.xml" /> |
52 <!-- Compilation summary file for diamonds. |
34 |
53 @type string |
35 |
54 @scope private |
|
55 --> |
|
56 <property name="diamonds.compile.summary" location="${compile.log.dir}/${build.id}_compile_diamonds.xml" /> |
|
57 |
36 <!-- including common compilation macros --> |
58 <!-- including common compilation macros --> |
37 <hlm:typedef file="${helium.dir}/tools/compile/compile.antlib.xml" uri="http://www.nokia.com/helium"/> |
59 <hlm:typedef file="${helium.dir}/tools/compile/compile.antlib.xml" uri="http://www.nokia.com/helium"/> |
38 <import file="cmaker.ant.xml" /> |
60 <import file="cmaker.ant.xml" /> |
39 <import file="ec/ec.ant.xml" /> |
61 <import file="ec/ec.ant.xml" /> |
40 <import file="ebs/ebs.ant.xml" /> |
62 <import file="ebs/ebs.ant.xml" /> |
41 <import file="sbs/sbs.ant.xml" /> |
63 <import file="sbs/sbs.ant.xml" /> |
42 <import file="sis.ant.xml" /> |
64 <import file="sis.ant.xml" /> |
43 <import file="qt/qt.ant.xml" /> |
65 <import file="qt/qt.ant.xml" /> |
|
66 <import file="coverity.ant.xml" /> |
44 |
67 |
45 <!-- A few basic steps (directory creation) that are needed before starting compilation. --> |
68 <!-- A few basic steps (directory creation) that are needed before starting compilation. --> |
46 <target name="prebuild"> |
69 <target name="prebuild"> |
47 <!-- Needed for the emulator to work. --> |
70 <!-- Needed for the emulator to work. --> |
48 <mkdir dir="${build.drive}/epoc32/winscw/d"/> |
71 <mkdir dir="${build.drive}/epoc32/winscw/d"/> |
51 <mkdir dir="${build.drive}/epoc32/release/winscw/urel/z/resource/fonts"/> |
74 <mkdir dir="${build.drive}/epoc32/release/winscw/urel/z/resource/fonts"/> |
52 <mkdir dir="${build.drive}/epoc32/include/osextensions"/> |
75 <mkdir dir="${build.drive}/epoc32/include/osextensions"/> |
53 </target> |
76 </target> |
54 |
77 |
55 <!-- Does all the necessary steps before starting the component build --> |
78 <!-- Does all the necessary steps before starting the component build --> |
56 <target name="precompile" depends="record-compile-start-time,create-canonical-sysdef-file,precompile-ec"/> |
79 <target name="precompile" depends="record-compile-start-time,create-canonical-sysdef-file,precompile-ec,run-coverity-configure"/> |
57 |
80 |
58 <!-- post operation for EC builds, submits the compile time and lists all the built components--> |
81 <!-- post operation for EC builds, submits the compile time and lists all the built components--> |
59 <target name="postcompile" depends="postcompile-ec,render-build-duplicates" unless="env.HLM_SUBCON"> |
82 <target name="postcompile" depends="postcompile-ec,render-build-duplicates,post-coverity" unless="env.HLM_SUBCON"> |
60 <antcall target="submit-compile-time"/> |
83 <runtarget target="submit-compile-time"/> |
61 </target> |
84 </target> |
|
85 |
62 |
86 |
63 <!-- Pre-processes all System Definition input files. |
87 <!-- Pre-processes all System Definition input files. |
64 |
88 |
65 Any Ant properties used in the files will be replaced by their values. |
89 Any Ant properties used in the files will be replaced by their values. |
66 Also the Symbian System Definition files needs to have \src inserted |
90 Also the Symbian System Definition files needs to have \src inserted |
79 </fail> |
103 </fail> |
80 |
104 |
81 <for param="file"> |
105 <for param="file"> |
82 <resources refid="system.definition.files"/> |
106 <resources refid="system.definition.files"/> |
83 <sequential> |
107 <sequential> |
84 <copy todir="${build.output.dir}/build/input" verbose="true"> |
108 <copy todir="${build.output.dir}/build/input" verbose="true"> |
85 <fileset file="@{file}"/> |
109 <fileset file="@{file}"/> |
86 <filterchain> |
110 <filterchain> |
87 <replaceregex pattern="bldFile="common" replace="bldFile="src\\\\common" flags="gi"/> |
111 <replaceregex pattern="bldFile="common" replace="bldFile="src\\\\common" flags="gi"/> |
88 <replaceregex pattern="mrp="common" replace="mrp="src\\\\common" flags="gi"/> |
112 <replaceregex pattern="mrp="common" replace="mrp="src\\\\common" flags="gi"/> |
89 <replaceregex pattern="bldFile="cedar" replace="bldFile="src\\\\cedar" flags="gi"/> |
113 <replaceregex pattern="bldFile="cedar" replace="bldFile="src\\\\cedar" flags="gi"/> |
90 <replaceregex pattern="mrp="cedar" replace="mrp="src\\\\cedar" flags="gi"/> |
114 <replaceregex pattern="mrp="cedar" replace="mrp="src\\\\cedar" flags="gi"/> |
91 <expandproperties/> |
115 <expandproperties/> |
92 </filterchain> |
116 </filterchain> |
93 <mapper> |
117 <mapper> |
94 <scriptmapper language="beanshell"> |
118 <scriptmapper language="jython"> |
95 <![CDATA[ |
119 <![CDATA[ |
96 import java.io.File; |
120 import os |
97 String counter = project.getProperty(".unique.counter"); |
121 (drive, _) = os.path.splitdrive(r'@{file}') |
98 int count; |
122 path = r'@{file}'.replace(drive + os.sep, "", 1) |
99 if (counter == null){ |
123 self.addMappedName(path) |
100 count = 0; |
|
101 }else{ |
|
102 count = Integer.valueOf(counter) + 1; |
|
103 } |
|
104 project.setProperty(".unique.counter", ""+count); |
|
105 targetname = (String.format("%016d",count) + "_"+new File(source).getName()); |
|
106 self.addMappedName(targetname); |
|
107 ]]> |
124 ]]> |
108 </scriptmapper> |
125 </scriptmapper> |
109 </mapper> |
126 </mapper> |
110 </copy> |
127 </copy> |
111 </sequential> |
128 </sequential> |
113 </target> |
130 </target> |
114 |
131 |
115 |
132 |
116 <!-- Merges all preprocessed System Definition files into one combined file. --> |
133 <!-- Merges all preprocessed System Definition files into one combined file. --> |
117 <target name="create-canonical-sysdef-file" depends="preprocess-sysdef-files"> |
134 <target name="create-canonical-sysdef-file" depends="preprocess-sysdef-files"> |
118 <pathconvert pathsep=" " property="system.definition.files.list"> |
135 <mkdir dir="${compile.log.dir}" /> |
119 <fileset dir="${build.output.dir}/build/input/" includes="*"/> |
136 <if> |
120 <chainedmapper> |
137 <istrue value="${schema.new}" /> |
121 <globmapper from="*" to="-x *" casesensitive="no"/> |
138 <then> |
122 </chainedmapper> |
139 <echo message="system model file: ${system.model.file}" /> |
123 </pathconvert> |
140 <copy file="${system.model.file}" tofile="${build.drive}/sf/os/deviceplatformrelease/foundation_system/system_model/system_model.xml"/> |
124 <hlm:compileGenxmlMergeMacro input="-x ${compile.sysdef.dtd.stub} ${system.definition.files.list}" |
141 <hlm:joinSysdef epocroot="${build.drive}" srcfile="${build.drive}/sf/os/deviceplatformrelease/foundation_system/system_model/system_model.xml" |
125 output="${canonical.sysdef.file}"/> |
142 destfile="${canonical.sysdef.file}.join.xml" /> |
126 </target> |
143 <!-- <hlm:mergeSysdef epocroot="${epocroot}" destfile="${canonical.sysdef.file}" srcfile="${canonical.sysdef.file}.join.xml" downstreamfile="${epocroot}/layer2.sysdef.xml" /> --> |
127 |
144 <hlm:downgradeSysdef epocroot="${build.drive}" srcfile="${canonical.sysdef.file}.join.xml" |
128 <!-- |
145 destfile="${canonical.sysdef.file}"/> |
129 Supports a cleaning of binaries before starting compilation, based on a SysDef configuration. |
146 </then> |
130 <deprecated>Please consider using ido-prep-clean target.</deprecated> |
147 <else> |
|
148 <pathconvert pathsep=" " property="system.definition.files.list"> |
|
149 <fileset dir="${build.output.dir}/build/input/" includes="**"/> |
|
150 <chainedmapper> |
|
151 <globmapper from="*" to="-x '*'" casesensitive="no"/> |
|
152 </chainedmapper> |
|
153 </pathconvert> |
|
154 <hlm:compileGenxmlMergeMacro input="-x ${compile.sysdef.dtd.stub} ${system.definition.files.list}" |
|
155 output="${canonical.sysdef.file}" logfile="${compile.log.dir}/${build.id}.sysdef_GenxmlMerge.log"/> |
|
156 </else> |
|
157 </if> |
|
158 </target> |
|
159 |
|
160 <!-- Supports a cleaning of binaries before starting compilation, based on a SysDef configuration. |
|
161 @deprecated Please consider using ido-prep-clean target. |
131 --> |
162 --> |
132 <target name="compile-clean" depends="create-canonical-sysdef-file" |
163 <target name="compile-clean" depends="create-canonical-sysdef-file" |
133 if="sysdef.clean.configuration"> |
164 if="sysdef.clean.configuration"> |
134 <antcall target="compile-configuration" inheritRefs="true"> |
165 <antcall target="compile-configuration" inheritRefs="true"> |
135 <param name="sysdef.configuration" value="${sysdef.clean.configuration}"/> |
166 <param name="sysdef.configuration" value="${sysdef.clean.configuration}"/> |
219 <if> |
250 <if> |
220 <not> |
251 <not> |
221 <isfalse value="${compile.discard.result}"/> |
252 <isfalse value="${compile.discard.result}"/> |
222 </not> |
253 </not> |
223 <then> |
254 <then> |
224 <delete file="${build.log.dir}/${build.id}.${sysdef.configuration}_compile.log.xml" failonerror="false"/> |
255 <delete file="${compile.log.dir}/${build.id}.${sysdef.configuration}_compile.log.xml" failonerror="false"/> |
225 </then> |
256 </then> |
226 </if> |
257 </if> |
227 </then> |
258 </then> |
228 <else> |
259 <else> |
229 <exec executable="perl" dir="${build.drive}/" output="${build.log.dir}/${build.id}.${sysdef.configuration}_scan1.log" failonerror="${failonerror}"> |
260 <exec executable="perl" dir="${build.drive}/" output="${compile.log.dir}/${build.id}.${sysdef.configuration}_scan1.log" failonerror="${failonerror}"> |
230 <arg value="${epocroot}epoc32/tools/scanlog.pl"/> |
261 <arg value="${epocroot}epoc32/tools/scanlog.pl"/> |
231 <arg file="${build.log.dir}/${build.id}.${sysdef.configuration}_compile.log"/> |
262 <arg file="${compile.log.dir}/${build.id}.${sysdef.configuration}_compile.log"/> |
232 </exec> |
263 </exec> |
233 <exec executable="perl" dir="${build.drive}/" failonerror="${failonerror}"> |
264 <exec executable="perl" dir="${build.drive}/" failonerror="${failonerror}"> |
234 <arg value="${epocroot}epoc32/tools/htmlscanlog.pl"/> |
265 <arg value="${epocroot}epoc32/tools/htmlscanlog.pl"/> |
235 <arg value="-v"/> |
266 <arg value="-v"/> |
236 <arg value="-v"/> |
267 <arg value="-v"/> |
237 <arg value="-l"/> |
268 <arg value="-l"/> |
238 <arg file="${build.log.dir}/${build.id}.${sysdef.configuration}_compile.log"/> |
269 <arg file="${compile.log.dir}/${build.id}.${sysdef.configuration}_compile.log"/> |
239 <arg value="-o"/> |
270 <arg value="-o"/> |
240 <arg file="${build.log.dir}/${build.id}.${sysdef.configuration}_scan2.html"/> |
271 <arg file="${build.log.dir}/${build.id}.${sysdef.configuration}_scan2.html"/> |
241 </exec> |
272 </exec> |
242 <hlm:assertFileExists file="${build.log.dir}/${build.id}.${sysdef.configuration}_scan2.html"/> |
273 <hlm:assertFileExists file="${build.log.dir}/${build.id}.${sysdef.configuration}_scan2.html"/> |
243 <if> |
274 <if> |
247 --> |
278 --> |
248 <isfalse value="${compile.discard.result}"/> |
279 <isfalse value="${compile.discard.result}"/> |
249 <then> |
280 <then> |
250 <hlm:metadatarecord database="${metadata.dbfile}"> |
281 <hlm:metadatarecord database="${metadata.dbfile}"> |
251 <hlm:abldmetadatainput> |
282 <hlm:abldmetadatainput> |
252 <fileset casesensitive="false" file="${build.log.dir}/${build.id}.${sysdef.configuration}_compile.log" /> |
283 <fileset casesensitive="false" file="${compile.log.dir}/${build.id}.${sysdef.configuration}_compile.log" /> |
253 <metadatafilterset refid="filterset.compile" /> |
284 <metadatafilterset refid="filterset.compile" /> |
254 </hlm:abldmetadatainput> |
285 </hlm:abldmetadatainput> |
255 </hlm:metadatarecord> |
286 </hlm:metadatarecord> |
256 <hlm:compileLogSignalMacro compile.summary.file="${build.id}.${sysdef.configuration}_compile.log" |
287 <hlm:compileLogSignalMacro compile.summary.file="${build.id}.${sysdef.configuration}_compile.log" |
257 error.limit="${build.errors.limit}" /> |
288 error.limit="${build.errors.limit}" phase="compile"/> |
258 <!-- Todo: metadata: insert assertions for metadata parsing here --> |
289 <!-- Todo: metadata: insert assertions for metadata parsing here --> |
259 </then> |
290 </then> |
260 </if> |
291 </if> |
261 </else> |
292 </else> |
262 </if> |
293 </if> |
354 f.write(output) |
385 f.write(output) |
355 ]]></scriptdef> |
386 ]]></scriptdef> |
356 |
387 |
357 <!-- Creates a .csv log of the sizes of all the binaries created in the build. --> |
388 <!-- Creates a .csv log of the sizes of all the binaries created in the build. --> |
358 <target name="binary-sizes-log" if="binary.sizes.output"> |
389 <target name="binary-sizes-log" if="binary.sizes.output"> |
359 <hlm:startSpecificLogMacro name="${build.log.dir}/${build.id}_binary_sizes.log"/> |
390 <hlm:startSpecificLogMacro name="${compile.log.dir}/${build.id}_binary_sizes.log" phase="compile"/> |
|
391 <!-- File containing data related to flash image size |
|
392 @type string |
|
393 @scope private |
|
394 --> |
360 <property name="binary.sizes.output.file" location="${build.log.dir}/${build.id}_flash_image_size_data.csv"/> |
395 <property name="binary.sizes.output.file" location="${build.log.dir}/${build.id}_flash_image_size_data.csv"/> |
361 <pathconvert pathsep=";" property="build.logs.list"> |
396 <pathconvert pathsep=";" property="build.logs.list"> |
362 <fileset dir="${build.log.dir}" includes="*_build.log" excludes="*ant_build.log;*_zipup_build.log"/> |
397 <fileset dir="${compile.log.dir}" includes="*_build.log" excludes="*ant_build.log;*_zipup_build.log"/> |
363 </pathconvert> |
398 </pathconvert> |
364 <pathconvert pathsep=";" property="binary.sizes.rom.logs.list"> |
399 <pathconvert pathsep=";" property="binary.sizes.rom.logs.list"> |
365 <fileset refid="binary.sizes.rom.logs"/> |
400 <fileset refid="binary.sizes.rom.logs"/> |
366 </pathconvert> |
401 </pathconvert> |
367 <hlm:python> |
402 <hlm:python> |
368 import logging |
403 import logging |
369 |
404 import compilation |
370 import build.io |
|
371 import sysdef.api |
405 import sysdef.api |
372 import sysdef.io |
|
373 |
|
374 #logging.basicConfig(level=logging.DEBUG) |
406 #logging.basicConfig(level=logging.DEBUG) |
375 logging.basicConfig(level=logging.INFO) |
407 logging.basicConfig(level=logging.INFO) |
376 |
408 |
377 logging.info('Reading the System Sefinition information') |
409 logging.info('Reading the System Sefinition information') |
378 sysDef = sysdef.api.SystemDefinition(r'${canonical.sysdef.file}') |
410 sysDef = sysdef.api.SystemDefinition(r'${canonical.sysdef.file}') |
379 |
411 |
|
412 bnsizelogger = compilation.BinarySizeLogger(sysDef) |
380 # Read in the output binaries of each unit |
413 # Read in the output binaries of each unit |
381 logging.info('Reading the output binaries created by each unit.') |
414 bnsizelogger.read_output_binaries_per_unit(r'${build.logs.list}'.split(';')) |
382 build_logs = r'${build.logs.list}'.split(';') |
|
383 if len(build_logs) == 0: |
|
384 raise Exception('List of build logs is empty!') |
|
385 logging.info("The list of log files:\n") |
|
386 logging.info("\n".join(build_logs)) |
|
387 for logpath in build_logs: |
|
388 binaries_reader = build.io.AbldLogWhatReader(logpath) |
|
389 sysDef.merge_binaries(binaries_reader) |
|
390 |
415 |
391 # Read in the binary sizes listed in the ROM output logs |
416 # Read in the binary sizes listed in the ROM output logs |
392 logging.info('Reading the binary sizes of each binary from ROM logs.') |
417 bnsizelogger.read_binary_sizes_in_rom_output_logs(r'${binary.sizes.rom.logs.list}'.split(';')) |
393 rom_logs = r'${binary.sizes.rom.logs.list}'.split(';') |
|
394 if len(rom_logs) == 0: |
|
395 raise Exception('List of ROM logs is empty!') |
|
396 logging.info("The list of log files:\n") |
|
397 logging.info("\n".join(rom_logs)) |
|
398 for log in rom_logs: |
|
399 binary_sizes_reader = build.io.RombuildLogBinarySizeReader(log) |
|
400 sysDef.merge_binary_sizes(binary_sizes_reader) |
|
401 |
418 |
402 # Write out a .csv file containing |
419 # Write out a .csv file containing |
403 size_writer = sysdef.io.FlashImageSizeWriter(r'${binary.sizes.output.file}') |
420 bnsizelogger.write2csvfile(r'${binary.sizes.output.file}', r'${sysdef.configurations.list}'.split(',')) |
404 size_writer.write(sysDef, r'${sysdef.configurations.list}'.split(',')) |
|
405 size_writer.close() |
|
406 </hlm:python> |
421 </hlm:python> |
407 <hlm:assertFileExists file="${binary.sizes.output.file}"/> |
422 <hlm:assertFileExists file="${binary.sizes.output.file}"/> |
408 <hlm:stopSpecificLogMacro name="${build.log.dir}/${build.id}_binary_sizes.log"/> |
423 <hlm:stopSpecificLogMacro name="${compile.log.dir}/${build.id}_binary_sizes.log" phase="compile"/> |
409 </target> |
424 </target> |
410 |
425 |
411 |
426 |
412 <!-- Run codescanner to perform analysis on source code. |
427 <!-- Run codescanner to perform analysis on source code. |
413 Logs will be created under ${build.log.dir}/codescanner/ |
428 Logs will be created under ${build.log.dir}/codescanner/ |