`_
+* ${macro}
#if>
#list>
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/.templates/indexcontent.html.ftl
--- a/buildframework/helium/doc/src/.templates/indexcontent.html.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/.templates/indexcontent.html.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -28,10 +28,12 @@
Release notes
what's new
#if>
- Quick Start Guide
+
Quick start guide
start here
Feature list
what is supported
+ New user tutorial
+ covers the basics
Manual
reference docs
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/architecture.rst
--- a/buildframework/helium/doc/src/architecture.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/architecture.rst Sun Oct 10 15:22:15 2010 +0300
@@ -68,7 +68,7 @@
Practices
=========
-Files created in Ant, Perl, Python or XML syntax must follow the `Style guide `_.
+Files created in Ant, Perl, Python or XML syntax must follow the `Style guide `_.
.. index::
@@ -88,15 +88,8 @@
See the reference API documentation:
* `Helium API`_
-* `Java APIs`_
-* `Python APIs`_
-* `Custom Ant tasks`_
.. _`Helium API` : api/helium/index.html
-.. _`Java APIs` : api/java/index.html
-.. _`Python APIs` : api/python/index.html
-.. _`Custom Ant tasks` : api/ant/index.html
-
.. index::
single: Tools and scripts locations
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/development/coding_conventions.rst
--- a/buildframework/helium/doc/src/development/coding_conventions.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/development/coding_conventions.rst Sun Oct 10 15:22:15 2010 +0300
@@ -46,7 +46,7 @@
Documentation
=============
-Standalone documents like this design document and the user guide are documented in reStructuredText__ format.
+Standalone documents like this design document and the user guide are documented in reStructuredText_ format.
__ http://docutils.sourceforge.net/rst.html
@@ -73,8 +73,31 @@
"``hlm-p``", "Properties"
"``hlm-m``", "Macros"
- It is **not** possible to link to the task or anything in the Java documentation.
+
+.. note:: It is **not** possible to link to tasks or anything in the Java documentation.
+A section of RST documentation might look like this::
+
+ The :hlm-t:`foo` target requires the :hlm-p:`bar` property to be defined. It uses the :hlm-t:`bazMacro` macro.
+
+Fields from the API elements can also be embedded in the RST documentation using an index-like syntax::
+
+ :hlm-p:`bar[summary]`
+
+This would extract the ``summary`` field of the ``bar`` property and insert it into the document. The available fields are:
+
+.. csv-table:: API element fields
+ :header: "Field", "Description"
+
+ "summary", "The first sentence or section of the documentation."
+ "documentation", "The whole documentation text."
+ "scope", "The visibility scope."
+ "defaultValue", "The default value if one is defined. Properties only."
+ "type", "The type of the element. Properties only."
+ "editable", "Whether definition is required or optional. Properties only."
+ "deprecated", "Deprecation message."
+
+
Creating Index References
`````````````````````````
@@ -129,7 +152,7 @@
:header: "Tag", "Applies to", "Description"
"scope", "All elements", "The scope or visibility of the element. Valid values are ``public`` (default), ``protected`` and ``private``."
- "editable", "All types", "Whether this element should be overridden or defined by the user. Valid values are ``required`` and ``optional``"
+ "editable", "All types", "Indicates whether the property must be defined or not. Valid values are ``required`` and ``optional``. ``required`` means it must be defined for the related feature to work. The user must define it if there is no default value, i.e. it is not already defined in Helium."
"type", "Properties", "The type of the property value. Valid values are ``string`` (default), ``integer``, ``boolean``."
"deprecated", "All elements", "Documents that the element is deprecated and may be removed in a future release. The text should describe what to use instead."
@@ -341,7 +364,7 @@
* Unit tests are written for each Python module.
* They should follow the Nose_ testing framework conventions.
-* The test suite is run by calling :hlm-t:`py-unittest`.
+* The test suite is run by calling ``bld test``.
.. _Nose : http://somethingaboutorange.com/mrl/projects/nose/
@@ -364,7 +387,7 @@
* `Twisted Coding Standard`_ (but with a grain of salt):
.. _`PEP 8 - Style Guide for Python Code` : http://www.python.org/dev/peps/pep-0008/
-.. _`Twisted Coding Standard` : http://twistedmatrix.com/trac/browser/trunk/doc/development/policy/coding-standard.xhtml?format=raw
+.. _`Twisted Coding Standard` : http://twistedmatrix.com/documents/current/core/development/policy/coding-standard.html
.. index::
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/development/developer_guide.rst
--- a/buildframework/helium/doc/src/development/developer_guide.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/development/developer_guide.rst Sun Oct 10 15:22:15 2010 +0300
@@ -249,7 +249,7 @@
Also all setter methods visible through Ant must be documented properly using *@ant.required*
or *@ant.not-required* javadoc style attributes.
-You can find more information on how to document Ant tasks using the doclet plugin on http://doclet.neuroning.com/.
+You can find more information on how to document Ant tasks using the doclet plugin on http://antdoclet.neuroning.com/.
General coding guidelines
-------------------------
@@ -264,7 +264,7 @@
----------------------------
In order to match as must as configurability concepts, Helium custom types and tasks must follow development guidelines as
-much as possible. You can find then on http://.apache.org/_task_guidelines.html.
+much as possible. You can find then on http://ant.apache.org/ant_task_guidelines.html.
Logging
-------
@@ -414,6 +414,15 @@
Debug logs for component tests can be found at ``/build/components//xunit``.
+Filtering Python tests using nose
+---------------------------------
+
+Python unit tests are run through the nose testing framework. To run just a single Python test module, use::
+
+ bld test -Dcomponent=pythoncore -Dnose.args=amara
+
+The value of ``nose.args`` is passed through to nose.
+
.. index::
single: Assertions
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/blocks.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/src/manual/blocks.rst Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,110 @@
+.. ============================================================================
+ Name : blocks.rst
+ Part of : Helium
+
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ ============================================================================
+
+.. index::
+ module: Blocks
+
+======
+Blocks
+======
+
+.. contents::
+
+.. _`Blocks-Intro-label`:
+
+Blocks Introduction
+====================
+
+Blocks is a packaging framework, which allows you to create bundles
+with interdependencies (like rpm or deb packages) base on the outcome of the build.
+
+
+Enabling Blocks input generation
+================================
+
+The input generation consists in gathering data from build steps throughout the build to allow the generation
+of the future bundle. Not all the steps are supported, so the build engineer must keep in mind that custom
+exports or modification of the binaries after a controlled build step might lead to bundles with inconsistent content.
+
+In order to enable blocks input generation you simply need to define the **blocks.enabled** property to true. Intermediate
+configuration file will be generated under **blocks.config.dir**.
+
+e.g::
+
+ hlm -Dblocks.enabled=true....
+
+
+Currently supported steps are:
+ * SBSv2 compilation
+ * Configuration export using cMaker (only if cmaker-what is called)
+ * ROM image creation
+
+
+Bundle generation
+=================
+
+Once the data have been gathered during the build, it is then possible to create bundles. To do so you need to call the
+**blocks-create-bundles** target. Generated bundle will be created under **blocks.bundle.dir**.
+
+e.g::
+
+ hlm -Dblocks.enabled=true .... blocks-create-bundles
+
+
+Blocks workspace management with Helium
+=======================================
+
+Helium allows you to use any build environment as Blocks workspace. The :hlm-t:`blocks-create-workspace` will handle the
+automatic creation of workspace base on the current build.drive used. If the current build.drive represent an
+already existing workspace then it will reuse it. The :hlm-p:blocks.workspace.id property will contain the Blocks workspace
+id. Also when new workspace is created some repositories can be automatically added using the **blocks.repositories.id** reference
+to an hlm:blocksRepositorySet object.
+
+::
+
+
+
+
+
+
+
+Installing bundles
+==================
+The :hlm-t:`blocks-install-bundles` target will allow you to install packages under the workspace, to do so, you can configure
+the following references using patternset:
+
+::
+
+
+
+
+
+
+
+
+
+
+
+
+The **blocks.bundle.filter.id** patternset will allow you to filter bundles based on their name. And **blocks.bundle.filter.id** patternset will allow you
+to install group selected group of bundles.
+
+Finally the workspace can be updated using the :hlm-t:`blocks-update-bundles` target.
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/configuring.rst
--- a/buildframework/helium/doc/src/manual/configuring.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/configuring.rst Sun Oct 10 15:22:15 2010 +0300
@@ -84,7 +84,7 @@
-Note that here the default target is :hlm-t:`product-build` so this would be used for a product build configuration. In reality it would need many more properties to be complete.
+Note that here the default target is ``product-build`` so this would be used for a product build configuration. In reality it would need many more properties to be complete.
Refer to the `configuration reference`_ for a full list of all Helium Ant properties.
@@ -188,9 +188,7 @@
Viewing target dependencies
===========================
-The :hlm-t:`deps` target can be used to display a list of the target dependencies for a given target. See the `manual page`_ for more information. Also the :hlm-t:`execlist` command works in a similar way but shows a dialog showing a separated list of all the dependent targets and then just the top-level of dependencies, to help with continuing a build on the command line.
-
-.. _`manual page`: ../api/helium/target-deps.html
+The :hlm-t:`deps` target can be used to display a list of the target dependencies for a given target. Also the :hlm-t:`execlist` command works in a similar way but shows a dialog showing a separated list of all the dependent targets and then just the top-level of dependencies, to help with continuing a build on the command line.
.. index::
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/configuring_features.rst.ftl
--- a/buildframework/helium/doc/src/manual/configuring_features.rst.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/configuring_features.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -18,12 +18,12 @@
============================================================================
-####################
+###########################
Configuring Helium Features
-####################
+###########################
Introduction
--------------------------------
+------------
This describes how to configure the Helium features.
@@ -36,15 +36,15 @@
Enabling blocks features.
Enabling to use dragonfly and many more.
-Properties need to be defined for enabling/disabling the features.
--------------------------------------------------------------
+Properties need to be defined for enabling/disabling the features
+-----------------------------------------------------------------
<#assign propertyCache = {}>
<#list doc.antDatabase.project.property as property>
<#assign propertyCache = propertyCache + {property.name: property}>
#list>
.. csv-table:: Feature properties
- :header: "Property name", "Description", "Allowed value", "Deprecated property"
+ :header: "Property name", "Description", "Default value", "Deprecated property"
<#list propertyCache?keys?sort as name>
<#assign property=propertyCache[name]>
@@ -58,7 +58,7 @@
<#assign deprecatedMessage="${deprecatedName.deprecated}">
#if>
#list>
- ":hlm-p:`${name}`", "${property.summary?replace("^", " ", "rm")?replace("\"", "\"\"", "rm")?trim}", "true/false", "${deprecatedProperty}${deprecatedMessage}"
+ ":hlm-p:`${name}`", "${property.summary?replace("^", " ", "rm")?replace("\"", "\"\"", "rm")?trim}", "${property.defaultValue}", "${deprecatedProperty}${deprecatedMessage}"
#if>
#list>
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/coverity.rst
--- a/buildframework/helium/doc/src/manual/coverity.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/coverity.rst Sun Oct 10 15:22:15 2010 +0300
@@ -217,6 +217,8 @@
machine coverity login password
+.. _`.netrc file`: configuring.html?highlight=netrc#passwords
+
.. csv-table:: Coverity feature flags
:header: "Flags to set", "Action performed", "Allowed value"
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/documentation.rst.ftl
--- a/buildframework/helium/doc/src/manual/documentation.rst.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/documentation.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -33,10 +33,6 @@
APIs
====
-* `Search API`_
-
-.. _`Search API`: ../api/index.html
-
* `Helium API`_
The `Helium API`_ specifies all the available Ant_ targets and their
@@ -50,19 +46,20 @@
.. _`Helium Antlib`: ../helium-antlib/index.html
+<#if !(ant?keys?seq_contains("sf"))>
+
* `Ant Tasks`_
-.. _`Ant Tasks`: ../api/ant/index.html
+.. _`Ant Tasks`: ../api/doclet/index.html
-<#if !(ant?keys?seq_contains("sf"))>
Customer APIs
-------------
* `IDO API`_
* `DFS70501 API`_
-.. _`IDO API`: ../ido/api/helium/index.html
-.. _`DFS70501 API`: ../dfs70501/api/helium/index.html
+.. _`IDO API`: http://helium.nmp.nokia.com/doc/ido/api/helium/index.html
+.. _`DFS70501 API`: http://helium.nmp.nokia.com/doc/dfs70501/api/helium/index.html
#if>
Building custom documentation
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/final.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/src/manual/final.rst Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,63 @@
+..
+ ============================================================================
+ Name : final.rst
+ Part of : Helium
+
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ ============================================================================
+
+.. index::
+ single: Stage - Final operations
+
+Final operations
+================
+
+Final operation are steps which could happen at the workflow completion.
+
+
+Running a target at build completion
+------------------------------------
+
+Helium offers the possibility to run a final target despite any error which could occur during the build.
+The configuration of the target is done using the **hlm.final.target** property.
+
+e.g:
+::
+
+
+
+
+Running action on failure
+-------------------------
+
+The signaling framework will automatically run all signalExceptionConfig in case of Ant failure at the
+end of the build.
+
+This example shows how simple task can be run in case of failure:
+::
+
+
+
+
+ Signal: ${r'$'}{signal.name}
+ Message: ${r'$'}{signal.message}
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/index.rst.ftl
--- a/buildframework/helium/doc/src/manual/index.rst.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/index.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -19,10 +19,15 @@
============================================================================
-->
-###################################
- Helium Manual
-###################################
+#############
+Helium Manual
+#############
+.. raw:: html
+
+
+
+
.. toctree::
:maxdepth: 2
@@ -36,7 +41,14 @@
configuring_features
running
stages
- stage_matti
+
+.. raw:: html
+
+
+
+.. toctree::
+ :maxdepth: 2
+
<#if !ant?keys?seq_contains("sf")>
nokiastages
datapackage
@@ -48,7 +60,9 @@
messaging
metrics
coverity
+ final
-
-
-
+.. raw:: html
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/introduction.rst
--- a/buildframework/helium/doc/src/manual/introduction.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/introduction.rst Sun Oct 10 15:22:15 2010 +0300
@@ -40,7 +40,7 @@
It is recommended to read the Ant_ documentation before learning about Helium. An understanding of XML_ is also needed as Ant_ is configured using an XML_ format.
-.. _Ant: http://Ant.apache.org/
+.. _Ant: http://ant.apache.org/
.. _XML: http://www.w3.org/XML/
.. index::
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/metrics.rst
--- a/buildframework/helium/doc/src/manual/metrics.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/metrics.rst Sun Oct 10 15:22:15 2010 +0300
@@ -45,7 +45,7 @@
====================
To enable logging to diamonds from Helium one needs to ensure that:
-* The properties :hlm-p:`diamonds.host` and :hlm-p:`diamonds.port` are set correctly.
+* The properties ``diamonds.host`` and ``diamonds.port`` are set correctly.
* By default they are taken from ``helium/tools/common/companyproperties.ant.xml``, but can be overridden by using:
* **Command line**
@@ -83,8 +83,8 @@
"``diamonds.host``", "Diamonds server address"
"``diamonds.port``", "Server port number"
"``diamonds.path``", "Builds path in Diamonds server"
- ":hlm-p:`build.family`", "Category of product"
- ":hlm-p:`stages`", "Start and end target of a stages with logical stage name"
+ "``build.family``", "Category of product"
+ "``stages``", "Start and end target of a stages with logical stage name"
":hlm-p:`sysdef.configurations.list`", "System definition name list to log component faults"
":hlm-p:`build.name`", "Name of product"
":hlm-p:`release.label`", "Name of release"
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_ats.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/src/manual/stage_ats.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,712 @@
+.. ============================================================================
+ Name : stage_ats.rst.ftl
+ Part of : Helium
+
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ ============================================================================
+
+.. index::
+ module: Testing
+
+=======
+Testing
+=======
+
+This is a good start for Helium users who want to setup test automation using ATS4. (**ATS3 users**, please `read here`_ .)
+
+.. _`read here`: stage_ats_old.html
+
+
+
+.. contents::
+
+
+
+Helium Test Automation
+======================
+
+Helium can be used to auomate testing. For this purpose, test asset must be alligned with the standard guidelines for writing the tests.
+
+Helium supports several test frameworks including `STIF`_, `TEF`_, RTest, MTF, `SUT`_, QtTest `EUnit`_, TDriver and ASTE. (`Description of test frameworks`_)
+
+Most of the above mentioned test frameworks share common configuration to setup TA environemnet. However, there are a few exceptions, which are discussed below under the headings of every test framework.
+
+
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`STIF`: http://s60wiki.nokia.com/S60Wiki/STIF
+.. _`TEF`: http://s60wiki.nokia.com/S60Wiki/TEF_%28TestExecute_Framework%29
+.. _`EUnit`: http://s60wiki.nokia.com/S60Wiki/EUnit
+#if>
+
+.. _`SUT`: http://developer.symbian.org/wiki/index.php/Symbian_Test_Tools#SymbianUnitTest
+.. _`Description of test frameworks`: http://developer.symbian.org/wiki/index.php/Symbian_Test_Tools
+
+
+
+Prerequisites
+-------------
+
+* `Harmonized Test Interface (HTI)`_ needs to be compiled and into the image.
+* The reader is expected to already have a working ATS setup in which test cases can be executed. ATS server names,
+ access rights and authentication etc. is supposed to be already taken care of.
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`Harmonized Test Interface (HTI)`: http://s60wiki.nokia.com/S60Wiki/HTI
+<#else>
+.. _`Harmonized Test Interface (HTI)`: http://developer.symbian.org/wiki/index.php/HTI_Tool
+#if>
+
+
+Setting up a Test Automation Environment with Helium
+====================================================
+
+Basic Test Automation step-by-step setup guide.
+
+
+Step 0: Structuring Test-source/test-asset
+------------------------------------------
+Test source usually lives in a component's ``tsrc`` directory. Test source components are created like any other Symbian SW component;
+there is a ``group`` directory with a ``bld.inf`` file for building, ``.mmp`` files for defining the targets, and so on.
+
+The test generation code expects ``.pkg`` file in the ``group`` directory of test component to be compiled, to get the paths of the files
+(can be data, configuration, initialization, etc) to be installed and where to install on the phone.
+
+**Please note** that not all components have ``tsrc`` and ``group`` directories. For instance, Qt, ASTE and TDriver do not have similar test asset structure as STIF, TEF and other test components. It is recommended to follow the test asset guidelines prior to setting up test automation with Helium.
+
+
+Step 1: Setting up system definition file
+-----------------------------------------
+**System Definition Files supporting layers.sysdef.xml**
+ **layers** in ``layers.sysdef.xml`` file and **configuration** in ``build.sysdef.xml`` file (`Structure of System Definition files version 1.4`_).
+
+ <#if !(ant?keys?seq_contains("sf"))>
+.. _`new API test automation guidelines`: http://s60wiki.nokia.com/S60Wiki/Test_Asset_Guidelines
+.. _`Structure of System Definition files version 1.4`: http://delivery.nmp.nokia.com/trac/helium/wiki/SystemDefinitionFiles
+#if>
+
+A template of layer in layers.sysdef.xml for system definition files
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+* Layer name should end with **_test_layer**
+* Two standard names for ATS test layers are being used; ``unit_test_layer`` and ``api_test_layer``. Test components (the``unit`` tags)
+ should be specified under these layers and grouped by ``module`` tag(s).
+* In the above, two modules means two drop files will be created; ``module`` may have one or more ``unit``
+* By using property ``exclude.test.layers``, complete layers can be excluded and the components inside that layer will not be included in the AtsDrop. This property is a comma (,) separated list
+
+**System Definition Files version 3.0 (SysDefs3)** (new Helium v.10.79)
+ The `structure of System Definition files version 3.0`_ is different than previous versions of system definition files. In SysDefs3, package definition files are used for components specification. Instead of layers naming conventions, filters are used to identify test components and test types, for example: "test, unit_test, !api_test" etc.
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`structure of System Definition files version 3.0`: http://wikis.in.nokia.com/view/SWManageabilityTeamWiki/PkgdefUse
+<#else>
+.. _`structure of System Definition files version 3.0`: sysdef3.html
+#if>
+
+An example template for defining test components in a package definition file.
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+* Filter "test" must be specified for every test component. If it is not specified, the component will not be considered as a test component.
+* / are now used to group test components, it work in the same way as ... in sysdef v1.4 works. The components having same group name are grouped together.
+ Separate drop files are created for different groups. In the above example, if only 'test' is selected, then two drop files will be created, one with tc1 and the other one with tc2 and tc3.
+
+
+Step 2: Configure ATS Ant properties
+---------------------------------------
+The properties are categorized as
+
+* **Common** - Valid for all test frameworks (Table-1).
+* **API/Module** - Valid for only API/Module tests like STIF, STF, EUNit etc., and hence, are shared among many test frameworks (Table-2).
+
+
+Also, the edit status of the properties can be described as
+
+* [must] - must be set by user
+* [recommended] - should be set by user but not mandatory
+* [allowed] - should **not** be set by user however, it is possible.
+
+.. csv-table:: Table-1: ATS - Common Properties
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`ats.server`", "[must]", ":hlm-p:`ats.server[documentation]`"
+ ":hlm-p:`ats.drop.location`", "[allowed]", ":hlm-p:`ats.drop.location[documentation]`"
+ ":hlm-p:`ats.product.name`", "[must]", ":hlm-p:`ats.product.name[documentation]`"
+ ":hlm-p:`ats.email.list`", "[allowed]", ":hlm-p:`ats.email.list[documentation]`"
+ ":hlm-p:`ats.report.type`", "[allowed]", ":hlm-p:`ats.report.type[documentation]`"
+ ":hlm-p:`ats.flashfiles.minlimit`", "[allowed]", ":hlm-p:`ats.flashfiles.minlimit[documentation]`"
+ ":hlm-p:`ats.plan.name`", "[allowed]", ":hlm-p:`ats.plan.name[documentation]`"
+ ":hlm-p:`ats.product.hwid`", "[allowed]", ":hlm-p:`ats.product.hwid[documentation]`"
+ ":hlm-p:`ats.script.type`", "[allowed]", ":hlm-p:`ats.script.type[documentation]`"
+ ":hlm-p:`ats.test.timeout`", "[allowed]", ":hlm-p:`ats.test.timeout[documentation]`"
+ ":hlm-p:`ats.testrun.name`", "[allowed]", ":hlm-p:`ats.testrun.name[documentation]`"
+ ":hlm-p:`ats.report.location`", "[allowed]", ":hlm-p:`ats.report.location[documentation]`"
+ ":hlm-p:`ats.diamonds.signal`", "[allowed]", ":hlm-p:`ats.diamonds.signal[documentation]`"
+
+
+An example of setting up the common properties as in table-1:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. csv-table:: Table-2: ATS - API/Module properties
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`ats.target.platform`", "[allowed]", ":hlm-p:`ats.target.platform[documentation]`"
+ ":hlm-p:`ats.obey.pkgfiles.rule`", "[allowed]", ":hlm-p:`ats.obey.pkgfiles.rule[documentation]`"
+ ":hlm-p:`ats.specific.pkg`", "[allowed]", ":hlm-p:`ats.specific.pkg[documentation]`"
+ ":hlm-p:`ats.test.filterset`", "[allowed]", ":hlm-p:`ats.test.filterset[documentation]`"
+
+
+An example of setting up API/Module testing properties as in table-2:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+Step 3: Configure or select ROM images (Optional)
+-------------------------------------------------
+Since helium 10 images are picked up using :hlm-p:`ats.product.name` and Imaker iconfig.xml files. Property ``release.images.dir`` is searched for iconfig.xml files, the ones where the product name is part of :hlm-p:`ats.product.name` is used.
+
+You should only build the images for each product you want to include in ats. See `Imaker`_ docs for more info. Eg.
+
+.. _`Imaker`: ../helium-antlib/imaker.html
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+For older products where there are no iconfig.xml, ``reference.ats.flash.images`` is used:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+.. Note::
+
+ Always declare *Properties* before and *filesets* after importing helium.ant.xml in order to overwrite the default values during the build.
+
+
+Step 4: Enabling or disabling test automation features
+------------------------------------------------------
+Helium supports a number of test automation features, which are discussed below. These features can be enabled or disabled by switching the values of the following properties to either *true* or *false*.
+
+
+.. csv-table:: Table-3: ATS - Switches/enablers
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`ats.enabled`", "[allowed]", ":hlm-p:`ats.enabled[documentation]`"
+ ":hlm-p:`ats4.enabled`", "[allowed]", ":hlm-p:`ats4.enabled[documentation]`"
+ ":hlm-p:`ats.stf.enabled`", "[allowed]", ":hlm-p:`ats.stf..enabled[documentation]`"
+ ":hlm-p:`aste.enabled`", "[allowed]", ":hlm-p:`aste.enabled[documentation]`"
+ ":hlm-p:`ats.ctc.enabled`", "[allowed]", ":hlm-p:`ats.ctc.enabled[documentation]`"
+ ":hlm-p:`ats.trace.enabled`", "[allowed]", ":hlm-p:`ats.trace.enabled[documentation]`"
+ ":hlm-p:`ats.emulator.enable`", "[allowed]", ":hlm-p:`ats.emulator.enable[documentation]`"
+ ":hlm-p:`ats.singledrop.enabled`", "[allowed]", ":hlm-p:`ats.singledrop.enabled[documentation]`"
+ ":hlm-p:`ats.multiset.enabled`", "[allowed]", ":hlm-p:`ats.multiset.enabled[documentation]`"
+ ":hlm-p:`ats.delta.enabled`", "[allowed]", ":hlm-p:`ats.delta.enabled[documentation]`"
+ ":hlm-p:`ats.java.importer.enabled`", "[allowed]", ":hlm-p:`ats.java.importer.enabled[documentation]`"
+ ":hlm-p:`ats.tdriver.enabled`", "[allowed]", ":hlm-p:`ats.tdriver.enabled[documentation]`"
+
+
+For example:
+
+.. code-block:: xml
+
+
+
+
+Supported Test Frameworks
+=========================
+In this section only Helium specific properties, targets or other related issues are discussed to configure the following test frameworks. However, as mentioned earlier, there are test asset guidelines to setup test components for different test frameworks.
+
+ASTE
+----
+* ASTE tests can be enabled by setting :hlm-p:`aste.enabled` (see table-3).
+* `SW Test Asset`_ location and type of test should be known as a prerequisite.
+* To configure the ASTE tests, aste specific properties are required in addition to those in table-1
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`SW Test Asset`: http://s60wiki.nokia.com/S60Wiki/MC_SW_Test_Asset_documentation
+#if>
+
+.. csv-table:: Table: ATS - ASTE properties
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`ats.aste.testasset.location`", "[must]", ":hlm-p:`ats.aste.testasset.location[documentation]`"
+ ":hlm-p:`ats.aste.software.release`", "[must]", ":hlm-p:`ats.aste.software.release[documentation]`"
+ ":hlm-p:`ats.aste.software.version`", "[must]", ":hlm-p:`ats.aste.software.version[documentation]`"
+ ":hlm-p:`ats.aste.testasset.caseids`", "[recommended]", ":hlm-p:`ats.aste.testasset.caseids[documentation]`"
+ ":hlm-p:`ats.aste.language`", "[recommended]", ":hlm-p:`ats.aste.language[documentation]`"
+ ":hlm-p:`ats.aste.test.type`", "[recommended]", ":hlm-p:`ats.aste.test.type[documentation]`"
+ ":hlm-p:`ats.aste.plan.name`", "[recommended]", ":hlm-p:`ats.aste.plan.name[documentation]`"
+ ":hlm-p:`ats.aste.testrun.name`", "[recommended]", ":hlm-p:`ats.aste.testrun.name[documentation]`"
+ ":hlm-p:`ats.aste.email.list`", "[recommended]", ":hlm-p:`ats.aste.email.list[documentation]`"
+
+
+An example of setting up ASTE properties:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+EUnit
+-----
+* Test framework is selected if there is a library ``eunit.lib`` in the ``.mmp`` file of a test component
+* Following EUnit specific properties are required in addition to those in table-1 and table-2.
+
+.. csv-table:: Table: ATS - ASTE properties
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`eunit.test.package`", "[allowed]", ":hlm-p:`eunit.test.package[documentation]`"
+ ":hlm-p:`eunitexerunner.flags`", "[allowed]", ":hlm-p:`eunitexerunner.flags[documentation]`"
+
+
+An example of setting up ASTE properties as in the above table:
+
+.. code-block:: xml
+
+
+
+
+
+MTF
+---
+* The test framework is selected if there is a library ``testframeworkclient.lib`` in the ``.mmp`` file of a test component
+* There is no MTF specific configuration for Helium in addition to those in table-1 and table-2.
+
+
+QtTest
+------
+* The test framework is selected if there is a library ``QtTest.lib`` in the ``.mmp`` file of a test component
+* There are several ``.PKG`` files created after executing ``qmake``, but only one is selected based on a set target platform. See (:hlm-p:`ats.target.platform`) description in table-2.
+* Properties in table-1 and table-2 should also be configured.
+
+
+RTest
+-----
+* The test framework is selected if there is a library ``euser.lib`` and a comment ``//RTEST``in the ``.mmp`` file of a test component.
+* There is no RTest specific configuration for Helium in addition to those in table-1 and table-2.
+
+
+STF
+---
+* The test framework is selected if there is ``ModuleName=TEFTESTMODULE`` in ``.ini`` file of a component.
+* There is no STF specific configuration for Helium in addition to those in table-1 and table-2.
+* To enable STF for ATS set, :hlm-p:`ats.stf.enabled` (see table-3). By default this is not enabled.
+
+
+STIF
+----
+* The test framework is selected if there is a library ``stiftestinterface.lib`` in the ``.mmp`` file of a test component
+* There is no STIF specific configuration for Helium in addition to those in table-1 and table-2.
+
+
+SUT
+---
+* The test framework is selected if there is a library ``symbianunittestfw.lib`` in the ``.mmp`` file of a test component
+* There is no SUT specific configuration for Helium in addition to those in table-1 and table-2.
+
+
+TEF
+---
+* The test framework is selected if there is a library ``testframeworkclient.lib`` in the ``.mmp`` file of a test component
+* There is no TEF specific configuration for Helium in addition to those in table-1 and table-2.
+
+
+TDriver
+-------
+* TDriver tests can be enabled by setting :hlm-p:`ats.tdriver.enabled` (see table-3).
+* TDriver Test Asset location should be known as a prerequisite.
+* Following TDriver specific properties are required in addition to those in table-1.
+
+
+.. csv-table:: Table: ATS Ant properties
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`ats.tdriver.enabled`", "[must]", ":hlm-p:`ats.tdriver.enabled[documentation]`"
+ ":hlm-p:`tdriver.asset.location`", "[must]", ":hlm-p:`tdriver.asset.location[documentation]`"
+ ":hlm-p:`tdriver.test.profiles`", "[must]", ":hlm-p:`tdriver.test.profiles[documentation]`"
+ ":hlm-p:`tdriver.tdrunner.enabled`", "[must]", ":hlm-p:`tdriver.tdrunner.enabled[documentation]`"
+ ":hlm-p:`tdriver.test.timeout`", "[must]", ":hlm-p:`tdriver.test.timeout[documentation]`"
+ ":hlm-p:`tdriver.parameters`", "[must]", ":hlm-p:`tdriver.parameters[documentation]`"
+ ":hlm-p:`tdriver.sis.files`", "[must]", ":hlm-p:`tdriver.sis.files[documentation]`"
+ ":hlm-p:`tdriver.tdrunner.parameters`", "[must]", ":hlm-p:`tdriver.tdrunner.parameters[documentation]`"
+ ":hlm-p:`tdriver.template.file`", "[allowed]", ":hlm-p:`tdriver.template.file[documentation]`"
+
+
+An example of setting up TDriver properties:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+* To execute the tests, :hlm-t:`tdriver-test` target should be called.
+* To create custom templates for TDriver, read `Instructions for creating TDriver custom template`_.
+
+
+.. _`Instructions for creating TDriver custom template`: tdriver_template_instructions.html
+
+
+
+Test Automation Features
+========================
+
+CTC (Code Coverage)
+-------------------
+
+* To enable ctc for ATS set, :hlm-p:`ats.ctc.enabled` (see table-3).
+* To compile components for CTC see `configure CTC for SBS`_
+
+.. _`configure CTC for SBS`: ../helium-antlib/sbsctc.html
+
+* Once ATS tests have finished results for CTC will be shown in Diamonds.
+* The following are optional CTC properties
+
+.. csv-table:: Table: ATS Ant properties
+ :header: "Property name", "Edit status", "Description"
+
+ "``ctc.instrument.type``", "[allowed]", "Sets the instrument type"
+ "``ctc.build.options``", "[allowed]", "Enables optional extra arguments for CTC, after importing a parent ant file."
+
+
+For example,
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+Or
+
+.. code-block:: xml
+
+
+
+
+
+
+See `more information on code coverage`_.
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`more information on code coverage`: http://s60wiki.nokia.com/S60Wiki/CTC
+<#else>
+.. _`more information on code coverage`: http://developer.symbian.org/wiki/index.php/Testing_Guidelines_for_Package_Releases#Code_coverage
+#if>
+
+
+
+Customized test XML files
+-------------------------
+
+The user can customize the generated test.xml with files:
+
+* **preset_custom.xml** goes before first set
+* **postset_custom.xml** goes after last set
+* **precase_custom.xml** goes before first case
+* **postcase_custom.xml** goes after last case
+* **prestep_custom.xml** goes before first step
+* **poststep_custom.xml** goes after last step
+* **prerun_custom.xml** goes before first run or execute step
+* **postrun_custom.xml** goes after last run or execute step
+* **prepostaction.xml** goes before first postaction
+* **postpostaction.xml** goes after last postaction
+
+The files must be in the directory 'custom' under the 'tsrc' or 'group' folder to be processed.
+
+The files need to be proper XML snippets that fit to their place. In case of an error an error is logged and a comment inserted to the generated XML file.
+
+A postaction section customization file (prepostaction.xml or postpostaction.xml) could look like this
+
+.. code-block:: xml
+
+
+ RunProcessAction
+
+
+
+
+
+
+The ``prestep_custom.xml`` can be used to flash and unstall something custom.
+
+.. code-block:: xml
+
+
+ FileUploadTask
+
+
+
+
+
+
+
+
+
+
+And then the ``prerun_custom.xml`` can be used to execute a task.
+
+.. code-block:: xml
+
+
+ NonTestExecuteTask
+
+
+
+
+
+
+
+
+
+**Note:** The users is expected to check the generated test.xml manually, as there is no validation. Invalid XML input files will be disregarded and a comment will be inserted to the generated XML file.
+
+
+Custom templates/drops
+----------------------
+* If you need to send a static drop to ATS then you can call the target :hlm-t:`ats-custom-drop`.
+* An example template is in helium/tools/testing/ats/templates/ats4_naviengine_template.xml
+* Then set a property to your own template, as follows.
+
+.. code-block:: xml
+
+
+
+
+Overriding XML values
+---------------------
+* Set the property ``ats.config.file`` to the location of the config file.
+
+Example configuration:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Delta testing
+-------------
+
+
+Multiset support
+----------------
+* Enable the feature by setting property :hlm-p:`ats.multiset.enabled` to ``true``.
+* If enabled, a 'set' in test.xml, is used for each pkg file in a component, this allows tests to run in parallel on several devices.
+
+ROM Bootup Tests
+----------------
+* ROM images can be tested on ATS by executing target ":hlm-t:`ats-bootup-test`". This feature is useful to test whther the created ROM images boot-up a device or not .
+* To enable this feature, set a property ":hlm-p:`ats.bootuptest.enabled`" (see table-3)
+* In addition to enable the feature, properties in the table-1 are also required.
+
+
+Single/Multiple test drops creation
+-----------------------------------
+* It is mentioned earlier in Step 1, that components can be grouped together.
+* During automation, separate TestDrops are created based on these groups.
+* This grouping can be neglected and a single test drop can be created by setting a property :hlm-p:`ats.singledrop.enabled` By default the value is 'false'. For example,
+
+
+.. code-block:: xml
+
+
+
+
+
+Skip uploading test drops
+-------------------------
+* ``ats-test`` target can only create a drop file, and does not send the drop (or package) to ATS server.
+* To use the feature, set the following property to ``flase``.
+
+.. code-block:: xml
+
+
+
+
+<#if !(ant?keys?seq_contains("sf"))>
+
+Support for multiple products (ROM images)
+------------------------------------------
+
+See: `Instructions for setting up multiple roms and executing specific tests`_.
+
+.. _`Instructions for setting up multiple roms and executing specific tests`: http://helium.nmp.nokia.com/doc/ido/romandtest.html
+
+
+#if>
+
+
+Testing with Winscw Emulator
+----------------------------
+* If enabled, ``ats-test`` target creates a zip of build area instead of images for use by emulator on ATS server.
+* Set a property as follows.
+
+.. code-block:: xml
+
+
+
+
+<#if !(ant?keys?seq_contains("sf"))>
+
+Tracing
+-------
+* Currently there isn't a single standard method of doing tracing in Symbian Platform.
+* Application, middleware, driver and kernel developers have used different methods for instrumenting their code. Due to the different methods used, it is inherently difficult to get a coherent overview of the whole platform when debugging and testing sw.
+* Current implementation of Tracing in Helium is based on the instruction given `here`_.
+* Tracing can be enabled by setting :hlm-p:`ats.trace.enabled` to ``true`` (see table-3).
+
+.. _`here`: http://s60wiki.nokia.com/S60Wiki/Tracing
+
+#if>
+
+
+Troubleshooting TA
+==================
+
+.. csv-table:: Table: Trouble shooting test automation
+ :header: "Type", "Description", "Possible solution"
+
+ "Error", "'**' not found", "Either the PKG file does not exist or incorrect filename."
+ "Error", "No test modules found in '**'", "This error is raised when there is no test components available. Check that your components are in the SystemDefinition files, and that the filters are set accordingly to the test asset documentation and that the components actually exists in the asset."
+ "Error", "'**' - test source not found", "Path in the bld.inf file is either incorrect or the component does not exist."
+ "Error", "Not enough flash files: # defined, # needed", "Check property :hlm-p:`ats.flashfiles.minlimit`. Selected ROM images files # is lesser than the required no. of files. This error can also be eliminated by reducing the value of the property."
+ "Error", "'CPP failed: '' in: '**'", "Check the path and/or the file. There can be broken path in the file or mising directives and macros."
+ "Error", "** - test sets are empty", "missing/invalid deirectives and/or project macros. The .mmp file ca be missing."
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_ats.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_ats.rst.inc.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,506 +0,0 @@
-<#--
-============================================================================
-Name : stage_ats.rst.inc.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-
-.. index::
- single: ATS - STIF, TEF, RTEST, MTF and EUnit
-
-.. _`Stage-ATS-label`:
-
-Stage: ATS - STIF, TEF, RTEST, MTF and EUnit (also Qt)
-=======================================================
-
-ATS testing is the automatic testing of the phone code once it has been compiled and linked to create a ROM image.
-
-Explanation of the process for getting ATS (`STIF`_ and `EUnit`_) tests compiled and executed by Helium, through the use of the :hlm-t:`ats-test` target.
-
-http://developer.symbian.org/wiki/index.php/Symbian_Test_Tools
-
-<#if !(ant?keys?seq_contains("sf"))>
-.. _`STIF`: http://s60wiki.nokia.com/S60Wiki/STIF
-.. _`EUnit`: http://s60wiki.nokia.com/S60Wiki/EUnit
-#if>
-
-.. image:: ats.dot.png
-
-Prerequisites
-----------------
-
-* `Harmonized Test Interface (HTI)`_ needs to be compiled and into the image.
-* The reader is expected to already have a working ATS setup in which test cases can be executed. ATS server names,
- access rights and authentication etc. is supposed to be already taken care of.
-
-<#if !(ant?keys?seq_contains("sf"))>
-.. _`Harmonized Test Interface (HTI)`: http://s60wiki.nokia.com/S60Wiki/HTI
-<#else>
-.. _`Harmonized Test Interface (HTI)`: http://developer.symbian.org/wiki/index.php/HTI_Tool
-#if>
-
-Test source components
--------------------------
-
-Test source usually lives in a component's ``tsrc`` directory. Test source components are created like any other Symbian SW component;
-there is a ``group`` directory with a ``bld.inf`` file for building, ``.mmp`` files for defining the targets, and so on.
-
-The test generation code expects ``.pkg`` file in the ``group`` directory of test component to be compiled, to get the paths of the files
-(can be data, configuration, initialization, etc files) to be installed and where to install on the phone.
-
-
-Three STEPS to setup ATS with Helium
---------------------------------------
-
-**Step 1: Configure System Definition Files**
- If the tsrc directory structure meets the criteria defined in the `new API test automation guidelines`_, then test components
- should be included in the System Definition files.
-
-**System Definition Files supporting layers.sysdef.xml**
- **layers** in ``layers.sysdef.xml`` file and **configuration** in ``build.sysdef.xml`` file (`Structure of System Definition files version 1.4`_).
-
- <#if !(ant?keys?seq_contains("sf"))>
-.. _`new API test automation guidelines`: http://s60wiki.nokia.com/S60Wiki/Test_Asset_Guidelines
-.. _`Structure of System Definition files version 1.4`: http://delivery.nmp.nokia.com/trac/helium/wiki/SystemDefinitionFiles
-#if>
-
-A template of layer in layers.sysdef.xml for system definition files
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
-* Layer name should end with **_test_layer**
-* Two standard names for ATS test layers are being used; ``unit_test_layer`` and ``api_test_layer``. Test components (the``unit`` tags)
- should be specified under these layers and grouped by ``module`` tag(s).
-* In the above, two modules means two drop files will be created; ``module`` may have one or more ``unit``
-* By using property ``exclude.test.layers``, complete layers can be excluded and the components inside that layer will not be included in the AtsDrop. This property is a comma (,) separated list
-
-**System Definition Files version 3.0 (SysDefs3)** (new Helium v.10.79)
- The `structure of System Definition files version 3.0`_ is different than previous versions of system definition files. In SysDefs3, package definition files are used for components specification. Instead of layers naming conventions, filters are used to identify test components and test types, for example: "test, unit_test, !api_test" etc.
-
-<#if !(ant?keys?seq_contains("sf"))>
-.. _`structure of System Definition files version 3.0`: http://wikis.in.nokia.com/view/SWManageabilityTeamWiki/PkgdefUse
-<#else>
-.. _`structure of System Definition files version 3.0`: sysdef3.rst
-#if>
-
-An example template for defining test components in a package definition file.
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-* Filter "test" must be specified for every test component. If it is not specified, the component will not be considered as a test component.
-* / are now used to group test components, it work in the same way as ... in sysdef v1.4 works. The components having same group name are grouped together.
- Separate drop files are created for different groups. In the above example, if only 'test' is selected, then two drop files will be created, one with tc1 and the other one with tc2 and tc3.
-
-
-**Step 2: Configure ATS properties in build.xml**
-
-**(A)** Username and Password for the ATS should be set in the `.netrc file`_::
-
- machine ats login ats_user_name password ats_password
-
-Add the above line in the ``.netrc`` file and replace ``ats_user_name`` with your real ATS username and ``ats_password`` with ATS password.
-
-**(B)** The following properties are ATS dependent with their edit status
-
-* [must] - must be set by user
-* [recommended] - should be set by user but not mandatory
-* [allowed] - should **not** be set by user however, it is possible.
-
-.. csv-table:: ATS Ant properties
- :header: "Property name", "Edit status", "Description"
-
- ":hlm-p:`ats.server`", "[must]", "For example: ``4fix012345`` or ``catstresrv001.company.net:80``. Default server port is ``8080``, but it is not allowed between intra and Noklab. Because of this we need to define server port as 80. The host can be different depending on site and/or product."
- ":hlm-p:`ats.drop.location`", "[allowed]", "Server location (UNC path) to save the ATSDrop file, before sending to the ATS Server. For example: ``\\\\trwsem00\\some_folder\\``. In case, :hlm-p:`ats.script.type` is set to ``import``, ATS doesn't need to have access to :hlm-p:`ats.drop.location`, its value can be any local folder on build machine, for example ``c:/temp`` (no network share needed)."
- ":hlm-p:`ats.product.name`", "[must]", "Name of the product to be tested."
- ":hlm-p:`eunit.test.package`", "[allowed]", "The EUnit package name to be unzipped on the environment, for executing EUnit tests."
- ":hlm-p:`eunitexerunner.flags`", "[allowed]", "Flags for EUnit exerunner can be set by setting the value of this variable. The default flags are set to ``/E S60AppEnv /R Off``."
- ":hlm-p:`ats.email.list`", "[allowed]", "The property is needed if you want to get an email from ATS server after the tests are executed. There can be one to many semicolon-separated email addresses."
- ":hlm-p:`ats.report.type`", "[allowed]", "Value of the ats email report, for ATS4 set to 'no_attachment' so email size is reduced"
- ":hlm-p:`ats.flashfiles.minlimit`", "[allowed]", "Limit of minimum number of flash files to execute :hlm-t:`ats-test` target, otherwise ``ATSDrop.zip`` will not be generated. Default value is 2 files."
- ":hlm-p:`ats.plan.name`", "[allowed]", "Modify the plan name if you have understanding of ``test.xml`` file or leave it as it is. Default value is ``plan``."
- ":hlm-p:`ats.product.hwid`", "[allowed]", "Product HardWare ID (HWID) attached to ATS. By default the value of HWID is not set."
- ":hlm-p:`ats.script.type`", "[allowed]", "There are two types of ats script files to send drop to ATS server, ``runx`` and ``import``; only difference is that with ``import`` ATS doesn't have to have access rights to ``testdrop.zip`` file, as it is sent to the system over http and import doesn't need network shares. If that is not needed ``import`` should not be used. Default value is ``runx`` as ``import`` involves heavy processing on ATS server."
- ":hlm-p:`ats.target.platform`", "[allowed]", "Sets target platform for compiling test components. Default value is ``armv5 urel``."
- ":hlm-p:`ats.test.timeout`", "[allowed]", "To set test commands execution time limit on ATS server, in seconds. Default value is ``60``."
- ":hlm-p:`ats.testrun.name`", "[allowed]", "Modify the test-run name if you have understanding of ``test.xml`` file or leave it as it is. Default value is a string consist of build id, product name, major and minor versions."
- ":hlm-p:`ats.trace.enabled`", "[allowed]", "Should be ``true`` if tracing is needed during the tests running on ATS. Default value is ``false``, the values are case-sensitive. See http://s60wiki.nokia.com/S60Wiki/CATS/TraceTools."
- ":hlm-p:`ats.ctc.enabled`", "[allowed]", "Should be ``true`` if coverage measurement and dynamic analysis (CTC) tool support is to be used by ATS. Default value is ``false``. The values are case-sensitive."
- ":hlm-p:`ats.ctc.host`", "[allowed]", "CTC host, provided by CATS used to create coverage measurement reports. MON.sym files are copied to this location, for example ``10.0.0.1``. If not given, code coverage reports are not created"
- ":hlm-p:`ats.obey.pkgfiles.rule`", "[allowed]", "If the property is set to ``true``, then the only test components which will have PKG files, will be included into the ``test.xml`` as a test-set. Which means, even if there's a test component (executable) but there's no PKG file, it should not be considered as a test component and hence not included into the test.xml as a separate test. By default the property value is ``false``."
- "``reference.ats.flash.images``", "[allowed]", "Fileset for list of flash images (can be .fpsx, .C00, .V01 etc) It is recommended to set the fileset, default filset is given below which can be overwritten. set *dir=""* attribute of the filset to ``${r'$'}{build.output.dir}/variant_images`` if hlm-t:`variant-image-creation` target is being used."
- ":hlm-p:`tsrc.data.dir`", "[allowed]", "The default value is ``data`` and refers to the 'data' directory under 'tsrc' directory."
- ":hlm-p:`tsrc.path.list`", "[allowed]", "Contains list of the tsrc directories. Gets the list from system definition layer files. Assuming that the test components are defined already in te ``layers.sysdef.xml`` files to get compiled. Not recommended, but the property value can be set if there are no System Definition file(s), and tsrc directories paths to set manually."
- ":hlm-p:`ats.report.location`", "[allowed]", "Sets ATS reports store location. Default location is ``${r'$'}{publish.dir}/${r'$'}{publish.subdir}``."
- ":hlm-p:`ats.multiset.enabled`", "[allowed]", "Should be ``true`` so a set is used for each pkg file in a component, this allows tests to run in parallel on several devices."
- ":hlm-p:`ats.diamonds.signal`", "[allowed]", "Should be ``true`` so at end of the build diamonds is checked for test results and Helium fails if tests failed."
- ":hlm-p:`ats.delta.enabled`", "[allowed]", "Should be ``true`` so only ADOs changed during :hlm-t:`do-prep-work-area` are tested by ATS."
- ":hlm-p:`ats4.enabled`", "[allowed]", "Should be ``true`` if ATS4 is to be used."
- ":hlm-p:`ats.emulator.enable`", "[allowed]", "Should be ``true`` if ``WINSCW`` emulator is to be used."
- ":hlm-p:`ats.specific.pkg`", "[allowed]", "Text in name of PKG files to use eg. 'sanity' would only use xxxsanity.pkg files from components."
- ":hlm-p:`ats.singledrop.enabled`", "[allowed]", "If present and set to 'true', it will create one drop file, if set to any other value or not present it will create multiple drop files (defined by the sysdef file). This is to save traffic to the server."
- ":hlm-p:`ats.java.importer.enabled`", "[allowed]", "If set to 'true', for older uploader is used for ats3 which shows improved error message."
- ":hlm-p:`ats.test.filterset`", "[allowed]", "(new Helium v.10.79)Contains a name of test filterset (see example below). A filterset is used to select/unselect test components. The filter(s) is/are effective when the same filters are defined in the package definition file for component(s)."
-
-An example of setting up properties:
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ...
-
- ...
-
-
-
-
-
-
-
-
-.. Note::
-
- Always declare *Properties* before and *filesets* after importing helium.ant.xml.
-
-**STEP 3: Call target ats-test**
-
-To execute the target, a property should be set(`` ``).
-
-Then call :hlm-t:`ats-test`, which will create the ATSDrop.zip (test package).
-
-If property *ats.email.list* is set, an email (test report) will be sent when the tests are ready on ATS.
-
-CTC:
-----
-
-CTC code coverage measurements reports can be created as part of Test Automation process.
-
-1. Build the src using ``build_ctc`` configuration, which is in ``build.sysdef.xml`` file, to create ``MON.sym`` files. It means that a property ``sysdef.configurations.list`` should be modified either add or replace current build configuration with ``build_ctc``
-
-2. Set the property, ``ats.ctc.host``, as described above, for sending the ``MON.sym`` files to the network drive. *(Please contact ATS server administrator and ask for the value to set this property)*
-
-3. Enable CTC process by setting up property ``ats.ctc.enabled`` to "true"
-
-4. Test drops are sent to the ATS server, where, after executing tests ``ctcdata.txt`` files are created. ``ctcdata.txt`` and ``MON.sym`` files are then further processed to create code coverage reports.
-
-5. View or download the Code coverage reports by following the link provided in the ATS report email (sent after the tests are executed on ATS)
-
-*NOTE: After receiving the email notification, it may take a few minutes before the code coverage reports are available.*
-
-
-Qt Tests:
----------
-
-QtTest.lib is supported and the default harness is set to EUnit. If ``QtTest.lib`` is there in ``.mmp`` file, Helium sets the Harness to Eunit and ATS supported Qt steps are added to test.xml file
-
-In ``layers.sysdef.xml`` file, the layer name should end with "_test_layer" e.g. "qt_unit_test_layer".
-
-There are several ``.PKG`` files created after executing ``qmake``, but only one is selected based on which target platform is set. Please read the property (``ats.target.platform``) description above.
-
-.. _`Skip-Sending-AtsDrop-label`:
-
-Skip Sending AtsDrop to ATS
-----------------------------
-
-By setting property of ``ats.upload.enabled`` to ``false``, ``ats-test`` target only creates a drop file, and does not send the drop (or package) to ATS server.
-
-Customizing the test.xml in ATS
---------------------------------
-
-The user can customize the generated test.xml with files:
-
-* **preset_custom.xml** goes before first set
-* **postset_custom.xml** goes after last set
-* **precase_custom.xml** goes before first case
-* **postcase_custom.xml** goes after last case
-* **prestep_custom.xml** goes before first step
-* **poststep_custom.xml** goes after last step
-* **prerun_custom.xml** goes before first run or execute step
-* **postrun_custom.xml** goes after last run or execute step
-* **prepostaction.xml** goes before first postaction
-* **postpostaction.xml** goes after last postaction
-
-The files must be in the directory 'custom' under the 'tsrc' or 'group' folder to be processed.
-
-The files need to be proper XML snippets that fit to their place. In case of an error an error is logged and a comment inserted to the generated XML file.
-
-A postaction section customization file (prepostaction.xml or postpostaction.xml) could look like this
-
-.. code-block:: xml
-
-
- Pre PostAction from custom file
-
-
-
-
-
-
-
-The ``prestep_custom.xml`` can be used to flash and unstall something custom.
-
-.. code-block:: xml
-
-
-
- install
-
-
-
-
- ...
-
-
-
-And then the ``prerun_custom.xml`` can be used to start measuring.
-
-.. code-block:: xml
-
-
-
- execute
-
-
-
-
-
-
-
-
-
-**Note:** The users is expected to check the generated test.xml manually, as there is no validation. Invalid XML input files will be disregarded and a comment will be inserted to the generated XML file.
-
-Overriding Test xml values
---------------------------
-
-Set the property ``ats.config.file`` to the location of the config file.
-
-Example configuration:
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-.. index::
- single: ATS - ASTE
-
-Stage: ATS - ASTE
-===================
-
-Explanation of the process for getting ATS `ASTE`_ tests compiled and executed by Helium, through the use of the :hlm-t:`ats-aste` target.
-
-<#if !(ant?keys?seq_contains("sf"))>
-.. _`ASTE`: http://s60wiki.nokia.com/S60Wiki/ASTE
-#if>
-
-Prerequisites
---------------
-
-* `Harmonized Test Interface (HTI)`_ needs to be compiled and into the image.
-* The reader is expected to already have a working ATS setup in which test cases can be executed. ATS server names, access rights and authentication etc. is supposed to be already taken care of.
-* `SW Test Asset`_ location and type of test should be known.
-
-<#if !(ant?keys?seq_contains("sf"))>
-.. _`Harmonized Test Interface (HTI)`: http://s60wiki.nokia.com/S60Wiki/HTI
-.. _`SW Test Asset`: http://s60wiki.nokia.com/S60Wiki/MC_SW_Test_Asset_documentation
-#if>
-
-Test source components
---------------------------
-
-Unlike STIF, EUnit etc tests, test source components (or ``tsrc`` structure) is not needed for `ASTE`_ tests.
-
-Two STEPS to setup ASTE with Helium
-------------------------------------
-
-**STEP 1: Configure ASTE properties in build.xml**
-
-**(A)** Username and Password for the ATS should be set in the `.netrc file`_
-
-.. code-block:: text
-
- machine ats login ats_user_name password ats_password
-
-Add the above line in the .netrc file and replace *ats_user_name* with your real ats username and "ats_password" with ats password.
-
-.. _`.netrc file`: configuring.html?highlight=netrc#passwords
-
-
-**(B)** The following properties are ASTE dependent with their edit status
-
-* [must] - must be set by user
-* [recommended] - should be set by user but not mandatory
-* [allowed] - should **not** be set by user however, it is possible.
-
-.. csv-table:: ATS Ant properties
- :header: "Property name", "Edit status", "Description"
-
- ":hlm-p:`ats.server`", "[must]", "For example: ``4fio00105`` or ``catstresrv001.company.net:80``. Default server port is ``8080``, but it is not allowed between intra and Noklab. Because of this we need to define server port as ``80``. The host can be different depending on site and/or product."
- ":hlm-p:`ats.drop.location`", "[must]", "Server location (UNC path) to save the ATSDrop file, before sending to the ATS. For example: ``\\\\trwsem00\\some_folder\\``. In case, ``ats.script.type`` is set to ``import``, ATS doesn't need to have access to :hlm-p:`ats.drop.location`, its value can be any local folder on build machine, for example ``c:/temp`` (no network share needed)."
- ":hlm-p:`ats.product.name`", "[must]", "Name of the product to be tested."
- ":hlm-p:`ats.aste.testasset.location`", "[must]", "Location of SW Test Assets, if the TestAsset is not packaged then it is first compressed to a ``.zip`` file. It should be a UNC path."
- ":hlm-p:`ats.aste.software.release`", "[must]", "Flash images releases, for example 'SPP 51.32'."
- ":hlm-p:`ats.aste.software.version`", "[must]", "Version of the software to be tested. For example: 'W810'"
- ":hlm-p:`ats.aste.email.list`", "[recommended]", "The property is needed if you want to get an email from ATS server after the tests are executed. There can be one to many semicolon(s) ";" separated email addresses."
- ":hlm-p:`ats.flashfiles.minlimit`", "[recommended]", "Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files."
- ":hlm-p:`ats.aste.plan.name`", "[recommended]", "Modify the plan name if you have understanding of test.xml file or leave it as it is. Default value is "plan"."
- ":hlm-p:`ats.product.hwid`", "[recommended]", "Product HardWare ID (HWID) attached to ATS. By default the value of HWID is not set."
- ":hlm-p:`ats.test.timeout`", "[recommended]", "To set test commands execution time limit on ATS server, in seconds. Default value is '60'."
- ":hlm-p:`ats.aste.testrun.name`", "[recommended]", "Modify the test-run name if you have understanding of ``test.xml`` file or leave it as it is. Default value is a string consists of build id, product name, major and minor versions."
- ":hlm-p:`ats.aste.test.type`", "[recommended]", "Type of test to run. Default is 'smoke'."
- ":hlm-p:`ats.aste.testasset.caseids`", "[recommended]", "These are the cases that which tests should be run from the TestAsset. For example, value can be set as ``100,101,102,103,105,106,``. A comma is needed to separate case IDs"
- ":hlm-p:`ats.aste.language`", "[recommended]", "Variant Language to be tested. Default is 'English'"
- "``reference.ats.flash.images``", "[recommended]", "Fileset for list of flash images (can be .fpsx, .C00, .V01 etc) It is recommended to set the fileset, default filset is given below which can be overwritten. set *dir=\"\"* attribute of the filset to ``${r'$'}{build.output.dir}/variant_images`` if :hlm-t:`variant-image-creation` target is being used."
-
-
-An example of setting up properties:
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ...
-
- ...
-
-
-
-
-
-
-
-
-*PLEASE NOTE:* Always declare *Properties* before and *filesets* after importing helium.ant.xml.
-
-**STEP 2: Call target ats-aste**
-
-To execute the target, a property should be set(`` ``).
-
-Then call :hlm-t:`ats-aste`, which will create the ATSDrop.zip (test package).
-
-If property ``ats.aste.email.list`` is set, an email (test report) will be sent when the tests are ready on ATS/ASTE.
-
-
-Skip Sending AtsDrop to ATS
-------------------------------
-
-click :ref:`Skip-Sending-AtsDrop-label`:
-
-Stage: ATS - Custom Drop
-========================
-
-If you need to send a static drop to ATS then you can call the target :hlm-t:`ats-custom-drop` and set a property to your own template.
-
-A example template is in helium/tools/testing/ats/templates/ats4_naviengine_template.xml
-
-.. code-block:: xml
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_ats_old.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/src/manual/stage_ats_old.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,563 @@
+.. ============================================================================
+ Name : stage_ats_old.rst.ftl
+ Part of : Helium
+
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ ============================================================================
+
+.. index::
+ module: TestingOld
+
+
+===========================
+Testing (ATS3/Old Document)
+===========================
+
+This is an old version of document for test automation for the **Helium users using ATS3**.
+
+**ATS4 users** should read `Helium Test Automation User Guide`_ (revised).
+
+.. _`Helium Test Automation User Guide`: stage_ats.html
+
+.. contents::
+
+
+Stage: ATS - STIF, TEF, RTEST, MTF, SUT and EUnit (also Qt)
+===========================================================
+
+ATS testing is the automatic testing of the phone code once it has been compiled and linked to create a ROM image.
+
+Explanation of the process for getting ATS (`STIF`_ and `EUnit`_) tests compiled and executed by Helium, through the use of the :hlm-t:`ats-test` target.
+
+http://developer.symbian.org/wiki/index.php/Symbian_Test_Tools
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`STIF`: http://s60wiki.nokia.com/S60Wiki/STIF
+.. _`EUnit`: http://s60wiki.nokia.com/S60Wiki/EUnit
+#if>
+
+.. image:: ats.dot.png
+
+Prerequisites
+-------------
+
+* `Harmonized Test Interface (HTI)`_ needs to be compiled and into the image.
+* The reader is expected to already have a working ATS setup in which test cases can be executed. ATS server names,
+ access rights and authentication etc. is supposed to be already taken care of.
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`Harmonized Test Interface (HTI)`: http://s60wiki.nokia.com/S60Wiki/HTI
+<#else>
+.. _`Harmonized Test Interface (HTI)`: http://developer.symbian.org/wiki/index.php/HTI_Tool
+#if>
+
+Test source components
+----------------------
+
+Test source usually lives in a component's ``tsrc`` directory. Test source components are created like any other Symbian SW component;
+there is a ``group`` directory with a ``bld.inf`` file for building, ``.mmp`` files for defining the targets, and so on.
+
+The test generation code expects ``.pkg`` file in the ``group`` directory of test component to be compiled, to get the paths of the files
+(can be data, configuration, initialization, etc files) to be installed and where to install on the phone.
+
+
+Three STEPS to setup ATS with Helium
+------------------------------------
+
+**Step 1: Configure System Definition Files**
+ If the tsrc directory structure meets the criteria defined in the `new API test automation guidelines`_, then test components
+ should be included in the System Definition files.
+
+**System Definition Files supporting layers.sysdef.xml**
+ **layers** in ``layers.sysdef.xml`` file and **configuration** in ``build.sysdef.xml`` file (`Structure of System Definition files version 1.4`_).
+
+ <#if !(ant?keys?seq_contains("sf"))>
+.. _`new API test automation guidelines`: http://s60wiki.nokia.com/S60Wiki/Test_Asset_Guidelines
+.. _`Structure of System Definition files version 1.4`: http://delivery.nmp.nokia.com/trac/helium/wiki/SystemDefinitionFiles
+#if>
+
+A template of layer in layers.sysdef.xml for system definition files
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+* Layer name should end with **_test_layer**
+* Two standard names for ATS test layers are being used; ``unit_test_layer`` and ``api_test_layer``. Test components (the``unit`` tags)
+ should be specified under these layers and grouped by ``module`` tag(s).
+* In the above, two modules means two drop files will be created; ``module`` may have one or more ``unit``
+* By using property ``exclude.test.layers``, complete layers can be excluded and the components inside that layer will not be included in the AtsDrop. This property is a comma (,) separated list
+
+**System Definition Files version 3.0 (SysDefs3)** (new Helium v.10.79)
+ The `structure of System Definition files version 3.0`_ is different than previous versions of system definition files. In SysDefs3, package definition files are used for components specification. Instead of layers naming conventions, filters are used to identify test components and test types, for example: "test, unit_test, !api_test" etc.
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`structure of System Definition files version 3.0`: http://wikis.in.nokia.com/view/SWManageabilityTeamWiki/PkgdefUse
+<#else>
+.. _`structure of System Definition files version 3.0`: sysdef3.html
+#if>
+
+An example template for defining test components in a package definition file.
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+* Filter "test" must be specified for every test component. If it is not specified, the component will not be considered as a test component.
+* / are now used to group test components, it work in the same way as ... in sysdef v1.4 works. The components having same group name are grouped together.
+ Separate drop files are created for different groups. In the above example, if only 'test' is selected, then two drop files will be created, one with tc1 and the other one with tc2 and tc3.
+
+
+**Step 2: Configure ATS properties in build.xml**
+
+**(A)** Username and Password for the ATS should be set in the `.netrc file`_::
+
+ machine ats login ats_user_name password ats_password
+
+Add the above line in the ``.netrc`` file and replace ``ats_user_name`` with your real ATS username and ``ats_password`` with ATS password.
+
+**(B)** The following properties are ATS dependent with their edit status
+
+* [must] - must be set by user
+* [recommended] - should be set by user but not mandatory
+* [allowed] - should **not** be set by user however, it is possible.
+
+.. csv-table:: ATS Ant properties
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`ats.server`", "[must]", "For example: ``4fix012345`` or ``catstresrv001.company.net:80``. Default server port is ``8080``, but it is not allowed between intra and Noklab. Because of this we need to define server port as 80. The host can be different depending on site and/or product."
+ ":hlm-p:`ats.drop.location`", "[allowed]", "Server location (UNC path) to save the ATSDrop file, before sending to the ATS Server. For example: ``\\\\trwsem00\\some_folder\\``. In case, :hlm-p:`ats.script.type` is set to ``import``, ATS doesn't need to have access to :hlm-p:`ats.drop.location`, its value can be any local folder on build machine, for example ``c:/temp`` (no network share needed)."
+ ":hlm-p:`ats.product.name`", "[must]", "Name of the product to be tested."
+ ":hlm-p:`eunit.test.package`", "[allowed]", "The EUnit package name to be unzipped on the environment, for executing EUnit tests."
+ ":hlm-p:`eunitexerunner.flags`", "[allowed]", "Flags for EUnit exerunner can be set by setting the value of this variable. The default flags are set to ``/E S60AppEnv /R Off``."
+ ":hlm-p:`ats.email.list`", "[allowed]", "The property is needed if you want to get an email from ATS server after the tests are executed. There can be one to many semicolon-separated email addresses."
+ ":hlm-p:`ats.report.type`", "[allowed]", "Value of the ats email report, for ATS4 set to 'no_attachment' so email size is reduced"
+ ":hlm-p:`ats.flashfiles.minlimit`", "[allowed]", "Limit of minimum number of flash files to execute :hlm-t:`ats-test` target, otherwise ``ATSDrop.zip`` will not be generated. Default value is 2 files."
+ ":hlm-p:`ats.plan.name`", "[allowed]", "Modify the plan name if you have understanding of ``test.xml`` file or leave it as it is. Default value is ``plan``."
+ ":hlm-p:`ats.product.hwid`", "[allowed]", "Product HardWare ID (HWID) attached to ATS. By default the value of HWID is not set."
+ ":hlm-p:`ats.script.type`", "[allowed]", "There are two types of ats script files to send drop to ATS server, ``runx`` and ``import``; only difference is that with ``import`` ATS doesn't have to have access rights to ``testdrop.zip`` file, as it is sent to the system over http and import doesn't need network shares. If that is not needed ``import`` should not be used. Default value is ``runx`` as ``import`` involves heavy processing on ATS server."
+ ":hlm-p:`ats.target.platform`", "[allowed]", "Sets target platform for compiling test components. Default value is ``armv5 urel``."
+ ":hlm-p:`ats.test.timeout`", "[allowed]", "To set test commands execution time limit on ATS server, in seconds. Default value is ``60``."
+ ":hlm-p:`ats.testrun.name`", "[allowed]", "Modify the test-run name if you have understanding of ``test.xml`` file or leave it as it is. Default value is a string consist of build id, product name, major and minor versions."
+ ":hlm-p:`ats.trace.enabled`", "[allowed]", "Should be ``true`` if tracing is needed during the tests running on ATS. Default value is ``false``, the values are case-sensitive. See http://s60wiki.nokia.com/S60Wiki/CATS/TraceTools."
+ ":hlm-p:`ats.ctc.enabled`", "[allowed]", "Should be ``true`` if coverage measurement and dynamic analysis (CTC) tool support is to be used by ATS. Default value is ``false``. The values are case-sensitive."
+ ":hlm-p:`ats.ctc.host`", "[allowed]", "ATS3 only CTC host, provided by CATS used to create coverage measurement reports. MON.sym files are copied to this location, for example ``10.0.0.1``. If not given, code coverage reports are not created"
+ ":hlm-p:`ats.obey.pkgfiles.rule`", "[allowed]", "If the property is set to ``true``, then the only test components which will have PKG files, will be included into the ``test.xml`` as a test-set. Which means, even if there's a test component (executable) but there's no PKG file, it should not be considered as a test component and hence not included into the test.xml as a separate test. By default the property value is ``false``."
+ ":hlm-p:`tsrc.data.dir`", "[allowed]", "The default value is ``data`` and refers to the 'data' directory under 'tsrc' directory."
+ ":hlm-p:`tsrc.path.list`", "[allowed]", "Contains list of the tsrc directories. Gets the list from system definition layer files. Assuming that the test components are defined already in te ``layers.sysdef.xml`` files to get compiled. Not recommended, but the property value can be set if there are no System Definition file(s), and tsrc directories paths to set manually."
+ ":hlm-p:`ats.report.location`", "[allowed]", "Sets ATS reports store location. Default location is ``${r'$'}{publish.dir}/${r'$'}{publish.subdir}``."
+ ":hlm-p:`ats.multiset.enabled`", "[allowed]", "Should be ``true`` so a set is used for each pkg file in a component, this allows tests to run in parallel on several devices."
+ ":hlm-p:`ats.diamonds.signal`", "[allowed]", "Should be ``true`` so at end of the build diamonds is checked for test results and Helium fails if tests failed."
+ ":hlm-p:`ats.delta.enabled`", "[allowed]", "Should be ``true`` so only ADOs changed during :hlm-t:`do-prep-work-area` are tested by ATS."
+ ":hlm-p:`ats4.enabled`", "[allowed]", "Should be ``true`` if ATS4 is to be used."
+ ":hlm-p:`ats.emulator.enable`", "[allowed]", "Should be ``true`` if ``WINSCW`` emulator is to be used."
+ ":hlm-p:`ats.specific.pkg`", "[allowed]", "Text in name of PKG files to use eg. 'sanity' would only use xxxsanity.pkg files from components."
+ ":hlm-p:`ats.singledrop.enabled`", "[allowed]", "If present and set to 'true', it will create one drop file, if set to any other value or not present it will create multiple drop files (defined by the sysdef file). This is to save traffic to the server."
+ ":hlm-p:`ats.java.importer.enabled`", "[allowed]", "If set to 'true', for older uploader is used for ats3 which shows improved error message."
+ ":hlm-p:`ats.test.filterset`", "[allowed]", "(new Helium v.10.79)Contains a name of test filterset (see example below). A filterset is used to select/unselect test components. The filter(s) is/are effective when the same filters are defined in the package definition file for component(s)."
+
+An example of setting up properties:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. Note::
+
+ Always declare *Properties* before and *filesets* after importing helium.ant.xml.
+
+**STEP 3: Call target ats-test**
+
+To execute the target, a property should be set(`` ``).
+
+Then call :hlm-t:`ats-test`, which will create the ATSDrop.zip (test package).
+
+If property *ats.email.list* is set, an email (test report) will be sent when the tests are ready on ATS.
+
+CTC
+---
+
+* To enable ctc for ATS set, :hlm-p:`ats.ctc.enabled`.
+
+For ATS3 only, set the ftp hostname for the ATS server:
+
+.. code-block:: xml
+
+
+
+
+* To compile components for CTC see `configure CTC for SBS`_
+
+.. _`configure CTC for SBS`: ../helium-antlib/sbsctc.html
+
+
+* Once ATS tests have finished results for CTC will be shown in Diamonds.
+* The following are optional CTC properties
+
+.. csv-table:: Table: ATS Ant properties
+ :header: "Property name", "Edit status", "Description"
+
+ "``ctc.instrument.type``", "[allowed]", "Sets the instrument type"
+ "``ctc.build.options``", "[allowed]", "Enables optional extra arguments for CTC, after importing a parent ant file."
+
+
+For example,
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+Or
+
+.. code-block:: xml
+
+
+
+
+
+
+See `more information on code coverage`_
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`more information on code coverage`: http://s60wiki.nokia.com/S60Wiki/CTC
+<#else>
+.. _`more information on code coverage`: http://developer.symbian.org/wiki/index.php/Testing_Guidelines_for_Package_Releases#Code_coverage
+#if>
+
+
+
+
+
+
+
+Qt Tests
+--------
+
+QtTest.lib is supported and the default harness is set to EUnit. If ``QtTest.lib`` is there in ``.mmp`` file, Helium sets the Harness to Eunit and ATS supported Qt steps are added to test.xml file
+
+In ``layers.sysdef.xml`` file, the layer name should end with "_test_layer" e.g. "qt_unit_test_layer".
+
+There are several ``.PKG`` files created after executing ``qmake``, but only one is selected based on which target platform is set. Please read the property (:hlm-p:`ats.target.platform`) description above.
+
+.. _`Skip-Sending-AtsDrop-label`:
+
+Skip Sending AtsDrop to ATS
+---------------------------
+
+By setting property of :hlm-p:`ats.upload.enabled` to ``false``, ``ats-test`` target only creates a drop file, and does not send the drop (or package) to ATS server.
+
+Choosing images to send to ATS
+------------------------------
+
+Since helium 10 images are picked up using :hlm-p:`ats.product.name` and Imaker iconfig.xml files. ``release.images.dir`` is searched for iconfig.xml files, the ones where the product name is part of :hlm-p:`ats.product.name` is used.
+
+You should only build the images for each product you want to include in ats. Eg.
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+For older products where there are no iconfig.xml, ``reference.ats.flash.images`` is used:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+Customizing the test.xml in ATS
+-------------------------------
+
+The user can customize the generated test.xml with files:
+
+* **preset_custom.xml** goes before first set
+* **postset_custom.xml** goes after last set
+* **precase_custom.xml** goes before first case
+* **postcase_custom.xml** goes after last case
+* **prestep_custom.xml** goes before first step
+* **poststep_custom.xml** goes after last step
+* **prerun_custom.xml** goes before first run or execute step
+* **postrun_custom.xml** goes after last run or execute step
+* **prepostaction.xml** goes before first postaction
+* **postpostaction.xml** goes after last postaction
+
+The files must be in the directory 'custom' under the 'tsrc' or 'group' folder to be processed.
+
+The files need to be proper XML snippets that fit to their place. In case of an error an error is logged and a comment inserted to the generated XML file.
+
+A postaction section customization file (prepostaction.xml or postpostaction.xml) could look like this
+
+.. code-block:: xml
+
+
+ Pre PostAction from custom file
+
+
+
+
+
+
+
+The ``prestep_custom.xml`` can be used to flash and unstall something custom.
+
+.. code-block:: xml
+
+
+
+ install
+
+
+
+
+ ...
+
+
+
+And then the ``prerun_custom.xml`` can be used to start measuring.
+
+.. code-block:: xml
+
+
+
+ execute
+
+
+
+
+
+
+
+
+
+**Note:** The users is expected to check the generated test.xml manually, as there is no validation. Invalid XML input files will be disregarded and a comment will be inserted to the generated XML file.
+
+Overriding Test xml values
+--------------------------
+
+Set the property ``ats.config.file`` to the location of the config file.
+
+Example configuration:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. index::
+ single: ATS - ASTE
+
+Stage: ATS - ASTE
+=================
+
+Explanation of the process for getting ATS `ASTE`_ tests compiled and executed by Helium, through the use of the :hlm-t:`ats-aste` target.
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`ASTE`: http://s60wiki.nokia.com/S60Wiki/ASTE
+#if>
+
+Prerequisites
+-------------
+
+* `Harmonized Test Interface (HTI)`_ needs to be compiled and into the image.
+* The reader is expected to already have a working ATS setup in which test cases can be executed. ATS server names, access rights and authentication etc. is supposed to be already taken care of.
+* `SW Test Asset`_ location and type of test should be known.
+
+<#if !(ant?keys?seq_contains("sf"))>
+.. _`Harmonized Test Interface (HTI)`: http://s60wiki.nokia.com/S60Wiki/HTI
+.. _`SW Test Asset`: http://s60wiki.nokia.com/S60Wiki/MC_SW_Test_Asset_documentation
+#if>
+
+Test source components
+----------------------
+
+Unlike STIF, EUnit etc tests, test source components (or ``tsrc`` structure) is not needed for `ASTE`_ tests.
+
+Two STEPS to setup ASTE with Helium
+-----------------------------------
+
+**STEP 1: Configure ASTE properties in build.xml**
+
+**(A)** Username and Password for the ATS should be set in the `.netrc file`_
+
+.. code-block:: text
+
+ machine ats login ats_user_name password ats_password
+
+Add the above line in the .netrc file and replace *ats_user_name* with your real ats username and "ats_password" with ats password.
+
+.. _`.netrc file`: configuring.html?highlight=netrc#passwords
+
+
+**(B)** The following properties are ASTE dependent with their edit status
+
+* [must] - must be set by user
+* [recommended] - should be set by user but not mandatory
+* [allowed] - should **not** be set by user however, it is possible.
+
+.. csv-table:: ATS Ant properties
+ :header: "Property name", "Edit status", "Description"
+
+ ":hlm-p:`ats.server`", "[must]", "For example: ``4fio00105`` or ``catstresrv001.company.net:80``. Default server port is ``8080``, but it is not allowed between intra and Noklab. Because of this we need to define server port as ``80``. The host can be different depending on site and/or product."
+ ":hlm-p:`ats.drop.location`", "[must]", "Server location (UNC path) to save the ATSDrop file, before sending to the ATS. For example: ``\\\\trwsem00\\some_folder\\``. In case, ``ats.script.type`` is set to ``import``, ATS doesn't need to have access to :hlm-p:`ats.drop.location`, its value can be any local folder on build machine, for example ``c:/temp`` (no network share needed)."
+ ":hlm-p:`ats.product.name`", "[must]", "Name of the product to be tested."
+ ":hlm-p:`ats.aste.testasset.location`", "[must]", "Location of SW Test Assets, if the TestAsset is not packaged then it is first compressed to a ``.zip`` file. It should be a UNC path."
+ ":hlm-p:`ats.aste.software.release`", "[must]", "Flash images releases, for example 'SPP 51.32'."
+ ":hlm-p:`ats.aste.software.version`", "[must]", "Version of the software to be tested. For example: 'W810'"
+ ":hlm-p:`ats.aste.email.list`", "[recommended]", "The property is needed if you want to get an email from ATS server after the tests are executed. There can be one to many semicolon(s) ";" separated email addresses."
+ ":hlm-p:`ats.flashfiles.minlimit`", "[recommended]", "Limit of minimum number of flash files to execute ats-test target, otherwise ATSDrop.zip will not be generated. Default value is "2" files."
+ ":hlm-p:`ats.aste.plan.name`", "[recommended]", "Modify the plan name if you have understanding of test.xml file or leave it as it is. Default value is "plan"."
+ ":hlm-p:`ats.product.hwid`", "[recommended]", "Product HardWare ID (HWID) attached to ATS. By default the value of HWID is not set."
+ ":hlm-p:`ats.test.timeout`", "[recommended]", "To set test commands execution time limit on ATS server, in seconds. Default value is '60'."
+ ":hlm-p:`ats.aste.testrun.name`", "[recommended]", "Modify the test-run name if you have understanding of ``test.xml`` file or leave it as it is. Default value is a string consists of build id, product name, major and minor versions."
+ ":hlm-p:`ats.aste.test.type`", "[recommended]", "Type of test to run. Default is 'smoke'."
+ ":hlm-p:`ats.aste.testasset.caseids`", "[recommended]", "These are the cases that which tests should be run from the TestAsset. For example, value can be set as ``100,101,102,103,105,106,``. A comma is needed to separate case IDs"
+ ":hlm-p:`ats.aste.language`", "[recommended]", "Variant Language to be tested. Default is 'English'"
+
+
+An example of setting up properties:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+*PLEASE NOTE:* Always declare *Properties* before and *filesets* after importing helium.ant.xml.
+
+**STEP 2: Call target ats-aste**
+
+To execute the target, a property should be set(`` ``).
+
+Then call :hlm-t:`ats-aste`, which will create the ATSDrop.zip (test package).
+
+If property ``ats.aste.email.list`` is set, an email (test report) will be sent when the tests are ready on ATS/ASTE.
+
+
+Skip Sending AtsDrop to ATS
+---------------------------
+
+click :ref:`Skip-Sending-AtsDrop-label`:
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_final.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_final.rst.inc.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-<#--
-============================================================================
-Name : stage_final.rst.inc.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-
-.. index::
- single: Stage - Final operations
-
-Stage: Final operations
-=======================
-
-Final operation are steps which could happen at the workflow completion.
-
-
-Running a target at build completion
-------------------------------------
-
-Helium offers the possibility to run a final target despite any error which could occur during the build.
-The configuration of the target is done using the **hlm.final.target** property.
-
-e.g:
-::
-
-
-
-
-Running action on failure
--------------------------
-
-The signaling framework will automatically run all signalExceptionConfig in case of Ant failure at the
-end of the build.
-
-This example shows how simple task can be run in case of failure:
-::
-
-
-
-
- Signal: ${r'$'}{signal.name}
- Message: ${r'$'}{signal.message}
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_matti.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_matti.rst.inc.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-<#--
-============================================================================
-Name : stage_matti.rst.inc.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-
-.. index::
- single: MATTI
-
-Stage: MATTI
-=============
-
-MATTI testing is very similar to ATS testing, so for details of how it all links together see :ref:`Stage-ATS-label`: `and the matti website`_.
-
-<#if !(ant?keys?seq_contains("sf"))>
-.. _`and the matti website`: http://trmatti1.nmp.nokia.com/help/
-#if>
-
-The set up of parameters is very similar (a few less parameters and it mostly uses ATS values). The main difference is that once the drop file has been uploaded to the ATS server it uses MATTI to perform the tests (the drop file contains the flash files, the ruby tests/sip profiles, data files, sis files and/or parameters file in xml format).
-
-The following parameters are the ones that are not listed in the ATS parameters, all other parameters required are as listed in the ATS section above, which include :hlm-p:`ats.server`, :hlm-p:`ats.email.list`, :hlm-p:`ats.email.format`, :hlm-p:`ats.email.subject`, :hlm-p:`ats.testrun.name`, :hlm-p:`ats.product.name`, :hlm-p:`ats.flashfiles.minlimit`, :hlm-p:`ats.flash.images` and :hlm-p:`ats.upload.enabled`.
-
-* [must] - must be set by user
-* [recommended] - should be set by user but not mandatory
-* [allowed] - should **not** be set by user however, it is possible.
-
-.. csv-table:: ATS Ant properties
- :header: "Property name", "Edit status", "Description"
-
- ":hlm-p:`matti.enabled`", "[must]", "Enable MATTI testing to occur, if not present the target :hlm-t:`matti-test` will not run."
- ":hlm-p:`matti.asset.location`", "[must]", "The location of the test asset where ruby test files, sip profiles, hardware data etc are located."
- ":hlm-p:`matti.test.profiles`", "[must]", "Test profiles to be executed should be mentioned in this comma separated list e.g., 'bat, fute'."
- ":hlm-p:`matti.sierra.enabled`", "[must]", "Mustbe set to 'true' if sierra is engine is to be used. If true .sip files are used otherwise .rb (ruby) files are used to execute tests-"
- ":hlm-p:`matti.test.timeout`", "[must]", "Separate but similar property to ats.test.timeout for matti tests."
- ":hlm-p:`matti.parameters`", "[must]", "Matti test parameters can be given through Matti parameters xml file."
- ":hlm-p:`matti.sis.files`", "[must]", "There are special sis files required to execute with test execution. This is a comma separated list in which several sis files can be deifned in a certain format like '##' e.g. "
- ":hlm-p:`matti.sierra.parameters`", "[must]", "Sierra parameters are set using this property. e.g. '--teardown --ordered'"
- ":hlm-p:`matti.template.file`", "[allowed]", "Location of the matti template file."
-
-
-All you need to do is setup the following parameters:
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-In order to upload and view the test run you need to have a valid user ID and password that matches that in your ``.netrc`` file. To create the account open a web browser window and enter the name of the ats.server with /ATS at the end e.g. http://123456:80/ATS. Click on the link in the top right hand corner to create the account. To view the test run once your account is active you need to click on the 'test runs' tab.
-
-To run the tests call the target :hlm-t:`matti-test` (you will need to define the :hlm-p:`build.drive`, :hlm-p:`build.number` and it is best to create the :hlm-p:`core.build.version` on the command line as well if you do not add it to the list of targets run that create the ROM image). e.g.
-::
-
- hlm -Dbuild.number=001 -Dbuild.drive=z: -Dcore.build.version=001 matti-test
-
-If it displays the message 'Matti testdrop created successfully!', script has done what it needs to do. The next thing to check is that the drop file has been uploaded to the ATS server OK. If that is performed successfully then the rest of the testing needs to be performed by the ATS server. There is also a ``test.xml`` file created that contains details needed for debugging any problems that might occur. To determine if the tests have run correctly you need to read the test run details from the server.
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_preparation.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_preparation.rst.inc.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/stage_preparation.rst.inc.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -36,24 +36,37 @@
Helium supports the creation of an environment based on a release store in a network drive. The main requirement from that release is to publish release metadata with the content.
-.. csv-table:: Ant properties to modify
+.. csv-table:: Ant properties to modify for Helium 11 and older
+ :header: "Property", "Description", "Values"
+
+ ":hlm-p:`s60.grace.server`", ":hlm-p:`s60.grace.server[summary]`", ":hlm-p:`s60.grace.server[defaultValue]`"
+ ":hlm-p:`s60.grace.service`", ":hlm-p:`s60.grace.service[summary]`", ":hlm-p:`s60.grace.service[defaultValue]`"
+ ":hlm-p:`s60.grace.product`", ":hlm-p:`s60.grace.product[summary]`", ":hlm-p:`s60.grace.product[defaultValue]`"
+ ":hlm-p:`s60.grace.release`", ":hlm-p:`s60.grace.release[summary]`", ":hlm-p:`s60.grace.product[defaultValue]`"
+ ":hlm-p:`s60.grace.revision`", ":hlm-p:`s60.grace.revision[summary]`", ":hlm-p:`s60.grace.revision[defaultValue]`"
+ ":hlm-p:`s60.grace.cache`", ":hlm-p:`s60.grace.cache[summary]`", ":hlm-p:`s60.grace.cache[defaultValue]`"
+ ":hlm-p:`s60.grace.checkmd5.enabled`", ":hlm-p:`s60.grace.checkmd5.enabled[summary]`", ":hlm-p:`s60.grace.checkmd5.enabled[defaultValue]`"
+ ":hlm-p:`s60.grace.usetickler`", ":hlm-p:`s60.grace.usetickler[summary]`", ":hlm-p:`s60.grace.usetickler[defaultValue]`"
+
+
+.. csv-table:: Ant properties to modify for Helium 12
:header: "Property", "Description", "Values"
- ":hlm-p:`s60.grace.server`", "UNC path to network drive.", ""
- ":hlm-p:`s60.grace.service`", "Service name.", ""
- ":hlm-p:`s60.grace.product`", "Product name.", ""
- ":hlm-p:`s60.grace.release`", "Regular expression to match release under the product directory.", ""
- ":hlm-p:`s60.grace.revision`", "Regular expresion to match a new build revision", "e.g: (_\d+)?"
- ":hlm-p:`s60.grace.cache`",
- ":hlm-p:`s60.grace.checkmd5.enabled`",
- ":hlm-p:`s60.grace.usetickler`", "Validate the release based on the tickler.", "true, false(default)"
+ ":hlm-p:`download.release.server`", ":hlm-p:`download.release.server[summary]`", ":hlm-p:`download.release.server[defaultValue]`"
+ ":hlm-p:`download.release.service`", ":hlm-p:`download.release.service[summary]`", ":hlm-p:`download.release.service[defaultValue]`"
+ ":hlm-p:`download.release.product`", ":hlm-p:`download.release.product[summary]`", ":hlm-p:`download.release.product[defaultValue]`"
+ ":hlm-p:`download.release.regex`", ":hlm-p:`download.release.regex[summary]`", ":hlm-p:`download.release.regex[defaultValue]`"
+ ":hlm-p:`download.release.revision`", ":hlm-p:`download.release.revision[summary]`", ":hlm-p:`download.release.revision[defaultValue]`"
+ ":hlm-p:`download.release.cache`", ":hlm-p:`download.release.cache[summary]`", ":hlm-p:`download.release.cache[defaultValue]`"
+ ":hlm-p:`download.release.checkmd5.enabled`", ":hlm-p:`download.release.checkmd5.enabled[summary]`", ":hlm-p:`download.release.checkmd5.enabled[defaultValue]`"
+ ":hlm-p:`download.release.usetickler`", ":hlm-p:`download.release.usetickler[summary]`", ":hlm-p:`download.release.usetickler[defaultValue]`"
-Once configured you can invoke Helium:
+Once configured you can invoke Helium::
- > hlm -Dbuild.number=1 -Dbuild.drive=X: ido-update-build-area-grace
+ hlm -Dbuild.number=1 -Dbuild.drive=X: ido-update-build-area
- > dir X:
- ...
- ...
+You should then have the latest release extracted to the X: drive.
-You should then have the latest/mentioned release un-archived under the X: drive.
\ No newline at end of file
+<#if !ant?keys?seq_contains("sf")>
+.. include:: stage_nokia_preparation.rst.inc
+#if>
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_publishing.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_publishing.rst.inc.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/stage_publishing.rst.inc.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -34,7 +34,7 @@
Diamonds is a utility tool that keeps track of build and release information. See the **Metrics** manual under section `Helium Configuration`_ for more info.
-.. _Helium Configuration: ../metrics.html#helium-configuration
+.. _Helium Configuration: metrics.html#helium-configuration
.. index::
@@ -103,6 +103,7 @@
+
@@ -114,6 +115,7 @@
+
@@ -179,6 +181,8 @@
"``archives.dir``", "The directory where the zip files are saved to.", ""
"``policy.csv``", "This property defines the location of the policy definition file.", ""
"``policy.default.value``", "This property defines the policy value when policy file is missing or invalid (e.g. wrong format).", "9999"
+ "``split.on.uncompressed.size.enabled``", "To enable/disable splitting the zip files depending on source file size.", "true/false"
+
The policy mapper enables the sorting of the content compare to its policy value. The mapper is looking for a policy file in the file to archive directory.
If the distribution policy file is missing then the file will go to the ``policy.default.value`` archive. Else it tries to open the file which
@@ -226,6 +230,9 @@
They support the same set of configuration properties as the default ``policy.remover``.
+<#if !ant?keys?seq_contains("sf")>
+.. include:: stage_metadata.rst.inc
+#if>
.. index::
single: Zipping SUBCON
@@ -233,5 +240,12 @@
Subcon zipping
--------------
-Subcon zipping is also configured using the same XML format as :hlm-t:`zip-ee` and implemented in the :hlm-t:`zip-subcon` target. A :hlm-p:`zips.subcon.spec.name` property must be defined but currently it is still a separate configuration file.
+Subcon zipping is also configured using the same XML format as :hlm-t:`zip-ee` and implemented in the :hlm-t:`zip-subcon` target. A ``zips.subcon.spec.name`` property must be defined but currently it is still a separate configuration file.
+
+Stage: Blocks packaging
+=======================
+
+Refer to the `Blocks integration manual`_
+
+.. _`Blocks intergration manual`: blocks.html
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stage_source_preparation.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_source_preparation.rst.inc.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/stage_source_preparation.rst.inc.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -136,6 +136,10 @@
The following properties are required:
- database: the name of the synergy database you want to use.
+<#if !ant?keys?seq_contains("sf")>
+.. include:: stage_nokia_ccm.rst.inc
+#if>
+
Mercurial
---------
@@ -150,6 +154,8 @@
+<#if !ant?keys?seq_contains("sf")>
For more information see API_
-.. _API: ../helium-antlib/api/doclet/index.SCM.html
+.. _API: ../api/doclet/index.SCM.html
+#if>
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/stages.rst.ftl
--- a/buildframework/helium/doc/src/manual/stages.rst.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/manual/stages.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -23,6 +23,7 @@
.. index::
module: Stages
+
=============
Helium stages
=============
@@ -47,7 +48,7 @@
.. include:: stage_releasing.rst.inc
Stage: Cenrep creation (S60 3.2.3 - 5.x)
-=================================
+========================================
<#if !(ant?keys?seq_contains("sf"))>
See: http://configurationtools.nmp.nokia.com/builds/cone/docs/cli/generate.html?highlight=generate
#if>
@@ -57,7 +58,7 @@
* IDO can use the ido-gen-cenrep to generate the cenreps which are IDO specific.
* We should pass the sysdef.configurations.list as parameter to ido-gen-cenrep target. Else it will use the defualt one of helium.
-Example:
+Example
-------
Below example will generate the cenrep only for IDO specific confml files.
@@ -105,17 +106,35 @@
.. include:: stage_integration.rst.inc
-.. include:: stage_ats.rst.inc
+
+Stage: Testing
+==============
+
+The test sources or test asset is mantained by test developers, who follow certain rules and standards to create the directory/file structure and writing the tests.
-.. include:: stage_matti.rst.inc
+Testing is performed automatically by ATS server which receives a zipped testdrop, containing test.xml file (required by ATS), ROM images, test cases, dlls, executbales and other supporting files. This testdrop is created by Helium Test Automation system.
+
+Read more: `Helium Test Automation User Guide`_
+
+.. _`Helium Test Automation User Guide`: stage_ats.html
-Stage: Check EPL License header.
-=================================
+
+
+
+Stage: Check EPL License header
+===============================
The target ``check-sf-source-header`` could be used to run to validate the source files for EPL license header.
* Include the target ``check-sf-source-header`` in the target sequence.
-* This will validate source files present on the build area to contain EPL license.
+* This will validate source files present on the build area not to contain SFL license.
+* Target could be enabled by setting ``sfvalidate.enabled`` to ``true``.
+
+The target ``ido-check-sf-source-header`` could be used to run to validate the source files for EPL license header for IDO/Package level.
+
+* Include the target ``ido-check-sf-source-header`` in the IDO target sequence.
+* This will validate source files present on the build area to contain EPL license by extracting values from ``distribution.policy.S60`` files.
+* Target could be enabled by setting ``sfvalidate.enabled`` to ``true``.
.. index::
single: Compatibility Analyser (CA)
@@ -123,32 +142,40 @@
Stage: Compatibility Analyser
=============================
-The Compatibility Analyser is a tool used to compare **binary** header and library files to ensure that the version being checked has not made any changes to the interfaces which may cause the code to not work correctly. Helium supplies a target that calls this Compatibility Analyser. Users who wish to use this tool first need to read the CA user guide found under SW DOcMan at: http://bhlns002.apac.nokia.com/symbian/symbiandevdm.nsf/WebAllByID2/DSX05526-EN/s60_compatibility_analyser_users_guide.doc.
+The Compatibility Analyser is a tool used to compare **binary** header and library files to ensure that the version being checked has not made any changes to the interfaces which may cause the code to not work correctly. Helium supplies a target that calls this Compatibility Analyser.
+Users who wish to use this tool first need to read the CA user guide found under: /epoc32/tools/s60rndtools/bctools/doc/S60_Compatibility_Analyser_Users_Guide.doc.
-The Compatibility Analyser is supplied as part of SymSEE, there is a wiki page for the tool found at http://s60wiki.nokia.com/S60Wiki/Compatibility_Analyser. As part of the configuration a default BC template file has been provided at Helium\tools\quality\CompatibilityAnalyser\config_template.txt make the necessary changes to this file (as described in the user guide). The supplied example file works with CA versions 2.0.0 and above which is available in SymSEE version 12.1.0 and above. The configurations that will need changing are:
+<#if !(ant?keys?seq_contains("sf"))>
+The Compatibility Analyser is supplied as part of SymSEE, there is a wiki page for the tool found at: http://s60wiki.nokia.com/S60Wiki/Compatibility_Analyser.
+#if>
+As part of the configuration a default BC template file has been provided at helium/tools/quality/compatibility_analyser/ca.cfg.xml make the necessary changes to this file (as described in the user guide). The supplied example file works with CA versions 2.0.0 and above.
+
+The minimum configurations that will need changing are:
* BASELINE_SDK_DIR
* BASELINE_SDK_S60_VERSION
* CURRENT_SDK_DIR
* REPORT_FILE_HEADERS
* REPORT_FILE_LIBRARIES
-The default configuration is supplied as part of tools\quality\CompatibilityAnalyser\compatibilty.ant.xml where there are a few properties that need to be set (overriding of these is recommended in your own config file):
+The default configuration is supplied as part of tools/quality/compatibility_analyser/compatibilty.ant.xml where there are a few properties that need to be set (overriding of these is recommended in your own config file):
.. csv-table:: Compatibility Analyser Ant properties
:header: "Property name", "Edit status", "Description"
":hlm-p:`ca.enabled`", "[must]", "Enables the bc-check and ca-generate-diamond-summary targets to be executed, when set to true."
- ":hlm-p:`bctools.root`", "[must]", "Place where the CheckBC and FilterBC tools are e.g. C:/APPS/carbide/plugins/com.nokia.s60tools.compatibilityanalyser.corecomponents_2.0.0/BCTools"
- ":hlm-p:`default.bc.config`", "[must]", "Place where the CheckBC default configuration file is, it is copied from this location to the output folder for use by checkBC.py e.g. helium/tools/quality/compatibility_analyser/ca_config_template.txt"
- ":hlm-p:`bc.config.dir`", "[must]", "The bc_config_template.txt file (default configuration file) will be copied from the folder it is saved in within helium to the location named in this property where it will be used ( in conjunction with the bc.config.file property). e.g. build.log.dir/bc"
- ":hlm-p:`bc.config.file`", "[must]", "The bc_config_template.txt file (default configuration file) will be copied from the folder it is saved in within helium to the location named and named as defined in this property where it will be used. You need to make sure this is not the same name as any other IDO or person using the build area. e.g. bc.config.dir/bc.config"
- ":hlm-p:`bc.check.libraries.enabled`", "[must]", "Enables the Binary Comparison for libraries when set to 'true'."
- ":hlm-p:`lib.param.val`", "[must]", "Defines the parameter that checkBC.py is called with -la (all libraries checked) or -ls lib (single library checked) (lib = the name of library to check) or -lm file.name (multiple libraries checked) the file.name is a file that contains the names of the library(ies) to be checked."
- ":hlm-p:`bc.check.headers.enabled`", "[must]", "Enables the Binary Comparison for headers when set to 'true'."
- ":hlm-p:`head.param.val`", "[must]", "Defines the parameter that checkBC.py is called with -ha (all headers checked) or -hs file (single header checked) (file= name of header file to check) or -hm file.name (multiple headers checked) the file.name is a file that contains the names of the header(s) to be checked"
+ ":hlm-p:`bc.prep.ca.file`", "[must]", "The name and location of the file that contains all the CA configuration values like, 'BASELINE_SDK_DIR=C:\Symbian\9.2\S60_3rd_FP1_2': an example file can be found at helium/tools/quality/compatibility_analyser/test/ca.cfg.xml "
+ ":hlm-p:`bc.tools.root`", "[must]", "Place where the CheckBC and FilterBC tools are e.g. /epoc32/tools/s60rndtools/bctools"
+ ":hlm-p:`bc.build.dir`", "[must]", "The place that all the files created during the running of the CA tool will be placed."
+ ":hlm-p:`bc.config.file`", "[must]", "The 'ca.ant.config.file' file (configuration file) will be copied from the folder it is saved in within helium to the location named as defined in this property where it will be used. You need to make sure this is not the same name as any other IDO or person using the build area. e.g. bc.config.dir/bc.config"
+ ":hlm-p:`bc.check.libraries.enabled`", "[must]", "Enables the compatibility analyser for libraries when set to 'true' (default value is 'false')."
+ ":hlm-p:`bc.lib.param.val`", "[optional]", "Defines the parameter that checkBC.py is called with -la (all libraries checked) (default value) or -ls lib (single library checked) (lib = the name of library to check) or -lm file.name (multiple libraries checked) the file.name is a file that contains the names of the library(ies) to be checked. If the 'bc.what.log.entry.enabled' property is set this variable must not be set."
+ ":hlm-p:`bc.check.headers.enabled`", "[must]", "Enables the compatibility analyser for headers when set to 'true' (default value is 'false')."
+ ":hlm-p:`bc.head.param.val`", "[optional]", "Defines the parameter that checkBC.py is called with -ha (all headers checked) (default value) or -hs file (single header checked) (file= name of header file to check) or -hm file.name (multiple headers checked) the file.name is a file that contains the names of the header(s) to be checked. If the 'bc.what.log.entry.enabled' property is set this variable must not be set."
":hlm-p:`bc.check.report.id`", "[must]", "Adds this to the CA output file name to give it a unique name."
- ":hlm-p:`ido.ca.html.output.dir`", "[must]", "Defines the location of CA output and the input for the diamonds creation target. e.g. build.log.dir/build.id_ca"
+ ":hlm-p:`bc.log.file.to.scan`", "[must]", "This must be set if the 'bc.what.log.entry.enabled' property is set otherwise it is not required. It is the name of the log file that was created during the build that will be scanned in order to determine which headers or library files will be compared."
+ ":hlm-p:`bc.what.log.entry.enabled`", "[optional]", "If set to true the 'whatlog' will be scanned for the list of header and/or library files that will be compared. The default is 'false'"
+ ":hlm-p:`bc.fail.on.error`", "[optional]", "If set to true the build will fail if there is an error with the binary compatibility analyser (including the conversion to diamonds XML files). If set to false it will not fail the build if there is a problem with CA."
and then run the target:
@@ -158,8 +185,6 @@
where nnn is the build number and n: is the substed drive letter.
-The results of the output from the analysis are placed in the \output\logs\BC folder under the substed build drive and are called libraries_report_?.xml and headers_report_?.xml, the reports can be viewed in Web-formatted layout, based on the BBCResults.xsl stylesheet which is copied to the \output\logs\BC folder on the build drive.
-
+The results of the output from the analysis are placed in the /output/logs/bc folder under the substed build drive and are called 'libraries_report_{bc.check.report.id}' and 'headers_report_{bc.check.report.id}', the reports can be viewed in Web-formatted layout, based on the BBCResults.xsl stylesheet which is copied to the /output/logs/bc folder on the build drive.
-.. include:: stage_final.rst.inc
-
+By running the target 'ca-generate-diamond-summary' the output is summarised and passed to diamonds where is is displayed in the 'Quality Aspects' section.
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/manual/tdriver_template_instructions.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/src/manual/tdriver_template_instructions.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,302 @@
+<#--
+============================================================================
+Name : tdriver_template_instructions.rst.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+.. index::
+ single: TDriver
+
+
+=======================
+TDriver Custom Template
+=======================
+
+
+.. contents::
+
+
+Instructions for creating custom templates for TDriver
+======================================================
+
+Creating custom template for TDriver is very simple and easy. It requires a bit of knowledge of `Python`_, `Python dictionary`_ and `Jinja templates`_, however, it is not mandatory. There will be an example template below, which may help to understand how to create new/modify TDriver template.
+
+.. _`Python`: http://wiki.python.org/moin/BeginnersGuide
+.. _`Python dictionary`: http://docs.python.org/tutorial/datastructures.html#dictionaries
+.. _`Jinja templates`: http://jinja.pocoo.org/2/documentation/templates
+
+
+The test.xml template consists of two parts
+ - Explicit (hardcoded part of the test.xml) and
+ - Implicit (logical/processed data from the TDriver scripts)
+
+
+Explicit template data
+----------------------
+
+This consists of normal template structure, obvious properties, attributes and their values.
+
+For example:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+It does not make any sense without parameters and values. However, explicit data does not require any logic or it is not the data coming from any script either.
+
+
+Implicit template data
+----------------------
+
+- This is complete processed data from several sources.
+- In case of TDriver template, this is a dictionary, ``xml_dict``, which has hierarchical data structure.
+- The contents of the dictionary can be categorized into:
+
+**Pre-Data** (non-itterative data and comes before the execution block in the beginning of the test.xml)
+
+
+.. csv-table:: Pre-Data (Data structure)
+ :header: "Variable name", "Description", "Usage example"
+
+ "diamonds_build_url", "Non-iterative - string", "xml_dict['diamonds_build_url']"
+ "testrun_name", "Non-iterative - string", "xml_dict['testrun_name']"
+ "device_type", "Non-iterative - string", "xml_dict['device_type']"
+ "alias_name", "Non-iterative - string", "xml_dict['alias_name']"
+
+
+
+**Execution-Block** (itterative, which is dependet on number of execution blocks. Please see the template example for exact usage)
+
+
+.. csv-table:: Pre-Data (Data structure)
+ :header: "Variable name", "Description", "Usage example"
+
+ "execution_blocks", "Iterative - dictionary. It has the following members", "for exe_block in xml_dict['execution_blocks']"
+ "image_files", "Iterative - list of ROM images.", "for image_file in exe_block['image_files']"
+ "install_files", "Iterative - list of files to be installed", "for file in exe_block['install_files']"
+ "tdriver_sis_files", "Iterative - list of sisfiles to be installed. This unpacks three values of sisfiles (src, dst_on_ats_server, dst_on_phone).", "for sisfile in exe_block['tdriver_sis_files']"
+ "tdriver_task_files", "Iterative - list of task files, .pro or .rb files, depending on the value of :hlm-p:`tdriver.tdrunner.enabled`.", "for task_file in exe_block['tdriver_task_files']"
+ "asset_path", "Non-iterative - string", "exe_block['asset_path']"
+ "test_timeout", "Non-iterative - string", "exe_block['test_timeout']"
+ "tdriver_parameters", "Non-iterative - string", "exe_block['tdriver_parameters']"
+ "tdrunner_enabled", "Non-iterative - boolean", "exe_block['tdrunner_enabled']"
+ "tdrunner_parameters", "Non-iterative - string", "exe_block['tdrunner_parameters']"
+ "ctc_enabled", "Non-iterative - boolean", "exe_block['ctc_enabled']"
+
+
+
+**Post-Data** (non-itterative data and comes after the execution block in the end of the test.xml)
+
+
+.. csv-table:: Pre-Data (Data structure)
+ :header: "Variable name", "Description", "Usage example"
+
+ "report_email", "Non-iterative - string", "xml_dict['report_email']"
+ "email_format", "Non-iterative - string", "xml_dict['email_format']"
+ "email_subject", "Non-iterative - string", "xml_dict['email_subject']"
+ "report_location", "Non-iterative - string", "xml_dict['report_location']"
+
+
+
+Example template
+================
+
+
+.. code-block:: xml
+
+ {% import 'ats4_macros.xml' as macros with context %}
+
+
+
+ {% if xml_dict['diamonds_build_url'] -%}
+ {{ xml_dict['diamonds_build_url'] }}
+ Smoke
+ {% endif %}
+ {{ xml_dict['testrun_name'] }}
+
+
+
+
+
+
+
+
+
+ {% for exe_block in xml_dict['execution_blocks'] -%}
+
+
+
+ {% if exe_block['image_files'] -%}
+
+ FlashTask
+
+ {% set i = 1 %}
+ {% for img in exe_block['image_files'] -%}
+
+ {% set i = i + 1 %}
+ {% endfor -%}
+
+
+ {% endif %}
+
+ {% if exe_block['install_files'] != [] -%}
+ {% for file in exe_block['install_files'] -%}
+
+ FileUploadTask
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+ {% if exe_block['tdriver_sis_files'] != [] -%}
+ {% for sisfile in exe_block['tdriver_sis_files'] -%}
+
+ FileUploadTask
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+ {% for sis_file in exe_block["tdriver_sis_files"] -%}
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {%- endfor -%}
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+ {% if exe_block["ctc_enabled"] == "True" -%}
+ {{ macros.ctc_initialization(exe_block) }}
+ {%- endif %}
+
+
+ {% if exe_block["tdriver_task_files"] -%}
+ {% for task_file in exe_block["tdriver_task_files"] -%}
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+
+ {% if exe_block["ctc_enabled"] == "True" -%}
+ {{ macros.ctc_finalization(exe_block) }}
+ {%- endif %}
+
+
+ CleanupTask
+
+
+
+
+
+
+ {% endfor -%}
+
+
+
+ EmailAction
+
+
+
+
+
+
+ {% if xml_dict['report_location'] -%}
+
+ FileStoreAction
+
+
+
+
+
+ {% endif %}
+ {% if xml_dict['diamonds_build_url'] -%}
+
+ DiamondsAction
+ {% if xml_dict['execution_blocks'] != [] and xml_dict['execution_blocks'][0]["ctc_enabled"] == "True" -%}
+
+
+
+ {%- endif %}
+
+ {%- endif %}
+
+
+
+
+
+
+Setting Custom Template for execution
+=====================================
+
+To execute custom template, set property :hlm-p:`tdriver.template.file`, for example:
+
+.. code-block:: xml
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/new_user_tutorial.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/src/new_user_tutorial.rst Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,280 @@
+.. ============================================================================
+ Name : new_user_tutorial.rst
+ Part of : Helium
+
+ Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ ============================================================================
+
+########################
+Helium New User Tutorial
+########################
+
+.. index::
+ module: Helium New User Tutorial
+
+.. contents::
+
+Introduction
+============
+
+This tutorial covers the basic information to get up and running using the Helium build framework. Check the `Helium manual`_ for more detailed information.
+
+.. _`Helium manual`: manual/index.html
+
+
+Setting up a simple build file
+===============================
+
+Helium is based on `Apache Ant`_, a build tool written in Java that uses XML configuration files. A Helium build configuration must start with a ``build.xml`` file in the directory where Helium commands are run from::
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. _`Apache Ant`: http://ant.apache.org/
+.. _`Ant manual`: http://ant.apache.org/manual
+
+Helium looks for a ``build.xml`` project file in the current directory. It will parse this and additional imported Ant files to create the project configuration.
+
+
+Basic structure
+===============
+
+The main components of Ant project files are targets, types and tasks.
+
+Targets define a set of tasks to be run as a build step. A target can depend on other targets, so a complete build process can be built up using a chain of targets. A simple target to echo some text to the console might look like this::
+
+
+ Hello!
+
+
+Types are information elements for configuring the build. The most common are properties that define a single value or location::
+
+
+
+Properties representing locations are normalised to full paths when the ``location`` attribute is used::
+
+
+
+.. note:: Once a property is defined it is immutable. The value of a property is defined by the first definition that is found.
+
+Another common type is a fileset that represents a collection of files, typically using wildcard selection::
+
+
+
+
+
+This will select all XML files under the ``helium.build.dir`` directory. Note the use of ``${}`` to insert the value of a property.
+
+There are a number of other types such as dirset, filelist, patternset which may be used for some configuration. See the "Concepts and Types" section of the `Ant manual`_ for more details.
+
+
+Import statements
+-----------------
+
+Import statements are used to pull additional Ant project file content into the main project::
+
+
+
+Here the order of elements is significant:
+
+Properties
+ Must be defined before the import to override a property value in an imported file. See the `properties list `_ for default values.
+
+Types
+ Other types such as filesets, dirsets that are referenced by ``ID`` must be defined after the import.
+
+Targets
+ Can be defined anywhere in the file.
+
+``helium.ant.xml`` is the root file to import from Helium, which will pull in all the Helium content.
+
+
+Run a command
+=============
+
+Make sure Helium is on the ``PATH``. Then the ``hlm`` command can be run from the project directory containing the ``build.xml`` file. Try a quick test::
+
+ hlm hello
+
+This should echo "Hi!" to the console, which shows that Helium can be imported successfully.
+
+A target can be run using its name as a command::
+
+ hlm [target]
+
+Often it can be useful to define or override property values on the command line, like this::
+
+ hlm [target] -Dname=value
+
+
+Setting up a build
+==================
+
+An actual build process is defined by chaining together a number of major build stages, e.g. preparation, compilation, ROM building, etc. So a top-level build process target called from the command line might look like this::
+
+
+
+
+
+
+
+
+
+In this case an additional target is defined and run after prep but before compilation. The full build is then run by calling::
+
+ hlm full-build -Dbuild.number=1
+
+Configuring build stages
+------------------------
+
+Configuring each build stage typically involves defining or overriding properties and other types that are needed for that stage. In some cases special XML file formats are used. Please refer to the `appropriate sections `_ of the manual for information on configuring each stage.
+
+There are a number of individual features that can be enabled or disabled using flag properties. See `this list `_.
+
+
+Overriding and extending targets
+================================
+
+If the build sequence needs customizing or extending, it is useful to be able to define new targets and potentially override existing Helium targets. Targets can be defined anywhere within the XML file. If multiple targets have the same name the first one to be parsed in the order of importing Ant files will be executed when called by name. Any target can be called explicitly by using its fully-qualified name which is constructed by prepending the name of the enclosing project, e.g.::
+
+ hlm common.hello
+
+This calls the ``hello`` target which is located in the common project file. It can be seen in the `API documentation`_.
+
+.. _`API documentation`: api/helium/project-common.html#hello
+
+Any existing target can be extended by overriding it and adding custom steps at the start or the end. To add steps to the start of a target, override it defining a new custom target and the original one as dependencies, e.g. to run a step before preparation::
+
+
+ Run before original target.
+
+
+
+
+Additional steps could be added to the end of a target using a similar method, or just include them in the overriding target thus::
+
+
+ Run after original target.
+
+
+
+Basic operations
+================
+
+Simple file-based tasks
+-----------------------
+
+Ant has core support for wide range of file-based tasks. Here are a few simple examples:
+
+Copying all HTML log files by wildcard::
+
+
+
+
+
+
+
+Zip all the log files::
+
+
+
+
+
+
+
+
+
+Deleting text log files::
+
+
+
+
+
+
+
+See the Ant Tasks section of the `Ant manual`_ for a full list of available tasks.
+
+
+Running an external tool
+------------------------
+
+The ```` task can be used to run an external tool::
+
+
+
+
+
+
+
+See the `Ant manual entry `_ for more details on how to use the ```` task. Use ```` along with the customisation methods above to call additional tools at suitable places during the build. The `Setting up a build`_ section shows how a custom tool target could be called during a full build process.
+
+External scripts can be run by calling the appropriate runtime executable and providing the script as an argument::
+
+
+
+
+
+
+Simple macros
+-------------
+
+Defining a macro is a useful method of combining a set of task steps to avoid repetition. This example defines a macro called ``testing`` and calls it::
+
+
+
+
+
+ v is @{v}
+
+
+
+
+
+
+ this is a test
+
+
+
+
+Getting help
+============
+
+There are several sources of further information:
+
+ * The `Helium manual`_.
+ * The `Helium API`_ of `targets`_, `properties`_ and `macros`_.
+ * Command line help. Try running::
+
+ hlm help [name]
+
+ to get help on a specific target or property.
+
+.. _`Helium API`: api/helium/index.html
+.. _`targets`: api/helium/targets_list.html
+.. _`properties`: api/helium/properties_list.html
+.. _`macros`: api/helium/macros_list.html
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/quick_start_guide.rst.ftl
--- a/buildframework/helium/doc/src/quick_start_guide.rst.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/quick_start_guide.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -70,8 +70,7 @@
- `Using Ant `_: specifically the Projects and Properties sections.
- `Configure Helium `_: `common configuration format `_ and `Helium stages `_.
- - `Helium glossary `_: lists the specific properties used in Helium.
-
+ - `Helium glossary `_: lists the specific properties used in Helium.
.. index::
single: Running builds with Helium
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/tutorials/imaker/buildinfo_creation.rst
--- a/buildframework/helium/doc/src/tutorials/imaker/buildinfo_creation.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/tutorials/imaker/buildinfo_creation.rst Sun Oct 10 15:22:15 2010 +0300
@@ -34,7 +34,6 @@
-
FTL template
~~~~~~~~~~~~
@@ -51,31 +50,6 @@
::
> hlm.bat -Dbuild.drive=Z: rombuild-imaker-create-buildinfo
- *** WARNING: Can't find vcvars32.bat - MS Visual Studio not present.
- Buildfile: build.xml
-
- create-data-model-db:
-
- validate-at-startup:
- [python] ERROR: Description has no content for 'read.build.int'
- [python] WARNING: Required property not defined: sysdef.configurations.list
- [python] WARNING: Required property not defined: tsrc.data.dir
- [python] WARNING: Required property not defined: ats3.pathToDrop
- [python] WARNING: Required property not defined: ats3.host
- [python] WARNING: Required property not defined: ats.flash.images
- [python] WARNING: Required property not defined: ats.image.type
- [python] WARNING: Required property not defined: ats.drop.file
- [python] WARNING: Required property not defined: ats3.username
- [python] WARNING: Required property not defined: cache.drive
- [python] WARNING: Required property not defined: ats.product.name
- [python] WARNING: Required property not defined: ats3.password
-
- rombuild-imaker-create-buildinfo:
- [fmpp] File processed.
-
- BUILD SUCCESSFUL
- Total time: 3 seconds
-
The output
~~~~~~~~~~
@@ -89,25 +63,24 @@
##########################################################################
BUILD_LOGGING_KEY_STAGES = prep,build-ebs-main,postbuild,flashfiles,java-certification-rom,zip-main,publish-generic,variants-core,variants-elaf,variants-china,variants-thai,variants-japan,variants,mobilecrash-prep,localise-tutorial-content,hdd-images,zip-flashfiles,zip-localisation,data-packaging-prep
- BUILD_SUMMARY_FILE_2 = Z:\output\logs\summary\pf_5250_16_wk2008_summary.log2.xml
- BUILD_LOG = Z:\output\logs\pf_5250_16_wk2008_ant_build.log
- BUILD_NAME = pf_5250
- BUILD_CACHE_LOG_DIR = C:\DOCUME~1\wbernard\LOCALS~1\Temp\helium\pf_5250_16_wk2008\logs
+ BUILD_SUMMARY_FILE_2 = Z:\output\logs\summary\x_16_wk2008_summary.log2.xml
+ BUILD_LOG = Z:\output\logs\x_16_wk2008_ant_build.log
+ BUILD_NAME = x
+ BUILD_CACHE_LOG_DIR = C:\DOCUME~1\x\LOCALS~1\Temp\helium\x_16_wk2008\logs
BUILD_SYSTEM = ebs
BUILD_LOG_DIR = Z:\output\logs
- BUILD_CACHE_DIR = C:\DOCUME~1\wbernard\LOCALS~1\Temp\helium\pf_5250_16_wk2008
+ BUILD_CACHE_DIR = C:\DOCUME~1\x\LOCALS~1\Temp\helium\x_16_wk2008
BUILD_OUTPUT_DIR = Z:\output
- BUILD_SUMMARY_FILE = Z:\output\logs\pf_5250_16_wk2008_build_summary.xml
+ BUILD_SUMMARY_FILE = Z:\output\logs\x_16_wk2008_build_summary.xml
BUILD_VERSION = 0.0.1
BUILD_SYSTEM_EBS = Not used
BUILD_SISFILES_DIR = Z:\output\sisfiles
BUILD_ERRORS_LIMIT = 0
BUILD_DRIVE = Z:
BUILD_NUMBER = 1
- BUILD_DUPLICATES_LOG = Z:\output\logs\pf_5250_16_wk2008_build_duplicates.xml
+ BUILD_DUPLICATES_LOG = Z:\output\logs\x_16_wk2008_build_duplicates.xml
BUILD_LOGGING_START_STAGE = check-env-prep
- BUILD_ID = pf_5250_16_wk2008
-
+ BUILD_ID = x_16_wk2008
Download the example: `buildinfo_creation.zip `_
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/doc/src/user_graph.dot.ftl
--- a/buildframework/helium/doc/src/user_graph.dot.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/doc/src/user_graph.dot.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -107,7 +107,7 @@
"DOS Scripting" -> NOSE[dir=none, lhead=cluster_4_1, ltail=cluster_4];
- Start [fontcolor=navyblue,fontsize=12,style=filled,href="introduction.html"];
+ Start [fontcolor=navyblue,fontsize=12,style=filled,href="manual/introduction.html"];
Ant [fontcolor=navyblue,fontsize=12,shape=box,href="http://ant.apache.org/manual/"];
"Running Helium" [fontcolor=navyblue,fontsize=12,shape=box,href="manual/running.html"];
@@ -123,7 +123,7 @@
"ROM Image" [fontcolor=navyblue,fontsize=12,shape=box,href="tutorials/rom_image.html"];
<#if !(ant?keys?seq_contains("sf"))>
- "Setting up Helium at Nokia" [fontcolor=navyblue,fontsize=12,shape=box,href="nokia/nokia.html"];
+ "Setting up Helium at Nokia" [fontcolor=navyblue,fontsize=12,shape=box,href="manual/retrieving.html"];
"Helium Nokia Stages" [fontcolor=navyblue,fontsize=12,shape=box,href="manual/nokiastages.html"];
Diamonds [fontcolor=navyblue,fontsize=12,shape=box,href="http://diamonds.nmp.nokia.com/diamonds/"];
"Helium Wiki" [fontcolor=navyblue,fontsize=12,shape=box,href="http://delivery.nmp.nokia.com/trac/helium/wiki"];
@@ -131,7 +131,7 @@
MCL [fontcolor=navyblue,fontsize=12,shape=box,href="http://s60wiki.nokia.com/S60Wiki/S60_Software_Asset_Management/Organization/Delivery_Services/Howto_build_DFS70.91.91_/_S60.MCL_with_Helium"];
IDO [fontcolor=navyblue,fontsize=12,shape=box,href="http://helium.nmp.nokia.com/doc/ido"];
TeamCI [fontcolor=navyblue,fontsize=12,shape=box,href="http://helium.nmp.nokia.com/doc/teamci"];
- "Helium Test Plan" [fontcolor=navyblue,fontsize=12,shape=box,href="manual/testing.html"];
+ "Helium Test Plan" [fontcolor=navyblue,fontsize=12,shape=box,href="development/testing.html"];
#if>
"Helium Developer Guide" [fontcolor=navyblue,fontsize=12,shape=box,href="development/developer_guide.html"];
@@ -139,7 +139,7 @@
Python [fontcolor=navyblue,fontsize=12,shape=box,href="http://www.python.org/"];
Java [fontcolor=navyblue,fontsize=12,shape=box,href="http://java.sun.com/j2se/"];
FMPP [fontcolor=navyblue,fontsize=12,shape=box,href="http://fmpp.sourceforge.net/"];
- "DOS Scripting" [fontcolor=navyblue,fontsize=12,shape=box,href="http://en.wikipedia.org/wiki/Batch_script"];
+ "DOS Scripting" [fontcolor=navyblue,fontsize=12,shape=box,href="http://en.wikipedia.org/wiki/Batch_file"];
ANTUnit [fontcolor=navyblue,fontsize=12,shape=box,href="http://ant.apache.org/antlibs/antunit/"];
NOSE [fontcolor=navyblue,fontsize=12,shape=box,href="http://ivory.idyll.org/articles/nose-intro.html"];
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/helium.ant.xml
--- a/buildframework/helium/helium.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/helium.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -22,11 +22,11 @@
-->
- Main full build targets and properties
+ Main starting point to import Helium. Imports the other main Ant files.
-
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/deps/net.sourceforge.docutils/docutils/0.5/docutils-0.5.py2.5.egg
Binary file buildframework/helium/sf/deps/net.sourceforge.docutils/docutils/0.5/docutils-0.5.py2.5.egg has changed
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/deps/net.sourceforge.docutils/docutils/0.5/ivy.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/deps/net.sourceforge.docutils/docutils/0.5/ivy.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/doc/src/index.rst
--- a/buildframework/helium/sf/doc/src/index.rst Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-=============
-Helium Antlib
-=============
-.. _Helium Antlib Java API: api/javadoc/index.html
-.. _Helium Antlib AntDoclet: api/doclet/index.html
-
-Developer Documentation
-=======================
-.. toctree::
- :maxdepth: 1
- :glob:
-
- *
-
-API Documentation
-=================
- * `Helium Antlib AntDoclet`_
- * `Helium Antlib Java API`_
-
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/doc/src/index.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/doc/src/index.rst.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,43 @@
+<#--
+============================================================================
+Name : .ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+=============
+Helium Antlib
+=============
+
+Developer Documentation
+=======================
+.. toctree::
+ :maxdepth: 1
+ :glob:
+
+ *
+
+<#if !(ant?keys?seq_contains("sf"))>
+
+API Documentation
+=================
+ * `Helium Antlib AntDoclet`_
+ * `Helium Antlib Java API`_
+
+.. _Helium Antlib Java API: ../api/javadoc/index.html
+.. _Helium Antlib AntDoclet: ../api/doclet/index.html
+#if>
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntFile.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntFile.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntFile.java Sun Oct 10 15:22:15 2010 +0300
@@ -76,10 +76,14 @@
doc = contentHandler.getDocument();
}
catch (SAXException e) {
- throw new IOException(e.getMessage());
+ throw new IOException("Error parsing: " + path + " at " + e.getMessage(), e);
}
}
+ public String getName() {
+ return getFile().getName();
+ }
+
public Project getProject() {
return rootProject;
}
@@ -129,4 +133,6 @@
}
return antlibFiles;
}
+
+
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntObjectMeta.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntObjectMeta.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntObjectMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -17,6 +17,7 @@
package com.nokia.helium.ant.data;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -34,7 +35,7 @@
public class AntObjectMeta {
public static final Map SCOPES;
-
+
static {
Map tempMap = new HashMap();
tempMap.put("public", new Integer(1));
@@ -42,7 +43,7 @@
tempMap.put("private", new Integer(3));
SCOPES = Collections.unmodifiableMap(tempMap);
}
-
+
/** The default scope if an element does not have a defined scope. */
public static final String DEFAULT_SCOPE = "public";
@@ -88,7 +89,7 @@
* @param name Attribute name.
* @return Attribute value.
*/
- protected String getAttr(String name) {
+ public String getAttr(String name) {
if (node.getNodeType() == Node.ELEMENT_NODE) {
String value = ((Element) node).attributeValue(name);
if (value != null) {
@@ -116,6 +117,10 @@
return parent.getRootMeta();
}
+ public AntObjectMeta getParent() {
+ return parent;
+ }
+
/**
* Returns the Ant file this Ant object is contained in.
*/
@@ -150,11 +155,15 @@
*/
public String getLocation() {
RootAntObjectMeta rootMeta = getRootMeta();
- String location = rootMeta.getFilePath();
- if (node instanceof ElementWithLocation) {
- location += ":" + ((ElementWithLocation)node).getLineNumber();
+ return rootMeta.getFilePath() + ":" + getLineNumber();
+ }
+
+ public Integer getLineNumber() {
+ int lineNum = 0;
+ if (node != null && node instanceof ElementWithLocation) {
+ lineNum = ((ElementWithLocation) node).getLineNumber();
}
- return location;
+ return lineNum;
}
/**
@@ -210,10 +219,10 @@
public String getDeprecated() {
return comment.getTagValue("deprecated");
}
-
+
/**
- * Returns the content of the "since" tag that should indicate which release this feature
- * was first added.
+ * Returns the content of the "since" tag that should indicate which release
+ * this feature was first added.
*
* @return Since release number.
*/
@@ -247,7 +256,7 @@
this.comment = comment;
}
- private void processComment() {
+ private void processComment() {
Comment commentNode = getCommentNode();
if (commentNode != null) {
comment = new AntComment(commentNode);
@@ -259,8 +268,7 @@
Node commentNode = null;
if (node.getNodeType() == Node.COMMENT_NODE) {
commentNode = node;
- }
- else {
+ } else {
List children = node.selectNodes("preceding-sibling::node()");
if (children.size() > 0) {
// Scan past the text nodess, which are most likely whitespace
@@ -275,13 +283,12 @@
if (child.getNodeType() == Node.COMMENT_NODE) {
commentNode = child;
log("Node has comment: " + node.getStringValue(), Project.MSG_DEBUG);
- }
- else {
+ } else {
log("Node has no comment: " + node.toString(), Project.MSG_WARN);
}
}
}
- return (Comment)commentNode;
+ return (Comment) commentNode;
}
public void log(String text, int level) {
@@ -290,8 +297,36 @@
project.log(text, level);
}
}
-
+
public String toString() {
return getName();
}
+
+ public List getTasks(String taskType) {
+ return getTaskDefinitions(".//" + taskType);
+ }
+
+ @SuppressWarnings("unchecked")
+ public List getScriptDefinitions(String xpathExpression) {
+ List nodes = getNode().selectNodes(xpathExpression);
+ List scripts = new ArrayList();
+ for (Element node : nodes) {
+ MacroMeta macroMeta = new MacroMeta(this, node);
+ macroMeta.setRuntimeProject(getRuntimeProject());
+ scripts.add(macroMeta);
+ }
+ return scripts;
+ }
+
+ @SuppressWarnings("unchecked")
+ public List getTaskDefinitions(String xpathExpression) {
+ List nodes = getNode().selectNodes(xpathExpression);
+ List tasks = new ArrayList();
+ for (Element node : nodes) {
+ TaskMeta taskMeta = new TaskMeta(this, node);
+ taskMeta.setRuntimeProject(getRuntimeProject());
+ tasks.add(taskMeta);
+ }
+ return tasks;
+ }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/Database.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/Database.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/Database.java Sun Oct 10 15:22:15 2010 +0300
@@ -23,13 +23,10 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
-
import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-
+import org.apache.tools.ant.ProjectHelper;
import com.nokia.helium.freemarker.WikiMethod;
import freemarker.cache.ClassTemplateLoader;
@@ -50,6 +47,8 @@
public static final String DEFAULT_SCOPE = "public";
public static final Map NAMESPACE_MAP;
+ private List propertiesList;
+ private List commentPropertiesList;
private Project rootProject;
private Map antfilesMap;
private Map packagesMap;
@@ -65,23 +64,17 @@
this(project, DEFAULT_SCOPE);
}
- @SuppressWarnings("unchecked")
- public Database(Project project, String scopeFilter) throws IOException {
- this.rootProject = project;
+ public Database(Project rootProject, String scopeFilter) throws IOException {
+ this.rootProject = rootProject;
this.scopeFilter = scopeFilter;
antfilesMap = new HashMap();
packagesMap = new HashMap();
- if (project != null) {
- Map targets = project.getTargets();
- Iterator targetsIter = targets.values().iterator();
-
- while (targetsIter.hasNext()) {
- Target target = targetsIter.next();
- String antFilePath = new File(target.getLocation().getFileName()).getCanonicalPath();
-
- if (!antfilesMap.containsKey(antFilePath)) {
- addAntFile(antFilePath);
+ if (rootProject != null) {
+ ProjectHelper helper = (ProjectHelper) rootProject.getReference(ProjectHelper.PROJECTHELPER_REFERENCE);
+ for (Object antFilename : helper.getImportStack()) {
+ if (antFilename instanceof File) {
+ addAntFile(((File) antFilename).getCanonicalPath());
}
}
}
@@ -101,7 +94,7 @@
private void addAntFile(String antFilePath) throws IOException {
if (!antfilesMap.containsKey(antFilePath)) {
- log("Adding project to database: " + antFilePath, Project.MSG_DEBUG);
+ log("Adding project to database: " + antFilePath, Project.MSG_VERBOSE);
AntFile antfile = new AntFile(this, antFilePath, scopeFilter);
antfile.setProject(rootProject);
antfilesMap.put(antFilePath, antfile);
@@ -193,25 +186,29 @@
}
public List getProperties() {
- List propertiesList = new ArrayList();
- for (AntFile antfile : antfilesMap.values()) {
- RootAntObjectMeta rootMeta = antfile.getRootObjectMeta();
- if (rootMeta instanceof ProjectMeta) {
- propertiesList.addAll(((ProjectMeta) rootMeta).getProperties());
+ if ( propertiesList == null) {
+ propertiesList = new ArrayList();
+ for (AntFile antfile : antfilesMap.values()) {
+ RootAntObjectMeta rootMeta = antfile.getRootObjectMeta();
+ if (rootMeta instanceof ProjectMeta) {
+ propertiesList.addAll(((ProjectMeta) rootMeta).getProperties());
+ }
}
}
return propertiesList;
}
-
+
public List getCommentProperties() {
- List propertiesList = new ArrayList();
- for (AntFile antfile : antfilesMap.values()) {
- RootAntObjectMeta rootMeta = antfile.getRootObjectMeta();
- if (rootMeta instanceof ProjectMeta) {
- propertiesList.addAll(((ProjectMeta) rootMeta).getPropertyCommentBlocks());
+ if (commentPropertiesList == null) {
+ commentPropertiesList = new ArrayList();
+ for (AntFile antfile : antfilesMap.values()) {
+ RootAntObjectMeta rootMeta = antfile.getRootObjectMeta();
+ if (rootMeta instanceof ProjectMeta) {
+ commentPropertiesList.addAll(((ProjectMeta) rootMeta).getPropertyCommentBlocks());
+ }
}
}
- return propertiesList;
+ return commentPropertiesList;
}
public List getPackages() throws IOException {
@@ -221,4 +218,15 @@
}
return packages;
}
+
+ public List getTargets() {
+ List targets = new ArrayList();
+ for (AntFile antFile : antfilesMap.values()) {
+ RootAntObjectMeta rootMeta = antFile.getRootObjectMeta();
+ if (rootMeta instanceof ProjectMeta) {
+ targets.addAll(((ProjectMeta)rootMeta).getTargets());
+ }
+ }
+ return targets;
+ }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/MacroMeta.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/MacroMeta.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/MacroMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -17,6 +17,7 @@
package com.nokia.helium.ant.data;
+import java.util.ArrayList;
import java.util.List;
import org.dom4j.Element;
@@ -34,6 +35,10 @@
public String getDescription() {
return getAttr("description");
}
+
+ public String getText() {
+ return getNode().getText();
+ }
@SuppressWarnings("unchecked")
public String getUsage() {
@@ -66,4 +71,17 @@
return "\n" + macroElements + " ";
}
}
+
+ @SuppressWarnings("unchecked")
+ public List getAttributes() {
+ List attributes = new ArrayList();
+ if (getNode().getNodeType() == Node.ELEMENT_NODE) {
+ Element element = (Element)getNode();
+ List attributeNodes = element.elements("attribute");
+ for (Element attributeNode : attributeNodes) {
+ attributes.add(attributeNode.attributeValue("name"));
+ }
+ }
+ return attributes;
+ }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/ProjectMeta.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/ProjectMeta.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/ProjectMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -111,19 +111,6 @@
return properties;
}
- @SuppressWarnings("unchecked")
- public List getMacros() {
- ArrayList objects = new ArrayList();
- List nodes = getNode().selectNodes("//macrodef | //scriptdef");
- for (Element node : nodes) {
- MacroMeta macroMeta = new MacroMeta(this, node);
- macroMeta.setRuntimeProject(getRuntimeProject());
- if (macroMeta.matchesScope(getScopeFilter())) {
- objects.add(macroMeta);
- }
- }
- return objects;
- }
@SuppressWarnings("unchecked")
public List getProjectDependencies() {
@@ -181,13 +168,12 @@
}
}
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
private String findSignalFailMode(String signalid, Document antDoc) {
XPath xpath2 = DocumentHelper.createXPath("//hlm:signalListenerConfig[@id='" + signalid
+ "']/signalNotifierInput/signalInput");
xpath2.setNamespaceURIs(Database.NAMESPACE_MAP);
List signalNodes3 = xpath2.selectNodes(antDoc);
-
for (Iterator iterator3 = signalNodes3.iterator(); iterator3.hasNext();) {
Element propertyNode3 = (Element) iterator3.next();
String signalinputid = propertyNode3.attributeValue("refid");
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/PropertyMeta.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/PropertyMeta.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/PropertyMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -29,6 +29,7 @@
public static final String STRING_TYPE = "string";
public static final String INTEGER_TYPE = "integer";
public static final String BOOLEAN_TYPE = "boolean";
+ public static final String FLOAT_TYPE = "float";
public static final String DEFAULT_TYPE = STRING_TYPE;
public PropertyMeta(AntObjectMeta parent, Node propNode) {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/RootAntObjectMeta.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/RootAntObjectMeta.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/RootAntObjectMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -51,7 +51,7 @@
public AntFile getAntFile() {
return antFile;
}
-
+
/**
* Returns the location path of the object.
*
@@ -73,19 +73,15 @@
return this;
}
- @SuppressWarnings("unchecked")
- public List getMacros() throws IOException {
- ArrayList objects = new ArrayList();
- List nodes = getNode().selectNodes("//macrodef | //scriptdef");
- for (Element node : nodes) {
- MacroMeta macroMeta = new MacroMeta(this, node);
- macroMeta.setRuntimeProject(getRuntimeProject());
- if (macroMeta.matchesScope(scopeFilter)) {
- objects.add(macroMeta);
+ public List getMacros() {
+ List objects = getScriptDefinitions("//macrodef | //scriptdef");
+ List filteredList = new ArrayList();
+ for (MacroMeta macroMeta : objects) {
+ if (macroMeta.matchesScope(getScopeFilter())) {
+ filteredList.add(macroMeta);
}
}
- return objects;
+ return filteredList;
}
+
}
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TargetMeta.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TargetMeta.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TargetMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -43,12 +43,36 @@
super(parent, node);
}
+ private String getPropertyFromDb(String prop) {
+ for (PropertyMeta property : getDatabase().getProperties()) {
+ if (property.getName().equals(prop)
+ && property.matchesScope(getRootMeta().getScopeFilter())) {
+ return prop;
+ }
+ }
+ for (PropertyCommentMeta property : getDatabase().getCommentProperties()) {
+ if (property.getName().equals(prop)
+ && property.matchesScope(getRootMeta().getScopeFilter())) {
+ return prop;
+ }
+ }
+ return null;
+ }
+
public String getIf() {
- return getAttr("if");
+ String propertyIf = getAttr("if");
+ if (!propertyIf.isEmpty() && getPropertyFromDb(propertyIf) != null) {
+ return propertyIf;
+ }
+ return "";
}
public String getUnless() {
- return getAttr("unless");
+ String propertyUnless = getAttr("unless");
+ if (!propertyUnless.isEmpty() && getPropertyFromDb(propertyUnless) != null) {
+ return propertyUnless;
+ }
+ return "";
}
public String getDescription() {
@@ -84,7 +108,7 @@
AntFile antFile = (AntFile) iterator.next();
RootAntObjectMeta rootObjectMeta = antFile.getRootObjectMeta();
if (rootObjectMeta instanceof ProjectMeta) {
- ProjectMeta projectMeta = (ProjectMeta)rootObjectMeta;
+ ProjectMeta projectMeta = (ProjectMeta) rootObjectMeta;
projectMeta.getConfigSignals(getName(), signals);
}
}
@@ -95,7 +119,17 @@
ArrayList properties = new ArrayList();
Visitor visitor = new AntPropertyVisitor(properties);
getNode().accept(visitor);
- return properties;
+ return filterPropertyDependencies(properties);
+ }
+
+ private List filterPropertyDependencies(ArrayList properties) {
+ List propertiesFiltered = new ArrayList();
+ for (String string : properties) {
+ if (getPropertyFromDb(string) != null) {
+ propertiesFiltered.add(string);
+ }
+ }
+ return propertiesFiltered;
}
private class AntPropertyVisitor extends VisitorSupport {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TaskContainerMeta.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TaskContainerMeta.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TaskContainerMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -106,7 +106,7 @@
if (name.endsWith("signal") || name.endsWith("execSignal")) {
String signalid = node.attributeValue("name");
- if (signalList != null) {
+ if (signalid != null && signalid.length() > 0) {
signalList.add(signalid);
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TaskMeta.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/TaskMeta.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.ant.data;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Element;
+import org.dom4j.Node;
+
+/**
+ * Meta object representing an Ant task.
+ *
+ */
+public class TaskMeta extends AntObjectMeta {
+
+ public TaskMeta(AntObjectMeta parent, Node node) {
+ super(parent, node);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Map getParams() {
+ Map params = new HashMap();
+
+ if (getNode().getNodeType() == Node.ELEMENT_NODE) {
+ Element element = (Element)getNode();
+ List paramNodes = element.elements("param");
+ for (Element paramNode : paramNodes) {
+ params.put(paramNode.attributeValue("name"), paramNode.attributeValue("value"));
+ }
+ }
+ return params;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/antlib.xml
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -23,6 +23,5 @@
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/taskdefs/AntConfigLintTask.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/taskdefs/AntConfigLintTask.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.ant.data.taskdefs;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DynamicElement;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-
-import com.nokia.helium.ant.data.Database;
-import com.nokia.helium.ant.data.types.AntLintCheck;
-import com.nokia.helium.ant.data.types.LintIssue;
-
-/**
- * Another version of AntLint that fits with the antdata API more closely.
- */
-@SuppressWarnings("serial")
-public class AntConfigLintTask extends Task implements DynamicElement {
-
- // Temporary solution, should change to scanning jar
- public static final Map CHECKS = new HashMap() {
- {
- put("wrongtypepropertycheck", "WrongTypePropertyCheck");
- // put("protected", new Integer(2));
- // put("private", new Integer(3));
- }
- };
- private List checks = new ArrayList();
- private List issues = new ArrayList();
- private Database db;
- private int errorsTotal;
-
- public AntConfigLintTask() throws IOException {
- setTaskName("antconfiglint");
- }
-
- @SuppressWarnings("unchecked")
- public Object createDynamicElement(String name) {
- AntLintCheck check = null;
- String className = "com.nokia.helium.ant.data.types." + CHECKS.get(name);
- log("Creating check: " + className, Project.MSG_DEBUG);
- try {
- Class clazz = (Class) Class.forName(className);
- if (clazz != null) {
- check = (AntLintCheck) clazz.newInstance();
- checks.add(check);
- }
- }
- catch (ClassNotFoundException th) {
- th.printStackTrace();
- throw new BuildException("Error in Antlint configuration: " + th.getMessage());
- } catch (InstantiationException th) {
- th.printStackTrace();
- throw new BuildException("Error in Antlint configuration: " + th.getMessage());
- } catch (IllegalAccessException th) {
- th.printStackTrace();
- throw new BuildException("Error in Antlint configuration: " + th.getMessage());
- }
- return check;
- }
-
- public void execute() {
- errorsTotal = 0;
- try {
- db = new Database(getProject());
- if (checks.size() == 0) {
- throw new BuildException("No checks defined.");
- }
- for (AntLintCheck check : checks) {
- check.setTask(this);
-
- log("Running check: " + check, Project.MSG_DEBUG);
- check.run();
-
- }
- for (LintIssue issue : issues) {
- log(issue.toString());
- }
- if (errorsTotal > 0) {
- throw new BuildException("AntLint errors found: " + errorsTotal);
- }
- }
- catch (IOException e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- public void addLintIssue(LintIssue issue) {
- issues.add(issue);
- if (issue.getSeverity() == AntLintCheck.SEVERITY_ERROR) {
- errorsTotal++;
- }
- }
-
- public Database getDatabase() {
- return db;
- }
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/AntLintCheck.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/AntLintCheck.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.ant.data.types;
-
-import java.io.IOException;
-
-import org.apache.tools.ant.types.DataType;
-
-import com.nokia.helium.ant.data.Database;
-import com.nokia.helium.ant.data.taskdefs.AntConfigLintTask;
-
-/**
- * An Ant Lint coding conventions check.
- */
-public abstract class AntLintCheck extends DataType {
- public static final int SEVERITY_ERROR = 0;
- public static final int DEFAULT_SEVERITY = SEVERITY_ERROR;
-
- private AntConfigLintTask task;
- private String name;
- private String text;
- private int severity = DEFAULT_SEVERITY;
-
- /**
- * Set the pattern text.
- *
- * @param text is the pattern text to set.
- */
- public void addText(String text) {
- this.text = text;
- }
-
- /**
- * Get the name of the Checker.
- *
- * @return name of the checker.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Set the name of the Checker.
- *
- * @param name is the name of the checker to set.
- * @ant.required
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Get the pattern set for this Checker.
- *
- * @return the pattern.
- */
- public String getPattern() {
- return text;
- }
-
- /**
- * Get the severity.
- *
- * @return the severity
- */
- public int getSeverity() {
- return severity;
- }
-
- /**
- * Set the severity. (Valid values : error|warning)
- *
- * @param severity is the severity to set.
- * @ant.required
- */
- public void setSeverity(int severity) {
- this.severity = severity;
- }
-
- public AntConfigLintTask getTask() {
- return task;
- }
-
- public void setTask(AntConfigLintTask task) {
- this.task = task;
- }
-
- protected Database getDb() {
- return task.getDatabase();
- }
-
- public abstract void run() throws IOException;
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/LintIssue.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/LintIssue.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.ant.data.types;
-
-import com.nokia.helium.ant.data.AntFile;
-
-/**
- * An Ant lint issue.
- */
-public class LintIssue {
- private String description;
- private int level;
- private AntFile antfile;
- private String location;
-
- public LintIssue(String description, int level, String location) {
- super();
- this.description = description;
- this.level = level;
- this.location = location;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public int getSeverity() {
- return level;
- }
-
- public void setLevel(int level) {
- this.level = level;
- }
-
- public AntFile getAntfile() {
- return antfile;
- }
-
- public void setAntfile(AntFile antfile) {
- this.antfile = antfile;
- }
-
- public String getLocation() {
- return location;
- }
-
- public void setLocation(String location) {
- this.location = location;
- }
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/PropertyNameCheck.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/PropertyNameCheck.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.ant.data.types;
-
-/**
- * A check for the name of a property.
- */
-public class PropertyNameCheck {
-
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/WrongTypePropertyCheck.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/types/WrongTypePropertyCheck.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.ant.data.types;
-
-import java.io.IOException;
-import java.util.List;
-
-import org.apache.tools.ant.Project;
-
-import com.nokia.helium.ant.data.PropertyMeta;
-
-/**
- * An AntLint check of the type of a property.
- */
-public class WrongTypePropertyCheck extends AntLintCheck {
- public static final String DESCRIPTION = "Property value does not match type";
-
- @Override
- public void run() throws IOException {
- List properties = getDb().getProperties();
- log("Properties total: " + properties.size(), Project.MSG_DEBUG);
- for (PropertyMeta propertyMeta : properties) {
- String type = propertyMeta.getType();
- String value = propertyMeta.getValue();
- if (value != null) {
- log("Testing for wrong type: " + propertyMeta.getName() + ", type: " + type, Project.MSG_DEBUG);
- if (type.equals("integer")) {
- try {
- Integer.decode(value);
- }
- catch (NumberFormatException e) {
- getTask().addLintIssue(new LintIssue(DESCRIPTION, getSeverity(), propertyMeta.getLocation()));
- }
- }
- }
- else {
- log("Testing for wrong type: " + propertyMeta.getName() + ": value cannot be found", Project.MSG_DEBUG);
- }
- }
- }
-}
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antdata/tests/data/test_project.ant.xml
--- a/buildframework/helium/sf/java/antdata/tests/data/test_project.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antdata/tests/data/test_project.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -50,8 +50,18 @@
-
+
+
+
+
+
${property1}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/ivy.xml
--- a/buildframework/helium/sf/java/antlint/ivy.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/ivy.xml Sun Oct 10 15:22:15 2010 +0300
@@ -30,6 +30,6 @@
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/AntLintHandler.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/AntLintHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-package com.nokia.helium.antlint;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.helpers.DefaultHandler;
-
-import com.nokia.helium.antlint.ant.types.AbstractCheck;
-import com.nokia.helium.antlint.ant.types.Check;
-
-/**
- * AntLintHandler
is an SAX2 event handler class used to check for
- * tab characters and indents inside the xml elements.
- *
- */
-public class AntLintHandler extends DefaultHandler {
- private int indentLevel;
- private int indentSpace;
- private Locator locator;
- private boolean textElement;
- private int currentLine;
- private StringBuffer strBuff = new StringBuffer();
-
- private boolean indentationCheck;
- private boolean tabCharacterCheck;
-
- private Check check;
-
- /**
- * Create an instance of {@link AntLintHandler}.
- *
- * @param check
- * is the check to be performed.
- */
- public AntLintHandler(AbstractCheck check) {
- super();
- this.check = check;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setDocumentLocator(Locator locator) {
- this.locator = locator;
- }
-
- /**
- * {@inheritDoc}
- */
- public void startDocument() {
- indentLevel -= 4;
- }
-
- /**
- * Set whether the handler should check for indentation or not.
- *
- * @param indentationCheck
- * a boolean value to set.
- */
- public void setIndentationCheck(boolean indentationCheck) {
- this.indentationCheck = indentationCheck;
- }
-
- /**
- * Set whether the handler should check for tab characters or not.
- *
- * @param tabCharacterCheck
- * is a boolean value to set.
- */
- public void setTabCharacterCheck(boolean tabCharacterCheck) {
- this.tabCharacterCheck = tabCharacterCheck;
- }
-
- /**
- * {@inheritDoc}
- */
- public void startElement(String uri, String name, String qName,
- Attributes atts) {
- countSpaces();
- indentLevel += 4; // When an element start tag is encountered,
- // indentLevel is increased 4 spaces.
- checkIndent();
- currentLine = locator.getLineNumber();
- }
-
- /**
- * {@inheritDoc}
- */
- public void endElement(String uri, String name, String qName) {
- countSpaces();
- // Ignore end tags in the same line
- if (currentLine != locator.getLineNumber()) {
- checkIndent();
- }
- indentLevel -= 4; // When an element end tag is encountered,
- // indentLevel is decreased 4 spaces.
- textElement = false;
- }
-
- /**
- * Check for indentation.
- *
- */
- private void checkIndent() {
- if (indentationCheck) {
- if ((indentSpace != indentLevel) && !textElement) {
- check.getReporter().report(check.getSeverity(),
- "Bad indentation", check.getAntFile(),
- locator.getLineNumber());
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void characters(char[] ch, int start, int length) {
- for (int i = start; i < start + length; i++) {
- strBuff.append(ch[i]);
- }
- }
-
- /**
- * Method counts the number of spaces.
- */
- public void countSpaces() {
- // Counts spaces and tabs in every newline.
- int numSpaces = 0;
- for (int i = 0; i < strBuff.length(); i++) {
- switch (strBuff.charAt(i)) {
- case '\t':
- numSpaces += 4;
- if (tabCharacterCheck) {
- check.getReporter().report(check.getSeverity(),
- "Tabs should not be used!", check.getAntFile(),
- locator.getLineNumber());
- }
- break;
- case '\n':
- numSpaces = 0;
- break;
- case '\r':
- break;
- case ' ':
- numSpaces++;
- break;
- default:
- textElement = true;
- break;
- }
- }
- indentSpace = numSpaces;
- strBuff.delete(0, strBuff.length());
- }
-
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/antlib.xml
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -27,8 +27,8 @@
-
+
@@ -39,16 +39,19 @@
-
-
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/taskdefs/AntLintTask.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/taskdefs/AntLintTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/taskdefs/AntLintTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -18,7 +18,9 @@
package com.nokia.helium.antlint.ant.taskdefs;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import java.util.Vector;
@@ -27,11 +29,14 @@
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
+import com.nokia.helium.ant.data.AntFile;
+import com.nokia.helium.ant.data.Database;
import com.nokia.helium.antlint.ant.AntlintException;
import com.nokia.helium.antlint.ant.Reporter;
import com.nokia.helium.antlint.ant.Severity;
import com.nokia.helium.antlint.ant.types.Check;
import com.nokia.helium.antlint.ant.types.ConsoleReporter;
+import com.nokia.helium.antlint.ant.types.Executor;
/**
* AntLint Task. This task checks for common coding conventions and errors in
@@ -42,30 +47,32 @@
*
* CheckAntCall : checks whether antcall is used with no param elements and
* calls target with no dependencies
- * CheckDescription : checks for project description
- * CheckDuplicateNames : checks for duplicate macros
- * CheckFileName : checks the naming convention of ant xml files
- * CheckIndentation : checks indentation
- * CheckJepJythonScript : checks the coding convention in Jep and Jython
- * scripts
- * CheckPresetDefMacroDefName : checks the naming convention of presetdef
+ * checkDescription : checks for project description
+ * checkDuplicateNames : checks for duplicate macros and task names
+ * checkFileName : checks the naming convention of ant xml files
+ * checkIndentation : checks indentation
+ * checkJythonScript : checks the coding convention Jython scripts
+ * checkPresetDefMacroDefName : checks the naming convention of presetdef
* and macrodef
- * CheckProjectName : checks the naming convention of project
- * CheckPropertyName : checks the naming convention of properties
- *
+ * checkProjectName : checks the naming convention of project
+ * checkPropertyName : checks the naming convention of properties
+ * checkPropertyTypeAndValueMismatch : checks for property type and value
+ * mismatch
* CheckPythonTasks : checks the coding convention of python tasks
- * CheckRunTarget : checks whether runtarget calls a target that has
+ * checkRunTarget : checks whether runtarget calls a target that has
* dependencies
- * CheckScriptCondition : checks the coding convention in script condition
- * CheckScriptDef : checks the coding convention in scriptdef
- * CheckScriptDefNameAttributes - checks the naming convention of scriptdef
- * name attributes
- * CheckScriptDefStyle : checks the coding style of scriptdef
- * CheckScriptSize : checks the size of scripts
- * CheckTabCharacter : checks for tab characters
- * CheckTargetName : checks the naming convention of targets
- * CheckUseOfEqualsTask : checks the usage of equals task
- * CheckUseOfIfInTargets : checks the usage of if task inside targets
+ * checkScriptCondition : checks the coding convention in script condition
+ * CheckScriptDef : checks the coding convention in scriptdef and attributes
+ * used any
+ * checkScriptSize : checks the size of scripts
+ * checkTabCharacter : checks for tab characters
+ * checkTargetName : checks the naming convention of targets
+ * checkTryCatchBlock : checks for empty or more than one catch element in a
+ * try-catch block
+ * checkUseOfEqualsTask : checks the usage of equals task
+ * checkUseOfIfInTargets : checks the usage of if task inside targets
+ * checkVariableTask : checks whether value attribute for ant-contrib
+ * variable task is set or not when unset is set to true
*
*
*
@@ -79,7 +86,7 @@
*
*
*
- * Usage:
+ * Usage: By default, a check will be enabled. To disable a check set enabled=false.
*
* <antlint>
* <fileset id="antlint.files" dir="${antlint.test.dir}/data">
@@ -87,9 +94,9 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckTabCharacter" severity="error" enabled="true"/>
- * <CheckTargetName" severity="warning" enabled="true" regexp="([a-z0-9[\\d\\-]]*)"/>
- * <CheckScriptDef" severity="error" enabled="true" outputDir="${antlint.test.dir}/output"/>
+ * <CheckTabCharacter" severity="error" />
+ * <CheckTargetName" severity="warning" regexp="([a-z0-9[\\d\\-]]*)"/>
+ * <CheckScriptDef" severity="error" enabled="false" outputDir="${antlint.test.dir}/output"/>
* </antlint>
*
*
@@ -104,12 +111,16 @@
private int errorCount;
private boolean failOnError = true;
private ConsoleReporter consoleReporter = new ConsoleReporter();
+ private List executors = new Vector();
+
+ public void add(Executor executor) {
+ executors.add(executor);
+ }
/**
* Add a set of files to copy.
*
- * @param set
- * a set of files to AntLintTask.
+ * @param set a set of files to AntLintTask.
* @ant.required
*/
public void addFileset(FileSet set) {
@@ -120,24 +131,40 @@
* Execute the antlint task.
*/
public final void execute() {
- if (checkerList.size() == 0) {
- throw new BuildException("No antlint checks are defined.");
+ if (checkerList.size() == 0 && executors.size() == 0) {
+ throw new BuildException("No antlint checks/executors are defined.");
}
+
try {
// Adding console reported by default if no
- // other reporter are mentioned.
+ // other reporters are mentioned.
if (reporters.size() == 0) {
reporters.add(consoleReporter);
}
setTask(this);
open();
- doAntLintCheck();
+ List antFilePaths = new ArrayList();
+ for (FileSet fs : antFileSetList) {
+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+ String[] srcFiles = ds.getIncludedFiles();
+ String basedir = ds.getBasedir().getPath();
+ for (int i = 0; i < srcFiles.length; i++) {
+ String antFilename = basedir + File.separator + srcFiles[i];
+ antFilePaths.add(antFilename);
+ }
+ }
+ Database db = new Database(getProject(), "private");
+ db.addAntFilePaths(antFilePaths);
+ doAntLintCheck(db);
+ triggerExternalCommands(db);
} catch (AntlintException e) {
- throw new BuildException(
- "Exception occured while running AntLint task "
- + e.getMessage());
+ throw new BuildException("Exception occured while running AntLint task "
+ + e.getMessage());
+ } catch (IOException ex) {
+ throw new BuildException("Exception occured while creating Ant database"
+ + ex.getMessage());
} finally {
- // Closing all reporter session.
+ // Closing all reporter sessions.
close();
}
@@ -147,58 +174,47 @@
}
+ private void triggerExternalCommands(Database database) throws AntlintException {
+ for (Executor executor : executors) {
+ log("\n" + executor.getClass().getSimpleName() + " output:" + "\n");
+ executor.setDatabase(database);
+ executor.validateAttributes();
+ executor.run();
+ }
+ }
+
/**
* Triggers the antlint checking.
*
- * @throws AntlintException
- *
- * @throws Exception
- * if the checking fails.
+ * @throws AntlintException if the checking fails.
*/
- private void doAntLintCheck() throws AntlintException {
-
- for (FileSet fs : antFileSetList) {
- DirectoryScanner ds = fs.getDirectoryScanner(getProject());
- String[] srcFiles = ds.getIncludedFiles();
- String basedir = ds.getBasedir().getPath();
- for (int i = 0; i < srcFiles.length; i++) {
- String antFilename = basedir + File.separator + srcFiles[i];
- runChecks(new File(antFilename));
+ private void doAntLintCheck(Database database) throws AntlintException {
+ Collection antFiles = database.getAntFiles();
+ for (AntFile antFile : antFiles) {
+ for (Check check : checkerList) {
+ if (check.isEnabled()) {
+ check.validateAttributes();
+ check.setReporter(this);
+ check.setAntFile(antFile);
+ check.run();
+ }
}
}
}
/**
- * Runs antlint checks for the given ant file.
+ * Method to add Antlint checkers.
*
- * @param antFileName
- * is the name of the ant file to be checked.
- * @throws AntlintException
+ * @param check an antlint check to be added.
*/
- private void runChecks(File antFilename) throws AntlintException {
- for (Check check : checkerList) {
- if (check.isEnabled()) {
- check.validateAttributes();
- check.setReporter(this);
- check.run(antFilename);
- }
- }
-
+ public void add(Check check) {
+ checkerList.add(check);
}
/**
- * To add Antlint checkers.
+ * Method to add Antlint reporters.
*
- * @param c
- */
- public void add(Check c) {
- checkerList.add(c);
- }
-
- /**
- * To add reporters.
- *
- * @param reporter
+ * @param reporter a antlint reporter to be added.
*/
public void add(Reporter reporter) {
reporter.setTask(this);
@@ -206,8 +222,9 @@
}
/**
- * @param failOnError
- * the failOnError to set
+ * Boolean flag to set whether fail on error or not.
+ *
+ * @param failOnError the failOnError to set
*/
public void setFailOnError(boolean failOnError) {
this.failOnError = failOnError;
@@ -215,13 +232,11 @@
/*
* (non-Javadoc)
- *
* @see
* com.nokia.helium.antlint.ant.Reporter#report(com.nokia.helium.antlint
* .ant.Severity, java.lang.String, java.io.File, int)
*/
- public void report(Severity severity, String message, File filename,
- int lineNo) {
+ public void report(Severity severity, String message, File filename, int lineNo) {
if (severity.getValue().toUpperCase().equals("ERROR")) {
errorCount++;
}
@@ -233,7 +248,6 @@
/*
* (non-Javadoc)
- *
* @see
* com.nokia.helium.antlint.ant.Reporter#setTask(org.apache.tools.ant.Task)
*/
@@ -244,14 +258,20 @@
}
}
- @Override
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.helium.antlint.ant.Reporter#close()
+ */
public void close() {
for (Reporter reporter : reporters) {
reporter.close();
}
}
- @Override
+ /*
+ * (non-Javadoc)
+ * @see com.nokia.helium.antlint.ant.Reporter#open()
+ */
public void open() {
for (Reporter reporter : reporters) {
reporter.open();
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractAntFileStyleCheck.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractAntFileStyleCheck.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import com.nokia.helium.antlint.ant.AntlintException;
+
+/**
+ * AbstractAntFileStyleCheck
is an abstract check class used to
+ * parse an Ant file. The class uses an internal handler to receive
+ * notifications of XML parsing.
+ *
+ */
+public abstract class AbstractAntFileStyleCheck extends AbstractCheck {
+
+ private Locator locator;
+ private StringBuffer buffer = new StringBuffer();
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run() throws AntlintException {
+ try {
+ SAXParserFactory saxFactory = SAXParserFactory.newInstance();
+ saxFactory.setNamespaceAware(true);
+ saxFactory.setValidating(true);
+ SAXParser parser = saxFactory.newSAXParser();
+ AntlintHandler handler = new AntlintHandler();
+ parser.parse(getAntFile().getFile(), handler);
+ } catch (ParserConfigurationException e) {
+ throw new AntlintException("Not able to parse XML file " + e.getMessage());
+ } catch (SAXException e) {
+ throw new AntlintException("Not able to parse XML file " + e.getMessage());
+ } catch (IOException e) {
+ throw new AntlintException("Not able to find XML file " + e.getMessage());
+ }
+ }
+
+ /**
+ * Set the locator.
+ *
+ * @param locator is the locator to set
+ */
+ private void setLocator(Locator locator) {
+ this.locator = locator;
+ }
+
+ /**
+ * Return the locator.
+ *
+ * @return the locator
+ */
+ public Locator getLocator() {
+ return locator;
+ }
+
+ protected void clearBuffer() {
+ buffer.delete(0, buffer.length());
+ }
+
+ /**
+ * Method to handle the element start notification.
+ *
+ * @param text is the text read at element start notification.
+ * @param lineNum is the current line number where the parser is reading.
+ */
+ protected abstract void handleStartElement(String text);
+
+ /**
+ * Method to handle the element end notification.
+ *
+ * @param text is the text read at element end notification.
+ * @param lineNum is the current line number where the parser is reading.
+ */
+ protected abstract void handleEndElement(String text);
+
+ /**
+ * Method to handle the document start notification.
+ */
+ protected abstract void handleStartDocument();
+
+ /**
+ * Method to handle the document end notification.
+ */
+ protected abstract void handleEndDocument();
+
+ /**
+ * A private class used to receive xml parsing notifications.
+ *
+ */
+ private class AntlintHandler extends DefaultHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setDocumentLocator(Locator locator) {
+ setLocator(locator);
+ }
+
+ public void startDocument() throws SAXException {
+ handleStartDocument();
+ }
+
+ @Override
+ public void endDocument() throws SAXException {
+ handleEndDocument();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void startElement(String uri, String name, String qName, Attributes atts) {
+ handleStartElement(buffer.toString());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void endElement(String uri, String name, String qName) {
+ handleEndElement(buffer.toString());
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void characters(char[] ch, int start, int length) {
+ for (int i = start; i < start + length; i++) {
+ buffer.append(ch[i]);
+ }
+ }
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractCheck.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractCheck.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractCheck.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,13 +16,13 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.DataType;
-import org.dom4j.Element;
-import org.dom4j.Node;
+import com.nokia.helium.ant.data.AntFile;
import com.nokia.helium.antlint.ant.Reporter;
import com.nokia.helium.antlint.ant.Severity;
@@ -35,10 +35,26 @@
private boolean enabled = true;
private Severity severity;
private Reporter reporter;
+ private AntFile antFile;
/**
- * @param enabled
- * the enabled to set
+ * Return the ant file.
+ *
+ * @return the ant file.
+ */
+ protected AntFile getAntFile() {
+ return antFile;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setAntFile(AntFile antFile) {
+ this.antFile = antFile;
+ }
+
+ /**
+ * {@inheritDoc}
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
@@ -53,7 +69,6 @@
/*
* (non-Javadoc)
- *
* @see
* com.nokia.helium.antlint.ant.types.Check#setReporter(com.nokia.helium
* .antlint.ant.Reporter)
@@ -64,7 +79,6 @@
/*
* (non-Javadoc)
- *
* @see com.nokia.helium.antlint.ant.types.Check#getReporter()
*/
public Reporter getReporter() {
@@ -73,7 +87,6 @@
/*
* (non-Javadoc)
- *
* @see
* com.nokia.helium.antlint.ant.types.Check#setSeverity(com.nokia.helium
* .antlint.ant.Severity)
@@ -85,7 +98,6 @@
/*
* (non-Javadoc)
- *
* @see com.nokia.helium.antlint.ant.types.Check#getSeverity()
*/
public Severity getSeverity() {
@@ -93,43 +105,64 @@
}
/**
- * {@inheritDoc}
- */
- public void run(Element node) {
- // ignore
- }
-
- /**
- * Return the nodes matching search element.
+ * Method to validate checker attributes.
*
- * @param element
- * @param elementName
- * @param returnNodes
*/
- public void elementTreeWalk(Element element, String elementName,
- List returnNodes) {
- for (int i = 0, size = element.nodeCount(); i < size; i++) {
- Node node = element.node(i);
- if (node instanceof Element) {
- if (node.getName().equals(elementName)) {
- returnNodes.add((Element) node);
- }
- elementTreeWalk((Element) node, elementName, returnNodes);
- }
+ public void validateAttributes() {
+ if (severity == null) {
+ throw new BuildException("'severity' attribute should be specified for checker '"
+ + this.toString() + "'");
}
}
/**
- * To validate checker attributes.
+ * Sends the given message to the configured reporter.
*
- * @return
+ * @param message is the message to be sent.
*/
- public void validateAttributes() {
- if (severity == null) {
- throw new BuildException(
- "'severity' attribute should be specified for checker '"
- + this.toString() + "'");
- }
+ protected void report(String message) {
+ report(message, 0);
+ }
+
+ /**
+ * Sends the given message with exact line number to the configured
+ * reporter.
+ *
+ * @param message is the message to be sent.
+ * @param lineNum is the line number.
+ */
+ protected void report(String message, int lineNum) {
+ getReporter().report(getSeverity(), message, getAntFile().getFile(), lineNum);
}
+ /**
+ * Method validates the given input string against the input regex pattern.
+ *
+ * @param input is the string to be validated.
+ * @param regex is the regex pattern
+ * @return true, if matches; otherwise false.
+ */
+ protected boolean matches(String input, String regex) {
+ Pattern pattern = Pattern.compile(regex);
+ Matcher matcher = pattern.matcher(input);
+ return matcher.matches();
+ }
+
+ protected boolean matchFound(String input, String regex) {
+ boolean found = false;
+ Pattern p1 = Pattern.compile(regex);
+ Matcher m1 = p1.matcher(input);
+ while (m1.find()) {
+ found = true;
+ }
+ return found;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.apache.tools.ant.types.DataType#toString()
+ */
+ public String toString() {
+ return getClass().getSimpleName();
+ }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractProjectCheck.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractProjectCheck.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.antlint.ant.AntlintException;
+
+/**
+ * AbstractProjectCheck
is an abstract check class used to run
+ * against a {@link ProjectMeta} or an {@link AntlibMeta}.
+ *
+ */
+public abstract class AbstractProjectCheck extends AbstractCheck {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run() throws AntlintException {
+ RootAntObjectMeta rootObjectMeta = getAntFile().getRootObjectMeta();
+ run(rootObjectMeta);
+
+ }
+
+ /**
+ * Method runs the check against the given {@link RootAntObjectMeta}.
+ *
+ * @param root is the {@link RootAntObjectMeta} against which the check is
+ * run.
+ */
+ protected abstract void run(RootAntObjectMeta root);
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractScriptCheck.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractScriptCheck.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractScriptCheck.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,97 +16,113 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.tools.ant.BuildException;
+import com.nokia.helium.ant.data.AntlibMeta;
+import com.nokia.helium.ant.data.MacroMeta;
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.ant.data.TargetMeta;
/**
* AbstractScriptCheck
is an abstract implementation of
* {@link Check} and contains some concrete methods related to script.
*
*/
-public abstract class AbstractScriptCheck extends AbstractCheck {
+public abstract class AbstractScriptCheck extends AbstractTargetCheck {
/**
- * Write a script with the given name and the text.
- *
- * @param name
- * is the name of the script
- * @param text
- * is the script text.
+ * {@inheritDoc}
*/
- protected void writeJythonFile(String name, String text, File outputDir) {
- if (outputDir == null) {
- throw new BuildException("'output' attribute for the checker '"
- + this.toString() + "' should be specified.");
- }
- if (text.contains("${")) {
- this.getReporter().report(this.getSeverity(),
- "${ found in " + name, this.getAntFile(), 0);
+ protected void run(RootAntObjectMeta root) {
+ super.run(root);
+ if (getMacroXPathExpression() != null) {
+ if (root instanceof ProjectMeta) {
+ ProjectMeta projectMeta = (ProjectMeta) root;
+ List macros = projectMeta
+ .getScriptDefinitions(getMacroXPathExpression());
+ for (MacroMeta macroMeta : macros) {
+ run(macroMeta);
+ }
+ }
+ if (root instanceof AntlibMeta) {
+ AntlibMeta antlibMeta = (AntlibMeta) root;
+ List macros = antlibMeta.getScriptDefinitions(getMacroXPathExpression());
+ for (MacroMeta macroMeta : macros) {
+ run(macroMeta);
+ }
+ }
}
- try {
- String heliumpath = outputDir.getCanonicalPath();
- new File(heliumpath + File.separator + "jep").mkdirs();
- File file = new File(heliumpath + File.separator + "jep"
- + File.separator + name + "_jep.py");
- PrintWriter output = new PrintWriter(new FileOutputStream(file));
- output.write("def abc():\n");
- output.write(" attributes = {} # pylint: disable-msg=C0103\n");
- output.write(" elements = {} # pylint: disable-msg=C0103\n");
- output.write(" project = None # pylint: disable-msg=C0103\n");
- output.write(" self = None # pylint: disable-msg=C0103\n");
- text = text.replace(" File(", " self.File(");
- for (String line : text.split("\n")) {
- output.write(" " + line + "\n");
- }
- output.close();
+ }
- if (text.contains("import ")) {
- File file2 = new File(heliumpath + File.separator
- + "test_jython.xml");
- PrintWriter output2 = new PrintWriter(new FileOutputStream(
- file2, true));
- output2.write("try:\n");
- for (String line : text.split("\n")) {
- if (line.trim().startsWith("import ")
- || line.trim().startsWith("from ")) {
- output2.write(" " + line + "\n");
- }
- }
-
- output2.write("except ImportError, e:\n");
- output2.write(" print '" + name + " failed: ' + str(e)\n");
- output2.close();
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(TargetMeta targetMeta) {
+ String xpath = getScriptXPathExpression(targetMeta.getName());
+ if (xpath != null) {
+ List macros = targetMeta.getScriptDefinitions(xpath);
+ for (MacroMeta macroMeta : macros) {
+ run(macroMeta);
}
- } catch (IOException e) {
- throw new BuildException("Not able to write JEP File " + name
- + "_jep.py");
}
}
/**
- * Check for the properties in the given script text.
+ * Method returns the name of the macro or a constructed name for the given
+ * script using its parent name.
*
- * @param text
- * is the script text to lookup.
+ * @param macroMeta is an instance of Macrometa.
+ * @return name of the script
+ */
+ protected String getScriptName(MacroMeta macroMeta) {
+ String name = macroMeta.getName();
+ if (name.isEmpty()) {
+ name = "target_" + macroMeta.getParent().getName();
+ }
+ return name;
+ }
+
+ /**
+ * Method runs the check against the input {@link MacroMeta}.
+ *
+ * @param macroMeta is the {@link MacroMeta} against whom the check is run.
+ */
+ protected abstract void run(MacroMeta macroMeta);
+
+ /**
+ * Get the xpath expression of the macro.
+ *
+ * @return the xpath expression of the macro.
*/
- protected void checkJepPropertiesInText(String text) {
- Pattern p1 = Pattern
- .compile("getProperty\\([\"']([a-zA-Z0-9\\.]*)[\"']\\)");
- Matcher m1 = p1.matcher(text);
- ArrayList props = new ArrayList();
- while (m1.find()) {
- props.add(m1.group(1));
+ protected abstract String getMacroXPathExpression();
+
+ /**
+ * Get the xpath expression for the input target.
+ *
+ * @param targetName is the name of the target.
+ * @return the xpath expression for the input target.
+ */
+ protected abstract String getScriptXPathExpression(String targetName);
+
+ /**
+ * Method returns a list of property names used in the given script
+ * definition.
+ *
+ * @param macroMeta the macrometa instance to lookup.
+ * @return a list of used property names
+ */
+ protected List getUsedProperties(MacroMeta macroMeta) {
+ Pattern pattern = Pattern.compile("attributes.get\\([\"']([^\"']*)[\"']\\)");
+ Matcher matcher = pattern.matcher(macroMeta.getText());
+ List usedPropertyList = new ArrayList();
+ while (matcher.find()) {
+ usedPropertyList.add(matcher.group(1));
}
- /*
- * for (String group : props) { checkPropertyInModel(group); }
- */
+ return usedPropertyList;
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractTargetCheck.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractTargetCheck.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.util.List;
+
+import org.apache.tools.ant.Target;
+
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.ant.data.TargetMeta;
+
+/**
+ * AbstractTargetCheck
is an abstract check class used to run
+ * against target level.
+ *
+ */
+public abstract class AbstractTargetCheck extends AbstractProjectCheck {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(RootAntObjectMeta root) {
+ if (root instanceof ProjectMeta) {
+ ProjectMeta projectMeta = (ProjectMeta) root;
+ List targets = projectMeta.getTargets();
+ for (TargetMeta targetMeta : targets) {
+ run(targetMeta);
+ }
+ }
+ }
+
+ /**
+ * Check the availability of dependent targets for the given target.
+ *
+ * @param targetName is the target for which dependent targets to be looked
+ * up.
+ * @return true, if the dependant targets are available; otherwise false
+ */
+ protected boolean checkTargetDependency(String targetName) {
+ Target targetDependency = (Target) getProject().getTargets().get(targetName);
+ return targetDependency != null && targetDependency.getDependencies().hasMoreElements();
+ }
+
+ /**
+ * Method to run the check against the input {@link TargetMeta}.
+ *
+ * @param targetMeta is the {@link TargetMeta} against whom the check is
+ * run.
+ */
+ protected abstract void run(TargetMeta targetMeta);
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/BeanshellScriptDump.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/BeanshellScriptDump.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import org.apache.tools.ant.BuildException;
+
+import com.nokia.helium.ant.data.MacroMeta;
+
+/**
+ * BeanshellScriptDumper
is used to extract and dump beanshell
+ * scripts from the Ant files.
+ */
+public class BeanshellScriptDump extends ScriptDump {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getMacroXPathExpression() {
+ return "//scriptdef";
+ }
+
+ protected String getScriptXPathExpression(String targetName) {
+ return null;
+ }
+
+ protected void run(MacroMeta macroMeta) {
+ String language = macroMeta.getAttr("language");
+ if (language.equals("beanshell")) {
+ writeBeanshellFile(macroMeta.getName(), macroMeta.getText());
+ }
+ }
+
+ /**
+ * Write a bean shell file with the given text.
+ *
+ * @param scriptdefname is the name of the file to be written.
+ * @param text is the text to be written inside the file.
+ */
+ private void writeBeanshellFile(String scriptdefname, String text) {
+ PrintWriter output = null;
+ scriptdefname = "Beanshell" + scriptdefname;
+
+ try {
+ String outputPath = getOutputDir().getCanonicalPath();
+ new File(outputPath).mkdirs();
+ File file = new File(outputPath + File.separator + scriptdefname + ".java");
+ output = new PrintWriter(new FileOutputStream(file));
+
+ for (String line : text.split("\n")) {
+ if (line.trim().startsWith("import")) {
+ output.write(line + "\n");
+ }
+ }
+ output.write("/**\n * x\n */\npublic final class " + scriptdefname + " {\n");
+ output.write(" private " + scriptdefname + "() { }\n");
+ output.write(" public static void main(String[] args) {\n");
+ for (String line : text.split("\n")) {
+ if (!line.trim().startsWith("import")) {
+ output.write(" " + line + "\n");
+ }
+ }
+ output.write(" }\n");
+ output.write("}\n");
+ } catch (IOException e) {
+ throw new BuildException("Not able to write Beanshell File " + scriptdefname + ".java");
+ } finally {
+ if (output != null) {
+ output.close();
+ }
+ }
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Check.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Check.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Check.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,38 +16,24 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-
-import org.dom4j.Element;
-
+import com.nokia.helium.ant.data.AntFile;
import com.nokia.helium.antlint.ant.AntlintException;
import com.nokia.helium.antlint.ant.Reporter;
import com.nokia.helium.antlint.ant.Severity;
/**
- * Check
represents a basic antlint component responsible for
- * running the user configured checks.
+ * Check
represents a basic antlint validation component
+ * responsible for running the user configured checks.
*
*/
public interface Check {
/**
- * Method runs the configured checks against the given node.
+ * Method runs the configured check against a ant file.
*
- * @param node
- * is the node of the xml to be checked.
+ * @throws AntlintException if check fails
*/
- void run(Element node);
-
- /**
- * Method runs the configured checks against the given ant file.
- *
- * @param fileName
- * is the name of the ant file.
- * @param reporter
- * @throws AntlintException
- */
- void run(File fileName) throws AntlintException;
+ void run() throws AntlintException;
/**
* Return whether this is check is enabled or not.
@@ -97,17 +83,16 @@
Reporter getReporter();
/**
- * Return ant file.
- *
- * @return
- */
- File getAntFile();
-
- /**
* To return current checker name.
*
* @return
*/
String toString();
+ /**
+ * Set the ant file.
+ *
+ * @param antFile the ant file to set.
+ */
+ void setAntFile(AntFile antFile);
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckAntCall.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckAntCall.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckAntCall.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,21 +16,14 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
import java.util.List;
-import org.apache.tools.ant.Target;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.TargetMeta;
+import com.nokia.helium.ant.data.TaskMeta;
/**
- * CheckAntCall
is used to check whether antcall is used with no param elements and
- * calls the target with no dependencies
+ * CheckAntCall
is used to check whether antcall is used with no
+ * param elements and calls the target with no dependencies
*
*
* Usage:
@@ -45,97 +38,25 @@
* </antlint>
*
*
- * @ant.task name="CheckAntCall" category="AntLint"
+ * @ant.task name="checkAntCall" category="AntLint"
*/
-public class CheckAntCall extends AbstractCheck {
-
- private File antFile;
+public class CheckAntCall extends AbstractTargetCheck {
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkAntCalls(node);
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node is the node to check.
- */
- @SuppressWarnings("unchecked")
- private void checkAntCalls(Element node) {
- if (node.elements("antcall") != null) {
- List antcallList = node.elements("antcall");
- for (Element antcallElement : antcallList) {
- String antcallName = antcallElement.attributeValue("target");
- if (((node.elements("param") == null) || (node.elements("param") != null && node.elements("param").isEmpty()))
- && !checkTargetDependency(antcallName)) {
- this.getReporter().report(this.getSeverity(), " is used with no param elements and calls the target "
- + antcallName
- + " that has no dependencies! ( could be used instead.)", this.getAntFile(), 0);
- }
+ public void run(TargetMeta targetMeta) {
+ List antCalls = targetMeta.getTasks("antcall");
+ int count = 0;
+ count++;
+ for (TaskMeta antCallMeta : antCalls) {
+ if (antCallMeta.getParams().isEmpty()
+ && !checkTargetDependency(antCallMeta.getAttr("target"))) {
+ report(" is used with no param " + "elements and calls the target '"
+ + antCallMeta.getAttr("target")
+ + "' that has no dependencies! ( could be used instead.)",
+ antCallMeta.getLineNumber());
}
}
}
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- List targetNodes = new ArrayList();
-
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", targetNodes);
- }
- catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
-
- for (Element targetNode : targetNodes) {
- run(targetNode);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckAntCall";
- }
-
- /**
- * Check the availability dependent targets of the given target.
- *
- * @param targetName is the target for which dependent targets to be loked up.
- * @return true, if the dependant targets are available; otherwise false
- */
- private boolean checkTargetDependency(String targetName) {
- boolean dependencyCheck = false;
- Target targetDependency = (Target) getProject().getTargets().get(targetName);
- dependencyCheck = targetDependency != null
- && targetDependency.getDependencies().hasMoreElements();
- return dependencyCheck;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDescription.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDescription.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDescription.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,14 +16,8 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
/**
* CheckDescription
is used to check whether project description is
@@ -38,60 +32,20 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckDescription" severity="error" enabled="true"/>
+ * <checkDescription severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckDescription" category="AntLint"
+ * @ant.task name="checkDescription" category="AntLint"
*/
-public class CheckDescription extends AbstractCheck {
-
- private File antFile;
+public class CheckDescription extends AbstractProjectCheck {
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("project")
- && node.element("description") == null) {
- this.getReporter().report(this.getSeverity(),
- "Description not specified!", this.getAntFile(), 0);
+ protected void run(RootAntObjectMeta root) {
+ if (root instanceof ProjectMeta && ((ProjectMeta) root).getDescription().isEmpty()) {
+ report("Description not specified!", root.getLineNumber());
}
}
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- run(doc.getRootElement());
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckDescription";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDuplicateNames.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDuplicateNames.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDuplicateNames.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,12 +16,19 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
import java.util.ArrayList;
import java.util.Hashtable;
+import java.util.List;
+
+import org.apache.tools.ant.taskdefs.MacroInstance;
+import org.apache.tools.ant.taskdefs.optional.script.ScriptDefBase;
+
+import com.nokia.helium.ant.data.MacroMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
/**
- * CheckDuplicateNames
is used to check for duplicate macro names.
+ * CheckDuplicateNames
is used to check for duplicate macro and
+ * task names.
*
*
* Usage:
@@ -32,57 +39,53 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckDuplicateNames" severity="error" enabled="true"/>
+ * <checkDuplicateNames severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckDuplicateNames" category="AntLint"
+ * @ant.task name="checkDuplicateNames" category="AntLint"
*/
-public class CheckDuplicateNames extends AbstractCheck {
+public class CheckDuplicateNames extends AbstractProjectCheck {
- private File antFile;
+ private static final String HELIUM_URI = "http://www.nokia.com/helium";
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
+ private List heliumTaskList;
+
+ /**
+ * {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- public void run(File antFilename) {
- this.antFile = antFilename;
- Hashtable> taskdefs = getProject()
- .getTaskDefinitions();
- ArrayList macros = new ArrayList(taskdefs.keySet());
-
- for (String macroName : macros) {
- if (macros.contains(macroName + "Macro")
- || macros.contains(macroName + "macro")) {
- this.getReporter()
- .report(
- this.getSeverity(),
- macroName + " and " + macroName + "Macro"
- + " found duplicate name",
- this.getAntFile(), 0);
+ protected void run(RootAntObjectMeta root) {
+ if (heliumTaskList == null) {
+ setHeliumTaskList(root);
+ }
+ List macros = root.getMacros();
+ if (heliumTaskList != null ) {
+ for (MacroMeta macroMeta : macros) {
+ if (heliumTaskList.contains(macroMeta.getName())) {
+ report("Task '" + macroMeta.getName() + "' and macro '" + macroMeta.getName()
+ + "' has duplicate name.", macroMeta.getLineNumber());
+ }
}
}
}
- /*
- * (non-Javadoc)
+ /**
+ * Method sets a list of helium tasks.
*
- * @see org.apache.tools.ant.types.DataType#toString()
+ * @param root is the {@link RootAntObjectMeta} used to lookup for tasks.
*/
- public String toString() {
- return "CheckDuplicateNames";
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private void setHeliumTaskList(RootAntObjectMeta root) {
+ heliumTaskList = new ArrayList();
+ Hashtable> taskdefs = root.getRuntimeProject().getTaskDefinitions();
+ List list = new ArrayList(taskdefs.keySet());
+ for (String taskName : list) {
+ Class clazz = taskdefs.get(taskName);
+ int index = taskName.lastIndexOf(":");
+ if (taskName.startsWith(HELIUM_URI)
+ && !(clazz.equals(MacroInstance.class) || clazz.equals(ScriptDefBase.class))) {
+ heliumTaskList.add(taskName.substring(index + 1));
+ }
+ }
}
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckFileName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckFileName.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckFileName.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,10 +16,6 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
/**
* CheckFileName
is used to check the naming convention of the ant
* files.
@@ -33,71 +29,42 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckFileName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)"/>
+ * <checkFileName severity="error" regexp="([a-z0-9[\\d\\-]]*)"/>
* </antlint>
*
*
- * @ant.task name="CheckFileName" category="AntLint"
+ * @ant.task name="checkFileName" category="AntLint"
*
*/
public class CheckFileName extends AbstractCheck {
private String regExp;
- private File antFile;
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
+ /**
+ * {@inheritDoc}
*/
- public void run(File antFilename) {
- if (antFilename != null) {
- this.antFile = antFilename;
- boolean found = false;
- Pattern p1 = Pattern.compile(getRegExp());
- Matcher m1 = p1.matcher(antFilename.getName());
- while (m1.find()) {
- found = true;
- }
- if (!found) {
- this.getReporter().report(this.getSeverity(),
- "INVALID File Name: " + antFilename.getName(),
- this.getAntFile(), 0);
- }
+ public void run() {
+ String fileName = getAntFile().getFile().getName();
+ if (!matchFound(fileName, getRegExp())) {
+ report("Invalid file Name: " + fileName);
}
}
/**
- * @param regExp
- * the regExp to set
+ * Method to set the regular expression.
+ *
+ * @param regExp the regExp to set
*/
public void setRegExp(String regExp) {
this.regExp = regExp;
}
/**
- * @return the regExp
+ * Method returns the regular expression.
+ *
+ * @return the regular expression
*/
public String getRegExp() {
return regExp;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckFileName";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckIndentation.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckIndentation.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckIndentation.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,18 +16,6 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.xml.sax.SAXException;
-
-import com.nokia.helium.antlint.AntLintHandler;
-import com.nokia.helium.antlint.ant.AntlintException;
-
/**
* CheckIndentation
is used to check the indentations in the ant
* files.
@@ -41,58 +29,96 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckIndentation" severity="error" enabled="true" />
+ * <checkIndentation severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckIndentation" category="AntLint"
+ * @ant.task name="checkIndentation" category="AntLint"
*
*/
-public class CheckIndentation extends AbstractCheck {
- private File antFile;
+public class CheckIndentation extends AbstractAntFileStyleCheck {
+ private static final int INDENT_SPACES = 4;
+ private int indentLevel;
+ private int totalNoOfSpaces;
+ private boolean textElement;
+ private int currentLine;
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
+ /**
+ * {@inheritDoc}
+ */
+ public void handleStartDocument() {
+ indentLevel -= INDENT_SPACES;
+ }
+
+ @Override
+ protected void handleEndDocument() {
+ indentLevel = 0;
+ }
+
+ /**
+ * {@inheritDoc}
*/
- public void run(File antFilename) throws AntlintException {
- try {
- this.antFile = antFilename;
- SAXParserFactory saxFactory = SAXParserFactory.newInstance();
- saxFactory.setNamespaceAware(true);
- saxFactory.setValidating(true);
- SAXParser parser = saxFactory.newSAXParser();
- AntLintHandler handler = new AntLintHandler(this);
- handler.setIndentationCheck(true);
- parser.parse(antFilename, handler);
- } catch (ParserConfigurationException e) {
- throw new AntlintException("Not able to parse XML file "
- + e.getMessage());
- } catch (SAXException e) {
- throw new AntlintException("Not able to parse XML file "
- + e.getMessage());
- } catch (IOException e) {
- throw new AntlintException("Not able to find XML file "
- + e.getMessage());
+ public void handleStartElement(String text) {
+ countSpaces(text);
+
+ // When an element start tag is encountered,
+ // indentLevel is increased 4 spaces.
+ indentLevel += INDENT_SPACES;
+
+ checkIndent(text);
+ currentLine = getLocator().getLineNumber();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void handleEndElement(String text) {
+ countSpaces(text);
+ // Ignore end tags in the same line
+ if (currentLine != getLocator().getLineNumber()) {
+ checkIndent(text);
+ }
+ // When an element end tag is encountered,
+ // indentLevel is decreased 4 spaces.
+ indentLevel -= INDENT_SPACES;
+ textElement = false;
+ }
+
+ /**
+ * Check for indentation.
+ *
+ */
+ private void checkIndent(String text) {
+ if ((totalNoOfSpaces != indentLevel) && !textElement) {
+ report("Bad indentation : ", getLocator().getLineNumber());
}
}
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
+ /**
+ * Method counts the number of spaces.
*/
- public String toString() {
- return "CheckIndentation";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
+ public void countSpaces(String text) {
+ // Counts spaces and tabs in every newline.
+ int numSpaces = 0;
+ for (int i = 0; i < text.length(); i++) {
+ switch (text.charAt(i)) {
+ case '\t':
+ numSpaces += 4;
+ break;
+ case '\n':
+ numSpaces = 0;
+ break;
+ case ' ':
+ numSpaces++;
+ break;
+ default:
+ // An alphanumeric character encountered
+ // set the text element flag
+ textElement = true;
+ break;
+ }
+ }
+ totalNoOfSpaces = numSpaces;
+ clearBuffer();
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckJythonScript.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckJythonScript.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckJythonScript.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,20 +16,11 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.MacroMeta;
/**
- * CheckJepJythonScript
is used to check the coding convention in
- * Jep and Jython scripts
+ * CheckJythonScript
is used to check the coding convention of
+ * Jython scripts
*
*
* Usage:
@@ -40,110 +31,36 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckJepJythonScript" severity="error" enabled="true" />
+ * <checkJythonScript severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckJepJythonScript" category="AntLint"
+ * @ant.task name="checkJythonScript" category="AntLint"
*
*/
public class CheckJythonScript extends AbstractScriptCheck {
- private File outputDir;
- private File antFile;
-
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkScripts(node);
- }
-
- if (node.getName().equals("scriptdef")) {
- String scriptdefname = node.attributeValue("name");
- String language = node.attributeValue("language");
- if (language.equals("jython")) {
- writeJythonFile(scriptdefname, node.getText(), outputDir);
- }
- }
+ protected String getMacroXPathExpression() {
+ return "//scriptdef";
}
/**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
+ * {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- private void checkScripts(Element node) {
- String target = node.attributeValue("name");
- List scriptList = node.selectNodes("//target[@name='" + target
- + "']/descendant::script");
- for (Element scriptElement : scriptList) {
- String language = scriptElement.attributeValue("language");
- if (language.equals("jython")) {
- writeJythonFile("target_" + target, scriptElement.getText(),
- outputDir);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- List scriptNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", scriptNodes);
- elementTreeWalk(doc.getRootElement(), "scriptdef", scriptNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element targetNode : scriptNodes) {
- run(targetNode);
- }
-
+ protected String getScriptXPathExpression(String targetName) {
+ return ".//script";
}
/**
- * @param outputDir
- * the outputDir to set
+ * {@inheritDoc}
*/
- public void setOutputDir(File outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- * @return the outputDir
- */
- public File getOutputDir() {
- return outputDir;
+ protected void run(MacroMeta macroMeta) {
+ String language = macroMeta.getAttr("language");
+ if (language != null && language.equals("jython") && macroMeta.getText().contains("${")) {
+ report("${ found in " + getScriptName(macroMeta));
+ }
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckJepJythonScript";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPresetDefMacroDefName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPresetDefMacroDefName.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPresetDefMacroDefName.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,18 +16,10 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.AntObjectMeta;
+import com.nokia.helium.ant.data.MacroMeta;
/**
* CheckPresetDefMacroDefName
is used to check the naming
@@ -42,108 +34,63 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckPresetDefMacroDefName" severity="error" enabled="true" />
+ * <checkPresetDefMacroDefName severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckPresetDefMacroDefName" category="AntLint"
+ * @ant.task name="checkPresetDefMacroDefName" category="AntLint"
*
*/
-public class CheckPresetDefMacroDefName extends AbstractCheck {
+public class CheckPresetDefMacroDefName extends AbstractScriptCheck {
private String regExp;
- private File antFile;
/**
* {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- public void run(Element node) {
- if (node.getName().equals("presetdef")
- || node.getName().equals("macrodef")) {
- String text = node.attributeValue("name");
- if (text != null && !text.isEmpty()) {
- checkDefName(text);
+ protected String getMacroXPathExpression() {
+ return "//macrodef | //presetdef";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getScriptXPathExpression(String targetName) {
+ return ".//script";
+ }
- }
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(MacroMeta macroMeta) {
+ validateName(macroMeta.getName(), macroMeta);
+ List attributes = macroMeta.getAttributes();
+ for (String attrName : attributes) {
+ validateName(attrName, macroMeta);
+ }
+ }
- List attributeList = node.elements("attribute");
- for (Element attributeElement : attributeList) {
- String attributeName = attributeElement.attributeValue("name");
- checkDefName(attributeName);
- }
+ private void validateName(String name, AntObjectMeta object) {
+ if (name != null && !name.isEmpty() && !matches(name, getRegExp())) {
+ report("Invalid presetdef/macrodef name: " + name, object.getLineNumber());
}
}
/**
- * Check the given text.
- *
- * @param text
- * is the text to check.
- */
- private void checkDefName(String text) {
- Pattern p1 = Pattern.compile(getRegExp());
- Matcher m1 = p1.matcher(text);
- if (!m1.matches()) {
- this.getReporter().report(this.getSeverity(),
- "INVALID PRESETDEF/MACRODEF Name: " + text,
- this.getAntFile(), 0);
- }
- }
-
- /*
- * (non-Javadoc)
+ * Set the regular expression.
*
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- List presetDefNodes = new ArrayList();
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "presetdef", presetDefNodes);
- elementTreeWalk(doc.getRootElement(), "macrodef", presetDefNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element presetDefNode : presetDefNodes) {
- run(presetDefNode);
- }
- }
-
- /**
- * @param regExp
- * the regExp to set
+ * @param regExp the regExp to set
*/
public void setRegExp(String regExp) {
this.regExp = regExp;
}
/**
+ * Get the regular expression.
+ *
* @return the regExp
*/
public String getRegExp() {
return regExp;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckPresetDefMacroDefName";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckProjectName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckProjectName.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckProjectName.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,16 +16,7 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
/**
* CheckProjectName
is used to check the naming convention of
@@ -40,98 +31,44 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckProjectName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
+ * <checkProjectName severity="error" regexp="([a-z0-9[\\d\\-]]*)" />
* </antlint>
*
*
- * @ant.task name="CheckProjectName" category="AntLint"
+ * @ant.task name="checkProjectName" category="AntLint"
*
*/
-public class CheckProjectName extends AbstractCheck {
+public class CheckProjectName extends AbstractProjectCheck {
private String regExp;
- private File antFile;
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("project")) {
- String text = node.attributeValue("name");
- if (text != null && !text.isEmpty()) {
- checkProjectName(text);
- } else {
- this.getReporter().report(this.getSeverity(),
- "Project name not specified!", this.getAntFile(), 0);
- }
+ protected void run(RootAntObjectMeta root) {
+ if (root != null && !root.getName().isEmpty() && !matches(root.getName(), getRegExp())) {
+ report("Invalid project name: " + root.getName(), root.getLineNumber());
+ }
+ if (root != null && root.getName().isEmpty()) {
+ report("Project name not specified!", root.getLineNumber());
}
}
/**
- * Check the given the project name.
- *
- * @param text
- * is the text to check.
- */
- private void checkProjectName(String text) {
- Pattern p1 = Pattern.compile(getRegExp());
- Matcher m1 = p1.matcher(text);
- if (!m1.matches()) {
- this.getReporter().report(this.getSeverity(),
- "INVALID Project Name: " + text, this.getAntFile(), 0);
- }
- }
-
- /*
- * (non-Javadoc)
+ * Set the regular expresssion.
*
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- run(doc.getRootElement());
-
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
-
- }
-
- /**
- * @param regExp
- * the regExp to set
+ * @param regExp the regExp to set
*/
public void setRegExp(String regExp) {
this.regExp = regExp;
}
/**
+ * Get the regular expression.
+ *
* @return the regExp
*/
public String getRegExp() {
return regExp;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckProjectName";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPropertyName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPropertyName.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPropertyName.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,18 +16,11 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.PropertyMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
/**
* CheckPropertyName
is used to check the naming convention of
@@ -42,121 +35,48 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckPropertyName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
+ * <checkPropertyName severity="error" regexp="([a-z0-9[\\d\\-]]*)" />
* </antlint>
*
*
- * @ant.task name="CheckPropertyName" category="AntLint"
+ * @ant.task name="checkPropertyName" category="AntLint"
*
*/
-public class CheckPropertyName extends AbstractCheck {
+public class CheckPropertyName extends AbstractProjectCheck {
- private ArrayList propertiesVisited = new ArrayList();
private String regExp;
- private File antFile;
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("property")) {
- String text = node.attributeValue("name");
- if (text != null && !text.isEmpty()) {
- checkPropertyName(text);
+ protected void run(RootAntObjectMeta root) {
+ if (root instanceof ProjectMeta) {
+ ProjectMeta projectMeta = (ProjectMeta) root;
+ List properties = projectMeta.getProperties();
+ for (PropertyMeta propertyMeta : properties) {
+ if (!matches(propertyMeta.getName(), getRegExp())) {
+ report("Invalid property name: " + propertyMeta.getName(),
+ propertyMeta.getLineNumber());
+ }
}
}
}
/**
- * Check the given property name.
- *
- * @param propertyName
- * is the property name to check.
- */
- private void checkPropertyName(String propertyName) {
- Pattern p1 = Pattern.compile(getRegExp());
- Matcher m1 = p1.matcher(propertyName);
- if (!m1.matches() && !isPropertyAlreadyVisited(propertyName)) {
- this.getReporter().report(this.getSeverity(),
- "INVALID Property Name: " + propertyName,
- this.getAntFile(), 0);
- markPropertyAsVisited(propertyName);
- }
- }
-
- /*
- * (non-Javadoc)
+ * Set the regular expression.
*
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- List propertyNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "property", propertyNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element propertyNode : propertyNodes) {
- run(propertyNode);
- }
- }
-
- /**
- * Check whether the property is already visited or not.
- *
- * @param propertyName
- * is the property to be checked.
- * @return true, if already been visited; otherwise false
- */
- private boolean isPropertyAlreadyVisited(String propertyName) {
- return propertiesVisited.contains(propertyName);
- }
-
- /**
- * Mark the given property as visited.
- *
- * @param propertyName
- * is the property to be marked.
- */
- private void markPropertyAsVisited(String propertyName) {
- propertiesVisited.add(propertyName);
- }
-
- /**
- * @param regExp
- * the regExp to set
+ * @param regExp the regExp to set
*/
public void setRegExp(String regExp) {
this.regExp = regExp;
}
/**
+ * Get the regular expression.
+ *
* @return the regExp
*/
public String getRegExp() {
return regExp;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckPropertyName";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPropertyTypeAndValueMismatch.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPropertyTypeAndValueMismatch.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.PropertyCommentMeta;
+import com.nokia.helium.ant.data.PropertyMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+
+/**
+ * CheckPropertyTypeAndValueMismatch
is used to check the property
+ * type and value mismatch.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <checkPropertyTypeAndValueMismatch severity="error" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="checkPropertyTypeAndValueMismatch" category="AntLint"
+ *
+ */
+public class CheckPropertyTypeAndValueMismatch extends AbstractProjectCheck {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(RootAntObjectMeta root) {
+ if (root instanceof ProjectMeta) {
+ ProjectMeta projectMeta = (ProjectMeta) root;
+ for (PropertyMeta propertyMeta : projectMeta.getProperties()) {
+ validateType(propertyMeta.getName(), propertyMeta.getType(),
+ propertyMeta.getLineNumber());
+ validateValue(propertyMeta);
+ }
+ for (PropertyCommentMeta propertyMeta : projectMeta.getPropertyCommentBlocks()) {
+ validateType(propertyMeta.getName(), propertyMeta.getType(),
+ propertyMeta.getLineNumber());
+ validateValue(propertyMeta);
+ }
+
+ }
+ }
+
+ /**
+ * Method validates the type of the given property.
+ *
+ * @param propetyName is the name of the property to be validated.
+ * @param propertyType is the type of property to be validated.
+ * @param lineNumber indicates the location of property.
+ */
+ private void validateType(String propetyName, String propertyType, int lineNumber) {
+ if (!(propertyType.equalsIgnoreCase(PropertyMeta.BOOLEAN_TYPE)
+ || propertyType.equalsIgnoreCase(PropertyMeta.FLOAT_TYPE)
+ || propertyType.equalsIgnoreCase(PropertyMeta.INTEGER_TYPE) || propertyType
+ .equalsIgnoreCase(PropertyMeta.STRING_TYPE))) {
+ report("Property '" + propetyName + "' has invalid type as '" + propertyType
+ + "'. (Valid types: boolean|float|integer|string)", lineNumber);
+ }
+ }
+
+ /**
+ * Method validates the given property.
+ *
+ * @param propertyMeta is the property to be validated.
+ */
+ private void validateValue(PropertyMeta propertyMeta) {
+ String type = propertyMeta.getType();
+ String value = propertyMeta.getRuntimeProject().getProperty(propertyMeta.getName());
+ if (PropertyMeta.BOOLEAN_TYPE.equalsIgnoreCase(type)) {
+ validateBooleanValue(propertyMeta.getName(), value, propertyMeta.getLineNumber());
+ }
+
+ if (PropertyMeta.INTEGER_TYPE.equalsIgnoreCase(type)) {
+ validateIntegerValue(propertyMeta.getName(), value, propertyMeta.getLineNumber());
+ }
+
+ if (PropertyMeta.FLOAT_TYPE.equalsIgnoreCase(type)) {
+ validateFloatValue(propertyMeta.getName(), value, propertyMeta.getLineNumber());
+ }
+ }
+
+ /**
+ * Method validates the given comment property.
+ *
+ * @param propertyMeta is the comment property to be validated.
+ */
+ private void validateValue(PropertyCommentMeta propertyMeta) {
+ String type = propertyMeta.getType();
+ String value = propertyMeta.getRuntimeProject().getProperty(propertyMeta.getName());
+ if (PropertyMeta.BOOLEAN_TYPE.equalsIgnoreCase(type)) {
+ validateBooleanValue(propertyMeta.getName(), value, propertyMeta.getLineNumber());
+ }
+
+ if (PropertyMeta.INTEGER_TYPE.equalsIgnoreCase(type)) {
+ validateIntegerValue(propertyMeta.getName(), value, propertyMeta.getLineNumber());
+ }
+
+ if (PropertyMeta.FLOAT_TYPE.equalsIgnoreCase(type)) {
+ validateFloatValue(propertyMeta.getName(), value, propertyMeta.getLineNumber());
+ }
+ }
+
+ /**
+ * Method validates the given boolean property.
+ *
+ * @param propertyName is the name of the property to be validated.
+ * @param value is the property value to be validated.
+ * @param lineNumber indicates the location of the property.
+ */
+ private void validateBooleanValue(String propertyName, String value, int lineNumber) {
+ if (value != null && !value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("false")) {
+ report("Property '" + propertyName + "' has invalid boolean value set as '" + value
+ + "'. (Valid values: true|false)", lineNumber);
+ }
+ }
+
+ /**
+ * Method validates the given integer property.
+ *
+ * @param propertyName is the name of the property to be validated.
+ * @param value is the property value to be validated.
+ * @param lineNumber indicates the location of the property.
+ */
+ private void validateIntegerValue(String propertyName, String value, int lineNumber) {
+ try {
+ if (value != null) {
+ Integer.parseInt(value);
+ }
+ } catch (NumberFormatException nfe) {
+ report("Property '" + propertyName + "' has invalid integer value set as '" + value
+ + "'.", lineNumber);
+ }
+ }
+
+ /**
+ * Method validates the given float property.
+ *
+ * @param propertyName is the name of the property to be validated.
+ * @param value is the property value to be validated.
+ * @param lineNumber indicates the location of the property.
+ */
+ private void validateFloatValue(String propertyName, String value, int lineNumber) {
+ try {
+ if (value != null) {
+ Double.parseDouble(value);
+ }
+ } catch (NumberFormatException nfe) {
+ report("Property '" + propertyName + "' has invalid float value set as '" + value
+ + "'.", lineNumber);
+ }
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPythonTasks.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPythonTasks.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-package com.nokia.helium.antlint.ant.types;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tools.ant.BuildException;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
-
-/**
- * CheckPythonTasks
is used to the check the coding convention of
- * python tasks.
- *
- *
- * Usage:
- *
- * <antlint>
- * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
- * <include name="*.ant.xml"/>
- * <include name="*build.xml"/>
- * <include name="*.antlib.xml"/>
- * </fileset>
- * <CheckPythonTasks" severity="error" enabled="true" outputDir="${antlint.test.dir}/output"/>
- * </antlint>
- *
- *
- * @ant.task name="CheckPythonTasks" category="AntLint"
- */
-public class CheckPythonTasks extends AbstractCheck {
-
- private File outputDir;
- private File antFile;
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- public void run(Element node) {
- if (node.getName().equals("target")) {
- String target = node.attributeValue("name");
- List pythonList = node.selectNodes("//target[@name='"
- + target + "']/descendant::*[name()=\"hlm:python\"]");
- int i = 0;
- for (Element pythonElement : pythonList) {
- writePythonFile(i + "_" + target, pythonElement.getText());
- i++;
- }
- }
- }
-
- /**
- * Writes the given text to a python file.
- *
- * @param name
- * is the name of the file to be written.
- * @param text
- * is the text to be written inside the file.
- */
- private void writePythonFile(String name, String text) {
- if (getOutputDir() == null) {
- throw new BuildException("'output' attribute for the checker '"
- + this.toString() + "' should be specified.");
- }
- try {
- String heliumpath = getOutputDir().getCanonicalPath();
- new File(heliumpath + File.separator + "python").mkdirs();
- File file = new File(heliumpath + File.separator + "python"
- + File.separator + "target" + name + ".py");
- PrintWriter output = new PrintWriter(new FileOutputStream(file));
- if (!text.equals("")) {
- output.write("def abc():");
- for (String line : text.split("\n")) {
- output.write(" " + line + "\n");
- }
- }
- output.close();
- } catch (IOException e) {
- throw new BuildException(
- "IOException:Not able to write python file " + name + ".py");
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- List targetNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", targetNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element targetNode : targetNodes) {
- run(targetNode);
- }
-
- }
-
- /**
- * @param outputDir
- * the outputDir to set
- */
- public void setOutputDir(File outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- * @return the outputDir
- */
- public File getOutputDir() {
- return outputDir;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckPythonTasks";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckRunTarget.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckRunTarget.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckRunTarget.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,17 +16,10 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
import java.util.List;
-import org.apache.tools.ant.Target;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.TargetMeta;
+import com.nokia.helium.ant.data.TaskMeta;
/**
* CheckRunTarget
is used to check whether runtarget calls a target
@@ -41,105 +34,25 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckRunTarget" severity="error" enabled="true" />
+ * <checkRunTarget severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckRunTarget" category="AntLint"
+ * @ant.task name="checkRunTarget" category="AntLint"
*
*/
-public class CheckRunTarget extends AbstractCheck {
-
- private File antFile;
+public class CheckRunTarget extends AbstractTargetCheck {
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkRunTargets(node);
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
- */
- @SuppressWarnings("unchecked")
- private void checkRunTargets(Element node) {
- if (node.elements("runtarget") != null) {
- List runTargetList = node.elements("runtarget");
- for (Element runTargetElement : runTargetList) {
- String runTargetName = runTargetElement
- .attributeValue("target");
- if (checkTargetDependency(runTargetName)) {
- this.getReporter().report(
- this.getSeverity(),
- " calls the target " + runTargetName
- + " that has dependencies!",
- this.getAntFile(), 0);
- }
+ protected void run(TargetMeta targetMeta) {
+ List runTargets = targetMeta.getTasks("runtarget");
+ for (TaskMeta runTargetMeta : runTargets) {
+ if (checkTargetDependency(runTargetMeta.getAttr("target"))) {
+ report(" calls the target " + runTargetMeta.getAttr("target")
+ + " that has dependencies!", runTargetMeta.getLineNumber());
}
}
}
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- List targetNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", targetNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element targetNode : targetNodes) {
- run(targetNode);
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckRunTarget";
- }
-
- /**
- * Check the availability dependent targets of the given target.
- *
- * @param targetName
- * is the target for which dependent targets to be loked up.
- * @return true, if the dependant targets are available; otherwise false
- */
- private boolean checkTargetDependency(String targetName) {
- boolean dependencyCheck = false;
- Target targetDependency = (Target) getProject().getTargets().get(
- targetName);
- dependencyCheck = targetDependency != null
- && targetDependency.getDependencies().hasMoreElements();
- return dependencyCheck;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptCondition.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptCondition.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptCondition.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,16 +16,7 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.MacroMeta;
/**
* CheckScriptCondition
is used to check the coding convention in
@@ -40,100 +31,36 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckScriptCondition" severity="error" enabled="true" />
+ * <checkScriptCondition" severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckScriptCondition" category="AntLint"
+ * @ant.task name="checkScriptCondition" category="AntLint"
*
*/
public class CheckScriptCondition extends AbstractScriptCheck {
- private File outputDir;
- private File antFile;
-
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkScriptConditions(node);
- }
+ protected String getScriptXPathExpression(String targetName) {
+ return ".//scriptcondition";
}
/**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
+ * {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- private void checkScriptConditions(Element node) {
- String target = node.attributeValue("name");
- List scriptList = node.selectNodes("//target[@name='" + target
- + "']/descendant::scriptcondition");
- for (Element scriptElement : scriptList) {
- String language = scriptElement.attributeValue("language");
- if (language.equals("jython")) {
- writeJythonFile("scriptcondition_" + target, scriptElement
- .getText(), outputDir);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
- List targetNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", targetNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element targetNode : targetNodes) {
- run(targetNode);
- }
-
+ protected String getMacroXPathExpression() {
+ return null;
}
/**
- * @param outputDir
- * the outputDir to set
- */
- public void setOutputDir(File outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- * @return the outputDir
+ * {@inheritDoc}
*/
- public File getOutputDir() {
- return outputDir;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckScriptCondition";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
+ protected void run(MacroMeta macroMeta) {
+ String language = macroMeta.getAttr("language");
+ if (language != null && language.equals("jython") && macroMeta.getText().contains("${")) {
+ report("${ found in " + getScriptName(macroMeta));
+ }
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDef.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDef.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-package com.nokia.helium.antlint.ant.types;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
-
-/**
- * CheckScriptDef
is used to check the coding convention in
- * scriptdef.
- *
- *
- * Usage:
- *
- * <antlint>
- * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
- * <include name="*.ant.xml"/>
- * <include name="*build.xml"/>
- * <include name="*.antlib.xml"/>
- * </fileset>
- * <CheckScriptDef" severity="error" enabled="true" outputDir="${antlint.test.dir}/output"/>
- * </antlint>
- *
- *
- * @ant.task name="CheckScriptDef" category="AntLint"
- *
- */
-public class CheckScriptDef extends AbstractScriptCheck {
-
- private File outputDir;
- private File antFile;
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("scriptdef")) {
- String scriptdefname = node.attributeValue("name");
- String language = node.attributeValue("language");
-
- checkScriptDef(scriptdefname, node);
-
- if (language.equals("beanshell")) {
- writeBeanshellFile(scriptdefname, node.getText());
- }
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
- */
- @SuppressWarnings("unchecked")
- public void checkScriptDef(String name, Node node) {
- List statements = node.selectNodes("//scriptdef[@name='" + name
- + "']/attribute");
- Pattern p1 = Pattern.compile("attributes.get\\([\"']([^\"']*)[\"']\\)");
- Matcher m1 = p1.matcher(node.getText());
- ArrayList props = new ArrayList();
- while (m1.find()) {
- props.add(m1.group(1));
- }
-
- if (!statements.isEmpty() && !props.isEmpty()) {
- for (Node statement : statements) {
- if (!props.contains(statement.valueOf("@name"))) {
- this.getReporter().report(
- this.getSeverity(),
- "Scriptdef " + name + " does not use "
- + statement.valueOf("@name"),
- this.getAntFile(), 0);
- }
- }
- }
- }
-
- /**
- * Write a bean shell file with the given text.
- *
- * @param scriptdefname
- * is the name of the file to be written.
- * @param text
- * is the text to be written inside the file.
- */
- private void writeBeanshellFile(String scriptdefname, String text) {
- if (getOutputDir() == null) {
- throw new BuildException("'output' attribute for the checker '"
- + this.toString() + "' should be specified.");
- }
- scriptdefname = "Beanshell" + scriptdefname;
- try {
- String heliumpath = getOutputDir().getCanonicalPath();
- new File(heliumpath + File.separator + "beanshell").mkdirs();
- File file = new File(heliumpath + File.separator + "beanshell"
- + File.separator + scriptdefname + ".java");
- PrintWriter output = new PrintWriter(new FileOutputStream(file));
-
- for (String line : text.split("\n")) {
- if (line.trim().startsWith("import")) {
- output.write(line + "\n");
- }
- }
-
- output.write("/**\n * x\n */\npublic final class " + scriptdefname
- + " {\n");
- output.write(" private " + scriptdefname + "() { }\n");
- output.write(" public static void main(String[] args) {\n");
- for (String line : text.split("\n")) {
- if (!line.trim().startsWith("import")) {
- output.write(" " + line + "\n");
- }
- }
- output.write(" }\n");
- output.write("}\n");
- output.close();
- } catch (IOException e) {
- throw new BuildException("Not able to write Beanshell File "
- + scriptdefname + ".java");
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
-
- List scriptDefNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "scriptdef", scriptDefNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element scriptDefNode : scriptDefNodes) {
- run(scriptDefNode);
- }
- }
-
- /**
- * @param outputDir
- * the outputDir to set
- */
- public void setOutputDir(File outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- * @return the outputDir
- */
- public File getOutputDir() {
- return outputDir;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckScriptDef";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefAttributes.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefAttributes.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.util.List;
+
+import com.nokia.helium.ant.data.MacroMeta;
+
+/**
+ * CheckScriptDefAttributes
is used to check for unused scriptdef attributes
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <checkScriptDefAttributes severity="warning" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="checkScriptDefAttributes" category="AntLint"
+ */
+public class CheckScriptDefAttributes extends AbstractScriptCheck {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getMacroXPathExpression() {
+ return "//scriptdef";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getScriptXPathExpression(String targetName) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(MacroMeta macroMeta) {
+ checkUnusedAttributes(macroMeta);
+ }
+
+ /**
+ * Method to check for unused attributes.
+ */
+ private void checkUnusedAttributes(MacroMeta macroMeta) {
+ List usedPropertyList = getUsedProperties(macroMeta);
+ List attributes = macroMeta.getAttributes();
+
+ if (!usedPropertyList.isEmpty()) {
+ for (String attrName : attributes) {
+ if (!usedPropertyList.contains(attrName)) {
+ report("Scriptdef " + macroMeta.getName() + " does not use " + attrName,
+ macroMeta.getLineNumber());
+ }
+ }
+
+ for (String attrName : usedPropertyList) {
+ if (!attributes.contains(attrName)) {
+ report("Scriptdef " + macroMeta.getName() + " does not have attribute "
+ + attrName, macroMeta.getLineNumber());
+ }
+ }
+ }
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefName.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefName.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.util.List;
+
+import com.nokia.helium.ant.data.AntObjectMeta;
+import com.nokia.helium.ant.data.MacroMeta;
+
+/**
+ *
+ */
+public class CheckScriptDefName extends AbstractScriptCheck {
+
+ private String regExp;
+
+ /**
+ * Set the regular expression.
+ *
+ * @param regExp the regExp to set
+ */
+ public void setRegExp(String regExp) {
+ this.regExp = regExp;
+ }
+
+ /**
+ * Get the regular expression.
+ *
+ * @return the regExp
+ */
+ public String getRegExp() {
+ return regExp;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getMacroXPathExpression() {
+ return "//scriptdef";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getScriptXPathExpression(String targetName) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(MacroMeta macroMeta) {
+ validateName(macroMeta.getName(), macroMeta);
+ List attributes = macroMeta.getAttributes();
+ for (String attrName : attributes) {
+ validateName(attrName, macroMeta);
+ }
+ }
+
+ private void validateName(String name, AntObjectMeta object) {
+ if (name != null && !name.isEmpty() && getRegExp() != null && !matches(name, getRegExp())) {
+ report("Invalid scriptdef name: " + name, object.getLineNumber());
+ }
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefNameAttributes.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefNameAttributes.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-package com.nokia.helium.antlint.ant.types;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
-
-/**
- * CheckScriptDefNameAttributes
is used to check the naming
- * convention of scriptdef name attributes
- *
- *
- * Usage:
- *
- * <antlint>
- * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
- * <include name="*.ant.xml"/>
- * <include name="*build.xml"/>
- * <include name="*.antlib.xml"/>
- * </fileset>
- * <CheckScriptDefNameAttributes" severity="error" enabled="true" />
- * </antlint>
- *
- *
- * @ant.task name="CheckScriptDefNameAttributes" category="AntLint"
- */
-public class CheckScriptDefNameAttributes extends AbstractCheck {
-
- private File antFile;
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("scriptdef")) {
- String scriptdefname = node.attributeValue("name");
- checkScriptDefNameAttributes(scriptdefname, node);
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
- */
- @SuppressWarnings("unchecked")
- public void checkScriptDefNameAttributes(String name, Node node) {
- List statements = node.selectNodes("//scriptdef[@name='" + name
- + "']/attribute");
- Pattern p1 = Pattern.compile("attributes.get\\([\"']([^\"']*)[\"']\\)");
- Matcher m1 = p1.matcher(node.getText());
- ArrayList props = new ArrayList();
- while (m1.find()) {
- props.add(m1.group(1));
- }
-
- ArrayList attributes = new ArrayList();
- for (Node statement : statements) {
- attributes.add(statement.valueOf("@name"));
- }
- for (String attribute : props) {
- if (!attributes.contains(attribute)) {
- this.getReporter().report(this.getSeverity(),
- "Scriptdef " + name + " does not have attribute " + attribute,
- this.getAntFile(), 0);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
-
- List scriptDefNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "scriptdef", scriptDefNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element scriptDefNode : scriptDefNodes) {
- run(scriptDefNode);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckScriptDefNameAttributes";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefStyle.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefStyle.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefStyle.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,19 +16,9 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.MacroMeta;
/**
* CheckScriptDefStyle
is used to check the coding style of
@@ -43,99 +33,41 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckScriptDefStyle" severity="error" enabled="true" />
+ * <checkScriptDefStyle severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckScriptDefStyle" category="AntLint"
+ * @ant.task name="checkScriptDefStyle" category="AntLint"
*
*/
-public class CheckScriptDefStyle extends AbstractCheck {
+public class CheckScriptDefStyle extends AbstractScriptCheck {
- private File antFile;
+ /**
+ * {@inheritDoc}
+ */
+ protected String getMacroXPathExpression() {
+ return "//scriptdef";
+ }
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("scriptdef")) {
- String scriptdefname = node.attributeValue("name");
- checkScriptDefStyle(scriptdefname, node);
- }
+ protected String getScriptXPathExpression(String targetName) {
+ return null;
}
/**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
+ * {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- public void checkScriptDefStyle(String name, Node node) {
- List statements = node.selectNodes("//scriptdef[@name='" + name
- + "']/attribute");
- Pattern p1 = Pattern.compile("attributes.get\\([\"']([^\"']*)[\"']\\)");
- Matcher m1 = p1.matcher(node.getText());
- ArrayList props = new ArrayList();
- while (m1.find()) {
- props.add(m1.group(1));
- }
+ protected void run(MacroMeta macroMeta) {
+ List usedPropertyList = getUsedProperties(macroMeta);
+ List attributes = macroMeta.getAttributes();
- ArrayList attributes = new ArrayList();
- for (Node statement : statements) {
- attributes.add(statement.valueOf("@name"));
+ if (usedPropertyList.isEmpty() && !attributes.isEmpty()) {
+ report("Scriptdef " + macroMeta.getName()
+ + " doesn't reference attributes directly, poor style",
+ macroMeta.getLineNumber());
}
- if (!statements.isEmpty() && props.isEmpty()) {
- this
- .getReporter()
- .report(
- this.getSeverity(),
- "Scriptdef "
- + name
- + " doesn't reference attributes directly, poor style",
- this.getAntFile(), 0);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
-
- List scriptDefNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "scriptdef", scriptDefNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element scriptDefNode : scriptDefNodes) {
- run(scriptDefNode);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckScriptDefStyle";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptSize.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptSize.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptSize.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,17 +16,7 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.MacroMeta;
/**
* CheckScriptSize
is used to check the size of script. By default,
@@ -41,91 +31,37 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckScriptSize" severity="error" enabled="true" />
+ * <checkScriptSize severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckScriptSize" category="AntLint"
+ * @ant.task name="checkScriptSize" category="AntLint"
*
*/
-public class CheckScriptSize extends AbstractCheck {
-
- private File antFile;
+public class CheckScriptSize extends AbstractScriptCheck {
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkSizeOfScript(node);
- }
+ protected String getMacroXPathExpression() {
+ return null;
}
/**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
+ * {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- private void checkSizeOfScript(Element node) {
- String target = node.attributeValue("name");
-
- List statements = node.selectNodes("//target[@name='" + target
- + "']/script | //target[@name='" + target
- + "']/*[name()=\"hlm:python\"]");
-
- for (Node statement : statements) {
- int size = statement.getText().length();
- if (size > 1000) {
- this
- .getReporter()
- .report(
- this.getSeverity(),
- "Target "
- + target
- + " has a script with "
- + size
- + " characters, code should be inside a python file",
- this.getAntFile(), 0);
- }
- }
+ protected String getScriptXPathExpression(String targetName) {
+ return ".//script | " + "//target[@name='" + targetName + "']/*[name()=\"hlm:python\"]";
}
- public void run(File antFilename) throws AntlintException {
-
- List targetNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", targetNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element targetNode : targetNodes) {
- run(targetNode);
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(MacroMeta macroMeta) {
+ int size = macroMeta.getText().length();
+ if (size > 1000) {
+ report("Target " + macroMeta.getParent().getName() + " has a script with " + size
+ + " characters, code should be inside a python file", macroMeta.getLineNumber());
}
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckScriptSize";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTabCharacter.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTabCharacter.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTabCharacter.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,19 +16,12 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.io.IOException;
import java.util.List;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.dom4j.Element;
-import org.dom4j.Node;
-import org.xml.sax.SAXException;
-
-import com.nokia.helium.antlint.AntLintHandler;
+import com.nokia.helium.ant.data.MacroMeta;
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.ant.data.TargetMeta;
import com.nokia.helium.antlint.ant.AntlintException;
/**
@@ -44,92 +37,94 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckTabCharacter" severity="error" enabled="true" />
+ * <checkTabCharacter" severity="error" enabled="true" />
* </antlint>
*
*
- * @ant.task name="CheckTabCharacter" category="AntLint"
+ * @ant.task name="checkTabCharacter" category="AntLint"
*
*/
-public class CheckTabCharacter extends AbstractCheck {
+public class CheckTabCharacter extends AbstractAntFileStyleCheck {
- private File antFile;
+ private static final String TAB_CHAR = "\t";
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- checkTabsInScript(node);
+ public void run() throws AntlintException {
+ super.run();
+ RootAntObjectMeta rootObjectMeta = getAntFile().getRootObjectMeta();
+ run(rootObjectMeta);
}
/**
- * Check against the given node.
+ * Method runs the check against the given {@link RootAntObjectMeta}.
*
- * @param node
- * is the node to check.
+ * @param root is the {@link RootAntObjectMeta} against which the check is
+ * run.
*/
- @SuppressWarnings("unchecked")
- private void checkTabsInScript(Element node) {
- if (node.getName().equals("target")) {
- String target = node.attributeValue("name");
-
- List statements = node.selectNodes("//target[@name='"
- + target + "']/script | //target[@name='" + target
- + "']/*[name()=\"hlm:python\"]");
-
- for (Node statement : statements) {
- if (statement.getText().contains("\t")) {
- this.getReporter().report(getSeverity(),
- "Target " + target + " has a script with tabs",
- getAntFile(), 0);
- }
+ private void run(RootAntObjectMeta root) {
+ if (root instanceof ProjectMeta) {
+ ProjectMeta projectMeta = (ProjectMeta) root;
+ List targets = projectMeta.getTargets();
+ for (TargetMeta targetMeta : targets) {
+ run(targetMeta);
}
}
}
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
+ /**
+ * {@inheritDoc}
+ */
+ protected void handleStartDocument() {
+ // Do nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void handleEndDocument() {
+ // Do nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void handleEndElement(String text) {
+ checkTabChars(text, getLocator().getLineNumber());
+ }
+
+ /**
+ * {@inheritDoc}
*/
- public void run(File antFilename) throws AntlintException {
- try {
- this.antFile = antFilename;
- SAXParserFactory saxFactory = SAXParserFactory.newInstance();
- saxFactory.setNamespaceAware(true);
- saxFactory.setValidating(true);
- SAXParser parser = saxFactory.newSAXParser();
- AntLintHandler handler = new AntLintHandler(this);
- handler.setTabCharacterCheck(true);
- parser.parse(antFilename, handler);
- } catch (ParserConfigurationException e) {
- throw new AntlintException("Not able to parse XML file "
- + e.getMessage());
- } catch (SAXException e) {
- throw new AntlintException("Not able to parse XML file "
- + e.getMessage());
- } catch (IOException e) {
- throw new AntlintException("Not able to find XML file "
- + e.getMessage());
+ protected void handleStartElement(String text) {
+ checkTabChars(text, getLocator().getLineNumber());
+ }
+
+ private void checkTabChars(String text, int lineNum) {
+ if (text.contains(TAB_CHAR)) {
+ report("Tabs should not be used!", lineNum);
+ }
+ clearBuffer();
+ }
+
+ /**
+ * Method to run the check against the input {@link TargetMeta}.
+ *
+ * @param targetMeta is the {@link TargetMeta} against whom the check is
+ * run.
+ */
+ private void run(TargetMeta targetMeta) {
+ List macros = targetMeta.getScriptDefinitions("//target[@name='"
+ + targetMeta.getName() + "']/descendant::script | //target[@name='"
+ + targetMeta.getName() + "']/descendant::*[name()=\"hlm:python\"]");
+ if (macros != null) {
+ for (MacroMeta macroMeta : macros) {
+ if (macroMeta.getText().contains(TAB_CHAR)) {
+ report("Target " + targetMeta.getName() + " has a script with tabs",
+ macroMeta.getLineNumber());
+ }
+ }
}
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckTabCharacter";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTargetName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTargetName.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTargetName.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,18 +16,7 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.TargetMeta;
/**
* CheckTargetName
is used to check the naming convention of the
@@ -42,73 +31,30 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckTargetName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
+ * <checkTargetName" severity="error" regexp="([a-z0-9[\\d\\-]]*)" />
* </antlint>
*
*
- * @ant.task name="CheckTargetName" category="AntLint"
+ * @ant.task name="checkTargetName" category="AntLint"
*
*/
-public class CheckTargetName extends AbstractCheck {
+public class CheckTargetName extends AbstractTargetCheck {
private String regExp;
- private File antFile;
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("target")) {
- String target = node.attributeValue("name");
+ protected void run(TargetMeta targetMeta) {
+ String target = targetMeta.getName();
+ if (target != null && !target.isEmpty()) {
if (!target.equals("tearDown") && !target.equals("setUp")
- && !target.equals("suiteTearDown")
- && !target.equals("suiteSetUp")) {
- checkTargetName(target);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
-
- List targetNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", targetNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element targetNode : targetNodes) {
- run(targetNode);
- }
-
- }
-
- /**
- * Check the given target name.
- *
- * @param targetName
- * is the target name to check.
- */
- private void checkTargetName(String targetName) {
- if (targetName != null && !targetName.isEmpty()) {
- Pattern p1 = Pattern.compile(getRegExp());
- Matcher m1 = p1.matcher(targetName);
- if (!m1.matches()) {
- this.getReporter().report(this.getSeverity(),
- "INVALID Target Name: " + targetName,
- this.getAntFile(), 0);
+ && !target.equals("suiteTearDown") && !target.equals("suiteSetUp")
+ && !matches(target, getRegExp())) {
+ report("INVALID Target Name: " + target, targetMeta.getLineNumber());
}
} else {
- log("Target name not specified!");
+ report("Target name not specified!", targetMeta.getLineNumber());
}
}
@@ -120,28 +66,9 @@
}
/**
- * @param regExp
- * the regExp to set
+ * @param regExp the regExp to set
*/
public void setRegExp(String regExp) {
this.regExp = regExp;
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckTargetName";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTryCatchBlock.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTryCatchBlock.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTryCatchBlock.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,19 +16,10 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
+import java.util.List;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.TargetMeta;
+import com.nokia.helium.ant.data.TaskMeta;
/**
* CheckTryCatchBlock
is used to check for empty and more than one
@@ -43,92 +34,28 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <checkTryCatchBlock" severity="error" enabled="true" />
+ * <checkTryCatchBlock" severity="error" />
* </antlint>
*
*
* @ant.task name="checkTryCatchBlock" category="AntLint"
*
*/
-public class CheckTryCatchBlock extends AbstractCheck {
-
- private File antFile;
-
- /**
- * {@inheritDoc}
- */
- public File getAntFile() {
- return antFile;
- }
+public class CheckTryCatchBlock extends AbstractTargetCheck {
/**
* {@inheritDoc}
*/
- public void run(File antFilename) throws AntlintException {
- try {
- this.antFile = antFilename;
- SAXParserFactory saxFactory = SAXParserFactory.newInstance();
- saxFactory.setNamespaceAware(true);
- saxFactory.setValidating(true);
- SAXParser parser = saxFactory.newSAXParser();
- TryCatchBlockHandler handler = new TryCatchBlockHandler();
- parser.parse(antFilename, handler);
- } catch (ParserConfigurationException e) {
- throw new AntlintException("Not able to parse XML file "
- + e.getMessage());
- } catch (SAXException e) {
- throw new AntlintException("Not able to parse XML file "
- + e.getMessage());
- } catch (IOException e) {
- throw new AntlintException("Not able to find XML file "
- + e.getMessage());
- }
- }
-
- public String toString() {
- return "CheckTryCatchBlock";
- }
-
- private class TryCatchBlockHandler extends DefaultHandler {
-
- private Locator locator;
- private int catchCounter;
+ protected void run(TargetMeta targetMeta) {
+ List trycatches = targetMeta.getTasks("trycatch");
+ List catches = targetMeta.getTasks("trycatch//catch");
- /**
- * {@inheritDoc}
- */
- public void setDocumentLocator(Locator locator) {
- this.locator = locator;
- }
-
- /**
- * {@inheritDoc}
- */
- public void startElement(String uri, String localName, String qName,
- Attributes attributes) throws SAXException {
- if (localName.equals("trycatch")) {
- catchCounter = 0;
- } else if (localName.equals("catch")) {
- catchCounter++;
- }
+ if (!trycatches.isEmpty() && catches.isEmpty()) {
+ report(" block found without element", targetMeta.getLineNumber());
}
-
- /**
- * {@inheritDoc}
- */
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- if (localName.equals("trycatch") && catchCounter == 0) {
- getReporter().report(getSeverity(),
- " block found without element",
- getAntFile(), locator.getLineNumber());
- } else if (localName.equals("trycatch") && catchCounter > 1) {
- getReporter().report(
- getSeverity(),
- " block found with " + catchCounter
- + " elements.", getAntFile(),
- locator.getLineNumber());
- }
+ if (!trycatches.isEmpty() && catches.size() > 1) {
+ report(" block found with " + catches.size() + " elements.",
+ targetMeta.getLineNumber());
}
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfEqualsTask.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfEqualsTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfEqualsTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,16 +16,10 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
import java.util.List;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.ant.data.TaskMeta;
/**
* CheckUseOfEqualsTask
is used to check the usage of equals task
@@ -40,72 +34,25 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckUseOfEqualsTask" severity="error" enabled="true" />
+ * <checkUseOfEqualsTask" severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckUseOfEqualsTask" category="AntLint"
+ * @ant.task name="checkUseOfEqualsTask" category="AntLint"
*/
-public class CheckUseOfEqualsTask extends AbstractCheck {
-
- private File antFile;
+public class CheckUseOfEqualsTask extends AbstractProjectCheck {
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("equals")) {
- String text = node.attributeValue("arg2");
+ protected void run(RootAntObjectMeta root) {
+ List conditions = root.getTaskDefinitions("//equals");
+ for (TaskMeta taskMeta : conditions) {
+ String text = taskMeta.getAttr("arg2");
if (text.equals("true") || text.equals("yes")) {
- this.getReporter().report(
- this.getSeverity(),
- node.attributeValue("arg1")
- + " uses 'equals' should use 'istrue' task",
- this.getAntFile(), 0);
+ report(taskMeta.getAttr("arg1") + " uses 'equals', should use 'istrue' task",
+ taskMeta.getLineNumber());
}
}
}
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
- */
- public void run(File antFilename) throws AntlintException {
-
- List equalNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "equals", equalNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element equalNode : equalNodes) {
- run(equalNode);
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckUseOfEqualsTask";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfIfInTargets.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfIfInTargets.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfIfInTargets.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,17 +16,10 @@
*/
package com.nokia.helium.antlint.ant.types;
-import java.io.File;
-import java.util.ArrayList;
import java.util.List;
-import org.dom4j.Document;
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.ant.data.TargetMeta;
+import com.nokia.helium.ant.data.TaskMeta;
/**
* CheckUseOfIfInTargets
is used to check the usage of if task as
@@ -42,122 +35,49 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <CheckUseOfIfInTargets" severity="error" enabled="true" />
+ * <checkUseOfIfInTargets" severity="error" />
* </antlint>
*
*
- * @ant.task name="CheckUseOfIfInTargets" category="AntLint"
+ * @ant.task name="checkUseOfIfInTargets" category="AntLint"
*
*/
-public class CheckUseOfIfInTargets extends AbstractCheck {
-
- private File antFile;
+public class CheckUseOfIfInTargets extends AbstractTargetCheck {
/**
* {@inheritDoc}
*/
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkUseOfIf(node);
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
- */
- @SuppressWarnings("unchecked")
- private void checkUseOfIf(Element node) {
- String target = node.attributeValue("name");
- String targetxpath = "//target[@name='" + target + "']//if";
+ protected void run(TargetMeta targetMeta) {
+ String target = targetMeta.getName();
+ List conditions = targetMeta.getTasks("if");
+ for (TaskMeta taskMeta : conditions) {
+ List ifThenPropertyConditions = taskMeta.getTasks("./then/property");
+ List ifElsePropertyConditions = taskMeta.getTasks("./else/property");
+ if (ifThenPropertyConditions.size() == 1 && ifElsePropertyConditions.size() == 1) {
+ report("Target " + target
+ + " poor use of if-else-property statement, use condition task",
+ taskMeta.getLineNumber());
+ }
+ List elseConditions = taskMeta.getTasks("./else");
- List statements2 = node.selectNodes(targetxpath);
- for (Node statement : statements2) {
- List conditiontest = statement.selectNodes("./then/property");
- if (conditiontest != null && conditiontest.size() == 1) {
- List conditiontest2 = statement
- .selectNodes("./else/property");
- if (conditiontest2 != null && conditiontest2.size() == 1) {
- this
- .getReporter()
- .report(
- this.getSeverity(),
- "Target "
- + target
- + " poor use of if-else-property statement, use condition task",
- this.getAntFile(), 0);
- } else if (statement.selectNodes("./else").size() == 0) {
- this
- .getReporter()
- .report(
- this.getSeverity(),
- "Target "
- + target
- + " poor use of if-then-property statement, use condition task",
- this.getAntFile(), 0);
- }
+ if (ifThenPropertyConditions.size() == 1 && elseConditions.size() == 0) {
+ report("Target " + target
+ + " poor use of if-then-property statement, use condition task",
+ taskMeta.getLineNumber());
}
}
- List statements = node.selectNodes("//target[@name='" + target
+
+ List conditions2 = targetMeta.getTaskDefinitions("//target[@name='" + target
+ "']/*");
- if (!(statements.size() > 1)) {
- if (node.selectSingleNode(targetxpath + "/else") == null) {
- if (node.selectSingleNode(targetxpath + "/isset") != null
- || node.selectSingleNode(targetxpath + "/not/isset") != null) {
- this
- .getReporter()
- .report(
- this.getSeverity(),
- "Target "
- + target
- + " poor use of if statement, use ifElseConditions = targetMeta.getTasks("./if/else");
+ List isSetConds = targetMeta.getTasks("./if/isset");
+ List notConds = targetMeta.getTaskDefinitions("./if/not/isset");
+ if (ifElseConditions.isEmpty() && (!isSetConds.isEmpty() || !notConds.isEmpty())) {
+ report("Target " + target
+ + " poor use of if statement, use targetNodes = new ArrayList();
-
- this.antFile = antFilename;
- SAXReader saxReader = new SAXReader();
- Document doc;
- try {
- doc = saxReader.read(antFilename);
- elementTreeWalk(doc.getRootElement(), "target", targetNodes);
- } catch (DocumentException e) {
- throw new AntlintException("Invalid XML file " + e.getMessage());
- }
- for (Element targetNode : targetNodes) {
- run(targetNode);
- }
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.apache.tools.ant.types.DataType#toString()
- */
- public String toString() {
- return "CheckUseOfIfInTargets";
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
- */
- public File getAntFile() {
- return this.antFile;
- }
-}
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckVariableTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckVariableTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.util.List;
+
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.ant.data.TaskMeta;
+
+/**
+ * CheckVariableTask
is used to check whether the value attribute
+ * of the ant-contrib variable task is set when attribute unset is set to true.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <checkVariableTask severity="error" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="checkVariableTask" category="AntLint"
+ */
+public class CheckVariableTask extends AbstractProjectCheck {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void run(RootAntObjectMeta root) {
+ List tasks = root.getTaskDefinitions("//var");
+ String name, value, unset = null;
+ for (TaskMeta taskMeta : tasks) {
+ name = taskMeta.getAttr("name");
+ value = taskMeta.getAttr("value");
+ unset = taskMeta.getAttr("unset");
+ if (!value.trim().isEmpty() && unset.equals("true")) {
+ report("Variable '" + name + "' should not have 'value' attribute set "
+ + "when 'unset' is true.", taskMeta.getLineNumber());
+ }
+ }
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckstyleExecutor.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckstyleExecutor.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.io.File;
+
+import org.apache.tools.ant.types.FileSet;
+
+import com.puppycrawl.tools.checkstyle.CheckStyleTask;
+import com.puppycrawl.tools.checkstyle.CheckStyleTask.Formatter;
+
+/**
+ * CheckstyleExecutor
extends {@link Executor} and is used to check
+ * the coding conventions of beanshell script.
+ */
+public class CheckstyleExecutor extends Executor {
+
+ private CheckStyleTask checkStyleTask;
+ private ScriptDump scriptDump;
+
+ /**
+ * Default constructor
+ */
+ public CheckstyleExecutor() {
+ scriptDump = new BeanshellScriptDump();
+ checkStyleTask = new CheckStyleTask();
+ }
+
+ /**
+ * Set the checkstyle configuration file.
+ *
+ * @param config is the checkstyle configuration file.
+ */
+ public void setConfig(File config) {
+ checkStyleTask.setConfig(config);
+ }
+
+ /**
+ * Add the checkstyle formatter.
+ *
+ * @param aFormatter the checkstyle formatter to add.
+ */
+ public void addFormatter(Formatter aFormatter) {
+ checkStyleTask.addFormatter(aFormatter);
+ }
+
+ protected ScriptDump getScriptDump() {
+ return scriptDump;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute() {
+
+ FileSet fileset = new FileSet();
+ fileset.setDir(getOutputDir());
+ fileset.setIncludes("**/*.java");
+
+ checkStyleTask.setTaskName(getClass().getSimpleName());
+ checkStyleTask.addFileset(fileset);
+ checkStyleTask.setProject(getProject());
+ checkStyleTask.execute();
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckstyleXmlReporter.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckstyleXmlReporter.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckstyleXmlReporter.java Sun Oct 10 15:22:15 2010 +0300
@@ -41,8 +41,8 @@
import com.nokia.helium.antlint.ant.Severity;
/**
- * This reporter will generate a Checkstyle compatible XML to
- * report Antlint issues.
+ * This reporter will generate a Checkstyle compatible XML to report Antlint
+ * issues.
*
* Usage:
*
@@ -59,7 +59,7 @@
* <antlintCheckstyleReporter file="report.xml" />
* </antlint>
*
- *
+ *
* @ant.type name="antlintCheckstyleReporter" category="AntLint"
*/
public class CheckstyleXmlReporter extends DataType implements Reporter {
@@ -74,8 +74,7 @@
* {@inheritDoc}
*/
@Override
- public void report(Severity severity, String message, File filename,
- int lineNo) {
+ public void report(Severity severity, String message, File filename, int lineNo) {
if (doc != null) {
if (currentFile == null || !currentFile.equals(filename)) {
currentFileNode = doc.createElement("file");
@@ -101,8 +100,7 @@
}
/**
- * Closing the reporting session. It will generates
- * the xml file.
+ * Closing the reporting session. It will generates the xml file.
*/
@Override
public void close() {
@@ -129,7 +127,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
@Override
public void open() {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/ConsoleReporter.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/ConsoleReporter.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/ConsoleReporter.java Sun Oct 10 15:22:15 2010 +0300
@@ -25,9 +25,8 @@
import com.nokia.helium.antlint.ant.Severity;
/**
- * This reporter will produce Antlint reporting using ant logging
- * system.
- *
+ * This reporter will produce Antlint reporting using ant logging system.
+ *
* Usage:
*
*
@@ -43,7 +42,7 @@
* <antlintCheckstyleReporter />
* </antlint>
*
- *
+ *
* @ant.type name="antlintConsoleReporter" category="AntLint"
*/
public class ConsoleReporter extends DataType implements Reporter {
@@ -53,29 +52,24 @@
/*
* (non-Javadoc)
- *
* @see
* com.nokia.helium.antlint.ant.Reporter#report(com.nokia.helium.antlint
* .ant.Severity, java.lang.String, java.io.File, int)
*/
@Override
- public void report(Severity severity, String message, File filename,
- int lineNo) {
+ public void report(Severity severity, String message, File filename, int lineNo) {
String errorMessage;
if (this.antFilename == null) {
this.antFilename = filename;
task.log("\nError(s)/Warning(s) for: " + this.antFilename);
- task
- .log("----------------------------------------------------------");
+ task.log("----------------------------------------------------------");
} else if (!this.antFilename.equals(filename)) {
this.antFilename = filename;
task.log("\nError(s)/Warning(s) for: " + this.antFilename);
- task
- .log("----------------------------------------------------------");
+ task.log("----------------------------------------------------------");
}
if (lineNo > 0) {
- errorMessage = severity.getValue().toUpperCase() + ": " + lineNo
- + ": " + message;
+ errorMessage = severity.getValue().toUpperCase() + ": " + lineNo + ": " + message;
} else {
errorMessage = severity.getValue().toUpperCase() + ": " + message;
@@ -86,7 +80,6 @@
/*
* (non-Javadoc)
- *
* @see
* com.nokia.helium.antlint.ant.Reporter#setTask(org.apache.tools.ant.Task)
*/
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Executor.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Executor.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.io.File;
+import java.util.Collection;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.ant.data.AntFile;
+import com.nokia.helium.ant.data.Database;
+
+/**
+ * Executor
is used to run any external tool or command from within
+ * the antlint task.
+ */
+public abstract class Executor extends DataType {
+
+ private File outputDir;
+ private Database database;
+
+ /**
+ * Set the Database.
+ * @param database is the Database to set.
+ */
+ public void setDatabase(Database database) {
+ this.database = database;
+ }
+
+ /**
+ * Set the output directory.
+ * @param outputDir is the output directory.
+ */
+ public void setOutputDir(File outputDir) {
+ this.outputDir = outputDir;
+ }
+
+ public File getOutputDir() {
+ return outputDir;
+ }
+
+ /**
+ * Method to run the configured external tool or command.
+ */
+ public void run() {
+ extractScripts();
+ execute();
+ }
+
+ /**
+ * Method to validate configured attributes.
+ *
+ */
+ public void validateAttributes() {
+ if (outputDir == null) {
+ throw new BuildException("'outputDir' attribute should be specified for '" + toString()
+ + "'");
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return getClass().getSimpleName();
+ }
+
+ private void extractScripts() {
+ Collection antFiles = database.getAntFiles();
+ for (AntFile antFile : antFiles) {
+ getScriptDump().setAntFile(antFile);
+ getScriptDump().setOutputDir(outputDir);
+ getScriptDump().dump();
+ }
+ }
+
+ /**
+ * Get the script dump.
+ *
+ * @return the script dump task.
+ */
+ protected abstract ScriptDump getScriptDump();
+
+ /**
+ * Method executes the configured tool or task.
+ */
+ protected abstract void execute();
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/PylintExecutor.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/PylintExecutor.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.ExecTask;
+import org.apache.tools.ant.taskdefs.PathConvert;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.Environment;
+import org.apache.tools.ant.types.FileSet;
+
+/**
+ * PylintExecutor
extends {@link Executor} and is used to check the
+ * lint issues of jython/python scripts.
+ */
+public class PylintExecutor extends Executor {
+
+ private ScriptDump scriptDump;
+ private ExecTask execTask;
+
+ public PylintExecutor() {
+ execTask = new ExecTask();
+ scriptDump = new PythonScriptDump();
+ }
+
+ /**
+ * Add an environment variable to the launched process.
+ *
+ * @param var new environment variable.
+ */
+ public void addEnv(Environment.Variable var) {
+ execTask.addEnv(var);
+ }
+
+ /**
+ * Adds a command-line argument.
+ *
+ * @return new command line argument created.
+ */
+ public Commandline.Argument createArg() {
+ return execTask.createArg();
+ }
+
+ @Override
+ protected ScriptDump getScriptDump() {
+ return scriptDump;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute() {
+ FileSet fileset = new FileSet();
+ fileset.setDir(getOutputDir());
+ fileset.setIncludes("**/*.py");
+ fileset.setProject(getProject());
+
+ PathConvert pathConvert = new PathConvert();
+ pathConvert.add(fileset);
+ pathConvert.setPathSep(" ");
+ pathConvert.setProperty("python.modules");
+ pathConvert.setProject(getProject());
+ pathConvert.execute();
+
+ execTask.createArg().setLine(getProject().getProperty("python.modules"));
+ execTask.setExecutable("python");
+ execTask.setTaskName(getClass().getSimpleName());
+ execTask.setProject(getProject());
+ execTask.setResultProperty("pylint.result");
+ execTask.execute();
+
+ int result = getResult();
+ if ((result & 2) == 2) {
+ throw new BuildException("Error: Pylint contains errors.");
+ }
+ }
+
+ private int getResult() {
+ String resultString = getProject().getProperty("pylint.result");
+ int result = -1;
+ try {
+ result = Integer.parseInt(resultString);
+ } catch (NumberFormatException e) {
+ log(e.getMessage(), Project.MSG_WARN);
+ }
+ return result;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/PythonScriptDump.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/PythonScriptDump.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+
+import com.nokia.helium.ant.data.MacroMeta;
+import com.nokia.helium.ant.data.TargetMeta;
+
+/**
+ * PythonScriptDumper
is used to extract and dump Python and Jython
+ * scripts from the Ant files.
+ */
+public class PythonScriptDump extends ScriptDump {
+
+ protected void run(TargetMeta targetMeta) {
+ String xpath = "//target[@name='" + targetMeta.getName()
+ + "']/descendant::*[name()=\"hlm:python\"]";
+ List macros = targetMeta.getScriptDefinitions(xpath);
+ int i = 0;
+ for (MacroMeta macroMeta : macros) {
+ writePythonFile(i + "_" + targetMeta.getName(), macroMeta.getText());
+ i++;
+ }
+ super.run(targetMeta);
+ }
+
+ protected void run(MacroMeta macroMeta) {
+ String language = macroMeta.getAttr("language");
+ if (language != null && language.equals("jython")) {
+ writeJythonFile(getScriptName(macroMeta), macroMeta.getText());
+ }
+ }
+
+ private String getScriptName(MacroMeta macroMeta) {
+ String name = macroMeta.getName();
+ if (name.isEmpty()) {
+ name = "target_" + macroMeta.getParent().getName();
+ }
+ return name;
+ }
+
+ protected String getMacroXPathExpression() {
+ return "//scriptdef";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String getScriptXPathExpression(String targetName) {
+ return ".//script | .//scriptcondition";
+ }
+
+ /**
+ * Writes the given text to a python file.
+ *
+ * @param name is the name of the file to be written.
+ * @param text is the text to be written inside the file.
+ */
+ private void writePythonFile(String name, String text) {
+ PrintWriter output = null;
+ try {
+ String outputPath = getOutputDir().getCanonicalPath() + File.separator + "python";
+ new File(outputPath).mkdirs();
+ File file = new File(outputPath + File.separator + "target" + name + ".py");
+ output = new PrintWriter(new FileOutputStream(file));
+ if (!text.equals("")) {
+ output.write("def abc():");
+ for (String line : text.split("\n")) {
+ output.write(" " + line + "\n");
+ }
+ }
+ } catch (IOException e) {
+ throw new BuildException("IOException:Not able to write python file " + name + ".py");
+ } finally {
+ if (output != null) {
+ output.close();
+ }
+ }
+ }
+
+ /**
+ * Write a script with the given name and the text.
+ *
+ * @param name is the name of the script
+ * @param text is the script text.
+ */
+ private void writeJythonFile(String name, String text) {
+ PrintWriter output = null, output2 = null;
+ try {
+ String outputPath = getOutputDir().getCanonicalPath() + File.separator + "jep";
+ new File(outputPath).mkdirs();
+ File file = new File(outputPath + File.separator + name + "_jep.py");
+ output = new PrintWriter(new FileOutputStream(file));
+ output.write("def abc():\n");
+ output.write(" attributes = {} # pylint: disable=C0103\n");
+ output.write(" elements = {} # pylint: disable=C0103\n");
+ output.write(" project = None # pylint: disable=C0103\n");
+ output.write(" self = None # pylint: disable=C0103\n");
+ text = text.replace(" File(", " self.File(");
+
+ for (String line : text.split("\n")) {
+ output.write(" " + line + "\n");
+ }
+
+ if (text.contains("import ")) {
+ File file2 = new File(getOutputDir().getCanonicalPath() + File.separator
+ + "test_jython.xml");
+ output2 = new PrintWriter(new FileOutputStream(file2, true));
+ output2.write("try:\n");
+ for (String line : text.split("\n")) {
+ if (line.trim().startsWith("import ") || line.trim().startsWith("from ")) {
+ output2.write(" " + line + "\n");
+ }
+ }
+ output2.write("except ImportError, e:\n");
+ output2.write(" print '" + name + " failed: ' + str(e)\n");
+ }
+ } catch (IOException e) {
+ throw new BuildException("Not able to write JEP File " + name + "_jep.py");
+ } finally {
+ if (output != null) {
+ output.close();
+ }
+ if (output2 != null) {
+ output2.close();
+ }
+ }
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/ScriptDump.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/ScriptDump.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.antlint.ant.types;
+
+import java.io.File;
+import java.util.List;
+
+import com.nokia.helium.ant.data.AntFile;
+import com.nokia.helium.ant.data.AntlibMeta;
+import com.nokia.helium.ant.data.MacroMeta;
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.ant.data.TargetMeta;
+
+/**
+ * ScriptDump
is an abstract implementation for extracting and
+ * dumping of various scripts from within an Ant file.
+ */
+public abstract class ScriptDump {
+
+ private File outputDir;
+ private AntFile antFile;
+
+ /**
+ * Return the ant file.
+ *
+ * @return the ant file.
+ */
+ protected AntFile getAntFile() {
+ return antFile;
+ }
+
+ /**
+ * Set the ant file.
+ *
+ * @param the ant file to set.
+ */
+ public void setAntFile(AntFile antFile) {
+ this.antFile = antFile;
+ }
+
+ /**
+ * Method extracts and dumps the requested scripts.
+ */
+ public void dump() {
+ RootAntObjectMeta root = getAntFile().getRootObjectMeta();
+ if (root instanceof ProjectMeta) {
+ ProjectMeta projectMeta = (ProjectMeta) root;
+ List targets = projectMeta.getTargets();
+ for (TargetMeta targetMeta : targets) {
+ run(targetMeta);
+ }
+ List macros = projectMeta.getScriptDefinitions(getMacroXPathExpression());
+ for (MacroMeta macroMeta : macros) {
+ run(macroMeta);
+ }
+ } else {
+ AntlibMeta antlibMeta = (AntlibMeta) root;
+ List macros = antlibMeta.getScriptDefinitions(getMacroXPathExpression());
+ for (MacroMeta macroMeta : macros) {
+ run(macroMeta);
+ }
+ }
+ }
+
+ protected void run(TargetMeta targetMeta) {
+ String xpath = getScriptXPathExpression(targetMeta.getName());
+ if (xpath != null) {
+ List macros = targetMeta.getScriptDefinitions(xpath);
+ for (MacroMeta macroMeta : macros) {
+ run(macroMeta);
+ }
+ }
+ }
+
+ public void setOutputDir(File outputDir) {
+ this.outputDir = outputDir;
+ }
+
+ public File getOutputDir() {
+ return outputDir;
+ }
+
+ /**
+ * Get the xpath expression of the macro.
+ *
+ * @return the xpath expression of the macro.
+ */
+ protected abstract String getMacroXPathExpression();
+
+ /**
+ * Get the xpath expression for the input target.
+ *
+ * @param targetName is the name of the target.
+ * @return the xpath expression for the input target.
+ */
+ protected abstract String getScriptXPathExpression(String targetName);
+
+ /**
+ * Method runs the check against the input {@link MacroMeta}.
+ *
+ * @param macroMeta is the {@link MacroMeta} against whom the check is run.
+ */
+ protected abstract void run(MacroMeta macroMeta);
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/antunit/test_antlint.ant.xml
--- a/buildframework/helium/sf/java/antlint/tests/antunit/test_antlint.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/tests/antunit/test_antlint.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -20,7 +20,7 @@
============================================================================
-->
-
+
Helium Antlib AntLint unittests.
@@ -42,6 +42,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -50,7 +146,7 @@
-
+
@@ -60,7 +156,7 @@
-
+
@@ -70,9 +166,50 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -80,19 +217,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -103,164 +228,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -273,10 +242,10 @@
-
+
-
-
+
+
@@ -290,11 +259,11 @@
-
+
-
-
+
+
@@ -308,15 +277,15 @@
-
-
+
+
-
-
+
+
${report.xml}
@@ -328,24 +297,114 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/build.bat
--- a/buildframework/helium/sf/java/antlint/tests/build.bat Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/tests/build.bat Sun Oct 10 15:22:15 2010 +0300
@@ -21,7 +21,7 @@
set TESTED_JAVA=C:\Apps\j2sdk_1.6.0_02
) ELSE set TESTED_JAVA=%JAVA_6_HOME%
if exist %TESTED_JAVA% (set JAVA_HOME=%TESTED_JAVA%)
-call ant -Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor %*
+call ant %*
if "%ERRORLEVEL%" neq "0" (goto error)
endlocal
goto :eof
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/data/build.xml
--- a/buildframework/helium/sf/java/antlint/tests/data/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/tests/data/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,5 +25,12 @@
Test target
-
-
+
+
+ Test target test2
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/data/config/java_checkstyle_config.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/tests/data/config/java_checkstyle_config.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/data/config/pylint-script.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/tests/data/config/pylint-script.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,22 @@
+#============================================================================
+#Name : pylint-script.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+#!/usr/bin/env python
+import sys
+from pylint import lint
+lint.Run(sys.argv[1:])
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/data/config/pylintrc.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/tests/data/config/pylintrc.txt Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,303 @@
+
+[MASTER]
+
+# Add to the black list. It should be a base name, not a
+# path. You may set this option multiple times.
+ignore=CVS
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# Set the cache size for astng objects.
+cache-size=500
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable only checker(s) with the given id(s). This option conflicts with the
+# disable-checker option
+#enable-checker=
+
+# Enable all checker(s) except those with the given id(s). This option
+# conflicts with the enable-checker option
+#disable-checker=
+
+# Enable all messages in the listed categories.
+#enable-msg-cat=
+
+# Disable all messages in the listed categories.
+#disable-msg-cat=
+
+# Enable the message(s) with the given id(s).
+#enable-msg=
+
+# Disable the message(s) with the given id(s).
+# R0912: Too many branches
+# F0401: Unable to import 'x'
+# C0111: Missing docstring
+# R0201: Method could be a function
+# R0915: Too many statements
+# R0902: Too many instance attributes
+# R0913: Too many arguments
+# R0904: Too many public methods
+# C0103: Invalid name
+# W0603: Using the global statement
+# W0142: Used * or ** magic
+# W0612: Unused variable
+# R0922: Abstract class is only referenced 1 times
+# W0232: Class has no __init__ method
+# I0011: Locally disabling *
+disable=C0301,W0401,W0611,W0614,R0801,W0402,R0914,C0302,R0903,R0912,F0401,C0111,R0201,R0915,R0902,R0913,R0904,C0103,W0603,W0142,W0612,R0922,W0232,I0011
+
+
+[REPORTS]
+
+# set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html
+output-format=text
+
+# Include message's id in output
+include-ids=yes
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells wether to display a full report or only the messages
+reports=yes
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note).You have access to the variables errors warning, statement which
+# respectivly contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (R0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (R0004).
+comment=no
+
+# Enable the report(s) with the given id(s).
+#enable-report=
+
+# Disable the report(s) with the given id(s).
+#disable-report=
+
+
+# checks for :
+# * doc strings
+# * modules / classes / functions / methods / arguments / variables name
+# * number of arguments, local variables, branchs, returns and statements in
+# functions, methods
+# * required module attributes
+# * dangerous default values as arguments
+# * redefinition of function / method / class
+# * uses of the global statement
+#
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# Regular expression which should only match functions or classes name which do
+# not require a docstring
+no-docstring-rgx=__.*__
+
+# Regular expression which should only match correct module names
+module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__)|(_[a-zA-Z0-9_]{2,40}))$
+
+# Regular expression which should only match correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+function-rgx=[a-z_][a-zA-Z0-9_]{2,40}$
+
+# Regular expression which should only match correct method names
+method-rgx=[a-z_][a-zA-Z0-9_]{2,40}$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=[a-z_][a-zA-Z0-9_]{2,40}$
+
+# Regular expression which should only match correct argument names
+argument-rgx=[a-z_][a-zA-Z0-9_]{2,30}$
+
+# Regular expression which should only match correct variable names
+variable-rgx=[a-z_][a-zA-Z0-9_]{2,30}$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
+
+# Good variable names which should always be accepted, separated by a comma
+good-names=i,j,k,ex,Run,_
+
+# Bad variable names which should always be refused, separated by a comma
+bad-names=foo,bar,baz,toto,tutu,tata
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=map,filter,apply,input
+
+
+# try to find bugs in the code using type inference
+#
+[TYPECHECK]
+
+# Tells wether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# When zope mode is activated, consider the acquired-members option to ignore
+# access to some undefined attributes.
+zope=no
+
+# List of members which are usually get through zope's acquisition mecanism and
+# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
+acquired-members=REQUEST,acl_users,aq_parent
+
+
+# checks for
+# * unused variables / imports
+# * undefined variables
+# * redefinition of variable from builtins or from an outer scope
+# * use of variable before assigment
+#
+[VARIABLES]
+
+# Tells wether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching names used for dummy variables (i.e. not used).
+dummy-variables-rgx=_|dummy
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+# checks for :
+# * methods without self as first argument
+# * overridden methods signature
+# * access only to existant members via self
+# * attributes not defined in the __init__ method
+# * supported interfaces implementation
+# * unreachable code
+#
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+
+# checks for sign of poor/misdesign:
+# * number of methods, attributes, local variables...
+# * size, complexity of functions, methods
+#
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=5
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branchs=12
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=2
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+
+# checks for
+# * external modules dependencies
+# * relative / wildcard imports
+# * cyclic imports
+# * uses of deprecated modules
+#
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report R0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report R0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report R0402 must
+# not be disabled)
+int-import-graph=
+
+
+# checks for :
+# * unauthorized constructions
+# * strict indentation
+# * line length
+# * use of <> instead of !=
+#
+[FORMAT]
+
+# Maximum number of characters on a single line.
+max-line-length=80
+
+# Maximum number of lines in a module
+max-module-lines=1000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
+# tab).
+indent-string=' '
+
+
+# checks for:
+# * warning notes in the code like FIXME, XXX
+# * PEP 263: source code with non ascii character but no encoding declaration
+#
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
+
+
+# checks for similarities and duplicated code. This computation may be
+# memory / CPU intensive, so you should disable it if you experiments some
+# problems.
+#
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/data/sample.ant.xml
--- a/buildframework/helium/sf/java/antlint/tests/data/sample.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/tests/data/sample.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -27,7 +27,10 @@
-
+
+
+
+
pow
@@ -72,51 +75,51 @@
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
-print check-script-size
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
+print 'check-script-size'
@@ -187,6 +190,7 @@
from path import path
+print abcd
print "Writing version file...."
vfile = path(r'${build.drive}'+"/").joinpath('s60_version.txt')
f = open(str(vfile), 'w')
@@ -294,5 +298,122 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/data/sample.antlib.xml
--- a/buildframework/helium/sf/java/antlint/tests/data/sample.antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antlint/tests/data/sample.antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -31,8 +31,6 @@
-
-
result = None
if project.getProperty("test.scriptdef.property")is not None:
@@ -45,10 +43,23 @@
target = str(attributes.get('attr0'))
-
+
-target = str(attributes.get('attr0'))
+
+
@@ -70,7 +81,28 @@
target = str(attributes.get('target'))
-
-target = str(attributes.get('target'))
+
+
+
+
+
+
+ antlintMacro
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antlint/tests/hlm_debug.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/tests/hlm_debug.log Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,1 @@
+11:02:12,823 DEBUG - Calling final target : null
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/antunit/src/com/nokia/helium/antunit/ant/types/CustomListener.java
--- a/buildframework/helium/sf/java/antunit/src/com/nokia/helium/antunit/ant/types/CustomListener.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/antunit/src/com/nokia/helium/antunit/ant/types/CustomListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -32,14 +32,14 @@
* The customListener type allows you to defines additional custom
* listener to be run while running test. Each test are considered
* as single build.
- *
+ *
* <au:antunit<
* .......
* <hlm:customListener<
* <hlm:listener classname="org.apache.tools.ant.listener.XmlLogger" /<
* </hlm:customListener<
* </au:antunit<
- *
+ *
* @ant.type name="customListener" category="antunit"
*/
public class CustomListener extends DataType implements AntUnitListener {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,34 @@
+
+
+
+ Helium Antlib Blocks build file.
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/demo/build.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/demo/build.bat Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,27 @@
+@echo off
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+setlocal
+if not defined JAVA_6_HOME (
+set TESTED_JAVA=C:\Apps\j2sdk_1.6.0_02
+) ELSE set TESTED_JAVA=%JAVA_6_HOME%
+if exist %TESTED_JAVA% (set JAVA_HOME=%TESTED_JAVA%)
+set OLDANT_ARGS=-lib %CD%\..\lib -lib %CD%\..\..\..\sf\lib -lib %CD%\..\..\bin\helium-blocks.jar -lib %CD%\..\..\..\sf\antlibs
+ant %*
+endlocal
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/demo/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/demo/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,44 @@
+
+
+
+ Helium Antlib blocks demo.
+
+
+
+
+
+
+
+ wsid: ${wsid}
+
+
+
+ unittest-addworkspace exists: ${name.exists}
+
+
+
+ workspace-demo dir exists: ${dir.exists}
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/ivy.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/ivy.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/AddWorkspaceStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/AddWorkspaceStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * Implements a parser of add workspace calls.
+ *
+ */
+public class AddWorkspaceStreamConsumer implements StreamConsumer {
+
+ public static final String MARKER = "Workspace id: ";
+ private int wsid;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void consumeLine(String line) {
+ // Workspace id: 2
+ if (line.startsWith(MARKER)) {
+ wsid = Integer.valueOf(line.substring(MARKER.length()));
+ }
+ }
+
+ /**
+ * Get the discovered workspace ID.
+ * @return the workspace ID. Zero value means an invalid ID.
+ */
+ public int getWsid() {
+ return wsid;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Blocks.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Blocks.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+import java.io.File;
+import java.util.List;
+
+import com.nokia.helium.core.plexus.CommandBase;
+
+/**
+ * This class is the base abstraction layer for invoking
+ * Blocks commands.
+ *
+ */
+public class Blocks extends CommandBase {
+ public static final String SEARCH_ALL_BUNDLES_EXPRESSION = ".";
+ private String executable = "blocks";
+
+ /**
+ * Default constructor.
+ */
+ public Blocks() {
+ }
+
+ /**
+ * New blocks instance with proper blocks script location.
+ * @param executable
+ */
+ public Blocks(String executable) {
+ this.executable = executable;
+ }
+
+ /**
+ * Add a new Blocks workspace.
+ * @param location the location of the workspace
+ * @param name the name of the workspace
+ * @return a Workspace object
+ * @throws BlocksException
+ */
+ public Workspace addWorkspace(File location, String name) throws BlocksException {
+ String[] args = new String[3];
+ args[0] = "workspace-add";
+ args[1] = location.getAbsolutePath();
+ args[2] = "--name=" + name;
+ AddWorkspaceStreamConsumer consumer = new AddWorkspaceStreamConsumer();
+ execute(args, consumer);
+
+ Workspace workspace = new Workspace();
+ workspace.setWsid(consumer.getWsid());
+ workspace.setLocation(location);
+ workspace.setName(name);
+ return workspace;
+ }
+
+ /**
+ * Remove a workspace.
+ * @param wsid the id of the workspace to remove.
+ * @throws BlocksException
+ */
+ public void removeWorkspace(int wsid) throws BlocksException {
+ String[] args = new String[3];
+ args[0] = "--force";
+ args[1] = "workspace-remove";
+ args[2] = "" + wsid;
+ execute(args);
+ }
+
+ /**
+ * List all existing workspaces.
+ * @return an array of Workspace objects.
+ * @throws BlocksException
+ */
+ public Workspace[] listWorkspaces() throws BlocksException {
+ String[] args = new String[1];
+ args[0] = "workspace-list";
+ WorkspaceListStreamConsumer consumer = new WorkspaceListStreamConsumer();
+ execute(args, consumer);
+ return consumer.getWorkspaces();
+ }
+
+ /**
+ * Search for a bundles matching the expression.
+ * @param expression the expression to match
+ * @return a list of string representing the list of bundles.
+ * @throws BlocksException in case of execution errors.
+ */
+ public List search(int wsid, String expression) throws BlocksException {
+ String[] args = new String[3];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "search";
+ args[2] = expression;
+ SearchStreamConsumer consumer = new SearchStreamConsumer();
+ execute(args, consumer);
+ return consumer.getSearchResults();
+ }
+
+ /**
+ * Installing a bundles defines by a name.
+ * @param bundleName the name of the bundle to install
+ * @throws BlocksException
+ */
+ public void installBundle(int wsid, String bundleName) throws BlocksException {
+ String[] args = new String[4];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "--force";
+ args[2] = "bundle-install";
+ args[3] = bundleName;
+ execute(args);
+ }
+
+ /**
+ * Installing a bundles defines by a group name.
+ * @param groupName the group name to install
+ * @throws BlocksException
+ */
+ public void installGroup(int wsid, String groupName) throws BlocksException {
+ String[] args = new String[4];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "--force";
+ args[2] = "group-install";
+ args[3] = groupName;
+ execute(args);
+ }
+
+ /**
+ * Get the list of groups available.
+ * @return
+ * @throws BlocksException
+ */
+ public List listGroup(int wsid) throws BlocksException {
+ String[] args = new String[2];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "group-list";
+ GroupListStreamConsumer consumer = new GroupListStreamConsumer();
+ execute(args, consumer);
+ return consumer.getGroups();
+ }
+
+ /**
+ * Add a repository to a workspace, using a generated name.
+ * @param wsid
+ * @param url
+ * @throws BlocksException
+ */
+ public void addRepository(int wsid, String url) throws BlocksException {
+ String[] args = new String[4];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "--force";
+ args[2] = "repo-add";
+ args[3] = url;
+ execute(args);
+ }
+
+ /**
+ * Add a repository to a workspace, using a given name.
+ * @param wsid the workspace id
+ * @param name the repository name
+ * @param url the repository location.
+ * @throws BlocksException
+ */
+ public void addRepository(int wsid, String name, String url) throws BlocksException {
+ String[] args = new String[5];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "--force";
+ args[2] = "repo-add";
+ args[3] = "--name=" + name;
+ args[4] = url;
+ execute(args);
+ }
+
+ /**
+ * Remove a repository base on its id.
+ * @param wsid the workspace id
+ * @param id the repository id to remove
+ * @throws BlocksException
+ */
+ public void removeRepository(int wsid, int id) throws BlocksException {
+ String[] args = new String[4];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "--force";
+ args[2] = "repo-remove";
+ args[3] = "" + id;
+ execute(args);
+ }
+
+ /**
+ * Remove a repository base on its name.
+ * @param wsid the workspace id
+ * @param name the repository name to remove
+ * @throws BlocksException
+ */
+ public void removeRepository(int wsid, String name) throws BlocksException {
+ String[] args = new String[3];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "repo-remove";
+ args[2] = name;
+ execute(args);
+ }
+
+ /**
+ * Get the repository list for current workspace.
+ * @param wsid the current workspace id.
+ * @return the repository list
+ * @throws BlocksException
+ */
+ public List listRepository(int wsid) throws BlocksException {
+ String[] args = new String[2];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "repo-list";
+ RepositoryListStreamConsumer consumer = new RepositoryListStreamConsumer();
+ execute(args, consumer);
+ return consumer.getRepositories();
+ }
+
+ /**
+ * Updating the workspace pointed by wsid.
+ * @param wsid the workspace id to update
+ * @throws BlocksException
+ */
+ public void update(int wsid) throws BlocksException {
+ String[] args = new String[3];
+ args[0] = "--wsid=" + wsid;
+ args[1] = "--force";
+ args[2] = "update";
+ execute(args);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getExecutable() {
+ return executable;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void throwException(String message, Throwable t) throws BlocksException {
+ throw new BlocksException(message, t);
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/BlocksException.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/BlocksException.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+/**
+ * Exception thrown by the Blocks framework.
+ *
+ */
+public class BlocksException extends Exception {
+
+ private static final long serialVersionUID = 8563679708827021881L;
+
+ /**
+ * Default constructor
+ * @param error the error message.
+ */
+ public BlocksException(String error) {
+ super(error);
+ }
+
+ /**
+ * Constructor which accept a message and a cause.
+ * @param error the error message.
+ */
+ public BlocksException(String message, Throwable t) {
+ super(message, t);
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Bundle.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Bundle.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.blocks;
+
+import java.io.File;
+
+import com.nokia.helium.core.plexus.CommandBase;
+
+/**
+ * Wrapper class for the bundle application. The bundle application will help to do simple
+ * operations on bundles, like creating repository index or sign a bundle.
+ *
+ */
+public class Bundle extends CommandBase {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getExecutable() {
+ return "bundle";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void throwException(String message, Throwable t) throws BundleException {
+ throw new BundleException(message, t);
+ }
+
+ /**
+ * Create a repository index base on a directory.
+ *
+ * @param path the directory which contains the debs packages.
+ * @throws BundleException in case of error.
+ */
+ public void createRepositoryIndex(File path) throws BundleException {
+ createRepositoryIndex(path, false);
+ }
+
+ /**
+ * Create a signed repository index base on a directory.
+ *
+ * @param path the directory which contains the debs packages.
+ * @param sign defines if the repository should be signed.
+ * @throws BundleException in case of error.
+ */
+ public void createRepositoryIndex(File path, boolean sign) throws BundleException {
+ if (path == null) {
+ throw new BundleException("Impossible to create the index, no directory specified.");
+ }
+ if (!path.isDirectory()) {
+ throw new BundleException("Invalid directory: " + path.getAbsolutePath());
+ }
+ String[] args = null;
+ if (sign) {
+ args = new String[3];
+ args[0] = "create-repo";
+ args[1] = "--sign";
+ args[2] = path.getAbsolutePath();
+ }
+ else {
+ args = new String[2];
+ args[0] = "create-repo";
+ args[1] = path.getAbsolutePath();
+ }
+ this.execute(args);
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/BundleException.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/BundleException.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+/**
+ * Exception thrown by the Bundle manipulation framework.
+ *
+ */
+public class BundleException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Default constructor.
+ * @param error the error message.
+ */
+ public BundleException(String error) {
+ super(error);
+ }
+
+ /**
+ * Constructor which accept a message and a cause.
+ * @param error the error message.
+ */
+ public BundleException(String message, Throwable t) {
+ super(message, t);
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Group.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Group.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+/**
+ * This class represents information related to
+ * a group.
+ *
+ */
+public class Group {
+ private String name;
+
+ /**
+ * Create a new Group with a name.
+ * @param name
+ */
+ public Group(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the group name.
+ * @return the group name as a string.
+ */
+ public String getName() {
+ return name;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/GroupListStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/GroupListStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * Implements group-list results parsing.
+ *
+ */
+public class GroupListStreamConsumer implements StreamConsumer {
+ private List groups = new ArrayList();
+
+ @Override
+ public void consumeLine(String line) {
+ if (line.trim().length() > 0) {
+ groups.add(new Group(line.trim()));
+ }
+ }
+
+ /**
+ * Get the group list from blocks output.
+ * @return a list of Group instance.
+ */
+ public List getGroups() {
+ return groups;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Repository.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Repository.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+
+/**
+ * This class stores the information related to a
+ * repository.
+ *
+ */
+public class Repository {
+ private int id;
+ private String name;
+ private String url;
+
+ /**
+ * Set the repository id.
+ * @param id
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * Set the repository name.
+ * @param id
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set the repository location.
+ * @param id
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * Get the repository id.
+ * @param id
+ */
+ public int getId() {
+ return id;
+ }
+
+ /**
+ * Get the repository name.
+ * @param id
+ */
+ public String getName() {
+ return name;
+ }
+
+
+ /**
+ * Get the repository location.
+ * @param id
+ */
+ public String getUrl() {
+ return url;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/RepositoryListStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/RepositoryListStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * Implements repo-list results parsing.
+ *
+ */
+public class RepositoryListStreamConsumer implements StreamConsumer {
+ private List repositories = new ArrayList();
+ private Repository repository;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void consumeLine(String line) {
+ if (repository == null && line.matches("^\\d+\\*?$")) {
+ repository = new Repository();
+ repository.setId(Integer.parseInt(line.trim().replaceAll("\\*", "")));
+ } else if (repository != null && line.matches("^\\s+Name:\\s+.+$")) {
+ repository.setName(line.split("Name:")[1].trim());
+ } else if (repository != null && line.matches("^\\s+URI:\\s+.+$")) {
+ repository.setUrl(line.split("URI:")[1].trim());
+ repositories.add(repository);
+ repository = null;
+ }
+ }
+
+ /**
+ * Get the list of repositories found.
+ * @return the list of repositories.
+ */
+ public List getRepositories() {
+ return repositories;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/SearchStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/SearchStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * Implements search results parsing.
+ *
+ */
+public class SearchStreamConsumer implements StreamConsumer {
+ private static final String SEPARATOR = " - ";
+ private List results = new ArrayList();
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void consumeLine(String line) {
+ if (line.contains(SEPARATOR)) {
+ results.add(line.substring(0, line.indexOf(SEPARATOR)));
+ }
+ }
+
+ /**
+ * Get the search result list.
+ * @return
+ */
+ public List getSearchResults() {
+ return results;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Workspace.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/Workspace.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+import java.io.File;
+
+/**
+ * Holder for workspace information:
+ * - ID
+ * - Name
+ * - Location
+ *
+ */
+public class Workspace {
+ private int wsid;
+ private String name;
+ private File location;
+
+
+ /**
+ * Get the workspace id.
+ * @return the workspace id.
+ */
+ public int getWsid() {
+ return wsid;
+ }
+
+ /**
+ * Set the workspace id.
+ * @param wsid the workspace id
+ */
+ public void setWsid(int wsid) {
+ this.wsid = wsid;
+ }
+
+ /**
+ * Get the workspace name.
+ * @return the workspace name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the workspace name.
+ * @param name The workspace name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the workspace location.
+ * @return the workspace directory.
+ */
+ public File getLocation() {
+ return location;
+ }
+
+ /**
+ * Set the workspace location.
+ * @param location the location to set.
+ */
+ public void setLocation(File location) {
+ this.location = location;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/WorkspaceListStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/WorkspaceListStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks;
+
+import java.io.File;
+import java.util.Vector;
+
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * Implements a parser of workspace list calls.
+ *
+ */
+public class WorkspaceListStreamConsumer implements StreamConsumer {
+
+ private Workspace workspace;
+ private Vector workspaces = new Vector();
+
+ @Override
+ public void consumeLine(String line) {
+ if (workspace == null && line.matches("^\\d+\\*?$")) {
+ workspace = new Workspace();
+ workspace.setWsid(Integer.parseInt(line.trim().replaceAll("\\*", "")));
+ } else if (workspace != null && line.matches("^\\s+name:\\s+.+$")) {
+ workspace.setName(line.split("name:")[1].trim());
+ } else if (workspace != null && line.matches("^\\s+path:\\s+.+$")) {
+ workspace.setLocation(new File(line.split("path:")[1].trim()));
+ workspaces.add(workspace);
+ workspace = null;
+ }
+ }
+
+ /**
+ * Returns the list of found workspaces.
+ * @return
+ */
+ public Workspace[] getWorkspaces() {
+ return workspaces.toArray(new Workspace[workspaces.size()]);
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/AbstractBlocksTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/AbstractBlocksTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,88 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+
+import com.nokia.helium.blocks.Blocks;
+import com.nokia.helium.core.plexus.AntStreamConsumer;
+
+/**
+ * This class implement an abstract Blocks task. It predefines
+ * some method to handle the workspace id.
+ *
+ */
+public abstract class AbstractBlocksTask extends Task {
+
+ private Blocks blocks;
+ private boolean verbose;
+ private Integer wsid;
+
+ /**
+ * The workspace id.
+ * @param wsid
+ * @ant.not-required
+ */
+ public void setWsid(Integer wsid) {
+ this.wsid = wsid;
+ }
+
+ /**
+ * Get the workspace id, it throws a BuildException if not set.
+ * @return
+ */
+ public int getWsid() {
+ if (wsid == null) {
+ throw new BuildException("wsid has not been specified.");
+ }
+ return wsid.intValue();
+ }
+
+
+ /**
+ * Are we execution the task in verbose mode.
+ * @return
+ */
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ /**
+ * Set true to show the output from blocks command execution.
+ * @param verbose
+ * @ant.not-required Default to false.
+ */
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ protected Blocks getBlocks() {
+ if (blocks == null) {
+ blocks = new Blocks();
+ if (isVerbose()) {
+ blocks.addOutputLineHandler(new AntStreamConsumer(this, Project.MSG_INFO));
+ } else {
+ blocks.addOutputLineHandler(new AntStreamConsumer(this, Project.MSG_DEBUG));
+ }
+ blocks.addErrorLineHandler(new AntStreamConsumer(this, Project.MSG_ERR));
+ }
+ return blocks;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/antlib.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/conditions/RepositoryExists.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/conditions/RepositoryExists.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.conditions;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.condition.Condition;
+
+import com.nokia.helium.blocks.Blocks;
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.Repository;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+
+/**
+ * The blocksRepositoryExists condition help you to check the existence of a repository definition under
+ * a specific workspace.
+ *
+ * This example will set the 'exists' property if a 'my_repository_name' repository is defined in the wsid workspace:
+ *
+ * <condition property="exists" >
+ * <hlm:blocksRepositoryExists name="my_repository_name" />
+ * </condition>
+ *
+
+ * This example will set the 'exists' property if any repository are defined in the wsid workspace:
+ *
+ * <condition property="exists" >
+ * <hlm:blocksRepositoryExists />
+ * </condition>
+ *
+ *
+ * @ant.type name="blocksRepositoryExists" category="Blocks"
+ */
+
+public class RepositoryExists extends AbstractBlocksTask implements Condition {
+ private String name;
+
+ /**
+ * The name of the repository to check the existence.
+ * @param name
+ * @ant.not-required
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean eval() {
+ Blocks blocks = getBlocks();
+ try {
+ for (Repository repository : blocks.listRepository(getWsid())) {
+ if (name != null && name.equals(repository.getName())) {
+ return true;
+ } else if (name == null) {
+ return true;
+ }
+
+ }
+ } catch (BlocksException e) {
+ throw new BuildException(e);
+ }
+ return false;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/conditions/WorkspaceExists.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/conditions/WorkspaceExists.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.conditions;
+
+import hidden.org.codehaus.plexus.interpolation.os.Os;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.condition.Condition;
+
+import com.nokia.helium.blocks.Blocks;
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.Workspace;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+import com.nokia.helium.core.filesystem.windows.Subst;
+
+/**
+ * The blocksWorkspaceExists condition help you to check the existence of a workspace
+ * based on his name or location.
+ *
+ * In the following example the property 'exists' is set if the blocks workspace named 'workspace_name' exists:
+ *
+ * <condition property="exists" >
+ * <hlm:blocksWorkspaceExists name="workspace_name" />
+ * </condition>
+ *
+ *
+ * @ant.type name="blocksWorkspaceExists" category="Blocks"
+ */
+public class WorkspaceExists extends AbstractBlocksTask implements Condition {
+
+ private File dir;
+ private String name;
+
+ /**
+ * The directory of the workspace to check the existence.
+ * @param dir
+ * @ant.not-required
+ */
+ public void setDir(File dir) {
+ this.dir = dir;
+ }
+
+ /**
+ * The name of the workspace to check the existence.
+ * @param name
+ * @ant.not-required
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean eval() {
+ if (dir == null && name == null) {
+ throw new BuildException("Either name or dir should be defined.");
+ }
+ if (dir != null && name != null) {
+ throw new BuildException("name or dir should not be defined at the same time.");
+ }
+
+ Blocks blocks = getBlocks();
+ try {
+ for (Workspace workspace : blocks.listWorkspaces()) {
+ if (dir != null && getRealDir().equals(workspace.getLocation().getCanonicalFile())) {
+ return true;
+ }
+ if (name != null && name.equals(workspace.getName())) {
+ return true;
+ }
+ }
+ } catch (BlocksException e) {
+ throw new BuildException(e);
+ } catch (IOException e) {
+ throw new BuildException(e);
+ }
+ return false;
+ }
+
+ /**
+ * Solve subst drives on windows.
+ * @return the realpath.
+ * @throws IOException
+ */
+ protected File getRealDir() throws IOException {
+ if (Os.isFamily(Os.FAMILY_WINDOWS) && dir != null) {
+ Subst subst = new Subst();
+ log("Real path: " + subst.getRealPath(dir).getCanonicalFile());
+ return subst.getRealPath(dir).getCanonicalFile();
+ }
+ return dir != null ? dir.getCanonicalFile() : null;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/helium.antlib.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/helium.antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,28 @@
+
+
+
+
+ Ant task definition declarations.
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/AddRepoTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/AddRepoTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+import com.nokia.helium.blocks.ant.types.RepositorySet;
+import com.nokia.helium.blocks.ant.types.RepositorySet.Repository;
+
+/**
+ * Adding repository to a workspace.
+ *
+ * Adding a repository with generated name:
+ *
+ * <hlm:blocksAddRepository wsid="1" url="file:e:/repo" />
+ *
+ *
+ * Adding repository with a given name:
+ *
+ * <hlm:blocksAddRepository wsid="1" name="repo1" url="file:e:/repo1" />
+ *
+ *
+ * Adding several repositories using nested repositorySet elements:
+ *
+ * <hlm:blocksAddRepository wsid="1">
+ * <repositorySet>
+ * <repository name="repo1" url="file:e:/repo1"/>
+ * <repository name="repo2" url="file:e:/repo2"/>
+ * </repositorySet>
+ * </hlm:blocksAddRepository>
+ *
+
+ * @ant.task name="blocksAddRepository" category="Blocks"
+ */
+public class AddRepoTask extends AbstractBlocksTask {
+ private String url;
+ private String name;
+ private List repositorySets = new ArrayList();
+
+ /**
+ * Add this repository URL to the
+ * workspace.
+ * @param url
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * Name of this repository.
+ * @param name
+ * @ant.not-required Blocks will generate a name.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Adding a nested RepositorySet element.
+ * @return a new RepositorySet instance.
+ */
+ public RepositorySet createRepositorySet() {
+ RepositorySet repositorySet = new RepositorySet();
+ this.add(repositorySet);
+ return repositorySet;
+ }
+
+ /**
+ * Adding a nested RepositorySet element.
+ * @param repositorySet
+ */
+ public void add(RepositorySet repositorySet) {
+ repositorySets.add(repositorySet);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute() {
+ if (url == null && repositorySets.isEmpty()) {
+ throw new BuildException("'url' attribute has not been defined.");
+ }
+ if (url != null && !repositorySets.isEmpty()) {
+ throw new BuildException("'url' attribute and nested repositorySet element cannot be used at the same time.");
+ }
+ try {
+ if (url != null) {
+ if (name == null) {
+ getBlocks().addRepository(getWsid(), url);
+ log("The repository " + url + " has been added successfully to workspace " + getWsid() + ".");
+ } else {
+ getBlocks().addRepository(getWsid(), name, url);
+ log("The repository " + name + " => " + url +
+ " has been added successfully to workspace " + getWsid() + ".");
+ }
+ } else {
+ for (RepositorySet repositorySet : repositorySets) {
+ for (Repository repository : repositorySet.getRepositories()) {
+ if (repository.getName() == null || repository.getUrl() == null) {
+ throw new BuildException("Either name or url attribute missing at " + repository.getLocation());
+ }
+ getBlocks().addRepository(getWsid(), repository.getName(), repository.getUrl());
+ }
+ }
+ }
+ } catch (BlocksException e) {
+ throw new BuildException(e.getMessage(), e);
+ }
+ }
+
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/AddWorkspaceTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/AddWorkspaceTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.Workspace;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+
+/**
+ * Declare a directory as a Blocks workspace.
+ *
+ *
+ * <hlm:blocksAddWorkspace name="myworkspace" dir="/path/to/workspace/dir/" wsidproperty="wsid" />
+ *
+ *
+ * @ant.task name="blocksAddWorkspace" category="Blocks"
+ */
+public class AddWorkspaceTask extends AbstractBlocksTask {
+
+ private String name;
+ private File dir;
+ private String wsidproperty;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute() {
+ if (dir == null) {
+ throw new BuildException("dir attribute is not defined.");
+ }
+ if (name == null) {
+ throw new BuildException("name attribute is not defined.");
+ }
+ try {
+ Workspace workspace = getBlocks().addWorkspace(dir, name);
+ log("Workspace " + workspace.getWsid() + " has been created successfully.");
+ if (wsidproperty != null) {
+ getProject().setNewProperty(wsidproperty, "" + workspace.getWsid());
+ }
+ } catch (BlocksException exc) {
+ throw new BuildException(exc);
+ }
+ }
+
+ /**
+ * The name of the output property.
+ * @param wsidproperty
+ * @ant.required
+ */
+ public void setWsidproperty(String wsidproperty) {
+ this.wsidproperty = wsidproperty;
+ }
+
+ /**
+ * The name of the workspace.
+ * @param name
+ * @ant.required
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+
+ /**
+ * The location of the workspace.
+ * @param dir
+ * @ant.required
+ */
+ public void setDir(File dir) {
+ this.dir = dir;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/CreateRepositoryIndexTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/CreateRepositoryIndexTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,149 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+
+import com.nokia.helium.blocks.Bundle;
+import com.nokia.helium.blocks.BundleException;
+import com.nokia.helium.core.plexus.AntStreamConsumer;
+
+/**
+ * This task will help you to create a debian repository index.
+ * To generate the index you need to set the dest attribute to point
+ * to a directory containing .deb packages. The outcome of the process
+ * will be a Package file under the mentioned directory.
+ *
+ *
+ * <hlm:blocksCreateRepositoryIndex dest="E:\some\path\to\a\repo"
+ * verbose="true" sign="false" />
+ *
+ * @ant.task name="blocksCreateRepositoryIndex" category="Blocks"
+ */
+public class CreateRepositoryIndexTask extends Task {
+
+ private File dest;
+ private boolean sign;
+ private boolean failOnError = true;
+ private boolean verbose;
+
+ /**
+ * Location where to create the repository index.
+ * @param dest
+ * @ant.required
+ */
+ public void setDest(File dest) {
+ this.dest = dest;
+ }
+
+ /**
+ * Get the location where to create the repository index.
+ * @return the dest folder.
+ */
+ public File getDest() {
+ return dest;
+ }
+
+ /**
+ * Defines if the repository index creation should be signed.
+ * @param sign If true the repository will be signed
+ * @ant.not-required Default is false
+ */
+ public void setSign(boolean sign) {
+ this.sign = sign;
+ }
+
+ /**
+ * Shall we sign the repository?
+ * @return true is the repository should be signed.
+ */
+ public boolean isSign() {
+ return sign;
+ }
+
+ /**
+ * If defined as true it will fail the build in case of error,
+ * else it will keepgoing.
+ * @param failOnError
+ * @ant.not-required Default is true.
+ */
+ public void setFailOnError(boolean failOnError) {
+ this.failOnError = failOnError;
+ }
+
+ /**
+ * Shall we fail on error?
+ * @return return true if should fails on error.
+ */
+ public boolean isFailOnError() {
+ return failOnError;
+ }
+
+ /**
+ * Set true to show the output from blocks command execution.
+ * @param verbose
+ * @ant.not-required Default to false.
+ */
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ /**
+ * Are we execution the task in verbose mode.
+ * @return
+ */
+ public boolean isVerbose() {
+ return verbose;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute() {
+ if (getDest() == null) {
+ throw new BuildException("'dest' attribute must be defined.");
+ }
+ try {
+ getBundle().createRepositoryIndex(getDest(), isSign());
+ } catch (BundleException e) {
+ if (isFailOnError()) {
+ throw new BuildException(e.getMessage(), e);
+ } else {
+ log(e.getMessage(), Project.MSG_ERR);
+ }
+ }
+ }
+
+ /**
+ * Get a pre-configured Bundle application wrapper instance.
+ * @return a new bundle object.
+ */
+ protected Bundle getBundle() {
+ Bundle bundle = new Bundle();
+ if (isVerbose()) {
+ bundle.addOutputLineHandler(new AntStreamConsumer(this, Project.MSG_INFO));
+ } else {
+ bundle.addOutputLineHandler(new AntStreamConsumer(this, Project.MSG_DEBUG));
+ }
+ bundle.addErrorLineHandler(new AntStreamConsumer(this, Project.MSG_ERR));
+ return bundle;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/GetWorkspaceIdTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/GetWorkspaceIdTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import hidden.org.codehaus.plexus.interpolation.os.Os;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.tools.ant.BuildException;
+
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.Workspace;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+import com.nokia.helium.core.filesystem.windows.Subst;
+
+/**
+ * Get the workspace based on the a name or a directory. The task fails if it can't find the information.
+ *
+ * This call will set the id of the workspace named myworkspace into the wsid property:
+ *
+ * <hlm:blocksGetWorkspaceId wsidoutput="wsid" name="myworkspace"/>
+ *
+ *
+ * @ant.task name="blocksGetWorkspaceId" category="Blocks"
+ */
+public class GetWorkspaceIdTask extends AbstractBlocksTask {
+
+ private File dir;
+ private String name;
+ private String wsidoutput;
+
+ /**
+ * The directory to get the wsid.
+ * @param dir the directory
+ * @ant.not-required
+ */
+ public void setDir(File dir) {
+ this.dir = dir;
+ }
+
+ /**
+ * The name of the workspace to get the wsid.
+ * @param name the name of a workspace
+ * @ant.not-required
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * The name of the output property.
+ * @param wsidoutput
+ * @ant.required
+ */
+ public void setWsidoutput(String wsidoutput) {
+ this.wsidoutput = wsidoutput;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute() {
+ if ((dir == null && name == null) || (dir != null && name != null)) {
+ throw new BuildException("You must define either name or dir attribute");
+ }
+
+ Workspace fw = null;
+ try {
+ File realDir = getRealDir();
+ for (Workspace workspace : getBlocks().listWorkspaces()) {
+ if (workspace.getLocation().getCanonicalFile().equals(realDir) || workspace.getName().equals(name)) {
+ fw = workspace;
+ break;
+ }
+ }
+ if (fw != null) {
+ log("Found matching workspace: " + fw.getWsid());
+ if (wsidoutput != null) {
+ log("Setting property " + wsidoutput);
+ getProject().setNewProperty(wsidoutput, "" + fw.getWsid());
+ }
+ }
+ } catch (BlocksException exc) {
+ throw new BuildException(exc);
+ } catch (IOException exc) {
+ throw new BuildException(exc);
+ }
+ }
+
+ /**
+ * Solve subst drives on windows.
+ * @return the realpath.
+ * @throws IOException
+ */
+ protected File getRealDir() throws IOException {
+ if (Os.isFamily(Os.FAMILY_WINDOWS) && dir != null) {
+ Subst subst = new Subst();
+ log("Real path: " + subst.getRealPath(dir).getCanonicalFile());
+ return subst.getRealPath(dir).getCanonicalFile();
+ }
+ return dir != null ? dir.getCanonicalFile() : null;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/InstallBundleTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/InstallBundleTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,188 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.PatternSet;
+
+import com.nokia.helium.blocks.Blocks;
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.Group;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+
+/**
+ * Installing a bundle under a workspace.
+ *
+ * The bundle "my-bundle-name" will be installed under the workspace 1:
+ *
+ * <hlm:blocksInstallBundle wsid="1" bundle="my-bundle-name" />
+ *
+ *
+ * The bundles matching the "my-bundle-name.*" pattern will be installed under the workspace 1:
+ *
+ * <hlm:blocksInstallBundle wsid="1">
+ * <bundleFilterSet>
+ * <include name="my-bundle-name.*" />
+ * <include name=".*src.*" />
+ * </bundleFilterSet>
+ * </hlm:blocksInstallBundle>
+ *
+ *
+ * The groups matching the ".*bin.*" pattern will be installed under the workspace 1:
+ *
+ * <hlm:blocksInstallBundle wsid="1">
+ * <groupFilterSet>
+ * <include name=".*bin.*" />
+ * </groupFilterSet>
+ * </hlm:blocksInstallBundle>
+ *
+ *
+ * bundleFilterSet and groupFilterSet are regular patternset, so any reference to patternset
+ * will be working:
+ *
+ * <patternset id="my.patternset" />
+ * ...
+ * <groupFilterSet refid="my.patternset" />
+ * ...
+ *
+ *
+ * @ant.task name="blocksInstallBundle" category="Blocks"
+ */
+public class InstallBundleTask extends AbstractBlocksTask {
+ private String group;
+ private String bundle;
+ private List bundlePatternSets = new ArrayList();
+ private List groupPatternSets = new ArrayList();
+
+ protected void validate() {
+ if ((bundle != null && (!bundlePatternSets.isEmpty() || group != null || !groupPatternSets.isEmpty()))
+ || (group != null && (!bundlePatternSets.isEmpty() || bundle != null || !groupPatternSets.isEmpty()))
+ || (!bundlePatternSets.isEmpty() && (group != null || bundle != null || !groupPatternSets.isEmpty()))
+ || (!groupPatternSets.isEmpty() && (group != null || bundle != null || !bundlePatternSets.isEmpty()))
+ || (bundle == null && bundlePatternSets.isEmpty() && group == null && groupPatternSets.isEmpty())) {
+ throw new BuildException("You can either use the bundle attribute or the group attribute or use nested groupfilterset or bundlefilterset.");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute() {
+ validate();
+ try {
+ if (bundle != null) {
+ log("Installing bundle " + bundle + " under workspace " + this.getWsid() + ".");
+ getBlocks().installBundle(this.getWsid(), bundle);
+ } else if (!bundlePatternSets.isEmpty()) {
+ for (String bundle : getBlocks().search(this.getWsid(), Blocks.SEARCH_ALL_BUNDLES_EXPRESSION)) {
+ if (shouldInstall(bundlePatternSets, bundle)) {
+ log("Installing " + bundle + " under workspace " + this.getWsid() + ".");
+ getBlocks().installBundle(this.getWsid(), bundle);
+ } else {
+ log("Skipping bundle " + bundle, Project.MSG_DEBUG);
+ }
+ }
+ } else if (group != null) {
+ log("Installing group " + group + " under workspace " + this.getWsid() + ".");
+ getBlocks().installGroup(this.getWsid(), group);
+ } else if (!groupPatternSets.isEmpty()) {
+ for (Group group : getBlocks().listGroup(this.getWsid())) {
+ if (shouldInstall(groupPatternSets, group.getName())) {
+ log("Installing group " + group.getName() + " under workspace " + this.getWsid() + ".");
+ getBlocks().installGroup(this.getWsid(), group.getName());
+ } else {
+ log("Skipping group " + bundle, Project.MSG_DEBUG);
+ }
+ }
+ }
+ } catch (BlocksException e) {
+ throw new BuildException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Defines the bundle name to install.
+ * @param bundle
+ * @ant.required
+ */
+ public void setBundle(String bundle) {
+ this.bundle = bundle;
+ }
+
+ /**
+ * Defines the bundle name to install.
+ * @param bundle
+ * @ant.required
+ */
+ public void setGroup(String group) {
+ this.group = group;
+ }
+
+ /**
+ * Add a nested patternset. Then bundle attribute cannot be used.
+ * @param patternSet
+ */
+ public PatternSet createBundleFilterSet() {
+ PatternSet patternSet = new PatternSet();
+ bundlePatternSets.add(patternSet);
+ return patternSet;
+ }
+
+ /**
+ * Add a nested patternset. Then bundle attribute cannot be used.
+ * @param patternSet
+ */
+ public PatternSet createGroupFilterSet() {
+ PatternSet patternSet = new PatternSet();
+ groupPatternSets.add(patternSet);
+ return patternSet;
+ }
+
+ /**
+ * Should the bundle be installed based on the patternsets config.
+ * @param patternSets a list of patternset elements
+ * @param name the name to validate
+ * @return
+ */
+ protected boolean shouldInstall(List patternSets, String name) {
+ int includes = 0;
+ for (PatternSet patternSet : patternSets) {
+ if (patternSet.getExcludePatterns(getProject()) != null) {
+ for (String pattern : patternSet.getExcludePatterns(getProject())) {
+ if (Pattern.matches(pattern, name)) {
+ return false;
+ }
+ }
+ }
+ if (patternSet.getIncludePatterns(getProject()) != null) {
+ for (String pattern : patternSet.getIncludePatterns(getProject())) {
+ includes ++;
+ if (Pattern.matches(pattern, name)) {
+ return true;
+ }
+ }
+ }
+ }
+ return includes == 0;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/RemoveRepoTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/RemoveRepoTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import org.apache.tools.ant.BuildException;
+
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+
+/**
+ * Remove a repository from a workspace.
+ *
+ * The repository named "my-repository-name" will be removed from workspace 1:
+ *
+ * <hlm:blocksRemoveRepository wsid="1" name="my-repository-name" />
+ *
+
+ * The repository 1 will be removed from workspace 1:
+ *
+ * <hlm:blocksRemoveRepository wsid="1" repositoryId="1" />
+ *
+ *
+ * @ant.task name="blocksRemoveRepository" category="Blocks"
+ */
+public class RemoveRepoTask extends AbstractBlocksTask {
+ private Integer repositoryId;
+ private String name;
+
+ /**
+ * Remove the repository using its id.
+ * workspace.
+ * @param repositoryId the repository id
+ * @ant.required
+ */
+ public void setRepositoryId(Integer repositoryId) {
+ this.repositoryId = repositoryId;
+ }
+
+ /**
+ * Remove the repository using its name.
+ * workspace.
+ * @param name the repository name
+ * @ant.not-required
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute() {
+ if (repositoryId == null && name == null) {
+ throw new BuildException("Either 'repositoryId' or 'name' attribute must be defined.");
+ }
+ if (repositoryId != null && name != null) {
+ throw new BuildException("'repositoryId' and 'name' attribute cannot be defined at the same time.");
+ }
+ try {
+ if (name != null) {
+ getBlocks().removeRepository(getWsid(), name);
+ log("The repository " + name + " has been removed successfully from workspace " + getWsid() + ".");
+ } else {
+ getBlocks().removeRepository(getWsid(), repositoryId.intValue());
+ log("The repository " + repositoryId + " has been removed successfully from workspace " + getWsid() + ".");
+ }
+ } catch (BlocksException e) {
+ throw new BuildException(e.getMessage(), e);
+ }
+ }
+
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/RemoveWorkspaceTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/RemoveWorkspaceTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import org.apache.tools.ant.BuildException;
+
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+
+/**
+ * Remove a Blocks workspace.
+ *
+ * The workspace 1 will be removed:
+ *
+ * <hlm:blocksRemoveWorkspace wsid="1" />
+ *
+ *
+ * @ant.task name="blocksRemoveWorkspace" category="Blocks"
+ */
+public class RemoveWorkspaceTask extends AbstractBlocksTask {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute() {
+ try {
+ getBlocks().removeWorkspace(getWsid());
+ log("Workspace " + getWsid() + " removed successfully.");
+ } catch (BlocksException e) {
+ throw new BuildException(e);
+ }
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/UpdateTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/taskdefs/UpdateTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.taskdefs;
+
+import org.apache.tools.ant.BuildException;
+
+import com.nokia.helium.blocks.BlocksException;
+import com.nokia.helium.blocks.ant.AbstractBlocksTask;
+
+/**
+ * Updating a workspace content.
+ *
+ * This call will update the workspace "1":
+ *
+ * <hlm:blocksUpdate wsid="1" />
+ *
+ *
+ * @ant.task name="blocksUpdate" category="Blocks"
+ */
+public class UpdateTask extends AbstractBlocksTask {
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute() {
+ try {
+ log("Updating workspace " + getWsid() + ".");
+ getBlocks().update(getWsid());
+ log("Workspace " + getWsid() + " updated successfully.");
+ } catch (BlocksException exc) {
+ throw new BuildException(exc);
+ }
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/types/RepositorySet.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/src/com/nokia/helium/blocks/ant/types/RepositorySet.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.ant.types;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.ProjectComponent;
+import org.apache.tools.ant.types.DataType;
+
+/**
+ * Ant type holding a set of repository definitions.
+ *
+ * Example of use:
+ *
+ * <hlm:blocksRepositorySet id="my.repo.list.ref.id" >
+ * <repository name="repo1" url="file:e:/repo1"/>
+ * <repository name="repo2" url="file:e:/repo2"/>
+ * </hlm:blocksRepositorySet>
+ *
+ *
+ * @ant.type name="blocksRepositorySet" category="Blocks"
+ */
+public class RepositorySet extends DataType {
+
+ private List repositories = new ArrayList();
+
+ /**
+ * Element representing a repository definition.
+ *
+ */
+ public class Repository extends ProjectComponent {
+ private String name;
+ private String url;
+
+ /**
+ * The name of the repository.
+ * @param name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * The location of the repository.
+ * @param name
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+ }
+
+ /**
+ * Create a nested repository element.
+ * @return
+ */
+ public Repository createRepository() {
+ Repository repo = new Repository();
+ repositories.add(repo);
+ return repo;
+ }
+
+ /**
+ * Get the list of repository definitions.
+ * @return
+ */
+ public List getRepositories() {
+ if (this.isReference()) {
+ if (this.getRefid().getReferencedObject() instanceof RepositorySet) {
+ return ((RepositorySet)this.getRefid().getReferencedObject()).getRepositories();
+ } else {
+ throw new BuildException("The type referenced by " +
+ this.getRefid().getRefId() + " is not of RepositorySet type.");
+ }
+ } else {
+ return this.repositories;
+ }
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/antunits/test_blocks.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/antunits/test_blocks.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,122 @@
+
+
+
+ Helium Antlib blocks unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ execute.test: ${execute.test}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/antunits/test_blocks_bundles.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/antunits/test_blocks_bundles.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,172 @@
+
+
+
+ Helium Antlib blocks unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ execute.test: ${execute.test}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/antunits/test_blocks_repo.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/antunits/test_blocks_repo.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,212 @@
+
+
+
+ Helium blocks repository unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ execute.test: ${execute.test}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/antunits/test_bundle.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/antunits/test_bundle.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,88 @@
+
+
+
+ Helium Antlib bundle unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ execute.test: ${execute.test}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/bld.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/bld.sh Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+if [ -f ~/.bashrc ] ; then
+ . ~/.bashrc
+fi
+
+ant $*
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/build.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/build.bat Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,33 @@
+@echo off
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+setlocal
+if not defined JAVA_6_HOME (
+set TESTED_JAVA=C:\Apps\j2sdk_1.6.0_02
+) ELSE set TESTED_JAVA=%JAVA_6_HOME%
+if exist %TESTED_JAVA% (set JAVA_HOME=%TESTED_JAVA%)
+set OLDANT_ARGS=-lib %CD%\..\lib -lib %ANT_LIB_HOME%\lib -lib %ANT_LIB_HOME%\bin\helium-core.jar -lib %CD%\..\..\bin\helium-blocks.jar -lib %ANT_LIB_HOME%\antlibs
+call ant %*
+if "%ERRORLEVEL%" neq "0" (goto error)
+endlocal
+goto :eof
+
+:error
+endlocal
+if "%OS%"=="Windows_NT" color 00
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,29 @@
+
+
+
+ Helium Antlib blocks tests.
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/data/demo.src_1.0-1.deb
Binary file buildframework/helium/sf/java/blocks/tests/data/demo.src_1.0-1.deb has changed
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/data/invalid1.deb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/data/invalid1.deb Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/data/invalid2.deb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/data/invalid2.deb Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/hlm_debug.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/hlm_debug.log Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,3569 @@
+11:02:26,198 DEBUG - Execution of blocks returned: 0
+11:02:26,229 DEBUG - Execution of subst returned: 0
+11:02:26,244 DEBUG - Execution of subst returned: 0
+11:02:26,666 DEBUG - Execution of blocks returned: 0
+11:02:27,119 DEBUG - Execution of blocks returned: 0
+11:02:27,932 DEBUG - Execution of blocks returned: 0
+11:02:28,744 DEBUG - Execution of blocks returned: 0
+11:02:29,151 DEBUG - Execution of blocks returned: 0
+11:02:29,166 DEBUG - Execution of subst returned: 0
+11:02:29,197 DEBUG - Execution of subst returned: 0
+11:02:29,213 DEBUG - Execution of subst returned: 0
+11:02:29,244 DEBUG - Execution of subst returned: 0
+11:02:29,260 DEBUG - Execution of subst returned: 0
+11:02:29,291 DEBUG - Execution of subst returned: 0
+11:02:29,307 DEBUG - Execution of subst returned: 0
+11:02:29,338 DEBUG - Execution of subst returned: 0
+11:02:29,354 DEBUG - Execution of subst returned: 0
+11:02:29,385 DEBUG - Execution of subst returned: 0
+11:02:29,807 DEBUG - Execution of blocks returned: 0
+11:02:30,619 DEBUG - Execution of blocks returned: 0
+11:02:30,635 DEBUG - Execution of subst returned: 0
+11:02:30,666 DEBUG - Execution of subst returned: 0
+11:02:30,682 DEBUG - Execution of subst returned: 0
+11:02:30,713 DEBUG - Execution of subst returned: 0
+11:02:30,729 DEBUG - Execution of subst returned: 0
+11:02:30,760 DEBUG - Execution of subst returned: 0
+11:02:30,776 DEBUG - Execution of subst returned: 0
+11:02:30,807 DEBUG - Execution of subst returned: 0
+11:02:31,619 DEBUG - Execution of blocks returned: 0
+11:02:32,041 DEBUG - Execution of blocks returned: 0
+11:02:33,275 DEBUG - Execution of blocks returned: 0
+11:02:33,682 DEBUG - Execution of blocks returned: 0
+11:02:34,104 DEBUG - Execution of blocks returned: 0
+11:02:34,916 DEBUG - Execution of blocks returned: 0
+11:02:35,322 DEBUG - Execution of blocks returned: 0
+11:02:35,744 DEBUG - Execution of blocks returned: 0
+11:02:37,057 DEBUG - Execution of blocks returned: 0
+11:02:40,275 DEBUG - Execution of bundle returned: 0
+11:02:41,681 DEBUG - Execution of blocks returned: 0
+11:02:42,103 DEBUG - Execution of blocks returned: 0
+11:02:42,931 DEBUG - Execution of blocks returned: 0
+11:02:45,322 DEBUG - Execution of bundle returned: 0
+11:02:46,353 DEBUG - Execution of blocks returned: 0
+11:02:47,416 DEBUG - Execution of blocks returned: 0
+11:02:50,369 DEBUG - Execution of blocks returned: 0
+11:02:52,931 DEBUG - Execution of blocks returned: 0
+11:02:53,353 DEBUG - Execution of blocks returned: 0
+11:02:54,181 DEBUG - Execution of blocks returned: 0
+11:02:56,556 DEBUG - Execution of bundle returned: 0
+11:02:57,587 DEBUG - Execution of blocks returned: 0
+11:02:58,368 DEBUG - External process error: apt-get failed with error code 100
+11:02:58,493 DEBUG - Execution of blocks returned: 1
+11:02:58,915 DEBUG - Execution of blocks returned: 0
+11:02:59,728 DEBUG - Execution of blocks returned: 0
+11:03:02,118 DEBUG - Execution of bundle returned: 0
+11:03:03,149 DEBUG - Execution of blocks returned: 0
+11:03:05,774 DEBUG - Execution of blocks returned: 0
+11:03:06,696 DEBUG - Execution of blocks returned: 0
+11:03:07,118 DEBUG - Execution of blocks returned: 0
+11:03:07,946 DEBUG - Execution of blocks returned: 0
+11:03:10,383 DEBUG - Execution of bundle returned: 0
+11:03:11,415 DEBUG - Execution of blocks returned: 0
+11:03:11,836 DEBUG - Execution of blocks returned: 0
+11:03:12,665 DEBUG - Execution of blocks returned: 0
+11:03:15,055 DEBUG - Execution of bundle returned: 0
+11:03:16,086 DEBUG - Execution of blocks returned: 0
+11:03:16,977 DEBUG - Execution of blocks returned: 0
+11:03:19,586 DEBUG - Execution of blocks returned: 0
+11:03:20,008 DEBUG - Execution of blocks returned: 0
+11:03:20,852 DEBUG - Execution of blocks returned: 0
+11:03:23,242 DEBUG - Execution of bundle returned: 0
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:24,148 DEBUG - self.doRollover()
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:24,148 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:24,148 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:24,148 DEBUG - if self.shouldRollover(record):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:24,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Error in atexit._run_exitfuncs:
+11:03:24,148 DEBUG - Traceback (most recent call last):
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:24,148 DEBUG - func(*targs, **kargs)
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:24,148 DEBUG - h.flush()
+11:03:24,148 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:24,148 DEBUG - self.stream.flush()
+11:03:24,148 DEBUG - ValueError: I/O operation on closed file
+11:03:24,148 DEBUG - Error in sys.exitfunc:
+11:03:24,164 DEBUG - Traceback (most recent call last):
+11:03:24,164 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:24,164 DEBUG - func(*targs, **kargs)
+11:03:24,164 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:24,164 DEBUG - h.flush()
+11:03:24,164 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:24,164 DEBUG - self.stream.flush()
+11:03:24,164 DEBUG - ValueError: I/O operation on closed file
+11:03:24,273 DEBUG - Execution of blocks returned: 0
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:25,039 DEBUG - self.doRollover()
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:25,039 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:25,039 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:25,039 DEBUG - if self.shouldRollover(record):
+11:03:25,039 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:25,039 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:25,039 DEBUG - ValueError: I/O operation on closed file
+11:03:25,039 DEBUG - Error in atexit._run_exitfuncs:
+11:03:25,039 DEBUG - Traceback (most recent call last):
+11:03:25,070 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:25,070 DEBUG - func(*targs, **kargs)
+11:03:25,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:25,070 DEBUG - h.flush()
+11:03:25,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:25,070 DEBUG - self.stream.flush()
+11:03:25,070 DEBUG - ValueError: I/O operation on closed file
+11:03:25,070 DEBUG - Error in sys.exitfunc:
+11:03:25,070 DEBUG - Traceback (most recent call last):
+11:03:25,070 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:25,070 DEBUG - func(*targs, **kargs)
+11:03:25,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:25,070 DEBUG - h.flush()
+11:03:25,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:25,070 DEBUG - self.stream.flush()
+11:03:25,070 DEBUG - ValueError: I/O operation on closed file
+11:03:25,180 DEBUG - Execution of blocks returned: 0
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:27,617 DEBUG - self.doRollover()
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:27,617 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:27,617 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,617 DEBUG - if self.shouldRollover(record):
+11:03:27,617 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,617 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,617 DEBUG - ValueError: I/O operation on closed file
+11:03:27,617 DEBUG - Traceback (most recent call last):
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,648 DEBUG - if self.shouldRollover(record):
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,648 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,648 DEBUG - ValueError: I/O operation on closed file
+11:03:27,648 DEBUG - Traceback (most recent call last):
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:27,648 DEBUG - if self.shouldRollover(record):
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:27,648 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:27,648 DEBUG - ValueError: I/O operation on closed file
+11:03:27,648 DEBUG - Error in atexit._run_exitfuncs:
+11:03:27,648 DEBUG - Traceback (most recent call last):
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:27,648 DEBUG - func(*targs, **kargs)
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:27,648 DEBUG - h.flush()
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:27,648 DEBUG - self.stream.flush()
+11:03:27,648 DEBUG - ValueError: I/O operation on closed file
+11:03:27,648 DEBUG - Error in sys.exitfunc:
+11:03:27,648 DEBUG - Traceback (most recent call last):
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:27,648 DEBUG - func(*targs, **kargs)
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:27,648 DEBUG - h.flush()
+11:03:27,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:27,648 DEBUG - self.stream.flush()
+11:03:27,648 DEBUG - ValueError: I/O operation on closed file
+11:03:27,758 DEBUG - Execution of blocks returned: 0
+11:03:28,070 DEBUG - Traceback (most recent call last):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:28,070 DEBUG - self.doRollover()
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:28,070 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:28,070 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:28,070 DEBUG - Traceback (most recent call last):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:28,070 DEBUG - if self.shouldRollover(record):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:28,070 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:28,070 DEBUG - ValueError: I/O operation on closed file
+11:03:28,070 DEBUG - Traceback (most recent call last):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:28,070 DEBUG - if self.shouldRollover(record):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:28,070 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:28,070 DEBUG - ValueError: I/O operation on closed file
+11:03:28,070 DEBUG - Traceback (most recent call last):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:28,070 DEBUG - if self.shouldRollover(record):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:28,070 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:28,070 DEBUG - ValueError: I/O operation on closed file
+11:03:28,070 DEBUG - Error in atexit._run_exitfuncs:
+11:03:28,070 DEBUG - Traceback (most recent call last):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:28,070 DEBUG - func(*targs, **kargs)
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:28,070 DEBUG - h.flush()
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:28,070 DEBUG - self.stream.flush()
+11:03:28,070 DEBUG - ValueError: I/O operation on closed file
+11:03:28,070 DEBUG - Error in sys.exitfunc:
+11:03:28,070 DEBUG - Traceback (most recent call last):
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:28,070 DEBUG - func(*targs, **kargs)
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:28,070 DEBUG - h.flush()
+11:03:28,070 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:28,070 DEBUG - self.stream.flush()
+11:03:28,070 DEBUG - ValueError: I/O operation on closed file
+11:03:28,180 DEBUG - Execution of blocks returned: 0
+11:03:28,898 DEBUG - Traceback (most recent call last):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:28,898 DEBUG - self.doRollover()
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:28,898 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:28,898 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:28,898 DEBUG - Traceback (most recent call last):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:28,898 DEBUG - if self.shouldRollover(record):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:28,898 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:28,898 DEBUG - ValueError: I/O operation on closed file
+11:03:28,898 DEBUG - Traceback (most recent call last):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:28,898 DEBUG - if self.shouldRollover(record):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:28,898 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:28,898 DEBUG - ValueError: I/O operation on closed file
+11:03:28,898 DEBUG - Traceback (most recent call last):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:28,898 DEBUG - if self.shouldRollover(record):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:28,898 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:28,898 DEBUG - ValueError: I/O operation on closed file
+11:03:28,898 DEBUG - Traceback (most recent call last):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:28,898 DEBUG - if self.shouldRollover(record):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:28,898 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:28,898 DEBUG - ValueError: I/O operation on closed file
+11:03:28,898 DEBUG - Error in atexit._run_exitfuncs:
+11:03:28,898 DEBUG - Traceback (most recent call last):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:28,898 DEBUG - func(*targs, **kargs)
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:28,898 DEBUG - h.flush()
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:28,898 DEBUG - self.stream.flush()
+11:03:28,898 DEBUG - ValueError: I/O operation on closed file
+11:03:28,898 DEBUG - Error in sys.exitfunc:
+11:03:28,898 DEBUG - Traceback (most recent call last):
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:28,898 DEBUG - func(*targs, **kargs)
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:28,898 DEBUG - h.flush()
+11:03:28,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:28,898 DEBUG - self.stream.flush()
+11:03:28,898 DEBUG - ValueError: I/O operation on closed file
+11:03:29,008 DEBUG - Execution of blocks returned: 0
+11:03:31,383 DEBUG - Execution of bundle returned: 0
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:32,289 DEBUG - self.doRollover()
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:32,289 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:32,289 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:32,289 DEBUG - if self.shouldRollover(record):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:32,289 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Error in atexit._run_exitfuncs:
+11:03:32,289 DEBUG - Traceback (most recent call last):
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:32,289 DEBUG - func(*targs, **kargs)
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:32,289 DEBUG - h.flush()
+11:03:32,289 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:32,289 DEBUG - self.stream.flush()
+11:03:32,289 DEBUG - ValueError: I/O operation on closed file
+11:03:32,289 DEBUG - Error in sys.exitfunc:
+11:03:32,304 DEBUG - Traceback (most recent call last):
+11:03:32,304 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:32,304 DEBUG - func(*targs, **kargs)
+11:03:32,304 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:32,304 DEBUG - h.flush()
+11:03:32,304 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:32,304 DEBUG - self.stream.flush()
+11:03:32,304 DEBUG - ValueError: I/O operation on closed file
+11:03:32,414 DEBUG - Execution of blocks returned: 0
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:34,867 DEBUG - self.doRollover()
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:34,867 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:34,867 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,867 DEBUG - if self.shouldRollover(record):
+11:03:34,867 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,867 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,867 DEBUG - ValueError: I/O operation on closed file
+11:03:34,867 DEBUG - Traceback (most recent call last):
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,898 DEBUG - if self.shouldRollover(record):
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,898 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,898 DEBUG - ValueError: I/O operation on closed file
+11:03:34,898 DEBUG - Traceback (most recent call last):
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:34,898 DEBUG - if self.shouldRollover(record):
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:34,898 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:34,898 DEBUG - ValueError: I/O operation on closed file
+11:03:34,898 DEBUG - Error in atexit._run_exitfuncs:
+11:03:34,898 DEBUG - Traceback (most recent call last):
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:34,898 DEBUG - func(*targs, **kargs)
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:34,898 DEBUG - h.flush()
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:34,898 DEBUG - self.stream.flush()
+11:03:34,898 DEBUG - ValueError: I/O operation on closed file
+11:03:34,898 DEBUG - Error in sys.exitfunc:
+11:03:34,898 DEBUG - Traceback (most recent call last):
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:34,898 DEBUG - func(*targs, **kargs)
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:34,898 DEBUG - h.flush()
+11:03:34,898 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:34,898 DEBUG - self.stream.flush()
+11:03:34,898 DEBUG - ValueError: I/O operation on closed file
+11:03:35,007 DEBUG - Execution of blocks returned: 0
+11:03:35,320 DEBUG - Traceback (most recent call last):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:35,320 DEBUG - self.doRollover()
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:35,320 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:35,320 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:35,320 DEBUG - Traceback (most recent call last):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:35,320 DEBUG - if self.shouldRollover(record):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:35,320 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:35,320 DEBUG - ValueError: I/O operation on closed file
+11:03:35,320 DEBUG - Traceback (most recent call last):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:35,320 DEBUG - if self.shouldRollover(record):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:35,320 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:35,320 DEBUG - ValueError: I/O operation on closed file
+11:03:35,320 DEBUG - Traceback (most recent call last):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:35,320 DEBUG - if self.shouldRollover(record):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:35,320 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:35,320 DEBUG - ValueError: I/O operation on closed file
+11:03:35,320 DEBUG - Error in atexit._run_exitfuncs:
+11:03:35,320 DEBUG - Traceback (most recent call last):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:35,320 DEBUG - func(*targs, **kargs)
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:35,320 DEBUG - h.flush()
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:35,320 DEBUG - self.stream.flush()
+11:03:35,320 DEBUG - ValueError: I/O operation on closed file
+11:03:35,320 DEBUG - Error in sys.exitfunc:
+11:03:35,320 DEBUG - Traceback (most recent call last):
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:35,320 DEBUG - func(*targs, **kargs)
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:35,320 DEBUG - h.flush()
+11:03:35,320 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:35,320 DEBUG - self.stream.flush()
+11:03:35,320 DEBUG - ValueError: I/O operation on closed file
+11:03:35,429 DEBUG - Execution of blocks returned: 0
+11:03:36,148 DEBUG - Traceback (most recent call last):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:36,148 DEBUG - self.doRollover()
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:36,148 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:36,148 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:36,148 DEBUG - Traceback (most recent call last):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:36,148 DEBUG - if self.shouldRollover(record):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:36,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:36,148 DEBUG - ValueError: I/O operation on closed file
+11:03:36,148 DEBUG - Traceback (most recent call last):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:36,148 DEBUG - if self.shouldRollover(record):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:36,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:36,148 DEBUG - ValueError: I/O operation on closed file
+11:03:36,148 DEBUG - Traceback (most recent call last):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:36,148 DEBUG - if self.shouldRollover(record):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:36,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:36,148 DEBUG - ValueError: I/O operation on closed file
+11:03:36,148 DEBUG - Traceback (most recent call last):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:36,148 DEBUG - if self.shouldRollover(record):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:36,148 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:36,148 DEBUG - ValueError: I/O operation on closed file
+11:03:36,148 DEBUG - Error in atexit._run_exitfuncs:
+11:03:36,148 DEBUG - Traceback (most recent call last):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:36,148 DEBUG - func(*targs, **kargs)
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:36,148 DEBUG - h.flush()
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:36,148 DEBUG - self.stream.flush()
+11:03:36,148 DEBUG - ValueError: I/O operation on closed file
+11:03:36,148 DEBUG - Error in sys.exitfunc:
+11:03:36,148 DEBUG - Traceback (most recent call last):
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:36,148 DEBUG - func(*targs, **kargs)
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:36,148 DEBUG - h.flush()
+11:03:36,148 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:36,148 DEBUG - self.stream.flush()
+11:03:36,148 DEBUG - ValueError: I/O operation on closed file
+11:03:36,257 DEBUG - Execution of blocks returned: 0
+11:03:38,648 DEBUG - Execution of bundle returned: 0
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:39,554 DEBUG - self.doRollover()
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:39,554 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:39,554 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:39,554 DEBUG - if self.shouldRollover(record):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:39,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Error in atexit._run_exitfuncs:
+11:03:39,554 DEBUG - Traceback (most recent call last):
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:39,554 DEBUG - func(*targs, **kargs)
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:39,554 DEBUG - h.flush()
+11:03:39,554 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:39,554 DEBUG - self.stream.flush()
+11:03:39,554 DEBUG - ValueError: I/O operation on closed file
+11:03:39,554 DEBUG - Error in sys.exitfunc:
+11:03:39,570 DEBUG - Traceback (most recent call last):
+11:03:39,570 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:39,570 DEBUG - func(*targs, **kargs)
+11:03:39,570 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:39,570 DEBUG - h.flush()
+11:03:39,570 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:39,570 DEBUG - self.stream.flush()
+11:03:39,570 DEBUG - ValueError: I/O operation on closed file
+11:03:39,679 DEBUG - Execution of blocks returned: 0
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:40,445 DEBUG - self.doRollover()
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:40,445 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:40,445 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:40,445 DEBUG - if self.shouldRollover(record):
+11:03:40,445 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:40,445 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:40,445 DEBUG - ValueError: I/O operation on closed file
+11:03:40,445 DEBUG - Traceback (most recent call last):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,210 DEBUG - if self.shouldRollover(record):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,210 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,210 DEBUG - ValueError: I/O operation on closed file
+11:03:42,210 DEBUG - Traceback (most recent call last):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,210 DEBUG - if self.shouldRollover(record):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,210 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,210 DEBUG - ValueError: I/O operation on closed file
+11:03:42,210 DEBUG - Traceback (most recent call last):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,210 DEBUG - if self.shouldRollover(record):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,210 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,210 DEBUG - ValueError: I/O operation on closed file
+11:03:42,210 DEBUG - Traceback (most recent call last):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,210 DEBUG - if self.shouldRollover(record):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,210 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,210 DEBUG - ValueError: I/O operation on closed file
+11:03:42,210 DEBUG - Traceback (most recent call last):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,210 DEBUG - if self.shouldRollover(record):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,210 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,210 DEBUG - ValueError: I/O operation on closed file
+11:03:42,210 DEBUG - Error in atexit._run_exitfuncs:
+11:03:42,210 DEBUG - Traceback (most recent call last):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:42,210 DEBUG - func(*targs, **kargs)
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:42,210 DEBUG - h.flush()
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:42,210 DEBUG - self.stream.flush()
+11:03:42,210 DEBUG - ValueError: I/O operation on closed file
+11:03:42,210 DEBUG - Error in sys.exitfunc:
+11:03:42,210 DEBUG - Traceback (most recent call last):
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:42,210 DEBUG - func(*targs, **kargs)
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:42,210 DEBUG - h.flush()
+11:03:42,210 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:42,210 DEBUG - self.stream.flush()
+11:03:42,210 DEBUG - ValueError: I/O operation on closed file
+11:03:42,320 DEBUG - Execution of blocks returned: 0
+11:03:42,648 DEBUG - Traceback (most recent call last):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:42,648 DEBUG - self.doRollover()
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:42,648 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:42,648 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:42,648 DEBUG - Traceback (most recent call last):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,648 DEBUG - if self.shouldRollover(record):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,648 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,648 DEBUG - ValueError: I/O operation on closed file
+11:03:42,648 DEBUG - Traceback (most recent call last):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,648 DEBUG - if self.shouldRollover(record):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,648 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,648 DEBUG - ValueError: I/O operation on closed file
+11:03:42,648 DEBUG - Traceback (most recent call last):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:42,648 DEBUG - if self.shouldRollover(record):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:42,648 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:42,648 DEBUG - ValueError: I/O operation on closed file
+11:03:42,648 DEBUG - Error in atexit._run_exitfuncs:
+11:03:42,648 DEBUG - Traceback (most recent call last):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:42,648 DEBUG - func(*targs, **kargs)
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:42,648 DEBUG - h.flush()
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:42,648 DEBUG - self.stream.flush()
+11:03:42,648 DEBUG - ValueError: I/O operation on closed file
+11:03:42,648 DEBUG - Error in sys.exitfunc:
+11:03:42,648 DEBUG - Traceback (most recent call last):
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:42,648 DEBUG - func(*targs, **kargs)
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:42,648 DEBUG - h.flush()
+11:03:42,648 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:42,648 DEBUG - self.stream.flush()
+11:03:42,648 DEBUG - ValueError: I/O operation on closed file
+11:03:42,757 DEBUG - Execution of blocks returned: 0
+11:03:43,476 DEBUG - Traceback (most recent call last):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:43,476 DEBUG - self.doRollover()
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:43,476 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:43,476 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:43,476 DEBUG - Traceback (most recent call last):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:43,476 DEBUG - if self.shouldRollover(record):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:43,476 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:43,476 DEBUG - ValueError: I/O operation on closed file
+11:03:43,476 DEBUG - Traceback (most recent call last):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:43,476 DEBUG - if self.shouldRollover(record):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:43,476 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:43,476 DEBUG - ValueError: I/O operation on closed file
+11:03:43,476 DEBUG - Traceback (most recent call last):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:43,476 DEBUG - if self.shouldRollover(record):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:43,476 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:43,476 DEBUG - ValueError: I/O operation on closed file
+11:03:43,476 DEBUG - Traceback (most recent call last):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:43,476 DEBUG - if self.shouldRollover(record):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:43,476 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:43,476 DEBUG - ValueError: I/O operation on closed file
+11:03:43,476 DEBUG - Error in atexit._run_exitfuncs:
+11:03:43,476 DEBUG - Traceback (most recent call last):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:43,476 DEBUG - func(*targs, **kargs)
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:43,476 DEBUG - h.flush()
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:43,476 DEBUG - self.stream.flush()
+11:03:43,476 DEBUG - ValueError: I/O operation on closed file
+11:03:43,476 DEBUG - Error in sys.exitfunc:
+11:03:43,476 DEBUG - Traceback (most recent call last):
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:43,476 DEBUG - func(*targs, **kargs)
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:43,476 DEBUG - h.flush()
+11:03:43,476 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:43,476 DEBUG - self.stream.flush()
+11:03:43,476 DEBUG - ValueError: I/O operation on closed file
+11:03:43,585 DEBUG - Execution of blocks returned: 0
+11:03:45,960 DEBUG - Execution of bundle returned: 0
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:46,866 DEBUG - self.doRollover()
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:46,866 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:46,866 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:46,866 DEBUG - if self.shouldRollover(record):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:46,866 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Error in atexit._run_exitfuncs:
+11:03:46,866 DEBUG - Traceback (most recent call last):
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:46,866 DEBUG - func(*targs, **kargs)
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:46,866 DEBUG - h.flush()
+11:03:46,866 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:46,866 DEBUG - self.stream.flush()
+11:03:46,866 DEBUG - ValueError: I/O operation on closed file
+11:03:46,866 DEBUG - Error in sys.exitfunc:
+11:03:46,882 DEBUG - Traceback (most recent call last):
+11:03:46,882 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:46,882 DEBUG - func(*targs, **kargs)
+11:03:46,882 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:46,882 DEBUG - h.flush()
+11:03:46,882 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:46,882 DEBUG - self.stream.flush()
+11:03:46,882 DEBUG - ValueError: I/O operation on closed file
+11:03:46,991 DEBUG - Execution of blocks returned: 0
+11:03:47,319 DEBUG - Traceback (most recent call last):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:47,319 DEBUG - self.doRollover()
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:47,319 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:47,319 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:47,319 DEBUG - Traceback (most recent call last):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:47,319 DEBUG - if self.shouldRollover(record):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:47,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:47,319 DEBUG - ValueError: I/O operation on closed file
+11:03:47,319 DEBUG - Traceback (most recent call last):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:47,319 DEBUG - if self.shouldRollover(record):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:47,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:47,319 DEBUG - ValueError: I/O operation on closed file
+11:03:47,319 DEBUG - Traceback (most recent call last):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:47,319 DEBUG - if self.shouldRollover(record):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:47,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:47,319 DEBUG - ValueError: I/O operation on closed file
+11:03:47,319 DEBUG - Error in atexit._run_exitfuncs:
+11:03:47,319 DEBUG - Traceback (most recent call last):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:47,319 DEBUG - func(*targs, **kargs)
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:47,319 DEBUG - h.flush()
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:47,319 DEBUG - self.stream.flush()
+11:03:47,319 DEBUG - ValueError: I/O operation on closed file
+11:03:47,319 DEBUG - Error in sys.exitfunc:
+11:03:47,319 DEBUG - Traceback (most recent call last):
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:47,319 DEBUG - func(*targs, **kargs)
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:47,319 DEBUG - h.flush()
+11:03:47,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:47,319 DEBUG - self.stream.flush()
+11:03:47,319 DEBUG - ValueError: I/O operation on closed file
+11:03:47,429 DEBUG - Execution of blocks returned: 0
+11:03:48,319 DEBUG - Traceback (most recent call last):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:48,319 DEBUG - self.doRollover()
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:48,319 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:48,319 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:48,319 DEBUG - Traceback (most recent call last):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:48,319 DEBUG - if self.shouldRollover(record):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:48,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:48,319 DEBUG - ValueError: I/O operation on closed file
+11:03:48,319 DEBUG - Traceback (most recent call last):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:48,319 DEBUG - if self.shouldRollover(record):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:48,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:48,319 DEBUG - ValueError: I/O operation on closed file
+11:03:48,319 DEBUG - Traceback (most recent call last):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:48,319 DEBUG - if self.shouldRollover(record):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:48,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:48,319 DEBUG - ValueError: I/O operation on closed file
+11:03:48,319 DEBUG - Traceback (most recent call last):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:48,319 DEBUG - if self.shouldRollover(record):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:48,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:48,319 DEBUG - ValueError: I/O operation on closed file
+11:03:48,319 DEBUG - Error in atexit._run_exitfuncs:
+11:03:48,319 DEBUG - Traceback (most recent call last):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:48,319 DEBUG - func(*targs, **kargs)
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:48,319 DEBUG - h.flush()
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:48,319 DEBUG - self.stream.flush()
+11:03:48,319 DEBUG - ValueError: I/O operation on closed file
+11:03:48,319 DEBUG - Error in sys.exitfunc:
+11:03:48,319 DEBUG - Traceback (most recent call last):
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:48,319 DEBUG - func(*targs, **kargs)
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:48,319 DEBUG - h.flush()
+11:03:48,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:48,319 DEBUG - self.stream.flush()
+11:03:48,319 DEBUG - ValueError: I/O operation on closed file
+11:03:48,429 DEBUG - Execution of blocks returned: 0
+11:03:50,819 DEBUG - Execution of bundle returned: 0
+11:03:51,116 DEBUG - Traceback (most recent call last):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:51,116 DEBUG - self.doRollover()
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:51,116 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:51,116 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:51,116 DEBUG - Traceback (most recent call last):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:51,116 DEBUG - if self.shouldRollover(record):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:51,116 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:51,116 DEBUG - ValueError: I/O operation on closed file
+11:03:51,116 DEBUG - Traceback (most recent call last):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:51,116 DEBUG - if self.shouldRollover(record):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:51,116 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:51,116 DEBUG - ValueError: I/O operation on closed file
+11:03:51,116 DEBUG - Traceback (most recent call last):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:51,116 DEBUG - if self.shouldRollover(record):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:51,116 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:51,116 DEBUG - ValueError: I/O operation on closed file
+11:03:51,116 DEBUG - Traceback (most recent call last):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:51,116 DEBUG - if self.shouldRollover(record):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:51,116 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:51,116 DEBUG - ValueError: I/O operation on closed file
+11:03:51,116 DEBUG - Error in atexit._run_exitfuncs:
+11:03:51,116 DEBUG - Traceback (most recent call last):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:51,116 DEBUG - func(*targs, **kargs)
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:51,116 DEBUG - h.flush()
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:51,116 DEBUG - self.stream.flush()
+11:03:51,116 DEBUG - ValueError: I/O operation on closed file
+11:03:51,116 DEBUG - Error in sys.exitfunc:
+11:03:51,116 DEBUG - Traceback (most recent call last):
+11:03:51,116 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:51,132 DEBUG - func(*targs, **kargs)
+11:03:51,132 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:51,132 DEBUG - h.flush()
+11:03:51,132 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:51,132 DEBUG - self.stream.flush()
+11:03:51,132 DEBUG - ValueError: I/O operation on closed file
+11:03:51,226 DEBUG - Execution of blocks returned: 0
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:52,132 DEBUG - self.doRollover()
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:52,132 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:52,132 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,132 DEBUG - if self.shouldRollover(record):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,132 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Error in atexit._run_exitfuncs:
+11:03:52,132 DEBUG - Traceback (most recent call last):
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:52,132 DEBUG - func(*targs, **kargs)
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:52,132 DEBUG - h.flush()
+11:03:52,132 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:52,132 DEBUG - self.stream.flush()
+11:03:52,132 DEBUG - ValueError: I/O operation on closed file
+11:03:52,132 DEBUG - Error in sys.exitfunc:
+11:03:52,147 DEBUG - Traceback (most recent call last):
+11:03:52,147 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:52,147 DEBUG - func(*targs, **kargs)
+11:03:52,147 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:52,147 DEBUG - h.flush()
+11:03:52,147 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:52,147 DEBUG - self.stream.flush()
+11:03:52,147 DEBUG - ValueError: I/O operation on closed file
+11:03:52,257 DEBUG - Execution of blocks returned: 0
+11:03:52,554 DEBUG - Traceback (most recent call last):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:52,554 DEBUG - self.doRollover()
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:52,554 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:52,554 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:52,554 DEBUG - Traceback (most recent call last):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,554 DEBUG - if self.shouldRollover(record):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,554 DEBUG - ValueError: I/O operation on closed file
+11:03:52,554 DEBUG - Traceback (most recent call last):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,554 DEBUG - if self.shouldRollover(record):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,554 DEBUG - ValueError: I/O operation on closed file
+11:03:52,554 DEBUG - Traceback (most recent call last):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,554 DEBUG - if self.shouldRollover(record):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,554 DEBUG - ValueError: I/O operation on closed file
+11:03:52,554 DEBUG - Traceback (most recent call last):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,554 DEBUG - if self.shouldRollover(record):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,554 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,554 DEBUG - ValueError: I/O operation on closed file
+11:03:52,554 DEBUG - Error in atexit._run_exitfuncs:
+11:03:52,554 DEBUG - Traceback (most recent call last):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:52,554 DEBUG - func(*targs, **kargs)
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:52,554 DEBUG - h.flush()
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:52,554 DEBUG - self.stream.flush()
+11:03:52,554 DEBUG - ValueError: I/O operation on closed file
+11:03:52,554 DEBUG - Error in sys.exitfunc:
+11:03:52,554 DEBUG - Traceback (most recent call last):
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:52,554 DEBUG - func(*targs, **kargs)
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:52,554 DEBUG - h.flush()
+11:03:52,554 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:52,554 DEBUG - self.stream.flush()
+11:03:52,554 DEBUG - ValueError: I/O operation on closed file
+11:03:52,663 DEBUG - Execution of blocks returned: 0
+11:03:52,975 DEBUG - Traceback (most recent call last):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:52,975 DEBUG - self.doRollover()
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:52,975 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:52,975 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:52,975 DEBUG - Traceback (most recent call last):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,975 DEBUG - if self.shouldRollover(record):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,975 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,975 DEBUG - ValueError: I/O operation on closed file
+11:03:52,975 DEBUG - Traceback (most recent call last):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,975 DEBUG - if self.shouldRollover(record):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,975 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,975 DEBUG - ValueError: I/O operation on closed file
+11:03:52,975 DEBUG - Traceback (most recent call last):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:52,975 DEBUG - if self.shouldRollover(record):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:52,975 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:52,975 DEBUG - ValueError: I/O operation on closed file
+11:03:52,975 DEBUG - Error in atexit._run_exitfuncs:
+11:03:52,975 DEBUG - Traceback (most recent call last):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:52,975 DEBUG - func(*targs, **kargs)
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:52,975 DEBUG - h.flush()
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:52,975 DEBUG - self.stream.flush()
+11:03:52,975 DEBUG - ValueError: I/O operation on closed file
+11:03:52,975 DEBUG - Error in sys.exitfunc:
+11:03:52,975 DEBUG - Traceback (most recent call last):
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:52,975 DEBUG - func(*targs, **kargs)
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:52,975 DEBUG - h.flush()
+11:03:52,975 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:52,975 DEBUG - self.stream.flush()
+11:03:52,975 DEBUG - ValueError: I/O operation on closed file
+11:03:53,085 DEBUG - Execution of blocks returned: 0
+11:03:53,819 DEBUG - Traceback (most recent call last):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:53,819 DEBUG - self.doRollover()
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:53,819 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:53,819 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:53,819 DEBUG - Traceback (most recent call last):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:53,819 DEBUG - if self.shouldRollover(record):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:53,819 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:53,819 DEBUG - ValueError: I/O operation on closed file
+11:03:53,819 DEBUG - Traceback (most recent call last):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:53,819 DEBUG - if self.shouldRollover(record):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:53,819 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:53,819 DEBUG - ValueError: I/O operation on closed file
+11:03:53,819 DEBUG - Traceback (most recent call last):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:53,819 DEBUG - if self.shouldRollover(record):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:53,819 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:53,819 DEBUG - ValueError: I/O operation on closed file
+11:03:53,819 DEBUG - Traceback (most recent call last):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:53,819 DEBUG - if self.shouldRollover(record):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:53,819 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:53,819 DEBUG - ValueError: I/O operation on closed file
+11:03:53,819 DEBUG - Error in atexit._run_exitfuncs:
+11:03:53,819 DEBUG - Traceback (most recent call last):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:53,819 DEBUG - func(*targs, **kargs)
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:53,819 DEBUG - h.flush()
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:53,819 DEBUG - self.stream.flush()
+11:03:53,819 DEBUG - ValueError: I/O operation on closed file
+11:03:53,819 DEBUG - Error in sys.exitfunc:
+11:03:53,819 DEBUG - Traceback (most recent call last):
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:53,819 DEBUG - func(*targs, **kargs)
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:53,819 DEBUG - h.flush()
+11:03:53,819 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:53,819 DEBUG - self.stream.flush()
+11:03:53,819 DEBUG - ValueError: I/O operation on closed file
+11:03:53,929 DEBUG - Execution of blocks returned: 0
+11:03:56,303 DEBUG - Execution of bundle returned: 0
+11:03:56,600 DEBUG - Traceback (most recent call last):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:56,600 DEBUG - self.doRollover()
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:56,600 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:56,600 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:56,600 DEBUG - Traceback (most recent call last):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:56,600 DEBUG - if self.shouldRollover(record):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:56,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:56,600 DEBUG - ValueError: I/O operation on closed file
+11:03:56,600 DEBUG - Traceback (most recent call last):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:56,600 DEBUG - if self.shouldRollover(record):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:56,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:56,600 DEBUG - ValueError: I/O operation on closed file
+11:03:56,600 DEBUG - Traceback (most recent call last):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:56,600 DEBUG - if self.shouldRollover(record):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:56,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:56,600 DEBUG - ValueError: I/O operation on closed file
+11:03:56,600 DEBUG - Traceback (most recent call last):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:56,600 DEBUG - if self.shouldRollover(record):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:56,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:56,600 DEBUG - ValueError: I/O operation on closed file
+11:03:56,600 DEBUG - Error in atexit._run_exitfuncs:
+11:03:56,600 DEBUG - Traceback (most recent call last):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:56,600 DEBUG - func(*targs, **kargs)
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:56,600 DEBUG - h.flush()
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:56,600 DEBUG - self.stream.flush()
+11:03:56,600 DEBUG - ValueError: I/O operation on closed file
+11:03:56,600 DEBUG - Error in sys.exitfunc:
+11:03:56,600 DEBUG - Traceback (most recent call last):
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:56,600 DEBUG - func(*targs, **kargs)
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:56,600 DEBUG - h.flush()
+11:03:56,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:56,600 DEBUG - self.stream.flush()
+11:03:56,600 DEBUG - ValueError: I/O operation on closed file
+11:03:56,710 DEBUG - Execution of blocks returned: 0
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:57,616 DEBUG - self.doRollover()
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:57,616 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:57,616 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:57,616 DEBUG - if self.shouldRollover(record):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:57,616 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Error in atexit._run_exitfuncs:
+11:03:57,616 DEBUG - Traceback (most recent call last):
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:57,616 DEBUG - func(*targs, **kargs)
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:57,616 DEBUG - h.flush()
+11:03:57,616 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:57,616 DEBUG - self.stream.flush()
+11:03:57,616 DEBUG - ValueError: I/O operation on closed file
+11:03:57,616 DEBUG - Error in sys.exitfunc:
+11:03:57,632 DEBUG - Traceback (most recent call last):
+11:03:57,632 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:57,632 DEBUG - func(*targs, **kargs)
+11:03:57,632 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:57,632 DEBUG - h.flush()
+11:03:57,632 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:57,632 DEBUG - self.stream.flush()
+11:03:57,632 DEBUG - ValueError: I/O operation on closed file
+11:03:57,741 DEBUG - Execution of blocks returned: 0
+11:03:58,038 DEBUG - Traceback (most recent call last):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:58,038 DEBUG - self.doRollover()
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:58,038 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:58,038 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:58,038 DEBUG - Traceback (most recent call last):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,038 DEBUG - if self.shouldRollover(record):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,038 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,038 DEBUG - ValueError: I/O operation on closed file
+11:03:58,038 DEBUG - Traceback (most recent call last):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,038 DEBUG - if self.shouldRollover(record):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,038 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,038 DEBUG - ValueError: I/O operation on closed file
+11:03:58,038 DEBUG - Traceback (most recent call last):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,038 DEBUG - if self.shouldRollover(record):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,038 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,038 DEBUG - ValueError: I/O operation on closed file
+11:03:58,038 DEBUG - Traceback (most recent call last):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,038 DEBUG - if self.shouldRollover(record):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,038 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,038 DEBUG - ValueError: I/O operation on closed file
+11:03:58,038 DEBUG - Error in atexit._run_exitfuncs:
+11:03:58,038 DEBUG - Traceback (most recent call last):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:58,038 DEBUG - func(*targs, **kargs)
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:58,038 DEBUG - h.flush()
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:58,038 DEBUG - self.stream.flush()
+11:03:58,038 DEBUG - ValueError: I/O operation on closed file
+11:03:58,038 DEBUG - Error in sys.exitfunc:
+11:03:58,038 DEBUG - Traceback (most recent call last):
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:58,038 DEBUG - func(*targs, **kargs)
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:58,038 DEBUG - h.flush()
+11:03:58,038 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:58,038 DEBUG - self.stream.flush()
+11:03:58,038 DEBUG - ValueError: I/O operation on closed file
+11:03:58,147 DEBUG - Execution of blocks returned: 0
+11:03:58,444 DEBUG - Traceback (most recent call last):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:58,444 DEBUG - self.doRollover()
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:58,444 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:58,444 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:58,444 DEBUG - Traceback (most recent call last):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,444 DEBUG - if self.shouldRollover(record):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,444 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,444 DEBUG - ValueError: I/O operation on closed file
+11:03:58,444 DEBUG - Traceback (most recent call last):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,444 DEBUG - if self.shouldRollover(record):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,444 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,444 DEBUG - ValueError: I/O operation on closed file
+11:03:58,444 DEBUG - Traceback (most recent call last):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,444 DEBUG - if self.shouldRollover(record):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,444 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,444 DEBUG - ValueError: I/O operation on closed file
+11:03:58,444 DEBUG - Traceback (most recent call last):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,444 DEBUG - if self.shouldRollover(record):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,444 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,444 DEBUG - ValueError: I/O operation on closed file
+11:03:58,444 DEBUG - Error in atexit._run_exitfuncs:
+11:03:58,444 DEBUG - Traceback (most recent call last):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:58,444 DEBUG - func(*targs, **kargs)
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:58,444 DEBUG - h.flush()
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:58,444 DEBUG - self.stream.flush()
+11:03:58,444 DEBUG - ValueError: I/O operation on closed file
+11:03:58,444 DEBUG - Error in sys.exitfunc:
+11:03:58,444 DEBUG - Traceback (most recent call last):
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:58,444 DEBUG - func(*targs, **kargs)
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:58,444 DEBUG - h.flush()
+11:03:58,444 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:58,444 DEBUG - self.stream.flush()
+11:03:58,444 DEBUG - ValueError: I/O operation on closed file
+11:03:58,553 DEBUG - Execution of blocks returned: 0
+11:03:58,850 DEBUG - Traceback (most recent call last):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:58,850 DEBUG - self.doRollover()
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:58,850 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:58,850 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:58,850 DEBUG - Traceback (most recent call last):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,850 DEBUG - if self.shouldRollover(record):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,850 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,850 DEBUG - ValueError: I/O operation on closed file
+11:03:58,850 DEBUG - Traceback (most recent call last):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,850 DEBUG - if self.shouldRollover(record):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,850 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,850 DEBUG - ValueError: I/O operation on closed file
+11:03:58,850 DEBUG - Traceback (most recent call last):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,850 DEBUG - if self.shouldRollover(record):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,850 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,850 DEBUG - ValueError: I/O operation on closed file
+11:03:58,850 DEBUG - Traceback (most recent call last):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:58,850 DEBUG - if self.shouldRollover(record):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:58,850 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:58,850 DEBUG - ValueError: I/O operation on closed file
+11:03:58,850 DEBUG - Error in atexit._run_exitfuncs:
+11:03:58,850 DEBUG - Traceback (most recent call last):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:58,850 DEBUG - func(*targs, **kargs)
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:58,850 DEBUG - h.flush()
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:58,850 DEBUG - self.stream.flush()
+11:03:58,850 DEBUG - ValueError: I/O operation on closed file
+11:03:58,850 DEBUG - Error in sys.exitfunc:
+11:03:58,850 DEBUG - Traceback (most recent call last):
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:58,850 DEBUG - func(*targs, **kargs)
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:58,850 DEBUG - h.flush()
+11:03:58,850 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:58,850 DEBUG - self.stream.flush()
+11:03:58,850 DEBUG - ValueError: I/O operation on closed file
+11:03:58,960 DEBUG - Execution of blocks returned: 0
+11:03:59,272 DEBUG - Traceback (most recent call last):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:03:59,272 DEBUG - self.doRollover()
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:03:59,272 DEBUG - os.rename(self.baseFilename, dfn)
+11:03:59,272 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:03:59,272 DEBUG - Traceback (most recent call last):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:59,272 DEBUG - if self.shouldRollover(record):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:59,272 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:59,272 DEBUG - ValueError: I/O operation on closed file
+11:03:59,272 DEBUG - Traceback (most recent call last):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:59,272 DEBUG - if self.shouldRollover(record):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:59,272 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:59,272 DEBUG - ValueError: I/O operation on closed file
+11:03:59,272 DEBUG - Traceback (most recent call last):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:03:59,272 DEBUG - if self.shouldRollover(record):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:03:59,272 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:03:59,272 DEBUG - ValueError: I/O operation on closed file
+11:03:59,272 DEBUG - Error in atexit._run_exitfuncs:
+11:03:59,272 DEBUG - Traceback (most recent call last):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:59,272 DEBUG - func(*targs, **kargs)
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:59,272 DEBUG - h.flush()
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:59,272 DEBUG - self.stream.flush()
+11:03:59,272 DEBUG - ValueError: I/O operation on closed file
+11:03:59,272 DEBUG - Error in sys.exitfunc:
+11:03:59,272 DEBUG - Traceback (most recent call last):
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:03:59,272 DEBUG - func(*targs, **kargs)
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:03:59,272 DEBUG - h.flush()
+11:03:59,272 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:03:59,272 DEBUG - self.stream.flush()
+11:03:59,272 DEBUG - ValueError: I/O operation on closed file
+11:03:59,381 DEBUG - Execution of blocks returned: 0
+11:04:00,100 DEBUG - Traceback (most recent call last):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:00,100 DEBUG - self.doRollover()
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:00,100 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:00,100 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:00,100 DEBUG - Traceback (most recent call last):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:00,100 DEBUG - if self.shouldRollover(record):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:00,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:00,100 DEBUG - ValueError: I/O operation on closed file
+11:04:00,100 DEBUG - Traceback (most recent call last):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:00,100 DEBUG - if self.shouldRollover(record):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:00,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:00,100 DEBUG - ValueError: I/O operation on closed file
+11:04:00,100 DEBUG - Traceback (most recent call last):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:00,100 DEBUG - if self.shouldRollover(record):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:00,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:00,100 DEBUG - ValueError: I/O operation on closed file
+11:04:00,100 DEBUG - Traceback (most recent call last):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:00,100 DEBUG - if self.shouldRollover(record):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:00,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:00,100 DEBUG - ValueError: I/O operation on closed file
+11:04:00,100 DEBUG - Error in atexit._run_exitfuncs:
+11:04:00,100 DEBUG - Traceback (most recent call last):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:00,100 DEBUG - func(*targs, **kargs)
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:00,100 DEBUG - h.flush()
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:00,100 DEBUG - self.stream.flush()
+11:04:00,100 DEBUG - ValueError: I/O operation on closed file
+11:04:00,100 DEBUG - Error in sys.exitfunc:
+11:04:00,100 DEBUG - Traceback (most recent call last):
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:00,100 DEBUG - func(*targs, **kargs)
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:00,100 DEBUG - h.flush()
+11:04:00,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:00,100 DEBUG - self.stream.flush()
+11:04:00,100 DEBUG - ValueError: I/O operation on closed file
+11:04:00,210 DEBUG - Execution of blocks returned: 0
+11:04:02,584 DEBUG - Execution of bundle returned: 0
+11:04:02,881 DEBUG - Traceback (most recent call last):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:02,881 DEBUG - self.doRollover()
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:02,881 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:02,881 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:02,881 DEBUG - Traceback (most recent call last):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:02,881 DEBUG - if self.shouldRollover(record):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:02,881 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:02,881 DEBUG - ValueError: I/O operation on closed file
+11:04:02,881 DEBUG - Traceback (most recent call last):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:02,881 DEBUG - if self.shouldRollover(record):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:02,881 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:02,881 DEBUG - ValueError: I/O operation on closed file
+11:04:02,881 DEBUG - Traceback (most recent call last):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:02,881 DEBUG - if self.shouldRollover(record):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:02,881 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:02,881 DEBUG - ValueError: I/O operation on closed file
+11:04:02,881 DEBUG - Traceback (most recent call last):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:02,881 DEBUG - if self.shouldRollover(record):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:02,881 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:02,881 DEBUG - ValueError: I/O operation on closed file
+11:04:02,881 DEBUG - Error in atexit._run_exitfuncs:
+11:04:02,881 DEBUG - Traceback (most recent call last):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:02,881 DEBUG - func(*targs, **kargs)
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:02,881 DEBUG - h.flush()
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:02,881 DEBUG - self.stream.flush()
+11:04:02,881 DEBUG - ValueError: I/O operation on closed file
+11:04:02,881 DEBUG - Error in sys.exitfunc:
+11:04:02,881 DEBUG - Traceback (most recent call last):
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:02,881 DEBUG - func(*targs, **kargs)
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:02,881 DEBUG - h.flush()
+11:04:02,881 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:02,881 DEBUG - self.stream.flush()
+11:04:02,881 DEBUG - ValueError: I/O operation on closed file
+11:04:02,991 DEBUG - Execution of blocks returned: 0
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:03,897 DEBUG - self.doRollover()
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:03,897 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:03,897 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:03,897 DEBUG - if self.shouldRollover(record):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:03,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Error in atexit._run_exitfuncs:
+11:04:03,897 DEBUG - Traceback (most recent call last):
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:03,897 DEBUG - func(*targs, **kargs)
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:03,897 DEBUG - h.flush()
+11:04:03,897 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:03,897 DEBUG - self.stream.flush()
+11:04:03,897 DEBUG - ValueError: I/O operation on closed file
+11:04:03,897 DEBUG - Error in sys.exitfunc:
+11:04:03,913 DEBUG - Traceback (most recent call last):
+11:04:03,913 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:03,913 DEBUG - func(*targs, **kargs)
+11:04:03,913 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:03,913 DEBUG - h.flush()
+11:04:03,913 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:03,913 DEBUG - self.stream.flush()
+11:04:03,913 DEBUG - ValueError: I/O operation on closed file
+11:04:04,022 DEBUG - Execution of blocks returned: 0
+11:04:04,319 DEBUG - Traceback (most recent call last):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:04,319 DEBUG - self.doRollover()
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:04,319 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:04,319 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:04,319 DEBUG - Traceback (most recent call last):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:04,319 DEBUG - if self.shouldRollover(record):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:04,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:04,319 DEBUG - ValueError: I/O operation on closed file
+11:04:04,319 DEBUG - Traceback (most recent call last):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:04,319 DEBUG - if self.shouldRollover(record):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:04,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:04,319 DEBUG - ValueError: I/O operation on closed file
+11:04:04,319 DEBUG - Traceback (most recent call last):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:04,319 DEBUG - if self.shouldRollover(record):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:04,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:04,319 DEBUG - ValueError: I/O operation on closed file
+11:04:04,319 DEBUG - Traceback (most recent call last):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:04,319 DEBUG - if self.shouldRollover(record):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:04,319 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:04,319 DEBUG - ValueError: I/O operation on closed file
+11:04:04,319 DEBUG - Error in atexit._run_exitfuncs:
+11:04:04,319 DEBUG - Traceback (most recent call last):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:04,319 DEBUG - func(*targs, **kargs)
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:04,319 DEBUG - h.flush()
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:04,319 DEBUG - self.stream.flush()
+11:04:04,319 DEBUG - ValueError: I/O operation on closed file
+11:04:04,319 DEBUG - Error in sys.exitfunc:
+11:04:04,319 DEBUG - Traceback (most recent call last):
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:04,319 DEBUG - func(*targs, **kargs)
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:04,319 DEBUG - h.flush()
+11:04:04,319 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:04,319 DEBUG - self.stream.flush()
+11:04:04,319 DEBUG - ValueError: I/O operation on closed file
+11:04:04,428 DEBUG - Execution of blocks returned: 0
+11:04:04,741 DEBUG - Traceback (most recent call last):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:04,741 DEBUG - self.doRollover()
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:04,741 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:04,741 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:04,741 DEBUG - Traceback (most recent call last):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:04,741 DEBUG - if self.shouldRollover(record):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:04,741 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:04,741 DEBUG - ValueError: I/O operation on closed file
+11:04:04,741 DEBUG - Traceback (most recent call last):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:04,741 DEBUG - if self.shouldRollover(record):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:04,741 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:04,741 DEBUG - ValueError: I/O operation on closed file
+11:04:04,741 DEBUG - Traceback (most recent call last):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:04,741 DEBUG - if self.shouldRollover(record):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:04,741 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:04,741 DEBUG - ValueError: I/O operation on closed file
+11:04:04,741 DEBUG - Error in atexit._run_exitfuncs:
+11:04:04,741 DEBUG - Traceback (most recent call last):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:04,741 DEBUG - func(*targs, **kargs)
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:04,741 DEBUG - h.flush()
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:04,741 DEBUG - self.stream.flush()
+11:04:04,741 DEBUG - ValueError: I/O operation on closed file
+11:04:04,741 DEBUG - Error in sys.exitfunc:
+11:04:04,741 DEBUG - Traceback (most recent call last):
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:04,741 DEBUG - func(*targs, **kargs)
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:04,741 DEBUG - h.flush()
+11:04:04,741 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:04,741 DEBUG - self.stream.flush()
+11:04:04,741 DEBUG - ValueError: I/O operation on closed file
+11:04:04,850 DEBUG - Execution of blocks returned: 0
+11:04:05,600 DEBUG - Traceback (most recent call last):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:05,600 DEBUG - self.doRollover()
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:05,600 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:05,600 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:05,600 DEBUG - Traceback (most recent call last):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:05,600 DEBUG - if self.shouldRollover(record):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:05,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:05,600 DEBUG - ValueError: I/O operation on closed file
+11:04:05,600 DEBUG - Traceback (most recent call last):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:05,600 DEBUG - if self.shouldRollover(record):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:05,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:05,600 DEBUG - ValueError: I/O operation on closed file
+11:04:05,600 DEBUG - Traceback (most recent call last):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:05,600 DEBUG - if self.shouldRollover(record):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:05,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:05,600 DEBUG - ValueError: I/O operation on closed file
+11:04:05,600 DEBUG - Traceback (most recent call last):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:05,600 DEBUG - if self.shouldRollover(record):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:05,600 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:05,600 DEBUG - ValueError: I/O operation on closed file
+11:04:05,600 DEBUG - Error in atexit._run_exitfuncs:
+11:04:05,600 DEBUG - Traceback (most recent call last):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:05,600 DEBUG - func(*targs, **kargs)
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:05,600 DEBUG - h.flush()
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:05,600 DEBUG - self.stream.flush()
+11:04:05,600 DEBUG - ValueError: I/O operation on closed file
+11:04:05,600 DEBUG - Error in sys.exitfunc:
+11:04:05,600 DEBUG - Traceback (most recent call last):
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:05,600 DEBUG - func(*targs, **kargs)
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:05,600 DEBUG - h.flush()
+11:04:05,600 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:05,600 DEBUG - self.stream.flush()
+11:04:05,600 DEBUG - ValueError: I/O operation on closed file
+11:04:05,709 DEBUG - Execution of blocks returned: 0
+11:04:08,084 DEBUG - Execution of bundle returned: 0
+11:04:08,397 DEBUG - Traceback (most recent call last):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:08,397 DEBUG - self.doRollover()
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:08,397 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:08,397 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:08,397 DEBUG - Traceback (most recent call last):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:08,397 DEBUG - if self.shouldRollover(record):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:08,397 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:08,397 DEBUG - ValueError: I/O operation on closed file
+11:04:08,397 DEBUG - Traceback (most recent call last):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:08,397 DEBUG - if self.shouldRollover(record):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:08,397 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:08,397 DEBUG - ValueError: I/O operation on closed file
+11:04:08,397 DEBUG - Traceback (most recent call last):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:08,397 DEBUG - if self.shouldRollover(record):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:08,397 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:08,397 DEBUG - ValueError: I/O operation on closed file
+11:04:08,397 DEBUG - Traceback (most recent call last):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:08,397 DEBUG - if self.shouldRollover(record):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:08,397 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:08,397 DEBUG - ValueError: I/O operation on closed file
+11:04:08,397 DEBUG - Error in atexit._run_exitfuncs:
+11:04:08,397 DEBUG - Traceback (most recent call last):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:08,397 DEBUG - func(*targs, **kargs)
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:08,397 DEBUG - h.flush()
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:08,397 DEBUG - self.stream.flush()
+11:04:08,397 DEBUG - ValueError: I/O operation on closed file
+11:04:08,397 DEBUG - Error in sys.exitfunc:
+11:04:08,397 DEBUG - Traceback (most recent call last):
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:08,397 DEBUG - func(*targs, **kargs)
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:08,397 DEBUG - h.flush()
+11:04:08,397 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:08,397 DEBUG - self.stream.flush()
+11:04:08,397 DEBUG - ValueError: I/O operation on closed file
+11:04:08,506 DEBUG - Execution of blocks returned: 0
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:09,412 DEBUG - self.doRollover()
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:09,412 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:09,412 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,412 DEBUG - if self.shouldRollover(record):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,412 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Error in atexit._run_exitfuncs:
+11:04:09,412 DEBUG - Traceback (most recent call last):
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:09,412 DEBUG - func(*targs, **kargs)
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:09,412 DEBUG - h.flush()
+11:04:09,412 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:09,412 DEBUG - self.stream.flush()
+11:04:09,412 DEBUG - ValueError: I/O operation on closed file
+11:04:09,412 DEBUG - Error in sys.exitfunc:
+11:04:09,428 DEBUG - Traceback (most recent call last):
+11:04:09,428 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:09,428 DEBUG - func(*targs, **kargs)
+11:04:09,428 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:09,428 DEBUG - h.flush()
+11:04:09,428 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:09,428 DEBUG - self.stream.flush()
+11:04:09,428 DEBUG - ValueError: I/O operation on closed file
+11:04:09,537 DEBUG - Execution of blocks returned: 0
+11:04:09,834 DEBUG - Traceback (most recent call last):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:09,834 DEBUG - self.doRollover()
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:09,834 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:09,834 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:09,834 DEBUG - Traceback (most recent call last):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,834 DEBUG - if self.shouldRollover(record):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,834 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,834 DEBUG - ValueError: I/O operation on closed file
+11:04:09,834 DEBUG - Traceback (most recent call last):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,834 DEBUG - if self.shouldRollover(record):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,834 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,834 DEBUG - ValueError: I/O operation on closed file
+11:04:09,834 DEBUG - Traceback (most recent call last):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,834 DEBUG - if self.shouldRollover(record):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,834 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,834 DEBUG - ValueError: I/O operation on closed file
+11:04:09,834 DEBUG - Traceback (most recent call last):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:09,834 DEBUG - if self.shouldRollover(record):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:09,834 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:09,834 DEBUG - ValueError: I/O operation on closed file
+11:04:09,834 DEBUG - Error in atexit._run_exitfuncs:
+11:04:09,834 DEBUG - Traceback (most recent call last):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:09,834 DEBUG - func(*targs, **kargs)
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:09,834 DEBUG - h.flush()
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:09,834 DEBUG - self.stream.flush()
+11:04:09,834 DEBUG - ValueError: I/O operation on closed file
+11:04:09,834 DEBUG - Error in sys.exitfunc:
+11:04:09,834 DEBUG - Traceback (most recent call last):
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:09,834 DEBUG - func(*targs, **kargs)
+11:04:09,834 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:09,850 DEBUG - h.flush()
+11:04:09,850 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:09,850 DEBUG - self.stream.flush()
+11:04:09,850 DEBUG - ValueError: I/O operation on closed file
+11:04:09,944 DEBUG - Execution of blocks returned: 0
+11:04:10,256 DEBUG - Traceback (most recent call last):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:10,256 DEBUG - self.doRollover()
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:10,256 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:10,256 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:10,256 DEBUG - Traceback (most recent call last):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:10,256 DEBUG - if self.shouldRollover(record):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:10,256 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:10,256 DEBUG - ValueError: I/O operation on closed file
+11:04:10,256 DEBUG - Traceback (most recent call last):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:10,256 DEBUG - if self.shouldRollover(record):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:10,256 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:10,256 DEBUG - ValueError: I/O operation on closed file
+11:04:10,256 DEBUG - Traceback (most recent call last):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:10,256 DEBUG - if self.shouldRollover(record):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:10,256 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:10,256 DEBUG - ValueError: I/O operation on closed file
+11:04:10,256 DEBUG - Error in atexit._run_exitfuncs:
+11:04:10,256 DEBUG - Traceback (most recent call last):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:10,256 DEBUG - func(*targs, **kargs)
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:10,256 DEBUG - h.flush()
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:10,256 DEBUG - self.stream.flush()
+11:04:10,256 DEBUG - ValueError: I/O operation on closed file
+11:04:10,256 DEBUG - Error in sys.exitfunc:
+11:04:10,256 DEBUG - Traceback (most recent call last):
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:10,256 DEBUG - func(*targs, **kargs)
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:10,256 DEBUG - h.flush()
+11:04:10,256 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:10,256 DEBUG - self.stream.flush()
+11:04:10,256 DEBUG - ValueError: I/O operation on closed file
+11:04:10,365 DEBUG - Execution of blocks returned: 0
+11:04:11,100 DEBUG - Traceback (most recent call last):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:11,100 DEBUG - self.doRollover()
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:11,100 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:11,100 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:11,100 DEBUG - Traceback (most recent call last):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:11,100 DEBUG - if self.shouldRollover(record):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:11,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:11,100 DEBUG - ValueError: I/O operation on closed file
+11:04:11,100 DEBUG - Traceback (most recent call last):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:11,100 DEBUG - if self.shouldRollover(record):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:11,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:11,100 DEBUG - ValueError: I/O operation on closed file
+11:04:11,100 DEBUG - Traceback (most recent call last):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:11,100 DEBUG - if self.shouldRollover(record):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:11,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:11,100 DEBUG - ValueError: I/O operation on closed file
+11:04:11,100 DEBUG - Traceback (most recent call last):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:11,100 DEBUG - if self.shouldRollover(record):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:11,100 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:11,100 DEBUG - ValueError: I/O operation on closed file
+11:04:11,100 DEBUG - Error in atexit._run_exitfuncs:
+11:04:11,100 DEBUG - Traceback (most recent call last):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:11,100 DEBUG - func(*targs, **kargs)
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:11,100 DEBUG - h.flush()
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:11,100 DEBUG - self.stream.flush()
+11:04:11,100 DEBUG - ValueError: I/O operation on closed file
+11:04:11,100 DEBUG - Error in sys.exitfunc:
+11:04:11,100 DEBUG - Traceback (most recent call last):
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:11,100 DEBUG - func(*targs, **kargs)
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:11,100 DEBUG - h.flush()
+11:04:11,100 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:11,100 DEBUG - self.stream.flush()
+11:04:11,100 DEBUG - ValueError: I/O operation on closed file
+11:04:11,209 DEBUG - Execution of blocks returned: 0
+11:04:13,584 DEBUG - Execution of bundle returned: 0
+11:04:13,897 DEBUG - Traceback (most recent call last):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:13,897 DEBUG - self.doRollover()
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:13,897 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:13,897 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:13,897 DEBUG - Traceback (most recent call last):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:13,897 DEBUG - if self.shouldRollover(record):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:13,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:13,897 DEBUG - ValueError: I/O operation on closed file
+11:04:13,897 DEBUG - Traceback (most recent call last):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:13,897 DEBUG - if self.shouldRollover(record):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:13,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:13,897 DEBUG - ValueError: I/O operation on closed file
+11:04:13,897 DEBUG - Traceback (most recent call last):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:13,897 DEBUG - if self.shouldRollover(record):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:13,897 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:13,897 DEBUG - ValueError: I/O operation on closed file
+11:04:13,897 DEBUG - Error in atexit._run_exitfuncs:
+11:04:13,897 DEBUG - Traceback (most recent call last):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:13,897 DEBUG - func(*targs, **kargs)
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:13,897 DEBUG - h.flush()
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:13,897 DEBUG - self.stream.flush()
+11:04:13,897 DEBUG - ValueError: I/O operation on closed file
+11:04:13,897 DEBUG - Error in sys.exitfunc:
+11:04:13,897 DEBUG - Traceback (most recent call last):
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:13,897 DEBUG - func(*targs, **kargs)
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:13,897 DEBUG - h.flush()
+11:04:13,897 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:13,897 DEBUG - self.stream.flush()
+11:04:13,897 DEBUG - ValueError: I/O operation on closed file
+11:04:14,006 DEBUG - Execution of blocks returned: 0
+11:04:14,740 DEBUG - Traceback (most recent call last):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:14,740 DEBUG - self.doRollover()
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:14,740 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:14,740 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:14,740 DEBUG - Traceback (most recent call last):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:14,740 DEBUG - if self.shouldRollover(record):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:14,740 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:14,740 DEBUG - ValueError: I/O operation on closed file
+11:04:14,740 DEBUG - Traceback (most recent call last):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:14,740 DEBUG - if self.shouldRollover(record):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:14,740 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:14,740 DEBUG - ValueError: I/O operation on closed file
+11:04:14,740 DEBUG - Traceback (most recent call last):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:14,740 DEBUG - if self.shouldRollover(record):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:14,740 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:14,740 DEBUG - ValueError: I/O operation on closed file
+11:04:14,740 DEBUG - Traceback (most recent call last):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:14,740 DEBUG - if self.shouldRollover(record):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:14,740 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:14,740 DEBUG - ValueError: I/O operation on closed file
+11:04:14,740 DEBUG - Error in atexit._run_exitfuncs:
+11:04:14,740 DEBUG - Traceback (most recent call last):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:14,740 DEBUG - func(*targs, **kargs)
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:14,740 DEBUG - h.flush()
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:14,740 DEBUG - self.stream.flush()
+11:04:14,740 DEBUG - ValueError: I/O operation on closed file
+11:04:14,740 DEBUG - Error in sys.exitfunc:
+11:04:14,740 DEBUG - Traceback (most recent call last):
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:14,740 DEBUG - func(*targs, **kargs)
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:14,740 DEBUG - h.flush()
+11:04:14,740 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:14,740 DEBUG - self.stream.flush()
+11:04:14,740 DEBUG - ValueError: I/O operation on closed file
+11:04:14,850 DEBUG - Execution of blocks returned: 0
+11:04:17,225 DEBUG - Execution of bundle returned: 0
+11:04:17,537 DEBUG - Traceback (most recent call last):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:17,537 DEBUG - self.doRollover()
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:17,537 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:17,537 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:17,537 DEBUG - Traceback (most recent call last):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:17,537 DEBUG - if self.shouldRollover(record):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:17,537 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:17,537 DEBUG - ValueError: I/O operation on closed file
+11:04:17,537 DEBUG - Traceback (most recent call last):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:17,537 DEBUG - if self.shouldRollover(record):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:17,537 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:17,537 DEBUG - ValueError: I/O operation on closed file
+11:04:17,537 DEBUG - Traceback (most recent call last):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:17,537 DEBUG - if self.shouldRollover(record):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:17,537 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:17,537 DEBUG - ValueError: I/O operation on closed file
+11:04:17,537 DEBUG - Error in atexit._run_exitfuncs:
+11:04:17,537 DEBUG - Traceback (most recent call last):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:17,537 DEBUG - func(*targs, **kargs)
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:17,537 DEBUG - h.flush()
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:17,537 DEBUG - self.stream.flush()
+11:04:17,537 DEBUG - ValueError: I/O operation on closed file
+11:04:17,537 DEBUG - Error in sys.exitfunc:
+11:04:17,537 DEBUG - Traceback (most recent call last):
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:17,537 DEBUG - func(*targs, **kargs)
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:17,537 DEBUG - h.flush()
+11:04:17,537 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:17,537 DEBUG - self.stream.flush()
+11:04:17,537 DEBUG - ValueError: I/O operation on closed file
+11:04:17,646 DEBUG - Execution of blocks returned: 0
+11:04:18,381 DEBUG - Traceback (most recent call last):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:18,381 DEBUG - self.doRollover()
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:18,381 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:18,381 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:18,381 DEBUG - Traceback (most recent call last):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:18,381 DEBUG - if self.shouldRollover(record):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:18,381 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:18,381 DEBUG - ValueError: I/O operation on closed file
+11:04:18,381 DEBUG - Traceback (most recent call last):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:18,381 DEBUG - if self.shouldRollover(record):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:18,381 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:18,381 DEBUG - ValueError: I/O operation on closed file
+11:04:18,381 DEBUG - Traceback (most recent call last):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:18,381 DEBUG - if self.shouldRollover(record):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:18,381 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:18,381 DEBUG - ValueError: I/O operation on closed file
+11:04:18,381 DEBUG - Traceback (most recent call last):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:18,381 DEBUG - if self.shouldRollover(record):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:18,381 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:18,381 DEBUG - ValueError: I/O operation on closed file
+11:04:18,381 DEBUG - Error in atexit._run_exitfuncs:
+11:04:18,381 DEBUG - Traceback (most recent call last):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:18,381 DEBUG - func(*targs, **kargs)
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:18,381 DEBUG - h.flush()
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:18,381 DEBUG - self.stream.flush()
+11:04:18,381 DEBUG - ValueError: I/O operation on closed file
+11:04:18,381 DEBUG - Error in sys.exitfunc:
+11:04:18,381 DEBUG - Traceback (most recent call last):
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:18,381 DEBUG - func(*targs, **kargs)
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:18,381 DEBUG - h.flush()
+11:04:18,381 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:18,381 DEBUG - self.stream.flush()
+11:04:18,381 DEBUG - ValueError: I/O operation on closed file
+11:04:18,490 DEBUG - Execution of blocks returned: 0
+11:04:20,849 DEBUG - Execution of bundle returned: 0
+11:04:21,146 DEBUG - Traceback (most recent call last):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:21,146 DEBUG - self.doRollover()
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:21,146 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:21,146 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:21,146 DEBUG - Traceback (most recent call last):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:21,146 DEBUG - if self.shouldRollover(record):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:21,146 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:21,146 DEBUG - ValueError: I/O operation on closed file
+11:04:21,146 DEBUG - Traceback (most recent call last):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:21,146 DEBUG - if self.shouldRollover(record):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:21,146 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:21,146 DEBUG - ValueError: I/O operation on closed file
+11:04:21,146 DEBUG - Traceback (most recent call last):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:21,146 DEBUG - if self.shouldRollover(record):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:21,146 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:21,146 DEBUG - ValueError: I/O operation on closed file
+11:04:21,146 DEBUG - Traceback (most recent call last):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:21,146 DEBUG - if self.shouldRollover(record):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:21,146 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:21,146 DEBUG - ValueError: I/O operation on closed file
+11:04:21,146 DEBUG - Error in atexit._run_exitfuncs:
+11:04:21,146 DEBUG - Traceback (most recent call last):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:21,146 DEBUG - func(*targs, **kargs)
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:21,146 DEBUG - h.flush()
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:21,146 DEBUG - self.stream.flush()
+11:04:21,146 DEBUG - ValueError: I/O operation on closed file
+11:04:21,146 DEBUG - Error in sys.exitfunc:
+11:04:21,146 DEBUG - Traceback (most recent call last):
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:21,146 DEBUG - func(*targs, **kargs)
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:21,146 DEBUG - h.flush()
+11:04:21,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:21,146 DEBUG - self.stream.flush()
+11:04:21,146 DEBUG - ValueError: I/O operation on closed file
+11:04:21,256 DEBUG - Execution of blocks returned: 0
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:22,162 DEBUG - self.doRollover()
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:22,162 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:22,162 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,162 DEBUG - if self.shouldRollover(record):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,162 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Error in atexit._run_exitfuncs:
+11:04:22,162 DEBUG - Traceback (most recent call last):
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:22,162 DEBUG - func(*targs, **kargs)
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:22,162 DEBUG - h.flush()
+11:04:22,162 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:22,162 DEBUG - self.stream.flush()
+11:04:22,162 DEBUG - ValueError: I/O operation on closed file
+11:04:22,162 DEBUG - Error in sys.exitfunc:
+11:04:22,177 DEBUG - Traceback (most recent call last):
+11:04:22,177 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:22,177 DEBUG - func(*targs, **kargs)
+11:04:22,177 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:22,177 DEBUG - h.flush()
+11:04:22,177 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:22,177 DEBUG - self.stream.flush()
+11:04:22,177 DEBUG - ValueError: I/O operation on closed file
+11:04:22,287 DEBUG - Execution of blocks returned: 0
+11:04:22,584 DEBUG - Traceback (most recent call last):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:22,584 DEBUG - self.doRollover()
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:22,584 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:22,584 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:22,584 DEBUG - Traceback (most recent call last):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,584 DEBUG - if self.shouldRollover(record):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,584 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,584 DEBUG - ValueError: I/O operation on closed file
+11:04:22,584 DEBUG - Traceback (most recent call last):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,584 DEBUG - if self.shouldRollover(record):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,584 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,584 DEBUG - ValueError: I/O operation on closed file
+11:04:22,584 DEBUG - Traceback (most recent call last):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,584 DEBUG - if self.shouldRollover(record):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,584 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,584 DEBUG - ValueError: I/O operation on closed file
+11:04:22,584 DEBUG - Traceback (most recent call last):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,584 DEBUG - if self.shouldRollover(record):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,584 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,584 DEBUG - ValueError: I/O operation on closed file
+11:04:22,584 DEBUG - Error in atexit._run_exitfuncs:
+11:04:22,584 DEBUG - Traceback (most recent call last):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:22,584 DEBUG - func(*targs, **kargs)
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:22,584 DEBUG - h.flush()
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:22,584 DEBUG - self.stream.flush()
+11:04:22,584 DEBUG - ValueError: I/O operation on closed file
+11:04:22,584 DEBUG - Error in sys.exitfunc:
+11:04:22,584 DEBUG - Traceback (most recent call last):
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:22,584 DEBUG - func(*targs, **kargs)
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:22,584 DEBUG - h.flush()
+11:04:22,584 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:22,584 DEBUG - self.stream.flush()
+11:04:22,584 DEBUG - ValueError: I/O operation on closed file
+11:04:22,693 DEBUG - Execution of blocks returned: 0
+11:04:22,990 DEBUG - Traceback (most recent call last):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:22,990 DEBUG - self.doRollover()
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:22,990 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:22,990 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:22,990 DEBUG - Traceback (most recent call last):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,990 DEBUG - if self.shouldRollover(record):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,990 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,990 DEBUG - ValueError: I/O operation on closed file
+11:04:22,990 DEBUG - Traceback (most recent call last):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,990 DEBUG - if self.shouldRollover(record):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,990 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,990 DEBUG - ValueError: I/O operation on closed file
+11:04:22,990 DEBUG - Traceback (most recent call last):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,990 DEBUG - if self.shouldRollover(record):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,990 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,990 DEBUG - ValueError: I/O operation on closed file
+11:04:22,990 DEBUG - Traceback (most recent call last):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:22,990 DEBUG - if self.shouldRollover(record):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:22,990 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:22,990 DEBUG - ValueError: I/O operation on closed file
+11:04:22,990 DEBUG - Error in atexit._run_exitfuncs:
+11:04:22,990 DEBUG - Traceback (most recent call last):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:22,990 DEBUG - func(*targs, **kargs)
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:22,990 DEBUG - h.flush()
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:22,990 DEBUG - self.stream.flush()
+11:04:22,990 DEBUG - ValueError: I/O operation on closed file
+11:04:22,990 DEBUG - Error in sys.exitfunc:
+11:04:22,990 DEBUG - Traceback (most recent call last):
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:22,990 DEBUG - func(*targs, **kargs)
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:22,990 DEBUG - h.flush()
+11:04:22,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:22,990 DEBUG - self.stream.flush()
+11:04:22,990 DEBUG - ValueError: I/O operation on closed file
+11:04:23,099 DEBUG - Execution of blocks returned: 0
+11:04:23,396 DEBUG - Traceback (most recent call last):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:23,396 DEBUG - self.doRollover()
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:23,396 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:23,396 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:23,396 DEBUG - Traceback (most recent call last):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:23,396 DEBUG - if self.shouldRollover(record):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:23,396 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:23,396 DEBUG - ValueError: I/O operation on closed file
+11:04:23,396 DEBUG - Traceback (most recent call last):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:23,396 DEBUG - if self.shouldRollover(record):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:23,396 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:23,396 DEBUG - ValueError: I/O operation on closed file
+11:04:23,396 DEBUG - Traceback (most recent call last):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:23,396 DEBUG - if self.shouldRollover(record):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:23,396 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:23,396 DEBUG - ValueError: I/O operation on closed file
+11:04:23,396 DEBUG - Traceback (most recent call last):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:23,396 DEBUG - if self.shouldRollover(record):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:23,396 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:23,396 DEBUG - ValueError: I/O operation on closed file
+11:04:23,396 DEBUG - Error in atexit._run_exitfuncs:
+11:04:23,396 DEBUG - Traceback (most recent call last):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:23,396 DEBUG - func(*targs, **kargs)
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:23,396 DEBUG - h.flush()
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:23,396 DEBUG - self.stream.flush()
+11:04:23,396 DEBUG - ValueError: I/O operation on closed file
+11:04:23,396 DEBUG - Error in sys.exitfunc:
+11:04:23,396 DEBUG - Traceback (most recent call last):
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:23,396 DEBUG - func(*targs, **kargs)
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:23,396 DEBUG - h.flush()
+11:04:23,396 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:23,396 DEBUG - self.stream.flush()
+11:04:23,396 DEBUG - ValueError: I/O operation on closed file
+11:04:23,506 DEBUG - Execution of blocks returned: 0
+11:04:23,818 DEBUG - Traceback (most recent call last):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:23,818 DEBUG - self.doRollover()
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:23,818 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:23,818 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:23,818 DEBUG - Traceback (most recent call last):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:23,818 DEBUG - if self.shouldRollover(record):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:23,818 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:23,818 DEBUG - ValueError: I/O operation on closed file
+11:04:23,818 DEBUG - Traceback (most recent call last):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:23,818 DEBUG - if self.shouldRollover(record):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:23,818 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:23,818 DEBUG - ValueError: I/O operation on closed file
+11:04:23,818 DEBUG - Traceback (most recent call last):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:23,818 DEBUG - if self.shouldRollover(record):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:23,818 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:23,818 DEBUG - ValueError: I/O operation on closed file
+11:04:23,818 DEBUG - Error in atexit._run_exitfuncs:
+11:04:23,818 DEBUG - Traceback (most recent call last):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:23,818 DEBUG - func(*targs, **kargs)
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:23,818 DEBUG - h.flush()
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:23,818 DEBUG - self.stream.flush()
+11:04:23,818 DEBUG - ValueError: I/O operation on closed file
+11:04:23,818 DEBUG - Error in sys.exitfunc:
+11:04:23,818 DEBUG - Traceback (most recent call last):
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:23,818 DEBUG - func(*targs, **kargs)
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:23,818 DEBUG - h.flush()
+11:04:23,818 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:23,818 DEBUG - self.stream.flush()
+11:04:23,818 DEBUG - ValueError: I/O operation on closed file
+11:04:23,927 DEBUG - Execution of blocks returned: 0
+11:04:24,662 DEBUG - Traceback (most recent call last):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:24,662 DEBUG - self.doRollover()
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:24,662 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:24,662 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:24,662 DEBUG - Traceback (most recent call last):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:24,662 DEBUG - if self.shouldRollover(record):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:24,662 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:24,662 DEBUG - ValueError: I/O operation on closed file
+11:04:24,662 DEBUG - Traceback (most recent call last):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:24,662 DEBUG - if self.shouldRollover(record):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:24,662 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:24,662 DEBUG - ValueError: I/O operation on closed file
+11:04:24,662 DEBUG - Traceback (most recent call last):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:24,662 DEBUG - if self.shouldRollover(record):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:24,662 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:24,662 DEBUG - ValueError: I/O operation on closed file
+11:04:24,662 DEBUG - Traceback (most recent call last):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:24,662 DEBUG - if self.shouldRollover(record):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:24,662 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:24,662 DEBUG - ValueError: I/O operation on closed file
+11:04:24,662 DEBUG - Error in atexit._run_exitfuncs:
+11:04:24,662 DEBUG - Traceback (most recent call last):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:24,662 DEBUG - func(*targs, **kargs)
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:24,662 DEBUG - h.flush()
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:24,662 DEBUG - self.stream.flush()
+11:04:24,662 DEBUG - ValueError: I/O operation on closed file
+11:04:24,662 DEBUG - Error in sys.exitfunc:
+11:04:24,662 DEBUG - Traceback (most recent call last):
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:24,662 DEBUG - func(*targs, **kargs)
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:24,662 DEBUG - h.flush()
+11:04:24,662 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:24,662 DEBUG - self.stream.flush()
+11:04:24,662 DEBUG - ValueError: I/O operation on closed file
+11:04:24,771 DEBUG - Execution of blocks returned: 0
+11:04:27,146 DEBUG - Execution of bundle returned: 0
+11:04:27,459 DEBUG - Traceback (most recent call last):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:27,459 DEBUG - self.doRollover()
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:27,459 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:27,459 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:27,459 DEBUG - Traceback (most recent call last):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:27,459 DEBUG - if self.shouldRollover(record):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:27,459 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:27,459 DEBUG - ValueError: I/O operation on closed file
+11:04:27,459 DEBUG - Traceback (most recent call last):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:27,459 DEBUG - if self.shouldRollover(record):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:27,459 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:27,459 DEBUG - ValueError: I/O operation on closed file
+11:04:27,459 DEBUG - Traceback (most recent call last):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:27,459 DEBUG - if self.shouldRollover(record):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:27,459 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:27,459 DEBUG - ValueError: I/O operation on closed file
+11:04:27,459 DEBUG - Error in atexit._run_exitfuncs:
+11:04:27,459 DEBUG - Traceback (most recent call last):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:27,459 DEBUG - func(*targs, **kargs)
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:27,459 DEBUG - h.flush()
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:27,459 DEBUG - self.stream.flush()
+11:04:27,459 DEBUG - ValueError: I/O operation on closed file
+11:04:27,459 DEBUG - Error in sys.exitfunc:
+11:04:27,459 DEBUG - Traceback (most recent call last):
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:27,459 DEBUG - func(*targs, **kargs)
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:27,459 DEBUG - h.flush()
+11:04:27,459 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:27,459 DEBUG - self.stream.flush()
+11:04:27,459 DEBUG - ValueError: I/O operation on closed file
+11:04:27,568 DEBUG - Execution of blocks returned: 0
+11:04:28,349 DEBUG - Traceback (most recent call last):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:28,349 DEBUG - self.doRollover()
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:28,349 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:28,349 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:28,349 DEBUG - Traceback (most recent call last):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:28,349 DEBUG - if self.shouldRollover(record):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:28,349 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:28,349 DEBUG - ValueError: I/O operation on closed file
+11:04:28,349 DEBUG - Traceback (most recent call last):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:28,349 DEBUG - if self.shouldRollover(record):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:28,349 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:28,349 DEBUG - ValueError: I/O operation on closed file
+11:04:28,349 DEBUG - Traceback (most recent call last):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:28,349 DEBUG - if self.shouldRollover(record):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:28,349 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:28,349 DEBUG - ValueError: I/O operation on closed file
+11:04:28,349 DEBUG - Traceback (most recent call last):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:28,349 DEBUG - if self.shouldRollover(record):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:28,349 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:28,349 DEBUG - ValueError: I/O operation on closed file
+11:04:28,349 DEBUG - Error in atexit._run_exitfuncs:
+11:04:28,349 DEBUG - Traceback (most recent call last):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:28,349 DEBUG - func(*targs, **kargs)
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:28,349 DEBUG - h.flush()
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:28,349 DEBUG - self.stream.flush()
+11:04:28,349 DEBUG - ValueError: I/O operation on closed file
+11:04:28,349 DEBUG - Error in sys.exitfunc:
+11:04:28,349 DEBUG - Traceback (most recent call last):
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:28,349 DEBUG - func(*targs, **kargs)
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:28,349 DEBUG - h.flush()
+11:04:28,349 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:28,349 DEBUG - self.stream.flush()
+11:04:28,349 DEBUG - ValueError: I/O operation on closed file
+11:04:28,459 DEBUG - Execution of blocks returned: 0
+11:04:30,833 DEBUG - Execution of bundle returned: 0
+11:04:31,146 DEBUG - Traceback (most recent call last):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:31,146 DEBUG - self.doRollover()
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:31,146 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:31,146 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:31,146 DEBUG - Traceback (most recent call last):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:31,146 DEBUG - if self.shouldRollover(record):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:31,146 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:31,146 DEBUG - ValueError: I/O operation on closed file
+11:04:31,146 DEBUG - Traceback (most recent call last):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:31,146 DEBUG - if self.shouldRollover(record):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:31,146 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:31,146 DEBUG - ValueError: I/O operation on closed file
+11:04:31,146 DEBUG - Traceback (most recent call last):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:31,146 DEBUG - if self.shouldRollover(record):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:31,146 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:31,146 DEBUG - ValueError: I/O operation on closed file
+11:04:31,146 DEBUG - Error in atexit._run_exitfuncs:
+11:04:31,146 DEBUG - Traceback (most recent call last):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:31,146 DEBUG - func(*targs, **kargs)
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:31,146 DEBUG - h.flush()
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:31,146 DEBUG - self.stream.flush()
+11:04:31,146 DEBUG - ValueError: I/O operation on closed file
+11:04:31,146 DEBUG - Error in sys.exitfunc:
+11:04:31,146 DEBUG - Traceback (most recent call last):
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:31,146 DEBUG - func(*targs, **kargs)
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:31,146 DEBUG - h.flush()
+11:04:31,146 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:31,146 DEBUG - self.stream.flush()
+11:04:31,146 DEBUG - ValueError: I/O operation on closed file
+11:04:31,255 DEBUG - Execution of blocks returned: 0
+11:04:31,974 DEBUG - Traceback (most recent call last):
+11:04:31,974 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:31,974 DEBUG - self.doRollover()
+11:04:31,974 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:31,974 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:31,974 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:31,974 DEBUG - Traceback (most recent call last):
+11:04:31,974 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:31,974 DEBUG - if self.shouldRollover(record):
+11:04:31,974 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:31,974 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:31,974 DEBUG - ValueError: I/O operation on closed file
+11:04:31,974 DEBUG - Traceback (most recent call last):
+11:04:31,974 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:31,974 DEBUG - if self.shouldRollover(record):
+11:04:31,974 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:31,974 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:31,990 DEBUG - ValueError: I/O operation on closed file
+11:04:31,990 DEBUG - Traceback (most recent call last):
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:31,990 DEBUG - if self.shouldRollover(record):
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:31,990 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:31,990 DEBUG - ValueError: I/O operation on closed file
+11:04:31,990 DEBUG - Traceback (most recent call last):
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:31,990 DEBUG - if self.shouldRollover(record):
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:31,990 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:31,990 DEBUG - ValueError: I/O operation on closed file
+11:04:31,990 DEBUG - Error in atexit._run_exitfuncs:
+11:04:31,990 DEBUG - Traceback (most recent call last):
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:31,990 DEBUG - func(*targs, **kargs)
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:31,990 DEBUG - h.flush()
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:31,990 DEBUG - self.stream.flush()
+11:04:31,990 DEBUG - ValueError: I/O operation on closed file
+11:04:31,990 DEBUG - Error in sys.exitfunc:
+11:04:31,990 DEBUG - Traceback (most recent call last):
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:31,990 DEBUG - func(*targs, **kargs)
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:31,990 DEBUG - h.flush()
+11:04:31,990 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:31,990 DEBUG - self.stream.flush()
+11:04:31,990 DEBUG - ValueError: I/O operation on closed file
+11:04:32,083 DEBUG - Execution of blocks returned: 0
+11:04:34,474 DEBUG - Execution of bundle returned: 0
+11:04:34,771 DEBUG - Traceback (most recent call last):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:34,771 DEBUG - self.doRollover()
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:34,771 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:34,771 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:34,771 DEBUG - Traceback (most recent call last):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:34,771 DEBUG - if self.shouldRollover(record):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:34,771 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:34,771 DEBUG - ValueError: I/O operation on closed file
+11:04:34,771 DEBUG - Traceback (most recent call last):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:34,771 DEBUG - if self.shouldRollover(record):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:34,771 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:34,771 DEBUG - ValueError: I/O operation on closed file
+11:04:34,771 DEBUG - Traceback (most recent call last):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:34,771 DEBUG - if self.shouldRollover(record):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:34,771 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:34,771 DEBUG - ValueError: I/O operation on closed file
+11:04:34,771 DEBUG - Traceback (most recent call last):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:34,771 DEBUG - if self.shouldRollover(record):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:34,771 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:34,771 DEBUG - ValueError: I/O operation on closed file
+11:04:34,771 DEBUG - Error in atexit._run_exitfuncs:
+11:04:34,771 DEBUG - Traceback (most recent call last):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:34,771 DEBUG - func(*targs, **kargs)
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:34,771 DEBUG - h.flush()
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:34,771 DEBUG - self.stream.flush()
+11:04:34,771 DEBUG - ValueError: I/O operation on closed file
+11:04:34,771 DEBUG - Error in sys.exitfunc:
+11:04:34,771 DEBUG - Traceback (most recent call last):
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:34,771 DEBUG - func(*targs, **kargs)
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:34,771 DEBUG - h.flush()
+11:04:34,771 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:34,771 DEBUG - self.stream.flush()
+11:04:34,771 DEBUG - ValueError: I/O operation on closed file
+11:04:34,880 DEBUG - Execution of blocks returned: 0
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:35,786 DEBUG - self.doRollover()
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:35,786 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:35,786 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:35,786 DEBUG - if self.shouldRollover(record):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:35,786 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Error in atexit._run_exitfuncs:
+11:04:35,786 DEBUG - Traceback (most recent call last):
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:35,786 DEBUG - func(*targs, **kargs)
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:35,786 DEBUG - h.flush()
+11:04:35,786 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:35,786 DEBUG - self.stream.flush()
+11:04:35,786 DEBUG - ValueError: I/O operation on closed file
+11:04:35,786 DEBUG - Error in sys.exitfunc:
+11:04:35,802 DEBUG - Traceback (most recent call last):
+11:04:35,802 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:35,802 DEBUG - func(*targs, **kargs)
+11:04:35,802 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:35,802 DEBUG - h.flush()
+11:04:35,802 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:35,802 DEBUG - self.stream.flush()
+11:04:35,802 DEBUG - ValueError: I/O operation on closed file
+11:04:35,911 DEBUG - Execution of blocks returned: 0
+11:04:36,208 DEBUG - Traceback (most recent call last):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:36,208 DEBUG - self.doRollover()
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:36,208 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:36,208 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:36,208 DEBUG - Traceback (most recent call last):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:36,208 DEBUG - if self.shouldRollover(record):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:36,208 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:36,208 DEBUG - ValueError: I/O operation on closed file
+11:04:36,208 DEBUG - Traceback (most recent call last):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:36,208 DEBUG - if self.shouldRollover(record):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:36,208 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:36,208 DEBUG - ValueError: I/O operation on closed file
+11:04:36,208 DEBUG - Traceback (most recent call last):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:36,208 DEBUG - if self.shouldRollover(record):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:36,208 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:36,208 DEBUG - ValueError: I/O operation on closed file
+11:04:36,208 DEBUG - Traceback (most recent call last):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:36,208 DEBUG - if self.shouldRollover(record):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:36,208 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:36,208 DEBUG - ValueError: I/O operation on closed file
+11:04:36,208 DEBUG - Error in atexit._run_exitfuncs:
+11:04:36,208 DEBUG - Traceback (most recent call last):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:36,208 DEBUG - func(*targs, **kargs)
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:36,208 DEBUG - h.flush()
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:36,208 DEBUG - self.stream.flush()
+11:04:36,208 DEBUG - ValueError: I/O operation on closed file
+11:04:36,208 DEBUG - Error in sys.exitfunc:
+11:04:36,208 DEBUG - Traceback (most recent call last):
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:36,208 DEBUG - func(*targs, **kargs)
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:36,208 DEBUG - h.flush()
+11:04:36,208 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:36,208 DEBUG - self.stream.flush()
+11:04:36,208 DEBUG - ValueError: I/O operation on closed file
+11:04:36,318 DEBUG - Execution of blocks returned: 0
+11:04:36,630 DEBUG - Traceback (most recent call last):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:36,630 DEBUG - self.doRollover()
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:36,630 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:36,630 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:36,630 DEBUG - Traceback (most recent call last):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:36,630 DEBUG - if self.shouldRollover(record):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:36,630 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:36,630 DEBUG - ValueError: I/O operation on closed file
+11:04:36,630 DEBUG - Traceback (most recent call last):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:36,630 DEBUG - if self.shouldRollover(record):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:36,630 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:36,630 DEBUG - ValueError: I/O operation on closed file
+11:04:36,630 DEBUG - Traceback (most recent call last):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:36,630 DEBUG - if self.shouldRollover(record):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:36,630 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:36,630 DEBUG - ValueError: I/O operation on closed file
+11:04:36,630 DEBUG - Error in atexit._run_exitfuncs:
+11:04:36,630 DEBUG - Traceback (most recent call last):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:36,630 DEBUG - func(*targs, **kargs)
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:36,630 DEBUG - h.flush()
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:36,630 DEBUG - self.stream.flush()
+11:04:36,630 DEBUG - ValueError: I/O operation on closed file
+11:04:36,630 DEBUG - Error in sys.exitfunc:
+11:04:36,630 DEBUG - Traceback (most recent call last):
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:36,630 DEBUG - func(*targs, **kargs)
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:36,630 DEBUG - h.flush()
+11:04:36,630 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:36,630 DEBUG - self.stream.flush()
+11:04:36,630 DEBUG - ValueError: I/O operation on closed file
+11:04:36,739 DEBUG - Execution of blocks returned: 0
+11:04:37,474 DEBUG - Traceback (most recent call last):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:37,474 DEBUG - self.doRollover()
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:37,474 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:37,474 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:37,474 DEBUG - Traceback (most recent call last):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:37,474 DEBUG - if self.shouldRollover(record):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:37,474 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:37,474 DEBUG - ValueError: I/O operation on closed file
+11:04:37,474 DEBUG - Traceback (most recent call last):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:37,474 DEBUG - if self.shouldRollover(record):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:37,474 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:37,474 DEBUG - ValueError: I/O operation on closed file
+11:04:37,474 DEBUG - Traceback (most recent call last):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:37,474 DEBUG - if self.shouldRollover(record):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:37,474 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:37,474 DEBUG - ValueError: I/O operation on closed file
+11:04:37,474 DEBUG - Traceback (most recent call last):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:37,474 DEBUG - if self.shouldRollover(record):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:37,474 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:37,474 DEBUG - ValueError: I/O operation on closed file
+11:04:37,474 DEBUG - Error in atexit._run_exitfuncs:
+11:04:37,474 DEBUG - Traceback (most recent call last):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:37,474 DEBUG - func(*targs, **kargs)
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:37,474 DEBUG - h.flush()
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:37,474 DEBUG - self.stream.flush()
+11:04:37,474 DEBUG - ValueError: I/O operation on closed file
+11:04:37,474 DEBUG - Error in sys.exitfunc:
+11:04:37,474 DEBUG - Traceback (most recent call last):
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:37,474 DEBUG - func(*targs, **kargs)
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:37,474 DEBUG - h.flush()
+11:04:37,474 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:37,474 DEBUG - self.stream.flush()
+11:04:37,474 DEBUG - ValueError: I/O operation on closed file
+11:04:37,583 DEBUG - Execution of blocks returned: 0
+11:04:39,958 DEBUG - Execution of bundle returned: 0
+11:04:40,271 DEBUG - Traceback (most recent call last):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:40,271 DEBUG - self.doRollover()
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:40,271 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:40,271 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:40,271 DEBUG - Traceback (most recent call last):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:40,271 DEBUG - if self.shouldRollover(record):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:40,271 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:40,271 DEBUG - ValueError: I/O operation on closed file
+11:04:40,271 DEBUG - Traceback (most recent call last):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:40,271 DEBUG - if self.shouldRollover(record):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:40,271 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:40,271 DEBUG - ValueError: I/O operation on closed file
+11:04:40,271 DEBUG - Traceback (most recent call last):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:40,271 DEBUG - if self.shouldRollover(record):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:40,271 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:40,271 DEBUG - ValueError: I/O operation on closed file
+11:04:40,271 DEBUG - Error in atexit._run_exitfuncs:
+11:04:40,271 DEBUG - Traceback (most recent call last):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:40,271 DEBUG - func(*targs, **kargs)
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:40,271 DEBUG - h.flush()
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:40,271 DEBUG - self.stream.flush()
+11:04:40,271 DEBUG - ValueError: I/O operation on closed file
+11:04:40,271 DEBUG - Error in sys.exitfunc:
+11:04:40,271 DEBUG - Traceback (most recent call last):
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:40,271 DEBUG - func(*targs, **kargs)
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:40,271 DEBUG - h.flush()
+11:04:40,271 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:40,271 DEBUG - self.stream.flush()
+11:04:40,271 DEBUG - ValueError: I/O operation on closed file
+11:04:40,380 DEBUG - Execution of blocks returned: 0
+11:04:41,099 DEBUG - Traceback (most recent call last):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:41,099 DEBUG - self.doRollover()
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:41,099 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:41,099 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:41,099 DEBUG - Traceback (most recent call last):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:41,099 DEBUG - if self.shouldRollover(record):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:41,099 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:41,099 DEBUG - ValueError: I/O operation on closed file
+11:04:41,099 DEBUG - Traceback (most recent call last):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:41,099 DEBUG - if self.shouldRollover(record):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:41,099 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:41,099 DEBUG - ValueError: I/O operation on closed file
+11:04:41,099 DEBUG - Traceback (most recent call last):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:41,099 DEBUG - if self.shouldRollover(record):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:41,099 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:41,099 DEBUG - ValueError: I/O operation on closed file
+11:04:41,099 DEBUG - Traceback (most recent call last):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:41,099 DEBUG - if self.shouldRollover(record):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:41,099 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:41,099 DEBUG - ValueError: I/O operation on closed file
+11:04:41,099 DEBUG - Error in atexit._run_exitfuncs:
+11:04:41,099 DEBUG - Traceback (most recent call last):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:41,099 DEBUG - func(*targs, **kargs)
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:41,099 DEBUG - h.flush()
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:41,099 DEBUG - self.stream.flush()
+11:04:41,099 DEBUG - ValueError: I/O operation on closed file
+11:04:41,099 DEBUG - Error in sys.exitfunc:
+11:04:41,099 DEBUG - Traceback (most recent call last):
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:41,099 DEBUG - func(*targs, **kargs)
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:41,099 DEBUG - h.flush()
+11:04:41,099 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:41,099 DEBUG - self.stream.flush()
+11:04:41,099 DEBUG - ValueError: I/O operation on closed file
+11:04:41,208 DEBUG - Execution of blocks returned: 0
+11:04:43,583 DEBUG - Execution of bundle returned: 0
+11:04:43,895 DEBUG - Traceback (most recent call last):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 72, in emit
+11:04:43,895 DEBUG - self.doRollover()
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 129, in doRollover
+11:04:43,895 DEBUG - os.rename(self.baseFilename, dfn)
+11:04:43,895 DEBUG - WindowsError: [Error 32] The process cannot access the file because it is being used by another process
+11:04:43,895 DEBUG - Traceback (most recent call last):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:43,895 DEBUG - if self.shouldRollover(record):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:43,895 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:43,895 DEBUG - ValueError: I/O operation on closed file
+11:04:43,895 DEBUG - Traceback (most recent call last):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:43,895 DEBUG - if self.shouldRollover(record):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:43,895 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:43,895 DEBUG - ValueError: I/O operation on closed file
+11:04:43,895 DEBUG - Traceback (most recent call last):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 71, in emit
+11:04:43,895 DEBUG - if self.shouldRollover(record):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\handlers.py", line 145, in shouldRollover
+11:04:43,895 DEBUG - self.stream.seek(0, 2) #due to non-posix-compliant Windows feature
+11:04:43,895 DEBUG - ValueError: I/O operation on closed file
+11:04:43,895 DEBUG - Error in atexit._run_exitfuncs:
+11:04:43,895 DEBUG - Traceback (most recent call last):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:43,895 DEBUG - func(*targs, **kargs)
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:43,895 DEBUG - h.flush()
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:43,895 DEBUG - self.stream.flush()
+11:04:43,895 DEBUG - ValueError: I/O operation on closed file
+11:04:43,895 DEBUG - Error in sys.exitfunc:
+11:04:43,895 DEBUG - Traceback (most recent call last):
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\atexit.py", line 24, in _run_exitfuncs
+11:04:43,895 DEBUG - func(*targs, **kargs)
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 1486, in shutdown
+11:04:43,895 DEBUG - h.flush()
+11:04:43,895 DEBUG - File "C:\APPS\actpython\lib\logging\__init__.py", line 746, in flush
+11:04:43,895 DEBUG - self.stream.flush()
+11:04:43,895 DEBUG - ValueError: I/O operation on closed file
+11:04:44,005 DEBUG - Execution of blocks returned: 0
+11:04:45,380 DEBUG - Execution of bundle returned: 0
+11:04:46,723 DEBUG - External process error: apt-ftparchive failed with error code 100
+11:04:46,848 DEBUG - Execution of bundle returned: 1
+11:04:47,755 DEBUG - External process error: apt-ftparchive failed with error code 100
+11:04:47,880 DEBUG - Execution of bundle returned: 1
+11:04:48,630 DEBUG - WARNING: Path 'E:\Build_E\wbernard\workspace\helium-working-java2\helium\build\components\helium-blocks\test\temp\repo' does not contain any bundles(*.deb).
+11:04:48,630 DEBUG - Creating empty repository.
+11:04:48,911 DEBUG - Execution of bundle returned: 0
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestBlocks.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestBlocks.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.helium.blocks.tests;
+
+import java.io.File;
+
+import com.nokia.helium.blocks.Blocks;
+import com.nokia.helium.blocks.BlocksException;
+
+import org.junit.*;
+import static org.junit.Assert.*;
+
+public class TestBlocks {
+
+ boolean blocksPresent;
+
+ @Before
+ public void setUp() {
+ // check if blocks is installed. Then test could take place.
+ try {
+ Process p = null;
+ if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+ p = Runtime.getRuntime().exec("blocks.bat");
+ } else {
+ p = Runtime.getRuntime().exec("blocks");
+ }
+ p.getErrorStream().close();
+ p.getOutputStream().close();
+ p.getInputStream().close();
+ blocksPresent = (p.waitFor()==0);
+ } catch (Exception e) {
+ System.err.println("Blocks is not installed so unittest will be skipped: " + e);
+ }
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ /**
+ * Test the simple execution of a blocks command
+ * @throws Exception
+ */
+ @Test
+ public void test_simpleBlocksExecution() throws Exception {
+ if (blocksPresent) {
+ Blocks blocks = new Blocks();
+ blocks.execute(new String[0]);
+ }
+ }
+
+ /**
+ * Test the simple execution of a blocks command
+ * @throws Exception
+ */
+ @Test
+ public void test_simpleBlocksExecutionFails() throws Exception {
+ if (blocksPresent) {
+ Blocks blocks = new Blocks();
+ String[] args = new String[1];
+ args[0] = "non-existing-command";
+ try {
+ blocks.execute(args);
+ fail("This blocks command must fail!");
+ } catch (BlocksException e) {
+ // nothing to do
+ }
+ }
+ }
+
+ @Test
+ public void test_addWorkspace() throws Exception {
+ if (blocksPresent) {
+ Blocks blocks = new Blocks();
+ try {
+ blocks.addWorkspace(new File("not-existing-dir"), "Not existing dir.");
+ fail("This blocks command must fail!");
+ } catch (BlocksException e) {
+ // nothing to do
+ }
+ }
+ }
+
+ @Test
+ public void test_listWorkspaces() throws Exception {
+ if (blocksPresent) {
+ Blocks blocks = new Blocks();
+ blocks.listWorkspaces();
+ }
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestBundle.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestBundle.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,97 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.tests;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.nokia.helium.blocks.Bundle;
+import com.nokia.helium.blocks.BundleException;
+
+/**
+ * Test bundle command interface.
+ */
+public class TestBundle {
+ boolean bundlePresent;
+
+ @Before
+ public void setUp() {
+ // check if blocks is installed. Then test could take place.
+ try {
+ Process p = null;
+ if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+ p = Runtime.getRuntime().exec("bundle.bat");
+ } else {
+ p = Runtime.getRuntime().exec("bundle");
+ }
+ p.getErrorStream().close();
+ p.getOutputStream().close();
+ p.getInputStream().close();
+ bundlePresent = (p.waitFor()==0);
+ } catch (Exception e) {
+ System.err.println("Bundler is not installed so unittest will be skipped: " + e);
+ }
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+ @Test
+ public void test_simpleBundleExecution() throws BundleException {
+ if (bundlePresent) {
+ Bundle bundle = new Bundle();
+ bundle.execute(new String[0]);
+ }
+ }
+
+ @Test
+ public void test_createIndexNullArg() {
+ if (bundlePresent) {
+ Bundle bundle = new Bundle();
+ try {
+ bundle.createRepositoryIndex(null);
+ fail("createRepositoryIndex must fail in case of invalid arg.");
+ } catch (BundleException exc) {
+ // ignore exception
+ }
+ }
+ }
+
+ @Test
+ public void test_createIndexInvalidDir() throws IOException {
+ if (bundlePresent) {
+ Bundle bundle = new Bundle();
+ try {
+ File file = File.createTempFile("invalid", ".dir");
+ file.deleteOnExit();
+ bundle.createRepositoryIndex(file);
+ fail("createRepositoryIndex must fail in case of invalid arg.");
+ } catch (BundleException exc) {
+ // ignore exception
+ }
+ }
+ }
+
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestGroupStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestGroupStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.tests;
+
+import org.junit.Test;
+
+import com.nokia.helium.blocks.GroupListStreamConsumer;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests related to the GroupStreamConsumer class.
+ */
+public class TestGroupStreamConsumer {
+
+ @Test
+ public void parsingOfData() {
+ GroupListStreamConsumer consumer = new GroupListStreamConsumer();
+ consumer.consumeLine("");
+ consumer.consumeLine(" My group");
+ consumer.consumeLine(" My second group");
+ consumer.consumeLine("");
+ assertEquals(consumer.getGroups().size(), 2);
+ assertEquals(consumer.getGroups().get(0).getName(), "My group");
+ assertEquals(consumer.getGroups().get(1).getName(), "My second group");
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestRepositoryListStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestRepositoryListStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.tests;
+
+import org.junit.Test;
+
+import com.nokia.helium.blocks.RepositoryListStreamConsumer;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests related to the GroupStreamConsumer class.
+ */
+public class TestRepositoryListStreamConsumer {
+
+ @Test
+ public void parsingOfData() {
+ RepositoryListStreamConsumer consumer = new RepositoryListStreamConsumer();
+ consumer.consumeLine("1");
+ consumer.consumeLine(" Name: sbs_22");
+ consumer.consumeLine(" URI: file:///e:/repo1");
+ consumer.consumeLine("");
+ consumer.consumeLine("2");
+ consumer.consumeLine(" Name: sbs_23");
+ consumer.consumeLine(" URI: file:///e:/repo2");
+ consumer.consumeLine("");
+ assertEquals(consumer.getRepositories().size(), 2);
+ assertEquals(consumer.getRepositories().get(0).getName(), "sbs_22");
+ assertEquals(consumer.getRepositories().get(0).getId(), 1);
+ assertEquals(consumer.getRepositories().get(0).getUrl(), "file:///e:/repo1");
+ assertEquals(consumer.getRepositories().get(1).getName(), "sbs_23");
+ assertEquals(consumer.getRepositories().get(1).getId(), 2);
+ assertEquals(consumer.getRepositories().get(1).getUrl(), "file:///e:/repo2");
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestSearchStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestSearchStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.tests;
+
+import org.junit.Test;
+
+import com.nokia.helium.blocks.SearchStreamConsumer;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests related to the SearchStreamConsumer class.
+ */
+public class TestSearchStreamConsumer {
+
+ @Test
+ public void parsingOfInvalidData() {
+ SearchStreamConsumer consumer = new SearchStreamConsumer();
+ consumer.consumeLine("");
+ consumer.consumeLine("foo-bar");
+ consumer.consumeLine("bar");
+ assertEquals(consumer.getSearchResults().size(), 0);
+ }
+
+ @Test
+ public void parsingOfValidData() {
+ SearchStreamConsumer consumer = new SearchStreamConsumer();
+ consumer.consumeLine("");
+ consumer.consumeLine("foo.src - n/a");
+ consumer.consumeLine("foo-dev.src - n/a");
+ assertEquals(consumer.getSearchResults().size(), 2);
+ assertEquals(consumer.getSearchResults().get(0), "foo.src");
+ assertEquals(consumer.getSearchResults().get(1), "foo-dev.src");
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestWorkspaceListSteamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/blocks/tests/src/com/nokia/helium/blocks/tests/TestWorkspaceListSteamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.blocks.tests;
+
+import org.junit.*;
+
+import com.nokia.helium.blocks.Workspace;
+import com.nokia.helium.blocks.WorkspaceListStreamConsumer;
+
+import static org.junit.Assert.*;
+
+public class TestWorkspaceListSteamConsumer {
+
+ @Test
+ public void simpleParsing() {
+ WorkspaceListStreamConsumer consumer = new WorkspaceListStreamConsumer();
+ consumer.consumeLine("");
+ consumer.consumeLine("foo");
+ consumer.consumeLine("bar");
+ assertEquals(consumer.getWorkspaces().length, 0);
+ }
+
+ @Test
+ public void simpleWorkspaceParsing() {
+ WorkspaceListStreamConsumer consumer = new WorkspaceListStreamConsumer();
+ consumer.consumeLine("1");
+ consumer.consumeLine(" name: foobar");
+ consumer.consumeLine(" path: C:\\workspace\\foo");
+ consumer.consumeLine("");
+ assertEquals(consumer.getWorkspaces().length, 1);
+ }
+
+ @Test
+ public void realWorkspaceParsing() {
+ WorkspaceListStreamConsumer consumer = new WorkspaceListStreamConsumer();
+ consumer.consumeLine("1");
+ consumer.consumeLine(" name: foo");
+ consumer.consumeLine(" path: C:\\workspaces\\foo");
+ consumer.consumeLine("");
+ consumer.consumeLine("2*");
+ consumer.consumeLine(" name: foobar");
+ consumer.consumeLine(" path: C:\\workspaces\\tests");
+ consumer.consumeLine("");
+ Workspace[] ws = consumer.getWorkspaces();
+ assertEquals(ws.length, 2);
+ assertEquals(ws[0].getName(), "foo");
+ assertEquals(ws[0].getLocation().toString(), "C:\\workspaces\\foo");
+ assertEquals(ws[1].getName(), "foobar");
+ assertEquals(ws[1].getLocation().toString(), "C:\\workspaces\\tests");
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/ivy.xml
--- a/buildframework/helium/sf/java/core/ivy.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/ivy.xml Sun Oct 10 15:22:15 2010 +0300
@@ -36,5 +36,7 @@
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/MessageCreationException.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/MessageCreationException.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/MessageCreationException.java Sun Oct 10 15:22:15 2010 +0300
@@ -19,18 +19,26 @@
package com.nokia.helium.core;
/**
- * Exception class for Messagecreation implementation
+ * Exception class for Message creation implementation
*
*/
public class MessageCreationException extends Exception {
+ private static final long serialVersionUID = 330899302955104898L;
/**
- * Constructor
- *
- * @exception - exception to be processed.
+ * Create a MessageCreationException with an error message
+ * @param message the error message.
*/
+ public MessageCreationException(String message) {
+ super("Message Creation Error: " + message);
+ }
- public MessageCreationException(String exception) {
- super("Message Creation Error: " + exception);
+ /**
+ * Creating a MessageCreationException with a message and a cause.
+ * @param message the message
+ * @param cause the root cause
+ */
+ public MessageCreationException(String message, Throwable cause) {
+ super("Message Creation Error: " + message, cause);
}
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/HeliumLogger.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/HeliumLogger.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.helium.core.ant;
+
+import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.DefaultLogger;
+import org.apache.tools.ant.Project;
+
+/**
+ * Logger class that can connect to Ant and log information regarding to skipped
+ * targets.
+ *
+ */
+public class HeliumLogger extends DefaultLogger {
+
+ private static final String INTERNALPROPERTY = "internal.";
+ private Project project;
+
+ /**
+ * Triggered when a target starts.
+ */
+ public void targetStarted(BuildEvent event) {
+ project = event.getProject();
+
+ /** The "if" condition to test on execution. */
+ String ifCondition = event.getTarget().getIf();
+ /** The "unless" condition to test on execution. */
+ String unlessCondition = event.getTarget().getUnless();
+
+ super.targetStarted(event);
+
+ /**
+ * if the target is not going to execute (due to 'if' or 'unless'
+ * conditions) print a message telling the user why it is not going to
+ * execute
+ **/
+ if (ifCondition != null && !isPropertyAvailable(ifCondition)) {
+ if (ifCondition.startsWith(INTERNALPROPERTY)) {
+ String enableProperty = ifCondition.substring(INTERNALPROPERTY
+ .length());
+ project.log("Skipped because property '" + enableProperty
+ + "' not set to 'true'.", Project.MSG_INFO);
+ } else {
+ project.log("Skipped because property '"
+ + project.replaceProperties(ifCondition)
+ + "' is not set.", Project.MSG_INFO);
+ }
+
+ } else if (unlessCondition != null
+ && isPropertyAvailable(unlessCondition)) {
+ if (unlessCondition.startsWith(INTERNALPROPERTY)) {
+ String enableProperty = unlessCondition
+ .substring(INTERNALPROPERTY.length());
+ project.log("Skipped because property '" + enableProperty
+ + "' is set.", Project.MSG_INFO);
+ } else {
+ project.log(
+ "Skipped because property '"
+ + project.replaceProperties(unlessCondition)
+ + "' set.", Project.MSG_INFO);
+ }
+ }
+ }
+
+ /**
+ * Method to verify whether the given property is available in the project
+ * or not.
+ *
+ * @param propertyName
+ * the name of the property to verify.
+ * @return true, if the property available and is set; otherwise false.
+ */
+ private boolean isPropertyAvailable(String propertyName) {
+ return project.getProperty(project.replaceProperties(propertyName)) != null;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/ResourceCollectionUtils.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/ResourceCollectionUtils.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.core.ant;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.types.Resource;
+import org.apache.tools.ant.types.ResourceCollection;
+
+/**
+ * This utility class provides a set of functions to manipulate Ant
+ * ResourceCollection.
+ *
+ */
+public final class ResourceCollectionUtils {
+
+ /**
+ * Private constructor to make sure the class is never
+ * Instantiated.
+ */
+ private ResourceCollectionUtils() { }
+
+ /**
+ * Extract the first file form the resource collection matching the pattern.
+ * Returns null if not found.
+ * @param resourceCollection
+ * @param pattern a regular expression as a string
+ * @return the first resource matching, or null if not found
+ */
+ public static File getFile(ResourceCollection resourceCollection, String pattern) {
+ return getFile(resourceCollection, Pattern.compile(pattern));
+ }
+
+ /**
+ * Extract the first file form the resource collection matching the pattern.
+ * Returns null if not found.
+ * @param resourceCollection
+ * @param pattern a regular expression as a compile pattern
+ * @return the first resource matching, or null if not found
+ */
+ @SuppressWarnings("unchecked")
+ public static File getFile(ResourceCollection resourceCollection, Pattern pattern) {
+ Iterator ri = (Iterator)resourceCollection.iterator();
+ while (ri.hasNext()) {
+ Resource resource = ri.next();
+ if (pattern.matcher(resource.toString()).matches()) {
+ return new File(resource.toString());
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Get the ResourceCollection as a list of files.
+ * Returns null if not found.
+ * @param resourceCollection
+ * @return a list of files.
+ */
+ @SuppressWarnings("unchecked")
+ public static List getFiles(ResourceCollection resourceCollection) {
+ List files = new ArrayList();
+ Iterator ri = (Iterator)resourceCollection.iterator();
+ while (ri.hasNext()) {
+ files.add(new File(ri.next().toString()));
+ }
+ return files;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/antlib.xml
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,6 +28,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/helium.antlib.xml
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/helium.antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/helium.antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,9 +25,13 @@
Ant task definition declarations.
-
-
+
+
+
+
-
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -44,6 +44,7 @@
* </hlm:getVariableValue>
*
*
+ * @ant.task category="Core"
* @ant.task name="getVariableValue"
*/
public class GetValueFromVariableSetTask extends Task {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/ResourceAccessTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/ResourceAccessTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,195 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.helium.core.ant.taskdefs;
+
+import java.io.RandomAccessFile;
+import java.nio.channels.FileChannel;
+import java.nio.channels.FileLock;
+import java.io.File;
+import java.util.HashMap;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.taskdefs.Sequential;
+
+/**
+ * This class implements the functionality to provide sequential access of
+ * resources. Resources access could be controled by providing a unique lock name
+ * and when try to access the resource call this task with locking to true so that
+ * no other threads / process can access the same resource at the same time.
+ *
+ * Examples:
+ *
+ * <target name="locksubst">
+ * <hlm:resourceaccess lockname="subst" noOfRetry="-1">
+ * <subst/>
+ * </hlm:resourceaccess>
+ * </target>
+ *
+ * @ant.task name="resourceaccess" category="Core"
+ */
+public class ResourceAccessTask extends Sequential {
+
+ private static HashMap lockMap =
+ new HashMap();
+ private static Object mutexObject = new Object();
+ private int noOfRetry = -1;
+ private String lockName;
+ private File baseDirectory;
+ private long interval = 1000;
+ private FileLock fileLock;
+
+ /*
+ * Default Constructor
+ */
+ public ResourceAccessTask() {
+ String tempDirectory = System.getProperty("java.io.tmpdir");
+ baseDirectory = new File(tempDirectory);
+ }
+
+ /*
+ * Helper function to set the interval
+ * @param intervalValue - waiting period till to try next time.
+ */
+ public void setInterval(Long intervalValue) {
+ interval = intervalValue;
+ }
+
+ /*
+ * Helper function to retry as many times
+ * @param retry - no. of times to retry before throwing
+ * LockAccessException
+ */
+ public void setNoOfRetry(int retry) {
+ noOfRetry = retry;
+ }
+
+ /*
+ * A unique lock name for a specific task to be run
+ * sequential.
+ * @param name of the lock to do sequential task.
+ */
+ public void setLockName(String name) {
+ lockName = name;
+ }
+
+ /*
+ * Base directory for lock file creation.
+ * @param dir, directory in which the lock file to be created
+ * defaults to temporary directory.
+ */
+ public void setBaseDirectory(File dir) {
+ baseDirectory = dir;
+ }
+
+ /*
+ * Function acquires the lock on the specified lock name.
+ */
+ public void acquireLock() {
+ File file = new File(baseDirectory, lockName);
+ if (! file.exists()) {
+ FileOutputStream stream = null;
+ try {
+ stream = new FileOutputStream(file);
+ stream.write("do not edit \n lock processing".getBytes());
+ stream.close();
+ } catch (FileNotFoundException e) {
+ throw new BuildException("interrupted during waiting period");
+ } catch (IOException e) {
+ throw new BuildException("I/O exception during creating lock for file: " + file);
+ }
+ }
+ try {
+ FileChannel channel = new RandomAccessFile(new File(baseDirectory,
+ lockName), "rw").getChannel();
+ boolean lockAcquired = false;
+ int i = 0;
+ while (!lockAcquired) {
+ try {
+ synchronized (mutexObject) {
+ if (lockMap.get(lockName) == null) {
+ if ( noOfRetry != -1 && i >= noOfRetry) {
+ throw new BuildException("lock not acquired");
+ }
+ i += 1;
+ fileLock = channel.lock();
+ lockAcquired = true;
+ lockMap.put(lockName, fileLock);
+ } else {
+ if ( noOfRetry != -1 && i >= noOfRetry) {
+ throw new BuildException("lock not acquired");
+ }
+ try {
+ Thread.sleep(interval);
+ } catch (InterruptedException e) {
+ throw new BuildException("interrupted during waiting period");
+ }
+ i += 1;
+ }
+ }
+ } catch (IOException e) {
+ throw new BuildException(e.getMessage());
+ } catch (java.nio.channels.OverlappingFileLockException jex) {
+ try {
+ Thread.sleep(interval);
+ } catch (InterruptedException e) {
+ throw new BuildException("interrupted during waiting period");
+ }
+ }
+ }
+ } catch (FileNotFoundException e) {
+ throw new BuildException("interrupted during waiting period");
+ }
+ }
+
+ /*
+ * Function to release the lock.
+ */
+ public void releaseLock() {
+ try {
+ synchronized (mutexObject) {
+ FileLock fileLock = lockMap.get(lockName);
+ if (fileLock == null) {
+ throw new BuildException("releasing without trying to lock resource: " + lockName);
+ }
+ lockMap.remove(lockName);
+ fileLock.release();
+ }
+ } catch (IOException e) {
+ throw new BuildException("IOException during releasing lock");
+ }
+ }
+
+ public void execute() {
+ if (!baseDirectory.exists()) {
+ throw new BuildException("base directory of resource access task not exists");
+ }
+ if (lockName == null) {
+ throw new BuildException("lock name should not "
+ + "be null during releasing the lock");
+ }
+ acquireLock();
+ try {
+ super.execute();
+ } finally {
+ releaseLock();
+ }
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/FMPPMessage.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/FMPPMessage.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/FMPPMessage.java Sun Oct 10 15:22:15 2010 +0300
@@ -20,8 +20,8 @@
import java.io.File;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.DataType;
-import org.apache.log4j.Logger;
import fmpp.tools.AntTask;
import fmpp.tools.AntTask.AntAttributeSubstitution;
@@ -37,22 +37,19 @@
*
* Example 1:
*
- * <hlm:fmppMessage target="diamonds" sourceFile="tool.xml.ftl">
+ * <hlm:fmppMessage sourceFile="tool.xml.ftl">
* <data expandProperties="yes">
* ant: antProperties()
* </data>
* </hlm:fmppMessage>
*
+ *
* @ant.type name="fmppMessage" category="Core"
*/
public class FMPPMessage extends DataType implements Message {
- private File outputFile;
-
private AntTask task = new AntTask();
- private Logger log = Logger.getLogger(FMPPMessage.class);
-
public void setSourceFile(File sourceFile) {
if (!sourceFile.exists()) {
throw new BuildException("input file : " + sourceFile + " doesn't exists");
@@ -79,18 +76,18 @@
InputStream stream = null;
try {
task.setProject(getProject());
- outputFile = File.createTempFile("fmppmessage", ".xml");
+ File outputFile = File.createTempFile("fmppmessage", ".xml");
outputFile.deleteOnExit();
task.setTaskName("fmpp");
task.setOutputFile(outputFile);
task.execute();
- log.debug("outputfile in getinputstream: " + outputFile);
+ log("Temp output file for template rendering: " + outputFile, Project.MSG_DEBUG);
stream = new FileInputStream(outputFile);
} catch (BuildException bex) {
- throw new MessageCreationException(bex.getMessage());
+ throw new MessageCreationException(bex.getMessage(), bex);
}
catch (IOException iex) {
- throw new MessageCreationException(iex.getMessage());
+ throw new MessageCreationException(iex.getMessage(), iex);
}
return stream;
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/HelpDef.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/HelpDef.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.helium.core.ant.types;
+
+import java.util.Iterator;
+
+import org.apache.tools.ant.BuildListener;
+import org.apache.tools.ant.BuildLogger;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.core.ant.PostBuildAction;
+
+/**
+ *
+ */
+public class HelpDef extends DataType implements PostBuildAction {
+
+ /**
+ *
+ * @param project Object of the project
+ * @param targetNames Array of target names to execute
+ *
+ */
+ public void executeOnPostBuild(Project project, String[] targetNames) {
+ String firstTarget;
+ // take target
+ if (targetNames != null && targetNames.length > 0) {
+ firstTarget = targetNames[0];
+ }
+ // no target, so set the default one
+ else {
+ firstTarget = "help";
+ }
+
+ // If 'help' target is called, just run that and set other
+ // target names as a property
+ if (firstTarget.equals("help")) {
+ displayHelp(project, targetNames, firstTarget);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void displayHelp(Project project, String[] targetNames, String firstTarget) {
+ if (targetNames.length > 1) {
+ project.setProperty("help.item", targetNames[1]);
+ }
+
+ // Set Emacs mode to true for all listeners, so that help text does
+ // not have [echo] at the start of each line
+ Iterator iter = project.getBuildListeners().iterator();
+ while (iter.hasNext()) {
+ BuildListener listener = (BuildListener) iter.next();
+ if (listener instanceof BuildLogger) {
+ BuildLogger logger = (BuildLogger) listener;
+ logger.setEmacsMode(true);
+ }
+ }
+
+ // Run the 'help' target
+ project.executeTarget(firstTarget);
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/HlmListenerDef.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/HlmListenerDef.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/HlmListenerDef.java Sun Oct 10 15:22:15 2010 +0300
@@ -17,7 +17,9 @@
package com.nokia.helium.core.ant.types;
-import org.apache.log4j.Logger;
+import java.util.Vector;
+
+import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.Project;
@@ -33,22 +35,64 @@
public class HlmListenerDef extends DataType implements PreBuildAction {
private String classname;
- private Logger log = Logger.getLogger(HlmListenerDef.class);
+ private boolean preappend;
+ /**
+ * The classname of the BuildListener to instantiate and register
+ * to the project..
+ * @param preappend
+ */
public void setClassname(String classname) {
this.classname = classname;
}
-
+
+ /**
+ * Defines if the listener should be added at the end of
+ * the list or always appended at the beguining of the list
+ * just after the logger.
+ * @param preappend
+ */
+ public void setPreappend(boolean preappend) {
+ this.preappend = preappend;
+ }
+
/**
* Register given listener to the project.
*/
+ @SuppressWarnings("unchecked")
public void executeOnPreBuild(Project project, String[] targetNames) {
+ if (classname == null) {
+ throw new BuildException("classname attribute has not been defined.");
+ }
try {
Class> listenerClass = Class.forName(classname);
BuildListener listener = (BuildListener) listenerClass
.newInstance();
- project.addBuildListener(listener);
- log.debug(classname + " is registered");
+
+ if (preappend) {
+ Vector listeners = (Vector)project.getBuildListeners();
+ for (BuildListener removeListener : listeners) {
+ project.removeBuildListener(removeListener);
+ }
+ // Always add the listener as after the first element which should be
+ // the logger.
+ if (listeners.size() > 0) {
+ listeners.add(1, listener);
+ } else {
+ // this is really unlikely to happen
+ listeners.add(listener);
+ }
+ for (BuildListener addListener : listeners) {
+ project.addBuildListener(addListener);
+ }
+
+ } else {
+ project.addBuildListener(listener);
+ }
+ // Trigger that build has started under the listener,
+ // so initialization could happen.
+ listener.buildStarted(new BuildEvent(project));
+ log(classname + " is registered", Project.MSG_DEBUG);
} catch (ClassNotFoundException ex) {
throw new BuildException("Class not found exception:"
+ ex.getMessage(), ex);
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/PostBuildQualityCheckAction.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/PostBuildQualityCheckAction.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,361 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.helium.core.ant.types;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.ant.data.AntFile;
+import com.nokia.helium.ant.data.Database;
+import com.nokia.helium.ant.data.ProjectMeta;
+import com.nokia.helium.ant.data.PropertyCommentMeta;
+import com.nokia.helium.ant.data.PropertyMeta;
+import com.nokia.helium.ant.data.RootAntObjectMeta;
+import com.nokia.helium.ant.data.TargetMeta;
+import com.nokia.helium.antlint.ant.AntlintException;
+import com.nokia.helium.antlint.ant.Reporter;
+import com.nokia.helium.antlint.ant.Severity;
+import com.nokia.helium.antlint.ant.types.Check;
+import com.nokia.helium.antlint.ant.types.CheckPropertyTypeAndValueMismatch;
+import com.nokia.helium.core.ant.PostBuildAction;
+
+/**
+ * PostBuildQualityCheckAction
is run as a post build action to report user
+ * configurations related to Helium targets and properties usage.
+ *
+ *
+ * This class currently reports following :
+ *
+ * Use of deprecated Helium targets.
+ * Use of private Helium targets.
+ * Use of deprecated Helium properties.
+ * Override of private Helium properties.
+ * Invalid property types/values set for Helium properties
+ *
+ *
+ */
+public class PostBuildQualityCheckAction extends DataType implements PostBuildAction, Reporter {
+ private static final String DEPRECATED = "deprecated:";
+ private Set output = new LinkedHashSet();
+ private String heliumPath;
+ private Database publicScopeDb;
+ private Database privateScopeDb;
+
+ /**
+ * Method logs a configuration report about usage of helium targets and
+ * properties.
+ *
+ * @param project Is the Ant project.
+ * @param targetNames Is an array of target names.
+ */
+ public void executeOnPostBuild(Project project, String[] targetNames) {
+
+ if (project.getProperty("helium.dir") != null) {
+ try {
+ setHeliumPath(new File(project.getProperty("helium.dir")).getCanonicalPath());
+ publicScopeDb = new Database(project);
+ privateScopeDb = new Database(project, "private");
+
+ // Get list of targets which are called either by antcall or
+ // runtarget
+ List antCallTargets = getAntCallTargets(project);
+ checkDeprecatedHeliumTargets(antCallTargets, project);
+ checkPrivateHeliumTargets(antCallTargets, project);
+
+ // Get list of customer defined properties
+ List customerProps = getCustomerProperties(project);
+ checkInvalidProperties(customerProps, project);
+ checkOverriddenProperties(customerProps, project);
+ checkDeprecatedProperties(customerProps, project);
+
+ if (!output.isEmpty()) {
+ log("*** Configuration report ***", Project.MSG_INFO);
+ for (String outputStr : output) {
+ log(outputStr, Project.MSG_INFO);
+ }
+ }
+ } catch (IOException e) {
+ log(e.getMessage(), Project.MSG_WARN);
+ }
+ } else {
+ log("Configuration report cannot be generated because 'helium.dir' property is not defined.",
+ Project.MSG_VERBOSE);
+ }
+ }
+
+ /**
+ * Return the Helium path.
+ *
+ * @return The helium path.
+ */
+ public String getHeliumPath() {
+ return heliumPath;
+ }
+
+ /**
+ * Set helium path.
+ *
+ * @param heliumPath is the path to set
+ */
+ public void setHeliumPath(String heliumPath) {
+ this.heliumPath = heliumPath;
+ }
+
+ /**
+ * Method checks for incorrect values, set for boolean/integer type properties.
+ *
+ * @param customerProps Is a list of customer defined properties
+ * @param project Is the Ant project.
+ */
+ private void checkInvalidProperties(List customerProps, Project project) {
+ Check check = new CheckPropertyTypeAndValueMismatch();
+ check.setReporter(this);
+ check.setSeverity((Severity) Severity.getInstance(Severity.class, "warning"));
+ for (AntFile antFile : privateScopeDb.getAntFiles()) {
+ try {
+ check.setAntFile(antFile);
+ check.run();
+ } catch (AntlintException aex) {
+ log(aex.getMessage(), Project.MSG_WARN);
+ }
+ }
+ }
+
+ /**
+ * Method checks for overridden of private scope helium properties.
+ *
+ * @param customerProps A list of customer defined properties.
+ * @param project Is the Ant project.
+ */
+ private void checkOverriddenProperties(List customerProps, Project project) {
+ for (PropertyMeta propertyMeta : privateScopeDb.getProperties()) {
+ if (propertyMeta.getLocation().contains(getHeliumPath())
+ && propertyMeta.getScope().equals("private")
+ && customerProps.contains(propertyMeta.getName())) {
+ output.add("Warning: " + propertyMeta.getName() + " property has been overridden");
+ }
+ }
+ for (PropertyCommentMeta propertyCommentMeta : privateScopeDb.getCommentProperties()) {
+ if (propertyCommentMeta.getLocation().contains(getHeliumPath())
+ && propertyCommentMeta.getScope().equals("private")
+ && customerProps.contains(propertyCommentMeta.getName())) {
+ output.add("Warning: " + propertyCommentMeta.getName()
+ + " property has been overridden");
+ }
+ }
+ }
+
+ /**
+ * Method checks for use of deprecated helium properties.
+ *
+ * @param customerProps Is a list of customer defined properties.
+ * @param project Is the Ant project.
+ */
+ private void checkDeprecatedProperties(List customerProps, Project project) {
+ // check for deprecated properties
+ for (PropertyMeta propertyMeta : privateScopeDb.getProperties()) {
+ if (propertyMeta.getLocation().contains(getHeliumPath())
+ && (!propertyMeta.getDeprecated().equals(""))
+ && customerProps.contains(propertyMeta.getName())) {
+ output.add("Warning: "
+ + propertyMeta.getName()
+ + " property has been deprecated "
+ + propertyMeta.getDeprecated()
+ + "."
+ + propertyMeta.getSummary().substring(
+ propertyMeta.getSummary().lastIndexOf(DEPRECATED)
+ + DEPRECATED.length()));
+ }
+ }
+
+ for (PropertyCommentMeta propertyCommentMeta : privateScopeDb.getCommentProperties()) {
+ if (propertyCommentMeta.getLocation().contains(getHeliumPath())
+ && (!propertyCommentMeta.getDeprecated().equals(""))
+ && customerProps.contains(propertyCommentMeta.getName())) {
+ output.add("Warning: "
+ + propertyCommentMeta.getName()
+ + " property has been deprecated "
+ + propertyCommentMeta.getDeprecated()
+ + "."
+ + propertyCommentMeta.getSummary().substring(
+ propertyCommentMeta.getSummary().lastIndexOf(DEPRECATED)
+ + DEPRECATED.length()));
+ }
+ }
+ }
+
+ /**
+ * Method checks for use of deprecated helium targets.
+ *
+ * @param antCallTargets A list of targets referred by antcall/runtarget.
+ * @param project Is the Ant project
+ */
+ private void checkDeprecatedHeliumTargets(List antCallTargets, Project project) {
+ for (String targetName : antCallTargets) {
+ TargetMeta targetMeta = getHeliumTarget(targetName, publicScopeDb);
+ if (targetMeta != null && !targetMeta.getDeprecated().trim().isEmpty()) {
+ output.add("Warning: " + targetMeta.getName() + " target has been deprecated. "
+ + targetMeta.getDeprecated() + ".");
+ }
+ }
+ // check in dependencies
+ for (TargetMeta targetMeta : publicScopeDb.getTargets()) {
+ if (!targetMeta.getLocation().contains(getHeliumPath())) {
+ List dependencies = targetMeta.getDepends();
+ for (String targetName : dependencies) {
+ TargetMeta tm = getHeliumTarget(targetName, publicScopeDb);
+ if (tm != null && !tm.getDeprecated().trim().isEmpty()) {
+ output.add("Warning: " + tm.getName() + " target has been deprecated. "
+ + tm.getDeprecated() + ".");
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Method checks for the use of private helium targets.
+ *
+ * @param antCallTargets A list of targets referred by antcall/runtarget.
+ * @param project Is the Ant project.
+ */
+ private void checkPrivateHeliumTargets(List antCallTargets, Project project) {
+ for (TargetMeta targetMeta : privateScopeDb.getTargets()) {
+ if (targetMeta.getLocation().contains(getHeliumPath())
+ && targetMeta.getScope().equals("private")
+ && antCallTargets.contains(targetMeta.getName())) {
+ output.add("Warning: " + targetMeta.getName()
+ + " is private and should only be called by helium");
+ }
+ }
+ // check in dependencies
+ for (TargetMeta targetMeta : publicScopeDb.getTargets()) {
+ if (!targetMeta.getLocation().contains(getHeliumPath())) {
+ List dependencies = targetMeta.getDepends();
+ for (String targetName : dependencies) {
+ TargetMeta tm = getHeliumTarget(targetName, privateScopeDb);
+ if (tm != null && tm.getScope().equals("private")) {
+ output.add("Warning: " + tm.getName()
+ + " is private and should only be called by helium");
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Method returns a list of targets referred by antcall/runtarget.
+ *
+ * @param project Is the Ant project.
+ * @return A list of targets referred by antcall/runtarget
+ */
+ private List getAntCallTargets(Project project) {
+ List antCallTargets = new ArrayList();
+ List customerAntFiles = getCustomerAntFiles(project);
+ for (AntFile antFile : customerAntFiles) {
+ RootAntObjectMeta root = antFile.getRootObjectMeta();
+ if (root instanceof ProjectMeta) {
+ ProjectMeta projectMeta = (ProjectMeta) root;
+ List targets = projectMeta.getTargets();
+ for (TargetMeta targetMeta : targets) {
+ antCallTargets.addAll(targetMeta.getExecTargets());
+ }
+ }
+ }
+ return antCallTargets;
+ }
+
+ /**
+ * Method returns a list of customer ant files.
+ *
+ * @param project Is the Ant project.
+ * @return A list of customer ant files.
+ */
+ private List getCustomerAntFiles(Project project) {
+ List customerAntFiles = new ArrayList();
+ try {
+ for (AntFile antFile : publicScopeDb.getAntFiles()) {
+ if (!antFile.getFile().getCanonicalPath().contains(getHeliumPath())) {
+ customerAntFiles.add(antFile);
+ }
+ }
+ } catch (IOException e) {
+ log("Unable to get a list of customer ant files. " + e.getMessage(), Project.MSG_WARN);
+ }
+ return customerAntFiles;
+ }
+
+ /**
+ * Method returns a list of property names defined by customer.
+ *
+ * @param project Is the Ant project.
+ * @return A list of customer defined property names.
+ */
+ private List getCustomerProperties(Project project) {
+ List customerProps = new ArrayList();
+ List properties = publicScopeDb.getProperties();
+ for (PropertyMeta propertyMeta : properties) {
+ if (!propertyMeta.getLocation().contains(getHeliumPath())) {
+ customerProps.add(propertyMeta.getName());
+ }
+ }
+ return customerProps;
+ }
+
+ /**
+ * Method returns target meta information of the target found in helium.
+ *
+ * @param targetName Is the name of the target requested.
+ * @param db Is the database to look in for the target information.
+ * @return The requested target meta.
+ */
+ private TargetMeta getHeliumTarget(String targetName, Database db) {
+ List targetList = db.getTargets();
+ for (TargetMeta targetMeta : targetList) {
+ if (targetMeta.getLocation().contains(getHeliumPath())
+ && targetMeta.getName().equals(targetName)) {
+ return targetMeta;
+ }
+ }
+ return null;
+ }
+
+ public void open() {
+ // do nothing
+ }
+
+ public void close() {
+ // do nothing
+ }
+
+ public void report(Severity severity, String message, File filename, int lineNo) {
+ output.add("Warning: " + message);
+ }
+
+ public void setTask(Task task) {
+ // do nothing
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/ReferenceType.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/ReferenceType.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/ReferenceType.java Sun Oct 10 15:22:15 2010 +0300
@@ -18,22 +18,31 @@
package com.nokia.helium.core.ant.types;
+import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.DataType;
import org.apache.tools.ant.types.Reference;
/**
- * Helper class to force user providing a reference. It doesn't implement any
- * particular Ant interface.
+ * Helper class to force the user providing a reference.
+ * It doesn't implement any particular Ant interface.
+ *
+ * @param The type the user should provide.
*/
-public class ReferenceType extends DataType {
+public class ReferenceType extends DataType {
/**
* Returns the referenced object.
*
* @return the reference object.
*/
- public Object getReferencedObject() {
+ @SuppressWarnings("unchecked")
+ public T getReferencedObject() {
Reference reference = getRefid();
Object obj = reference.getReferencedObject(getProject());
- return obj;
+ Class clazz = (Class)getClass().getTypeParameters()[0].getBounds()[0];
+ if (clazz.isInstance(obj)) {
+ return clazz.cast(obj);
+ } else {
+ throw new BuildException("Type referenced by " + reference.getRefId() + " is not a " + clazz.getSimpleName());
+ }
}
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/Stage.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/Stage.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/Stage.java Sun Oct 10 15:22:15 2010 +0300
@@ -18,9 +18,11 @@
package com.nokia.helium.core.ant.types;
+import java.util.Hashtable;
+import java.util.Map;
+
import org.apache.tools.ant.types.DataType;
import org.apache.tools.ant.BuildException;
-import org.apache.log4j.Logger;
/**
* A Stage
is a Data type which stores Stage information.
@@ -41,24 +43,25 @@
*/
public class Stage extends DataType {
- //Default id is used as the stage name so overriding is possible.
- private Logger log = Logger.getLogger(Stage.class);
- private String stageName;
-
private String startTarget;
private String endTarget;
-
- public void setStageName(String name) {
- log.debug("stage-name:" + name);
- if (stageName != null) {
- throw new BuildException("no supported attribute stageName externally");
- }
- stageName = name;
- }
public String getStageName() {
- return stageName;
+ if (!this.isReference()) {
+ if (getProject() != null && getProject().getReferences() != null &&
+ getProject().getReferences().containsValue(this)) {
+ @SuppressWarnings("unchecked")
+ Hashtable references = (Hashtable)getProject().getReferences();
+ for (Map.Entry entry : references.entrySet()) {
+ if (entry.getValue() == this) {
+ return entry.getKey();
+ }
+ }
+ }
+ throw new BuildException("stage type can only be used as a reference at " + this.getLocation());
+ }
+ return this.getRefid().getRefId();
}
/**
* Returns the stage start target.
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/filesystem/windows/Subst.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/filesystem/windows/Subst.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.core.filesystem.windows;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+import com.nokia.helium.core.plexus.CommandBase;
+
+/**
+ * This class wrap up subst windows utility calls.
+ *
+ */
+public class Subst extends CommandBase {
+
+ /**
+ * Get the mapping between drive and the subst folder.
+ * @return
+ * @throws IOException
+ */
+ public Map getSubstDrives() throws IOException {
+ String[] args = new String[0];
+ Subst subst = new Subst();
+ SubstStreamConsumer consumer = new SubstStreamConsumer();
+ subst.execute(args, consumer);
+ return consumer.getSubstDrives();
+ }
+
+ /**
+ * Tell if a path is under a subst drive.
+ * @return
+ * @throws IOException
+ */
+ public boolean isUnderSubstDrive(File filename) throws IOException {
+ Map substDrives = getSubstDrives();
+ return substDrives.containsKey(new File(filename.getCanonicalPath().substring(0, 2)));
+ }
+
+ /**
+ * Tell if a path is under a subst drive.
+ * @return
+ * @throws IOException
+ */
+ public File getRealPath(File filename) throws IOException {
+ Map substDrives = getSubstDrives();
+ File drive = new File(filename.getAbsolutePath().substring(0, 2));
+ if (substDrives.containsKey(drive)) {
+ return new File(substDrives.get(drive), filename.getAbsolutePath().substring(3)).getAbsoluteFile();
+ } else {
+ return filename.getCanonicalFile();
+ }
+ }
+
+
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected String getExecutable() {
+ return "subst";
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void throwException(String message, Throwable t) throws IOException {
+ throw new IOException(message);
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/src/com/nokia/helium/core/filesystem/windows/SubstStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/filesystem/windows/SubstStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.core.filesystem.windows;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+/**
+ * Parse subst output.
+ *
+ */
+public class SubstStreamConsumer implements StreamConsumer {
+ private Map substDrives = new HashMap();
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void consumeLine(String line) {
+ if (line.trim().length() > 0) {
+ substDrives.put( new File(line.substring(0, 2)), new File(line.substring(8)));
+ }
+ }
+
+ /**
+ * Get the mapping between subst drive and folder.
+ * @return the mapping.
+ */
+ public Map getSubstDrives() {
+ return substDrives;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/antunit/resourceaccess/test_resourceaccess.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/antunit/resourceaccess/test_resourceaccess.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,133 @@
+
+
+
+ Helium antlib core resource access tests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/antunit/run-scenario.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/antunit/run-scenario.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,69 @@
+
+
+
+ Helium Antlib feature enabler macro.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/antunit/test_buildstatusdef.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/antunit/test_buildstatusdef.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/antunit/test_core.ant.xml
--- a/buildframework/helium/sf/java/core/tests/antunit/test_core.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/tests/antunit/test_core.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,6 +25,8 @@
Testing core targets
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/antunit/test_feature_enabled_flags.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/antunit/test_feature_enabled_flags.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,74 @@
+
+
+
+
+ Testing targets.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/antunit/test_getfreedrive.ant.xml
--- a/buildframework/helium/sf/java/core/tests/antunit/test_getfreedrive.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/tests/antunit/test_getfreedrive.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,8 +25,8 @@
Testing getFreeDrive targets
-
-
+
+
@@ -49,10 +49,10 @@
-
+
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/antunit/test_helpdef.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/antunit/test_helpdef.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/bld.sh
--- a/buildframework/helium/sf/java/core/tests/bld.sh Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/tests/bld.sh Sun Oct 10 15:22:15 2010 +0300
@@ -21,4 +21,4 @@
. ~/.bashrc
fi
-ant -Dant.executor.class="com.nokia.helium.core.ant.HeliumExecutor" $*
+ant $*
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/build.bat
--- a/buildframework/helium/sf/java/core/tests/build.bat Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/core/tests/build.bat Sun Oct 10 15:22:15 2010 +0300
@@ -21,7 +21,7 @@
set TESTED_JAVA=C:\Apps\j2sdk_1.6.0_02
) ELSE set TESTED_JAVA=%JAVA_6_HOME%
if exist %TESTED_JAVA% (set JAVA_HOME=%TESTED_JAVA%)
-call ant -Dant.executor.class=com.nokia.helium.core.ant.HeliumExecutor %*
+call ant %*
if "%ERRORLEVEL%" neq "0" (goto error)
endlocal
goto :eof
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/scenarii/bld.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/scenarii/bld.sh Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of the License "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+if [ -f ~/.bashrc ] ; then
+ . ~/.bashrc
+fi
+ant $*
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/scenarii/build.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/scenarii/build.bat Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,32 @@
+@echo off
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+setlocal
+if not defined JAVA_6_HOME (
+set TESTED_JAVA=C:\Apps\j2sdk_1.6.0_02
+) ELSE set TESTED_JAVA=%JAVA_6_HOME%
+if exist %TESTED_JAVA% (set JAVA_HOME=%TESTED_JAVA%)
+echo %ANT_ARGS%
+call ant %*
+if "%ERRORLEVEL%" neq "0" (goto error)
+endlocal
+goto :eof
+
+:error
+endlocal
+if "%OS%"=="Windows_NT" color 00
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/scenarii/config_report/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/scenarii/config_report/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,119 @@
+
+
+
+ Helium Antlib logger unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Running run-target-disabled
+
+
+
+ Running run-target-enabled
+
+
+
+ Running run-with-old-flag-enabled
+
+
+
+ Running run-with-new-flag-enabled
+
+
+
+ Running run-with-both-enabled
+
+
+
+ Running run-with-unless-enabled
+
+
+
+ Running run-with-unless-internal-enabled
+
+
+
+ Running antcall-deprecated-target
+
+
+
+
+ Running runtarget-deprecated-target
+
+
+
+
+ Running depends-deprecated-target
+
+
+
+ Running run-private-target-as-antcall
+
+
+
+
+ Running run-private-target-as-runtarget
+
+
+
+
+ Running run-private-target-as-depends
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/scenarii/config_report/feature/feature.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/scenarii/config_report/feature/feature.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,151 @@
+
+
+
+ Helium Antlib logger unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Warning: this target is deprecated, please remove it from your configuration
+
+
+
+
+ Warning: this target is deprecated, please remove it from your configuration
+
+
+
+
+ Warning: this target is deprecated, please remove it from your configuration
+
+
+
+
+ Inside private target a-private-target
+
+
+
+
+ Inside private target b-private-target
+
+
+
+
+ Inside private target c-private-target
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/scenarii/help/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/scenarii/help/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,41 @@
+
+
+
+ Helium Antlib logger unittests.
+
+
+
+Help:
+This is the documentation.
+help.item: ${help.item}
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/scenarii/property/feature.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/scenarii/property/feature.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,59 @@
+
+
+
+ Helium Antlib logger unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/scenarii/test/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/scenarii/test/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,90 @@
+
+
+
+ Helium Antlib logger unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Running run-target-disabled
+
+
+
+
+ Running run-target-enabled
+
+
+
+
+ Running run-with-old-flag-enabled
+
+
+
+
+ Running run-with-new-flag-enabled
+
+
+
+
+ Running run-with-both-enabled
+
+
+
+
+ Running run-with-unless-enabled
+
+
+
+
+ Running run-with-unless-internal-enabled
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/src/com/nokia/helium/core/ant/tests/TestResourceCollectionUtils.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/src/com/nokia/helium/core/ant/tests/TestResourceCollectionUtils.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.core.ant.tests;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.tools.ant.types.Resource;
+import org.apache.tools.ant.types.ResourceCollection;
+import org.junit.Test;
+
+import com.nokia.helium.core.ant.ResourceCollectionUtils;
+
+/**
+ * Testing the ResourceCollectionUtils utility class
+ *
+ */
+public class TestResourceCollectionUtils {
+
+ /**
+ * Simplistic ResourceCollection used by unittests.
+ */
+ class ResourceCollectionImpl implements ResourceCollection {
+
+ private List resources = new ArrayList();
+
+ private ResourceCollectionImpl(File[] files) {
+ for (File file : files) {
+ Resource res = new Resource();
+ res.setName(file.getAbsolutePath());
+ resources.add(res);
+ }
+ }
+
+ public boolean isFilesystemOnly() {
+ return true;
+ }
+
+ public Iterator iterator() {
+ return resources.iterator();
+ }
+
+ public int size() {
+ // TODO Auto-generated method stub
+ return resources.size();
+ }
+
+ }
+
+ @Test
+ public void getFile() {
+ File[] files = new File[3];
+ files[0] = new File("foo.xml");
+ files[1] = new File("foo.html");
+ files[2] = new File("foo.dat");
+ File file = ResourceCollectionUtils.getFile(new ResourceCollectionImpl(files), ".*.xml");
+ assertTrue("must find one file", file != null);
+ assertTrue("must find one file (name check)", file.getName().equals(files[0].getName()));
+ }
+
+ @Test
+ public void getFileReturnsNull() {
+ File[] files = new File[3];
+ files[0] = new File("foo.xml");
+ files[1] = new File("foo.html");
+ files[2] = new File("foo.dat");
+ File file = ResourceCollectionUtils.getFile(new ResourceCollectionImpl(files), ".*\\.ini$");
+ assertTrue("must not find a file", file == null);
+ }
+
+ @Test
+ public void getFiles() {
+ File[] files = new File[3];
+ files[0] = new File("foo.xml");
+ files[1] = new File("foo.html");
+ files[2] = new File("foo.dat");
+ List outFiles = ResourceCollectionUtils.getFiles(new ResourceCollectionImpl(files));
+ assertTrue("must not return null", outFiles != null);
+ assertTrue("size must be 3", outFiles.size() == 3);
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/core/tests/src/com/nokia/helium/core/filesystem/windows/test/TestSubstStreamConsumer.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/src/com/nokia/helium/core/filesystem/windows/test/TestSubstStreamConsumer.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.core.filesystem.windows.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.Locale;
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.nokia.helium.core.filesystem.windows.SubstStreamConsumer;
+
+public class TestSubstStreamConsumer {
+
+ /**
+ * This test should only run on windows as subst is only
+ * meaningful on that platform.
+ */
+ @Test
+ public void validateSubstOutputParsing() {
+ String osName = System.getProperty("os.name").toLowerCase(Locale.US);
+ if (osName.contains("windows")) {
+ // Setting up an Ant task
+ SubstStreamConsumer consumer = new SubstStreamConsumer();
+ consumer.consumeLine("");
+ consumer.consumeLine("I:\\: => E:\\Build_E\\buildarea\\tb92_201012");
+ consumer.consumeLine("J:\\: => E:\\Build_E\\buildarea\\tb92_201013");
+ Map substDrives = consumer.getSubstDrives();
+ assertTrue(substDrives.size() == 2);
+ assertTrue(substDrives.containsKey(new File("I:")));
+ assertTrue(substDrives.containsKey(new File("J:")));
+ assertTrue(substDrives.containsValue(new File("E:\\Build_E\\buildarea\\tb92_201012")));
+ assertTrue(substDrives.containsValue(new File("E:\\Build_E\\buildarea\\tb92_201013")));
+ }
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/AllTargetDiamondsListener.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/AllTargetDiamondsListener.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.diamonds;
-
-import java.io.BufferedWriter;
-import java.io.FileInputStream;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.Vector;
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.Target;
-
-/**
- * Generate target times
- */
-public class AllTargetDiamondsListener extends DiamondsListenerImpl {
-
- private static Logger log = Logger.getLogger(DiamondsListenerImpl.class);
-
- private Vector antTargets = new Vector();
-
-
-
-
- /**
- * Function to process logging info during begining of target execution
- *
- * @param event of target execution.
- */
- public void targetBegin(BuildEvent buildEvent) {
- antTargets.add(new AntTarget(buildEvent.getTarget()));
- }
-
- /**
- * Function to process logging info during end of target execution
- *
- * @param event of target execution.
- */
- public void targetEnd(BuildEvent buildEvent) {
- for (AntTarget at : antTargets)
- {
- if (at.equals(buildEvent.getTarget())) {
- at.setEndTime(new Date());
- }
- }
- }
-
- /**
- * Function to process logging info during end of build
- *
- * @param event of target execution.
- */
- public void buildEnd(BuildEvent buildEvent) throws DiamondsException {
- try {
- if (isInitialized()) {
- File tempFile = File.createTempFile("diamonds-targets", ".xml");
- FileWriter fstream = new FileWriter(tempFile);
- BufferedWriter out = new BufferedWriter(fstream);
- out.write("\n");
-
- for (AntTarget at : antTargets)
- {
- Calendar startcalendar = Calendar.getInstance();
- Calendar endcalendar = Calendar.getInstance();
- startcalendar.setTime(at.getStartTime());
- if (at.getEndTime() != null)
- {
- endcalendar.setTime(at.getEndTime());
- endcalendar.add(Calendar.SECOND, -5);
- if (endcalendar.after(startcalendar))
- {
- out.write("\n");
- out.write("" + at.getName() + " \n");
- out.write("" + getTimeFormat().format(at.getStartTime()) + " \n");
- out.write("" + getTimeFormat().format(at.getEndTime()) + " \n");
- out.write(" \n");
- }
- }
- }
-
- out.write(" \n");
- out.close();
- FileInputStream stream = new FileInputStream(tempFile);
- log.debug("alltargetdiamondslistener file: " + tempFile);
- mergeToFullResults(stream);
- stream.close();
- stream = new FileInputStream(tempFile);
- log.debug("diamondsclient: " + getDiamondsClient());
- log.debug("diamondsclient: " + DiamondsConfig.getBuildId());
- getDiamondsClient().sendData(stream, DiamondsConfig.getBuildId());
- }
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- }
-
- class AntTarget {
- private String targetName;
- private Date startTime;
- private Date endTime;
- private int hashCode;
-
- public AntTarget(Target target)
- {
- targetName = target.getName();
- hashCode = target.hashCode();
- startTime = new Date();
- }
- public String getName() { return targetName; }
- public Date getStartTime() { return startTime; }
- public Date getEndTime() { return endTime; }
- public void setEndTime(Date e) { endTime = e; }
- public boolean equals(Object obj) { return obj.hashCode() == hashCode; }
- public int hashCode() { return hashCode; }
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsClient.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsClient.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.diamonds;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import org.apache.commons.httpclient.HttpClient;
-import org.apache.commons.httpclient.HttpException;
-import org.apache.commons.httpclient.methods.FileRequestEntity;
-import org.apache.commons.httpclient.methods.PostMethod;
-import org.apache.commons.httpclient.methods.RequestEntity;
-import org.apache.commons.httpclient.methods.InputStreamRequestEntity;
-import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
-
-import com.nokia.helium.core.EmailDataSender;
-import com.nokia.helium.core.EmailSendException;
-
-/**
- * Diamonds client used to connect to get build id and also to send the build results
- *
- */
-public class DiamondsClient {
-
- private static final int INT_SERV_ERROR = 500;
-
- private static final int SERV_NOT_FOUND = 404;
-
- private static final int SERV_OK = 200;
-
- private boolean isRecordOnly;
-
- private Logger log = Logger.getLogger(DiamondsClient.class);
-
- private String host;
-
- private String port;
-
- private String path;
-
- private String emailID;
-
- private HttpClient httpClient;
-
- public DiamondsClient(String hst, String prt, String pth, String mailID) {
- host = hst;
- port = prt;
- path = pth;
- emailID = mailID;
- httpClient = new HttpClient();
- }
-
- private int executeMethod(PostMethod postMethod) throws DiamondsException {
- int result = 0;
- try {
- result = httpClient.executeMethod(postMethod);
- }
- catch (IOException e) {
- isRecordOnly = true;
- throw new DiamondsException("IOException while sending http request." + e.getMessage());
- // e.printStackTrace();
- }
- return result;
- }
-
- private String checkForProtocol(String url) throws DiamondsException {
- String retURL = url;
- if (!StringUtils.containsIgnoreCase(url, "http://")) {
- retURL = "http://" + url;
- }
- return retURL;
- }
-
- private String getURL() throws DiamondsException {
- return getURL(null);
- }
-
- private String getURL(String subPath) throws DiamondsException {
- String urlPath = path;
- if (subPath != null) {
- urlPath = subPath;
- }
- return checkForProtocol("http://" + host + ":" + port + urlPath);
- }
-
- private PostMethod getPostMethod(String fileName, String urlPath) {
-
- // Get the Diamonds XML-file which is to be exported
- File input = new File(fileName);
-
- // Prepare HTTP post
- PostMethod post = new PostMethod(urlPath);
-
- // Request content will be retrieved directly
- // from the input stream
-
- RequestEntity entity = new FileRequestEntity(input, "text/xml; charset=ISO-8859-1");
- post.setRequestEntity(entity);
- return post;
- }
-
- private int processPostMethodResult(int result) {
- // Log status code
- switch (result) {
- case INT_SERV_ERROR:
- // log.error("Internal server error");
- break;
- case SERV_NOT_FOUND:
- // log.error("Server not found");
- break;
- case SERV_OK:
- // log.info("Connection to diamonds server - OK");
- break;
- default:
- // log.debug("Response code: " + result);
- }
- return result;
- }
-
- public String getBuildId(InputStream stream) throws DiamondsException {
- String diamondsBuildID = null;
- PostMethod postMethod = null;
- try {
- if (!isRecordOnly) {
- String strURL = getURL();
- log.debug("strURL:" + strURL);
- postMethod = getPostMethod(stream, strURL);
- log.debug("postmethod:" + postMethod);
- int postMethodResult = httpClient.executeMethod(postMethod);
- log.debug("postmethod-result:" + postMethodResult);
-
- int result = processPostMethodResult(postMethodResult);
-
- if (result == SERV_OK) {
- // Display and save response code which functions as a id for
- // the build.
- diamondsBuildID = postMethod.getResponseBodyAsString();
- log.debug("diamondsBuildID: " + diamondsBuildID);
- }
- else {
- isRecordOnly = true;
- log.error("Diamonds data not sent, because of connection failure.");
- // throw new DiamondsException("Connection Failed");
- }
- }
- }
- catch (HttpException ex) {
- isRecordOnly = true;
- log.debug("Diamonds data not sent:s", ex);
- log.error("Diamonds data not sent: " + ex.getMessage());
- }
- catch (IOException ex) {
- isRecordOnly = true;
- log.debug("Diamonds data not sent:", ex);
- log.error("Diamonds data not sent: " + ex.getMessage());
- }
- finally {
- // Release current connection to the connection pool once you are
- // done
- if (postMethod != null) {
- postMethod.releaseConnection();
- }
- }
- return diamondsBuildID;
- }
-
- /**
- *
- * @param fileName Filename to export to Diamonds
- * @return diamonds build id
- */
- public String getBuildId(String fileName) throws DiamondsException {
- String diamondsBuildID = null;
- PostMethod postMethod = null;
-
- // Get HTTP client
- // MyHttpClient httpclient = createHttpClient();
-
- // Execute post request
- try {
- if (!isRecordOnly) {
- String strURL = getURL();
- log.debug("strURL:" + strURL);
- postMethod = getPostMethod(fileName, strURL);
- log.debug("postmethod:" + postMethod);
- int postMethodResult = httpClient.executeMethod(postMethod);
- log.debug("postmethod-result:" + postMethodResult);
-
- int result = processPostMethodResult(postMethodResult);
-
- if (result == SERV_OK) {
- // Display and save response code which functions as a id for
- // the build.
- diamondsBuildID = postMethod.getResponseBodyAsString();
- log.debug("diamondsBuildID: " + diamondsBuildID);
- }
- else {
- isRecordOnly = true;
- log.error("Diamonds data not sent, because of connection failure.");
- // throw new DiamondsException("Connection Failed");
- }
- }
- }
- catch (HttpException ex) {
- isRecordOnly = true;
- log.debug("Diamonds data not sent:s", ex);
- log.error("Diamonds data not sent: " + ex.getMessage());
- }
- catch (IOException ex) {
- isRecordOnly = true;
- log.debug("Diamonds data not sent:", ex);
- log.error("Diamonds data not sent: " + ex.getMessage());
- }
- finally {
- // Release current connection to the connection pool once you are
- // done
- if (postMethod != null) {
- postMethod.releaseConnection();
- }
- }
- return diamondsBuildID;
- }
-
- private PostMethod getPostMethod(InputStream stream, String urlPath) {
-
- // Get the Diamonds XML-file which is to be exported
- //File input = new File(fileName);
-
- // Prepare HTTP post
- PostMethod post = new PostMethod(urlPath);
-
- RequestEntity entity = new InputStreamRequestEntity(stream, "text/xml");
- post.setRequestEntity(entity);
- return post;
- }
-
- public int sendData(InputStream stream, String urlPath) {
- PostMethod postMethod = null;
- int result = -1;
- if (urlPath != null && !isRecordOnly) {
- try {
- String strURL = getURL(urlPath);
- postMethod = getPostMethod(stream, strURL);
- result = processPostMethodResult(httpClient.executeMethod(postMethod));
- }
- catch (IllegalArgumentException e) {
- // Catching this exception is needed because it is raised by httpclient
- // library if the server is under update.
- log.error("sendData:The final data via http not sent because errors:IllegalArgumentException ", e);
- }
- catch (DiamondsException e) {
- log.error("sendData:The final data via http not sent because errors:DiamondsException ", e);
- }
- catch (IOException e) {
- log.error("sendData:The final data via http not sent because errors:IOException ", e);
- }
- }
- return result;
- }
-
- public int sendData(String fileName, String urlPath) {
- PostMethod postMethod = null;
- int result = -1;
- if (urlPath != null && !isRecordOnly) {
- try {
- String strURL = getURL(urlPath);
- postMethod = getPostMethod(fileName, strURL);
- result = processPostMethodResult(httpClient.executeMethod(postMethod));
- }
- catch (IllegalArgumentException e) {
- // Catching this exception is needed because it is raised by httpclient
- // library if the server is under update.
- log.error("sendData:The final data via http not sent because errors:IllegalArgumentException ", e);
- }
- catch (DiamondsException e) {
- log.error("sendData:The final data via http not sent because errors:DiamondsException ", e);
- }
- catch (IOException e) {
- log.error("sendData:The final data via http not sent because errors:IOException ", e);
- }
- }
- return result;
- }
-
- public int sendDataByMail(String fileName, String smtpServer, String ldapServer) throws EmailSendException {
- log.debug("DiamondsClient:sendDataByEmail:emailID" + emailID);
- EmailDataSender emailSender = new EmailDataSender(emailID, smtpServer, ldapServer);
- log.debug("DiamondsClient:sendDataByEmail: " + fileName);
- emailSender.sendData("diamonds", new File(fileName), "application/xml", "[DIAMONDS_DATA]", null);
- log.debug("DiamondsClient:sendDataByEmail:succeeds");
- return 0;
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsConfig.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsConfig.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsConfig.java Sun Oct 10 15:22:15 2010 +0300
@@ -17,27 +17,13 @@
package com.nokia.helium.diamonds;
-import java.util.HashMap;
-import java.util.Map;
-import com.nokia.helium.core.ant.types.Stage;
-import com.nokia.helium.core.ant.types.TargetMessageTrigger;
import org.apache.tools.ant.Project;
-import java.util.Hashtable;
-import org.apache.log4j.Logger;
/**
- * Loads the configuration information from the xml file.
+ * Loads the configuration information from Ant project.
*
*/
public final class DiamondsConfig {
-
- private static HashMap stages = new HashMap();
-
- private static Logger log = Logger.getLogger(DiamondsConfig.class);
-
- private static String initialiserTargetName;
-
- private static Project project;
private static final String DIAMONDS_HOST_PROPERTY = "diamonds.host";
private static final String DIAMONDS_PORT_PROPERTY = "diamonds.port";
@@ -48,131 +34,71 @@
private static final String DIAMONDS_SMTP_PROPERTY = "diamonds.smtp.server";
private static final String DIAMONDS_INITIALIZER_TARGET_PROPERTY = "diamonds.initializer.targetname";
private static final String DIAMONDS_CATEGORY_PROPERTY = "diamonds.category";
-
-
+ private static final String DIAMONDS_BUILD_ID_PROPERTY = "diamonds.build.id";
private static final String[] PROPERTY_NAMES = {DIAMONDS_HOST_PROPERTY, DIAMONDS_PORT_PROPERTY, DIAMONDS_PATH_PROPERTY,
DIAMONDS_TSTAMP_PROPERTY, DIAMONDS_MAIL_PROPERTY,
DIAMONDS_LDAP_PROPERTY, DIAMONDS_SMTP_PROPERTY,
DIAMONDS_INITIALIZER_TARGET_PROPERTY, DIAMONDS_CATEGORY_PROPERTY};
-
- private static HashMap targetMessageList = new HashMap();
-
- private DiamondsConfig() {
- }
-
-
- @SuppressWarnings("unchecked")
- private static void initializeMessage(Project prj) {
- Hashtable references = prj.getReferences();
- for (String key : references.keySet()) {
- Object object = references.get(key);
- log.debug("key: " + key);
- if (object instanceof TargetMessageTrigger) {
- log.debug("found message map:" + object);
- log.debug("found key: " + key);
- TargetMessageTrigger message = (TargetMessageTrigger)object;
- targetMessageList.put(message.getTargetName(), (TargetMessageTrigger)object);
- }
+
+ private Project project;
+ private Boolean enabled;
+
+ public DiamondsConfig(Project project) throws DiamondsException {
+ this.project = project;
+ if (this.isDiamondsEnabled()) {
+ initialize();
}
}
- @SuppressWarnings("unchecked")
- public static void initialize(Project prj) throws DiamondsException {
- project = prj;
- log.debug("Diamonds config initialization: project: " + project);
- initializeMessage(prj);
- for (String property : PROPERTY_NAMES ) {
- validateProperty(property);
- }
- Hashtable references = prj.getReferences();
- for (String key : references.keySet()) {
- Object object = references.get(key);
- if (object instanceof Stage) {
- log.debug("stage found: " + key);
- Stage stageMap = (Stage)object;
- stageMap.setStageName(key);
- stages.put(key, (Stage)object);
+ private void initialize() throws DiamondsException {
+ for (String property : PROPERTY_NAMES) {
+ String propertyValue = project.getProperty(property);
+ if (propertyValue == null) {
+ throw new DiamondsException("required property: " + property + " not defined");
}
}
- }
-
- private static void validateProperty(String propertyName) throws DiamondsException {
- String propertyValue = project.getProperty(propertyName);
- if (propertyValue == null) {
- throw new DiamondsException("required property: " + propertyName + " not defined");
+ try {
+ Integer.parseInt(project.getProperty(DIAMONDS_PORT_PROPERTY));
+ } catch (NumberFormatException e) {
+ throw new DiamondsException("Invalid port number for property " +
+ DIAMONDS_PORT_PROPERTY + ": " + project.getProperty(DIAMONDS_PORT_PROPERTY));
}
}
- /**
- * Helper function to get the stages
- *
- * @return the stages from config in memory
- */
- static Map getStages() {
- return stages;
- }
-
- /**
- * Helper function to get the targets
- *
- * @return the targets from config in memory
- */
- static HashMap getTargetsMap() {
- return targetMessageList;
- }
-
- /**
- * Returns true if stages exists in config
- *
- * @return the existance of stages in config
- */
- public static boolean isStagesInConfig() {
- return !stages.isEmpty();
- }
-
- /**
- * Returns true if targets exists in config
- *
- * @return the targets from config in memory
- */
- public static boolean isTargetsInConfig() {
- return !targetMessageList.isEmpty();
- }
-
- public static String getHost() {
+ public String getHost() {
return project.getProperty(DIAMONDS_HOST_PROPERTY);
}
- public static String getPort() {
+ public String getPort() {
return project.getProperty(DIAMONDS_PORT_PROPERTY);
}
- public static String getPath() {
+ public String getPath() {
return project.getProperty(DIAMONDS_PATH_PROPERTY);
}
- public static String getTimeFormat() {
+ public String getTimeFormat() {
return project.getProperty(DIAMONDS_TSTAMP_PROPERTY);
}
- public static String getMailInfo() {
+ public String getMailInfo() {
return project.getProperty(DIAMONDS_MAIL_PROPERTY);
}
- public static String getLDAPServer() {
+ public String getLDAPServer() {
return project.getProperty(DIAMONDS_LDAP_PROPERTY);
}
- public static String getSMTPServer() {
+ public String getSMTPServer() {
return project.getProperty(DIAMONDS_SMTP_PROPERTY);
}
- public static String getBuildIdProperty() {
- return "diamonds.build.id";
+ public String getBuildIdProperty() {
+ return DIAMONDS_BUILD_ID_PROPERTY;
}
- public static String getBuildId() {
- return project.getProperty(getBuildIdProperty());
+ public String getBuildId() {
+ return project.getProperty(DIAMONDS_BUILD_ID_PROPERTY);
}
/**
@@ -180,12 +106,32 @@
*
* @return the initialiserTargetName
*/
- public static String getInitializerTargetProperty() {
- return DIAMONDS_INITIALIZER_TARGET_PROPERTY;
+ public String getInitializerTargetName() {
+ String targetName = project.getProperty(DIAMONDS_INITIALIZER_TARGET_PROPERTY);
+ if (targetName != null) {
+ if (project.getTargets().containsKey(targetName)) {
+ return targetName;
+ } else {
+ project.log("'" + DIAMONDS_INITIALIZER_TARGET_PROPERTY + "' property reference and unexisting target: " + targetName);
+ }
+ }
+ return null;
}
- public static String getCategory() {
+ public String getCategory() {
return project.getProperty(DIAMONDS_CATEGORY_PROPERTY);
}
+
+ public boolean isDiamondsEnabled() {
+ if (enabled == null) {
+ String diamondsEnabled = project.getProperty("diamonds.enabled");
+ if (diamondsEnabled != null) {
+ enabled = new Boolean(Project.toBoolean(diamondsEnabled));
+ } else {
+ enabled = Boolean.TRUE;
+ }
+ }
+ return enabled.booleanValue();
+ }
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsException.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsException.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsException.java Sun Oct 10 15:22:15 2010 +0300
@@ -27,12 +27,19 @@
private static final long serialVersionUID = 8743300713686555395L;
/**
- * Constructor
- *
- * @exception - exception to be processed.
+ * Diamonds exception with error message.
+ * @param message the error message.
*/
+ public DiamondsException(String message) {
+ super(message);
+ }
- public DiamondsException(String exception) {
- super(exception);
+ /**
+ * Diamonds exception with error message and a root cause
+ * @param message the error message
+ * @param cause the root cause
+ */
+ public DiamondsException(String message, Throwable cause) {
+ super(message, cause);
}
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsExceptionStatusUpdate.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsExceptionStatusUpdate.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: To update the build status to Diamonds with signals in case of build exceptions.
- *
- */
-
-package com.nokia.helium.diamonds;
-
-import java.text.SimpleDateFormat;
-import org.apache.tools.ant.types.DataType;
-import java.util.Hashtable;
-import java.util.Vector;
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.Project;
-import com.nokia.helium.core.ant.HlmExceptionHandler;
-import com.nokia.helium.signal.SignalStatus;
-import com.nokia.helium.signal.SignalStatusList;
-
-
-/**
- * Class to store the builds status and check the signal is present in the deferred signal list.
- * if so get the signal informations like signal name, error message and target name.
- * With collected signal information and build status send the generated XML file to diamonds client class
- * to update the information into diamonds
- */
-public class DiamondsExceptionStatusUpdate extends DataType implements HlmExceptionHandler {
- private Logger log = Logger.getLogger(DiamondsExceptionStatusUpdate.class);
-
- /* Initiate build status to failed as this method will be invoked in case of exceptions only */
- private String buildStatus = "failed";
-
- private SimpleDateFormat timeFormat;
-
- private Hashtable signalInformation = new Hashtable();
-
- private String outputFile,templateFile;
-
-
- /**
- * Implements the Exception method to update build status and signal information to diamonds.
- * @param project
- * @param module
- * @param e
- */
- @SuppressWarnings("unchecked")
- public void handleException(Project project, Exception e) {
- Project prj = DiamondsListenerImpl.getProject();
-
- try {
- if (DiamondsListenerImpl.isInitialized()) {
- if (SignalStatusList.getDeferredSignalList().hasSignalInList()) {
- Vector signalList = SignalStatusList.getDeferredSignalList().getSignalStatusList();
- timeFormat = new SimpleDateFormat(DiamondsConfig.getTimeFormat());
- log.debug("Build Status = " + buildStatus);
- int i = 0;
- for (SignalStatus status : signalList) {
- prj.setProperty("diamond.signal.name." + i, status.getName());
- prj.setProperty("diamond.error.message." + i, status.getName());
- prj.setProperty("diamond.time.stamp." + i, new String(timeFormat.format(status.getTimestamp())));
- DiamondsListenerImpl.sendMessage("diamonds-signal");
- }
- }
- if (SignalStatusList.getNowSignalList().hasSignalInList()) {
- Vector signalList = SignalStatusList.getNowSignalList().getSignalStatusList();
- buildStatus = "failed";
- timeFormat = new SimpleDateFormat(DiamondsConfig.getTimeFormat());
- log.debug("Build Status = " + buildStatus);
- int i = 0;
- for (SignalStatus status : signalList) {
- prj.setProperty("diamond.signal.name." + i, status.getName());
- prj.setProperty("diamond.error.message." + i, status.getMessage());
- prj.setProperty("diamond.time.stamp." + i,new String(timeFormat.format(status.getTimestamp())));
- i += 1;
- }
- DiamondsListenerImpl.sendMessage("diamonds.signal.message");
- }
- prj.setProperty("build.status", buildStatus);
- DiamondsListenerImpl.sendMessage("diamonds.status.message");
- }
- } catch (DiamondsException dex) {
- log.debug("exception: ", dex);
- }
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsListener.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsListener.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -19,18 +19,23 @@
import org.apache.tools.ant.BuildEvent;
+import com.nokia.helium.diamonds.ant.Listener;
+
/**
* Diamonds specific Listener interface.
*
*/
public interface DiamondsListener {
+
+ void configure(Listener listener) throws DiamondsException;
+
/**
* Function to process logging info during beginning of target execution
*
* @param event
* of target execution.
*/
- void targetBegin(BuildEvent buildEvent) throws DiamondsException;
+ void targetStarted(BuildEvent buildEvent) throws DiamondsException;
/**
* Function to process logging info during end of target execution
@@ -38,7 +43,7 @@
* @param event
* of target execution.
*/
- void targetEnd(BuildEvent buildEvent) throws DiamondsException;
+ void targetFinished(BuildEvent buildEvent) throws DiamondsException;
/**
* Function to process logging info during beginning of build
@@ -46,7 +51,7 @@
* @param event
* of target execution.
*/
- void buildBegin(BuildEvent buildEvent) throws DiamondsException;
+ void buildStarted(BuildEvent buildEvent) throws DiamondsException;
/**
* Function to process logging info during end of build
@@ -54,5 +59,5 @@
* @param event
* of target execution.
*/
- void buildEnd(BuildEvent buildEvent) throws DiamondsException;
+ void buildFinished(BuildEvent buildEvent) throws DiamondsException;
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsListenerImpl.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsListenerImpl.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.diamonds;
-
-import org.apache.tools.ant.BuildEvent;
-
-import org.apache.tools.ant.Project;
-import java.util.Date;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import org.apache.log4j.Logger;
-import com.nokia.helium.core.EmailSendException;
-import com.nokia.helium.core.ant.Message;
-import com.nokia.helium.core.MessageCreationException;
-import com.nokia.helium.diamonds.XMLMerger.XMLMergerException;
-import java.io.InputStream;
-
-/**
- * Base diamonds logger implementation. The common implementation like initialization done here and
- * used by sub classes.
- */
-public class DiamondsListenerImpl implements DiamondsListener {
-
- private static ArrayList finalStreamList = new ArrayList();
-
- private static DiamondsClient diamondsClient;
-
- private static boolean isInitialized;
-
- private static ArrayList deferLogList = new ArrayList();
-
- private static Logger log = Logger.getLogger(DiamondsListenerImpl.class);
-
- private static Project project;
-
- private static Object mutexObject = new Object();;
-
- private static SimpleDateFormat timeFormat;
-
- /**
- * Default constructor
- */
- public DiamondsListenerImpl() {
- }
-
- public static void initialize(Project prj) {
- project = prj;
- log.debug("buildbegin:" + project);
- Date date = new Date();
- timeFormat = new SimpleDateFormat(DiamondsConfig.getTimeFormat());
- log.debug("build.start.time:" + date);
- project.setProperty("build.start.time", timeFormat.format(date));
- }
-
- /**
- * Function to process logging info during end of build
- *
- * @param event of target execution.
- */
- public final void buildBegin(BuildEvent buildEvent) throws DiamondsException {
- }
-
- /**
- * Function to process logging info during end of build
- *
- * @param event of target execution.
- */
- @SuppressWarnings("unchecked")
- public void buildEnd(BuildEvent buildEvent) throws DiamondsException {
- log.debug("build end: " + isInitialized());
- if (isInitialized()) {
- project.setProperty("build.end.time", timeFormat.format(new Date()));
- sendMessage("final.message");
- isInitialized = false;
- InputStream first = finalStreamList.remove(0);
- try {
- //printStreamContent(first);
- File fullResultsFile = File.createTempFile("diamonds-full-results", ".xml");
- XMLMerger merger = new XMLMerger(first, fullResultsFile);
- String smtpServer = DiamondsConfig.getSMTPServer();
- String ldapServer = DiamondsConfig.getLDAPServer();
- for (InputStream stream : finalStreamList) {
- try {
- merger.merge(stream);
- }
- catch (XMLMerger.XMLMergerException xe) {
- log.debug("Error during the merge: ", xe);
- }
- }
- diamondsClient.sendDataByMail(fullResultsFile.getAbsolutePath(), smtpServer, ldapServer);
- } catch (EmailSendException ese) {
- log.warn("Error occured while sending mail: " + ese.getMessage());
-
- } catch (IOException e) {
- log.error("Error sending diamonds final log: IOException", e);
- }
- catch (XMLMergerException e) {
- log.error("Error sending diamonds final log: XMLMergerException ", e);
- }
- }
- }
-
- /**
- * Function to process logging info during begining of target execution
- *
- * @param event of target execution.
- */
- public void targetBegin(BuildEvent buildEvent) throws DiamondsException {
- initDiamondsClient();
- }
-
- /**
- * Function to process logging info during end of target execution
- *
- * @param event of target execution.
- */
- public void targetEnd(BuildEvent buildEvent) throws DiamondsException {
- }
-
- /**
- * returns true if diamonds is already initialized for the build.
- *
- * @param true diamonds initialized otherwise false.
- */
- public static boolean isInitialized() {
- return isInitialized;
- }
-
- public static void mergeToFullResults(InputStream stream) throws DiamondsException {
- finalStreamList.add(stream);
- }
-
-
- /**
- * Helper function to return the default project passed to messages.
- */
- static Project getProject() {
- return project;
- }
-
-
-
- protected DiamondsClient getDiamondsClient() {
- return diamondsClient;
- }
-
-
- protected boolean getIsInitialized() {
- return isInitialized;
- }
-
- protected static SimpleDateFormat getTimeFormat() {
- return timeFormat;
- }
-
- protected ArrayList getDeferLogList() {
- return deferLogList;
- }
-
- protected static File streamToTempFile(InputStream stream) throws IOException {
- File temp = File.createTempFile("diamonds", "xml");
- FileOutputStream out = new FileOutputStream(temp);
- int read = 0;
- byte[] bytes = new byte[1024];
-
- while ((read = stream.read(bytes)) != -1) {
- out.write(bytes, 0, read);
- }
- out.flush();
- out.close();
- stream.close();
- return temp;
- }
-
- private static void sendMessage(Message message, String buildID) throws DiamondsException {
- try {
- File tempFile = streamToTempFile(message.getInputStream());
- tempFile.deleteOnExit();
- if (buildID == null) {
- buildID = diamondsClient.getBuildId(new FileInputStream(tempFile));
- if (buildID != null) {
- project.setProperty(DiamondsConfig.getBuildIdProperty(), buildID);
- log.info("got Build ID from diamonds:" + buildID);
- }
- } else {
- diamondsClient.sendData(new FileInputStream(tempFile), buildID);
- }
- mergeToFullResults(new FileInputStream(tempFile));
- } catch (IOException iex) {
- log.debug("IOException while retriving message:", iex);
- throw new DiamondsException("IOException while retriving message");
- }
- catch (MessageCreationException mex) {
- log.debug("IOException while retriving message:", mex);
- throw new DiamondsException("error during message retrival");
- }
- }
-
- /**
- * Send message to diamonds.
- * @param messageId - id to look from in the ant config and to send it to diamonds.
- * id is pointing to an fmpp message.
- */
- public static void sendMessage(String messageId) throws DiamondsException {
- log.debug("send-message:" + messageId);
- synchronized (mutexObject) {
- String buildID = project.getProperty(DiamondsConfig.getBuildIdProperty());
- Object obj = project.getReference(messageId);
- if (obj != null) {
- if (obj instanceof Message) {
- sendMessage((Message)obj, buildID);
- }
- } else {
- log.debug("Message not sent for message id: " + messageId);
- }
- }
- }
-
- /**
- * Initializes the diamonds client and sends the initial data
- */
- @SuppressWarnings("unchecked")
- protected void initDiamondsClient() throws DiamondsException {
- if (!isInitialized) {
- diamondsClient = new DiamondsClient(DiamondsConfig.getHost(),
- DiamondsConfig.getPort(),
- DiamondsConfig.getPath(),
- DiamondsConfig.getMailInfo());
- String buildID = project.getProperty(DiamondsConfig.getBuildIdProperty());
- if (buildID == null ) {
- sendMessage("initial.message");
- }
- isInitialized = true;
- }
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsPostBuildStatusUpdate.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsPostBuildStatusUpdate.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: To update the build status to Diamonds with signals in case of build exceptions.
- *
- */
-
-package com.nokia.helium.diamonds;
-
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.Project;
-import com.nokia.helium.core.ant.PostBuildAction;
-
-/**
- * Class to store the builds status and send the generated XML file to diamonds client class to
- * update the build status into diamonds
- */
-public class DiamondsPostBuildStatusUpdate extends DataType implements PostBuildAction {
- private Logger log;
-
- /* Initiate build status to failed as this method will be invoked in case of exceptions only */
- private String buildStatus = "succeeded";
-
- private String outputFile, templateFile;
-
-
- public DiamondsPostBuildStatusUpdate() {
- log = Logger.getLogger(DiamondsPostBuildStatusUpdate.class);
- }
-
- /**
- * Override execute method to update build status to diamonds.
- *
- * @param prj
- * @param module
- * @param targetNames
- */
- @SuppressWarnings("unchecked")
- public void executeOnPostBuild(Project project, String[] targetNames) {
- try {
- if (DiamondsListenerImpl.isInitialized()) {
- Project prj = DiamondsListenerImpl.getProject();
- prj.setProperty("build.status", buildStatus);
- DiamondsListenerImpl.sendMessage("diamonds-status");
- }
- } catch (DiamondsException de) {
- log.error("Not able to merge into full results XML file " + de.getMessage(), de);
- }
- }
-
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsSession.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsSession.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: To update the build status to Diamonds with signals in case of build exceptions.
+ *
+ */
+package com.nokia.helium.diamonds;
+
+import com.nokia.helium.core.ant.Message;
+
+/**
+ * Defines the interface needed to communicated with Diamonds.
+ *
+ */
+public interface DiamondsSession {
+
+ /**
+ * Open the session, using custom message.
+ * @param message
+ * @throws DiamondsException if the opening failed.
+ */
+ void open(Message message) throws DiamondsException;
+
+ /**
+ * Close the session using a custom message.
+ * @param message
+ * @throws DiamondsException if the session is not opened
+ */
+ void close(Message message) throws DiamondsException;
+
+ /**
+ * Sending a custom message.
+ *
+ * @param message
+ * @throws DiamondsException if the session is not opened
+ */
+ void send(Message message) throws DiamondsException;
+
+ /**
+ * Returns true if the session to diamonds has been opened successfully.
+ * @return
+ */
+ boolean isOpen();
+
+ /**
+ * Returns the build id as a string, or null if session is not yet
+ * open, or opening failed.
+ * @return the build id.
+ */
+ String getBuildId();
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsSessionSocket.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsSessionSocket.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,234 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: To update the build status to Diamonds with signals in case of build exceptions.
+ *
+ */
+package com.nokia.helium.diamonds;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.methods.FileRequestEntity;
+import org.apache.commons.httpclient.methods.PostMethod;
+
+import com.nokia.helium.core.EmailDataSender;
+import com.nokia.helium.core.EmailSendException;
+import com.nokia.helium.core.MessageCreationException;
+import com.nokia.helium.core.ant.Message;
+import com.nokia.helium.diamonds.XMLMerger.XMLMergerException;
+
+/**
+ * This class implements the DiamondsSession interface. The implementation
+ * is based on TCP/IP socket communication.
+ *
+ */
+public class DiamondsSessionSocket implements DiamondsSession {
+
+ private List messages = new ArrayList();
+ private String buildId;
+ private HttpClient httpClient = new HttpClient();
+ private URL url;
+ private String email;
+ private String smtpServer;
+ private String ldapServer;
+
+ /**
+ * Create a new session instance. The session needs to be opened.
+ * @param url the diamonds base url
+ * @param email the diamonds email address where to send merged results
+ * @param smtpServer the address of the SMTP server.
+ * @param ldapServer the url of the LDAP server.
+ */
+ public DiamondsSessionSocket(URL url, String email, String smtpServer, String ldapServer) {
+ this.url = url;
+ this.email = email;
+ this.smtpServer = smtpServer;
+ this.ldapServer = ldapServer;
+ }
+
+ /**
+ * Create a new session instance based on an already existing build id
+ * @param url the diamonds base url
+ * @param email the diamonds email address where to send merged results
+ * @param smtpServer the address of the SMTP server.
+ * @param ldapServer the url of the LDAP server.
+ * @param buildId diamonds build id
+ */
+ public DiamondsSessionSocket(URL url, String email, String smtpServer, String ldapServer, String buildId) {
+ this.url = url;
+ this.email = email;
+ this.smtpServer = smtpServer;
+ this.ldapServer = ldapServer;
+ this.buildId = buildId;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public synchronized void open(Message message) throws DiamondsException {
+ if (!isOpen()) {
+ buildId = sendInternal(message, false);
+ } else {
+ throw new DiamondsException("Diamonds session is already open.");
+ }
+ }
+
+ /**
+ * Internal method to send data to diamonds.
+ * If ignore result is true, then the method will return null, else the message return by the query
+ * will be returned.
+ * @param message
+ * @param ignoreResult
+ * @return
+ * @throws DiamondsException is thrown in case of message retrieval error, connection error.
+ */
+ protected synchronized String sendInternal(Message message, boolean ignoreResult) throws DiamondsException {
+ URL destURL = url;
+ if (buildId != null) {
+ try {
+ destURL = new URL(url.getProtocol(), url.getHost(), url.getPort(), buildId);
+ } catch (MalformedURLException e) {
+ throw new DiamondsException("Error generating the url to send the message: " + e.getMessage(), e);
+ }
+ }
+ PostMethod post = new PostMethod(destURL.toExternalForm());
+ try {
+ File tempFile = streamToTempFile(message.getInputStream());
+ tempFile.deleteOnExit();
+ messages.add(tempFile);
+ post.setRequestEntity(new FileRequestEntity(tempFile, "text/xml"));
+ } catch (MessageCreationException e) {
+ throw new DiamondsException("Error retrieving the message: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new DiamondsException("Error serializing the message into a temporary file: " + e.getMessage(), e);
+ }
+ try {
+ int result = httpClient.executeMethod(post);
+ if (result != HttpStatus.SC_OK && result != HttpStatus.SC_ACCEPTED) {
+ throw new DiamondsException("Error sending the message: " + post.getStatusLine() +
+ "(" + post.getResponseBodyAsString() + ")");
+ }
+ if (!ignoreResult) {
+ return post.getResponseBodyAsString();
+ }
+ } catch (HttpException e) {
+ throw new DiamondsException("Error sending the message: " + e.getMessage(), e);
+ } catch (IOException e) {
+ throw new DiamondsException("Error sending the message: " + e.getMessage(), e);
+ } finally {
+ post.releaseConnection();
+ }
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public synchronized void send(Message message) throws DiamondsException {
+ if (isOpen()) {
+ sendInternal(message, true);
+ } else {
+ throw new DiamondsException("Diamonds session is not opened.");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public synchronized void close(Message message) throws DiamondsException {
+ if (isOpen()) {
+ sendInternal(message, true);
+ buildId = null;
+
+ if (!messages.isEmpty()) {
+ // Sending the data via email.
+ String mergingErrors = null;
+ File firstFile = messages.remove(0);
+ try {
+ File fullResultsFile = File.createTempFile("diamonds-full-results", ".xml");
+ XMLMerger merger = new XMLMerger(new FileInputStream(firstFile), fullResultsFile);
+ for (File file : messages) {
+ try {
+ merger.merge(new FileInputStream(file));
+ } catch (XMLMerger.XMLMergerException xe) {
+ mergingErrors = mergingErrors == null ? xe.getMessage() :
+ mergingErrors + "\n" + xe.getMessage();
+ }
+ }
+ EmailDataSender emailSender = new EmailDataSender(email, smtpServer, ldapServer);
+ emailSender.sendData("diamonds", fullResultsFile, "application/xml", "[DIAMONDS_DATA]", null);
+ } catch (IOException e) {
+ throw new DiamondsException("Error while merging the xml files: " + e.getMessage(), e);
+ } catch (XMLMergerException e) {
+ throw new DiamondsException("Error while merging the xml files: " + e.getMessage(), e);
+ } catch (EmailSendException e) {
+ throw new DiamondsException("Error occured while sending mail: " + e.getMessage(), e);
+ }
+ if (mergingErrors != null) {
+ throw new DiamondsException("Error occured while sending mail: " + mergingErrors);
+ }
+ }
+
+ } else {
+ throw new DiamondsException("Diamonds session is not opened.");
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isOpen() {
+ return getBuildId() != null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getBuildId() {
+ return buildId;
+ }
+
+ /**
+ * Write the content of an inputstream into a temp file. Deletion of the file
+ * has to be made by the caller.
+ * @param stream the input stream
+ * @return the temp file created.
+ */
+ protected static File streamToTempFile(InputStream stream) throws IOException {
+ File temp = File.createTempFile("diamonds", "xml");
+ FileOutputStream out = new FileOutputStream(temp);
+ int read = 0;
+ byte[] bytes = new byte[1024];
+
+ while ((read = stream.read(bytes)) != -1) {
+ out.write(bytes, 0, read);
+ }
+ out.flush();
+ out.close();
+ stream.close();
+ return temp;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsStatusUpdate.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsStatusUpdate.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,135 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: To update the build status to Diamonds with signals in case of build exceptions.
+ *
+ */
+
+package com.nokia.helium.diamonds;
+
+import java.text.SimpleDateFormat;
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.Project;
+import com.nokia.helium.core.ant.HlmExceptionHandler;
+import com.nokia.helium.core.ant.Message;
+import com.nokia.helium.core.ant.PostBuildAction;
+import com.nokia.helium.diamonds.ant.Listener;
+import com.nokia.helium.signal.ant.SignalStatus;
+import com.nokia.helium.signal.ant.Signals;
+
+
+/**
+ * Class to store the builds status and check the signal is present in the deferred signal list.
+ * if so get the signal informations like signal name, error message and target name.
+ * With collected signal information and build status send the generated XML file to diamonds client class
+ * to update the information into diamonds
+ *
+ * @ant.type name="diamondsStatusUpdate" category="diamonds"
+ */
+public class DiamondsStatusUpdate extends DataType implements HlmExceptionHandler, PostBuildAction {
+ private static final String BUILD_SIGNAL_MESSAGE_REFERENCE_ID = "diamonds.signal.message";
+ private static final String BUILD_STATUS_MESSAGE_REFERENCE_ID = "diamonds.status.message";
+ private static final String BUILD_STATUS_PROPERTY = "build.status";
+ private String buildStatus = "succedded";
+
+ /**
+ * Implements the Exception method to update build status and signal information to diamonds.
+ * @param project
+ * @param module
+ * @param e
+ */
+ public void handleException(Project project, Exception e) {
+ buildStatus = "failed";
+ Listener listener = Listener.getDiamondsListener(project);
+ if (listener != null && listener.getConfiguration() != null &&
+ listener.getSession() != null && listener.getSession().isOpen()) {
+ try {
+ log("Build Status = " + buildStatus, Project.MSG_DEBUG);
+ project.setProperty(BUILD_STATUS_PROPERTY, buildStatus);
+ sendMessage(listener, BUILD_STATUS_MESSAGE_REFERENCE_ID);
+ } catch (DiamondsException dex) {
+ log(dex.getMessage(), Project.MSG_WARN);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void executeOnPostBuild(Project project, String[] targetNames) {
+ Listener listener = Listener.getDiamondsListener(project);
+ if (listener != null && listener.getSession() != null && listener.getSession().isOpen()) {
+ try {
+ // Sending the signal data on post build, as they have already been raised.
+ sendSignals(listener);
+ log("Build Status = " + buildStatus, Project.MSG_DEBUG);
+ project.setProperty(BUILD_STATUS_PROPERTY, buildStatus);
+ sendMessage(listener, BUILD_STATUS_MESSAGE_REFERENCE_ID);
+ } catch (DiamondsException de) {
+ log("Not able to merge into full results XML file " + de.getMessage(), Project.MSG_WARN);
+ }
+ }
+ }
+
+ /**
+ * Send a message.
+ * @param listener the diamonds listener
+ * @param the messageId a reference string to a Message instance.
+ */
+ protected void sendMessage(Listener listener, String messageId) throws DiamondsException {
+ Object object = listener.getProject().getReference(messageId);
+ if (object != null
+ && object instanceof Message) {
+ listener.getSession().send((Message)object);
+ }
+ }
+
+ /**
+ * Sending signal information to diamonds
+ * @param project the root project instance
+ * @param listener the diamonds listener.
+ * @return
+ */
+ protected void sendSignals(Listener listener) {
+ Project project = listener.getProject();
+ try {
+ SimpleDateFormat timeFormat = new SimpleDateFormat(listener.getConfiguration().getTimeFormat());
+ int i = 0;
+ if (!Signals.getSignals().getDeferredSignalList().isEmpty()) {
+ buildStatus = "failed";
+ for (SignalStatus status : Signals.getSignals().getDeferredSignalList()) {
+ project.setProperty("diamond.signal.name." + i, status.getName());
+ project.setProperty("diamond.error.message." + i, status.getMessage());
+ project.setProperty("diamond.time.stamp." + i, new String(timeFormat.format(status.getTimestamp())));
+ i += 1;
+ }
+ }
+ if (!Signals.getSignals().getNowSignalList().isEmpty()) {
+ buildStatus = "failed";
+ for (SignalStatus status : Signals.getSignals().getNowSignalList()) {
+ project.setProperty("diamond.signal.name." + i, status.getName());
+ project.setProperty("diamond.error.message." + i, status.getMessage());
+ project.setProperty("diamond.time.stamp." + i,new String(timeFormat.format(status.getTimestamp())));
+ i += 1;
+ }
+ }
+ // At list one signal has been found, let's send the message.
+ if (i > 0) {
+ sendMessage(listener, BUILD_SIGNAL_MESSAGE_REFERENCE_ID);
+ }
+ } catch (DiamondsException dex) {
+ log(dex.getMessage(), Project.MSG_WARN);
+ }
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/StageDiamondsListener.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/StageDiamondsListener.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.diamonds;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import com.nokia.helium.core.ant.types.Stage;
-
-/**
- * Diamonds client used to connect to get build id and also to send the build results
- *
- */
-public class StageDiamondsListener extends DiamondsListenerImpl {
-
- private static final Date INVALID_DATE = new Date(-1);
-
- private static Object mutexObject = new Object();;
-
- private Logger log = Logger.getLogger(StageDiamondsListener.class);
-
- private List> stageTargetBeginList = new ArrayList>();
-
- private Map> stageTargetEndMap = new HashMap>();
-
- private Map stageStartTargetMap = new HashMap();
-
- private Map stageStartTargetTimeMap = new HashMap();
-
- private boolean isTargetMapInitialized;
-
- private Map stages;
-
-
- public StageDiamondsListener() {
- stages = DiamondsConfig.getStages();
- }
-
- public void targetBegin(BuildEvent buildEvent) throws DiamondsException {
- initDiamondsClient();
- Project projectInStage = buildEvent.getProject();
- int hashCode = projectInStage.hashCode();
- String targetName = buildEvent.getTarget().getName();
- if (!isTargetMapInitialized && stages != null) {
- log.debug("diamonds:StageDiamondsListener: initializing for all stages.");
- initStageTargetsMap(projectInStage);
- isTargetMapInitialized = true;
- }
- String targetNameWithHashCode = targetName + "-" + hashCode;
- log.debug("targetBegin: targetNameWithHashCode: " + targetNameWithHashCode);
- log.debug("targetBegin targetName: " + targetName + " - currentStartTargetName:"
- + stageStartTargetMap.get(targetNameWithHashCode));
- if (stageStartTargetMap.get(targetNameWithHashCode) == null) {
- log.debug("looking for start target match and associating time to it");
- findAndSetStartTimeForTargetInStageList(targetName, targetNameWithHashCode);
- }
- }
-
- private Date getStartTime(Stage stage) {
- String startTargetName = stage.getStartTarget();
- for (Iterator> listIter = stageTargetBeginList.iterator(); listIter.hasNext();) {
- Map stageMap = listIter.next();
- if (stageMap.get(startTargetName) != null) {
- Set targetSet = stageMap.keySet();
- for (String key : targetSet) {
- log.debug("key: " + key);
- Date time = stageMap.get(key);
- log.debug("time: " + time);
- if (time != INVALID_DATE) {
- return time;
- }
- }
- }
- }
- throw new BuildException("No time recorded " + "for stage:" + stage.getStageName());
- }
-
- private void sendStageInfo(String targetName, int hashCode) throws DiamondsException {
- List stageList = stageTargetEndMap.get(targetName);
- synchronized (mutexObject) {
- if (stageList != null) {
- for (Stage stage : stageList) {
- if (stage != null) {
- log.debug("stage.name: " + stage.getStageName());
- log.debug("stage.start target name: " + stage.getStartTarget());
- String currentStageTargetName = stageStartTargetMap.get(stage.getStartTarget()
- + "-" + hashCode);
- log.debug("getStageBasedOnEndTarget: currentStargetTargetName" + currentStageTargetName);
- if (currentStageTargetName != null) {
- log.debug("stage in targetend: " + stage);
- if (stage != null && getIsInitialized()) {
- //initDiamondsClient();
- String stageName = stage.getStageName();
- log.debug("stageName in targetend: " + stageName);
- String stageMessage = stageName + ".id";
- sendMessage(stageMessage);
- Date startTime = getStartTime(stage);
- getProject().setProperty("logical.stage", stageName);
- getProject().setProperty("stage.start.time", getTimeFormat().format(startTime));
- getProject().setProperty("stage.end.time", getTimeFormat().format(new Date()));
- sendMessage("stage.time.message");
- }
- }
- }
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- public void targetEnd(BuildEvent buildEvent) throws DiamondsException {
- String targetName = buildEvent.getTarget().getName();
- Project prj = buildEvent.getProject();
- int hashCode = prj.hashCode();
- String targetNameWithHashCode = targetName + "-" + hashCode;
- log.debug("targetEnd: targetNamewith-hashcode: " + targetNameWithHashCode);
- sendStageInfo(targetName, hashCode);
- }
-
- private void findAndSetStartTimeForTargetInStageList(String targetName,
- String targetNameWithHashCode) throws DiamondsException {
- for (Iterator> listIter = stageTargetBeginList.iterator(); listIter.hasNext();) {
- Map stageMap = listIter.next();
- Date targetTime = stageMap.get(targetName);
- if (targetTime != null && targetTime.equals(INVALID_DATE)) {
- log.debug("diamonds:StageDiamondsListener: started recording for stage-target-----: "
- + targetName);
- log.debug("findtime: targetNamewith-hashcode: " + targetNameWithHashCode);
- log.debug("findtime: time: " + new Date());
- stageMap.put(targetName, new Date());
- stageStartTargetMap.put(targetNameWithHashCode, targetName);
- stageStartTargetTimeMap.put(targetNameWithHashCode, new Date());
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private void initStageTargetsMap(Project projectInStage) {
- for (String key : stages.keySet()) {
- Stage stage = stages.get(key);
- String startTargetName = stage.getStartTarget();
- Map stageMap = new LinkedHashMap();
- Vector arrayList = null;
- try {
- arrayList = projectInStage.topoSort(startTargetName, projectInStage.getTargets(), false);
- }
- catch (BuildException be) {
- log.debug("Diamonds target missing: ", be);
- }
- if (arrayList != null) {
- log.debug(" + Stage definition: " + stage.getStageName());
- Enumeration targetEnum = arrayList.elements();
- while (targetEnum.hasMoreElements()) {
- // fast lookup
- Target target = targetEnum.nextElement();
- stageMap.put(target.getName(), INVALID_DATE);
- log.debug(" - Start target: " + target.getName());
- }
- stageTargetBeginList.add(stageMap);
-
- // stage end process
- String endTargetName = stage.getEndTarget();
- // fast lookup
- List existingStageList = stageTargetEndMap.get(endTargetName);
- if (existingStageList == null) {
- existingStageList = new ArrayList();
- stageTargetEndMap.put(endTargetName, existingStageList);
- }
- existingStageList.add(stage);
- log.debug(" - End target: " + endTargetName);
- }
- }
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/TargetDiamondsListener.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/TargetDiamondsListener.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.diamonds;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Map;
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import com.nokia.helium.core.ant.types.TargetMessageTrigger;
-import com.nokia.helium.core.ant.Message;
-
-/**
- * Listener sending data based on target configuration to diamonds.
- */
-public class TargetDiamondsListener extends DiamondsListenerImpl {
-
-
- private Logger log = Logger.getLogger(TargetDiamondsListener.class);
-
- private Map targetsMap;
-
- private String currentTarget;
-
- /**
- * Default constructor
- */
- public TargetDiamondsListener() {
- targetsMap = DiamondsConfig.getTargetsMap();
- for (String key : targetsMap.keySet()) {
- log.debug("target name: " + key);
- }
- }
-
- private boolean isTargetsToExecute(BuildEvent buildEvent) {
- Project projectInTarget = buildEvent.getProject();
- Target target = buildEvent.getTarget();
- boolean retValue = false;
- log.debug("isTargetsToExecute: target:" + target.getName() );
- TargetMessageTrigger targetInMap = targetsMap.get(target.getName());
- log.debug("isTargetsToExecute: targetInMap:" + targetInMap );
- if (targetInMap != null) {
- log.debug("target: " + target.getName());
- log.debug("targetInMap: " + targetInMap);
- String targetNameInMap = targetInMap.getTargetName();
- log.debug("targetNameInMap: " + targetInMap.getTargetName());
- if (targetNameInMap != null) {
- retValue = true;
- String ifCondition = target.getIf();
- if ((ifCondition != null) && (projectInTarget.getProperty(
- projectInTarget.replaceProperties(ifCondition)) == null)) {
- retValue = false;
- }
- String unlessCondition = target.getUnless();
- if (unlessCondition != null && (projectInTarget.getProperty(
- projectInTarget.replaceProperties(unlessCondition)) != null)) {
- retValue = false;
- }
- }
- }
- return retValue;
- }
-
- /**
- * Function to process logging info during beginning of target execution. This checks that the
- * current target execution is in config and requires some data to be send it to diamonds.
- *
- * @param event of target execution.
- */
- public void targetBegin(BuildEvent buildEvent) throws DiamondsException {
- initDiamondsClient();
- String targetName = buildEvent.getTarget().getName();
- if (isTargetsToExecute(buildEvent)) {
- currentTarget = targetName;
- }
- }
-
- /**
- * Function to process logging info during end of build. If the target in config, sends the data
- * to diamonds (uses the template conversion if needed).
- *
- * @param event of target execution.
- */
- public void targetEnd(BuildEvent buildEvent) throws DiamondsException {
- String targetName = buildEvent.getTarget().getName();
- if (isTargetsToExecute(buildEvent)) {
- if (currentTarget != null && currentTarget.equals(targetName)) {
- log.debug("targetEnd: " + targetName);
- if (getIsInitialized()) {
- log.debug("diamonds:TargetDiamondsListener:finished recording, sending data to diamonds for target: "
- + buildEvent.getTarget().getName());
- sendTargetData(buildEvent, buildEvent.getTarget().getProject());
- }
- currentTarget = null;
- }
- }
- }
-
- private void sendData(InputStream stream) throws DiamondsException {
- String urlPath = DiamondsConfig.getBuildId();
- getDiamondsClient().sendData(stream, urlPath);
- log.debug("urlPath:" + urlPath);
- }
- /**
- * Sends the data to diamonds. First it looks if the template with target name exists, then it
- * looks for input source file from config, if ant properties required from config, it uses it
- * for template conversion. If no template file exists, sends the data directly.
- *
- * @param event of target execution.
- */
- private void sendTargetData(BuildEvent buildEvent, Project project) throws DiamondsException {
- TargetMessageTrigger targetMap = targetsMap.get(currentTarget);
- if (targetMap != null) {
-
- List messageList = targetMap.getMessageList();
- for ( Message message : messageList ) {
- try {
- File tempFile = streamToTempFile(message.getInputStream());
- tempFile.deleteOnExit();
- sendData(new FileInputStream(tempFile));
- mergeToFullResults(new FileInputStream(tempFile));
- } catch (IOException iex) {
- throw new DiamondsException("error closing the stream while sending data");
- }
- catch (com.nokia.helium.core.MessageCreationException mex) {
- log.debug("IOException while retriving message:", mex);
- throw new DiamondsException("error during message retrival");
- }
- }
- }
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/HeliumListener.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/HeliumListener.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-package com.nokia.helium.diamonds.ant;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.BuildListener;
-import org.apache.tools.ant.Project;
-
-import com.nokia.helium.diamonds.AllTargetDiamondsListener;
-import com.nokia.helium.diamonds.DiamondsConfig;
-import com.nokia.helium.diamonds.DiamondsException;
-import com.nokia.helium.diamonds.DiamondsListener;
-import com.nokia.helium.diamonds.DiamondsListenerImpl;
-import com.nokia.helium.diamonds.StageDiamondsListener;
-import com.nokia.helium.diamonds.TargetDiamondsListener;
-
-/**
- * Listener class that can connect to Ant and log information regarding to build
- * times, number of errors and such. Data is sent to Diamonds server, where it
- * is processed further.
- *
- * This class is listening all build related events. It catches the build
- * start-finish, target start-finish events of Ant and gather build start-end
- * time, errors/warnings and store in BuildData class. Stored data will be
- * exported to XML and uploaded to Diamonds server after each specific target.
- * For example after target "create-bom" this class will upload all BOM data to
- * Diamonds.
- *
- *
- */
-public class HeliumListener implements BuildListener {
-
- private Logger log = Logger.getLogger(HeliumListener.class);
-
- private List diamondsListeners;
-
- private Project project;
-
- private boolean isInitialized;
-
- private boolean skipDiamonds ;
- private boolean skipDiamondsSet;
-
- /**
- * Default constructor.
- */
- public HeliumListener() {
- diamondsListeners = new ArrayList();
- }
-
- /**
- * Ant call this function when build start.
- */
- public void buildStarted(BuildEvent event) {
- project = event.getProject();
- }
-
- /**
- * Triggered when a target starts.
- */
- @SuppressWarnings("unchecked")
- public void targetStarted(BuildEvent event) {
- Project prj = event.getProject();
- String targetName = event.getTarget().getName();
-
- String diamondsEnabled = prj.getProperty("diamonds.enabled");
- String skip = prj.getProperty("skip.diamonds");
- log.debug("diamondsenabled: " + diamondsEnabled);
- log.debug("skip: " + skip);
- if (!isInitialized) {
- if (diamondsEnabled != null && !Project.toBoolean(diamondsEnabled)) {
- log.info("'diamonds.enabled' is not true, to use diamonds set 'diamonds.enabled' to 'true'.");
- skipDiamonds = true;
- isInitialized = true;
- } else if (skip != null && Project.toBoolean(skip)) {
- log.info("'skip.diamonds' is deprecated. Please consider using 'diamonds.enabled'.");
- skipDiamonds = true;
- isInitialized = true;
- }
- }
-
- try {
- if (!skipDiamonds) {
- if (!isInitialized) {
- /**
- * Initialize Diamonds if and only if initializer-target-name has been called
- */
- String buildID = prj.getProperty(DiamondsConfig.getBuildIdProperty());
- log.debug("targetStarted:buildid:" + buildID);
- String initializerTargetName = prj.getProperty(DiamondsConfig.getInitializerTargetProperty());
- log.debug("initializerTargetName:" + initializerTargetName);
- log.debug("targetName:" + targetName);
- if ( buildID != null || (initializerTargetName != null && targetName.equals(initializerTargetName))) {
- isInitialized = true;
- project = prj;
- log.debug("trying to initialize diamonds config");
- DiamondsConfig.initialize(project);
- DiamondsListenerImpl.initialize(project);
- String category = DiamondsConfig.getCategory();
- log.debug("category:" + category);
- if (category != null && diamondsListeners.isEmpty()) {
- addListeners(event);
- log.info("Diamonds enabled");
- }
- }
- }
- } else {
- if (!skipDiamondsSet && skipDiamonds)
- {
- skipDiamondsSet = true;
- }
- }
- } catch (DiamondsException ex) {
- log.debug("Diamonds error: ", ex);
- String errorMessage = ex.getMessage();
- if (errorMessage == null) {
- errorMessage = "";
- }
- log.error("Diamonds Error, might not be logged properly, see debug log. "
- + errorMessage);
- }
- if (diamondsListeners != null) {
- for (DiamondsListener diamondsListener : diamondsListeners) {
- try {
- diamondsListener.targetBegin(event);
- } catch (DiamondsException e) {
- e.printStackTrace();
- log.debug("Error:", e);
- String errorMessage = e.getMessage();
- if (errorMessage == null) {
- errorMessage = "";
- }
- log.error("Diamonds Error, might not be logged properly, see debug log. "
- + errorMessage);
- }
- }
- }
- }
-
- private void addListeners(BuildEvent event) throws DiamondsException {
- if (DiamondsConfig.isStagesInConfig()) {
- StageDiamondsListener stageListener = new StageDiamondsListener();
- diamondsListeners.add(stageListener);
- stageListener.buildBegin(event);
- }
- if (DiamondsConfig.isTargetsInConfig()) {
- TargetDiamondsListener targetListener = new TargetDiamondsListener();
- diamondsListeners.add(targetListener);
- targetListener.buildBegin(event);
- }
-
- AllTargetDiamondsListener allTargetListener = new AllTargetDiamondsListener();
- diamondsListeners.add(allTargetListener);
- allTargetListener.buildBegin(event);
- }
-
- /**
- * Triggered when a target finishes.
- */
- public void targetFinished(BuildEvent event) {
- if (diamondsListeners != null) {
- for (DiamondsListener diamondsListener : diamondsListeners) {
- try {
- diamondsListener.targetEnd(event);
- } catch (DiamondsException e) {
- log.debug("Error:", e);
- String errorMessage = e.getMessage();
- if (errorMessage == null) {
- errorMessage = "";
- }
- log.error("Diamonds Error, might not be logged properly, see debug log. "
- + errorMessage);
- }
-
- }
- }
- }
-
- /**
- * Triggered when the build finishes.
- */
- public void buildFinished(BuildEvent event) {
- if (diamondsListeners != null) {
- for (DiamondsListener diamondsListener : diamondsListeners) {
- try {
- diamondsListener.buildEnd(event);
- } catch (DiamondsException e) {
- log.error("Failed to log in diamonds: " + e);
- }
-
- }
- }
- project = event.getProject();
- cleanup();
- }
-
- /**
- * See if build needs a final cleanup target to be called.
- */
- private void cleanup() {
- String loggingoutputfile = project.getProperty("logging.output.file");
- if (loggingoutputfile != null) {
- File file = new File(loggingoutputfile);
- if (file.exists()) {
- file.delete();
- }
- }
- }
-
- /**
- * Triggered when a task starts.
- */
- public void taskStarted(BuildEvent event) {
- }
-
- /**
- * Triggered when a task finishes.
- */
- public void taskFinished(BuildEvent event) {
- }
-
- /**
- * Triggered when a build message is logged.
- */
- public void messageLogged(BuildEvent event) {
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/Listener.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/Listener.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.helium.diamonds.ant;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.BuildListener;
+import org.apache.tools.ant.Project;
+
+
+import com.nokia.helium.core.ant.Message;
+import com.nokia.helium.diamonds.DiamondsConfig;
+import com.nokia.helium.diamonds.DiamondsException;
+import com.nokia.helium.diamonds.DiamondsListener;
+import com.nokia.helium.diamonds.DiamondsSession;
+import com.nokia.helium.diamonds.DiamondsSessionSocket;
+
+/**
+ * Listener class that can connect to Ant and log information regarding to build
+ * times, number of errors and such. Data is sent to Diamonds server, where it
+ * is processed further.
+ *
+ * This class is listening all build related events. It catches the build
+ * start-finish, target start-finish events of Ant and gather build start-end
+ * time, errors/warnings and store in BuildData class. Stored data will be
+ * exported to XML and uploaded to Diamonds server after each specific target.
+ * For example after target "create-bom" this class will upload all BOM data to
+ * Diamonds.
+ *
+ *
+ */
+public class Listener implements BuildListener {
+
+ private static final String INITIAL_MESSAGE = "initial.message";
+ private static final String FINAL_MESSAGE = "final.message";
+ private static final String BUILD_START_TIME_PROPERTY = "build.start.time";
+ private static final String BUILD_END_TIME_PROPERTY = "build.end.time";
+ private Project project;
+ private DiamondsConfig config;
+ private DiamondsSession session;
+ private List diamondsListeners = new ArrayList();
+ private Date startTime = new Date();
+
+ public DiamondsConfig getConfiguration() {
+ return config;
+ }
+
+ public DiamondsSession getSession() {
+ return session;
+ }
+
+ public Project getProject() {
+ return project;
+ }
+
+ /**
+ * Ant call this function when build start.
+ */
+ public void buildStarted(BuildEvent event) {
+ }
+
+ private Message getMessage(String messageId) throws DiamondsException {
+ Object obj = project.getReference(messageId);
+ if (obj != null && obj instanceof Message) {
+ return (Message)obj;
+ }
+ throw new DiamondsException("Could not find message '" + messageId + "'");
+ }
+
+ /**
+ * Triggered when a target starts.
+ */
+ public void targetStarted(BuildEvent event) {
+ if (project == null) {
+ project = event.getProject();
+ try {
+ config = new DiamondsConfig(project);
+
+ // Set initial start time property.
+ SimpleDateFormat timeFormat = new SimpleDateFormat(config.getTimeFormat());
+ project.setProperty(BUILD_START_TIME_PROPERTY, timeFormat.format(startTime));
+ } catch (DiamondsException e) {
+ config = null;
+ project.log("Diamonds reporting is disabled, because the listener is not configured properly: " + e.getMessage(), Project.MSG_ERR);
+ }
+ if (config == null || !config.isDiamondsEnabled()) {
+ project.log("'diamonds.enabled' is not true, to use diamonds set 'diamonds.enabled' to 'true'.");
+ } else {
+ try {
+ for (Object object : project.getReferences().values()) {
+ if (object instanceof DiamondsListener) {
+ DiamondsListener diamondsListener = (DiamondsListener)object;
+ diamondsListener.configure(this);
+ project.log("Adding DiamondsListener: " + diamondsListener.getClass(), Project.MSG_DEBUG);
+ diamondsListeners.add(diamondsListener);
+ }
+ }
+ } catch (DiamondsException e) {
+ throw new BuildException("Diamonds listener is not configured properly: " + e.getMessage(), e);
+ }
+ }
+ for (DiamondsListener diamondsListener : diamondsListeners) {
+ try {
+ diamondsListener.buildStarted(new BuildEvent(project));
+ } catch (DiamondsException e) {
+ // Voluntarily ignoring errors happening.
+ project.log(e.getMessage(), Project.MSG_ERR);
+ }
+ }
+ }
+
+ if (config != null && config.isDiamondsEnabled() && session == null) {
+ String buildId = project.getProperty(config.getBuildIdProperty());
+ try {
+ if (session == null && buildId != null) {
+ project.log("Reusing diamonds session with the following build id: " + buildId);
+ // we have a pre-configured build id.
+ session = new DiamondsSessionSocket(new URL("http", config.getHost(),
+ Integer.parseInt(config.getPort()), config.getPath()),
+ config.getMailInfo(), config.getSMTPServer(), config.getLDAPServer(), buildId);
+ } else if (session == null && event.getTarget().getName().equals(config.getInitializerTargetName())) {
+ session = new DiamondsSessionSocket(new URL("http", config.getHost(),
+ Integer.parseInt(config.getPort()), config.getPath()),
+ config.getMailInfo(), config.getSMTPServer(), config.getLDAPServer());
+ session.open(getMessage(INITIAL_MESSAGE));
+ // defining build id on the both root project, and current target project.
+ event.getTarget().getProject().setProperty(config.getBuildIdProperty(), session.getBuildId());
+ project.setProperty(config.getBuildIdProperty(), session.getBuildId());
+ project.log("Diamonds build id: " + project.getProperty(config.getBuildIdProperty()));
+ }
+ } catch (NumberFormatException e) {
+ project.log(e.getMessage(), Project.MSG_ERR);
+ project.log("Diamonds reporting will be disabled.", Project.MSG_ERR);
+ session = null;
+ } catch (MalformedURLException e) {
+ project.log(e.getMessage(), Project.MSG_ERR);
+ project.log("Diamonds reporting will be disabled.", Project.MSG_ERR);
+ session = null;
+ } catch (DiamondsException e) {
+ project.log(e.getMessage(), Project.MSG_ERR);
+ project.log("Diamonds reporting will be disabled.", Project.MSG_ERR);
+ session = null;
+ }
+ } else if (session != null && session.isOpen()) {
+ for (DiamondsListener diamondsListener : diamondsListeners) {
+ try {
+ diamondsListener.targetStarted(event);
+ } catch (DiamondsException e) {
+ // Voluntarily ignoring errors happening.
+ project.log(e.getMessage(), Project.MSG_ERR);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Triggered when a target finishes.
+ */
+ public void targetFinished(BuildEvent event) {
+ if (config != null && config.isDiamondsEnabled() && session != null && session.isOpen()) {
+ for (DiamondsListener diamondsListener : diamondsListeners) {
+ try {
+ diamondsListener.targetFinished(event);
+ } catch (DiamondsException e) {
+ // Voluntarily ignoring errors happening.
+ project.log(e.getMessage(), Project.MSG_ERR);
+ }
+ }
+ }
+ }
+
+ /**
+ * Triggered when the build finishes.
+ */
+ public void buildFinished(BuildEvent event) {
+ if (config != null && config.isDiamondsEnabled() && session != null && session.isOpen()) {
+ // Setting the final timestamp
+ SimpleDateFormat timeFormat = new SimpleDateFormat(config.getTimeFormat());
+ project.setProperty(BUILD_END_TIME_PROPERTY, timeFormat.format(new Date()));
+ for (DiamondsListener diamondsListener : diamondsListeners) {
+ try {
+ diamondsListener.buildFinished(event);
+ } catch (DiamondsException e) {
+ // Voluntarily ignoring errors happening.
+ project.log(e.getMessage(), Project.MSG_ERR);
+ }
+ }
+ try {
+ // Sending the message
+ Message message = getMessage(FINAL_MESSAGE);
+ session.close(message);
+ } catch (DiamondsException e) {
+ project.log(e.getMessage(), Project.MSG_ERR);
+ }
+ }
+ }
+
+
+ /**
+ * Triggered when a task starts.
+ */
+ public void taskStarted(BuildEvent event) {
+ }
+
+ /**
+ * Triggered when a task finishes.
+ */
+ public void taskFinished(BuildEvent event) {
+ }
+
+ /**
+ * Triggered when a build message is logged.
+ */
+ public void messageLogged(BuildEvent event) {
+ }
+
+
+ public static Listener getDiamondsListener(Project project) {
+ for (Object bl : project.getBuildListeners()) {
+ if (bl instanceof Listener) {
+ return (Listener)bl;
+ }
+ }
+ return null;
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/antlib.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/types/AllTargetDiamondsListener.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/types/AllTargetDiamondsListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.helium.diamonds.ant.types;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Vector;
+import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Target;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.core.ant.types.FileMessage;
+import com.nokia.helium.diamonds.DiamondsException;
+import com.nokia.helium.diamonds.DiamondsListener;
+import com.nokia.helium.diamonds.ant.Listener;
+
+/**
+ * The targetTimingMessageListener should be used as a reference in a build
+ * file so the message listener can detect it an record target execution time
+ * before sending it.
+ *
+ *
+ * <hlm:targetTimingMessageListener id="target.time.message.listener" />
+ *
+ *
+ * @ant.type name="targetTimingMessageListener" category="Diamonds"
+ */
+public class AllTargetDiamondsListener extends DataType implements DiamondsListener {
+
+ private List antTargets = new Vector();
+ private List completedTargets = new Vector();
+ private Listener diamondsListener;
+ private int minTime = 5000; // in ms
+
+ /**
+ * Function to process logging info during end of build
+ *
+ * @param event of target execution.
+ */
+ class AntTarget {
+ private String targetName;
+ private Date startTime;
+ private Date endTime;
+ private int hashCode;
+
+ public AntTarget(Target target) {
+ targetName = target.getName();
+ this.hashCode = target.hashCode();
+ startTime = new Date();
+ }
+
+ public String getName() { return targetName; }
+ public Date getStartTime() { return startTime; }
+ public Date getEndTime() { return endTime; }
+ public void setEndTime(Date e) { endTime = e; }
+ public boolean equals(Object obj) { return obj.hashCode() == hashCode; }
+ public int hashCode() { return hashCode; }
+ }
+
+ public synchronized void buildFinished(BuildEvent buildEvent) throws DiamondsException {
+ try {
+ SimpleDateFormat timeFormat = new SimpleDateFormat(diamondsListener.getConfiguration().getTimeFormat());
+ File tempFile = File.createTempFile("diamonds-targets", ".xml");
+ tempFile.deleteOnExit();
+ BufferedWriter out = new BufferedWriter(new FileWriter(tempFile));
+ out.write("\n");
+ out.write("\n");
+ out.write("24 \n");
+ out.write("\n");
+
+ for (AntTarget at : completedTargets) {
+ if (at.getEndTime() != null) {
+ out.write("\n");
+ out.write("" + at.getName() + " \n");
+ out.write("" + timeFormat.format(at.getStartTime()) + " \n");
+ out.write("" + timeFormat.format(at.getEndTime()) + " \n");
+ out.write(" \n");
+ }
+ }
+
+ out.write(" \n");
+ out.write(" \n");
+ out.close();
+ FileMessage message = new FileMessage();
+ message.setProject(getProject());
+ message.setFile(tempFile);
+ diamondsListener.getSession().send(message);
+ } catch (IOException e) {
+ throw new DiamondsException(e.getMessage(), e);
+ }
+ }
+
+ public void buildStarted(BuildEvent buildEvent) throws DiamondsException {
+ }
+
+ public void configure(Listener listener) throws DiamondsException {
+ diamondsListener = listener;
+ }
+
+ public synchronized void targetFinished(BuildEvent buildEvent) throws DiamondsException {
+ for (AntTarget at : antTargets) {
+ if (at.equals(buildEvent.getTarget())) {
+ at.setEndTime(new Date());
+ if (at.getEndTime().getTime() - at.getStartTime().getTime() >= minTime) {
+ completedTargets.add(at);
+ }
+ antTargets.remove(at);
+ break;
+ }
+ }
+ }
+
+ public synchronized void targetStarted(BuildEvent buildEvent) throws DiamondsException {
+ antTargets.add(new AntTarget(buildEvent.getTarget()));
+ }
+
+ /**
+ * Defines the minimum execution time for a target to be recorded. Time is in millisecond.
+ * If set to 0 then all target are recorded.
+ * @param minTime
+ * @ant.not-required Default is 5000ms
+ */
+ public void setMinTime(Integer minTime) {
+ if (minTime.intValue() < 0) {
+ throw new BuildException("Invalid value for minTime attribute: " +
+ minTime.intValue() + ", value must be >=0. At " + this.getLocation());
+ }
+ this.minTime = minTime.intValue();
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/types/StageDiamondsListener.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/types/StageDiamondsListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.helium.diamonds.ant.types;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.core.ant.Message;
+import com.nokia.helium.core.ant.types.Stage;
+import com.nokia.helium.diamonds.DiamondsException;
+import com.nokia.helium.diamonds.DiamondsListener;
+import com.nokia.helium.diamonds.ant.Listener;
+
+/**
+ * The targetTimingMessageListener should be used as a reference in a build
+ * file so the message listener can detect it an record target execution time
+ * before sending it.
+ *
+ *
+ * <hlm:stageMessageListener id="stage.message.listener">
+ * <hlm:fmppMessage sourceFile="tool.xml.ftl">
+ * <data expandProperties="yes">
+ * ant: antProperties()
+ * </data>
+ * </hlm:fmppMessage>
+ * </hlm:stageMessageListener>
+ *
+ *
+ * @ant.type name="stageMessageListener" category="Diamonds"
+ */
+public class StageDiamondsListener extends DataType implements DiamondsListener {
+ private Listener diamondsListener;
+ private List stages = new ArrayList();
+ private List completedStages = new ArrayList();
+ private DiamondsStage currentStage;
+ private Message message;
+
+ class DiamondsStage extends Stage {
+ private Date startTime;
+ private Date endTime;
+ private String stageName;
+
+ public DiamondsStage(Stage stage) {
+ this.setEndTarget(stage.getEndTarget());
+ this.setStartTarget(stage.getStartTarget());
+ stageName = stage.getStageName();
+ }
+
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+
+ public void setProperties(Project project, String timeFormatString) {
+ SimpleDateFormat timeFormat = new SimpleDateFormat(timeFormatString);
+ project.setProperty("logical.stage", this.getStageName());
+ project.setProperty("stage.start.time", timeFormat.format(startTime));
+ project.setProperty("stage.end.time", timeFormat.format(endTime));
+ }
+
+ public String getStageName() {
+ return stageName;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public void configure(Listener listener) throws DiamondsException {
+ diamondsListener = listener;
+ if (message == null) {
+ throw new BuildException(this.getDataTypeName() + " must have one nested message at " + this.getLocation());
+ }
+ Map startStageName = new Hashtable();
+ for (Map.Entry entry : ((Map)listener.getProject().getReferences()).entrySet()) {
+ if (entry.getValue() instanceof Stage) {
+ Stage stage = (Stage)entry.getValue();
+ if (stage.getStartTarget() != null && stage.getEndTarget() != null) {
+ if (startStageName.containsKey(stage.getStartTarget())) {
+ log("Stage " + entry.getKey() + " uses the start target named '" + stage.getStartTarget() +
+ "' which is already used by stage " + startStageName.get(stage.getStartTarget()) +
+ ". Stage " + entry.getKey() + " will be ignored.", Project.MSG_WARN);
+ } else {
+ if (!getProject().getTargets().containsKey(stage.getStartTarget())) {
+ log("Stage " + entry.getKey() + " refer to an inexistant start target: " + stage.getStartTarget()
+ + ". Stage will be ignored", Project.MSG_ERR);
+ } else if (!getProject().getTargets().containsKey(stage.getEndTarget())) {
+ log("Stage " + entry.getKey() + " refer to an inexistant end target: " + stage.getEndTarget()
+ + ". Stage will be ignored", Project.MSG_ERR);
+ } else {
+ startStageName.put(stage.getStartTarget(), entry.getKey());
+ DiamondsStage diamondsStage = new DiamondsStage(stage);
+ stages.add(diamondsStage);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ public void buildFinished(BuildEvent buildEvent) throws DiamondsException {
+ if (currentStage != null) {
+ currentStage.setEndTime(new Date());
+ completedStages.add(currentStage);
+ currentStage = null;
+ }
+ }
+
+ public void buildStarted(BuildEvent buildEvent) throws DiamondsException {
+ }
+
+ public synchronized void targetFinished(BuildEvent buildEvent) throws DiamondsException {
+ if (currentStage != null) {
+ if (buildEvent.getTarget().getName().equals(currentStage.getEndTarget())) {
+ getProject().log("Stage ending - " + currentStage.getStageName(), Project.MSG_DEBUG);
+ currentStage.setEndTime(new Date());
+ completedStages.add(currentStage);
+ try {
+ sendCompletedStage(currentStage);
+ } finally {
+ currentStage = null;
+ }
+ }
+ }
+ }
+
+ protected void sendCompletedStage(DiamondsStage stage) throws DiamondsException {
+ if (message != null) {
+ stage.setProperties(diamondsListener.getProject(), diamondsListener.getConfiguration().getTimeFormat());
+ diamondsListener.getSession().send(message);
+ }
+ }
+
+ public synchronized void targetStarted(BuildEvent buildEvent) throws DiamondsException {
+ if (currentStage == null) {
+ currentStage = geStageByStartTarget(buildEvent.getTarget().getName());
+ if (currentStage != null) {
+ getProject().log("Stage starting - " + currentStage.getStageName(), Project.MSG_DEBUG);
+ currentStage.setStartTime(new Date());
+ }
+ } else {
+ // In this case we have an overlap...
+ DiamondsStage newStage = geStageByStartTarget(buildEvent.getTarget().getName());
+ if (newStage != null) {
+ getProject().log("Stage " + currentStage.getStageName() + " and stage " + newStage.getStageName() + " are overlapping.", Project.MSG_WARN);
+ getProject().log("Stage ending - " + currentStage.getStageName(), Project.MSG_DEBUG);
+ currentStage.setEndTime(new Date());
+ newStage.setStartTime(new Date());
+ completedStages.add(currentStage);
+ try {
+ sendCompletedStage(currentStage);
+ } finally {
+ currentStage = newStage;
+ getProject().log("Stage starting - " + currentStage.getStageName(), Project.MSG_DEBUG);
+ }
+
+ }
+ }
+ }
+
+ private DiamondsStage geStageByStartTarget(String targetName) {
+ for (DiamondsStage stage : stages) {
+ if (targetName.equals(stage.getStartTarget())) {
+ return stage;
+ }
+ }
+ return null;
+ }
+
+
+ public void add(Message message) {
+ if (this.message != null) {
+ throw new BuildException(this.getDataTypeName() + " cannot accept more than one nested message at " + this.getLocation());
+ }
+ this.message = message;
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/types/TargetDiamondsListener.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/types/TargetDiamondsListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.helium.diamonds.ant.types;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Target;
+
+import com.nokia.helium.core.ant.Message;
+import com.nokia.helium.core.MessageCreationException;
+import com.nokia.helium.core.ant.types.TargetMessageTrigger;
+import com.nokia.helium.diamonds.DiamondsException;
+import com.nokia.helium.diamonds.DiamondsListener;
+import com.nokia.helium.diamonds.DiamondsSession;
+import com.nokia.helium.diamonds.ant.Listener;
+
+/**
+ * Listener sending data based on target configuration to diamonds.
+ */
+public class TargetDiamondsListener implements DiamondsListener {
+ private static final int READ_ARRAY_SIZE = 1000;
+
+ private Listener diamondsListener;
+ private Map targetTriggers = new HashMap();
+
+
+ public void configure(Listener diamondsListener) throws DiamondsException {
+ this.diamondsListener = diamondsListener;
+ for (Object entry : diamondsListener.getProject().getReferences().values()) {
+ if (entry instanceof TargetMessageTrigger) {
+ TargetMessageTrigger targetMessageTrigger = (TargetMessageTrigger)entry;
+ targetTriggers.put(targetMessageTrigger.getTargetName(), targetMessageTrigger);
+ }
+ }
+ }
+
+ public void buildFinished(BuildEvent buildEvent) throws DiamondsException {
+ }
+
+ public void buildStarted(BuildEvent buildEvent) throws DiamondsException {
+ }
+
+ public void targetFinished(BuildEvent buildEvent) throws DiamondsException {
+ String targetName = buildEvent.getTarget().getName();
+ if (testIfCondition(buildEvent.getTarget()) && testUnlessCondition(buildEvent.getTarget()) &&
+ targetTriggers.containsKey(buildEvent.getTarget().getName())) {
+ DiamondsSession session = diamondsListener.getSession();
+ if (session != null && session.isOpen()) {
+ for (Message message : targetTriggers.get(targetName).getMessageList()) {
+ buildEvent.getProject().log("Sending message to Diamonds:\n" + dumpMessage(message), Project.MSG_DEBUG);
+ session.send(message);
+ }
+ }
+ }
+ }
+
+ /**
+ * Check if the target should be skipped because of the if attribute.
+ * @param target the target instance to be tested.
+ * @return Returns true if the target should be executed, false otherwise.
+ */
+ private boolean testIfCondition(Target target) {
+ if (target.getIf() == null) {
+ return true;
+ }
+ String test = target.getProject().replaceProperties(target.getIf());
+ return target.getProject().getProperty(test) != null;
+ }
+
+ /**
+ * Check if the target should be skipped because of the unless attribute.
+ * @param target the target instance to be tested.
+ * @return Returns true if the target should be executed, false otherwise.
+ */
+ private boolean testUnlessCondition(Target target) {
+ if (target.getUnless() == null) {
+ return true;
+ }
+ String test = target.getProject().replaceProperties(target.getUnless());
+ return target.getProject().getProperty(test) == null;
+ }
+
+ /**
+ * Dump the content of a Message and return a String.
+ * @param message The message.
+ * @return String of contents.
+ * @throws DiamondsException If any IO errors.
+ */
+ private String dumpMessage(Message message) throws DiamondsException {
+ StringBuilder builder;
+ try {
+ InputStream in = message.getInputStream();
+ builder = new StringBuilder();
+ byte[] data = new byte[READ_ARRAY_SIZE];
+ int length = in.read(data);
+ while (length > 0) {
+ builder.append(new String(data, 0, length));
+ length = in.read(data);
+ }
+ }
+ catch (IOException e) {
+ throw new DiamondsException(e.toString());
+ } catch (MessageCreationException e) {
+ throw new DiamondsException(e.toString());
+ }
+ return builder.toString();
+ }
+
+ public void targetStarted(BuildEvent buildEvent) throws DiamondsException {
+ }
+}
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/helium.antlib.xml
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/helium.antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/helium.antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,11 +25,9 @@
Ant task definition declarations.
-
-
+
-
-
-
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/antunit/run-scenario.ant.xml
--- a/buildframework/helium/sf/java/diamonds/tests/antunit/run-scenario.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/antunit/run-scenario.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,12 +25,11 @@
-
-
+
-
+
@@ -43,13 +42,13 @@
-
+
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/antunit/test_diamonds.ant.xml
--- a/buildframework/helium/sf/java/diamonds/tests/antunit/test_diamonds.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/antunit/test_diamonds.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -23,24 +23,102 @@
Helium Antlib diamonds unittests.
-
+
+
+
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/config/diamonds_config_default.ant.xml
--- a/buildframework/helium/sf/java/diamonds/tests/config/diamonds_config_default.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/config/diamonds_config_default.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -29,29 +29,17 @@
-
-
-
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
@@ -77,11 +65,6 @@
-
-
- ant: antProperties()
-
-
@@ -115,5 +98,23 @@
+
+
+
+
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+ ant: antProperties()
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/data/templates/diamonds_signal.xml.ftl
--- a/buildframework/helium/sf/java/diamonds/tests/data/templates/diamonds_signal.xml.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/data/templates/diamonds_signal.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -1,6 +1,6 @@
<#--
============================================================================
-Name : finish.xml.ftl
+Name : diamonds_signal.xml.ftl
Part of : Helium
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
@@ -21,21 +21,14 @@
-->
<#include "header.ftl">
- <#assign diamondsignalname = ""/>
- <#assign diamondkeys = ant?keys>
- <#list diamondkeys as diamondkey>
- <#if diamondkey?contains("diamond.signal.name")>
- <#list diamondkey?split(".") as index>
- <#assign signalIndex = index/>
- #list>
+ <#list ant?keys as diamondskey>
+ <#if diamondskey?starts_with("diamond.signal.name.")>
+ <#assign signalIndex = diamondskey?split(".")?last />
- <#list diamondkeys as diamondkey>
- <#if diamondkey?contains("${signalIndex}")>
- <#if ant?contains("diamond.signal.name.${signalIndex}")>${ant["diamond.signal.name.${signalIndex}"]} #if>
- <#if ant?contains("diamond.error.message.${signalIndex}")>${ant["diamond.error.message.${signalIndex}"]} #if>
- <#if ant?contains("diamond.time.stamp.${signalIndex}")>${ant["diamond.time.stamp.${signalIndex}"]} #if>
- #if>
- #list>
+ ${signalIndex}
+ <#if ant?keys?seq_contains("diamond.signal.name.${signalIndex}")>${ant["diamond.signal.name.${signalIndex}"]?xml} #if>
+ <#if ant?keys?seq_contains("diamond.error.message.${signalIndex}")>${ant["diamond.error.message.${signalIndex}"]?xml} #if>
+ <#if ant?keys?seq_contains("diamond.time.stamp.${signalIndex}")>${ant["diamond.time.stamp.${signalIndex}"]?xml} #if>
#if>
#list>
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/data/templates/skipped-target.xml.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/tests/data/templates/skipped-target.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,29 @@
+<#--
+============================================================================
+Name : skipped-target.xml.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+<#include "header.ftl">
+
+
+ invalid_target
+ 0.0
+
+
+<#include "footer.ftl">
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/build-without-config/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/build-without-config/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,167 @@
+
+
+
+ Helium Antlib diamonds unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/build/build.xml
--- a/buildframework/helium/sf/java/diamonds/tests/scenarii/build/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/build/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -24,6 +24,7 @@
Helium Antlib diamonds unittests.
+
@@ -31,7 +32,7 @@
-
+
@@ -88,9 +89,6 @@
-
-
-
@@ -112,7 +110,7 @@
usetimestamp="true" />
-
+
@@ -179,6 +177,8 @@
+
+
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/failing-build/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/failing-build/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,60 @@
+
+
+
+ Helium Antlib diamonds unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-address/build.xml
--- a/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-address/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-address/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -24,6 +24,7 @@
Helium Antlib diamonds unittests.
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates-1/build.xml
--- a/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates-1/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates-1/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -24,6 +24,7 @@
Helium Antlib diamonds unittests.
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates/build.xml
--- a/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -24,6 +24,7 @@
Helium Antlib diamonds unittests.
+
@@ -121,10 +122,12 @@
-
-
-
-
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/signal-build/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/signal-build/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,82 @@
+
+
+
+ Helium Antlib diamonds unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Signal: ${signal.name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/diamonds/tests/scenarii/target-recording/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/target-recording/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,76 @@
+
+
+
+ Helium Antlib diamonds unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/Environment.java
--- a/buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/Environment.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/Environment.java Sun Oct 10 15:22:15 2010 +0300
@@ -44,7 +44,6 @@
*/
public class Environment {
private static final String[] WINDOWS_EXE_EXTENSIONS = { ".exe", ".bat", ".cmd" };
- private static final String STDERR_OUTPUT = "stderr";
private static final String[] DEFAULT_EXECUTABLES = { "java", "ant" };
private Project project;
@@ -79,7 +78,6 @@
* Adds default executables to the list that must have been run because Ant is running.
*/
private void addDefaultExecutables() {
-
for (int i = 0; i < DEFAULT_EXECUTABLES.length; i++) {
Executable exe = new Executable(DEFAULT_EXECUTABLES[i]);
exe.setExecuted(true);
@@ -188,6 +186,7 @@
if (executableFiles != null && executableFiles.length > 0) {
executableFile = executableFiles[0];
exec.setPath(executableFile.getCanonicalPath());
+ break;
}
}
}
@@ -226,46 +225,94 @@
return pathDirs;
}
- private boolean findVersion(Executable exec) throws IOException {
- // Get the executable additional data for this execution
- ExecutableInfo def = defs.get(exec.getNameNoExt());
- if (def != null && def.getVersionArgs() != null) {
- String path = exec.getPath();
- if (path == null) {
- path = "";
- }
- String[] versionArgs = def.getVersionArgs().split(" ");
- String[] commands = new String[versionArgs.length + 1];
- commands[0] = path;
- for (int i = 0; i < versionArgs.length; i++) {
- commands[i + 1] = versionArgs[i].trim();
- }
- Process commandProcess = Runtime.getRuntime().exec(commands);
+ private class ExecutableVersionReader implements Runnable {
+ private static final int VERSION_TEXT_READ_TIMEOUT = 5000;
+ private static final int CHAR_ARRAY_SIZE = 1000;
+
+ private String[] commands;
+ private InputStream in;
+ private StringBuilder text = new StringBuilder();
+ private char[] chars = new char[CHAR_ARRAY_SIZE];
+ private IOException exception;
- String output = def.getOutput();
- StringBuilder text = new StringBuilder();
- int dataRead = 0;
- char[] chars = new char[1000];
- if (output == null || !output.equals(STDERR_OUTPUT)) {
- InputStream in = commandProcess.getInputStream();
+ ExecutableVersionReader(String[] commands) {
+ this.commands = commands;
+ }
+
+ public void run() {
+ try {
+ int dataRead = 0;
InputStreamReader textIn = new InputStreamReader(in);
while (dataRead != -1) {
+
dataRead = textIn.read(chars, 0, chars.length);
+
if (dataRead != -1) {
text.append(chars, 0, dataRead);
}
}
}
- InputStream err = commandProcess.getErrorStream();
- InputStreamReader textErr = new InputStreamReader(err);
- dataRead = 0;
- while (dataRead != -1) {
- dataRead = textErr.read(chars, 0, chars.length);
- if (dataRead != -1) {
- text.append(chars, 0, dataRead);
+ catch (IOException e) {
+ exception = e;
+ }
+ synchronized (this) {
+ notify();
+ }
+ }
+
+ /**
+ * Read output data from both stdout and stderr streams.
+ *
+ * @return Text data.
+ * @throws IOException
+ * @throws InterruptedException
+ */
+ public String readData() throws IOException {
+ try {
+ Process commandProcess = Runtime.getRuntime().exec(commands);
+ // Try to read from stdout
+ in = commandProcess.getInputStream();
+ new Thread(this).start();
+ synchronized (this) {
+ wait(VERSION_TEXT_READ_TIMEOUT);
+ }
+
+ // If no data available after timeout, try reading from stderr
+ if (text.length() == 0) {
+ in = commandProcess.getErrorStream();
+ new Thread(this).start();
+ synchronized (this) {
+ wait(VERSION_TEXT_READ_TIMEOUT);
+ }
}
}
- String versionText = text.toString();
+ catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+ if (exception != null) {
+ throw exception;
+ }
+ return text.toString();
+ }
+ }
+
+ private boolean findVersion(Executable exec) throws IOException {
+ // Get the executable additional data for this execution
+ ExecutableInfo def = defs.get(exec.getNameNoExt());
+ if (def != null && def.getVersionArgs() != null) {
+ String exePath = exec.getPath();
+ if (exePath == null) {
+ exePath = "";
+ }
+ String[] versionArgs = def.getVersionArgs().split(" ");
+ String[] commands = new String[versionArgs.length + 1];
+ commands[0] = exePath;
+ for (int i = 0; i < versionArgs.length; i++) {
+ commands[i + 1] = versionArgs[i].trim();
+ }
+
+ ExecutableVersionReader reader = new ExecutableVersionReader(commands);
+ String versionText = reader.readData();
if (def.getVersionRegex() != null) {
Pattern versionPattern = Pattern.compile(def.getVersionRegex());
Matcher versionMatch = versionPattern.matcher(versionText);
@@ -291,7 +338,7 @@
exec.setLastModified(file.lastModified());
exec.setLength(file.length());
}
-
+
/**
* Calculate a hash value for the executable file.
*
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/ant/listener/ExecListener.java
--- a/buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/ant/listener/ExecListener.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/ant/listener/ExecListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -31,6 +31,7 @@
import org.apache.tools.ant.RuntimeConfigurable;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.UnknownElement;
+import org.apache.tools.ant.taskdefs.condition.Os;
/**
* Checks for uses of the task and logs them to a CSV file.
@@ -102,6 +103,10 @@
Project project = event.getProject();
executable = project.replaceProperties(executable);
logger.debug("ExecListener: executable is run: " + executable);
+ String osFamily = (String) map.get("osfamily");
+ if (osFamily != null && !Os.isOs(osFamily, null, null, null)) {
+ return;
+ }
execCalls.add(executable);
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/ant/taskdefs/EnvironmentTask.java
--- a/buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/ant/taskdefs/EnvironmentTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/ant/taskdefs/EnvironmentTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -75,6 +75,7 @@
try {
if (outputFile != null) {
out = new FileOutputStream(outputFile);
+ project.log("Writing output to " + outputFile.toString(), Project.MSG_INFO);
}
List executableDefs = new ArrayList();
for (Iterator iterator = envDataList.iterator(); iterator.hasNext();) {
@@ -85,6 +86,7 @@
Environment environment = new Environment(project);
environment.setExecutableDefs(executableDefs);
environment.scan(ExecListener.getExecCalls());
+
EnvironmentXMLWriter writer = new EnvironmentXMLWriter(out);
writer.write(environment);
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/environment/tests/antunit/listener/build.xml
--- a/buildframework/helium/sf/java/environment/tests/antunit/listener/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/environment/tests/antunit/listener/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -46,6 +46,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/environment/tests/antunit/test_listener.ant.xml
--- a/buildframework/helium/sf/java/environment/tests/antunit/test_listener.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/environment/tests/antunit/test_listener.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -1,7 +1,7 @@
-
-
- Ant task definition declarations.
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/StopLogToConsoleTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/StopLogToConsoleTask.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,81 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-package com.nokia.ant.taskdefs;
-
-import org.apache.tools.ant.Task;
-
-import com.nokia.ant.HeliumLogger;
-
-/**
- * This task is deprecated, please consider using the
- * hlm:taskRecorder task from the logging framework.
- *
- * This task will control the outputing of the Helium logger.
- *
- * Example of usage, to stop logging to console:
- *
- * <hlm:logtoconsole action="stop"/>
- *
- *
- * To resume logging to console:
- *
- * <hlm:logtoconsole action="start"/>
- *
- *
- * @ant.task name="logtoconsole" category="Logging"
- * @deprecated This task is deprecated, please consider using the
- * hlm:taskRecorder task from the logging framework.
- */
-@Deprecated
-public class StopLogToConsoleTask extends Task
-{
- private boolean stopLogToConsole;
-
- /**
- * Action to perform, stop/start logging.
- * @ant.not-required Default value is start.
- */
- public void setAction(String msg)
- {
- if ( msg.equalsIgnoreCase("stop") )
- {
- stopLogToConsole = true;
- }
- else
- {
- stopLogToConsole = false;
- }
- }
-
- @Override
- public void execute()
- {
- super.execute();
- if (HeliumLogger.getStopLogToConsole() != stopLogToConsole)
- {
- if (stopLogToConsole) {
- log("Logging to console suspended.");
- }
- HeliumLogger.setStopLogToConsole(stopLogToConsole);
- if (!stopLogToConsole) {
- log("Logging to console resumed.");
- }
- }
- }
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/src/com/nokia/log4j.xml
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/log4j.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/log4j.xml Sun Oct 10 15:22:15 2010 +0300
@@ -1,7 +1,7 @@
-
- Helium Antlib feature enabler macro.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/tests/antunit/test_feature_enabled_flags.ant.xml
--- a/buildframework/helium/sf/java/legacy/tests/antunit/test_feature_enabled_flags.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-
-
-
-
- Testing targets.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/tests/scenarii/bld.sh
--- a/buildframework/helium/sf/java/legacy/tests/scenarii/bld.sh Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of the License "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-if [ -f ~/.bashrc ] ; then
- . ~/.bashrc
-fi
-ant $*
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/tests/scenarii/build.bat
--- a/buildframework/helium/sf/java/legacy/tests/scenarii/build.bat Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-@echo off
-
-rem
-rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-rem All rights reserved.
-rem This component and the accompanying materials are made available
-rem under the terms of the License "Eclipse Public License v1.0"
-rem which accompanies this distribution, and is available
-rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-rem
-rem Initial Contributors:
-rem Nokia Corporation - initial contribution.
-rem
-rem Contributors:
-rem
-rem Description:
-rem
-
-setlocal
-if not defined JAVA_6_HOME (
-set TESTED_JAVA=C:\Apps\j2sdk_1.6.0_02
-) ELSE set TESTED_JAVA=%JAVA_6_HOME%
-if exist %TESTED_JAVA% (set JAVA_HOME=%TESTED_JAVA%)
-call ant %*
-if "%ERRORLEVEL%" neq "0" (goto error)
-endlocal
-goto :eof
-
-:error
-endlocal
-if "%OS%"=="Windows_NT" color 00
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/tests/scenarii/property/feature.ant.xml
--- a/buildframework/helium/sf/java/legacy/tests/scenarii/property/feature.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-
-
-
- Helium Antlib logger unittests.
-
-
-
-
-
-
-
-
-
-
-
-
- Inside the temp target
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/tests/scenarii/test/build.xml
--- a/buildframework/helium/sf/java/legacy/tests/scenarii/test/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-
-
-
- Helium Antlib logger unittests.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Running run-target-disabled
-
-
-
- Running run-target-enabled
-
-
-
- Running run-with-old-flag-enabled
-
-
-
- Running run-with-new-flag-enabled
-
-
-
- Running run-with-both-enabled
-
-
-
- Running run-with-unless-enabled
-
-
-
- Running run-with-unless-internal-enabled
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/legacy/tests/src/com/nokia/ant/HeliumLoggerTest.java
--- a/buildframework/helium/sf/java/legacy/tests/src/com/nokia/ant/HeliumLoggerTest.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.ant;
-
-import junit.framework.TestCase;
-
-/**
- * Test class for Helium Logger.
- *
- */
-public class HeliumLoggerTest extends TestCase {
-
- /**
- * Basic test to check if the property
- * is set correctly.
- */
- public void testSetStopLogToConsole() {
- HeliumLogger logger = new HeliumLogger();
- logger.setStopLogToConsole(true);
- assert logger.getStopLogToConsole();
- }
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/antlib.xml
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,8 +28,9 @@
-
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/AntLoggingHandler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/AntLoggingHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/AntLoggingHandler.java Sun Oct 10 15:22:15 2010 +0300
@@ -19,198 +19,303 @@
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import java.util.ArrayList;
import java.util.Date;
-import java.util.HashMap;
import java.util.Hashtable;
+import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Vector;
-import java.util.Map.Entry;
+import java.util.regex.Pattern;
-import org.apache.log4j.Logger;
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Target;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.LogLevel;
+import org.apache.tools.ant.types.DataType;
import com.nokia.helium.core.ant.types.Stage;
-import com.nokia.helium.logger.ant.types.StageLogging;
+import com.nokia.helium.logger.ant.types.StageRecord;
+
/**
* Ant logging class for each Stage.
*
*
*/
-public class AntLoggingHandler implements Handler {
- private static Hashtable recorderEntries = new Hashtable();
- private static HashMap fileCreatedMap = new HashMap();
- private static boolean isDefaultStageStarted;
- private Map stagesMapping;
- private Map stageRecordMap;
- private HashMap> depStartTargetMap;
- private HashMap stageStartTargetMap;
- private boolean isStageRecordingHappening;
- private boolean loggingStarted;
- private int loglevel = -1;
- private VerbosityLevelChoices antLogLevel;
- private Logger log = Logger.getLogger(AntLoggingHandler.class);
- private String currentStageName;
- private Project project;
+public class AntLoggingHandler extends DataType implements BuildEventHandler, TargetEventHandler, SubBuildEventHandler, CommonListenerRegister {
+ private Map recorderEntries = new Hashtable();
+ private Map stageStartTargets = new Hashtable();
+ private Map stageEndTargets = new Hashtable();
+ private RecorderEntry defaultRecorderEntry;
+ private RecorderEntry currentRecorderEntry;
+ private Stage currentStage;
+ private CommonListener commonListener;
+ private boolean record;
+ private List recordExclusions = new ArrayList();
+
+ @SuppressWarnings("unchecked")
+ public void register(CommonListener commonListener) {
+ this.commonListener = commonListener;
+ Map references = (Map)commonListener.getProject().getReferences();
+ for (Map.Entry entry : references.entrySet()) {
+ if (entry.getValue() instanceof StageRecord) {
+ StageRecord stageRecord = (StageRecord)entry.getValue();
+ if (stageRecord.getDefaultOutput() != null) {
+ if (defaultRecorderEntry == null) {
+ RecorderEntry recorderEntry = new RecorderEntry(stageRecord.getDefaultOutput());
+ recorderEntry.setMessageOutputLevel(stageRecord.getLogLevel());
+ recorderEntry.setEmacsMode(false);
+ recorderEntry.setRecordState(false);
+ defaultRecorderEntry = recorderEntry;
+ } else {
+ log("There must be only one default stagerecord datatype.");
+ }
+ } else if (stageRecord.getStageRefID() != null) {
+ if (references.containsKey(stageRecord.getStageRefID())) {
+ if (references.get(stageRecord.getStageRefID()) instanceof Stage) {
+ // Check the stage
+ Stage stage = (Stage)references.get(stageRecord.getStageRefID());
+ validateStageInformation(stageRecord.getStageRefID(), stage);
+ log("Found stage [" + stageRecord.getStageRefID() + "] for recording", Project.MSG_DEBUG);
+ // check the stage logging.
+ validateStageRecorder(entry.getKey(), stageRecord);
+ String startTarget = stage.getStartTarget();
+ if (getProject().getTargets().containsKey(stage.getStartTarget())) {
+ Vector targets = getProject().topoSort(stage.getStartTarget(), getProject().getTargets(), false);
+ if (targets.size() != 0) {
+ startTarget = targets.firstElement().getName();
+ }
+ }
- /**
- * AntLoggingHandler constructor.
- *
- * @param proj
- */
- public AntLoggingHandler(Project proj) {
- project = proj;
- antLogLevel = new VerbosityLevelChoices();
- stagesMapping = new HashMap();
- stageRecordMap = new HashMap();
- depStartTargetMap = new HashMap>();
- stageStartTargetMap = new HashMap();
- initialize(project);
+ if (stageRecord.getOutput().exists()) {
+ long timestamp = System.currentTimeMillis();
+ log("Backing up of " + stageRecord.getOutput() + " into " + stageRecord.getOutput() + "."
+ + timestamp);
+ stageRecord.getOutput().renameTo(new File(stageRecord.getOutput().getAbsoluteFile() + "." + timestamp));
+ }
+
+ RecorderEntry recorderEntry = new RecorderEntry(stageRecord.getOutput());
+ recorderEntry.setMessageOutputLevel(stageRecord.getLogLevel());
+ recorderEntry.setEmacsMode(false);
+ recorderEntry.setRecordState(false);
+
+ // Make sure we cleanup the file now if needed.
+ if (stageRecord.getOutput().exists()) {
+ recorderEntry.openFile(stageRecord.getAppend());
+ recorderEntry.closeFile();
+ }
+
+ // Then add everything to the internal configuration
+ stageStartTargets.put(startTarget, stage);
+ stageEndTargets.put(stage.getEndTarget(), stage);
+ recorderEntries.put(stageRecord.getStageRefID(), recorderEntry);
+ } else {
+ throw new BuildException("Invalid stagerecord stageRefId attribute value, " +
+ "the '" + stageRecord.getStageRefID() + "' id doesn't refer to a stage type at " +
+ stageRecord.getLocation().toString());
+
+ }
+ } else {
+ throw new BuildException("Invalid stagerecord stageRefId attribute value, " +
+ "the '" + stageRecord.getStageRefID() + "' id doesn't exist at " +
+ stageRecord.getLocation().toString());
+ }
+ } else {
+ throw new BuildException("Invalid stagerecord configuration, " +
+ "the stageRefId attribute is not defined at " +
+ stageRecord.getLocation().toString());
+ }
+ }
+ }
+ if (defaultRecorderEntry != null) {
+ log("Registering the logging framework.", Project.MSG_DEBUG);
+ currentRecorderEntry = defaultRecorderEntry;
+ commonListener.register(this);
+ } else {
+ log("There must be one default stagerecord datatype. Logging framework will be disabled.");
+ }
+ }
+
+ private void validateStageInformation(String stageKey, Stage stage) {
+ if (stage.getStartTarget() == null) {
+ throw new BuildException("'starttarget' for stage '" + stageKey
+ + "' should not be null.");
+ }
+ if (stage.getEndTarget() == null) {
+ throw new BuildException("'endtarget' for stage '" + stageKey + "' should not be null.");
+ }
}
/**
- * Return the project associated to this Handler.
+ * To validate each stagelogging data type.
*
- * @return a project instance
+ * @param stagerefid
+ * @param stageLogging
+ */
+ private void validateStageRecorder(String stagerefid, StageRecord stageRecorder) {
+ if (stageRecorder.getOutput() == null) {
+ throw new BuildException("'output' attribute for stagelogging '" + stagerefid
+ + "' should not be null.");
+ }
+ }
+
+ /**
+ * A new stage is starting. Stop current log, then start stage specific log recording.
+ * @param target
+ * @param stage
*/
- public Project getProject() {
- return project;
+ protected void startStage(Target target, Stage stage) {
+ if (record && currentRecorderEntry != null) {
+ currentRecorderEntry.addLogMessage("Stop logging into " + currentRecorderEntry.getFilename() + " at " + getDateTime());
+ currentRecorderEntry.setRecordState(false);
+ currentRecorderEntry.closeFile();
+ commonListener.unRegister(currentRecorderEntry);
+ }
+ currentRecorderEntry = recorderEntries.get(stage.getStageName());
+ if (currentRecorderEntry == null) {
+ currentRecorderEntry = this.defaultRecorderEntry;
+ }
+ if (record) {
+ defaultRecorderEntry.reopenFile();
+ defaultRecorderEntry.addLogMessage("Start logging stage " + stage.getStageName() + " into " + currentRecorderEntry.getFilename() + " at " + getDateTime());
+ defaultRecorderEntry.closeFile();
+
+ currentRecorderEntry.reopenFile();
+ currentRecorderEntry.setRecordState(true);
+ currentRecorderEntry.addLogMessage("Start logging into " + currentRecorderEntry.getFilename() + " at " + getDateTime());
+ commonListener.register(currentRecorderEntry);
+ }
}
-
+
+ /**
+ * Current stage is ending. Stop recording current stage, and then switch to
+ * default log.
+ * @param target
+ * @param stage
+ */
+ protected void endStage(Target target, Stage stage) {
+ if (record && currentRecorderEntry != null) {
+ currentRecorderEntry.addLogMessage("Stop logging into " + currentRecorderEntry.getFilename() + " at " + getDateTime());
+ currentRecorderEntry.setRecordState(false);
+ currentRecorderEntry.closeFile();
+ commonListener.unRegister(currentRecorderEntry);
+ }
+ currentRecorderEntry = defaultRecorderEntry;
+ if (record) {
+ currentRecorderEntry.reopenFile();
+ currentRecorderEntry.setRecordState(true);
+ currentRecorderEntry.addLogMessage("Start logging into " + currentRecorderEntry.getFilename() + " at " + getDateTime());
+ commonListener.register(currentRecorderEntry);
+ }
+ }
+
/**
* {@inheritDoc}
*/
- public void handleTargetFinished(BuildEvent event) {
- // log.debug("Finished target [" + event.getTarget().getName() + "]");
- if (isEndTarget(event.getTarget().getName()) && getIsStageRecordingHappening()
- && (getLoggingStarted())) {
- log.debug("Stopping stage logging for [" + currentStageName + "] for target ["
- + event.getTarget().getName() + "]");
- stopLog(currentStageName, "default");
- if (!isDefaultStageStarted) {
- startLog("default");
- isDefaultStageStarted = true;
+ @Override
+ public synchronized void targetStarted(BuildEvent event) {
+ if (stageStartTargets.containsKey(event.getTarget().getName())) {
+ if (this.currentStage != null) {
+ endStage(event.getTarget(), currentStage);
}
- currentStageName = null;
+ currentStage = stageStartTargets.get(event.getTarget().getName());
+ startStage(event.getTarget(), currentStage);
}
}
/**
* {@inheritDoc}
*/
- public void handleTargetStarted(BuildEvent event) {
-
- // log.debug("Started target [" + event.getTarget().getName() + "]");
-
- if (getLoggingStarted() && !isDefaultStageStarted) {
- startLog("default");
- isDefaultStageStarted = true;
- }
-
- if (currentStageName == null && !getIsStageRecordingHappening() && getLoggingStarted()) {
- String stageName = isStageValid(event.getTarget(), event.getProject());
- if (stageName != null) {
- log.debug("Started stage logging for [" + stageName + "] for target ["
- + event.getTarget().getName() + "]");
-
- if (isDefaultStageStarted) {
- stopLog("default", stageName);
- isDefaultStageStarted = false;
- }
- startLog(stageName);
- currentStageName = stageName;
- }
+ @Override
+ public synchronized void targetFinished(BuildEvent event) {
+ if (currentStage != null && currentStage.getEndTarget().equals(event.getTarget().getName())) {
+ endStage(event.getTarget(), currentStage);
+ currentStage = null;
}
}
/**
* {@inheritDoc}
*/
- public void handleBuildStarted(BuildEvent event) {
- // Nothing to do
+ @Override
+ public void buildStarted(BuildEvent event) {
}
/**
* {@inheritDoc}
*/
- public void handleBuildFinished(BuildEvent event) {
-
- /*
- * If any stage logging is happening stop logging into stage log file and switch to
- * main/default ant log file.
- */
- if (getLoggingStarted() && getIsStageRecordingHappening()) {
- stopLog(currentStageName, "default");
- if (!isDefaultStageStarted) {
- startLog("default");
- isDefaultStageStarted = true;
- }
- currentStageName = null;
+ @Override
+ public synchronized void buildFinished(BuildEvent event) {
+ if (currentRecorderEntry != defaultRecorderEntry) {
+ currentRecorderEntry.addLogMessage("Stop logging into " + currentRecorderEntry.getFilename() + " at " + getDateTime());
+ currentRecorderEntry.setRecordState(false);
+ currentRecorderEntry.closeFile();
+ commonListener.unRegister(currentRecorderEntry);
+ currentRecorderEntry = defaultRecorderEntry;
}
-
- /*
- * If default stage logging happening stop logging into default ant log file.
- */
- if (isDefaultStageStarted && getLoggingStarted()) {
- stopLog("default", null, event);
- isDefaultStageStarted = false;
- }
- this.cleanup();
+ defaultRecorderEntry.reopenFile();
+ defaultRecorderEntry.setRecordState(true);
+ defaultRecorderEntry.addLogMessage("Start logging into " + defaultRecorderEntry.getFilename() + " at " + getDateTime());
+ defaultRecorderEntry.buildFinished(event);
+ defaultRecorderEntry.setRecordState(false);
+ defaultRecorderEntry.closeFile();
+ record = false;
}
/**
- * Returns recorder entry for logging current build process.
- *
- * @param name
- * @param proj
- * @return
+ * Define if the stage logging should be recording of not.
+ * @param record
*/
- protected RecorderEntry getRecorder(File name) {
- RecorderEntry entry = recorderEntries.get(name);
- if (entry == null) {
- // create a recorder entry
- entry = new RecorderEntry(name);
- recorderEntries.put(name, entry);
+ public synchronized void setRecordState(boolean record) {
+ this.record = record;
+ if (record) {
+ currentRecorderEntry.reopenFile();
+ currentRecorderEntry.setRecordState(true);
+ this.commonListener.register(this.currentRecorderEntry);
+ } else {
+ currentRecorderEntry.setRecordState(false);
+ this.commonListener.unRegister(this.currentRecorderEntry);
+ currentRecorderEntry.closeFile();
}
- return entry;
+ }
+
+ /**
+ * Adding a regular expression
+ * @param pattern
+ */
+ public void addRegexp(Pattern pattern) {
+ if (pattern != null) {
+ for (Entry entry : recorderEntries.entrySet()) {
+ RecorderEntry recorderEntry = entry.getValue();
+ recorderEntry.addRegexp(pattern);
+ }
+ }
}
/**
- * Sets the level to which this recorder entry should log to.
- *
- * @param level the level to set.
- * @see VerbosityLevelChoices
+ * Prunning a project/subproject from stage logger recording scope.
+ * @param project
*/
- public void setLoglevel(VerbosityLevelChoices level) {
- loglevel = level.getLevel();
+ public synchronized void addRecordExclusion(Project project) {
+ if (!recordExclusions.contains(project)) {
+ recordExclusions.add(project);
+ if (currentRecorderEntry != null) {
+ currentRecorderEntry.setExcludedProject(recordExclusions);
+ }
+ }
}
/**
- * A list of possible values for the setLoglevel()
method. Possible values include:
- * error, warn, info, verbose, debug.
- */
- public static class VerbosityLevelChoices extends LogLevel {
- }
-
- /**
- * To clean recorder entries.
+ * Allow an external task to add again a project into recording scope.
+ * @param project
*/
- private void cleanup() {
- log.debug("Cleaning up recorder entries of stagerecord");
- recorderEntries.clear();
- fileCreatedMap.clear();
-
+ public synchronized void removeRecordExclusion(Project project) {
+ recordExclusions.remove(project);
}
-
+
/**
- * To get current date and time.
- *
- * @return
+ * Get formated date and time
*/
private String getDateTime() {
DateFormat dateFormat = new SimpleDateFormat("EE yyyy/MM/dd HH:mm:ss:SS aaa");
@@ -219,446 +324,17 @@
}
/**
- * To get the current stage running.
- *
- * @return
- */
- public String getCurrentStageName() {
- return this.currentStageName;
- }
-
- /**
- * To do the logging actions depending on hlm:record actions.
- *
- * @param stageName
- * @param action
- * @param message
- * @param task
- */
- public void doLoggingAction(String stageName, boolean action, String message, Task task,
- Target target) {
- String time = getDateTime();
- File fileName;
- if (stageName.equalsIgnoreCase("default")) {
- if (stageRecordMap.get("default") == null) {
- throw new BuildException("stageRecordMap.get('default') is null");
- }
- fileName = stageRecordMap.get("default").getDefaultOutput();
- } else {
- fileName = stageRecordMap.get(stageName).getOutput();
- }
-
- if (fileName.exists()) {
- for (Map.Entry entry : recorderEntries.entrySet()) {
- if (fileName.equals(entry.getKey()) && (getRecorderEntry(fileName) != null)
- && (fileCreatedMap.get(fileName))) {
- RecorderEntry recorderEntry = getRecorderEntry(fileName);
- recorderEntry.addLogMessage(message + " logging into " + fileName + " from "
- + task.getTaskName() + " task at " + time);
- log.debug(message + " logging into " + fileName + " from " + task.getTaskName()
- + " task at " + time);
- recorderEntry.setRecordState(action);
- break;
- }
- }
- }
- }
-
- /**
- * Called by LogReplace task to find and replace any property values which are not updated.
- *
- * @param regExp
- */
- public void addRegExp(String regExp) {
- if (!regExp.equals("")) {
- for (Map.Entry entry : recorderEntries.entrySet()) {
- RecorderEntry recorderEntry = entry.getValue();
- recorderEntry.addRegexp(regExp);
- }
- }
- }
-
- /**
- * Initializing stage logging data.
- * Gathering all stagerecord.
- *
- * @param project
+ * {@inheritDoc}
*/
- @SuppressWarnings("unchecked")
- private void initialize(Project project) {
- Map references = (Hashtable)project.getReferences();
- //matchStageName(references, stageKey);
- for (Entry entry : references.entrySet()) {
- if (entry.getValue() instanceof StageLogging) {
- StageLogging tempStageLogging = (StageLogging)entry.getValue();
- // Is the stagerecord having a defaultoutput attribute,
- // if yes, it is the default recorder.
- if (tempStageLogging.getDefaultOutput() != null) {
- stageRecordMap.put("default", tempStageLogging);
- registerRecorderEntry(tempStageLogging.getDefaultOutput(), tempStageLogging, StatusAndLogListener.getStatusAndLogListener().getProject());
- } else if (tempStageLogging.getStageRefID() != null) {
- if (references.containsKey(tempStageLogging.getStageRefID())) {
- if (references.get(tempStageLogging.getStageRefID()) instanceof Stage) {
- // Check the stage
- Stage stage = (Stage)references.get(tempStageLogging.getStageRefID());
- validateStageInformation(tempStageLogging.getStageRefID(), stage);
- log.debug("Found stage [" + tempStageLogging.getStageRefID() + "] for recording");
- stagesMapping.put(tempStageLogging.getStageRefID(), stage);
- // check the stage logging.
- validateStageLogging(entry.getKey(), tempStageLogging);
- stageRecordMap.put(tempStageLogging.getStageRefID(), tempStageLogging);
- } else {
- throw new BuildException("Invalid stagerecord stageRefId attribute value, " +
- "the '" + tempStageLogging.getStageRefID() + "' id doesn't refer to a stage type at " +
- tempStageLogging.getLocation().toString());
-
- }
- } else {
- throw new BuildException("Invalid stagerecord stageRefId attribute value, " +
- "the '" + tempStageLogging.getStageRefID() + "' id doesn't exist at " +
- tempStageLogging.getLocation().toString());
- }
- } else {
- throw new BuildException("Invalid stagerecord configuration, " +
- "the stageRefId attribute is not defined at " +
- tempStageLogging.getLocation().toString());
- }
- }
- }
- if (!stageRecordMap.containsKey("default")) {
- throw new BuildException("There must be one default stagerecord datatype.");
- }
- }
-
- /**
- * To start logging for respective stage.
- *
- * @param stageName
- */
- private void startLog(String stageName) {
- File fileName;
- String message;
- String time = getDateTime();
- StageLogging stageLogging = null;
- log.debug("Starting logging for [" + stageName + "]");
- if (stageName.equals("default")) {
- fileName = stageRecordMap.get("default").getDefaultOutput();
- stageLogging = stageRecordMap.get("default");
- message = "Starting logging into " + fileName + " at " + time;
- }
- else {
- fileName = stageRecordMap.get(stageName).getOutput();
- stageLogging = stageRecordMap.get(stageName);
- this.isStageRecordingHappening = true;
- message = "Starting logging for " + stageName + " into " + fileName + " at " + time;
- }
- if (getRecorderEntry(fileName) != null) {
- RecorderEntry recorderEntry = getRecorderEntry(fileName);
- if (isFilePresent(recorderEntry, fileName, stageLogging)) {
- recorderEntry.setRecordState(true);
- recorderEntry.addLogMessage(message);
- }
- }
- }
-
- /**
- * To check is the file created.
- *
- * @param recorderEntry
- * @param fileName
- * @param stageLogging
- * @return
- */
- private boolean isFilePresent(RecorderEntry recorderEntry, File fileName,
- StageLogging stageLogging) {
- log.debug("isFilePresent? " + fileName);
- if (!fileCreatedMap.get(fileName)) {
- if (!fileName.getParentFile().exists()) {
- log.debug("Creating dir: " + fileName.getParentFile());
- fileName.getParentFile().mkdirs();
- }
- if (fileName.exists()) {
- long timestamp = System.currentTimeMillis();
- getProject().log("Backing up of " + fileName + " into " + fileName + "."
- + timestamp);
- fileName.renameTo(new File(fileName.getAbsoluteFile() + "." + timestamp));
- }
- recorderEntry.openFile(stageLogging.getAppend());
- fileCreatedMap.put(fileName, true);
- return true;
- }
- else {
- return true;
- }
-
- }
-
- /**
- * To stop logging for respective stage.
- *
- * @param stopStageName
- * @param startStageName
- */
- private void stopLog(String stopStageName, String startStageName) {
- stopLog(stopStageName, startStageName, null);
+ @Override
+ public void subBuildFinished(BuildEvent event) {
+ removeRecordExclusion(event.getProject());
}
/**
- * To stop logging for respective stage.
- *
- * @param stopStageName
- * @param startStageName
- * @param event
- */
- private void stopLog(String stopStageName, String startStageName, BuildEvent event) {
- File fileName;
- String message;
- String time = getDateTime();
- log.debug("Stopping logging for [" + stopStageName + "]");
- if (stopStageName.equals("default")) {
- fileName = stageRecordMap.get("default").getDefaultOutput();
- message = "Stopping logging into " + fileName + " at " + time;
- if (startStageName != null) {
- message = message + "\nStarting logging into "
- + stageRecordMap.get(startStageName).getOutput();
- }
- }
- else {
- fileName = stageRecordMap.get(stopStageName).getOutput();
- this.isStageRecordingHappening = false;
- message = "Stopping logging for " + stopStageName + " into " + fileName + " at " + time;
- if (startStageName != null) {
- message = message + "\nResuming logging into "
- + stageRecordMap.get("default").getDefaultOutput();
- }
- }
- if (getRecorderEntry(fileName) != null) {
- RecorderEntry recorderEntry = getRecorderEntry(fileName);
- if (event != null) {
- recorderEntry.handleBuildFinished(event);
- } else {
- recorderEntry.addLogMessage(message);
- recorderEntry.setRecordState(false);
- }
- }
- }
-
- /**
- * To register into recorder entry.
- *
- * @param fileName
- * @param stageLogging
- * @param proj
+ * {@inheritDoc}
*/
- private void registerRecorderEntry(File fileName, StageLogging stageLogging, Project proj) {
- log.debug("Registering recorderentry for log file [" + fileName + "]");
- RecorderEntry recorderEntry = getRecorder(fileName);
- antLogLevel.setValue(stageLogging.getLogLevel());
- this.setLoglevel(antLogLevel);
- recorderEntry.setMessageOutputLevel(loglevel);
- recorderEntry.setEmacsMode(false);
- recorderEntry.setRecordState(false);
- if (fileCreatedMap.get(fileName) == null) {
- fileCreatedMap.put(fileName, false);
- }
- }
-
- /**
- * To check is the stage valid for given start and end targets.
- *
- * @param target
- * @param proj
- * @return
- */
- private String isStageValid(Target target, Project proj) {
- // if
- // (!proj.getName().equals(StatusAndLogListener.getStatusAndLogListener().getProject().getName())
- // && (StatusAndLogListener.getStatusAndLogListener().getProject().getName() != null)) {
- initSubProjectDependentTarget(proj);
- // }
- for (Map.Entry entry : stagesMapping.entrySet()) {
- Stage stage = entry.getValue();
- if (stage.getStartTarget().equals(target.getName())
- && validateStageTargets(proj, stage.getStartTarget(), stage.getEndTarget())) {
- log.debug("Found stage [" + entry.getKey() + "] for target [" + target.getName()
- + "]");
- return entry.getKey();
- }
- if (stageStartTargetMap.get(entry.getKey()) != null) {
- if (stageStartTargetMap.get(entry.getKey()).getName().equals(target.getName())) {
- log.debug("Found stage [" + entry.getKey() + "] for dependent target ["
- + target.getName() + "]");
- return entry.getKey();
- }
- }
- else if (isDependentTarget(target, entry.getKey())) {
- log.debug("Found stage [" + entry.getKey() + "] for dependent target ["
- + target.getName() + "]");
- return entry.getKey();
- }
- }
- return null;
- }
-
- /**
- * To check, is the given target is end target for any stages.
- *
- * @param targetName
- * @return
- */
-
- private boolean isEndTarget(String targetName) {
- if (stagesMapping.get(currentStageName) != null) {
- return stagesMapping.get(currentStageName).getEndTarget().equals(targetName);
- }
- return false;
- }
-
- /**
- * To validate is the endtarget and starttarget are present in the current project.
- *
- * @param proj
- * @param startTarget
- * @param endTarget
- * @return
- */
-
- @SuppressWarnings("unchecked")
- private boolean validateStageTargets(Project proj, String startTarget, String endTarget) {
-
- Hashtable antTargets = proj.getTargets();
- return antTargets.containsKey(startTarget) && antTargets.containsKey(endTarget);
+ @Override
+ public void subBuildStarted(BuildEvent event) {
}
-
- /**
- * To check is recording is happening for any stages.
- *
- * @return
- */
- private boolean getIsStageRecordingHappening() {
- return this.isStageRecordingHappening;
- }
-
- /**
- * Is the given target is dependent target to start the stage.
- *
- * @param target
- * @param stageName
- * @return
- */
- private boolean isDependentTarget(Target target, String stageName) {
-
- if (depStartTargetMap.get(stageName) != null) {
- for (Target depTarget : depStartTargetMap.get(stageName)) {
- if (depTarget.getName().equals(target.getName())) {
- depStartTargetMap.remove(stageName);
- stageStartTargetMap.put(stageName, depTarget);
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * To initialize the dependent target and stages mapping.
- *
- * @param proj
- * @param stageKey
- * @param startTarget
- * @param endTarget
- */
- @SuppressWarnings("unchecked")
- private void initDependentTargetMap(Project proj, String stageKey, String startTarget,
- String endTarget) {
- Vector arrayList = null;
- if (validateStageTargets(proj, startTarget, endTarget)) {
- arrayList = proj.topoSort(startTarget, proj.getTargets(), false);
- log.debug("Target dependency for " + startTarget);
- for (Target target : arrayList) {
- log.debug(" Start Target : " + target.getName());
- }
- if (arrayList != null && arrayList.size() > 1) {
- depStartTargetMap.put(stageKey, arrayList);
- }
- }
-
- }
-
- /**
- * To init dependent targets for subproject.
- *
- * @param proj
- */
- private void initSubProjectDependentTarget(Project proj) {
-
- for (Map.Entry entry : stagesMapping.entrySet()) {
- if (depStartTargetMap.get(entry.getKey()) == null) {
- initDependentTargetMap(proj, entry.getKey(), entry.getValue().getStartTarget(), entry.getValue().getEndTarget());
- }
- }
- }
-
- /**
- * To validate stage information.
- *
- * @param stageKey
- * @param stage
- */
- private void validateStageInformation(String stageKey, Stage stage) {
-
- if (stage.getStartTarget() == null) {
- throw new BuildException("'starttarget' for stage '" + stageKey
- + "' should not be null.");
- }
-
- if (stage.getEndTarget() == null) {
- throw new BuildException("'endtarget' for stage '" + stageKey + "' should not be null.");
- }
- }
-
- /**
- * To validate each stagelogging data type.
- *
- * @param stagerefid
- * @param stageLogging
- */
- private void validateStageLogging(String stagerefid, StageLogging stageLogging) {
-
- if (stageLogging.getOutput() == null) {
- throw new BuildException("'output' attribute for stagelogging '" + stagerefid
- + "' should not be null.");
- }
- registerRecorderEntry(stageLogging.getOutput(), stageLogging, StatusAndLogListener.getStatusAndLogListener().getProject());
- }
-
- /**
- * To retrun recorderEntry of respective file.
- *
- * @param filename
- * @return
- */
- private RecorderEntry getRecorderEntry(File filename) {
- return recorderEntries.get(filename);
- }
-
- /**
- * Is recording started.
- *
- * @return
- */
- public boolean getLoggingStarted() {
- return loggingStarted;
- }
-
- /**
- * Set to recording started.
- *
- * @param loggingStarted
- */
- public void setLoggingStarted(boolean loggingStarted) {
- this.loggingStarted = loggingStarted;
- }
-
-}
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/BuildEventHandler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/BuildEventHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/BuildEventHandler.java Sun Oct 10 15:22:15 2010 +0300
@@ -31,13 +31,13 @@
*
* @param event is the build event to be handled.
*/
- void handleBuildStarted( BuildEvent event );
+ void buildStarted( BuildEvent event );
/**
* Method to handle build finish events.
*
* @param event is the build event to be handled.
*/
- void handleBuildFinished( BuildEvent event );
+ void buildFinished( BuildEvent event );
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/CommonListener.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/CommonListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.logger.ant.listener;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.BuildListener;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.SubBuildListener;
+
+/**
+ * CommonListener
implements {@link BuildListener} and listens to build events in
+ * particularly for activities such as ant logging and displaying build stage summary at the end of
+ * build process.
+ *
+ */
+public class CommonListener implements BuildListener, SubBuildListener {
+ private static CommonListener self;
+ private boolean initialized;
+
+ private List buildHandlers = new ArrayList();
+ private List targetHandlers = new ArrayList();
+ private List taskHandlers = new ArrayList();
+ private List messageHandlers = new ArrayList();
+ private List subBuildHandlers = new ArrayList();
+ private Project project;
+
+ /**
+ * Default constructor
+ */
+ public CommonListener() {
+ // Declaring ourself globally.
+ self = this;
+ }
+
+ /**
+ * Signals that the last target has finished. This event will still be fired if an error
+ * occurred during the build.
+ *
+ * @param event An event with any relevant extra information. Must not be null
.
+ *
+ * @see BuildEvent#getException()
+ */
+ public synchronized void buildStarted(BuildEvent event) {
+ project = event.getProject();
+ for (BuildEventHandler handler : buildHandlers) {
+ handler.buildStarted(event);
+ }
+ }
+
+ /**
+ * Signals that a build has started. This event is fired before any targets have started.
+ *
+ * @param event An event with any relevant extra information. Must not be null
.
+ */
+ public synchronized void buildFinished(BuildEvent event) {
+ for (BuildEventHandler handler : buildHandlers) {
+ handler.buildFinished(event);
+ }
+ }
+
+ /**
+ * Signals that a target is starting.
+ *
+ * @param event An event with any relevant extra information. Must not be null
.
+ *
+ * @see BuildEvent#getTarget()
+ */
+ public synchronized void targetStarted(BuildEvent event) {
+ if (!initialized) {
+ // Let's introspect current project for registarable objects
+ for (Object entry : getProject().getReferences().values()) {
+ if (entry instanceof CommonListenerRegister) {
+ ((CommonListenerRegister) entry).register(this);
+ if (entry instanceof BuildEventHandler) {
+ ((BuildEventHandler)entry).buildStarted(new BuildEvent(getProject()));
+ }
+ }
+ }
+ initialized = true;
+ }
+ for (TargetEventHandler handler : targetHandlers) {
+ handler.targetStarted(event);
+ }
+ }
+
+ /**
+ * Signals that a target has finished. This event will still be fired if an error occurred
+ * during the build.
+ *
+ * @param event An event with any relevant extra information. Must not be null
.
+ *
+ * @see BuildEvent#getException()
+ */
+ public synchronized void targetFinished(BuildEvent event) {
+ for (TargetEventHandler handler : targetHandlers) {
+ handler.targetFinished(event);
+ }
+ }
+
+ /**
+ * Signals that a task is starting.
+ *
+ * @param event An event with any relevant extra information. Must not be null
.
+ *
+ * @see BuildEvent#getTask()
+ */
+ public synchronized void taskStarted(BuildEvent event) {
+ for (TaskEventHandler handler : taskHandlers) {
+ handler.taskStarted(event);
+ }
+ }
+
+ /**
+ * Signals that a task has finished. This event will still be fired if an error occurred during
+ * the build.
+ *
+ * @param event An event with any relevant extra information. Must not be null
.
+ *
+ * @see BuildEvent#getException()
+ */
+ public synchronized void taskFinished(BuildEvent event) {
+ for (TaskEventHandler handler : taskHandlers) {
+ handler.taskFinished(event);
+ }
+ }
+
+ /**
+ * Signals that a subbuild has started. This event is fired before any targets have started.
+ *
+ * @param event
+ */
+ public synchronized void subBuildStarted(BuildEvent event) {
+ for (SubBuildEventHandler handler : subBuildHandlers) {
+ handler.subBuildStarted(event);
+ }
+ }
+
+ /**
+ * Signals that the last target has finished. This event will still be fired if an error
+ * occurred during the build.
+ *
+ * @param event
+ */
+
+ public synchronized void subBuildFinished(BuildEvent event) {
+ for (SubBuildEventHandler handler : subBuildHandlers) {
+ handler.subBuildStarted(event);
+ }
+ }
+
+ /**
+ * Signals a message logging event.
+ *
+ * @param event An event with any relevant extra information. Must not be null
.
+ *
+ * @see BuildEvent#getMessage()
+ * @see BuildEvent#getException()
+ * @see BuildEvent#getPriority()
+ */
+ public synchronized void messageLogged(BuildEvent event) {
+ for (MessageEventHandler handler : messageHandlers) {
+ handler.messageLogged(event);
+ }
+ }
+
+ /**
+ * Register the given handler.
+ *
+ * @param handler is the handler to register
+ */
+ public synchronized void register(Object handler) {
+ if (handler instanceof BuildEventHandler) {
+ // The duplication of the list prevents concurrent modification exception.
+ List temp = new ArrayList(buildHandlers);
+ temp.add((BuildEventHandler)handler);
+ buildHandlers = temp;
+ }
+ if (handler instanceof TargetEventHandler) {
+ List temp = new ArrayList(targetHandlers);
+ temp.add((TargetEventHandler)handler);
+ targetHandlers = temp;
+ }
+ if (handler instanceof TaskEventHandler) {
+ List temp = new ArrayList(taskHandlers);
+ temp.add((TaskEventHandler)handler);
+ taskHandlers = temp;
+ }
+ if (handler instanceof MessageEventHandler) {
+ List temp = new ArrayList(messageHandlers);
+ temp.add((MessageEventHandler)handler);
+ messageHandlers = temp;
+ }
+ }
+
+ /**
+ * Register the given handler.
+ *
+ * @param handler is the handler to register
+ */
+ public synchronized void unRegister(Object handler) {
+ if (handler instanceof BuildEventHandler) {
+ List temp = new ArrayList(buildHandlers);
+ temp.remove((BuildEventHandler)handler);
+ buildHandlers = temp;
+ }
+ if (handler instanceof TargetEventHandler) {
+ List temp = new ArrayList(targetHandlers);
+ temp.remove((TargetEventHandler)handler);
+ targetHandlers = temp;
+ }
+ if (handler instanceof TaskEventHandler) {
+ List temp = new ArrayList(taskHandlers);
+ temp.remove((TaskEventHandler)handler);
+ taskHandlers = temp;
+ }
+ if (handler instanceof MessageEventHandler) {
+ List temp = new ArrayList(messageHandlers);
+ temp.remove((MessageEventHandler)handler);
+ messageHandlers = temp;
+ }
+ }
+
+ /**
+ * Return root project.
+ *
+ * @return
+ */
+ public Project getProject() {
+ return project;
+ }
+
+ /**
+ * Get the main StatusAndLogListener.
+ *
+ * @return
+ */
+ public static CommonListener getCommonListener() {
+ return self;
+ }
+
+ /**
+ * Check and return required type handler.
+ *
+ * @param handlerType
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ public synchronized T getHandler(Class handlerType) {
+ for (BuildEventHandler handler : buildHandlers) {
+ if (handlerType.isInstance(handler)) {
+ return (T)handler;
+ }
+ }
+ for (TargetEventHandler handler : targetHandlers) {
+ if (handlerType.isInstance(handler)) {
+ return (T)handler;
+ }
+ }
+ for (TaskEventHandler handler : taskHandlers) {
+ if (handlerType.isInstance(handler)) {
+ return (T)handler;
+ }
+ }
+ for (MessageEventHandler handler : messageHandlers) {
+ if (handlerType.isInstance(handler)) {
+ return (T)handler;
+ }
+ }
+ for (SubBuildEventHandler handler : subBuildHandlers) {
+ if (handlerType.isInstance(handler)) {
+ return (T)handler;
+ }
+ }
+ return null;
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/CommonListenerRegister.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/CommonListenerRegister.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.logger.ant.listener;
+
+/**
+ * This interface defines an Ant type to be
+ * able automatically registered by the CommonListener.
+ *
+ */
+public interface CommonListenerRegister {
+
+ /**
+ * This method is call by the CommonListener while discovering
+ * reference implementing this interface.
+ *
+ * @param commonListener the commonListener to register to.
+ */
+ void register(CommonListener commonListener);
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/Handler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/Handler.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-package com.nokia.helium.logger.ant.listener;
-
-
-/**
- * Handler
is an interface which is used to handle the build events
- * which are of importance for ant logging and build stage summary display.
- *
- *
- */
-public interface Handler extends BuildEventHandler, TargetEventHandler {
-
-
-
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/MessageEventHandler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/MessageEventHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/MessageEventHandler.java Sun Oct 10 15:22:15 2010 +0300
@@ -29,6 +29,6 @@
* Method to handle SubBuild Started events.
* @param event
*/
- void handleMessageLogged( BuildEvent event );
+ void messageLogged(BuildEvent event);
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/RecorderEntry.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/RecorderEntry.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/RecorderEntry.java Sun Oct 10 15:22:15 2010 +0300
@@ -1,30 +1,33 @@
/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Contributors:
- *
- * Description:
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*
*/
+/* * Portion Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.*/
+
package com.nokia.helium.logger.ant.listener;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.log4j.Logger;
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DefaultLogger;
@@ -37,7 +40,7 @@
* @since Ant 1.4
*/
public class RecorderEntry implements BuildEventHandler, TargetEventHandler, TaskEventHandler,
- MessageEventHandler {
+ MessageEventHandler, SubBuildEventHandler {
/** The name of the file associated with this recorder entry. */
private File filename;
@@ -52,13 +55,16 @@
/** Strip task banners if true. */
private boolean emacsMode;
- private Pattern pattern;
+ // defines if this recorder entry should notify the stage logger about project to exclude from recording.
+ private boolean excludeSubProject;
+ private List excludedProjects = new ArrayList();
+ private List includedProjects = new ArrayList();
- private Vector logRegExps = new Vector();
- private Logger log = Logger.getLogger(getClass());
+ private List logRegExps = new ArrayList();
/**
- * @param name The name of this recorder (used as the filename).
+ * Create a RecorderEntry using a filename.
+ * @param name the filename of the log file.
*/
public RecorderEntry(File name) {
targetStartTime = System.currentTimeMillis();
@@ -66,6 +72,20 @@
}
/**
+ * New RecorderEntry using a filename and allow sub project exclusion.
+ * @param name the log filename
+ * @param excludeSubProject If true this recorder entry will notify
+ * the stage logger about projects to exclude
+ * from recording. If false, then only non-excluded
+ * project message will be handled.
+ */
+ public RecorderEntry(File name, boolean excludeSubProject) {
+ targetStartTime = System.currentTimeMillis();
+ filename = name;
+ this.excludeSubProject = true;
+ }
+
+ /**
* @return the name of the file the output is sent to.
*/
public File getFilename() {
@@ -96,8 +116,8 @@
*
* @param regexp
*/
- public void addRegexp(String regexp) {
- logRegExps.add(regexp);
+ public void addRegexp(Pattern pattern) {
+ logRegExps.add(pattern);
}
/**
@@ -111,7 +131,7 @@
* @see org.apache.tools.ant.BuildListener#buildStarted(BuildEvent)
*/
/** {@inheritDoc}. */
- public void handleBuildStarted(BuildEvent event) {
+ public void buildStarted(BuildEvent event) {
log("> BUILD STARTED", Project.MSG_DEBUG);
}
@@ -119,8 +139,8 @@
* @see org.apache.tools.ant.BuildListener#buildFinished(BuildEvent)
*/
/** {@inheritDoc}. */
- public void handleBuildFinished(BuildEvent event) {
- log.debug("< BUILD FINISHED");
+ public void buildFinished(BuildEvent event) {
+ log("< BUILD FINISHED", Project.MSG_DEBUG);
if (record && out != null) {
Throwable error = event.getException();
@@ -144,9 +164,16 @@
*
* @since Ant 1.6.2
*/
- public void handleSubBuildFinished(BuildEvent event) {
+ public void subBuildFinished(BuildEvent event) {
log("< SUBBUILD FINISHED", Project.MSG_DEBUG);
- // let's keep the logging ongoing, even if sub-build finishes.
+ if (excludeSubProject && CommonListener.getCommonListener() != null) {
+ AntLoggingHandler antLogger = CommonListener.getCommonListener().getHandler(AntLoggingHandler.class);
+ if (antLogger != null) {
+ antLogger.removeRecordExclusion(event.getProject());
+ }
+ }
+ excludedProjects.remove(event.getProject());
+ includedProjects.remove(event.getProject());
}
/**
@@ -156,73 +183,102 @@
*
* @since Ant 1.6.2
*/
- public void handleSubBuildStarted(BuildEvent event) {
+ public void subBuildStarted(BuildEvent event) {
log("< SUBBUILD STARTED", Project.MSG_DEBUG);
+ includedProjects.add(event.getProject());
+ if (excludeSubProject && CommonListener.getCommonListener() != null) {
+ AntLoggingHandler antLogger = CommonListener.getCommonListener().getHandler(AntLoggingHandler.class);
+ if (antLogger != null) {
+ antLogger.addRecordExclusion(event.getProject());
+ }
+ }
}
/**
* {@inheritDoc}
*/
- public void handleTargetStarted(BuildEvent event) {
- log(">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG);
- log(StringUtils.LINE_SEP + event.getTarget().getName() + ":", Project.MSG_INFO);
+ public void targetStarted(BuildEvent event) {
+ if ((!excludeSubProject && !excludedProjects.contains(event.getTarget().getProject())) ||
+ (this.excludeSubProject && this.includedProjects.contains(event.getTarget().getProject()))) {
+ log(">> TARGET STARTED -- " + event.getTarget(), Project.MSG_DEBUG);
+ log(StringUtils.LINE_SEP + event.getTarget().getName() + ":", Project.MSG_INFO);
+ }
targetStartTime = System.currentTimeMillis();
}
/**
* {@inheritDoc}
*/
- public void handleTargetFinished(BuildEvent event) {
- log("<< TARGET FINISHED -- " + event.getTarget(), Project.MSG_DEBUG);
+ public void targetFinished(BuildEvent event) {
+ if ((!excludeSubProject && !excludedProjects.contains(event.getTarget().getProject())) ||
+ (this.excludeSubProject && this.includedProjects.contains(event.getTarget().getProject()))) {
+ log("<< TARGET FINISHED -- " + event.getTarget(), Project.MSG_DEBUG);
- String time = formatTime(System.currentTimeMillis() - targetStartTime);
+ String time = formatTime(System.currentTimeMillis() - targetStartTime);
- log(event.getTarget() + ": duration " + time, Project.MSG_VERBOSE);
- flush();
+ log(event.getTarget() + ": duration " + time, Project.MSG_VERBOSE);
+ flush();
+ }
}
/**
* @see org.apache.tools.ant.BuildListener#taskStarted(BuildEvent)
*/
/** {@inheritDoc}. */
- public void handleTaskStarted(BuildEvent event) {
- log(">>> TASK STARTED -- " + event.getTask(), Project.MSG_DEBUG);
+ public void taskStarted(BuildEvent event) {
+ if ((!excludeSubProject && !excludedProjects.contains(event.getTask().getProject())) ||
+ (this.excludeSubProject && this.includedProjects.contains(event.getTask().getProject()))) {
+ log(">>> TASK STARTED -- " + event.getTask(), Project.MSG_DEBUG);
+ }
}
/**
* @see org.apache.tools.ant.BuildListener#taskFinished(BuildEvent)
*/
/** {@inheritDoc}. */
- public void handleTaskFinished(BuildEvent event) {
- log("<<< TASK FINISHED -- " + event.getTask(), Project.MSG_DEBUG);
- flush();
+ public void taskFinished(BuildEvent event) {
+ if ((!excludeSubProject && !excludedProjects.contains(event.getTask().getProject())) ||
+ (this.excludeSubProject && this.includedProjects.contains(event.getTask().getProject()))) {
+ log("<<< TASK FINISHED -- " + event.getTask(), Project.MSG_DEBUG);
+ flush();
+ }
}
/**
* @see org.apache.tools.ant.BuildListener#messageLogged(BuildEvent)
*/
/** {@inheritDoc}. */
- public void handleMessageLogged(BuildEvent event) {
- log("--- MESSAGE LOGGED", Project.MSG_DEBUG);
+ public void messageLogged(BuildEvent event) {
+ Project project = event.getProject();
+ if (project == null && event.getTask() != null) {
+ project = event.getTask().getProject();
+ }
+ if (project == null && event.getTarget() != null) {
+ project = event.getTarget().getProject();
+ }
+ if ((!excludeSubProject && !excludedProjects.contains(project))
+ || (excludeSubProject && includedProjects.contains(project))) {
+ log("--- MESSAGE LOGGED", Project.MSG_DEBUG);
- StringBuffer buf = new StringBuffer();
-
- if (event.getTask() != null) {
- String name = event.getTask().getTaskName();
+ StringBuilder buf = new StringBuilder();
- if (!emacsMode) {
- String label = "[" + name + "] ";
- int size = DefaultLogger.LEFT_COLUMN_SIZE - label.length();
+ if (event.getTask() != null) {
+ String name = event.getTask().getTaskName();
- for (int i = 0; i < size; i++) {
- buf.append(" ");
+ if (!emacsMode) {
+ String label = "[" + name + "] ";
+ int size = DefaultLogger.LEFT_COLUMN_SIZE - label.length();
+
+ for (int i = 0; i < size; i++) {
+ buf.append(" ");
+ }
+ buf.append(label);
}
- buf.append(label);
}
+ String messgeToUpdate = filterMessage(event.getMessage());
+ buf.append(messgeToUpdate);
+ log(buf.toString(), event.getPriority());
}
- String messgeToUpdate = filterMessage(event.getMessage());
- buf.append(messgeToUpdate);
- log(buf.toString(), event.getPriority());
}
/**
@@ -232,12 +288,9 @@
* @return
*/
private String filterMessage(String message) {
- for (String regExp : logRegExps) {
- pattern = Pattern.compile(regExp);
- if (pattern != null) {
- Matcher match = pattern.matcher(message);
- message = match.replaceAll("********");
- }
+ for (Pattern pattern : logRegExps) {
+ Matcher match = pattern.matcher(message);
+ message = match.replaceAll("********");
}
return message;
}
@@ -311,38 +364,6 @@
}
/**
- * Registering ourselves to the StatusAndLogListener.
- */
- public void register() {
- StatusAndLogListener listener = StatusAndLogListener.getStatusAndLogListener();
- if (listener != null) {
- this.log.debug("register");
- synchronized (listener) {
- listener.register((BuildEventHandler) this);
- listener.register((TargetEventHandler) this);
- listener.register((TaskEventHandler) this);
- listener.register((MessageEventHandler) this);
- }
- }
- }
-
- /**
- * Unregistering ourselves from the StatusAndLogListener.
- */
- public void unregister() {
- StatusAndLogListener listener = StatusAndLogListener.getStatusAndLogListener();
- if (listener != null) {
- this.log.debug("unregister");
- synchronized (listener) {
- listener.remove((MessageEventHandler) this);
- listener.remove((TaskEventHandler) this);
- listener.remove((TargetEventHandler) this);
- listener.remove((BuildEventHandler) this);
- }
- }
- }
-
- /**
* @since 1.6.2
*/
public void cleanup() {
@@ -355,11 +376,9 @@
* @since 1.6.3
*/
public void closeFile() {
- this.log.debug("closeFile.");
if (out != null) {
out.close();
out = null;
- unregister();
}
}
@@ -387,10 +406,11 @@
private void openFileImpl(boolean append) {
if (out == null) {
- this.log.debug("openFileImpl: " + filename);
try {
+ if (!filename.getParentFile().exists()) {
+ filename.getParentFile().mkdirs();
+ }
out = new PrintStream(new FileOutputStream(filename, append));
- register();
}
catch (IOException ioe) {
throw new BuildException("Problems opening file using a " + "recorder entry: "
@@ -405,8 +425,30 @@
* @param message
*/
public void addLogMessage(String message) {
- out.println(StringUtils.LINE_SEP + message);
+ if (out != null) {
+ out.println(StringUtils.LINE_SEP + message);
+ }
+ }
+ /**
+ *
+ * @param excludedProjects
+ */
+ public void setExcludedProject(List excludedProjects) {
+ this.excludedProjects = new ArrayList(excludedProjects);
}
+ /**
+ * Defines the root project a recorder entry should record
+ * from. (this one and sub-project). List will be cleared
+ * if the project is null.
+ * @param project
+ */
+ public void setRecorderProject(Project project) {
+ if (project != null) {
+ this.includedProjects.add(project);
+ } else {
+ this.includedProjects.clear();
+ }
+ }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/StageSummaryHandler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/StageSummaryHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/StageSummaryHandler.java Sun Oct 10 15:22:15 2010 +0300
@@ -29,7 +29,6 @@
import java.util.Map;
import java.util.Vector;
-import org.apache.log4j.Logger;
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -37,7 +36,6 @@
import org.apache.tools.ant.util.DateUtils;
import com.nokia.helium.core.ant.types.Stage;
-import com.nokia.helium.logger.ant.types.StageSummary;
import freemarker.cache.FileTemplateLoader;
import freemarker.template.Configuration;
@@ -49,72 +47,60 @@
* build process.
*
*/
-public class StageSummaryHandler implements Handler {
+public class StageSummaryHandler implements BuildEventHandler, TargetEventHandler {
public static final String PASSED = "PASSED";
public static final String FAILED = "FAILED";
- private Logger log = Logger.getLogger(getClass());
- private boolean lookup4Stages;
private boolean summarize;
+ private boolean initialized;
+
- private Map completedStages;
+ private Map completedStages = new LinkedHashMap();;
private StageWrapper currentStage;
private Hashtable stages;
private File template;
- /**
- * Create an instance of {@link StageSummaryHandler}
- *
- */
- public StageSummaryHandler() {
- completedStages = new LinkedHashMap();
- log.debug("StageStatusHandler instantiated");
+ public StageSummaryHandler(File template) {
+ this.template = template;
}
/**
* {@inheritDoc}
*/
- public void handleBuildStarted(BuildEvent event) {
+ public void buildStarted(BuildEvent event) {
}
/**
* {@inheritDoc}
*/
- public void handleBuildFinished(BuildEvent event) {
+ public void buildFinished(BuildEvent event) {
if (summarize && currentStage != null) {
endCurrentStage();
}
if (summarize && !completedStages.isEmpty()) {
generateSummary(event.getProject());
- log.debug("Stage Summary generation completed");
+ CommonListener.getCommonListener().getProject().log("Stage Summary generation completed", Project.MSG_DEBUG);
}
}
/**
* {@inheritDoc}
*/
- public void handleTargetStarted(BuildEvent event) {
- Project project = event.getProject();
- if (!summarize) {
- StageSummary stageSummary = getStageSummary(project);
- summarize = stageSummary != null
- && stageSummary.getTemplate() != null;
- lookup4Stages = summarize;
- template = stageSummary.getTemplate();
- log.debug("Is Project configured to display Stage Summary ? "
- + summarize);
+ public void targetStarted(BuildEvent event) {
+ if (!initialized) {
+ if (template != null) {
+ parseStages(event.getProject());
+ CommonListener.getCommonListener().getProject().log("Stage summary enabled...", Project.MSG_DEBUG);
+ summarize = true;
+ } else {
+
+ CommonListener.getCommonListener().getProject().log("Stage summary disabled because template is missing.", Project.MSG_DEBUG);
+ }
+ initialized = true;
}
- if (lookup4Stages) {
- log.debug("Loading stages....");
- parseStages(event.getProject());
- log.debug("Total no of stages loaded = " + stages.size());
- lookup4Stages = false;
- }
-
- log.debug("Handling target - " + event.getTarget().getName());
if (summarize && doRunTarget(event)) {
StageWrapper stage = searchNewStage(event);
if (stage != null) {
@@ -126,7 +112,7 @@
/**
* {@inheritDoc}
*/
- public void handleTargetFinished(BuildEvent event) {
+ public void targetFinished(BuildEvent event) {
if (summarize && isCurrentStageToEnd(event)) {
endCurrentStage();
}
@@ -155,32 +141,6 @@
}
/**
- * Method returns the configured {@link StageSummary}.
- *
- * @param project
- * is the project to lookup for stageSummary.
- * @return the {@link StageSummary}.
- */
- @SuppressWarnings("unchecked")
- private StageSummary getStageSummary(Project project) {
- StageSummary stageSummary = null;
- int count = 0;
- Hashtable references = project.getReferences();
- for (Enumeration en = references.keys(); en.hasMoreElements();) {
- Object object = references.get(en.nextElement());
- if (object instanceof StageSummary) {
- count++;
- if (count > 1) {
- throw new BuildException("Multiple entries of 'hlm:stagesummary' found in "
- + "stages_config.ant.xml.");
- }
- stageSummary = (StageSummary) object;
- }
- }
- return stageSummary;
- }
-
- /**
* Start the given stage as a new build stage.
*
* @param newStage
@@ -194,8 +154,8 @@
}
newStage.setStartTime(currTime);
this.currentStage = newStage;
- log.debug("New stage [" + newStage.stageName + "] started at "
- + getTimestamp(currTime));
+ CommonListener.getCommonListener().getProject().log("New stage [" + newStage.stageName + "] started at "
+ + getTimestamp(currTime), Project.MSG_DEBUG);
}
/**
@@ -214,8 +174,8 @@
currTime));
completedStages.put(currentStage.stageName, currentStage);
}
- log.debug("Stage [" + currentStage.stageName + "] finished at "
- + getTimestamp(currTime));
+ CommonListener.getCommonListener().getProject().log("Stage [" + currentStage.stageName + "] finished at "
+ + getTimestamp(currTime), Project.MSG_DEBUG);
currentStage = null;
}
}
@@ -333,7 +293,7 @@
if (template != null) {
try {
Configuration cfg = new Configuration();
- log.debug("Basedir: " + template.getParentFile());
+ CommonListener.getCommonListener().getProject().log("Basedir: " + template.getParentFile(), Project.MSG_DEBUG);
cfg.setTemplateLoader(new FileTemplateLoader(template
.getParentFile()));
Template templ = cfg.getTemplate(template.getName());
@@ -412,13 +372,13 @@
private void validateStageInformation(String stageKey, Stage stage) {
if (stage.getStartTarget() == null) {
- throw new BuildException("'starttarget' for stage '" + stageKey
- + "' should not be null.");
+ throw new BuildException("'starttarget' attribute for stage '" + stageKey
+ + "' is not defined.");
}
if (stage.getEndTarget() == null) {
- throw new BuildException("'endtarget' for stage '" + stageKey
- + "' should not be null.");
+ throw new BuildException("'endtarget' attribute for stage '" + stageKey
+ + "' is not defined.");
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/StatusAndLogListener.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/StatusAndLogListener.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-package com.nokia.helium.logger.ant.listener;
-
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.BuildListener;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.SubBuildListener;
-
-/**
- * StatusAndLogListener
implements {@link BuildListener} and listens to build events in
- * particularly for activities such as ant logging and displaying build stage summary at the end of
- * build process.
- *
- */
-public class StatusAndLogListener implements BuildListener, SubBuildListener {
- private static StatusAndLogListener self;
-
- private Vector buildHandlers = new Vector();
- private Vector targetHandlers = new Vector();
- private Vector taskHandlers = new Vector();
- private Vector messageHandlers = new Vector();
- private Vector subBuildHandlers = new Vector();
- private Project project;
- private Logger log = Logger.getLogger(getClass());
-
- /**
- * Default constructor
- */
- public StatusAndLogListener() {
- self = this;
- }
-
- /**
- * Signals that the last target has finished. This event will still be fired if an error
- * occurred during the build.
- *
- * @param event An event with any relevant extra information. Must not be null
.
- *
- * @see BuildEvent#getException()
- */
- public synchronized void buildStarted(BuildEvent event) {
- project = event.getProject();
- for (BuildEventHandler handler : buildHandlers) {
- handler.handleBuildStarted(event);
- }
-
- }
-
- /**
- * Signals that a build has started. This event is fired before any targets have started.
- *
- * @param event An event with any relevant extra information. Must not be null
.
- */
- public synchronized void buildFinished(BuildEvent event) {
- for (BuildEventHandler handler : buildHandlers) {
- handler.handleBuildFinished(event);
- }
- }
-
- /**
- * Signals that a target is starting.
- *
- * @param event An event with any relevant extra information. Must not be null
.
- *
- * @see BuildEvent#getTarget()
- */
- public synchronized void targetStarted(BuildEvent event) {
- for (TargetEventHandler handler : targetHandlers) {
- handler.handleTargetStarted(event);
- }
- }
-
- /**
- * Signals that a target has finished. This event will still be fired if an error occurred
- * during the build.
- *
- * @param event An event with any relevant extra information. Must not be null
.
- *
- * @see BuildEvent#getException()
- */
- public synchronized void targetFinished(BuildEvent event) {
- for (TargetEventHandler handler : targetHandlers) {
- handler.handleTargetFinished(event);
- }
- }
-
- /**
- * Signals that a task is starting.
- *
- * @param event An event with any relevant extra information. Must not be null
.
- *
- * @see BuildEvent#getTask()
- */
- public synchronized void taskStarted(BuildEvent event) {
- for (TaskEventHandler handler : taskHandlers) {
- handler.handleTaskStarted(event);
- }
- }
-
- /**
- * Signals that a task has finished. This event will still be fired if an error occurred during
- * the build.
- *
- * @param event An event with any relevant extra information. Must not be null
.
- *
- * @see BuildEvent#getException()
- */
- public synchronized void taskFinished(BuildEvent event) {
- for (TaskEventHandler handler : taskHandlers) {
- handler.handleTaskFinished(event);
- }
- }
-
- /**
- * Signals that a subbuild has started. This event is fired before any targets have started.
- *
- * @param event
- */
- public synchronized void subBuildStarted(BuildEvent event) {
- for (SubBuildEventHandler handler : subBuildHandlers) {
- handler.handleSubBuildStarted(event);
- }
- }
-
- /**
- * Signals that the last target has finished. This event will still be fired if an error
- * occurred during the build.
- *
- * @param event
- */
-
- public synchronized void subBuildFinished(BuildEvent event) {
- for (SubBuildEventHandler handler : subBuildHandlers) {
- handler.handleSubBuildStarted(event);
- }
- }
-
- /**
- * Signals a message logging event.
- *
- * @param event An event with any relevant extra information. Must not be null
.
- *
- * @see BuildEvent#getMessage()
- * @see BuildEvent#getException()
- * @see BuildEvent#getPriority()
- */
- public synchronized void messageLogged(BuildEvent event) {
- for (MessageEventHandler handler : messageHandlers) {
- handler.handleMessageLogged(event);
- }
- }
-
- /**
- * Register the given handler.
- *
- * @param handler is the handler to register
- */
- public synchronized void register(Handler handler) {
- Vector tmpBuildHandlers = new Vector(buildHandlers);
- tmpBuildHandlers.add(handler);
- buildHandlers = tmpBuildHandlers;
- Vector tmpTargetHandlers = new Vector(targetHandlers);
- tmpTargetHandlers.add(handler);
- targetHandlers = tmpTargetHandlers;
- }
-
- /**
- * Register the given handler.
- *
- * @param handler is the handler to register
- */
- public synchronized void remove(Handler handler) {
- Vector tmpBuildHandlers = new Vector(buildHandlers);
- tmpBuildHandlers.remove(handler);
- buildHandlers = tmpBuildHandlers;
- Vector tmpTargetHandlers = new Vector(targetHandlers);
- tmpTargetHandlers.remove(handler);
- targetHandlers = tmpTargetHandlers;
- }
-
- /**
- * Register the given handler.
- *
- * @param handler is the handler to register
- */
- public synchronized void register(BuildEventHandler handler) {
- Vector tmp = new Vector(buildHandlers);
- tmp.add(handler);
- buildHandlers = tmp;
- }
-
- /**
- * Remove the given handler.
- *
- * @param handler is the handler to register
- */
- public synchronized void remove(BuildEventHandler handler) {
- Vector tmp = new Vector(buildHandlers);
- tmp.remove(handler);
- buildHandlers = tmp;
- }
-
- /**
- * Register the given handler.
- *
- * @param handler is the handler to register
- */
- public synchronized void register(TargetEventHandler handler) {
- Vector tmp = new Vector(targetHandlers);
- tmp.add(handler);
- targetHandlers = tmp;
- }
-
- /**
- * Remove the given handler.
- *
- * @param handler is the handler to register
- */
- public synchronized void remove(TargetEventHandler handler) {
- Vector tmp = new Vector(targetHandlers);
- tmp.remove(handler);
- targetHandlers = tmp;
- }
-
- /**
- * Register the given SubBuildEventHandler.
- *
- * @param handler is the handler to register
- */
- public synchronized void register(SubBuildEventHandler handler) {
- Vector tmp = new Vector(subBuildHandlers);
- tmp.add(handler);
- subBuildHandlers = tmp;
- }
-
- /**
- * Remove the given SubBuildEventHandler.
- *
- * @param handler is the handler to register
- */
- public synchronized void remove(SubBuildEventHandler handler) {
- Vector tmp = new Vector(subBuildHandlers);
- tmp.remove(handler);
- subBuildHandlers = tmp;
- }
-
- /**
- * Register the given MessageEventHandler.
- *
- * @param handler is the handler to register
- */
- public synchronized void register(MessageEventHandler handler) {
- Vector tmp = new Vector(messageHandlers);
- tmp.add(handler);
- messageHandlers = tmp;
- }
-
- /**
- * Remove the given MessageEventHandler.
- *
- * @param handler is the handler to register
- */
- public synchronized void remove(MessageEventHandler handler) {
- Vector tmp = new Vector(messageHandlers);
- tmp.remove(handler);
- messageHandlers = tmp;
- }
-
- /**
- * Register the given TaskEventHandler.
- *
- * @param handler is the handler to register
- */
- public synchronized void register(TaskEventHandler handler) {
- Vector tmp = new Vector(taskHandlers);
- tmp.add(handler);
- taskHandlers = tmp;
- }
-
- /**
- * Remove the given TaskEventHandler.
- *
- * @param handler is the handler to register
- */
- public synchronized void remove(TaskEventHandler handler) {
- Vector tmp = new Vector(taskHandlers);
- tmp.remove(handler);
- taskHandlers = tmp;
- }
-
- /**
- * Return root project.
- *
- * @return
- */
- public Project getProject() {
- return project;
- }
-
- /**
- * Get the main StatusAndLogListener.
- *
- * @return
- */
- public static StatusAndLogListener getStatusAndLogListener() {
- return self;
- }
-
- /**
- * Check and return required type handler.
- *
- * @param handlerType
- * @return
- */
- public synchronized Handler getHandler(Class> handlerType) {
- for (BuildEventHandler handler : buildHandlers) {
- if (handlerType.isInstance(handler)) {
- return (Handler) handler;
- }
- }
- return null;
- }
-
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/SubBuildEventHandler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/SubBuildEventHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/SubBuildEventHandler.java Sun Oct 10 15:22:15 2010 +0300
@@ -30,12 +30,12 @@
* Method to handle SubBuild Started events.
* @param event
*/
- void handleSubBuildStarted( BuildEvent event );
+ void subBuildStarted( BuildEvent event );
/**
* Method to handle SubBuild Finished events.
* @param event
*/
- void handleSubBuildFinished( BuildEvent event );
+ void subBuildFinished( BuildEvent event );
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/TargetEventHandler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/TargetEventHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/TargetEventHandler.java Sun Oct 10 15:22:15 2010 +0300
@@ -32,13 +32,13 @@
* @param event
*/
- void handleTargetStarted( BuildEvent event );
+ void targetStarted( BuildEvent event );
/**
* Method to handle target finish events.
*
* @param event is the build event to be handled.
*/
- void handleTargetFinished( BuildEvent event );
+ void targetFinished( BuildEvent event );
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/TaskEventHandler.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/TaskEventHandler.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/TaskEventHandler.java Sun Oct 10 15:22:15 2010 +0300
@@ -31,13 +31,13 @@
*
* @param event is the build event to be handled.
*/
- void handleTaskFinished( BuildEvent event );
+ void taskFinished( BuildEvent event );
/**
* Method to handle Task Started( events.
*
* @param event is the build event to be handled.
*/
- void handleTaskStarted( BuildEvent event );
+ void taskStarted( BuildEvent event );
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogRecorderTask.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogRecorderTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogRecorderTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -30,13 +30,12 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.Recorder.VerbosityLevelChoices;
import org.apache.tools.ant.types.EnumeratedAttribute;
-import org.apache.tools.ant.types.LogLevel;
import com.nokia.helium.logger.ant.listener.AntLoggingHandler;
-import com.nokia.helium.logger.ant.listener.Handler;
import com.nokia.helium.logger.ant.listener.RecorderEntry;
-import com.nokia.helium.logger.ant.listener.StatusAndLogListener;
+import com.nokia.helium.logger.ant.listener.CommonListener;
import com.nokia.helium.logger.ant.types.RecordFilter;
import com.nokia.helium.logger.ant.types.RecordFilterSet;
@@ -51,11 +50,11 @@
*
*
*
- * @ant.task name="Record" category="Logging".
+ * @ant.task name="Record" category="Logging"
*
*/
-public class LogRecorderTask extends Task implements Handler {
+public class LogRecorderTask extends Task {
private static Hashtable recorderEntries = new Hashtable();
private File fileName;
@@ -74,18 +73,15 @@
* Run by the task.
*/
public void execute() {
- StatusAndLogListener statusAndLogListener = new StatusAndLogListener();
- AntLoggingHandler antLoggingHandler = new AntLoggingHandler(getProject());
- antLoggingHandler.setLoggingStarted(true);
- statusAndLogListener.register(antLoggingHandler);
+ CommonListener commonListener = CommonListener.getCommonListener();
- /* To validate attributes passed. */
+ // To validate attributes passed.
validateAttributes();
- /* to add regular filters */
+ // to add regular filters
addAllRecordFilters();
- /* Init password/record filter and replace any unset properties */
+ // Init password/record filter and replace any unset properties
initAndReplaceProperties();
//Create the root folder path.
@@ -117,30 +113,25 @@
recorder.setEmacsMode(emacsMode);
if (start != null) {
if (start.booleanValue()) {
- getProject().addBuildListener(statusAndLogListener);
- if (antLoggingHandler != null) {
- if (antLoggingHandler.getCurrentStageName() != null) {
- antLoggingHandler.doLoggingAction(antLoggingHandler.getCurrentStageName(), false, "Stopping", this, getOwningTarget());
- } else {
- antLoggingHandler.doLoggingAction("default", false, "Stopping", this, getOwningTarget());
- }
+ recorder.reopenFile();
+ commonListener.register(recorder);
+ recorder.setRecordState(start.booleanValue());
+ recorder.setRecorderProject(getProject());
+ AntLoggingHandler handler = commonListener.getHandler(AntLoggingHandler.class);
+ if (handler != null) {
+ handler.addRecordExclusion(getProject());
}
- recorder.reopenFile();
- recorder.setRecordState(start.booleanValue());
} else {
recorder.setRecordState(start.booleanValue());
recorder.closeFile();
- getProject().removeBuildListener(statusAndLogListener);
- if (antLoggingHandler != null) {
- if (antLoggingHandler.getCurrentStageName() != null) {
- antLoggingHandler.doLoggingAction(antLoggingHandler.getCurrentStageName(), true, "Starting", this, getOwningTarget());
- } else {
- antLoggingHandler.doLoggingAction("default", true, "Starting", this, getOwningTarget());
- }
+ commonListener.unRegister(recorder);
+ recorder.setRecorderProject(null);
+ AntLoggingHandler handler = commonListener.getHandler(AntLoggingHandler.class);
+ if (handler != null) {
+ handler.removeRecordExclusion(getProject());
}
}
}
-
}
/**
* To Validate is the fileName set for recording.
@@ -281,16 +272,7 @@
return VALUES;
}
}
-
- /**
- * To set the verbosity levels
- *
- *
- */
- public static class VerbosityLevelChoices extends LogLevel {
- }
-
-
+
/**
* To register the recorder entry
*/
@@ -298,11 +280,10 @@
RecorderEntry entry = recorderEntries.get(name);
if (entry == null) {
// create a recorder entry
- entry = new RecorderEntry(name);
+ entry = new RecorderEntry(name, true);
for (String regExp : regExpList) {
if (!regExp.equals("")) {
- String pattern = Pattern.quote(regExp);
- entry.addRegexp(pattern);
+ entry.addRegexp(Pattern.compile(Pattern.quote(regExp)));
}
}
entry.openFile(append);
@@ -320,23 +301,10 @@
}
}
- public void handleBuildFinished(BuildEvent event) {
- // TODO Auto-generated method stub
-
+ public void buildFinished(BuildEvent event) {
}
- public void handleBuildStarted(BuildEvent event) {
- // TODO Auto-generated method stub
-
- }
-
- public void handleTargetFinished(BuildEvent event) {
- // TODO Auto-generated method stub
- }
-
- public void handleTargetStarted(BuildEvent event) {
- // TODO Auto-generated method stub
-
+ public void buildStarted(BuildEvent event) {
}
/**
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogReplaceTask.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogReplaceTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogReplaceTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -23,7 +23,7 @@
import org.apache.tools.ant.Task;
import com.nokia.helium.logger.ant.listener.AntLoggingHandler;
-import com.nokia.helium.logger.ant.listener.StatusAndLogListener;
+import com.nokia.helium.logger.ant.listener.CommonListener;
/**
* To replace the property values with real values if the properties are not set at the begining of the build.
@@ -32,7 +32,7 @@
* <hlm:logreplace regexp="${property.not.set}"/>
*
*
- * @ant.task name="logreplace" category="Logging".
+ * @ant.task name="logreplace" category="Logging"
*/
public class LogReplaceTask extends Task {
@@ -43,20 +43,20 @@
*/
public void execute() {
- if (StatusAndLogListener.getStatusAndLogListener() == null) {
- this.log("The StatusAndLogListener is not available.", Project.MSG_WARN);
+ if (regExp == null ) {
+ throw new BuildException("'regexp' attribute should not be null.");
+ }
+
+ if (CommonListener.getCommonListener() == null) {
+ this.log("The common listener is not available.", Project.MSG_WARN);
return;
}
- AntLoggingHandler antLoggingHandler = (AntLoggingHandler)StatusAndLogListener.getStatusAndLogListener().getHandler(AntLoggingHandler.class);
-
- if (regExp == null ) {
- throw new BuildException("'regexp' attribute should not be null.");
- }
-
+ AntLoggingHandler antLoggingHandler = CommonListener.getCommonListener().getHandler(AntLoggingHandler.class);
if (antLoggingHandler != null) {
- String pattern = Pattern.quote(regExp);
- antLoggingHandler.addRegExp(pattern);
+ antLoggingHandler.addRegexp(Pattern.compile(Pattern.quote(regExp)));
+ } else {
+ log("Could not find the logging framework.", Project.MSG_WARN);
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/TriggerLoggerTask.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/TriggerLoggerTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/TriggerLoggerTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -16,12 +16,11 @@
*/
package com.nokia.helium.logger.ant.taskdefs;
-import org.apache.log4j.Logger;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import com.nokia.helium.logger.ant.listener.AntLoggingHandler;
-import com.nokia.helium.logger.ant.listener.StatusAndLogListener;
+import com.nokia.helium.logger.ant.listener.CommonListener;
/**
* This task is used to start the helium logging listener.
@@ -29,25 +28,19 @@
*/
public class TriggerLoggerTask extends Task {
- private Logger log = Logger.getLogger(TriggerLoggerTask.class);
public void execute() {
- log.debug("Registering Ant logging to StatusAndLogListener listener");
- if (StatusAndLogListener.getStatusAndLogListener() == null) {
- this.log("The StatusAndLogListener is not available.", Project.MSG_WARN);
+ log("Registering Ant logging to StatusAndLogListener listener", Project.MSG_DEBUG);
+ if (CommonListener.getCommonListener() == null) {
+ this.log("The CommonListener is not available.", Project.MSG_WARN);
return;
}
- AntLoggingHandler antLoggingHandler = new AntLoggingHandler(getProject());
- StatusAndLogListener.getStatusAndLogListener().register(antLoggingHandler);
- if (antLoggingHandler != null ) {
- if (!antLoggingHandler.getLoggingStarted()) {
- log.debug("Starting Logging using 'AntLoggingHandler' first time.");
- antLoggingHandler.setLoggingStarted(true);
- } else {
- log.debug("'AntLoggingHandler' is already started logging.");
- }
+ AntLoggingHandler handler = CommonListener.getCommonListener().getHandler(AntLoggingHandler.class);
+ if (handler != null) {
+ log("Starting logging framework.", Project.MSG_DEBUG);
+ handler.setRecordState(true);
} else {
- log.debug("Could not find the AntLoggingHandler instance.");
+ log("Could not find the logging listener.", Project.MSG_WARN);
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/RecordFilter.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/RecordFilter.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/RecordFilter.java Sun Oct 10 15:22:15 2010 +0300
@@ -28,7 +28,7 @@
* <hlm:recordfilter category="warn" regexp="^WARN"/>
*
*
- * @ant.task name="Recordfilter" category="Logging".
+ * @ant.task name="Recordfilter" category="Logging"
*
*/
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/RecordFilterSet.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/RecordFilterSet.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/RecordFilterSet.java Sun Oct 10 15:22:15 2010 +0300
@@ -35,7 +35,7 @@
*
*
*
- * @ant.task name="Recordfilterset" category="Logging".
+ * @ant.task name="Recordfilterset" category="Logging"
*
*/
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageLogging.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageLogging.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-package com.nokia.helium.logger.ant.types;
-
-import java.io.File;
-
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.types.DataType;
-
-/**
- * A 'StageRecord' is a Data type which stores attributes for stage recording/logging.
- *
- *
- * Usage:
- *
- * <hlm:stagerecord id="record.default" defaultoutput="${build.log.dir}/${build.id}_main.ant.log" loglevel="info" append="false"/>
- *
- *
- * <hlm:stagerecord id="record.prep"
- * stagerefid="preparation"
- * output="${build.log.dir}/${build.id}_prep.ant.log"
- * loglevel="info"
- * append="false"/>
- *
- *
- *
- *
- * @ant.task name="stagerecord" category="Logging"
- */
-public class StageLogging extends DataType {
-
- private static boolean isAntLoggerRegistered;
- private String logLevel = "info";
- private File logFile;
- private File defaultLogFile;
- private boolean append = true;
- private String stageRefId;
- private Logger log = Logger.getLogger(getClass());
-
-
- /**
- * Sets output log file name.
- * @param output the file to log into
- * @ant.required
- */
-
- public void setOutput(File output) {
- this.logFile = output;
- }
-
- /**
- * Returns output log file name.
- * @return
- */
-
- public File getOutput() {
- return this.logFile;
- }
-
- /**
- * Sets log level for respective stage.
- * @param logLevel
- * @ant.not-required
- */
-
- public void setLogLevel(String logLevel) {
- this.logLevel = logLevel;
- }
-
- /**
- * Returns log level of respective stage.
- * @return
- */
-
- public String getLogLevel() {
- return this.logLevel;
- }
-
- /**
- * Get the name of this StageRefID.
- *
- * @return name of the Phase.
- */
- public String getStageRefID() {
- return this.stageRefId;
- }
-
- /**
- * Set the name of the StageRefID.
- *
- * @param name
- * is the name to set.
- * @ant.required
- */
- public void setStageRefId(String name) {
- this.stageRefId = name;
- }
-
- /**
- * Return default ant log file name.
- * @return
- */
- public File getDefaultOutput() {
- return this.defaultLogFile;
- }
-
- /**
- * Set the default ant log name.
- * @param name
- * @ant.required
- */
- public void setDefaultOutput(File name) {
- this.defaultLogFile = name;
- }
-
- /**
- * Set append value.
- * @param append
- * @ant.not-required Default is true
- */
- public void setAppend(boolean append) {
- this.append = append;
- }
-
- /**
- * Return the append value.
- * @param append
- * @return
- */
- public boolean getAppend() {
- return this.append;
- }
-
-
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageRecord.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageRecord.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.logger.ant.types;
+
+import java.io.File;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Recorder.VerbosityLevelChoices;
+import org.apache.tools.ant.types.DataType;
+
+/**
+ * A 'StageRecord' is a Data type which stores attributes for stage recording/logging.
+ *
+ *
+ * Usage:
+ *
+ * <hlm:stagerecord id="record.default" defaultoutput="${build.log.dir}/${build.id}_main.ant.log" loglevel="info" append="false"/>
+ *
+ *
+ * <hlm:stagerecord id="record.prep"
+ * stagerefid="preparation"
+ * output="${build.log.dir}/${build.id}_prep.ant.log"
+ * loglevel="info"
+ * append="false"/>
+ *
+ *
+ *
+ *
+ * @ant.task name="stagerecord" category="Logging"
+ */
+public class StageRecord extends DataType {
+
+ private int logLevel = Project.MSG_INFO;
+ private File logFile;
+ private File defaultLogFile;
+ private boolean append = true;
+ private String stageRefId;
+
+ /**
+ * Sets output log file name.
+ * @param output the file to log into
+ * @ant.required
+ */
+
+ public void setOutput(File output) {
+ this.logFile = output;
+ }
+
+ /**
+ * Returns output log file name.
+ * @return
+ */
+
+ public File getOutput() {
+ return this.logFile;
+ }
+
+ /**
+ * Sets log level for respective stage.
+ * @param logLevel
+ * @ant.not-required
+ */
+
+ public void setLogLevel(VerbosityLevelChoices logLevel) {
+ this.logLevel = logLevel.getLevel();
+ }
+
+ /**
+ * Returns log level of respective stage.
+ * @return
+ */
+
+ public int getLogLevel() {
+ return this.logLevel;
+ }
+
+ /**
+ * Get the name of this StageRefID.
+ *
+ * @return name of the Phase.
+ */
+ public String getStageRefID() {
+ return this.stageRefId;
+ }
+
+ /**
+ * Set the name of the StageRefID.
+ *
+ * @param name
+ * is the name to set.
+ * @ant.required
+ */
+ public void setStageRefId(String name) {
+ this.stageRefId = name;
+ }
+
+ /**
+ * Return default ant log file name.
+ * @return
+ */
+ public File getDefaultOutput() {
+ return this.defaultLogFile;
+ }
+
+ /**
+ * Set the default ant log name.
+ * @param name
+ * @ant.required
+ */
+ public void setDefaultOutput(File name) {
+ this.defaultLogFile = name;
+ }
+
+ /**
+ * Set append value.
+ * @param append
+ * @ant.not-required Default is true
+ */
+ public void setAppend(boolean append) {
+ this.append = append;
+ }
+
+ /**
+ * Return the append value.
+ * @param append
+ * @return
+ */
+ public boolean getAppend() {
+ return this.append;
+ }
+
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageSummary.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageSummary.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageSummary.java Sun Oct 10 15:22:15 2010 +0300
@@ -18,12 +18,11 @@
import java.io.File;
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.DataType;
+import com.nokia.helium.logger.ant.listener.CommonListenerRegister;
import com.nokia.helium.logger.ant.listener.StageSummaryHandler;
-import com.nokia.helium.logger.ant.listener.StatusAndLogListener;
+import com.nokia.helium.logger.ant.listener.CommonListener;
/**
* StageSummary
is a Data type when set a build summary is
@@ -38,21 +37,9 @@
* @ant.task name="stagesummary" category="Logging"
*
*/
-public class StageSummary extends DataType {
-
- private static boolean isStageSummaryHandlerRegistered;
- private File template;
- private Logger log = Logger.getLogger(getClass());
+public class StageSummary extends DataType implements CommonListenerRegister {
- public void setProject(Project project)
- {
- super.setProject(project);
- if ( !isStageSummaryHandlerRegistered && StatusAndLogListener.getStatusAndLogListener() != null) {
- log.debug("Registering stage summary to the StatusAndLogListener listener");
- StatusAndLogListener.getStatusAndLogListener().register( new StageSummaryHandler() );
- isStageSummaryHandlerRegistered = true;
- }
- }
+ private File template;
/**
* Get the template used for displaying build stage summary.
@@ -73,4 +60,13 @@
public void setTemplate( File template ) {
this.template = template;
}
+
+ @Override
+ public void register(CommonListener commonListener) {
+ if (commonListener.getHandler(StageSummaryHandler.class) != null) {
+ log("Only one stageSummary configuration element should be used. Ignoring type at " + this.getLocation());
+ } else {
+ commonListener.register(new StageSummaryHandler(getTemplate()));
+ }
+ }
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/antunit/run-scenario.ant.xml
--- a/buildframework/helium/sf/java/logging/tests/antunit/run-scenario.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/antunit/run-scenario.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -21,36 +21,36 @@
============================================================================
-->
- Helium Antlib logger macro.
+ Helium Antlib logger macro.
-
-
-
- --------------------------------------------
-
+
+
+
+ --------------------------------------------
+
-
- --------------------------------------------
-
-
+
+ --------------------------------------------
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/antunit/test_recorder.ant.xml
--- a/buildframework/helium/sf/java/logging/tests/antunit/test_recorder.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/antunit/test_recorder.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -45,4 +45,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/antunit/test_stageslogging.ant.xml
--- a/buildframework/helium/sf/java/logging/tests/antunit/test_stageslogging.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/antunit/test_stageslogging.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -27,6 +27,10 @@
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/build_failure/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/build_failure/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/build_failure/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,6 +28,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/build_status/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/build_status/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/build_status/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,7 +28,8 @@
-
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/inavlid_stage_refid_object/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/inavlid_stage_refid_object/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/inavlid_stage_refid_object/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,6 +28,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/invalid_stage_refid/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/invalid_stage_refid/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/invalid_stage_refid/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,6 +28,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/logger/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/logger/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/logger/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -127,5 +127,17 @@
+
+
+
+
+
+
+
+ test1
+
+ Not in mainlog
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/missing_default_config/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/missing_default_config/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/missing_default_config/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,6 +28,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/missing_stage_refid/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/missing_stage_refid/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/missing_stage_refid/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,6 +28,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/override_scenario/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/override_scenario/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/override_scenario/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -28,6 +28,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/valid_build/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -39,8 +39,7 @@
-
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/scenarii/valid_build/stages_config.ant.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/stages_config.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/stages_config.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -27,7 +27,8 @@
-
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/logging/tests/stages_config.ant.xml
--- a/buildframework/helium/sf/java/logging/tests/stages_config.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/logging/tests/stages_config.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -27,7 +27,8 @@
-
+
+
@@ -38,6 +39,9 @@
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/doc/metadata.rst
--- a/buildframework/helium/sf/java/metadata/doc/metadata.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/doc/metadata.rst Sun Oct 10 15:22:15 2010 +0300
@@ -49,8 +49,8 @@
Overview
--------
-Metadata filters are set of regular expressions used to match the text of the build output and process the errors, categorize it,
-and used to generate the output for diamonds, summary file, email output. Predefined set of ids are defined for each stage of the
+Metadata filters are a set of regular expressions used to match the text of the build output and process the errors, categorize it,
+and used to generate the output for diamonds, summary file, email output. A predefined set of ids are defined for each stage of the
build. For example for raptor compilation filter is defined as below,
The default definition of filterset.sbs is
@@ -71,11 +71,11 @@
-The complete list of predefined ids for various stages of the build are defined in this file,
+The complete list of predefined ids for various stages of the build are defined in the file,
helium/config/metadata_filter_config_default.xml
-Each ID can be overridden to provide additional regular expression to control the results of the build for different stages.
+Each ID can be overridden to provide additional regular expressions to control the results of the build for different stages.
Two ways to add the regular expressions
---------------------------------------
@@ -104,9 +104,9 @@
Note
----
-1. The order of metadatafilter / metadatafilterset is important, so the first one takes precedence than the second one.
+1. The order of metadatafilter / metadatafilterset is important, so the first one takes precedence over the second one.
-2. Order is also preserved in the csv file, the expressions which are defined first get precedence than the later one.
+2. Order is also preserved in the csv file, the expressions which are defined first has precedence over the later one.
3. All the regular expressions are JAVA patterns.
@@ -181,14 +181,14 @@
Using the Metadata framework with FMPP
======================================
-The Metadata framework gives an efficient opportunity to record huge amount or data in a fast and reliable way (timewise and memory consumption-wise).
-Thanks to the ORMFMPPLoader database loader it is really simple to access those data and render then in any other format: HTML for easy to read build summary,
-XML to communicated with other tools, text file...
+The Metadata framework gives an efficient opportunity to record huge amounts of data in a fast and reliable way (timewise and memory consumption-wise).
+Thanks to the ORMFMPPLoader database loader it is really simple to access those data and render them in another format: HTML for easy to read build summary,
+XML to communicate with other tools, text file...
Loading a database
------------------
-A database can be load and assigned to a template variable using the pp.loadData functionnality from the FMPP task. The 'com.nokia.helium.metadata.ORMFMPPLoader'
+A database can be loaded and assigned to a template variable using the pp.loadData functionnality from the FMPP task. The 'com.nokia.helium.metadata.ORMFMPPLoader'
accept one argument which is the path to the database.
Example::
@@ -206,7 +206,7 @@
---------------------------------------
The 'jpasingle' is the best way to access results from single values like count of entities. The jpasingle queries must be written in JPQL,
-please check the valid database schema in the previous section (case matter!).
+please check the valid database schema in the previous section (case matters!).
Example of a template that will return the number of log files recorded in the database::
@@ -217,7 +217,7 @@
--------------------------------
The JPA query allows you to perform query and directly use JPA entity object directly inside the template. The jpa queries must be written in JPQL,
-please check the valid database schema in the previous section (case matter!).
+please check the valid database schema in the previous section (case matters!).
In the following example the query loop through the available log files::
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/antlib.xml
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -26,6 +26,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/CoverityLogMetaDataInput.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/CoverityLogMetaDataInput.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.helium.metadata.ant.types;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.Map;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+
+import com.nokia.helium.metadata.AutoCommitEntityManager;
+import com.nokia.helium.metadata.MetadataException;
+import com.nokia.helium.metadata.model.metadata.LogFile;
+import com.nokia.helium.metadata.model.metadata.MetadataEntry;
+import com.nokia.helium.metadata.model.metadata.Severity;
+import com.nokia.helium.metadata.model.metadata.SeverityDAO;
+
+/**
+ * This Type is to specify and use the text logparser type to parse and store the data.
+ * This type will not replace any string of format [ababa] with ""
+ *
+ * <hlm:metadatafilterset id="text_log_metadata_input">
+ * <metadatafilterset filterfile="${project.dir}/../data/common.csv" />
+ * </hlm:metadatafilterset>
+ *
+ * <hlm:coveritymetadatainput>
+ * <fileset dir="${project.dir}/../data/">
+ * <include name="*_fixslashes*.log"/>
+ * </fileset>
+ * <metadatafilterset refid="text_log_metadata_input" />
+ * </hlm:coveritymetadatainput>
+ *
+ *
+ * @ant.task name="coveritymetadatainput" category="Metadata"
+ */
+public class CoverityLogMetaDataInput extends TextLogMetaDataInput {
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void extract(EntityManagerFactory factory, File file) throws MetadataException {
+ EntityManager em = factory.createEntityManager();
+ AutoCommitEntityManager autoCommitEM = new AutoCommitEntityManager(factory);
+ try {
+ // Get the severities
+ SeverityDAO severityDao = new SeverityDAO();
+ severityDao.setEntityManager(em);
+ Map priorities = severityDao.getSeverities();
+
+ // Add a logfile entry into the database.
+ LogFile logFile = getLogFile(em, file);
+
+ // Start parsing
+ BufferedReader reader = new BufferedReader(new FileReader(file));
+ String logText = null;
+ int lineNumber = 0;
+ while ((logText = reader.readLine()) != null) {
+ lineNumber++;
+ SeverityEnum.Severity severity = getSeverity(logText);
+ if (severity != SeverityEnum.Severity.NONE) {
+ MetadataEntry entry = new MetadataEntry();
+ entry.setLogFile(autoCommitEM.merge(logFile));
+ entry.setLineNumber(lineNumber);
+ entry.setSeverity(autoCommitEM.merge(priorities.get(severity.toString())));
+ entry.setText(logText);
+ autoCommitEM.persist(entry);
+ }
+ }
+ reader.close();
+ } catch (FileNotFoundException ex) {
+ throw new MetadataException(ex.getMessage(), ex);
+ } catch (IOException ex) {
+ throw new MetadataException(ex.getMessage(), ex);
+ } finally {
+ if (autoCommitEM != null) {
+ autoCommitEM.close();
+ }
+ if (em != null) {
+ em.close();
+ }
+ }
+ }
+
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/IMakerLogMetaDataInput.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/IMakerLogMetaDataInput.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/IMakerLogMetaDataInput.java Sun Oct 10 15:22:15 2010 +0300
@@ -62,7 +62,7 @@
*/
public class IMakerLogMetaDataInput extends AbstractComponentBaseMetadataInput {
public static final String DEFAULT_COMPONENT_NAME = "General";
- private Pattern iMakerFpsxPattern = Pattern.compile("/([^/]*?\\.fpsx)");
+ private Pattern iMakerFpsxPattern = Pattern.compile("/([^/]*?\\.(?:fpsx|bin))");
private EntityManager entityManager;
/**
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/PolicyLogMetaDataInput.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/PolicyLogMetaDataInput.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/PolicyLogMetaDataInput.java Sun Oct 10 15:22:15 2010 +0300
@@ -124,23 +124,32 @@
public void startElement(String uri, String localName, String qName,
Attributes attributes) throws SAXException {
if (qName.equalsIgnoreCase("error")) {
- String errorType = attributes.getValue("", "type");
+ String errorType = attributes.getValue("type");
MetadataEntry me = new MetadataEntry();
me.setLogFile(autoCommitEM.merge(logFile));
me.setLineNumber(locator.getLineNumber());
me.setSeverity(severity);
if (errorType.equals("unknownstatus")) {
- me.setText(attributes.getValue("", "message") + attributes.getValue("", "value"));
+ me.setText(attributes.getValue("message") + attributes.getValue("value"));
} else if (errorType.equals("A") || errorType.equals("B")
|| errorType.equals("C") || errorType.equals("D")) {
int flags = Pattern.CASE_INSENSITIVE | Pattern.DOTALL ;
Pattern pattern = Pattern.compile("([\\\\/][^\\\\/]+?)$", flags);
me.setText(pattern.matcher(errorType + "Found incorrect value for "
- + attributes.getValue("", "message")).replaceAll(""));
+ + attributes.getValue("message")).replaceAll(""));
} else if (errorType.equals("missing")) {
- me.setText(attributes.getValue("", "message"));
+ me.setText(attributes.getValue("message"));
} else if (errorType.equals("invalidencoding")) {
- me.setText(attributes.getValue("", "message"));
+ me.setText(attributes.getValue("message"));
+ } else {
+ String message = errorType;
+ if (attributes.getValue("message") != null) {
+ message += " : " + attributes.getValue("message");
+ }
+ if (attributes.getValue("value") != null) {
+ message += ", " + attributes.getValue("value");
+ }
+ me.setText(message);
}
autoCommitEM.persist(me);
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefCollection.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefCollection.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefCollection.java Sun Oct 10 15:22:15 2010 +0300
@@ -44,7 +44,7 @@
@Column(name = "ID", nullable = false, unique = true, length = 255)
private String collectionId;
- @Column(name = "NAME", nullable = false, length = 255)
+ @Column(name = "NAME", length = 255)
private String name;
@Column(name = "PACKAGE_ID", insertable = false, updatable = false, nullable = false)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefComponent.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefComponent.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefComponent.java Sun Oct 10 15:22:15 2010 +0300
@@ -43,7 +43,7 @@
@Column(name = "ID", nullable = false, unique = true, length = 255)
private String componentId;
- @Column(name = "NAME", nullable = false, length = 255)
+ @Column(name = "NAME", length = 255)
private String name;
@Column(name = "COLLECTION_ID", insertable = false, updatable = false, nullable = false)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefPackage.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefPackage.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefPackage.java Sun Oct 10 15:22:15 2010 +0300
@@ -44,7 +44,7 @@
@Column(name = "ID", nullable = false, unique = true, length = 255)
private String packageId;
- @Column(name = "NAME", nullable = false, length = 255)
+ @Column(name = "NAME", length = 255)
private String name;
@OneToMany
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefPackage.java.orig
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/model/metadata/SysdefPackage.java.orig Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+package com.nokia.helium.metadata.model.metadata;
+
+import java.util.List;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToMany;
+
+/**
+ * This class represent the PACKAGE table in the
+ * database.
+ * Each package name will be unique across the build
+ * that is why it is not link to any specific logFile.
+ */
+@Entity
+public class SysdefPackage {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.SEQUENCE)
+ @Column(name = "PACKAGE_ID")
+ private int id;
+
+ @Column(name = "ID", nullable = false, unique = true, length = 255)
+ private String packageId;
+
+ @Column(name = "NAME", nullable = false, length = 255)
+ private String name;
+
+ @Column(name = "LOCATION", nullable = false, length = 4096)
+ private String location;
+
+ @OneToMany(cascade = CascadeType.REMOVE)
+ @JoinColumn(name = "PACKAGE_ID", referencedColumnName = "PACKAGE_ID")
+ private List components;
+
+ /**
+ * Set the id of the row.
+ * @param id
+ */
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ /**
+ * Get the id of the row.
+ * @return the id
+ */
+ public int getId() {
+ return id;
+ }
+
+ public void setPackageId(String packageId) {
+ this.packageId = packageId;
+ }
+
+ public String getPackageId() {
+ return packageId;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/tests/antunit/test_sysdef_input.ant.xml
--- a/buildframework/helium/sf/java/metadata/tests/antunit/test_sysdef_input.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/metadata/tests/antunit/test_sysdef_input.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -94,4 +94,36 @@
+
+
+
+
+
+
+
+
+ dbPath: ${test.temp.dir}/metadata_1_db
+ ant: antProperties()
+
+
+
+ package.count: ${package.count}
+ collection.count: ${collection.count}
+ component.count: ${component.count}
+ unit.count: ${unit.count}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/metadata/tests/data/sysdef/sysdef3_without_name.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/tests/data/sysdef/sysdef3_without_name.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CASummaryTask.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CASummaryTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CASummaryTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -24,10 +24,6 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.SortedSet;
-import java.util.TreeSet;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -43,6 +39,7 @@
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import org.xml.sax.SAXException;
+import org.apache.tools.ant.BuildException;
/**
@@ -65,10 +62,53 @@
public class CASummaryTask extends Task {
/** String used to look for the tag values in the header xml file **/
- private static String headerExpression = "//issuelist/headerfile/issue/typeid/text()";
+ private static final String HEADER_EXPRESSION = "//issuelist/headerfile/issue/typeid/text()";
/** String used to look for the tag values in the library xml file **/
- private static String libraryExpression = "//issuelist/library/issue/typeid/text()";
+ private static final String LIBRARY_EXPRESSION = "//issuelist/library/issue/typeid/text()";
+
+ /**maximum number of typeIDs available for the library compare file*/
+ private static final int MAX_NUM_TYPE_IDS = 15;
+
+ /** 0 to 14 typeID modes, supplied by Satarupa Pal. Add this i=to the output information to diamonds*/
+ private static final String[] TYPE_MODE = {
+ "unknown",
+ "removed",
+ "added",
+ "moved",
+ "deleted",
+ "inserted",
+ "modified",
+ "added",
+ "modified",
+ "modified",
+ "modified",
+ "modified",
+ "modified",
+ "removed",
+ "not available"};
+
+ /**
+ the BC library output file: xml paths required to retrieve the additional textual information.
+ */
+ private static final String[] SEARCH_PATHS = {
+ "//issuelist/library/issue[typeid = \"0\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"1\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"2\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"3\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"4\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"5\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"6\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"7\"]/bc_severity/text()",
+ "//issuelist/library/issue[typeid = \"8\"]/typeinfo/text()",
+ "//issuelist/library/issue[typeid = \"9\"]/typeinfo/text()",
+ "//issuelist/library/issue[typeid = \"10\"]/typeinfo/text()",
+ "//issuelist/library/issue[typeid = \"11\"]/typeinfo/text()",
+ "//issuelist/library/issue[typeid = \"12\"]/typeinfo/text()",
+ "//issuelist/library/issue[typeid = \"13\"]/typeinfo/text()",
+ "//issuelist/library/issue[typeid = \"14\"]/typeinfo/text()"};
+
+ private boolean failOnError; //init to default value false
/** The file containing the CA summary data */
private String inputFile;
@@ -172,6 +212,24 @@
return header;
}
+ /**
+ * Defines if the task should fail in case of error.
+ * @param failOnError
+ * @ant.not-required Default true
+ */
+ public void setFailOnError(boolean failOnError) {
+ this.failOnError = failOnError;
+ }
+
+ /**
+ * Shall we fail in case of issue.
+ * @return
+ */
+ public boolean shouldFailOnError() {
+ System.out.println(" failOnError = " + failOnError);
+ return failOnError;
+ }
+
/** the main part of the code - the method that is called */
public void execute() {
log("CASummaryTask execute method with input file : " + inputFile, Project.MSG_ERR);
@@ -189,25 +247,35 @@
log("FileNotFoundException while getting the input file. : " + inputFile + " "
+ exc.getMessage(), Project.MSG_ERR);
inputFileFound = false; // stops an empty output file being created.
+ if (shouldFailOnError()) {
+ throw new BuildException(exc.getMessage(), exc);
+ }
}
+
if (inputFileFound) {
try {
// write the title stuff for the XML diamonds schema
output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(getoutputFile()), "UTF8"));
- }
- catch (FileNotFoundException exc) {
+ } catch (FileNotFoundException exc) {
log("FileNotFoundException while getting the output file. : " + getoutputFile()
+ " " + exc.getMessage(), Project.MSG_ERR);
- }
- catch (UnsupportedEncodingException exc) {
+ if (shouldFailOnError()) {
+ throw new BuildException(exc.getMessage(), exc);
+ }
+ } catch (UnsupportedEncodingException exc) {
// We are Ignoring the errors as no need to fail the build.
log("UnsupportedEncodingException while creating the output file : "
+ getoutputFile() + " " + exc.getMessage(), Project.MSG_ERR);
- }
- catch (SecurityException exc) {
+ if (shouldFailOnError()) {
+ throw new BuildException(exc.getMessage(), exc);
+ }
+ } catch (SecurityException exc) {
// We are Ignoring the errors as no need to fail the build.
log("SecurityException while creating the output file : " + getoutputFile() + " "
+ exc.getMessage(), Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(exc.getMessage(), exc);
+ }
}
if (output != null) {
@@ -226,11 +294,11 @@
if (tempheader) {
output.write(" \r\n");
// process each line
- findTextAndOutput(headerExpression); // read input file and write the output
+ findHeaderTextAndOutput(HEADER_EXPRESSION); // read input file and write the output
} else {
output.write(" \r\n");
// process each line
- findTextAndOutput(libraryExpression); // read input file and write the output
+ findLibTextAndOutput(LIBRARY_EXPRESSION); // read input file and write the output
}
// write the end of file text
@@ -249,17 +317,26 @@
catch (FileNotFoundException exc) {
log("FileNotFoundException while getting the diamonds header file : "
+ getdiamondsHeaderFileName() + " " + exc.getMessage(), Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(exc.getMessage(), exc);
+ }
}
catch (IOException exc) {
// We are Ignoring the errors as no need to fail the build.
log("IOException : " + getdiamondsHeaderFileName() + " output file = "
+ getoutputFile() + " " + exc.getMessage(), Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(exc.getMessage(), exc);
+ }
}
catch (IllegalArgumentException exc) {
// We are Ignoring the errors as no need to fail the build.
log("IllegalArgumentException : " + getdiamondsHeaderFileName()
+ " output file = " + getoutputFile() + " " + exc.getMessage(), Project.MSG_ERR);
- }
+ if (shouldFailOnError()) {
+ throw new BuildException(exc.getMessage(), exc);
+ }
+ }
}
else {
log("Error: no output File available ", Project.MSG_ERR);
@@ -270,17 +347,187 @@
}
}
+ /**
+ class for recording the number of occurances of a typeID for the library comparison output.
+ */
+ private class HeaderInfo {
+ private int typeId;
+ private long numOccurances;
+
+ /**
+ * @param typeId the type ID of the issue
+ * @ant.required
+ */
+ private void settypeId(int typeId) {
+ this.typeId = typeId;
+ }
+
+ /**
+ * @return the typeID
+ */
+ private int gettypeId() {
+ return typeId;
+ }
+
+ /**
+ * @param numOccurances the number of times the type ID appears in the output file
+ * @ant.required
+ */
+ public void setnumOccurances(long numOccurances) {
+ this.numOccurances = numOccurances;
+ }
+
+ /**
+ * @return the number of occurrance of the typeID
+ */
+ public long getnumOccurances() {
+ return numOccurances;
+ }
+ }
+
+
/**
* This is the function that performs the actual file searches and writes the number of occurances
* of each typeID to the output xml file
*/
- private void findTextAndOutput(String expression) {
+ private void findHeaderTextAndOutput(String expression) {
String value;
- Integer count;
+
/** place to store the number of typeids found */
- Hashtable typeIds = new Hashtable();
+ HeaderInfo[] headerinf = new HeaderInfo[MAX_NUM_TYPE_IDS];
int tempKey;
- int tempVal;
+
+ //initialise the array of typeIDs
+ int sizevar = headerinf.length;
+ for (int i = 0; i < MAX_NUM_TYPE_IDS; i++) {
+ headerinf[i] = new HeaderInfo();
+ headerinf[i].typeId = i;
+ headerinf[i].numOccurances = 0;
+ }
+ try {
+ DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder builder = docFactory.newDocumentBuilder();
+ Document doc = builder.parse(getinputFile());
+
+ //creating an XPathFactory:
+ XPathFactory factory = XPathFactory.newInstance();
+ //using this factory to create an XPath object:
+ XPath xpath = factory.newXPath();
+ //XPath object created compiles the XPath expression:
+ XPathExpression expr = xpath.compile(expression);
+
+ //expression is evaluated with respect to a certain context node which is doc.
+ Object result = expr.evaluate(doc, XPathConstants.NODESET);
+ NodeList nodeList = (NodeList) result;
+ //and scan through the list
+ for (int i = 0; i < nodeList.getLength(); i++) {
+ value = nodeList.item(i).getNodeValue(); //get the value as a string from the xml file
+ tempKey = Integer.parseInt(value); //convert it to an integer
+ if (tempKey < MAX_NUM_TYPE_IDS) {
+ headerinf[tempKey].numOccurances++; //increase the number of occurances
+ } else {
+ log("tempKey out of range");
+ }
+ }
+
+ boolean noErrors = true; //so we print something when no data present
+ for (int i = 0; i < MAX_NUM_TYPE_IDS; i++) //typeIDS 1 to 14
+ {
+ if (headerinf[i].numOccurances != 0) {
+ noErrors = false;
+ String headSearchPath = "//issuelist/headerfile/issue[typeid = \"" + i + "\"]/typestring/text()";
+ //XPath object created compiles the XPath expression:
+ XPathExpression typeInfoExpr = xpath.compile(headSearchPath);
+ //expression is evaluated with respect to a certain context node which is doc.
+ Object typeInfoResult = typeInfoExpr.evaluate(doc, XPathConstants.NODESET);
+ NodeList typeInfoNodeList = (NodeList) typeInfoResult;
+ output.write(" \r\n");
+ }
+ }
+ if (noErrors) {
+ output.write(" \r\n");
+ }
+ } catch (ParserConfigurationException err) {
+ log("Error: ParserConfigurationException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
+ }
+ } catch (SAXException err) {
+ log("Error: SAXException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
+ }
+ } catch (XPathExpressionException err) {
+ log("Error: XPathExpressionException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
+ }
+ } catch (IOException err) {
+ log("Error: IOException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
+ }
+ }
+ }
+
+ /**
+ class for recording the number of occurances of a typeID for the library comparison output.
+ */
+ private class LibraryInfo {
+ private int typeId;
+ private long numOccurances;
+
+ /**
+ * @param typeId the type ID of the issue
+ * @ant.required
+ */
+ private void settypeId(int typeId) {
+ this.typeId = typeId;
+ }
+
+ /**
+ * @return the typeID
+ */
+ private int gettypeId() {
+ return typeId;
+ }
+
+ /**
+ * @param numOccurances the number of times the type ID appears in the output file
+ * @ant.required
+ */
+ public void setnumOccurances(long numOccurances) {
+ this.numOccurances = numOccurances;
+ }
+
+ /**
+ * @return the number of occurrance of the typeID
+ */
+ public long getnumOccurances() {
+ return numOccurances;
+ }
+ }
+
+ /**
+ * This is the function that performs the actual file searches and writes the number of occurances
+ * of each typeID to the output xml file
+ */
+ private void findLibTextAndOutput(String expression) {
+
+ String value;
+
+ /** place to store the number of typeids found */
+ LibraryInfo[] libraryinf = new LibraryInfo[MAX_NUM_TYPE_IDS];
+ int tempKey;
+
+ //initialise the array of typeIDs
+ int sizevar = libraryinf.length;
+ for (int i = 0; i < MAX_NUM_TYPE_IDS; i++) {
+ libraryinf[i] = new LibraryInfo();
+ libraryinf[i].typeId = i;
+ libraryinf[i].numOccurances = 0;
+ }
try {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
@@ -296,33 +543,55 @@
//expression is evaluated with respect to a certain context node which is doc.
Object result = expr.evaluate(doc, XPathConstants.NODESET);
+ //create a node list
NodeList nodeList = (NodeList) result;
+ //and scan through the list
for (int i = 0; i < nodeList.getLength(); i++) {
- value = nodeList.item(i).getNodeValue(); //get the value as a string from the xml file
- tempKey = Integer.parseInt(value); //convert it to an integer so they can be sorted
- if (!typeIds.containsKey(tempKey)) { //see if the typeID is already present in the hashtable
- typeIds.put(tempKey, 0); //it's not so create it (stops null pointer exceptions)
+ value = nodeList.item(i).getNodeValue(); //get the value as a string from the xml file
+ tempKey = Integer.parseInt(value); //convert it to an integer
+ if (tempKey < MAX_NUM_TYPE_IDS) {
+ libraryinf[tempKey].numOccurances++; //increase the number of occurances
+ } else {
+ log("tempKey out of range");
}
- count = typeIds.get(tempKey); //get the current count of this typeID
- count++; //inc the count
- typeIds.put(tempKey, count); //write it back to the hashtable
}
-
- //now sort and write to xml file
- SortedSet sortedset = new TreeSet(typeIds.keySet());
- Iterator sorted = sortedset.iterator();
- while (sorted.hasNext()) { //go through each one on the file and write to xml output file
- tempVal = sorted.next();
- output.write(" \r\n");
+
+ boolean noErrors = true; //so we print something when no data present
+ for (int i = 1; i < MAX_NUM_TYPE_IDS; i++) { //typeIDS 1 to 14
+ if (libraryinf[i].numOccurances != 0) {
+ noErrors = false;
+ //XPath object created compiles the XPath expression:
+ XPathExpression typeInfoExpr = xpath.compile(SEARCH_PATHS[i]);
+ //expression is evaluated with respect to a certain context node which is doc.
+ Object typeInfoResult = typeInfoExpr.evaluate(doc, XPathConstants.NODESET);
+ NodeList typeInfoNodeList = (NodeList) typeInfoResult;
+ output.write(" \r\n");
+ }
+ }
+ if (noErrors) {
+ output.write(" \r\n");
+ }
+ } catch (XPathExpressionException err) {
+ log("Error: XPathExpressionException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
}
} catch (ParserConfigurationException err) {
log("Error: ParserConfigurationException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
+ }
} catch (SAXException err) {
log("Error: SAXException: trying to parse xml file ", Project.MSG_ERR);
- } catch (XPathExpressionException err) {
- log("Error: XPathExpressionException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
+ }
} catch (IOException err) {
log("Error: IOException: trying to parse xml file ", Project.MSG_ERR);
+ if (shouldFailOnError()) {
+ throw new BuildException(err.getMessage(), err);
+ }
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTSummaryTask.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTSummaryTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTSummaryTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -304,7 +304,6 @@
lineLen = 0;
}
else {
- log("can't find the '=' at end of line ", Project.MSG_ERR);
lineLen = 0;
}
}
@@ -322,7 +321,6 @@
}
else {
lineLen = 0;
- log("can't find the digits at beg of line ", Project.MSG_ERR);
}
}
else {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTToolTask.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTToolTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTToolTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -49,7 +49,7 @@
* fileset: Location of the source files whose complexity is to be measured.
*
*
- * @ant.task name="cmt" category="Quality".
+ * @ant.task name="cmt" category="Quality"
*/
public class CMTToolTask extends Task {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CodeScannerTask.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CodeScannerTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CodeScannerTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -21,6 +21,7 @@
import java.util.Vector;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.ExecTask;
import org.apache.tools.ant.types.Path;
@@ -57,11 +58,13 @@
public class CodeScannerTask extends Task {
private Vector paths = new Vector();
private File configuration;
- private String dest;
+ private File dest;
private String format = "xml,html";
private boolean auto;
private File log;
- private boolean failonerror;
+ private boolean failonerror = true;
+ private String lxrURL;
+ private File sourceDir;
/**
* This defines if the task should fails in case of error while executing codescanner.
@@ -86,7 +89,7 @@
* Get dest attribute.
*
*/
- public String getDest() {
+ public File getDest() {
return this.dest;
}
@@ -96,7 +99,7 @@
* @param dest
* @ant.required
*/
- public void setDest(String dest) {
+ public void setDest(File dest) {
this.dest = dest;
}
@@ -157,17 +160,33 @@
}
/**
+ * Set lxr URL to update the codescanner html output files.
+ * @param lxrURL the lxrURL to set
+ */
+ public void setLxrURL(String lxrURL) {
+ this.lxrURL = lxrURL;
+ }
+
+ /**
+ * Set the source folder path in case lxr URL property is set.
+ * @param sourceDir the sourceDir to set
+ */
+ public void setSourceDir(File sourceDir) {
+ this.sourceDir = sourceDir;
+ }
+
+ /**
* {@inheritDoc}
*/
@Override
public void execute() {
// creating the exec subtask
ExecTask task = new ExecTask();
- task.setProject(getProject());
- task.setTaskName(this.getTaskName());
+ task.bindToOwner(this);
task.setFailonerror(failonerror);
task.setExecutable("codescanner");
task.setDir(new File("."));
+ String commandString = "codescanner";
if (dest == null) {
throw new BuildException("'dest' attribute must be defined");
}
@@ -178,6 +197,7 @@
else {
task.createArg().setValue("-c");
task.createArg().setValue(configuration.getAbsolutePath());
+ commandString += " -c " + configuration.getAbsolutePath();
}
}
else {
@@ -190,7 +210,7 @@
// -t off
task.createArg().setValue("-t");
task.createArg().setValue(auto ? "on" : "off");
-
+ commandString += " -t " + (auto ? "on" : "off");
// -l log
if (log != null) {
this.log("Output log: " + log.getAbsolutePath());
@@ -201,34 +221,66 @@
// -o type
task.createArg().setValue("-o");
task.createArg().setValue(format);
- if (paths.isEmpty()) {
- throw new BuildException("No input directory defined");
- }
- // Getting the list of source dir to scan
- Vector srcs = new Vector();
- for (Path path : paths) {
- if (path.isReference()) {
- path = (Path) path.getRefid().getReferencedObject();
+ commandString += " -o " + format;
+
+ if (this.lxrURL != null ) {
+ if (this.sourceDir == null) {
+ throw new BuildException("'sourceDir' attribute must be defined");
+ }
+ if (!paths.isEmpty() ) {
+ throw new BuildException("Nested path element are not allowed when lxrURL attribute is in use.");
+ }
+ task.createArg().setValue("-x");
+ task.createArg().setValue(this.lxrURL);
+ commandString += " -x " + this.lxrURL;
+ task.createArg().setValue(sourceDir.getAbsolutePath());
+ commandString += " " + sourceDir.getAbsolutePath();
+ } else {
+ if (paths.isEmpty()) {
+ throw new BuildException("No input directory defined");
}
- for (String apath : path.list()) {
- srcs.add(apath);
+
+ // Getting the list of source dir to scan
+ Vector srcs = new Vector();
+ for (Path path : paths) {
+ if (path.isReference()) {
+ path = (Path) path.getRefid().getReferencedObject();
+ }
+ for (String apath : path.list()) {
+ srcs.add(apath);
+ }
+ }
+ for (int i = 0; i < srcs.size(); i++) {
+ if (i != srcs.size() - 1) {
+ task.createArg().setValue("-i");
+ task.createArg().setValue(srcs.elementAt(i));
+ commandString += " -i " + srcs.elementAt(i);
+ }
+ else {
+ task.createArg().setValue(srcs.elementAt(i));
+ commandString += " " + srcs.elementAt(i);
+ }
}
}
- for (int i = 0; i < srcs.size(); i++) {
- if (i != srcs.size() - 1) {
- task.createArg().setValue("-i");
- task.createArg().setValue(srcs.elementAt(i));
- }
- else {
- task.createArg().setValue(srcs.elementAt(i));
- task.createArg().setValue(dest.toString());
+
+ // output path
+ task.createArg().setValue(dest.getAbsolutePath());
+ commandString += " " + dest.getAbsolutePath();
+ this.log("Output dir " + dest.getAbsolutePath());
+
+ // Run codescanner
+ try {
+ log("Running codescanner with arguments '" + commandString + "'");
+ task.execute();
+ } catch (BuildException be) {
+ if (this.failonerror) {
+ throw new BuildException("Errors occured while running 'codescanner'", be);
+ } else {
+ log("Errors occured while running 'codescanner' " + be.getMessage(), Project.MSG_ERR);
}
}
- // output path
- this.log("Output dir " + dest);
-
- // Run codescanner
- task.execute();
+
+
this.log("Successfully executed codescanner");
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CoverityTask.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CoverityTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CoverityTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -23,6 +23,7 @@
import org.apache.tools.ant.Task;
import org.apache.tools.ant.taskdefs.ExecTask;
+import com.nokia.helium.core.ant.MappedVariable;
import com.nokia.helium.core.ant.types.VariableImpl;
import com.nokia.helium.core.ant.types.VariableSet;
@@ -40,7 +41,7 @@
*
*
*
- * @ant.task name="coverity" category="Quality".
+ * @ant.task name="coverity" category="Quality"
*
*/
@@ -51,6 +52,7 @@
private boolean execute = true;
private boolean append;
private File error;
+ private File output;
private String dir;
private Vector coverityOptions = new Vector();
private Vector coverityArgs = new Vector();
@@ -81,17 +83,32 @@
task.setTaskName(this.getTaskName());
task.setFailonerror(failOnError);
task.setError(this.error);
+ if (this.output != null) {
+ task.setOutput(this.output);
+ }
task.setAppend(isAppend());
task.setExecutable(command);
task.setDir(new File(this.dir));
for (VariableSet coverityArg : coverityOptions) {
+
+ for (MappedVariable variable : coverityArg.getVariables()) {
+ if (variable.getName().equals("--password") || variable.getName().equals("-pa")) {
+ commandString += " " + variable.getName() + " ********";
+ } else {
+ commandString += " " + variable.getName() + " " + variable.getValue();
+ }
+ }
task.createArg().setLine(coverityArg.getParameter(" "));
- commandString += " " + coverityArg.getParameter(" ");
+
}
for (VariableImpl coverityArg : coverityArgs) {
+ if (coverityArg.getName().equals("--password") || coverityArg.getName().equals("-pa")) {
+ commandString += " " + coverityArg.getName() + " ********";
+ } else {
+ commandString += " " + coverityArg.getName() + " " + coverityArg.getValue();
+ }
task.createArg().setLine(coverityArg.getParameter(" "));
- commandString += " " + coverityArg.getParameter(" ");
}
try {
@@ -183,6 +200,20 @@
}
/**
+ * @param output the output to set
+ */
+ public void setOutput(File output) {
+ this.output = output;
+ }
+
+ /**
+ * @return the output
+ */
+ public File getOutput() {
+ return output;
+ }
+
+ /**
* @param append the append to set
*/
public void setAppend(boolean append) {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/antunit/test_ca.ant.xml
--- a/buildframework/helium/sf/java/quality/tests/antunit/test_ca.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/tests/antunit/test_ca.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -32,7 +32,6 @@
-
@@ -57,12 +56,11 @@
- output file is ${diamonds.build.output.dir}
${header.ok}
-
+
@@ -95,10 +93,27 @@
${header.notypeids}
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${header.no.issues}
+
+
@@ -117,15 +132,37 @@
${libraries.ok}
+ substring="typeID:6:mode:modified:None:occurs" />
+
+
+
+
+
+
-
+
+
+
+ inputFile="${test.data.src}/libraries_report_fail.xml"
+ failOnError="${bc.fail.on.error}" />
+
+
+
+
+
+
+
@@ -144,8 +181,53 @@
${libraries.one.id}
+ substring="typeID:7:mode:added:Informative:occurs" />
+
+
+
+
+
+
+
+
+
+
+
+ ${libraries.no.id}
+
+
+
+
+
+
+
+
+
+
+
+ ${libraries.no.issues}
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/antunit/test_codescanner.ant.xml
--- a/buildframework/helium/sf/java/quality/tests/antunit/test_codescanner.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/tests/antunit/test_codescanner.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -62,6 +62,7 @@
configuration="${codescanner.config}">
+
@@ -113,4 +114,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/data/headers_report_noissues.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/quality/tests/data/headers_report_noissues.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\include\_sdpdefs.h
+
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\include\_sipcodecdefs.h
+
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\include\animationcmd.h
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/data/headers_report_ok.xml
--- a/buildframework/helium/sf/java/quality/tests/data/headers_report_ok.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/tests/data/headers_report_ok.xml Sun Oct 10 15:22:15 2010 +0300
@@ -31,6 +31,7 @@
60
13
13
+ has compilation errors
1
BBC Break
@@ -48,6 +49,22 @@
62
13
13
+ has compilation errors
+ File
+
+ 1
+ BBC Break
+
+
+ 1
+ SC Break
+
+
+
+ 63
+ 6
+ 13
+ has changed parameters
File
1
@@ -66,6 +83,7 @@
5
0
13
+ has been removed
1
BBC Break
@@ -75,6 +93,35 @@
SC Break
+
+ 519
+ 13
+ has compilation errors
+
+ Not specified
+
+ 1
+ BBC Break
+
+
+
+
+ c:\symbian\9.2\s60_3rd_fp1_2\epoc32\include\avkon.rh
+ j:\epoc32\include\platform\mw\avkon.rh
+
+
+ 0
+ 12
+ has changed its initialisation value
+ avkon_multiselection_list_query_list::flags
+ Not specifiedavkon_multiselection_list_query_list::flags
+
+ 1
+ SC Break
+
+
+ xZxyUIjD0pqjT
+ platform\mw\avkon.rh
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/data/libraries_report_no_ids.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/quality/tests/data/libraries_report_no_ids.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\aknicon.dso
+ armv5
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/data/libraries_report_noissues.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/quality/tests/data/libraries_report_noissues.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\aknicon.dso
+ armv5
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\release\armv5\lib\hal.dso
+ J:\epoc32\release\armv5\lib\hal.dso
+ hal
+ armv5
+ armv5
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\release\armv5\lib\irs.dso
+ J:\epoc32\release\armv5\lib\irs.dso
+ irs
+ armv5
+ armv5
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/data/libraries_report_ok.xml
--- a/buildframework/helium/sf/java/quality/tests/data/libraries_report_ok.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/tests/data/libraries_report_ok.xml Sun Oct 10 15:22:15 2010 +0300
@@ -23,7 +23,7 @@
-->
-
+
C:\Symbian\9.2\S60_3rd_FP1_2\aknicon.dso
armv5
@@ -36,49 +36,191 @@
Informative
None
-
-
- C:\Symbian\9.2\S60_3rd_FP1_2\aknnotify.dso
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\release\armv5\lib\hal.dso
+ J:\epoc32\release\armv5\lib\hal.dso
+ hal
+ armv5
+ armv5
+
+ 13
+ DLL is missing in current SDK
+ BBC Break
+ None
+ OK
+
+
+ 14
+ Baseline DLL is not available for analysis
+ Informative
+ None
+
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\release\armv5\lib\irs.dso
+ J:\epoc32\release\armv5\lib\irs.dso
+ irs
+ armv5
+ armv5
+
+ 14
+ Baseline DLL is not available for analysis
+ Informative
+ None
+
- 6
- Possible BBC Break
- SC Break
+ 8
+ Target type/UID1 has been changed
+ BBC Break
+ None
- 7
- Informative
- None
-
-
-
- C:\Symbian\9.2\S60_3rd_FP1_2\animation.dso
-
- 7
- Informative
+ 9
+ UID2 has been changed
+ BBC Break
None
- 14
- Informative
+ 10
+ UID3 has been changed
+ BBC Break
None
-
-
- C:\Symbian\9.2\S60_3rd_FP1_2\animationshared.dso
-
- 14
- Informative
- None
-
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\release\armv5\lib\lmkcommonui.dso
+
+ lmkcommonui
+ armv5
+
+
+ 1
+ BBC Break
+ SC Break
+
+
+ 13
+ DLL is missing in current SDK
+ BBC Break
+ None
+
+
+
+
+ J:\epoc32\release\armv5\lib\HelloWorldAPI.dso
+ HelloWorldAPI
+
+ armv5
+
+ 2
+ Informative
+ Informative
+
+
+ 4
+ vtable for CommsDat::CCDDefaultCDMA2000SettingsRecord
+ 222
+ BBC Break
+ SC Break
+ OK
+ Studied and approved..
+
+
+ 5
+ typeinfo for CommsDat::CCDCprRecord
+ 257
+ BBC Break
+ None
+ OK
+ CCDCprRecord is part of internal technology..
+
+
+ 3
+ typeinfo for CommsDat::CCDIAPPrioritySelectionPolicyRecord
+ 257
+ 289
+ BBC Break
+ None
+ OK
+ Constructor is part of internal technology..
+
+
+ 5
+ typeinfo for CommsDat::CCDLEAPRecord
+ 258
+ BBC Break
+ None
+
+
+ 3
+ vtable for CommsDat::CCDAccessPointRecord
+ 258
+ 281
+ BBC Break
+ None
+ OK
+ Constructor is part of internal technology..
+
+
+
+ C:\Symbian\9.2\S60_3rd_FP1_2\epoc32\release\armv5\lib\cone.dso
+ J:\epoc32\release\armv5\lib\cone.dso
+ cone
+ armv5
+ armv5
+
+ 6
+ CCoeControl::SetGc(CWindowGc*) const
+ CCoeControl::SetCustomGc(CWindowGc*)
+ 470
+ None
+ SC Break
+ OK
+ Function names changed but entry points and arg lists retained. Old names deprecated. an inline trampoline exists for both removed functions. This is OK.
+
+
+ 6
+ CCoeTextDrawerBase::CCoeTextDrawerBase_Reserved2()
+ CCoeTextDrawerBase::DrawTextVertical(CGraphicsContext&, TCoeTextTypeAdaptor const&, CFont const&, TRect const&, TRect const&, int) const
+ 536
+ None
+ SC Break
+ OK
+ Reserved function has been renamed.
+
+
+ 4
+ CCoePlainTextDrawer::Construct()
+ 552
+ BBC Break
+ SC Break
+ OK
+ Private function, which is not called from any inline functions.
+
+
+ 6
+ CCoeControl::GetGc() const
+ CCoeControl::CustomGc() const
+ 619
+ Possible BBC Break
+ Possible SC Break
+ OK
+ Function name has changed, which is ok.
+
+
+ 7
+ CCoeEnv::ScreenDevice(int) const
+ 716
+ Informative
+ None
+
+
+ 7
+ CCoeEnv::RootWin(int) const
+ 717
+ Informative
+ None
+
-
- C:\Symbian\9.2\S60_3rd_FP1_2\apfile.dso
-
- 4
- BBC Break
- SC Break
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/quality/tests/data/libraries_report_one_id.xml
--- a/buildframework/helium/sf/java/quality/tests/data/libraries_report_one_id.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/quality/tests/data/libraries_report_one_id.xml Sun Oct 10 15:22:15 2010 +0300
@@ -31,11 +31,6 @@
Informative
None
-
- 7
- Informative
- None
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/sbs/doc/sbsctc.rst
--- a/buildframework/helium/sf/java/sbs/doc/sbsctc.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/sbs/doc/sbsctc.rst Sun Oct 10 15:22:15 2010 +0300
@@ -73,4 +73,10 @@
-
\ No newline at end of file
+
+
+ or
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/scm/tests/antunit/abstract_unittest_scmtask.ant.xml
--- a/buildframework/helium/sf/java/scm/tests/antunit/abstract_unittest_scmtask.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/scm/tests/antunit/abstract_unittest_scmtask.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -288,7 +288,7 @@
-
+
Not in repo
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/build.xml
--- a/buildframework/helium/sf/java/signaling/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -22,10 +22,6 @@
-->
Helium Antlib signaling.
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/signaling.rst
--- a/buildframework/helium/sf/java/signaling/signaling.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/signaling.rst Sun Oct 10 15:22:15 2010 +0300
@@ -104,8 +104,6 @@
-Detailed documentation of the notifier interface could be found `here <../../helium-antlib/index.html>`_.
-
Example: configuring compileSignal
----------------------------------
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/signalingCreateANewSignal.rst
--- a/buildframework/helium/sf/java/signaling/signalingCreateANewSignal.rst Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/signalingCreateANewSignal.rst Sun Oct 10 15:22:15 2010 +0300
@@ -69,7 +69,7 @@
The signalListenerConfig defines which target to listen and raise signal for. The target name is defined through the **target** attribute.
Then the nested **targetCondition** element is used to configure how the signal should be triggered.
-This element accepts any nested `Ant conditions `_.
+This element accepts any nested `Ant conditions `_.
In this case the signal will get raised only if the file is not present after the execution of the **custom-action** target.
The framework then uses the defined signalInput from the signalNotifierInput configuration to know how to behave when the signal is raised. In the previous example it will
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/Notifier.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/Notifier.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-package com.nokia.helium.signal;
-
-import org.apache.tools.ant.Project;
-
-import com.nokia.helium.signal.ant.types.NotifierInput;
-
-/**
- * This interface describe what method a Notifier needs to implement.
- *
- */
-public interface Notifier {
-
- /**
- * Setting the project.
- *
- * @param project
- */
- void setProject(Project project);
-
- /**
- * Sends the data to the requested sender list with specified notifier
- *
- * @param signalName is the name of the signal that has been raised.
- * @param failStatus indicates whether to fail the build or not
- * @param notifierInput contains signal notifier info
- * @param message is the message from the signal that has been raised.
- */
- void sendData(String signalName, boolean failStatus,
- NotifierInput notifierInput, String message );
-
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalExceptionMessage.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalExceptionMessage.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:To print the message on the shell in case of build fails for deffered Signals.
- *
- */
-
-package com.nokia.helium.signal;
-
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DataType;
-
-import com.nokia.helium.core.ant.HlmExceptionHandler;
-
-/**
- * Class to check the signal is present in the deferred and now signal list.
- * Print the message on the shell "Build completed with errors and warnings".
- *
- */
-
-public class SignalExceptionMessage extends DataType implements
- HlmExceptionHandler {
- private Logger log = Logger.getLogger(SignalExceptionMessage.class);
-
- /**
- * Implements the Exception method to print the build completed message.
- *
- * @param project
- * @param module
- * @param e
- */
- public void handleException(Project project, Exception e) {
-
- if (SignalStatusList.getDeferredSignalList().hasSignalInList()) {
- log.info("Build completed with errors and warnings.");
- }
-
- if (SignalStatusList.getNowSignalList().hasSignalInList()) {
- log.info("Build completed with errors and warnings.");
- }
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalNeverFailMessage.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalNeverFailMessage.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: To print the message on the shell in case of build has errors
- * is user sets failbuild status to never in signal configuration file.
- *
- */
-
-package com.nokia.helium.signal;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DataType;
-
-import com.nokia.helium.core.ant.PostBuildAction;
-
-/**
- * Class to check the signal is present in the never signal list. Print the
- * message on the shell "Build completed with errors and warnings".
- *
- */
-public class SignalNeverFailMessage extends DataType implements PostBuildAction {
-
- /**
- * Override execute method to print build completed message.
- *
- * @param prj
- * @param module
- * @param targetNames
- */
- public void executeOnPostBuild(Project project, String[] targetNames) {
- if (SignalStatusList.getNeverSignalList().hasSignalInList()) {
- project.log(SignalStatusList.getNeverSignalList().getErrorMsg());
- }
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalStatus.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalStatus.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-package com.nokia.helium.signal;
-
-import java.util.Date;
-
-/**
- * Signal data holder;
- */
-public class SignalStatus {
-
- // Signal attributes.
- private String name;
- private String message;
- private String targetName;
- private Date signalTimeStamp;
-
- /**
- * Deferred signal holder.
- *
- * @param signalName
- * name of the signal been raised
- * @param message
- * message for the user
- * @param targetName
- * current target.
- */
- public SignalStatus(String signalName, String message, String targetName, Date signalDateAndTime) {
- this.name = signalName;
- this.message = message;
- this.targetName = targetName;
- this.signalTimeStamp = signalDateAndTime;
-
- }
- /**
- * Returns the signal message.
- * @return
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Returns signal name.
- * @return
- */
- public String getName() {
- return name;
- }
-
- /**
- * Returns target name.
- * @return
- */
- public String getTargetName() {
- return targetName;
- }
-
- /**
- * Returns signal date and time.
- * @return
- */
- public Date getTimestamp() {
- return signalTimeStamp;
- }
-
- /**
- * Converts signal status object to string.
- */
- public String toString() {
- return name + ": " + message + " : " + targetName;
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalStatusList.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/SignalStatusList.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-package com.nokia.helium.signal;
-
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-
-/**
- * This class implements at storage for SignalStatus object.
- * It cannot be instantiated, it must be used through the typed list:
- * getDeferredSignalList, getNowSignalList, getNeverSignalList
- *
- */
-public final class SignalStatusList {
-
- private static SignalStatusList deferSignalList = new SignalStatusList();
- private static SignalStatusList nowSignalList = new SignalStatusList();
- private static SignalStatusList neverSignalList = new SignalStatusList();
-
- private Vector signals = new Vector();
-
- private Logger log = Logger.getLogger(this.getClass());
-
-
- private SignalStatusList() { }
-
- /**
- * Get the list of stored SignalStatus object.
- * @return a Vector of SignalStatus instances.
- */
- public Vector getSignalStatusList() {
- return new Vector(signals);
- }
-
- /**
- * Add a SignalStatus object to the list.
- *
- * @param status
- * a signal
- */
- public void addSignalStatus(SignalStatus status) {
- log.debug("SignalStatusList:addSignalStatus:msg:" + status);
- signals.add(status);
- }
-
- /**
- * Converts the error list into a user readable message.
- *
- * @return the error message.
- */
- public String getErrorMsg() {
- StringBuffer statusBuffer = new StringBuffer();
- for (SignalStatus signalStatus : signals) {
- statusBuffer.append(signalStatus);
- statusBuffer.append("\n");
- }
- log.debug("getErrorMsg:msg:" + statusBuffer.toString());
- return statusBuffer.toString();
- }
-
- /**
- * Check if it has any pending signals stored.
- *
- * @return true if any signal are pending.
- */
- public boolean hasSignalInList() {
- log.debug("asDeferMsgInList:size:"
- + signals.size());
- return signals.size() > 0;
- }
-
- /**
- * Clear all deferred signals.
- */
- public void clearStatusList() {
- log.debug("clearStatusList:size1:"
- + signals.size());
- signals.clear();
- log.debug("clearStatusList:size2:"
- + signals.size());
- }
-
- /*
- * Returns the deferred signal list.
- */
- public static SignalStatusList getDeferredSignalList() {
- return deferSignalList;
- }
-
- /*
- * Returns the now signal list.
- */
- public static SignalStatusList getNowSignalList() {
- return nowSignalList;
- }
-
- /*
- * Returns the never signal list.
- */
- public static SignalStatusList getNeverSignalList() {
- return neverSignalList;
- }
-
-}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/Notifier.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/Notifier.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.helium.signal.ant;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.ResourceCollection;
+
+/**
+ * This interface describe what method a Notifier needs to implement.
+ *
+ */
+public interface Notifier {
+
+ /**
+ * Setting the project.
+ *
+ * @param project
+ */
+ void setProject(Project project);
+
+ /**
+ * Sends the data to the requested sender list with specified notifier
+ *
+ * @param signalName is the name of the signal that has been raised.
+ * @param failStatus indicates whether to fail the build or not
+ * @param notifierInput contains signal notifier info, collection of resources.
+ * @param message is the message from the signal that has been raised.
+ */
+ void sendData(String signalName, boolean failStatus,
+ ResourceCollection notifierInput, String message );
+
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalExceptionMessage.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalExceptionMessage.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:To print the message on the shell in case of build fails for deffered Signals.
+ *
+ */
+
+package com.nokia.helium.signal.ant;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.core.ant.HlmExceptionHandler;
+
+/**
+ * Class to check the signal is present in the deferred and now signal list.
+ * Print the message on the shell "Build completed with errors and warnings".
+ *
+ */
+
+public class SignalExceptionMessage extends DataType implements
+ HlmExceptionHandler {
+
+ /**
+ * Implements the Exception method to print the build completed message.
+ *
+ * @param project
+ * @param module
+ * @param e
+ */
+ public void handleException(Project project, Exception e) {
+ if (!Signals.getSignals().getDeferredSignalList().isEmpty()
+ || !Signals.getSignals().getNowSignalList().isEmpty()) {
+ log("Build completed with errors and warnings.", Project.MSG_WARN);
+ }
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalList.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalList.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of the License "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.helium.signal.ant;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.apache.tools.ant.taskdefs.condition.Condition;
-
-import com.nokia.helium.signal.Notifier;
-import com.nokia.helium.signal.SignalStatus;
-import com.nokia.helium.signal.SignalStatusList;
-import com.nokia.helium.signal.ant.types.NotifierInput;
-import com.nokia.helium.signal.ant.types.SignalInput;
-import com.nokia.helium.signal.ant.types.SignalListenerConfig;
-import com.nokia.helium.signal.ant.types.SignalNotifierInput;
-import com.nokia.helium.signal.ant.types.SignalNotifierList;
-import com.nokia.helium.signal.ant.types.TargetCondition;
-
-/**
- * Helper class to store the list of notifiers.
- */
-public class SignalList {
-
- // default id list name
- public static final String DEFAULT_NOTIFIER_LIST_REFID = "defaultSignalInput";
-
-
- private Hashtable signalListenerConfigs = new Hashtable();
-
- private HashMap> targetsMap = new HashMap>();
-
- private Project project;
-
- private Logger log = Logger.getLogger(this.getClass());
-
- /**
- * Constructor
- */
- @SuppressWarnings("unchecked")
- public SignalList(Project project) {
- this.project = project;
- Hashtable references = project.getReferences();
- Enumeration keyEnum = references.keys();
- while (keyEnum.hasMoreElements()) {
- String key = keyEnum.nextElement();
- if (references.get(key) instanceof SignalListenerConfig) {
- log.debug("SignalList: Found reference: " + key);
- SignalListenerConfig config = (SignalListenerConfig) references
- .get(key);
- config.setConfigId(key);
- signalListenerConfigs.put(key, config);
- String targetName = config.getTargetName();
- List list;
- if (targetsMap.get(targetName) == null) {
- list = new ArrayList();
- } else {
- list = targetsMap.get(targetName);
- }
- list.add(config);
- targetsMap.put(targetName, list);
- }
- }
- }
-
- public Project getProject() {
- return project;
- }
-
- /**
- * Returns the list of SignalListenerConfig discovered.
- * @return a Vector of SignalList objects.
- */
- public Vector getSignalListenerConfigList() {
- return new Vector(signalListenerConfigs.values());
- }
-
- /**
- * Check if targetName is defined is defined by a targetCondition.
- * @param targetName the target name
- * @return a boolean, true if found, false otherwise.
- */
- public boolean isTargetInSignalList(String targetName) {
- return targetsMap.get(targetName) != null;
- }
-
- /**
- * Return the list of SignalListenerConfig defining a target.
- * @param targetName
- * @return
- */
- public List getSignalListenerConfig(String targetName) {
- return targetsMap.get(targetName);
- }
-
- protected void sendNotifications(Vector notifierList, String signalName, String errorMessage ) {
- sendNotifications( notifierList, signalName, false, null, errorMessage );
- }
-
- public void processForSignal(Project prj, SignalNotifierInput signalNotifierInput, String signalName, String targetName,
- String errorMessage, boolean failBuild) {
- SignalInput signalInput = signalNotifierInput.getSignalInput();
- Vector notifierList = signalInput.getSignalNotifierList();
- if (notifierList == null) {
- Object obj = (Object) prj
- .getReference(DEFAULT_NOTIFIER_LIST_REFID);
- if (obj instanceof SignalNotifierList) {
- notifierList = ((SignalNotifierList) obj)
- .getNotifierList();
- }
- }
- NotifierInput notifierInput = signalNotifierInput.getNotifierInput();
- sendNotifications(notifierList, signalName, failBuild,
- notifierInput, errorMessage );
- if (failBuild) {
- String failStatus = "now";
- if (signalInput != null) {
- failStatus = signalInput.getFailBuild();
- } else {
- log.debug("Could not find config for signal: " + signalName);
- }
- if (failStatus == null || failStatus.equals("now")) {
- log.debug("Adding now signal. Signal name is " + signalName);
- SignalStatusList.getNowSignalList().addSignalStatus(new SignalStatus(signalName,
- errorMessage, targetName, new Date()));
- throw new BuildException(new SignalStatus(signalName,
- errorMessage, targetName, new Date()).toString());
- } else if (failStatus.equals("defer")) {
- log.debug("Adding deffer signal. Signal " + signalName + " will be deferred.");
- SignalStatusList.getDeferredSignalList().addSignalStatus(new SignalStatus(
- signalName, errorMessage, targetName, new Date()));
- } else if (failStatus.equals("never")) {
- log.debug("Adding never signal. Signal name is " + signalName);
- SignalStatusList.getNeverSignalList().addSignalStatus(new SignalStatus(signalName,
- errorMessage, targetName, new Date()));
- } else if (!failStatus.equals("never")) {
- SignalStatusList.getNowSignalList().addSignalStatus(new SignalStatus(signalName,
- errorMessage, targetName, new Date()));
- throw new BuildException(new SignalStatus(signalName,
- errorMessage, targetName, new Date()).toString());
- } else {
- log.info("Signal " + signalName
- + " set to be ignored by the configuration.");
- }
- }
- }
- /**
- * Send notification using the notification list.
- *
- * @param notifierList
- */
- protected void sendNotifications(Vector notifierList, String signalName,
- boolean failStatus, NotifierInput notifierInput, String errorMessage ) {
- if (notifierList == null) {
- return;
- }
- for (Notifier notifier : notifierList) {
- if (notifier != null) {
- notifier.sendData(signalName, failStatus, notifierInput, errorMessage );
- }
- }
- }
-
- public boolean checkAndNotifyFailure(Target target, Project prj) {
- String targetName = target.getName();
- String signalName = "unknown";
- boolean retValue = false;
-
- if (isTargetInSignalList(targetName)) {
- retValue = true;
- for (SignalListenerConfig config : getSignalListenerConfig(targetName))
- {
- TargetCondition targetCondition = config
- .getTargetCondition();
- String errorMessage = null;
- log.debug("targetcondition:" + targetCondition);
- Condition condition = null;
- if (targetCondition != null) {
- condition = getFailureCondition(targetCondition);
- }
- errorMessage = config.getErrorMessage();
- String refid = config.getConfigId();
- log.debug("refid:" + refid);
- Object configCurrent = prj.getReference(refid);
- if (configCurrent != null && configCurrent instanceof SignalListenerConfig) {
- signalName = refid;
- }
- processForSignal(prj, config.getSignalNotifierInput(), signalName,
- targetName, errorMessage, condition != null);
- log.debug("checkAndNotifyFailure: SignalName: " + signalName);
- }
- }
- return retValue;
- }
-
- private Condition getFailureCondition(TargetCondition targetCondition) {
- Condition retCondition = null;
- Vector conditionList = targetCondition.getConditions();
- for (Condition condition : conditionList) {
- log.debug("getFailureCondition:" + condition.eval());
- if (condition.eval()) {
- retCondition = condition;
- break;
- }
- }
- return retCondition;
- }
-
-
- /**
- * Handle the signal, either fail now, or defer the failure.
- *
- * @param targetName
- * , target where the failure happened.
- * @param errMsg
- * , the error message
- */
- public void fail(String signalName, String targetName, String errorMessage)
- {
- String failStatus = "now";
- log.debug("Could not find config for signal: " + signalName);
- log.debug("failStatus: " + failStatus);
- log.debug("Adding now signal. Signal name is " + signalName);
- SignalStatusList.getNowSignalList().addSignalStatus(new SignalStatus(signalName,
- errorMessage, targetName, new Date()));
- throw new BuildException(new SignalStatus(signalName,
- errorMessage, targetName, new Date()).toString());
- }
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalListener.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalListener.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalListener.java Sun Oct 10 15:22:15 2010 +0300
@@ -18,10 +18,18 @@
package com.nokia.helium.signal.ant;
-import org.apache.log4j.Logger;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Target;
+
+import com.nokia.helium.signal.ant.types.SignalListenerConfig;
/**
* Listener class that can connect to Ant and log information regarding to build
@@ -38,14 +46,13 @@
*
*/
public class SignalListener implements BuildListener {
-
private boolean initialized;
- private SignalList signalList;
-
private Project project;
- private Logger log = Logger.getLogger(this.getClass());
+ private Hashtable signalListenerConfigs = new Hashtable();
+
+ private HashMap> targetsMap = new HashMap>();
/**
* Ant call this function when build start.
@@ -57,28 +64,41 @@
/**
* Triggered when a target starts.
*/
+ @SuppressWarnings("unchecked")
public void targetStarted(BuildEvent event) {
if (project == null) {
project = event.getProject();
}
- }
-
- private void initialize() {
- signalList = new SignalList(project);
- //signalList1 = new SignalList(project);
+ if (!initialized) {
+ Hashtable references = (Hashtable)project.getReferences();
+ Enumeration keyEnum = references.keys();
+ while (keyEnum.hasMoreElements()) {
+ String key = keyEnum.nextElement();
+ if (references.get(key) instanceof SignalListenerConfig) {
+ SignalListenerConfig config = (SignalListenerConfig) references
+ .get(key);
+ config.setConfigId(key);
+ signalListenerConfigs.put(key, config);
+ String targetName = config.getTargetName();
+ List list;
+ if (targetsMap.get(targetName) == null) {
+ list = new ArrayList();
+ } else {
+ list = targetsMap.get(targetName);
+ }
+ list.add(config);
+ targetsMap.put(targetName, list);
+ }
+ }
+ initialized = true;
+ }
}
/**
* Triggered when a target finishes.
*/
public void targetFinished(BuildEvent event) {
- if (!initialized) {
- log.debug("Signaling: Initializing Signaling");
- initialize();
- initialized = true;
- }
- log.debug("Signaling:targetFinished:sendsignal: " + event.getTarget());
- signalList.checkAndNotifyFailure(event.getTarget(), event.getProject());
+ checkAndNotifyFailure(event.getTarget(), event.getProject());
}
/**
@@ -104,4 +124,30 @@
*/
public void messageLogged(BuildEvent event) {
}
+
+ protected boolean checkAndNotifyFailure(Target target, Project prj) {
+ String targetName = target.getName();
+ String signalName = "unknown";
+ boolean retValue = false;
+
+ if (targetsMap.containsKey(targetName)) {
+ retValue = true;
+ for (SignalListenerConfig config : targetsMap.get(targetName))
+ {
+ String refid = config.getConfigId();
+ Object configCurrent = prj.getReference(refid);
+ if (configCurrent != null && configCurrent instanceof SignalListenerConfig) {
+ signalName = refid;
+ }
+ boolean failBuild = false;
+ if (config.getTargetCondition() != null) {
+ failBuild = config.getTargetCondition().getCondition().eval();
+ }
+ Signals.getSignals().processSignal(prj, config.getSignalNotifierInput(), signalName,
+ targetName, config.getErrorMessage(), failBuild);
+ }
+ }
+ return retValue;
+ }
+
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalNeverFailMessage.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalNeverFailMessage.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: To print the message on the shell in case of build has errors
+ * is user sets failbuild status to never in signal configuration file.
+ *
+ */
+
+package com.nokia.helium.signal.ant;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.core.ant.PostBuildAction;
+
+/**
+ * Class to check the signal is present in the never signal list. Print the
+ * message on the shell "Build completed with errors and warnings".
+ *
+ */
+public class SignalNeverFailMessage extends DataType implements
+ PostBuildAction {
+
+ /**
+ * Override execute method to print build completed message.
+ *
+ * @param prj
+ * @param module
+ * @param targetNames
+ */
+ public void executeOnPostBuild(Project project, String[] targetNames) {
+ if (!Signals.getSignals().getNeverSignalList().isEmpty()) {
+ log("Build completed with errors and warnings.", Project.MSG_WARN);
+ }
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalStatus.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/SignalStatus.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.helium.signal.ant;
+
+import java.util.Date;
+
+/**
+ * Signal data holder;
+ */
+public class SignalStatus {
+
+ // Signal attributes.
+ private String name;
+ private String message;
+ private String targetName;
+ private Date signalTimeStamp;
+
+ /**
+ * Deferred signal holder.
+ *
+ * @param signalName
+ * name of the signal been raised
+ * @param message
+ * message for the user
+ * @param targetName
+ * current target.
+ */
+ public SignalStatus(String signalName, String message, String targetName, Date signalDateAndTime) {
+ this.name = signalName;
+ this.message = message;
+ this.targetName = targetName;
+ this.signalTimeStamp = signalDateAndTime;
+
+ }
+ /**
+ * Returns the signal message.
+ * @return
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Returns signal name.
+ * @return
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Returns target name.
+ * @return
+ */
+ public String getTargetName() {
+ return targetName;
+ }
+
+ /**
+ * Returns signal date and time.
+ * @return
+ */
+ public Date getTimestamp() {
+ return signalTimeStamp;
+ }
+
+ /**
+ * Converts signal status object to string.
+ */
+ public String toString() {
+ return getName() + ": " + getMessage() + " : " + getTargetName();
+ }
+}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/Signals.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/Signals.java Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of the License "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: To print the message on the shell in case of build has errors
+ * is user sets failbuild status to never in signal configuration file.
+ *
+ */
+package com.nokia.helium.signal.ant;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.ResourceCollection;
+
+import com.nokia.helium.signal.ant.types.SignalInput;
+import com.nokia.helium.signal.ant.types.SignalNotifierInput;
+
+/**
+ * Signals give access to signals raised during the build.
+ *
+ */
+public class Signals {
+ // Global instance handling signals a the running Ant build
+ private static Signals self;
+
+ private SignalStatusList deferSignalList = new SignalStatusList();
+ private SignalStatusList nowSignalList = new SignalStatusList();
+ private SignalStatusList neverSignalList = new SignalStatusList();
+ private Logger log = Logger.getLogger(this.getClass());
+
+ /**
+ * Get the access to the unique instance of Signals.
+ * @return
+ */
+ public static Signals getSignals() {
+ if (self == null) {
+ self = new Signals();
+ }
+ return self;
+ }
+
+ /**
+ * Returns the deferred signal list.
+ */
+ public List getDeferredSignalList() {
+ return deferSignalList;
+ }
+
+ /**
+ * Returns the now signal list.
+ */
+ public List getNowSignalList() {
+ return nowSignalList;
+ }
+
+ /**
+ * Returns the never signal list.
+ */
+ public List getNeverSignalList() {
+ return neverSignalList;
+ }
+
+ /**
+ *
+ * @param project current Ant project
+ * @param signalNotifierInput can be null, the DEFAULT_NOTIFIER_LIST_REFID will be used for notification,
+ * and failing configuration will be considered as now.
+ * @param signalName the signal name
+ * @param targetName target where the signal has been raised.
+ * @param errorMessage the message
+ * @param failBuild true for a failure, false in case of success.
+ */
+ public void processSignal(Project project, SignalNotifierInput signalNotifierInput, String signalName, String targetName,
+ String errorMessage, boolean failBuild) {
+ Vector notifierList = null;
+ ResourceCollection notifierInput = null;
+ if (signalNotifierInput != null) {
+ SignalInput signalInput = signalNotifierInput.getSignalInput();
+ notifierList = signalInput.getSignalNotifierList();
+ notifierInput = signalNotifierInput.getNotifierInput();
+ }
+ // Print some verbose log information about signal raised.
+ project.log("------------ Signal raised ------------", notifierList != null ? Project.MSG_VERBOSE : Project.MSG_INFO);
+ project.log("Signal: " + signalName, notifierList != null ? Project.MSG_VERBOSE : Project.MSG_INFO);
+ project.log("Target: " + targetName, notifierList != null ? Project.MSG_VERBOSE : Project.MSG_INFO);
+ project.log("Message: " + errorMessage, notifierList != null ? Project.MSG_VERBOSE : Project.MSG_INFO);
+ project.log("Failure: " + (failBuild ? "Yes" : "No"), notifierList != null ? Project.MSG_VERBOSE : Project.MSG_INFO);
+ project.log("---------------------------------------", notifierList != null ? Project.MSG_VERBOSE : Project.MSG_INFO);
+
+ // Only run notification
+ if (notifierList != null) {
+ sendNotifications(notifierList, signalName, failBuild,
+ notifierInput, errorMessage );
+ }
+ if (failBuild) {
+ String failStatus = "now";
+ if (signalNotifierInput != null && signalNotifierInput.getSignalInput() != null) {
+ failStatus = signalNotifierInput.getSignalInput().getFailBuild();
+ } else {
+ log.debug("Could not find config for signal: " + signalName);
+ }
+ if (failStatus == null || failStatus.equals("now")) {
+ log.debug("Adding now signal. Signal name is " + signalName);
+ Signals.getSignals().getNowSignalList().add(new SignalStatus(signalName,
+ errorMessage, targetName, new Date()));
+ throw new BuildException(new SignalStatus(signalName,
+ errorMessage, targetName, new Date()).toString());
+ } else if (failStatus.equals("defer")) {
+ log.debug("Adding deffer signal. Signal " + signalName + " will be deferred.");
+ Signals.getSignals().getDeferredSignalList().add(new SignalStatus(
+ signalName, errorMessage, targetName, new Date()));
+ } else if (failStatus.equals("never")) {
+ log.debug("Adding never signal. Signal name is " + signalName);
+ Signals.getSignals().getNeverSignalList().add(new SignalStatus(signalName,
+ errorMessage, targetName, new Date()));
+ } else if (!failStatus.equals("never")) {
+ Signals.getSignals().getNowSignalList().add(new SignalStatus(signalName,
+ errorMessage, targetName, new Date()));
+ throw new BuildException(new SignalStatus(signalName,
+ errorMessage, targetName, new Date()).toString());
+ } else {
+ log.info("Signal " + signalName
+ + " set to be ignored by the configuration.");
+ }
+ }
+ }
+
+ /**
+ * Send notification using the notification list.
+ *
+ * @param notifierList
+ */
+ protected void sendNotifications(List notifierList, String signalName,
+ boolean failStatus, ResourceCollection notifierInput, String errorMessage ) {
+ if (notifierList == null) {
+ return;
+ }
+ for (Notifier notifier : notifierList) {
+ if (notifier != null) {
+ notifier.sendData(signalName, failStatus, notifierInput, errorMessage);
+ }
+ }
+ }
+
+ protected class SignalStatusList extends ArrayList {
+
+ private static final long serialVersionUID = 2159492246599277712L;
+
+ /**
+ * Converts the error list into a user readable message.
+ *
+ * @return the error message.
+ */
+ public String toString() {
+ StringBuffer statusBuffer = new StringBuffer();
+ for (SignalStatus signalStatus : this) {
+ statusBuffer.append(signalStatus);
+ statusBuffer.append("\n");
+ }
+ return statusBuffer.toString();
+ }
+
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/conditions/DeferredFailureCondition.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/conditions/DeferredFailureCondition.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/conditions/DeferredFailureCondition.java Sun Oct 10 15:22:15 2010 +0300
@@ -21,8 +21,8 @@
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.taskdefs.condition.Condition;
-import com.nokia.helium.signal.SignalStatus;
-import com.nokia.helium.signal.SignalStatusList;
+import com.nokia.helium.signal.ant.SignalStatus;
+import com.nokia.helium.signal.ant.Signals;
/**
* The hasDeferredFailure condition allows you to know if any diferred failure are pending,
@@ -65,7 +65,7 @@
public boolean eval() {
if (name != null) {
getProject().log("Has deferred " + name + " failure?");
- for (SignalStatus signal : SignalStatusList.getDeferredSignalList().getSignalStatusList()) {
+ for (SignalStatus signal : Signals.getSignals().getDeferredSignalList()) {
if (signal.getName().equals(name)) {
getProject().log("Failure " + name + " found.");
return true;
@@ -74,9 +74,9 @@
} else {
getProject().log(
"Deferred failure: "
- + ((SignalStatusList.getDeferredSignalList().hasSignalInList()) ? "Yes"
+ + ((!Signals.getSignals().getDeferredSignalList().isEmpty()) ? "Yes"
: "No"));
- return SignalStatusList.getDeferredSignalList().hasSignalInList();
+ return !Signals.getSignals().getDeferredSignalList().isEmpty();
}
return false;
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/helium.antlib.xml
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/helium.antlib.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/helium.antlib.xml Sun Oct 10 15:22:15 2010 +0300
@@ -29,8 +29,8 @@
-
-
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/taskdefs/ClearDeferredFailuresTask.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/taskdefs/ClearDeferredFailuresTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/taskdefs/ClearDeferredFailuresTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -20,7 +20,7 @@
import org.apache.tools.ant.Task;
-import com.nokia.helium.signal.SignalStatusList;
+import com.nokia.helium.signal.ant.Signals;
/**
* This class implements a task that clear all pending failure. It is quite
@@ -35,7 +35,7 @@
@Override
public void execute() {
log("Clearing all pending failures.");
- SignalStatusList.getDeferredSignalList().clearStatusList();
+ Signals.getSignals().getDeferredSignalList().clear();
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/taskdefs/SignalTask.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/taskdefs/SignalTask.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/taskdefs/SignalTask.java Sun Oct 10 15:22:15 2010 +0300
@@ -20,10 +20,12 @@
import java.util.Vector;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.Target;
import org.apache.tools.ant.Task;
-import com.nokia.helium.signal.ant.SignalList;
+import com.nokia.helium.signal.ant.Signals;
+import com.nokia.helium.signal.ant.types.SignalInput;
import com.nokia.helium.signal.ant.types.SignalNotifierInput;
/**
@@ -58,24 +60,29 @@
private Vector signalNotifierInputs = new Vector();
- public String getMessage() {
- return message;
- }
-
/**
- * Helper function called by ant to create the new signalinput
- */
+ * Create a nested signalNotifierInput element.
+ * @return a SignalNotifierInput instance
+ */
public SignalNotifierInput createSignalNotifierInput() {
SignalNotifierInput input = new SignalNotifierInput();
add(input);
return input;
}
+ /**
+ * Get the nested SignalNotifierInput. Only the first element will be returned.
+ * @return null if the list is empty of the first element.
+ */
public SignalNotifierInput getSignalNotifierInput() {
+ if (signalNotifierInputs.isEmpty()) {
+ return null;
+ }
return (SignalNotifierInput)signalNotifierInputs.elementAt(0);
}
+
/**
- * Helper function to add the created signalinput
+ * Add a SignalNotifierInput kind of element.
* @param filter to be added to the filterset
*/
public void add(SignalNotifierInput input) {
@@ -84,21 +91,16 @@
/**
- * Error message.
- *
- * @ant.not-required
+ * Error message sent to the user.
+ * @ant.not-required Default message will be sent.
*/
public void setMessage(String message) {
this.message = message;
}
-
- public String getName() {
- return name;
- }
-
/**
- * Signal name to emit.
+ * Reference of the signal to emit. The referenced object
+ * must be a signalInput.
*
* @ant.required
*/
@@ -109,69 +111,59 @@
/**
* integer value representing the number of errors.
*
- * @ant.required
+ * @ant.no-required Default is 0.
*/
public void setResult(int result) {
this.result = new Integer(result);
}
+ /**
+ * {@inheritDoc}
+ */
@Override
public void execute() {
- if (name == null) {
+ if (name == null && getSignalNotifierInput() == null) {
throw new BuildException("'name' attribute is not defined.");
}
+ if (name != null && getSignalNotifierInput() != null) {
+ log("The usage of name and nested signalInputNotifier at the same time is deprecated.", Project.MSG_WARN);
+ log("'name' attribute will be ignored.", Project.MSG_WARN);
+ name = null;
+ }
if (result == null) {
result = new Integer(0);
}
+ SignalNotifierInput config = null;
+ String signalName = null;
+ if (name != null) {
+ signalName = name;
+ Object configObject = getProject().getReference(name);
+ if (configObject != null && configObject instanceof SignalInput) {
+ config = new SignalNotifierInput();
+ config.setProject(getProject());
+ config.add((SignalInput)configObject);
+ } else {
+ throw new BuildException("name attribute (" + name + ") is not refering to a signalInput");
+ }
+ } else {
+ config = getSignalNotifierInput();
+ signalName = config.getSignalInput().getName();
+ }
- SignalList signalList = new SignalList(getProject());
- boolean failStatus = result.intValue() != 0;
- if (failStatus) {
- // keep same message as earlier.
- log(name
- + ": "
- + name
- + " signal failed. Expected result was 0, actual result was "
- + result);
-
- if (message == null) {
- message = "Expected result was 0, actual result was " + result;
- }
- }
-
// notify the user
- String targetName = "signalExceptionTarget";
+ String targetName = "unknown";
Target target = this.getOwningTarget();
if (target != null) {
targetName = target.getName();
}
- if (signalNotifierInputs.isEmpty()) {
- Object config = getProject().getReference(name);
- if (config == null) {
- throw new BuildException("Could not find signal config for signal name: " + name);
- }
- signalList.processForSignal(getProject(), this.getSignalNotifierInput(), this.name,
- this.getOwningTarget().getName(), message, result.intValue() != 0);
+ if (message == null) {
+ message = "Expected result was 0, actual result was " + result;
+ }
+ log(signalName + ": " + targetName + ": " + message);
- if (result.intValue() != 0) {
- // keep same message as earlier.
- log(name
- + ": "
- + name
- + " signal failed. Expected result was 0, actual result was "
- + result);
-
- if (message == null) {
- message = "Expected result was 0, actual result was " + result;
- }
- signalList.fail(getName(), this.getOwningTarget().getName(), message);
- }
-
- } else {
- signalList.processForSignal(getProject(), getSignalNotifierInput(), getName(),
- targetName, message, failStatus);
- }
+ Signals.getSignals().processSignal(getProject(), config, signalName,
+ targetName, message, result.intValue() != 0);
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/EMAILNotifier.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/EMAILNotifier.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/EMAILNotifier.java Sun Oct 10 15:22:15 2010 +0300
@@ -22,8 +22,10 @@
import com.nokia.helium.core.EmailSendException;
import com.nokia.helium.core.PropertiesSource;
import com.nokia.helium.core.TemplateInputSource;
-import com.nokia.helium.signal.Notifier;
+import com.nokia.helium.signal.ant.Notifier;
import com.nokia.helium.core.TemplateProcessor;
+import com.nokia.helium.core.ant.ResourceCollectionUtils;
+
import java.util.List;
import java.util.Hashtable;
import java.util.ArrayList;
@@ -32,6 +34,8 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.ResourceCollection;
+
import java.io.File;
/**
@@ -53,21 +57,11 @@
private String additionalRecipients;
/**
- * Rendering the template, and sending the result through email.
- *
- * @param signalName
- * - is the name of the signal that has been raised.
- * @param failStatus
- * - indicates whether to fail the build or not
- * @param notifierInput
- * - contains signal notifier info
- * @param message
- * - is the message from the signal that has been raised.
+ * {@inheritDoc}
*/
-
@SuppressWarnings("unchecked")
public void sendData(String signalName, boolean failStatus,
- NotifierInput notifierInput, String message) {
+ ResourceCollection notifierInput, String message) {
if (notifyWhen != null
&& (notifyWhen.equals("always")
|| (notifyWhen.equals("fail") && failStatus) || (notifyWhen
@@ -96,7 +90,7 @@
File fileToSend = null;
if (notifierInput != null) {
- fileToSend = notifierInput.getFile(".*.html");
+ fileToSend = ResourceCollectionUtils.getFile(notifierInput, ".*.html");
}
if (fileToSend == null) {
if (defaultTemplate != null && defaultTemplate.exists()) {
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/ExecuteTaskNotifier.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/ExecuteTaskNotifier.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/ExecuteTaskNotifier.java Sun Oct 10 15:22:15 2010 +0300
@@ -20,10 +20,10 @@
import java.io.File;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import java.util.Vector;
-import org.apache.log4j.Logger;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.MagicNames;
@@ -32,8 +32,10 @@
import org.apache.tools.ant.Task;
import org.apache.tools.ant.TaskContainer;
import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.Resource;
+import org.apache.tools.ant.types.ResourceCollection;
-import com.nokia.helium.signal.Notifier;
+import com.nokia.helium.signal.ant.Notifier;
/**
* This notifier allows you to execute a task sequence when a specific signal
@@ -55,11 +57,8 @@
*
* @ant.type name="executeTaskNotifier" category="Signaling"
*/
-@SuppressWarnings("deprecation")
public class ExecuteTaskNotifier extends DataType implements Notifier,
TaskContainer {
-
- private Logger log = Logger.getLogger(ExecuteTaskNotifier.class);
private List tasks = new ArrayList();
private boolean failOnError;
@@ -74,7 +73,7 @@
*/
@SuppressWarnings("unchecked")
public void sendData(String signalName, boolean failStatus,
- NotifierInput notifierInput, String message ) {
+ ResourceCollection notifierInput, String message ) {
try {
// Configure the project
Project prj = getProject().createSubProject();
@@ -96,12 +95,18 @@
prj.setProperty("signal.message", message );
// Converting the list of inputs into a string.
String inputs = "";
- if (notifierInput != null && notifierInput.getFile() != null) {
- inputs += notifierInput.getFile().toString();
+ if (notifierInput != null) {
+ Iterator ri = notifierInput.iterator();
+ while (ri.hasNext()) {
+ inputs += ri.next().toString();
+ if (ri.hasNext()) {
+ inputs += File.pathSeparator;
+ }
+ }
}
prj.setProperty("signal.notifier.inputs", inputs);
for (Task task : tasks) {
- log.debug("Executing task: " + task.getTaskName());
+ log("Executing task: " + task.getTaskName(), Project.MSG_DEBUG);
task.setProject(prj);
task.perform();
}
@@ -115,9 +120,10 @@
}
}
- @Override
+ /**
+ * {@inheritDoc}
+ */
public void addTask(Task task) {
- log.debug("Adding task: " + task.getTaskName());
tasks.add(task);
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/InfoNotifier.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/InfoNotifier.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/InfoNotifier.java Sun Oct 10 15:22:15 2010 +0300
@@ -19,10 +19,12 @@
import java.io.File;
-import org.apache.log4j.Logger;
+import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.ResourceCollection;
-import com.nokia.helium.signal.Notifier;
+import com.nokia.helium.core.ant.ResourceCollectionUtils;
+import com.nokia.helium.signal.ant.Notifier;
/**
* The InfoNotifier provides you an easy way to inform the
@@ -30,24 +32,15 @@
* @ant.type name="infoNotifier" category="Signaling"
*/
public class InfoNotifier extends DataType implements Notifier {
-
- private Logger log = Logger.getLogger(InfoNotifier.class);
/**
- * Rendering the template, and sending the result through email.
- *
- * @param signalName - is the name of the signal that has been raised.
- * @param failStatus - indicates whether to fail the build or not
- * @param notifierInput - contains signal notifier info
- * @param message - is the message from the signal that has been raised.
+ * {@inheritDoc}
*/
-
- @SuppressWarnings("unchecked")
public void sendData(String signalName, boolean failStatus,
- NotifierInput notifierInput, String message ) {
- if (notifierInput != null) {
- File logFile = notifierInput.getFile(".*.log");
- log.error("Error in log file: " + logFile);
+ ResourceCollection notifierInput, String message ) {
+ if (notifierInput != null) {
+ File logFile = ResourceCollectionUtils.getFile(notifierInput, ".*.log");
+ log("Error in log file: " + logFile, Project.MSG_ERR);
}
}
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/NotifierInput.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/NotifierInput.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/NotifierInput.java Sun Oct 10 15:22:15 2010 +0300
@@ -20,110 +20,30 @@
import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-import org.apache.log4j.Logger;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.Path;
/**
- * Helper class to store the signal notifier info.
+ * This Ant type allows you to provide a list of files, for
+ * example logs to a notifier. The usage of this type is
+ * deprecated, please consider using any kind of Ant
+ * ResourceCollection like paths or filesets.
+ *
+ * @ant.type name="NotifierInput" category="Signaling"
*/
-public class NotifierInput extends DataType
-{
-
- private File file;
-
- //Different notifier could choose specific file
- private String pattern = ".html";
-
- private Vector fileSetList = new Vector();
-
- private Logger log = Logger.getLogger(this.getClass());
-
- /**
- * Adds the fileset (list of input log files to be processed).
- * @param fileSet fileset to be added
- *
- */
- public void add(FileSet fileSet) {
- fileSetList.add(fileSet);
- }
+public class NotifierInput extends Path {
- public File getFile() {
- return getFile(pattern);
- }
-
- /**
- * Return a file from the input fileset.
- * @param pattern pattern to match from the input fileset
- * @return the matched files including the base dir.
- */
- public File getFile(String pattern) {
- File fileToReturn = null;
- if (file != null) {
- if (file.toString().matches(pattern)) {
- fileToReturn = file;
- }
- return fileToReturn;
- }
- for (FileSet fs : fileSetList) {
- DirectoryScanner ds = fs.getDirectoryScanner(getProject());
- String[] includedFiles = ds.getIncludedFiles();
- for ( String filePath : includedFiles ) {
- if (filePath.matches(pattern)) {
- fileToReturn = new File(ds.getBasedir(), filePath);
- log.debug("matched file for pattern: " + pattern + ":" + fileToReturn);
- break;
- }
- }
- }
- return fileToReturn;
- }
-
- /**
- * Returns the list of filelist from the input fileset.
- * @param pattern pattern to match from the input fileset
- * @return the matched files including the base dir.
- */
- public List getFileList(String pattern) {
- List fileList = new ArrayList();
- for (FileSet fs : fileSetList) {
- DirectoryScanner ds = fs.getDirectoryScanner(getProject());
- String[] includedFiles = ds.getIncludedFiles();
- for ( String filePath : includedFiles ) {
- if (filePath.matches(pattern)) {
- fileList.add(new File(ds.getBasedir(), filePath));
- }
- }
- }
- return fileList;
+ public NotifierInput(Project project) {
+ super(project);
}
/**
* Helper function called by ant to set the input file.
* @param inputFile input file for notifier
- */
- public void setFile(File inputFile) {
- file = inputFile;
- }
-
- /**
- * Helper function called by ant to get the file
- * @return the input file for notifier.
+ * @ant.not-required
*/
- public String getPattern() {
- return pattern ;
- }
-
- /**
- * Helper function called by ant to get the file
- * @return the input file for notifier.
- */
- public void setPattern(String ptn) {
- pattern = ptn;
+ public void setFile(File file) {
+ this.createPathElement().setLocation(file);
}
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SMSNotifier.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SMSNotifier.java Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of the License "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-package com.nokia.helium.signal.ant.types;
-
-
-import org.apache.tools.ant.types.DataType;
-
-import com.nokia.helium.signal.Notifier;
-
-/**
- * Defines a signal notification via SMS.
- */
-public class SMSNotifier extends DataType implements Notifier {
-
- /**
- * Sends the data to the requested sender list with specified notifier
- *
- * @param signalName is the name of the signal that has been raised.
- * @param failStatus indicates whether to fail the build or not
- * @param notifierInput contains signal notifier info
- * @param message is the message from the signal that has been raised.
- */
- public void sendData(String signalName, boolean failStatus,
- NotifierInput notifierInput, String message ) {
- }
-
-}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalExceptionConfig.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalExceptionConfig.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalExceptionConfig.java Sun Oct 10 15:22:15 2010 +0300
@@ -25,7 +25,7 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.DataType;
-import com.nokia.helium.signal.Notifier;
+import com.nokia.helium.signal.ant.Notifier;
/**
* The signalExceptionConfig type will allow you to configure post-build
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalInput.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalInput.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalInput.java Sun Oct 10 15:22:15 2010 +0300
@@ -19,14 +19,14 @@
package com.nokia.helium.signal.ant.types;
+import java.util.List;
import java.util.Vector;
-import org.apache.log4j.Logger;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.DataType;
import com.nokia.helium.core.ant.types.ReferenceType;
-import com.nokia.helium.signal.Notifier;
+import com.nokia.helium.signal.ant.Notifier;
/**
* SignalInput class which is a type to store input for signals
@@ -47,15 +47,11 @@
*/
public class SignalInput extends DataType
{
- private Vector notifierListRef = new Vector();
-
- private Vector notifierInputList = new Vector();
+ private List> notifierListRef = new Vector>();
// By default it is configured to fail the build.
private String failBuild = "now";
- private Logger log = Logger.getLogger(SignalInput.class);
-
/**
* Defines how the signal framework should handle the error, either
@@ -73,27 +69,10 @@
* @param failBuild type of failure for this input.
*/
public String getFailBuild() {
- return failBuild;
- }
-
- /**
- * Helper function called by ant to create a new notifier for
- * this input.
- * @return ReferenceType created ReferenceType.
- */
- public NotifierInput createNotifierInput() {
- NotifierInput notifierInput = new NotifierInput();
- add(notifierInput);
- return notifierInput;
- }
-
- /**
- * Adds the created notifier to the list
- * @param ReferenceType notifier to be added to the list.
- */
- public void add(NotifierInput notifierInput) {
- if (notifierInput != null) {
- notifierInputList.add(notifierInput);
+ if (this.isReference()) {
+ return getReferencedObject().getFailBuild();
+ } else {
+ return failBuild;
}
}
@@ -102,8 +81,8 @@
* this input.
* @return ReferenceType created ReferenceType.
*/
- public ReferenceType createNotifierListRef() {
- ReferenceType notifierRef = new ReferenceType();
+ public ReferenceType createNotifierListRef() {
+ ReferenceType notifierRef = new ReferenceType();
add(notifierRef);
return notifierRef;
}
@@ -112,34 +91,49 @@
* Adds the created notifier to the list
* @param ReferenceType notifier to be added to the list.
*/
- public void add(ReferenceType notifier) {
+ public void add(ReferenceType notifier) {
if (notifier != null) {
notifierListRef.add(notifier);
}
}
-
- public Vector getNotifierInput() {
- return notifierInputList;
- }
-
+
/**
* Gets the NotifierList associated with this input. If the
* notifier list reference is empty then it throws exception.
* @return List of notifier associated with this input.
*/
public Vector getSignalNotifierList() {
- Vector notifierList = null;
- if (notifierListRef != null) {
- log.debug("getSignalNotifierList:list.size:" + notifierListRef.size());
- for (ReferenceType notifierRef : notifierListRef) {
- Object obj = notifierRef.getReferencedObject();
- if (obj instanceof SignalNotifierList) {
- notifierList = ((SignalNotifierList)obj).getNotifierList();
- break;
+ if (this.isReference()) {
+ return getReferencedObject().getSignalNotifierList();
+ } else {
+ Vector notifierList = null;
+ if (notifierListRef != null) {
+ for (ReferenceType notifierRef : notifierListRef) {
+ notifierList = notifierRef.getReferencedObject().getNotifierList();
}
+ return notifierList;
}
- return notifierList;
+ throw new BuildException("No signal notifierlist reference defined.");
}
- throw new BuildException("No signal notifierlist reference defined.");
- }
+ }
+
+ /**
+ * Get the signal name. If the object is a reference then its id is used.
+ * 'unknownSignalName' is returned otherwise.
+ * @return the signal name.
+ */
+ public String getName() {
+ if (this.isReference()) {
+ return this.getRefid().getRefId();
+ }
+ return "unknownSignalName";
+ }
+
+ protected SignalInput getReferencedObject() {
+ Object obj = this.getRefid().getReferencedObject();
+ if (obj instanceof SignalInput) {
+ return (SignalInput)obj;
+ }
+ throw new BuildException("SignalInput reference " + this.getRefid().getRefId() + " does not exist.");
+ }
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalListenerConfig.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalListenerConfig.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalListenerConfig.java Sun Oct 10 15:22:15 2010 +0300
@@ -20,6 +20,7 @@
import java.util.Vector;
+import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.DataType;
/**
@@ -50,7 +51,7 @@
private String errMsg;
- private Vector targetConditions = new Vector();
+ private TargetCondition targetCondition;
private String configID;
@@ -85,27 +86,24 @@
*/
public SignalNotifierInput createSignalNotifierInput() {
SignalNotifierInput input = new SignalNotifierInput();
- add(input);
+ signalNotifierInputs.add(input);
+ if (this.signalNotifierInputs.size() > 1) {
+ throw new BuildException(this.getDataTypeName() + " only accept one nested signalNotifierInput at " + this.getLocation());
+ }
return input;
}
/**
- * Helper function to add the created signalinput
- * @param filter to be added to the filterset
- */
- public void add(SignalNotifierInput input) {
- signalNotifierInputs.add(input);
- }
-
-
- /**
* Creates type target condition of type TargetCondition.
* @return ReferenceType which is created and stored by the config.
*/
public TargetCondition createTargetCondition() {
+ if (this.targetCondition != null) {
+ throw new BuildException(this.getDataTypeName() + " only accept one nested targetCondition at " + this.getLocation());
+ }
TargetCondition condition = new TargetCondition();
- add(condition);
- return condition;
+ this.targetCondition = condition;
+ return this.targetCondition;
}
/**
@@ -125,24 +123,12 @@
}
/**
- * Adds the TargetCondition reference to the container.
- * @param TargetCondition to be added to the container, to be processed during signaling.
- */
- public void add(TargetCondition condition) {
- if (condition != null) {
- targetConditions.add(condition);
- }
- }
-
- /**
* Helper function to return the Targetcondition matching the target name.
- * @param String name of the target for which the targetcondition is returned,
+ * @param String name of the target for which the targetcondition is returned, can be null in case of
+ * informative signal, in that case build should not be failing.
*/
public TargetCondition getTargetCondition() {
- if (targetConditions.isEmpty()) {
- return null;
- }
- return targetConditions.get(0);
+ return this.targetCondition;
}
/**
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalNotifierInput.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalNotifierInput.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalNotifierInput.java Sun Oct 10 15:22:15 2010 +0300
@@ -23,6 +23,7 @@
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.types.ResourceCollection;
/**
@@ -33,43 +34,41 @@
* </targetCondition>
*
*/
-public class SignalNotifierInput extends DataType
-{
+public class SignalNotifierInput extends DataType {
+
private Vector signalInputs = new Vector();
- private Vector notifierInputList = new Vector();
+ private Vector notifierInputList = new Vector();
/**
- * Helper function called by ant to create a new notifier for
- * this input.
- * @return ReferenceType created ReferenceType.
+ * Create a nested notifierInput element.
+ * @return a new NotifierInput instance.
*/
public NotifierInput createNotifierInput() {
- NotifierInput notifierInput = new NotifierInput();
+ NotifierInput notifierInput = new NotifierInput(getProject());
add(notifierInput);
return notifierInput;
}
/**
- * Adds the created notifier to the list
- * @param ReferenceType notifier to be added to the list.
+ * Adds any kind of ResourceCollection Ant type like
+ * paths or filesets.
+ * @param notifierInput notifier to be added to the list.
*/
- public void add(NotifierInput notifierInput) {
- if (notifierInput != null) {
- notifierInputList.add(notifierInput);
- }
+ public void add(ResourceCollection notifierInput) {
+ notifierInputList.add(notifierInput);
}
/**
- * Helper function to add the created signalinput
- * @param filter to be added to the filterset
+ * Add a nested signalInput.
+ * @param signalInput the signalInput to be added
*/
- public void add(SignalInput input) {
- signalInputs.add(input);
+ public void add(SignalInput signalInput) {
+ signalInputs.add(signalInput);
}
/**
- * Helper function called by ant to create the new signalinput
+ * Create a nested signalInput.
*/
public SignalInput createSignalInput() {
SignalInput input = new SignalInput();
@@ -77,8 +76,12 @@
return input;
}
- public NotifierInput getNotifierInput() {
- NotifierInput input = null;
+ /**
+ * Returns the notifierInput associated to the current object.
+ * @return a ResourceCollection representing the notifier inputs.
+ */
+ public ResourceCollection getNotifierInput() {
+ ResourceCollection input = null;
if (notifierInputList.size() > 1) {
throw new BuildException("One and only signal input can be defined");
}
@@ -94,18 +97,11 @@
*/
public SignalInput getSignalInput() {
if (signalInputs.isEmpty()) {
- throw new BuildException("No signal input in signal config, failed: ");
+ throw new BuildException("One nested signalInput is required at " + this.getLocation());
}
if (signalInputs.size() > 1) {
- throw new BuildException("One and only signal input can be defined");
+ throw new BuildException("One and only signalInput can be defined at " + this.getLocation());
}
-
- Object refObject = signalInputs.elementAt(0).getRefid().getReferencedObject();
- if (refObject == null) {
- throw new BuildException("Signal Input Reference not exists");
- }
-
- SignalInput signalInput = (SignalInput)refObject;
- return signalInput;
+ return signalInputs.elementAt(0);
}
}
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalNotifierList.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalNotifierList.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalNotifierList.java Sun Oct 10 15:22:15 2010 +0300
@@ -22,7 +22,7 @@
import org.apache.tools.ant.types.DataType;
-import com.nokia.helium.signal.Notifier;
+import com.nokia.helium.signal.ant.Notifier;
/**
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalStatusDef.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalStatusDef.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/SignalStatusDef.java Sun Oct 10 15:22:15 2010 +0300
@@ -22,7 +22,7 @@
import org.apache.tools.ant.types.DataType;
import com.nokia.helium.core.ant.PostBuildAction;
-import com.nokia.helium.signal.SignalStatusList;
+import com.nokia.helium.signal.ant.Signals;
/**
* Class to store the status of the signal of a particular target.
@@ -35,8 +35,8 @@
* @throws BuildException
*/
public void executeOnPostBuild(Project project, String[] targetNames) {
- if (SignalStatusList.getDeferredSignalList().hasSignalInList()) {
- throw new BuildException(SignalStatusList.getDeferredSignalList().getErrorMsg());
+ if (!Signals.getSignals().getDeferredSignalList().isEmpty()) {
+ throw new BuildException(Signals.getSignals().getDeferredSignalList().toString());
}
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/TargetCondition.java
--- a/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/TargetCondition.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/src/com/nokia/helium/signal/ant/types/TargetCondition.java Sun Oct 10 15:22:15 2010 +0300
@@ -17,8 +17,7 @@
package com.nokia.helium.signal.ant.types;
-import java.util.Vector;
-
+import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.condition.Condition;
import org.apache.tools.ant.types.DataType;
@@ -31,17 +30,17 @@
private String name;
- private String errMsg;
+ private String message;
- private Vector conditionList = new Vector();
+ private Condition condition;
/**
* Helper function to store the Name of the target for which the signal to be processed.
*
* @param targetName to be stored.
*/
- public void setName(String targetName) {
- name = targetName;
+ public void setName(String name) {
+ this.name = name;
}
/**
@@ -49,8 +48,8 @@
*
* @param errorMessage to be displayed after failure.
*/
- public void setMessage(String errorMessage) {
- errMsg = errorMessage;
+ public void setMessage(String message) {
+ this.message = message;
}
/**
@@ -59,7 +58,10 @@
* @param condition variable to add
*/
public void add(Condition condition) {
- conditionList.add(condition);
+ if (this.condition != null) {
+ throw new BuildException(this.getDataTypeName() + " type can only accept one condition at " + this.getLocation().toString());
+ }
+ this.condition = condition;
}
/**
@@ -67,8 +69,11 @@
*
* @return conditions variable for this configuration.
*/
- public Vector getConditions() {
- return conditionList;
+ public Condition getCondition() {
+ if (this.condition == null) {
+ throw new BuildException(this.getDataTypeName() + " must have one nested condition defined at " + this.getLocation().toString());
+ }
+ return condition;
}
/**
@@ -88,6 +93,6 @@
* @deprecated
*/
public String getMessage() {
- return errMsg;
+ return message;
}
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/templates/email.html.ftl
--- a/buildframework/helium/sf/java/signaling/src/templates/email.html.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-<#--
-============================================================================
-Name : email.html.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-
-
-
-
-
-
- Build result e-mail from ${ant["env.COMPUTERNAME"]}.
-
-
-
-
-
-
-
This is an e-mail notification that a build has been completed on ${ant["env.COMPUTERNAME"]}
-
-
-
- <#macro create_section title type>
-
-
${title}
-
-
- <#nested>
-
-
- #macro>
-
-<#list doc.logSummary.log as lognode>
- <#if (lognode.build[".//message[@priority='error']"]?size > 0)>
-
- <#if (lognode.@filename[0])?exists>${lognode.@filename[0]}...FAIL #if>
-
- <#list lognode.build[".//message[@priority='error']"] as message>
- ${message}
- #list>
-
-
- <#else>
- <#if (lognode.@filename[0])?exists>${lognode.@filename[0]}...OK #if>
- #if>
-#list>
-
-
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/templates/email_default.html.ftl
--- a/buildframework/helium/sf/java/signaling/src/templates/email_default.html.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-<#--
-============================================================================
-Name : email.html.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-
-
-
-
-
-
- Build result e-mail from ${ant["env.COMPUTERNAME"]}.
-
-
-
-
-
-
-
This is an e-mail notification that a build has been completed on ${ant["env.COMPUTERNAME"]}
-
- ${signaling['signal.name']} is finished.
-
-
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/src/templates/email_subject.txt.ftl
--- a/buildframework/helium/sf/java/signaling/src/templates/email_subject.txt.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-<#--
-============================================================================
-Name : email_subject.txt.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-${ant["build.id"]}:${ant["env.COMPUTERNAME"]}: ${signalname} alert
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/antunit/signaling_test.ant.xml
--- a/buildframework/helium/sf/java/signaling/tests/antunit/signaling_test.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +0,0 @@
-
-
-
-
- Test all the helium signals
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/antunit/test_defered_failure.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/tests/antunit/test_defered_failure.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/antunit/test_executetasknotifier.ant.xml
--- a/buildframework/helium/sf/java/signaling/tests/antunit/test_executetasknotifier.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/tests/antunit/test_executetasknotifier.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -65,20 +65,20 @@
-
+
-
+
-
+
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/antunit/test_hasdeferredfailure.ant.xml
--- a/buildframework/helium/sf/java/signaling/tests/antunit/test_hasdeferredfailure.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/tests/antunit/test_hasdeferredfailure.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -77,11 +77,7 @@
-
-
-
-
-
+
@@ -92,7 +88,7 @@
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/antunit/test_signal_listener.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/tests/antunit/test_signal_listener.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/antunit/test_signaling_config.ant.xml
--- a/buildframework/helium/sf/java/signaling/tests/antunit/test_signaling_config.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/tests/antunit/test_signaling_config.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -229,8 +229,8 @@
-
-
+
+
@@ -239,7 +239,7 @@
-
+
@@ -248,7 +248,7 @@
-
+
@@ -274,12 +274,12 @@
-
+
@@ -320,7 +320,7 @@
-
+
@@ -332,4 +332,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/antunit/test_signaltask.ant.xml
--- a/buildframework/helium/sf/java/signaling/tests/antunit/test_signaltask.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/tests/antunit/test_signaltask.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -64,7 +64,12 @@
-
+
+
+
+
+
+
@@ -101,13 +106,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -120,13 +137,14 @@
-
+
+
-
+
@@ -136,4 +154,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/build.xml
--- a/buildframework/helium/sf/java/signaling/tests/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/tests/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -24,17 +24,5 @@
Helium Antlib signaling tests.
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/scenarii/dual-cond-config-failure/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/tests/scenarii/dual-cond-config-failure/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+ Signal: ${signal.name}
+ Message: ${signal.message}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/scenarii/signal-listener-test/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/tests/scenarii/signal-listener-test/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+ Signal: ${signal.name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/scenarii/test-deferred-failure/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/signaling/tests/scenarii/test-deferred-failure/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+ Signal: ${signal.name}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/signaling/tests/src/com/nokia/helium/signaling/tests/TestEmailSender.java
--- a/buildframework/helium/sf/java/signaling/tests/src/com/nokia/helium/signaling/tests/TestEmailSender.java Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/signaling/tests/src/com/nokia/helium/signaling/tests/TestEmailSender.java Sun Oct 10 15:22:15 2010 +0300
@@ -51,7 +51,7 @@
en.setTitle("test");
en.setSmtp("test");
en.setLdap("test");
- NotifierInput input = new NotifierInput();
+ NotifierInput input = new NotifierInput(p);
input.setFile(new File(System.getProperty("testdir") + "/tests/data/test.log_status.html"));
en.sendData("test", true, input, "Test Message");
}
@@ -70,7 +70,7 @@
en.setTitle("test");
en.setSmtp("test");
en.setLdap("test");
- NotifierInput input = new NotifierInput();
+ NotifierInput input = new NotifierInput(p);
en.sendData("test", true, input, "Test Message");
}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/sysdef/demo/data/sf/os/buildtools/bldsystemtools/sysdeftools/joinsysdef.pl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/sysdef/demo/data/sf/os/buildtools/bldsystemtools/sysdeftools/joinsysdef.pl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,20 @@
+#============================================================================
+#Name : .pl
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#============================================================================
+use FindBin '$Bin';
+system("python $Bin/joinsysdef_mock.py @ARGV");
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/java/sysdef/src/com/nokia/helium/sysdef/templates/root_sysdef_model.xml.ftl
--- a/buildframework/helium/sf/java/sysdef/src/com/nokia/helium/sysdef/templates/root_sysdef_model.xml.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/java/sysdef/src/com/nokia/helium/sysdef/templates/root_sysdef_model.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -142,7 +142,7 @@
]>
xmlns:vendor="${idnamespace}"#if>>
-<#list layers?keys as layer>
+<#list layers?keys?sort as layer>
<#list roots?keys as root>
<#if roots[root]?keys?seq_contains(layer)>
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/ivy.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/ivy.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/blockspackagercpythontests/__init__.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/blockspackagercpythontests/__init__.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,19 @@
+#============================================================================
+#Name : __init__.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/__init__.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/__init__.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,18 @@
+#============================================================================
+#Name : __init__.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/test_packager_cli.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/test_packager_cli.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,44 @@
+#============================================================================
+#Name : test_packager_cli.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+import unittest
+import unittestadditions
+skipTest = False
+try:
+ import packager.cli
+except ImportError:
+ skipTest = True
+import logging
+
+
+#logging.basicConfig(level=logging.DEBUG)
+logger = logging.getLogger('nokiatest.datasources')
+
+
+class CliTest(unittest.TestCase):
+ """ Verifying the datasource interface. """
+
+ @unittestadditions.skip(skipTest)
+ def test_cli(self):
+ """ Check that --help-datasource works. """
+ app = packager.cli.PackagerApp()
+ ret = app.execute(['--help-datasource'])
+ print ret
+ assert ret == 0, "Return value for help must be 0."
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/test_packager_datasources.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/test_packager_datasources.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,377 @@
+#============================================================================
+#Name : test_packager_datasources.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+import unittest
+from unittestadditions import skip
+skipTest = False
+try:
+ import packager.datasources
+except ImportError:
+ skipTest = True
+import os
+from StringIO import StringIO
+import tempfile
+import xml.sax
+import logging
+import sys
+
+#logging.basicConfig(level=logging.DEBUG)
+logger = logging.getLogger('nokiatest.datasources')
+
+class DataSourceInterfaceTest(unittest.TestCase):
+ """ Verifying the datasource interface. """
+
+ @skip(skipTest)
+ def test_datasource_getComponent(self):
+ """ Check that getComponent is not implemented. """
+ ds = packager.datasources.DataSource('/')
+ self.assertRaises(NotImplementedError, ds.getComponents)
+
+ @skip(skipTest)
+ def test_datasource_getHelp(self):
+ """ Check that no help is defined. """
+ ds = packager.datasources.DataSource('/')
+ self.assertEqual(None, ds.getHelp())
+ self.assertEqual(ds.help, ds.getHelp())
+
+class CMakerDataSourceTest(unittest.TestCase):
+ """ Unit test for CMakerDataSource """
+ @skip(skipTest)
+ def test_whatlog_missing(self):
+ """ getComponent should fail if whatlog is missing. """
+ data = {}
+ ds = packager.datasources.CMakerDataSource('/', data)
+ self.assertRaises(packager.datasources.MissingProperty, ds.getComponents)
+
+ @skip(skipTest)
+ def test_configdir_missing(self):
+ """ getComponent should fail if configdir is missing. """
+ data = {'whatlog': 'somevalue'}
+ ds = packager.datasources.CMakerDataSource('/', data)
+ self.assertRaises(packager.datasources.MissingProperty, ds.getComponents)
+
+ @skip(skipTest)
+ def test_invalid_whatlog_invalid_configdir(self):
+ """ getComponent should fail because whatlog doesn't exists. """
+ data = {'whatlog': 'somevalue', 'configdir': 'somevalue'}
+ ds = packager.datasources.CMakerDataSource('/', data)
+ self.assertRaises(Exception, ds.getComponents)
+
+ @skip(skipTest)
+ def test_valid_whatlog_invalid_configdir(self):
+ """ getComponent should fail because configdir doesn't exists. """
+ data = {'whatlog': __file__, 'configdir': 'somevalue'}
+ ds = packager.datasources.CMakerDataSource('/', data)
+ self.assertRaises(Exception, ds.getComponents)
+
+ @skip(skipTest)
+ def test_install_log_parsing(self):
+ """ Test the parsing of a regular cmaker install log. """
+ log = r"""C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(src/env.mk),q(/epoc32/tools/cmaker/env.mk))'
+C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(src/functions.mk),q(/epoc32/tools/cmaker/functions.mk))'
+C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(src/include_template.mk),q(/epoc32/tools/cmaker/include_template.mk))'
+C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(src/settings.mk),q(/epoc32/tools/cmaker/settings.mk))'
+C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(src/tools.mk),q(/epoc32/tools/cmaker/tools.mk))'
+C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(src/utils.mk),q(/epoc32/tools/cmaker/utils.mk))'
+C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(bin/mingw_make.exe),q(/epoc32/tools/rom/mingw_make.exe))'
+C:\APPS\actperl\bin\perl.exe -e 'use File::Copy; copy(q(src/cmaker.cmd),q(/epoc32/tools/cmaker.cmd))'
+"""
+ (handle, filename) = tempfile.mkstemp()
+ os.write(handle, log)
+ os.close(handle)
+
+ data = {'whatlog': filename, 'configdir': os.path.dirname(__file__)}
+ ds = packager.datasources.CMakerDataSource('/', data)
+ components = ds.getComponents()
+ assert len(components) == 1
+ assert len(components[0].getTargetFiles()) == 8
+ assert 'epoc32/tools/rom/mingw_make.exe' in components[0].getTargetFiles()
+
+ os.remove(filename)
+
+
+ @skip(skipTest)
+ def test_what_log_parsing_windows(self):
+ """ Test the parsing of a regular cmaker what log (windows). """
+ if sys.platform == 'win32':
+ log = r"""\epoc32\tools\rom\image.txt
+\CreateImage.cmd
+cd \config\overlay && xcopy *.* \ /F /R /Y /S
+0 File(s) copied
+cd \tools\toolsmodTB92 && xcopy *.* \ /F /R /Y /S
+Y:\tools\toolsmodTB92\epoc32\tools\abld.pl -> Y:\epoc32\tools\abld.pl
+Y:\tools\toolsmodTB92\epoc32\tools\bldmake.pl -> Y:\epoc32\tools\bldmake.pl
+"""
+ (handle, filename) = tempfile.mkstemp()
+ os.write(handle, log)
+ os.close(handle)
+
+ data = {'whatlog': filename, 'configdir': os.path.dirname(__file__)}
+ ds = packager.datasources.CMakerDataSource('/', data)
+ components = ds.getComponents()
+ assert len(components) == 1
+ assert len(components[0].getTargetFiles()) == 2
+ print components[0].getTargetFiles()
+ assert 'CreateImage.cmd' in components[0].getTargetFiles()
+ assert 'epoc32/tools/rom/image.txt' in components[0].getTargetFiles()
+ assert 'epoc32/tools/abld.pl' not in components[0].getTargetFiles()
+ assert 'epoc32/tools/bldmake.pl' not in components[0].getTargetFiles()
+
+ os.remove(filename)
+
+ @skip(skipTest)
+ def test_what_log_parsing_linux(self):
+ """ Test the parsing of a regular cmaker what log (linux). """
+ if sys.platform != 'win32':
+ log = r"""/epoc32/tools/rom/image.txt
/CreateImage.cmd
+"""
+ (handle, filename) = tempfile.mkstemp()
+ os.write(handle, log)
+ os.close(handle)
+
+ data = {'whatlog': filename, 'configdir': os.path.dirname(__file__)}
+ ds = packager.datasources.CMakerDataSource('/', data)
+ components = ds.getComponents()
+ assert len(components) == 1
+ assert len(components[0].getTargetFiles()) == 2
+ print components[0].getTargetFiles()
+ assert 'CreateImage.cmd' in components[0].getTargetFiles()
+ assert 'epoc32/tools/rom/image.txt' in components[0].getTargetFiles()
+
+ os.remove(filename)
+
+
+ @skip(skipTest)
+ def test_getHelp(self):
+ """ Check that help is defined for CMakerDataSource. """
+ ds = packager.datasources.CMakerDataSource('/', {})
+ self.assertNotEqual(None, ds.getHelp())
+ self.assertEqual(ds.help, ds.getHelp())
+
+
+class SBSDataSourceTest(unittest.TestCase):
+ """ Unit test case for SBSDataSource """
+ @skip(skipTest)
+ def test_getHelp(self):
+ """ Check that help is defined for SBSDataSource. """
+ ds = packager.datasources.SBSDataSource('/', {})
+ self.assertNotEqual(None, ds.getHelp())
+ self.assertEqual(ds.help, ds.getHelp())
+
+
+class SysdefComponentListTest(unittest.TestCase):
+ """ Unit test case for packager.datasources.sbs.SysdefComponentList """
+ sysdef = None
+
+ def setUp(self):
+ self.sysdef = StringIO("""
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+""")
+
+ @skip(skipTest)
+ def test_unit_parsing(self):
+ """ SysdefComponentList extract correctly the units... """
+ cl = packager.datasources.sbs.SysdefComponentList('/')
+ p = xml.sax.make_parser()
+ p.setContentHandler(cl)
+ p.parse(self.sysdef)
+ assert len(cl) == 2
+ assert cl['unit1_name']['path'] == os.path.normpath('/path/to/component1')
+ assert cl['unit2_name']['path'] == os.path.normpath('/path/to/Component2')
+ assert cl['unit2_name']['name'] == 'unit2_name'
+
+ @skip(skipTest)
+ def test_get_component_name_by_path(self):
+ """ Check if get_component_name_by_path is case unsensitive. """
+ cl = packager.datasources.sbs.SysdefComponentList('/')
+ p = xml.sax.make_parser()
+ p.setContentHandler(cl)
+ p.parse(self.sysdef)
+
+ # reading path should be case independent.
+ assert cl.get_component_name_by_path(os.path.normpath('/path/to/Component2')) == 'unit2_name'
+ assert cl.get_component_name_by_path(os.path.normpath('/path/to/component2')) == 'unit2_name'
+
+ @skip(skipTest)
+ def test_get_component_name_by_path_invalid(self):
+ """ Check that get_component_name_by_path is raising an exception if """
+ cl = packager.datasources.sbs.SysdefComponentList('/')
+ p = xml.sax.make_parser()
+ p.setContentHandler(cl)
+ p.parse(self.sysdef)
+
+ # reading path should be case independent.
+ try:
+ cl.get_component_name_by_path(os.path.normpath('/path/to/invalid'))
+ except packager.datasources.sbs.ComponentNotFound:
+ pass
+ else:
+ self.fail("Expected get_component_name_by_path to raise an exception in case of non-existing component definition.")
+
+
+class SysdefComponentListSysdef3ParsingTest(unittest.TestCase):
+ """ Unit test case for packager.datasources.sbs.SysdefComponentList """
+ sysdef = None
+
+ def setUp(self):
+ self.sysdef = StringIO("""
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+""")
+
+ @skip(skipTest)
+ def test_unit_parsing(self):
+ """ SysdefComponentList extract correctly the units... """
+ cl = packager.datasources.sbs.SysdefComponentList('/')
+ p = xml.sax.make_parser()
+ p.setContentHandler(cl)
+ p.parse(self.sysdef)
+ assert len(cl) == 2
+ print cl
+ assert cl['helloworldcons_app_sf_app_helloworldcons_group']['path'] == os.path.normpath('/sf/app/helloworldcons/group')
+ assert cl['helloworld_api_sf_mw_helloworldapi_group']['path'] == os.path.normpath('/sf/mw/helloworldapi/group')
+ assert cl['helloworld_api_sf_mw_helloworldapi_group']['name'] == 'helloworld_api'
+
+ @skip(skipTest)
+ def test_get_component_name_by_path(self):
+ """ Check if get_component_name_by_path is case unsensitive. """
+ cl = packager.datasources.sbs.SysdefComponentList('/')
+ p = xml.sax.make_parser()
+ p.setContentHandler(cl)
+ p.parse(self.sysdef)
+
+ # reading path should be case independent.
+ assert cl.get_component_name_by_path(os.path.normpath('/sf/app/helloworldcons/group')) == 'helloworldcons_app_sf_app_helloworldcons_group'
+ assert cl.get_component_name_by_path(os.path.normpath('/sf/mw/helloworldapi/group')) == 'helloworld_api_sf_mw_helloworldapi_group'
+
+ @skip(skipTest)
+ def test_get_component_name_by_path_invalid(self):
+ """ Check that get_component_name_by_path is raising an exception if """
+ cl = packager.datasources.sbs.SysdefComponentList('/')
+ p = xml.sax.make_parser()
+ p.setContentHandler(cl)
+ p.parse(self.sysdef)
+
+ # reading path should be case independent.
+ try:
+ cl.get_component_name_by_path(os.path.normpath('/path/to/invalid'))
+ except packager.datasources.sbs.ComponentNotFound:
+ pass
+ else:
+ self.fail("Expected get_component_name_by_path to raise an exception in case of non-existing component definition.")
+
+
+class ObyParserTest(unittest.TestCase):
+ """ Unit test case for packager.datasources.imaker.ObyParser """
+ oby = None
+
+ def setUp(self):
+ (hld, filename) = tempfile.mkstemp(".oby", "datasource_test")
+ os.write(hld, """
+rofssize=0x10000000
+# file=\\epoc32\\release\\ARMV5\\urel\\COMMENT.DLL "Sys\\Bin\\EDISP.DLL"
+file=\\epoc32\\release\\ARMV5\\urel\\edisp.dll "Sys\\Bin\\EDISP.DLL"
+data=\\epoc32\\data\\Z\\Private\\10202BE9\\20000585.txt "Private\\10202BE9\\20000585.txt"
+extension[0x09080004]=\\epoc32\\release\ARMV5\urel\power_resources.dll "Sys\\Bin\\power_resources.dll"
+variant[0x09080004]=\\epoc32\\release\\ARMV5\\urel\\ecust.b23b7726cf4b5801b0dc14102b245fb8.dll "Sys\\Bin\\ecust.dll"
+# file="\\epoc32\\release\\ARMV5\\urel\\edisp.dll" "Sys\\Bin\\EDISP.DLL"
+data="/output/release_flash_images/langpack_01/rofs2/variant/private/10202be9/10281872.txt" "private\10202be9\10281872.txt"
+""")
+ os.close(hld)
+ self.oby = filename
+
+ def tearDown(self):
+ os.remove(self.oby)
+
+ @skip(skipTest)
+ def test_oby(self):
+ """ Testing the extraction of source files from an processed Oby file. """
+ print self.oby
+ p = packager.datasources.imaker.ObyParser('/', self.oby)
+ files = p.getSourceFiles()
+ print files
+ assert len(files) == 5
+ assert os.path.normpath(r'\epoc32\release\ARMV5\urel\edisp.dll'.replace('\\', os.sep).replace('/', os.sep)) in files
+ assert os.path.normpath(r'\epoc32\data\Z\Private\10202BE9\20000585.txt'.replace('\\', os.sep).replace('/', os.sep)) in files
+ assert os.path.normpath(r'\epoc32\release\ARMV5\urel\power_resources.dll'.replace('\\', os.sep).replace('/', os.sep)) in files
+ assert os.path.normpath(r'\epoc32\release\ARMV5\urel\ecust.b23b7726cf4b5801b0dc14102b245fb8.dll'.replace('\\', os.sep).replace('/', os.sep)) in files
+ assert os.path.normpath(r'/output/release_flash_images/langpack_01/rofs2/variant/private/10202be9/10281872.txt'.replace('\\', os.sep).replace('/', os.sep)) in files
+
+
+class ConEDataSourceTest(unittest.TestCase):
+ """ ConfToolDataSource unittest. """
+
+ @skip(skipTest)
+ def test_cone_input(self):
+ """ Testing ConE output log parsing. """
+ log = """ Generating file '\\epoc32\\release\\winscw\\urel\\z\\private\\10202BE9\\10208dd7.txt'...
+DEBUG : cone.crml(assets/symbianos/implml/usbmanager_10285c46.crml)
+ Generating file '\\epoc32\\release\\winscw\\urel\\z\\private\\10202BE9\\10285c46.txt'...
+DEBUG : cone.crml(assets/symbianos/implml/usbmanager_10286a43.crml)
+ Generating file '\\epoc32\\release\\winscw\\urel\\z\\private\\10202BE9\\10286a43.txt'...
+INFO : cone
+ Adding impl CrmlImpl(ref='assets/symbianos/implml/apputils_100048aa.crml', type='crml', index=0)
+INFO : cone
+"""
+ (handle, filename) = tempfile.mkstemp()
+ os.write(handle, log)
+ os.close(handle)
+ data = {'filename': filename, 'name': 'cone', 'version': '1.0'}
+ ds = packager.datasources.ConEDataSource('/', data)
+ components = ds.getComponents()
+ assert len(components) == 1
+ print components[0].getTargetFiles()
+ assert len(components[0].getTargetFiles()) == 3
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/test_packager_io.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/blockspackagertests/test_packager_io.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,113 @@
+#============================================================================
+#Name : test_packager_io.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+# pylint: disable=E0602
+import unittest
+import logging
+from unittestadditions import skip
+skipTest = False
+try:
+ import packager.io
+ from Blocks.Packaging.BuildData import *
+except ImportError:
+ skipTest = True
+
+#logging.basicConfig(level=logging.DEBUG)
+logger = logging.getLogger('nokiatest.datasources')
+
+class BuildDataSerializerTest(unittest.TestCase):
+ """ Check the de/serialisation of PlainBuildData objects. """
+
+ @skip(skipTest)
+ def test_serialization_deserialization(self):
+ """ Check if a serialized PlainBuildData can be deserialized correctly. """
+ bd = PlainBuildData()
+ bd.setComponentName("foobar")
+ bd.setComponentVersion("99")
+ bd.setSourceRoot('/src')
+ bd.setTargetRoot('/epoc32')
+ bd.addSourceFiles(['src.txt', 'cmp/src.txt'])
+ bd.addTargetFiles(['release/armv5/urel/target.dll', 'release/armv5/lib/target.lib'])
+ data_xml = packager.io.BuildDataSerializer(bd).toXml()
+ bdx = packager.io.BuildDataSerializer().fromXml(data_xml)
+ self.assertEquals(bd.getComponentName(), bdx.getComponentName())
+ self.assertEquals(bd.getComponentVersion(), bdx.getComponentVersion())
+ self.assertEquals(bd.getSourceRoot(), bdx.getSourceRoot())
+ self.assertEquals(bd.getTargetRoot(), bdx.getTargetRoot())
+ self.assertEquals(bd.getSourceFiles(), bdx.getSourceFiles())
+ self.assertEquals(bd.getTargetFiles(), bdx.getTargetFiles())
+ self.assertEquals(len(bdx.getSourceFiles()), 2)
+ self.assertEquals(len(bdx.getTargetFiles()), 2)
+ assert 'release/armv5/urel/target.dll' in bdx.getTargetFiles()
+ assert 'release/armv5/lib/target.lib' in bdx.getTargetFiles()
+ assert 'src.txt' in bdx.getSourceFiles()
+ assert 'cmp/src.txt' in bdx.getSourceFiles()
+
+class BdFileSerializerTest(unittest.TestCase):
+ """ Verifying the datasource interface. """
+
+ @skip(skipTest)
+ def test_serialization_deserialization(self):
+ """ Check if a serialized BdFile can be deserialized correctly. """
+ bd = BdFile("epoc32/release/armv5/urel/target.dll")
+ bd.getVariantPlatform()
+ bd.addSourceDependency("/src/src.txt")
+ bd.addOwnerDependency("/epoc32/release/armv5/urel/target.dll")
+ data_xml = packager.io.BdFileSerializer(bd).toXml()
+ bdx = packager.io.BdFileSerializer().fromXml(data_xml)
+ self.assertEquals(bd.getPath(), bdx.getPath())
+ self.assertEquals(bd.getVariantPlatform(), bdx.getVariantPlatform())
+ self.assertEquals(bd.getVariantType(), bdx.getVariantType())
+ self.assertEquals(bd.getSourceDependencies(), bdx.getSourceDependencies())
+ self.assertEquals(bd.getOwnerDependencies(), bdx.getOwnerDependencies())
+
+ assert len(bd.getSourceDependencies()) == 1
+ assert len(bd.getOwnerDependencies()) == 1
+
+ assert "/src/src.txt" in bd.getSourceDependencies()
+ assert '/epoc32/release/armv5/urel/target.dll' in bd.getOwnerDependencies()
+
+
+class BuildDataMergerTest(unittest.TestCase):
+ """ Unit test case for packager.io.BuildDataMerger """
+ @skip(skipTest)
+ def test_merge(self):
+ """ Testing a simple merge. """
+ bd = PlainBuildData()
+ bd.setComponentName("foobar")
+ bd.setComponentVersion("99")
+ bd.setSourceRoot('/src')
+ bd.setTargetRoot('/epoc32')
+ bd.addSourceFiles(['src.txt', 'cmp/src.txt'])
+ bd.addTargetFiles(['release/armv5/urel/target.dll', 'release/armv5/lib/target.lib'])
+
+ bd2 = PlainBuildData()
+ bd2.setComponentName("foobar")
+ bd2.setComponentVersion("99")
+ bd2.setSourceRoot('/src')
+ bd2.setTargetRoot('/epoc32')
+ bd2.addSourceFiles(['src.txt', 'cmp/src.txt', 'cmp2/src.txt'])
+ bd2.addTargetFiles(['release/armv5/urel/target2.dll'])
+
+ m = packager.io.BuildDataMerger(bd)
+ m.merge(bd2)
+
+ assert len(bd.getSourceFiles()) == 3
+ assert len(bd.getTargetFiles()) == 3
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/__init__.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/__init__.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,18 @@
+#============================================================================
+#Name : __init__.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/cli.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/cli.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,199 @@
+#============================================================================
+#Name : cli.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+import sys
+import re
+import os
+import xml.dom.minidom
+from optparse import OptionParser
+import Blocks
+from packager.io import BuildDataSerializer, BuildDataMerger
+from Blocks.Packaging.DependencyProcessors.DefaultProcessors import BuildDataDependencyProcessor
+import packager.datasources
+import logging
+logging.basicConfig(level=logging.INFO)
+
+
+
+
+class PackagerApp:
+ """ The packager CLI implementation. """
+ def __init__(self):
+ self.logger = logging.getLogger("packager")
+ self.cli = OptionParser(usage="%prog [options]")
+ self.cli.add_option("--epocroot", metavar="DIR", help="Epocroot location (must be an absolute path)")
+ self.cli.add_option("--config", metavar="DIR")
+ self.cli.add_option("--outputdir", metavar="DIR")
+ self.cli.add_option("--datasource", metavar="NAME")
+ self.cli.add_option("--metadatadir", metavar="DIR")
+ self.cli.add_option("--updateData", action="store_true", dest="action_update", default=False)
+ self.cli.add_option("--createBundles", action="store_true", dest="action_bundle", default=False)
+ self.cli.add_option("--help-datasource", action="store_true", dest="action_help_datasource", default=False)
+ self.cli.add_option("--workers", type="int", dest="workers", default=4)
+ self.cli.add_option("--writer", dest="writer", default='deb')
+ self.cli.add_option("--sourceRules", dest="sourceRules")
+ self.cli.add_option("--targetRules", dest="targetRules")
+ self.cli.add_option("--pkgDirectives", dest="pkgDirectives")
+ self.cli.add_option("--debug", action="store_true", default=False)
+ self.cli.add_option("--interdeps", choices=['true', 'false'], dest="interdeps", default='false')
+ self.__workers = 4
+ self.__writer = "deb"
+ self.__config = None
+ self.__epocroot = None
+ self.__datasource = None
+ self.__update = False
+ self.__bundle = False
+ self.__help_datasource = False
+ self.__outputdir = None
+ self.__source_rules = None
+ self.__target_rules = None
+ self.__directives = None
+ self.__metadatadir = None
+ self.__interdeps = None
+ self.__writerOptions = None
+ self.__data = {}
+
+ def __readoptions(self, argv=sys.argv):
+ # removing -Dxxx=xxx
+ args = []
+ for arg in argv:
+ res = re.match("-D(.+)=(.*)", arg)
+ if res is not None:
+ self.logger.debug("property: %s=%s" % (res.group(1), res.group(2)))
+ self.__data[res.group(1)] = res.group(2)
+ else:
+ args.append(arg)
+
+ opts, dummy_args = self.cli.parse_args(args)
+ self.__config = opts.config
+ self.__epocroot = opts.epocroot
+ self.__outputdir = opts.outputdir
+ self.__update = opts.action_update
+ self.__bundle = opts.action_bundle
+ self.__help_datasource = opts.action_help_datasource
+ self.__datasource = opts.datasource
+ self.__workers = opts.workers
+ self.__writer = opts.writer
+ self.__source_rules = opts.sourceRules
+ self.__target_rules = opts.targetRules
+ self.__directives = opts.pkgDirectives
+ self.__metadatadir = opts.metadatadir
+ self.__interdeps = opts.interdeps
+ if opts.debug:
+ logging.getLogger().setLevel(logging.DEBUG)
+
+ def __update_data(self):
+ if self.__config is None:
+ raise Exception("--config argument is missing.")
+ if self.__epocroot is None:
+ raise Exception("--epocroot argument is missing.")
+ if not os.path.exists(self.__config) or not os.path.isdir(self.__config):
+ raise Exception("Could not find directory: %s." % self.__config)
+ if not os.path.exists(self.__epocroot) or not os.path.isdir(self.__epocroot) or not os.path.isabs(self.__epocroot):
+ raise Exception("Could not find directory: %s." % self.__epocroot)
+ if self.__datasource is None:
+ raise Exception("--datasource argument is missing.")
+
+ self.logger.info("Retrieving components information...")
+ datasource = packager.datasources.getDataSource(self.__datasource, self.__epocroot, self.__data)
+ for component in datasource.getComponents():
+ outfilename = os.path.join(self.__config, component.getComponentName() + ".blocks_component.xml")
+ if os.path.exists(outfilename):
+ bd = BuildDataSerializer().fromXml(open(outfilename).read())
+ self.logger.info("Merging with previous data...")
+ component = BuildDataMerger(bd).merge(component)
+ serializer = BuildDataSerializer(component)
+ self.logger.info("Writing %s" % outfilename)
+ output = open(outfilename , 'wb')
+ output.write(xml.dom.minidom.parseString(serializer.toXml()).toprettyxml())
+ output.close()
+
+ def __create_bundles(self):
+ if self.__config is None:
+ raise Exception("--config argument is missing.")
+ if self.__epocroot is None:
+ raise Exception("--epocroot argument is missing.")
+ if self.__metadatadir is None:
+ raise Exception("--metadatadir argument is missing.")
+ if not os.path.exists(self.__config) or not os.path.isdir(self.__config):
+ raise Exception("Could not find directory: %s." % self.__config)
+ if not os.path.exists(self.__epocroot) or not os.path.isdir(self.__epocroot) or not os.path.isabs(self.__epocroot):
+ raise Exception("Could not find directory: %s." % self.__epocroot)
+ if self.__outputdir is None:
+ raise Exception("--outputdir argument is missing.")
+ if not os.path.exists(self.__outputdir) or not os.path.isdir(self.__outputdir):
+ raise Exception("Could not find directory: %s." % self.__epocroot)
+ if not os.path.exists(self.__metadatadir) or not os.path.isdir(self.__metadatadir):
+ raise Exception("Could not find directory: %s." % self.__metadatadir)
+
+ if self.__interdeps == 'false':
+ self.__writerOptions = {'STRONG_DEP_MAPPING': None}
+
+ # Creating the packager.
+ storage = Blocks.Packaging.OneoffStorage(self.__metadatadir)
+ packager_obj = Blocks.Packaging.Packager(storage,
+ self.__outputdir,
+ maxWorkers = self.__workers,
+ writer = self.__writer,
+ targetRules = self.__target_rules,
+ sourceRules = self.__source_rules,
+ directives = self.__directives,
+ writerOptions = self.__writerOptions
+ #startNow=False
+ )
+ # Adding processors
+ packager_obj.addProcessor(BuildDataDependencyProcessor)
+ try:
+ from Blocks.Packaging.DependencyProcessors.RaptorDependencyProcessor import DotDeeDependencyProcessor
+ packager_obj.addProcessor(DotDeeDependencyProcessor)
+ except ImportError:
+ logging.warning("Could not load DotDeeDependencyProcessor.")
+
+ for filename in os.listdir(self.__config):
+ filename = os.path.normpath(os.path.join(self.__config, filename))
+ if not filename.endswith('.blocks_component.xml'):
+ continue
+ self.logger.info("Loading %s" % filename)
+ packager_obj.addComponent(BuildDataSerializer().fromXml(open(filename, 'r').read()))
+
+ packager_obj.wait()
+
+ def execute(self, argv=sys.argv):
+ """ Run the CLI. """
+ try:
+ self.__readoptions(argv)
+ if self.__help_datasource:
+ print packager.datasources.getDataSourceHelp()
+ elif self.__update:
+ self.__update_data()
+ elif self.__bundle:
+ self.__create_bundles()
+ else:
+ self.cli.print_help()
+ except IOError, exc:
+ if self.logger.getEffectiveLevel() == logging.DEBUG:
+ self.logger.exception(exc)
+ self.logger.error(str(exc))
+ return -1
+ return 0
+
+
+if __name__ == "__main__":
+ app = PackagerApp()
+ sys.exit(app.execute())
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/datasources/__init__.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/datasources/__init__.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,29 @@
+#============================================================================
+#Name : __init__.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+"""
+Definitions of the datasource.
+"""
+from packager.datasources.api import *
+from packager.datasources.cmaker import CMakerDataSource
+from packager.datasources.imaker import IMakerDataSource
+from packager.datasources.sbs import SBSDataSource
+from packager.datasources.cone import ConEDataSource
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/datasources/api.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/datasources/api.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,73 @@
+#============================================================================
+#Name : api.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+import logging
+logger = logging.getLogger("datasources.api")
+
+class MissingProperty(Exception):
+ """ An exception to indicate about a missing property """
+ pass
+
+class DataSource(object):
+ """ This abstract class defines a DataSource for the packager application. """
+ def __init__(self, epocroot, data=None):
+ self.epocroot = epocroot
+ self._data = data
+ if data is None:
+ self._data = {}
+
+ def getComponents(self):
+ """ The getComponents method must return a list of BuildData object (one per component).
+ In case of error (e.g incomplete configuration) the method will raise an Exception.
+ """
+ raise NotImplementedError
+
+ def getHelp(self):
+ return None
+
+ help = property(lambda self: self.getHelp())
+
+
+DATASOURCES = {}
+
+def getDataSource(name, epocroot, data):
+ if name in DATASOURCES:
+ logger.debug("Creating datasource for %s." % name)
+ return DATASOURCES[name](epocroot, data)
+ else:
+ logger.info("Loading %s." % name)
+ def class_import(name):
+ try:
+ components = name.split('.')
+ klassname = components.pop()
+ mod = __import__('.'.join(components), globals(), locals(), [klassname])
+ return getattr(mod, klassname)
+ except:
+ raise Exception("Could not load %s" % name)
+ return class_import(name)(epocroot, data)
+
+
+def getDataSourceHelp():
+ doc = ""
+ for name in DATASOURCES:
+ dshelp = DATASOURCES[name](None, None).help
+ if dshelp is not None:
+ doc = doc + "--- %s -----------------------------------\n" % name + dshelp +\
+ "\n------------------------------------------\n"
+ return doc
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/datasources/cmaker.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/datasources/cmaker.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,106 @@
+#============================================================================
+#Name : cmaker.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+import os
+import re
+from packager.datasources.api import DataSource, MissingProperty, DATASOURCES
+from Blocks.Packaging.BuildData import PlainBuildData
+import logging
+
+logger = logging.getLogger('packager.datasources.cmaker')
+
+class CMakerDataSource(DataSource):
+ """ Extract information from cMaker logs """
+ def __init__(self, epocroot, data):
+ DataSource.__init__(self, epocroot, data)
+
+ def getComponents(self):
+ if 'whatlog' not in self._data:
+ raise MissingProperty("The whatlog property has not be defined.")
+ if 'configdir' not in self._data:
+ raise MissingProperty("The configdir property has not be defined.")
+ component_name = "cmaker"
+ if 'name' in self._data:
+ component_name = self._data['name']
+ version = "1"
+ if 'version' in self._data:
+ version = self._data['version']
+
+ # validating the inputs
+ if not os.path.exists(self._data['whatlog']) or not os.path.isfile(self._data['whatlog']):
+ raise Exception("Could not find %s file." % self._data['whatlog'])
+ cdir = os.path.abspath(self._data['configdir'])
+ if not os.path.exists(cdir) or not os.path.isdir(cdir):
+ raise Exception("Could not find %s directory." % cdir)
+
+
+ build_data = PlainBuildData()
+ build_data.setComponentName(component_name)
+ build_data.setComponentVersion(version) # need to get it from a the sysdef file
+ build_data.setSourceRoot(self.epocroot)
+ build_data.setTargetRoot(self.epocroot)
+
+ targets = [path[len(self.epocroot):].lstrip(os.sep) for path in self.getExportedFiles()]
+ build_data.addTargetFiles(targets)
+ sources = [path[len(self.epocroot):].lstrip(os.sep) for path in self.getSourceFiles()]
+ build_data.addSourceFiles(sources)
+ return [build_data]
+
+
+ def getExportedFiles(self):
+ """ Get the list of exported file from the log. The parser will recognize cMaker what output and
+ cMaker install log. The usage of xcopy will get warn to the user as its output will not be consider
+ and the target file will get dismissed. """
+ log = open(self._data['whatlog'], 'r')
+ for line in log:
+ line = line.rstrip()
+ rcopy = re.match(r'^.*\s+copy\(q\((.+)\),q\((.*)\)\)\'', line)
+ rxcopy = re.match(r'^(.*)\s+\-\>\s+(.+)$', line)
+ if ':' not in line and line.startswith(os.sep):
+ yield os.path.normpath(os.path.join(self.epocroot, line))
+ elif rcopy is not None:
+ yield os.path.normpath(os.path.join(self.epocroot, rcopy.group(2)))
+ elif rxcopy is not None:
+ logger.warning('This looks like an xcopy output! Make sure you use cmaker correctly: %s' % line)
+
+
+ def getSourceFiles(self):
+ """ Get the list of source file using the call dir and the whatdeps log if available. """
+ cdir = os.path.abspath(self._data['configdir'])
+ for (path, dirpath, namelist) in os.walk(cdir):
+ for name in namelist:
+ yield os.path.join(path, name)
+ if 'whatdepslog' in self._data:
+ log = open(self._data['whatdepslog'], 'r')
+ for line in log:
+ line = line.rstrip()
+ if ':' not in line and line.startswith(os.sep):
+ yield os.path.normpath(os.path.join(self.epocroot, line))
+
+ def getHelp(self):
+ help_ = """This datasource will gather information from the cMaker output logs.
+Plugin property configuration:
+whatlog Defines the location of the whatlog.
+configdir Defines cMaker calling location.
+whatdepslog Defines the location of the cMaker whatdeps log (optional).
+ """
+ return help_
+
+
+DATASOURCES['cmaker'] = CMakerDataSource
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/datasources/cone.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/datasources/cone.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,74 @@
+#============================================================================
+#Name : conftool.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+from packager.datasources.api import DataSource, DATASOURCES
+from Blocks.Packaging.BuildData import PlainBuildData
+import logging
+import re
+import os
+
+logger = logging.getLogger('packager.datasources.conftool')
+
+class ConEDataSource(DataSource):
+ """ Extract information from ConE logs """
+ def __init__(self, epocroot, data=None):
+ DataSource.__init__(self, epocroot, data)
+
+ def getTargetFiles(self):
+ """ Get the generated files from the log output. """
+ result = []
+ txtFile = open(self._data['filename'], 'r')
+ matcher = re.compile(r"^\s*Generating file '(.+)'\.\.\.\s*$")
+ for line in txtFile:
+ res = matcher.match(line)
+ if res:
+ result.append(os.path.normpath(os.path.join(self.epocroot,
+ res.group(1))))
+ txtFile.close()
+ return result
+
+ def getComponents(self):
+ """ Get the components list from the cli input. """
+ if 'name' not in self._data:
+ raise Exception("The name property has not be defined.")
+ if 'version' not in self._data:
+ raise Exception("The version property has not be defined.")
+
+ if 'filename' not in self._data:
+ raise Exception("The input conftool log file is not defined")
+
+ #todo: add the source iby / path for conftool input
+ build_data = PlainBuildData()
+ build_data.setComponentName(self._data['name'])
+ build_data.setComponentVersion(self._data['version'])
+ build_data.setSourceRoot(self.epocroot)
+ build_data.setTargetRoot(self.epocroot)
+ build_data.addTargetFiles([path[len(self.epocroot):].lstrip(os.sep) for path in self.getTargetFiles()])
+ return [build_data]
+
+ def getHelp(self):
+ """ Returns the help. """
+ return """
+name Defines the name of the component
+version Defines the version of the component
+filename Defines the log file name of ctool
+"""
+
+
+DATASOURCES['cone'] = ConEDataSource
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/datasources/imaker.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/datasources/imaker.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,117 @@
+#============================================================================
+#Name : imaker.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+from packager.datasources.api import DataSource, MissingProperty, DATASOURCES
+from Blocks.Packaging.BuildData import PlainBuildData, BdFile
+import logging
+import re
+import os
+
+logger = logging.getLogger('packager.datasources.imaker')
+
+class ObyParser:
+ """ Simplistic Oby file parser. """
+ def __init__(self, epocroot, filename):
+ self.epocroot = epocroot
+ self.filename = filename
+
+ def getSourceFiles(self):
+ """ Return the list of source file needed to create the image. """
+ result = []
+ logger.debug("Analyzing %s" % self.filename)
+ oby = open(self.filename, 'r')
+ for line in oby:
+ res = re.match(r'\s*(file|data|variant.+|bootbinary|primary.+|extension.+)\s*=\s*\"?(.+?)\"?\s+\".+\"', line)
+ if res is not None:
+ result.append(os.path.normpath(os.path.join(self.epocroot, res.group(2).strip().replace('\\', os.sep).replace('/', os.sep))))
+ oby.close()
+ return result
+
+
+class IMakerDataSource(DataSource):
+ """ Extract information from iMaker logs - iMaker integrated version """
+ def __init__(self, epocroot, data=None):
+ DataSource.__init__(self, epocroot, data)
+
+ def getComponents(self):
+ if 'name' not in self._data:
+ raise Exception("The name property has not be defined.")
+ if 'version' not in self._data:
+ raise Exception("The version property has not be defined.")
+ obys = [self._data[key] for key in self._data.keys() if key.startswith('oby')]
+ targets = [os.path.normpath(self._data[key]) for key in self._data.keys() if key.startswith('target')]
+ build_data = PlainBuildData()
+ build_data.setComponentName(self._data['name'])
+ build_data.setComponentVersion(self._data['version'])
+ build_data.setSourceRoot(self.epocroot)
+ build_data.setTargetRoot(self.epocroot)
+
+ build_data.addTargetFiles([path[len(self.epocroot):].lstrip(os.sep) for path in targets])
+
+ deps = []
+ for oby in obys:
+ deps.extend(ObyParser(self.epocroot, oby).getSourceFiles())
+ for target in targets:
+ print target
+ if target.endswith(".fpsx"):
+ target = os.path.normpath(target)
+ bdfile = BdFile(target[len(self.epocroot):].lstrip(os.sep))
+ bdfile.setOwnerDependencies([path[len(self.epocroot):].lstrip(os.sep) for path in deps])
+ build_data.addDeliverable(bdfile)
+ return [build_data]
+
+class IMakerRomDirDataSource(DataSource):
+ """ Extract information from iMaker logs - guess content of the package from the rom output dir. """
+ def __init__(self, epocroot, data=None):
+ DataSource.__init__(self, epocroot, data)
+
+ def getComponents(self):
+ if 'name' not in self._data:
+ raise MissingProperty("The name property has not be defined.")
+ if 'version' not in self._data:
+ raise MissingProperty("The version property has not be defined.")
+ if 'dir' not in self._data:
+ raise MissingProperty("The dir property has not be defined.")
+ cdir = os.path.normpath(self._data['dir'])
+ obys = []
+ targets = []
+ for (path, dirpath, namelist) in os.walk(cdir):
+ for name in namelist:
+ if name.endswith(".oby"):
+ obys.append(os.path.join(path, name)[len(self.epocroot):].lstrip(os.sep))
+ targets.append(os.path.join(path, name)[len(self.epocroot):].lstrip(os.sep))
+ build_data = PlainBuildData()
+ build_data.setComponentName(self._data['name'])
+ build_data.setComponentVersion(self._data['version'])
+ build_data.setSourceRoot(self.epocroot)
+ build_data.setTargetRoot(self.epocroot)
+ build_data.addTargetFiles(targets)
+ return [build_data]
+
+ def getHelp(self):
+ return """
+name Defines the name of the component
+version Defines the version of the component
+dir Defines the root location of ROM images.
+"""
+
+
+DATASOURCES['imaker'] = IMakerDataSource
+DATASOURCES['imaker-romdir'] = IMakerRomDirDataSource
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/datasources/sbs.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/datasources/sbs.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,299 @@
+#============================================================================
+#Name : imaker.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+import xml.sax
+import time
+import os
+import re
+import fileutils
+import sys
+from packager.datasources.api import DataSource, MissingProperty, DATASOURCES
+from Blocks.Packaging.DataSources.LinkInfoToBuildData import LinkInfoXmlReader # pylint: disable=F0401
+try:
+ from Blocks.Packaging.DataSources.SbsLinkInfoReader import LinkInfoReader # pylint: disable=E0611
+except ImportError:
+ if os.path.sep == '\\':
+ raptor_cmd = fileutils.which("sbs.bat")
+ else:
+ raptor_cmd = fileutils.which("sbs")
+ sbs_home = os.path.dirname(os.path.dirname(raptor_cmd))
+ os.environ['SBS_HOME'] = sbs_home
+ sys.path.append(os.path.join(sbs_home, 'python'))
+ sys.path.append(os.path.join(sbs_home, 'python', 'plugins'))
+ # loading as raptor plugin - loading also raptor.
+ if os.path.sep == '\\':
+ os.environ['HOSTPLATFORM'] = 'win 32'
+ os.environ['HOSTPLATFORM_DIR'] = 'win32'
+ else:
+ os.environ['HOSTPLATFORM'] = 'linux'
+ os.environ['HOSTPLATFORM_DIR'] = 'linux'
+ from filter_blocks import LinkInfoReader # pylint: disable=F0401
+
+from Blocks.Packaging.BuildData import PlainBuildData
+from Blocks.Packaging.DataSources.WhatLog import WhatLogReader as LogReader
+import logging
+from Queue import Queue
+from threading import Thread
+
+class ComponentNotFound(Exception):
+ """ Error raised in case of not found component. """
+
+ def __init__(self, message):
+ Exception.__init__(self, message)
+
+class SysdefComponentList(xml.sax.ContentHandler):
+ """ Simplistic sysdef data extractor, it will only get data from unit elements."""
+
+ def __init__(self, epocroot, version="1"):
+ xml.sax.ContentHandler.__init__(self)
+ self.__data = {}
+ self.__epocroot = epocroot
+ self.__version = version
+ self.__component = None
+
+ def startElement(self, tag, attributes):
+ if tag == "component" and attributes.get("id"):
+ self.__component = attributes.get("id")
+ elif tag == "unit" and self.__component and not attributes.get("unitID") and not attributes.get("name") and attributes.get("bldFile"):
+ data = {}
+ data['path'] = os.path.normpath(os.path.join(self.__epocroot, attributes.get("bldFile")).replace('\\', os.sep).replace('/', os.sep))
+ if attributes.get("version") is None:
+ data['version'] = self.__version
+ else:
+ data['version'] = attributes.get("version")
+ data['name'] = self.__cleanup_name(self.__component)
+ self.__data[self.__component + attributes.get("bldFile").replace('\\', '_').replace('/', '_')] = data
+ elif tag == "unit" and attributes.get("name") is not None and attributes.get("bldFile") is not None:
+ data = {}
+ data['path'] = os.path.normpath(os.path.join(self.__epocroot, attributes.get("bldFile")).replace('\\', os.sep).replace('/', os.sep))
+ if attributes.get("version") is None:
+ data['version'] = self.__version
+ else:
+ data['version'] = attributes.get("version")
+ data['name'] = self.__cleanup_name(attributes.get("name"))
+ self.__data[self.__cleanup_name(attributes.get("name"))] = data
+
+ def endElement(self, tag):
+ if tag == "component":
+ self.__component = None
+
+ def __cleanup_name(self, name):
+ return re.sub(r'[^a-zA-Z0-9_-]', '', re.sub(r'\.', '_', name))
+
+ def keys(self):
+ return self.__data.keys()
+
+ def __getitem__(self, key):
+ return self.__data[key]
+
+ def __contains__(self, key):
+ for data in self.__data:
+ if key in data['name']:
+ return True
+ return False
+
+ def __len__(self):
+ return self.__data.__len__()
+
+ def get_component_name_by_path(self, dir_):
+ dir_ = os.path.normpath(dir_)
+ for key in self.__data.keys():
+ if dir_.lower() == self.__data[key]['path'].lower():
+ return key
+ raise ComponentNotFound("Could not find component name for dir %s" % dir_)
+
+ def __str__(self):
+ return "<%s: %s>" % (type(self), self.__data)
+
+
+class BldInfWorker(Thread):
+ """ SBS component worker. """
+ def __init__(self, inqueue, outqueue, datasource, whatlog, cl, link_info):
+ Thread.__init__(self)
+ self.logger = logging.getLogger(self.__class__.__name__)
+ self.inqueue = inqueue
+ self.outqueue = outqueue
+ self.whatlog = whatlog
+ self.cl = cl
+ self.link_info = link_info
+ self.datasource = datasource
+
+ def run(self):
+ """ Thread implementation. """
+ while True:
+ tag, bldinf = self.inqueue.get()
+ if tag == 'STOP':
+ self.logger.debug("Builder thread exiting..." )
+ return
+ else:
+ try:
+ tick = time.time()
+ self.outqueue.put(self.datasource.getBuildData(bldinf, self.whatlog, self.cl, self.link_info))
+ tock = time.time()
+ self.logger.info("Analyzed component %s in %s seconds" % (bldinf, tock - tick))
+ except IOError, exc:
+ self.logger.error('Error happened in thread execution %s' % exc)
+ import traceback
+ self.logger.debug(traceback.format_exc())
+
+
+class SBSDataSource(DataSource):
+ """ That class implements the DataSource API"""
+
+ def __init__(self, epocroot, data=None):
+ DataSource.__init__(self, epocroot, data)
+ self.logger = logging.getLogger(self.__class__.__name__)
+
+ def _get_sysdef_info(self):
+ """ Returns a SysdefComponentList containing the result of sysdef parsing. """
+ self.logger.debug("Reading the component information from the sysdef (%s)." % self._data['sysdef'])
+ p = xml.sax.make_parser()
+ cl = SysdefComponentList(self.epocroot)
+ p.setContentHandler(cl)
+ p.parse(open(self._data['sysdef']))
+ return cl
+
+ def _get_whatlog(self):
+ self.logger.debug("Extracting whatlog data (%s)..." % self._data['sbslog'])
+ parser = xml.sax.make_parser()
+ lr = LogReader()
+ parser.setContentHandler(lr)
+ file_ = open(self._data['sbslog'])
+ while True:
+ data = file_.read()
+ if not data:
+ break
+ parser.feed(data)
+ file_.close()
+ parser.close()
+ return lr
+
+ def _generate_link_info(self, output=None):
+ """ Generate the link.info file from the build log. It returns the generated xml filename. """
+ self.logger.info("Generating the link information from the %s log." % self._data['sbslog'])
+ parser = xml.sax.make_parser()
+ reader = LinkInfoReader(self.epocroot)
+ parser.setContentHandler(reader)
+ parser.parse(open(self._data['sbslog'], 'r'))
+ if output is None:
+ output = self._data['sbslog'] + ".link.xml"
+ self.logger.info("Writing %s." % output)
+ out = open(output, 'wb')
+ reader.writeXml(out=out)
+ out.close()
+ return output
+
+ def getComponents(self):
+ if 'sbslog' not in self._data:
+ raise MissingProperty("The sbslog property has not be defined.")
+ if 'sysdef' not in self._data:
+ raise MissingProperty("The sysdef property has not be defined.")
+
+ # generating link info
+ link_info = LinkInfoXmlReader.getBuildData(self._generate_link_info())
+
+ # Read the component list
+ cl = self._get_sysdef_info()
+
+ # Get the whatlog
+ whatlog = self._get_whatlog()
+
+ result = []
+ if 'threads' in self._data and self._data['threads'].isdigit():
+ inqueue = Queue()
+ outqueue = Queue()
+ workers = []
+ # Work to be done
+
+ for bldinf in whatlog.getInfs():
+ inqueue.put(('', bldinf))
+ # Creating the builders
+ for i in range(int(self._data['threads'])):
+ b = BldInfWorker(inqueue, outqueue, self, \
+ whatlog, cl, link_info)
+ workers.append(b)
+ b.start()
+ # Waiting the work to finish.
+ for w in workers:
+ inqueue.put(('STOP', None))
+ for w in workers:
+ w.join()
+ self.logger.info("All done.")
+ while not outqueue.empty():
+ result.append(outqueue.get())
+ else:
+ for bldinf in whatlog.getInfs():
+ result.append(self.getBuildData(bldinf, whatlog, cl, link_info))
+ return result
+
+ def getBuildData(self, bldinf, whatlog, cl, link_info):
+ """ Get the build data from a bldinf name. """
+ tick = time.time()
+ src_walk_path = ""
+ abs_bldinf = os.path.abspath(bldinf)
+ self.logger.debug("component location: %s" % abs_bldinf)
+ component_name = cl.get_component_name_by_path(os.path.normpath(os.path.dirname(abs_bldinf)))
+ build_data = PlainBuildData()
+ self.logger.debug("component name: %s" % cl[component_name]['name'])
+ build_data.setComponentName(cl[component_name]['name'])
+ self.logger.debug("component version: %s" % cl[component_name]['version'])
+ build_data.setComponentVersion(cl[component_name]['version']) # need to get it from a the sysdef file
+ build_data.setSourceRoot(self.epocroot)
+ build_data.setTargetRoot(self.epocroot)
+
+ targets = [path[len(self.epocroot):].lstrip(os.sep) for path in whatlog.getFilePaths(abs_bldinf)]
+ build_data.addTargetFiles(targets)
+
+ # If path contains group folder then parent to parent is required else parent folder is enough
+ if os.path.dirname(abs_bldinf).endswith("group"):
+ src_walk_path = os.path.dirname(os.path.dirname(abs_bldinf))
+ else:
+ src_walk_path = os.path.dirname(abs_bldinf)
+
+ sources = []
+ for (path, dirpath, namelist) in os.walk(src_walk_path):
+ for name in namelist:
+ sources.append(os.path.join(path, name)[len(self.epocroot):].lstrip(os.sep))
+ build_data.addSourceFiles(sources)
+ tock = time.time()
+ self.logger.info(" + Content analysis %s in %s seconds" % (bldinf, tock - tick))
+
+ tick = time.time()
+ key_bldinf = abs_bldinf.replace(os.sep, '/')
+ if link_info.has_key(key_bldinf):
+ self.logger.debug("Found deps for %s" % key_bldinf)
+ for bdfile in link_info[key_bldinf].getDependencies():
+ if bdfile.getPath() in build_data.getTargetFiles():
+ # no dependency data above, only paths - OK to overwrite
+ build_data.addDeliverable(bdfile)
+ else:
+ self.logger.warning("Link data from %s has unlisted target %s" % (abs_bldinf, bdfile.getPath()))
+ tock = time.time()
+ self.logger.info(" + Dependency analysis for %s in %s seconds" % (bldinf, tock - tick))
+ return build_data
+
+ def getHelp(self):
+ help_ = """The sbs datasource will extract component information from the sbs logs. You need a recent version of raptor: e.g 2.8.4.
+Plugin property configuration:
+sbslog Location of the sbs log.
+sysdef Location of the canonical system definition file.
+ """
+ return help_
+
+DATASOURCES['sbs'] = SBSDataSource
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/lib/packager/io.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/lib/packager/io.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,143 @@
+#============================================================================
+#Name : io.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+import xml.dom.minidom
+import logging
+from Blocks.Packaging.BuildData import BdFile, PlainBuildData
+logger = logging.getLogger('io')
+
+class BdFileSerializer:
+ """ Class used to serialize or deserialize the DBFile """
+ def __init__(self, bdfile=None):
+ self.bdfile = bdfile
+
+ def toXml(self):
+ logger.debug("Serializing DBFile.")
+ document = xml.dom.minidom.Document()
+ component = document.createElement('bdfile')
+ component.setAttribute('path', self.bdfile.getPath())
+ if self.bdfile.variantType is not None:
+ component.setAttribute('variantType', self.bdfile.variantType)
+ if self.bdfile.variantPlatform is not None:
+ component.setAttribute('variantPlatform', self.bdfile.variantPlatform)
+ # Owner reqs
+ ownerReqs = document.createElement('ownerRequirements')
+ for path in self.bdfile.ownerRequirements:
+ req = document.createElement("ownerRequirement")
+ req.setAttribute('path', path)
+ ownerReqs.appendChild(req)
+ component.appendChild(ownerReqs)
+ # source Requirements
+ srcReqs = document.createElement('sourceRequirements')
+ for path in self.bdfile.sourceRequirements:
+ req = document.createElement("sourceRequirement")
+ req.setAttribute('path', path)
+ srcReqs.appendChild(req)
+ component.appendChild(srcReqs)
+ return component.toxml()
+
+ def fromXml(self, data):
+ logger.debug("Deserializing DBFile.")
+ node = xml.dom.minidom.parseString(data).childNodes[0]
+ if self.bdfile == None:
+ self.bdfile = BdFile(node.getAttribute('path'))
+
+ self.bdfile.path = node.getAttribute('path')
+ self.bdfile.variantPlatform = node.getAttribute('variantPlatform')
+ self.bdfile.variantType = node.getAttribute('variantType')
+ for src in node.getElementsByTagName('ownerRequirements')[0].getElementsByTagName('ownerRequirement'):
+ self.bdfile.ownerRequirements.append(src.getAttribute('path'))
+ for src in node.getElementsByTagName('sourceRequirements')[0].getElementsByTagName('sourceRequirement'):
+ self.bdfile.sourceRequirements.append(src.getAttribute('path'))
+ return self.bdfile
+
+class BuildDataSerializer:
+ """ Class used to serialize or deserialize the plain build data """
+ def __init__(self, builddata=None):
+ self.builddata = builddata
+ if self.builddata is None:
+ self.builddata = PlainBuildData()
+
+ def toXml(self):
+ logger.debug("Serializing PlainBuildData.")
+ document = xml.dom.minidom.Document()
+ component = document.createElement('component')
+ component.setAttribute('name', self.builddata.getComponentName())
+ component.setAttribute('version', self.builddata.getComponentVersion())
+ # sources
+ sources = document.createElement('sources')
+ sources.setAttribute('root', self.builddata.getSourceRoot())
+ for path in self.builddata.getSourceFiles():
+ source = document.createElement("source")
+ source.setAttribute('path', path)
+ sources.appendChild(source)
+ component.appendChild(sources)
+ # targets
+ targets = document.createElement('targets')
+ targets.setAttribute('root', self.builddata.getTargetRoot())
+ for path in self.builddata.targetFiles.keys():
+ target = document.createElement("target")
+ target.setAttribute('path', path)
+ if self.builddata.targetFiles[path] is not None:
+ target.appendChild(document.importNode(xml.dom.minidom.parseString(BdFileSerializer(self.builddata.targetFiles[path]).toXml()).childNodes[0], deep=1))
+ targets.appendChild(target)
+ component.appendChild(targets)
+ return component.toxml()
+
+ def fromXml(self, data):
+ logger.debug("Deserializing PlainBuildData.")
+ node = xml.dom.minidom.parseString(data).childNodes[0]
+ self.builddata.setComponentName(node.getAttribute('name'))
+ self.builddata.setComponentVersion(node.getAttribute('version'))
+ self.builddata.setSourceRoot(node.getElementsByTagName('sources')[0].getAttribute('root'))
+ self.builddata.setTargetRoot(node.getElementsByTagName('targets')[0].getAttribute('root'))
+ files = []
+ for src in node.getElementsByTagName('sources')[0].getElementsByTagName('source'):
+ files.append(src.getAttribute('path'))
+ self.builddata.addSourceFiles(files)
+
+ files = []
+ for target in node.getElementsByTagName('targets')[0].getElementsByTagName('target'):
+ files.append(target.getAttribute('path'))
+ self.builddata.addTargetFiles(files)
+ for target in node.getElementsByTagName('targets')[0].getElementsByTagName('target'):
+ for bdfile in target.getElementsByTagName('bdfile'):
+ self.builddata.addDeliverable(BdFileSerializer().fromXml(bdfile.toxml()))
+ return self.builddata
+
+
+class BuildDataMerger:
+ """ Class used to merge contents of build data """
+ def __init__(self, output):
+ self.output = output
+
+ def merge(self, bd):
+ """ Merge the content of bd into output. """
+ if bd.getComponentName() != self.output.getComponentName():
+ raise Exception("Trying to merger two different components (different name)")
+ if bd.getComponentVersion() != self.output.getComponentVersion():
+ raise Exception("Trying to merger two different components (different version)")
+ if bd.getSourceRoot() != self.output.getSourceRoot():
+ raise Exception("Trying to merger two different components (different source root)")
+ if bd.getTargetRoot() != self.output.getTargetRoot():
+ raise Exception("Trying to merger two different components (different target root)")
+ self.output.addSourceFiles(bd.getSourceFiles())
+ self.output.addTargetFiles(bd.getTargetFiles())
+ for dep in bd.getDependencies():
+ self.output.addDeliverable(dep)
+ return self.output
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/setup.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/setup.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,37 @@
+#============================================================================
+#Name : .py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+import os
+from setuptools import setup, find_packages
+pyfiles = []
+for x in os.listdir('lib'):
+ if x.endswith('.py'):
+ pyfiles.append(x.replace('.py', ''))
+
+setup(
+ name = 'blockspackager',
+ version = '0.1',
+ description = "blockspackager",
+ license = 'EPL',
+ package_dir = {'': 'lib'},
+ py_modules = pyfiles,
+ packages = find_packages('lib', exclude=["*tests"]),
+ test_suite = 'nose.collector',
+ package_data = {'': ['*.xml', '*.conf', '*.xsd', '*.nsi']},
+ zip_safe = False,
+ )
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/blockspackager/tests.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/blockspackager/tests.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,28 @@
+
+
+
+ Helium unittests.
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/ivy.xml
--- a/buildframework/helium/sf/python/pythoncore/ivy.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/ivy.xml Sun Oct 10 15:22:15 2010 +0300
@@ -39,5 +39,6 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/amara.py
--- a/buildframework/helium/sf/python/pythoncore/lib/amara.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/amara.py Sun Oct 10 15:22:15 2010 +0300
@@ -105,24 +105,26 @@
def __setitem__(self, key, value):
self.xml_set_attribute(key, value)
- def __getattr__(self, attr):
+ def __getattr__(self, attr):
+ if attr == 'xml_child_elements':
+ return self._getxml_child_elements()
if isinstance(attr, basestring):
res = self.dom.getElementsByTagName(attr)
if len(res) == 0:
if hasattr(self.dom, 'documentElement'):
val = self.dom.documentElement.getAttribute(attr)
if not self.dom.documentElement.hasAttribute(attr):
- raise Exception(attr + ' not found')
+ raise AttributeError(attr + ' not found')
else:
val = self.dom.getAttribute(attr)
if not self.dom.hasAttribute(attr):
- raise Exception(attr + ' not found')
+ raise AttributeError(attr + ' not found')
return val
return MinidomAmara(res[0], self.dom)
if self.parent:
return MinidomAmara(self.parent.getElementsByTagName(self.dom.tagName)[attr])
else:
- raise Exception(str(attr) + ' not found')
+ raise AttributeError(str(attr) + ' not found')
def __setattr__(self, name, value):
if isinstance(value, basestring):
@@ -134,13 +136,20 @@
for entry in self.parent.getElementsByTagName(self.dom.tagName):
yield MinidomAmara(entry)
- def __str__(self):
+ def _get_text(self, node):
+ """ Recursive method to collate sub-node strings. """
text = ''
- for t_text in self.dom.childNodes:
- if t_text.nodeType == t_text.TEXT_NODE and t_text.data != None:
- text = text + t_text.data
- return text
+ for child in node.childNodes:
+ if child.nodeType == child.TEXT_NODE and child.data != None:
+ text = text + ' ' + child.data
+ else:
+ text += self._get_text(child)
+ return text.strip()
+ def __str__(self):
+ """ Output a string representing the XML node. """
+ return self._get_text(self.dom)
+
def xml(self, out=None, indent=False, omitXmlDeclaration=False, encoding='utf-8'):
"""xml"""
if omitXmlDeclaration:
@@ -169,6 +178,14 @@
if elem.nodeType == elem.ELEMENT_NODE:
l_attrib.append(MinidomAmara(elem))
return l_attrib
+
+ def _getxml_child_elements(self):
+ """get xml children"""
+ l_attrib = {}
+ for elem in self.dom.childNodes:
+ if elem.nodeType == elem.ELEMENT_NODE:
+ l_attrib[elem.tagName] = MinidomAmara(elem)
+ return l_attrib
def _getxml_attributes(self):
"""get aml attributes"""
@@ -209,6 +226,7 @@
childNodes = property(_getxml_children)
xml_children = property(_getxml_children)
xml_attributes = property(_getxml_attributes)
+ xml_child_elements = property(_getxml_child_elements)
def __eq__(self, obj):
return str(self) == obj
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/archive/mappers.py
--- a/buildframework/helium/sf/python/pythoncore/lib/archive/mappers.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/archive/mappers.py Sun Oct 10 15:22:15 2010 +0300
@@ -51,21 +51,25 @@
self._metadata = None
if not os.path.exists(self._config['archives.dir']):
os.makedirs(self._config['archives.dir'])
- if self._config.has_key("grace.metadata") and self._config.get_boolean("grace.metadata", False):
- if self._config.has_key("grace.template") and os.path.exists(self._config["grace.template"]) and \
+
+ if self._config.has_key("grace.metadata"):
+ raise Exception('grace.metadata not supported, see documentation for correct configuration')
+
+ if self._config.has_key("release.metadata") and self._config.get_boolean("release.metadata", False):
+ if self._config.has_key("release.template") and os.path.exists(self._config["release.template"]) and \
not os.path.exists(os.path.join(self._config['archives.dir'], self._config['name'] + ".metadata.xml")):
- shutil.copy(config["grace.template"], os.path.join(self._config['archives.dir'], self._config['name'] + ".metadata.xml"))
+ shutil.copy(config["release.template"], os.path.join(self._config['archives.dir'], self._config['name'] + ".metadata.xml"))
self._metadata = symrec.ReleaseMetadata(os.path.join(self._config['archives.dir'], self._config['name']+ ".metadata.xml"),
- service=self._config['grace.service'],
- product=self._config['grace.product'],
- release=self._config['grace.release'])
+ service=self._config['release.service'],
+ product=self._config['release.product'],
+ release=self._config['release.name'])
self._metadata.save()
def declare_package(self, filename, extract="single"):
""" Add a package to the metadata file. """
if self._metadata is None:
return
- self._metadata.add_package(os.path.basename(filename), extract=extract, filters=self._config.get_list('grace.filters', None), default=self._config.get_boolean('grace.default', True))
+ self._metadata.add_package(os.path.basename(filename), extract=extract, filters=self._config.get_list('release.filters', None), default=self._config.get_boolean('release.default', True))
self._metadata.save()
def create_commands(self, manifest):
@@ -99,12 +103,12 @@
if len(manifests) == 1:
filename = os.path.join(self._config['archives.dir'], self._config['name'])
_logger.info(" * " + filename + self._tool.extension())
- self.declare_package(filename + self._tool.extension(), self._config.get('grace.extract', 'single'))
+ self.declare_package(filename + self._tool.extension(), self._config.get('release.extract', 'single'))
result.extend(self._tool.create_command(self._config.get('zip.root.dir', self._config['root.dir']), filename, manifests=[manifest]))
return [result]
- def _split_manifest_file(self, name, manifest_file_path):
+ def _split_manifest_file(self, name, manifest_file_path, key=None):
""" This method return a list of files that contain the content of the zip parts to create. """
filenames = []
@@ -137,7 +141,10 @@
files = 0
part += 1
- filename = "%s_part%02d" % (name, part)
+ if key is not None:
+ filename = "%s_part%02d_%s" % (name, part, key)
+ else:
+ filename = "%s_part%02d" % (name, part)
filenames.append(os.path.join(self._config['temp.build.dir'], filename + ".txt"))
output = codecs.open(os.path.join(self._config['temp.build.dir'], filename + ".txt"), 'w', "utf-8" )
@@ -156,7 +163,10 @@
files = 0
part += 1
- filename = "%s_part%02d" % (name, part)
+ if key is not None:
+ filename = "%s_part%02d_%s" % (name, part, key)
+ else:
+ filename = "%s_part%02d" % (name, part)
filenames.append(os.path.join(self._config['temp.build.dir'], filename + ".txt"))
output = open(os.path.abspath(os.path.join(self._config['temp.build.dir'], filename + ".txt")), 'w')
@@ -178,7 +188,7 @@
return filenames
-class PolicyMapper(Mapper):
+class PolicyMapper(DefaultMapper):
""" Implements a policy content mapper.
It transforms a list of files into a list of commands with their inputs.
@@ -188,7 +198,7 @@
def __init__(self, config, archiver):
""" Initialization. """
- Mapper.__init__(self, config, archiver)
+ DefaultMapper.__init__(self, config, archiver)
self._policies = {}
self._policy_cache = {}
self._binary = {}
@@ -233,11 +243,22 @@
# Generating sublists.
for key in self._policies.keys():
+ manifests = []
self._policies[key].close()
manifest = os.path.join(self._config['temp.build.dir'], self._config['name'] + "_%s" % key + ".txt")
- filename = os.path.join(self._config['archives.dir'], self._config['name'] + "_%s" % key)
- _logger.info(" * " + filename + self._tool.extension())
- result.extend(self._tool.create_command(self._config.get('zip.root.dir', self._config['root.dir']), filename, manifests=[manifest]))
+ _logger.info(" * Input manifest: " + manifest)
+ if self._config.has_key("split.on.uncompressed.size.enabled") and self._config.get_boolean("split.on.uncompressed.size.enabled", "false"):
+ manifests = self._split_manifest_file(self._config['name'], manifest, key)
+ else:
+ manifests.append(manifest)
+ for manifest in manifests:
+ _logger.info(" * Creating command for manifest: " + manifest)
+ filename = os.path.join(self._config['archives.dir'], os.path.splitext(os.path.basename(manifest))[0])
+ if len(manifests) == 1:
+ filename = os.path.join(self._config['archives.dir'], self._config['name'] + "_%s" % key)
+ _logger.info(" * " + filename + self._tool.extension())
+ self.declare_package(filename + self._tool.extension(), self._config.get('release.extract', 'single'))
+ result.extend(self._tool.create_command(self._config.get('zip.root.dir', self._config['root.dir']), filename, manifests=[manifest]))
stages.append(result)
# See if any internal archives need to be created
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/archive/scanners.py
--- a/buildframework/helium/sf/python/pythoncore/lib/archive/scanners.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/archive/scanners.py Sun Oct 10 15:22:15 2010 +0300
@@ -48,11 +48,10 @@
[self.add_exclude_lst(filename) for filename in self._config.get_list('exclude.lst', [])]
[self.add_filetype(filetype) for filetype in self._config.get_list('filetype', [])]
[self.add_selector(archive.selectors.get_selector(selector, self._config)) for selector in self._config.get_list('selector', [])]
- # To support old features.
- # TODO: inform customers and remove.
+
if 'distribution.policy.s60' in self._config:
self.add_selector(archive.selectors.get_selector('distribution.policy.s60', self._config))
-
+
def add_exclude_lst(self, filename):
""" Adding excludes from exclude list. """
if not os.path.exists(filename):
@@ -76,7 +75,7 @@
This method need to be overloaded by the specialized class.
return fullpath name
"""
- raise NotImplementedError()
+ raise NotImplementedError()
class AbldWhatScanner(Scanner):
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/__init__.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/__init__.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/__init__.py Sun Oct 10 15:22:15 2010 +0300
@@ -54,7 +54,11 @@
# Customize some attributes from how optparse leaves them.
if hasattr(self._opts, 'build_drive'):
self.build_drive = path(self._opts.build_drive)
- self.file_store = path(self._opts.file_store)
+ if os.path.exists(self._opts.file_store):
+ self.file_store = path(self._opts.file_store)
+ else:
+ self.file_store = ''
+ _logger.info(self._opts.file_store + ' not found')
self.flash_images = split_paths(self._opts.flash_images)
if hasattr(self._opts, 'sis_files'):
self.sis_files = split_paths(self._opts.sis_files)
@@ -62,6 +66,8 @@
self.config_file = self._opts.config
if hasattr(self._opts, 'obey_pkgfiles'):
self.obey_pkgfiles = to_bool(self._opts.obey_pkgfiles)
+ if hasattr(self._opts, 'minimum_execution_blocks'):
+ self.minimum_execution_blocks = (self._opts.minimum_execution_blocks == 'true')
if hasattr(self._opts, 'hti'):
self.hti = to_bool(self._opts.hti)
if hasattr(self._opts, 'test_type'):
@@ -91,7 +97,7 @@
for t_key, t_value in temp_dict.items():
self.tsrc_paths_dict[t_key] = t_value
else:
- _logger.error(tsrc + ' not found')
+ _logger.error(tsrc + ' - test source not found')
#preparing a list of main components
for main_component in self.tsrc_paths_dict.keys():
@@ -166,6 +172,9 @@
self.ctc_enabled = 'False'
if hasattr(config, 'ctc_enabled'):
self.ctc_enabled = to_bool(config.ctc_enabled)
+ self.ats_stf_enabled = 'False'
+ if hasattr(config, 'ats_stf_enabled'):
+ self.ats_stf_enabled = to_bool(config.ats_stf_enabled)
if hasattr(config, 'multiset_enabled'):
self.multiset_enabled = to_bool(config.multiset_enabled)
if hasattr(config, 'monsym_files'):
@@ -180,6 +189,9 @@
self.flash_images = config.flash_images
if hasattr(config, 'test_type'):
self.test_type = config.test_type
+ self.minimum_execution_blocks = False
+ if hasattr(config, 'minimum_execution_blocks'):
+ self.minimum_execution_blocks = config.minimum_execution_blocks
def insert_set(self, data_files=None, config_files=None,
engine_ini_file=None, image_files=None, sis_files=None,
@@ -230,12 +242,39 @@
if self.trace_enabled != "":
if self.trace_enabled.lower() == "true":
setd = dict(setd, pmd_files=pmd_files,
- trace_path=self.file_store.joinpath(self.REPORT_PATH, "traces", setd["name"], "tracelog.blx"),
+ trace_path=os.path.join(self.file_store, self.REPORT_PATH, "traces", setd["name"], "tracelog.blx"),
trace_activation_files=trace_activation_files)
else:
setd = dict(setd, pmd_files=[],
trace_path="",trace_activation_files=[])
- self.sets.append(setd)
+
+ if self.minimum_execution_blocks:
+ if self.sets == []:
+ self.sets = [setd]
+ else:
+ files = ['component_path',
+ 'trace_activation_files',
+ 'src_dst',
+ #'trace_path',
+ #'custom_dir',
+ 'pmd_files',
+ 'dll_files',
+ 'config_files',
+ 'data_files',
+ 'testmodule_files']
+
+ if self.sets[0]['test_harness'] == setd['test_harness'] and setd['engine_ini_file'] == None:
+ for param in files:
+ if setd[param]:
+ if type(setd[param]) == dict:
+ for key in setd[param].keys():
+ self.sets[0][param][key] = setd[param][key]
+ else:
+ self.sets[0][param] = self.sets[0][param] + setd[param]
+ else:
+ self.sets.append(setd)
+ else:
+ self.sets.append(setd)
def set_plan_harness(self):
"""setting up test harness for a plan"""
@@ -272,7 +311,7 @@
actions = []
temp_var = ""
include_ctc_runprocess = False
- report_path = self.file_store.joinpath(self.REPORT_PATH)
+ report_path = os.path.join(self.file_store, self.REPORT_PATH)
if self.ctc_enabled and adg.CTC_PATHS_LIST != [] and self.monsym_files != "" and not "${" in self.monsym_files:
include_ctc_runprocess = True
@@ -311,18 +350,18 @@
("send-files", "true"),
("to", self.report_email)))
ats3_report = ("FileStoreAction",
- (("to-folder", report_path.joinpath("ATS3_REPORT")),
+ (("to-folder", os.path.join(report_path, "ATS3_REPORT")),
("report-type", "ATS3_REPORT"),
("date-format", "yyyyMMdd"),
("time-format", "HHmmss")))
stif_report = ("FileStoreAction",
- (("to-folder", report_path.joinpath("STIF_REPORT")),
+ (("to-folder", os.path.join(report_path, "STIF_REPORT")),
("report-type", "STIF_COMPONENT_REPORT_ALL_CASES"),
("run-log", "true"),
("date-format", "yyyyMMdd"),
("time-format", "HHmmss")))
eunit_report = ("FileStoreAction",
- (("to-folder", report_path.joinpath("EUNIT_REPORT")),
+ (("to-folder", os.path.join(report_path, "EUNIT_REPORT")),
("report-type", "EUNIT_COMPONENT_REPORT_ALL_CASES"),
("run-log", "true"),
("date-format", "yyyyMMdd"),
@@ -405,7 +444,9 @@
tesplan_counter += 1
exe_flag = False
for srcanddst in plan_sets['src_dst']:
- _ext = srcanddst[0].rsplit(".")[1]
+ _ext = ''
+ if '.' in srcanddst[0]:
+ _ext = srcanddst[0].rsplit(".")[1]
#the list below are the files which are executable
#if none exists, set is not executable
for mat in ["dll", "ini", "cfg", "exe", "script"]:
@@ -488,9 +529,11 @@
default="")
cli.add_option("--specific-pkg", help="Text in name of pkg files to use", default='')
cli.add_option("--ats4-enabled", help="ATS4 enabled", default="False")
+ cli.add_option("--ats-stf-enabled", help="ATS STF enabled", default="False")
cli.add_option("--obey-pkgfiles", help="If this option is True, then only test components having PKG file are executable and if the compnents don't have PKG files they will be ignored.", default="False")
cli.add_option("--verbose", help="Increase output verbosity", action="store_true", default=False)
cli.add_option("--hti", help="HTI enabled", default="True")
+ cli.add_option("--minimum-execution-blocks", help="Create as few as possible execution blocks", default="false")
opts, tsrc_paths = cli.parse_args()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/aste_template.xml
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/aste_template.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/aste_template.xml Sun Oct 10 15:22:15 2010 +0300
@@ -139,7 +139,7 @@
InstallSisTask
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/ats4_template.xml
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/ats4_template.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/ats4_template.xml Sun Oct 10 15:22:15 2010 +0300
@@ -77,7 +77,7 @@
{%- endif %}
{% if setd["ctc_enabled"] == "True" -%}
- {{ macros.ctc_initialization() }}
+ {{ macros.ctc_initialization(test_plan) }}
{%- endif %}
@@ -168,7 +168,7 @@
InstallSisTask
-
+
@@ -272,7 +272,7 @@
{% if setd["ctc_enabled"] == "True" -%}
- {{ macros.ctc_finalization(setd) }}
+ {{ macros.ctc_finalization(test_plan) }}
{%- endif %}
@@ -311,7 +311,7 @@
EmailAction
-
+
{% if test_plan['report_type'].lower() == 'no_attachment' -%}
@@ -319,6 +319,15 @@
{%- endif %}
+ {% if test_plan['file_store'] -%}
+
+ FileStoreAction
+
+
+
+
+
+ {% endif %}
{% if test_plan['diamonds_build_url'] -%}
DiamondsAction
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/atsconfigparser.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/atsconfigparser.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/atsconfigparser.py Sun Oct 10 15:22:15 2010 +0300
@@ -51,8 +51,11 @@
p_temp.value = value
changed = True
if not changed:
- for device in self.doc.test.target.device:
- device.xml_append(self.doc.xml_create_element(u"setting", attributes = {u'name': unicode(name), u'value': unicode(value)}))
+ if hasattr(self.doc, 'test'):
+ for device in self.doc.test.target.device:
+ device.xml_append(self.doc.xml_create_element(u"setting", attributes = {u'name': unicode(name), u'value': unicode(value)}))
+ else:
+ raise Exception("You can't add a setting with ats4")
def containsattribute(self, name, value):
""" returns true or false """
@@ -74,9 +77,12 @@
p_temp.value = value
changed = True
if not changed:
- for device in self.doc.test.target.device:
- device.xml_append(self.doc.xml_create_element(u"property", attributes = {u'name': unicode(name), u'value': unicode(value)}))
-
+ if hasattr(self.doc, 'test'):
+ for device in self.doc.test.target.device:
+ device.xml_append(self.doc.xml_create_element(u"property", attributes = {u'name': unicode(name), u'value': unicode(value)}))
+ else:
+ for device in self.doc.testrun.agents.agent:
+ device.xml_append(self.doc.xml_create_element(u"property", attributes = {u'name': unicode(name), u'value': unicode(value)}))
class ATSConfigParser:
""" ATS configuration parser"""
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/bootup_testing.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/bootup_testing.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,361 @@
+# -*- encoding: latin-1 -*-
+
+#============================================================================
+#Name : bootup_testing.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+"""Bootup test drop generation."""
+
+#W0142 => * and ** were used
+#R* removed during refactoring
+
+from optparse import OptionParser
+from xml.etree import ElementTree as et
+import logging
+import os
+import re
+import tempfile
+import zipfile
+import pkg_resources # pylint: disable-msg=F0401
+from path import path # pylint: disable-msg=F0401
+import amara
+import ntpath as atspath
+import jinja2 # pylint: disable-msg=F0401
+import ats3.parsers as parser
+
+_logger = logging.getLogger('bootup-testing')
+
+# Shortcuts
+E = et.Element
+SE = et.SubElement
+
+class Configuration(object):
+ """
+ Bootup test drop generation configuration.
+ """
+
+ def __init__(self, opts):
+ """
+ Initialize from optparse configuration options.
+ """
+
+ self._opts = opts
+ # Customize some attributes from how optparse leaves them.
+ self.build_drive = path(self._opts.build_drive)
+ self.file_store = path(self._opts.file_store)
+ self.flash_images = self.split_paths(self._opts.flash_images)
+ self.template_loc = path(self._opts.template_loc)
+
+
+ def split_paths(self, arg, delim=","):
+ """
+ Split the string by delim, removing extra whitespace.
+ """
+ return [path(part.strip())
+ for part in arg.split(delim) if part.strip()]
+
+ def __getattr__(self, attr):
+ return getattr(self._opts, attr)
+
+ def __str__(self):
+ dump = "Configuration:\n"
+ seen = set()
+ for key, value in vars(self).items():
+ if not key.startswith("_"):
+ dump += "\t%s = %s\n" % (key, value)
+ seen.add(key)
+ for key, value in vars(self._opts).items():
+ if key not in seen:
+ dump += "\t%s = %s\n" % (key, value)
+ seen.add(key)
+ return dump
+
+
+class BootupTestPlan(object):
+ """
+ Tells ATS server that images have to be tested if they can start the device.
+ """
+
+ def __init__(self, config):
+ self.pkg_parser = parser.PkgFileParser()
+ self.file_store = config.file_store
+ self.build_drive = config.build_drive
+
+ def insert_execution_block(self, block_count=1, image_files=None):
+ """
+ Insert task and flash files into the execution block
+ """
+ if image_files is None:
+ image_files = []
+
+ exe_dict = dict(name="exe%d" % block_count, image_files=image_files)
+
+ return exe_dict
+
+
+ def __getitem__(self, key):
+ return self.__dict__[key]
+
+
+
+class BootupTestDropGenerator(object):
+ """
+ Generate test drop zip file for Bootup testing.
+
+ The main responsibility of this class is to create testdrop and
+ test.xml file.
+
+ """
+
+ def __init__(self):
+ self.drop_path_root = path("BootupDrop")
+ self.drop_path = None
+ self.defaults = {}
+
+ def generate(self, xml_dict, output_file, template_loc=None):
+ """Generate a test drop file."""
+ xml = self.generate_xml(xml_dict, template_loc)
+ return self.generate_drop(xml_dict, xml, output_file)
+
+ def generate_drop(self, xml_dict, xml, output_file):
+ """Generate test drop zip file."""
+
+ zfile = zipfile.ZipFile(output_file, "w", zipfile.ZIP_DEFLATED)
+ try:
+ for drop_file, src_file in self.drop_files(xml_dict):
+
+ _logger.info(" + Adding: %s" % src_file.strip())
+ try:
+ zfile.write(src_file.strip(), drop_file.encode('utf-8'))
+ except OSError, expr:
+ _logger.error(expr)
+ doc = amara.parse(et.tostring(xml.getroot()))
+ _logger.debug("XML output: %s" % doc.xml(indent=u"yes", encoding="ISO-8859-1"))
+ zfile.writestr("test.xml", doc.xml(indent="yes", encoding="ISO-8859-1"))
+ finally:
+ _logger.info("Testdrop for bootup testing created successfully!")
+ zfile.close()
+
+ def generate_xml(self, xml_dict, template_loc):
+ """ generate an XML file"""
+ template_loc = path(template_loc).normpath()
+ loader = jinja2.ChoiceLoader([jinja2.PackageLoader(__name__, 'templates')])
+ env = jinja2.Environment(loader=loader)
+ if template_loc is None or not ".xml" in template_loc.lower():
+ template = env.from_string(pkg_resources.resource_string(__name__, 'bootup_testing_template.xml'))# pylint: disable-msg=E1101
+ else:
+ template = env.from_string(open(template_loc).read())# pylint: disable-msg=E1101
+
+ xmltext = template.render(xml_dict=xml_dict, os=os, atspath=atspath, atsself=self).encode('ISO-8859-1')
+ #print xmltext
+ return et.ElementTree(et.XML(xmltext))
+
+
+ def drop_files(self, xml_dict):
+ """Yield a list of drop files."""
+
+ drop_set = set()
+ drop_files = []
+ #Adding test asset, there's an execution block for every test asset
+ for execution_block in xml_dict["execution_blocks"]:
+ drop_dir = path(execution_block["name"])
+ drop_files = execution_block["image_files"]
+ for file_path in drop_files:
+ if file_path != None:
+ #Adding image files to the top level,
+ drop_file = drop_dir.joinpath("images", file_path.name)
+
+ drop_file = drop_file.normpath()
+ if drop_file not in drop_set:
+ drop_set.add(drop_file)
+ yield (drop_file, file_path.normpath())
+
+
+class ComponentParser(object):
+ """
+ Add information to the XML dictionary
+ """
+ def __init__(self, config):
+ self.flash_images = [path(p) for p in config.flash_images]
+ self.build_drive = config.build_drive
+ self.diamonds_build_url = config.diamonds_build_url
+ self.testrun_name = config.testrun_name
+ self.alias_name = config.alias_name
+ self.device_type = config.device_type
+ self.report_email = config.report_email
+ self.email_format = config.email_format
+ self.email_subject = config.email_subject
+
+ self.xml_dict = {}
+
+
+ def insert_pre_data(self):
+ """
+ Creates a dictionary for the data before
+ the block starts.
+ """
+ self.xml_dict = dict(self.xml_dict, temp_directory=path(tempfile.mkdtemp()))
+ self.xml_dict = dict(self.xml_dict, diamonds_build_url=self.diamonds_build_url)
+ self.xml_dict = dict(self.xml_dict, testrun_name=self.testrun_name)
+ self.xml_dict = dict(self.xml_dict, alias_name=self.alias_name)
+ self.xml_dict = dict(self.xml_dict, device_type=self.device_type)
+
+ def create_execution_block(self, config):
+ """Parse flash images """
+ execution_block_list = []
+ test_plan = BootupTestPlan(config)
+ block_count = 1
+ self.flash_images = self.get_sorted_images(self.flash_images)
+ execution_block_list.append(test_plan.insert_execution_block(block_count, self.flash_images))
+
+
+ self.xml_dict = dict(self.xml_dict, execution_blocks=execution_block_list)
+
+ def insert_post_data(self):
+ """
+ Creates a dictionary for the data after
+ the block ends. Or, Postaction data
+ """
+ self.xml_dict = dict(self.xml_dict, report_email=self.report_email)
+ self.xml_dict = dict(self.xml_dict, email_format=self.email_format)
+ self.xml_dict = dict(self.xml_dict, email_subject=self.email_subject)
+
+ return self.xml_dict
+
+ def get_sorted_images(self, image_files):
+ """sort the images """
+ sorted_images = []
+ for image_file in image_files:
+ if 'core' in image_file.name:
+ sorted_images.append(image_file)
+ for image_file in image_files:
+ if 'rofs2' in image_file.name:
+ sorted_images.append(image_file)
+ for image_file in image_files:
+ if 'rofs3' in image_file.name:
+ sorted_images.append(image_file)
+ for image_file in image_files:
+ if 'udaerase' in image_file.name:
+ sorted_images.append(image_file)
+ for image_file in image_files:
+ if 'core' not in image_file.name and 'rofs2' not in image_file.name and 'rofs3' not in image_file.name and 'udaerase' not in image_file.name.lower():
+ sorted_images.append(image_file)
+ if len(sorted_images) > 0 and "rofs" in sorted_images[0]:
+ return image_files
+ return sorted_images
+
+def create_drop(config):
+ """Create a test drop."""
+ xml_dict = {}
+
+ _logger.debug("initialize configuration dictionary")
+ drop_parser = ComponentParser(config)
+
+ #Inserting data for test run and global through out the dictionary
+ drop_parser.insert_pre_data()
+
+ #for every asset path there should be a
+ #separate execution block
+ drop_parser.create_execution_block(config)
+
+ #Inserting reporting and email data (post actions)
+ xml_dict = drop_parser.insert_post_data()
+
+
+# print "-------------------------------------------------"
+# keys = xml_dict
+# for key in xml_dict.keys():
+# if key == "execution_blocks":
+# for exe in xml_dict[key]:
+# print key, "->"
+# print exe['name']
+# print exe['image_files']
+# for file1 in exe['image_files']:
+# print file1
+#
+# else:
+# print key, "->", xml_dict[key]
+#
+# print xml_dict['diamonds_build_url']
+# print xml_dict['testrun_name']
+# print xml_dict['email_format']
+# print xml_dict['email_subject']
+#
+# print "-------------------------------------------------"
+
+
+
+ generator = BootupTestDropGenerator()
+ _logger.info("generating drop file: %s" % config.drop_file)
+ generator.generate(xml_dict, output_file=config.drop_file, template_loc=config.template_loc)
+
+
+
+def to_bool(param):
+ """setting a true or false based on a param value"""
+ param = str(param).lower()
+ if "true" == param or "t" == param or "1" == param:
+ return "True"
+ else:
+ return "False"
+
+def main():
+ """Main entry point."""
+
+
+ cli = OptionParser(usage="%prog [options] PATH1 [PATH2 [PATH3 ...]]")
+ cli.add_option("--ats4-enabled", help="ATS4 enabled", default="True")
+ cli.add_option("--build-drive", help="Build area root drive")
+ cli.add_option("--drop-file", help="Name for the final drop zip file", default="ATSBootupDrop.zip")
+
+ cli.add_option("--minimum-flash-images", help="Minimum amount of flash images", default=2)
+ cli.add_option("--flash-images", help="Paths to the flash image files", default="")
+
+ cli.add_option("--template-loc", help="Custom template location", default="")
+
+ cli.add_option("--file-store", help="Destination path for reports.", default="")
+ cli.add_option("--report-email", help="Email notification receivers", default="")
+ cli.add_option("--testrun-name", help="Name of the test run", default="bootup_test")
+ cli.add_option("--alias-name", help="Name of the alias", default="alias")
+ cli.add_option("--device-type", help="Device type (e.g. 'PRODUCT')", default="unknown")
+ cli.add_option("--diamonds-build-url", help="Diamonds build url")
+ cli.add_option("--email-format", help="Format of an email", default="")
+ cli.add_option("--email-subject", help="Subject of an email", default="Bootup Testing")
+ cli.add_option("--verbose", help="Increase output verbosity", action="store_true", default=False)
+
+ opts, _ = cli.parse_args()
+
+ ats4_enabled = to_bool(opts.ats4_enabled)
+
+ if ats4_enabled == "False":
+ cli.error("Bootup test executes on ATS4. Set property 'ats4.enabled'")
+
+ if not opts.flash_images:
+ cli.error("no flash image files given")
+ if len(opts.flash_images.split(",")) < int(opts.minimum_flash_images):
+ cli.error("Not enough flash files: %i defined, %i needed" % (len(opts.flash_images.split(",")), int(opts.minimum_flash_images) ))
+
+ if opts.verbose:
+ _logger.setLevel(logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
+ _ = tempfile.mkdtemp()
+ config = Configuration(opts)
+ create_drop(config)
+
+if __name__ == "__main__":
+ main()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/bootup_testing_template.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/bootup_testing_template.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,92 @@
+
+
+
+
+
+ {% if xml_dict['diamonds_build_url'] -%}
+ {{ xml_dict['diamonds_build_url'] }}
+ Smoke
+ {% endif %}
+ {{ xml_dict['testrun_name'] }}
+
+
+
+
+
+
+
+
+
+ {% for exe_block in xml_dict['execution_blocks'] -%}
+
+
+
+ {% if exe_block['image_files'] -%}
+
+ FlashTask
+
+ {% set i = 1 %}
+ {% for img in exe_block['image_files'] -%}
+
+ {% set i = i + 1 %}
+ {% endfor -%}
+
+
+ {% endif %}
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+
+
+
+ CleanupTask
+
+
+
+
+
+
+ {% endfor -%}
+
+
+
+ EmailAction
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/dropgenerator.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/dropgenerator.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/dropgenerator.py Sun Oct 10 15:22:15 2010 +0300
@@ -440,7 +440,7 @@
if 'rofs3' in image_file.name:
sorted_images.append(image_file)
for image_file in setd["image_files"]:
- if 'core' not in image_file.name and 'rofs2' not in image_file.name and 'rofs3' not in image_file.name and 'udaerase' not in image_file.name.lower():
+ if 'core' not in image_file.name and 'rofs2' not in image_file.name and 'rofs3' not in image_file.name:
sorted_images.append(image_file)
if len(sorted_images) > 0 and "rofs" in sorted_images[0]:
return setd["image_files"]
@@ -1029,7 +1029,11 @@
template = env.from_string(pkg_resources.resource_string(__name__, 'ats4_template.xml'))# pylint: disable=E1101
xmltext = template.render(test_plan=test_plan, os=os, atspath=atspath, atsself=self).encode('ISO-8859-1')
- return et.ElementTree(et.XML(xmltext))
+ try:
+ xml = et.ElementTree(et.XML(xmltext))
+ except ExpatError, err:
+ raise ExpatError(str(err) + xmltext)
+ return xml
def get_template(self, directory, template_name):
if directory:
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/matti/MattiDrops.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/matti/MattiDrops.py Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,254 +0,0 @@
-# -*- encoding: latin-1 -*-
-
-#============================================================================
-#Name : MattiDrops.py
-#Part of : Helium
-
-#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-#All rights reserved.
-#This component and the accompanying materials are made available
-#under the terms of the License "Eclipse Public License v1.0"
-#which accompanies this distribution, and is available
-#at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-#Initial Contributors:
-#Nokia Corporation - initial contribution.
-#
-#Contributors:
-#
-#Description: Script for test drop generation and sending to execution to
-#ATS3-system
-#===============================================================================
-
-""" create the MATTI test drop file for use on the test server """
-# pylint: disable=R0902, R0903, R0912
-
-import os
-import re
-import sys
-import string
-import zipfile
-import logging
-from optparse import OptionParser
-from xml.etree import ElementTree as et
-from jinja2 import Environment, PackageLoader # pylint: disable=F0401
-
-# Shortcuts
-E = et.Element
-SE = et.SubElement
-
-_logger = logging.getLogger('matti')
-
-class Configuration(object):
- """
- ATS3 drop generation configuration.
- """
-
- def __init__(self, opts):
- """
- Initialize from optparse configuration options.
- """
- self._opts = opts
-
- # Customize some attributes from how optparse leaves them.
- self.build_drive = os.path.normpath(self._opts.build_drive)
- self.file_store = os.path.normpath(self._opts.file_store)
- self.matti_scripts = os.path.normpath(self._opts.matti_scripts)
- self.template_location = os.path.normpath(self._opts.template_loc)
- if self._opts.flash_images:
- self.flash_images = self._opts.flash_images.split(',')
- else:
- self.flash_images = []
- if not re.search(r'\A\s*?\Z', self._opts.sis_files):
- self.sis_files = self._opts.sis_files.split(',')
- else:
- self.sis_files = None
- self.step_list = []
- self.filelist = []
- self.image_list = []
- self.sis_list = []
- self.device_type = self._opts.device_type
- self.device_hwid = self._opts.device_hwid
- self.drop_file = self._opts.drop_file
- self.minimum_flash_images = self._opts.minimum_flash_images
- self.plan_name = self._opts.plan_name
- self.test_timeout = self._opts.test_timeout
- self.diamonds_build_url = self._opts.diamonds_build_url
- self.testrun_name = self._opts.testrun_name
- self.report_email = self._opts.report_email
- self.harness = self._opts.harness
- self.sis_enabled = False
- if self.sis_files:
- if len(self.sis_files) >= 1:
- self.sis_enabled = True
-
-
- def __getattr__(self, attr):
- return getattr(self._opts, attr)
-
- def __str__(self):
- dump = "Configuration:\n"
- seen = set()
- for key, value in vars(self).items():
- if not key.startswith("_"):
- dump += "\t%s = %s\n" % (key, value)
- seen.add(key)
- for key, value in vars(self._opts).items():
- if key not in seen:
- dump += "\t%s = %s\n" % (key, value)
- seen.add(key)
- return dump
-
-class MattiDrop(object):
- """
- ATS3 testdrop generation for MATTI tool
- """
-
- def __init__(self, config=None):
- self.configuration = config
- self.matti_cases = {}
- self.tmp_path = os.getcwd()
- self.files = []
- self.test_files = []
-
- def fetch_testfiles(self):
- """Needed flash files, sis-files and testscripts from given matti scripts -folder are added to file list."""
- tmp_case_list = []
-# tmp_image_list = []
- os.chdir(os.path.normpath(self.configuration.matti_scripts))
- try:
- for path, _, names in os.walk(os.getcwd()):
- for name in names:
- if re.search(r'.*?[.]rb\Z', name):
- tmp_case_list.append((os.path.normpath(os.path.join(path, name)), os.path.join("ats3", "matti", "script", name)))
- if tmp_case_list:
- for tmp_case in tmp_case_list:
- self.configuration.step_list.append(dict(path=os.path.join("§TEST_RUN_ROOT§", str(tmp_case[1])), name="Test case"))
- if self.configuration.flash_images:
- for image in self.configuration.flash_images:
- tmp = string.rsplit(image, os.sep)
- image_name = tmp[len(tmp)-1]
- self.configuration.image_list.append(os.path.join("ATS3Drop", "images", image_name))
- if self.configuration.sis_files:
- for sis in self.configuration.sis_files:
- tmp = string.rsplit(sis, os.sep)
- sis_name = tmp[len(tmp)-1]
- self.configuration.sis_list.append(dict(path=os.path.join("ATS3Drop", "sis", sis_name), dest=sis_name))
- except KeyError, error:
- _logger.error("Error in file reading / fetching!")
- sys.stderr.write(error)
- if tmp_case_list:
- for tmp_case in tmp_case_list:
- self.configuration.filelist.append(tmp_case[1])
- return tmp_case_list
- else:
- _logger.error("No test cases/files available!")
- return None
-
-
- def create_testxml(self):
- """This method will use Jinja2 template engine for test.xml creation"""
- os.chdir(self.tmp_path)
- env = Environment(loader=PackageLoader('ats3.matti', 'template'))
- if os.path.isfile(self.configuration.template_location):
- template = env.from_string(open(self.configuration.template_location).read())
- xml_file = open("test.xml", 'w')
- xml_file.write(template.render(configuration=self.configuration))
- xml_file.close()
- else:
- _logger.error("No template file found")
-
- def create_testdrop(self, output_file=None, file_list=None):
- """Creates testdrop zip-file to given location."""
- #env = Environment(loader=PackageLoader('MattiDrops', 'template'))
- os.chdir(self.tmp_path)
- if output_file and file_list:
- zfile = zipfile.ZipFile(output_file, "w", zipfile.ZIP_DEFLATED)
- try:
- _logger.info("Adding files to testdrop:")
- for src_file, drop_file in file_list:
- _logger.info(" + Adding: %s" % src_file.strip())
- if os.path.isfile(src_file):
- zfile.write(str(src_file.strip()), str(drop_file))
- else:
- _logger.error("invalid test file name supplied %s " % drop_file)
- if self.configuration.flash_images:
- for image in self.configuration.flash_images:
- tmp = string.rsplit(image, os.sep)
- image_name = tmp[len(tmp)-1]
- _logger.info(" + Adding: %s" % image_name)
- if os.path.isfile(image):
- zfile.write(image, os.path.join("ATS3Drop", "images", image_name))
- else:
- _logger.error("invalid flash file name supplied %s " % image_name)
- if self.configuration.sis_enabled:
- if self.configuration.sis_files:
- for sis in self.configuration.sis_files:
- tmp = string.rsplit(sis, os.sep)
- sis_name = tmp[len(tmp)-1]
- _logger.info(" + Adding: %s" % sis_name)
- if os.path.isfile(sis):
- zfile.write(sis, os.path.join("ATS3Drop", "sis", sis_name))
- else:
- _logger.error("invalid sis file name supplied %s " % sis_name)
- zfile.write(os.path.normpath(os.path.join(os.getcwd(),"test.xml")), "test.xml")
- finally:
- _logger.info("Testdrop created! %s" % output_file)
- zfile.close()
- return zfile
-
-def create_drop(configuration):
- """Testdrop creation"""
- if configuration:
- m_drop = MattiDrop(configuration)
- m_drop.fetch_testfiles()
- m_drop.create_testxml()
- return m_drop.create_testdrop(configuration.drop_file, m_drop.fetch_testfiles())
- else:
- _logger.error("No configuration available for test drop creation")
-
-def main():
- """Main entry point."""
- cli = OptionParser(usage="%prog [options] TSRC1 [TSRC2 [TSRC3 ...]]")
- cli.add_option("--build-drive", help="Build area root drive", default='X:')
- cli.add_option("--matti-scripts", help="Path to the directory where the MATTI test scripts are saved.", default="")
- cli.add_option("--flash-images", help="Flash image files as a list",
- default="")
- cli.add_option("--report-email", help="Email notification receivers",
- default="")
- cli.add_option("--harness", help="Test harness (default: %default)",
- default="unknown")
- cli.add_option("--file-store", help="Destination path for reports.",
- default="")
- cli.add_option("--testrun-name", help="Name of the test run",
- default="run")
- cli.add_option("--device-type", help="Device type (e.g. 'PRODUCT')",
- default="unknown")
- cli.add_option("--device-hwid", help="Device hwid",
- default="")
- cli.add_option("--diamonds-build-url", help="Diamonds build url")
- cli.add_option("--drop-file", help="Name for the final drop zip file",
- default="")
- cli.add_option("--minimum-flash-images", help="Minimum amount of flash images",
- default=2)
- cli.add_option("--plan-name", help="Name of the test plan",
- default="plan")
- cli.add_option("--sis-files", help="Sis files as a list",
- default="")
- cli.add_option("--template-loc", help="location of template file",
- default="..\template")
- cli.add_option("--test-timeout", help="Test execution timeout value (default: %default)",
- default="60")
- cli.add_option("--verbose", help="Increase output verbosity",
- action="store_true", default=True)
- opts, _ = cli.parse_args()
-
- if opts.verbose:
- _logger.setLevel(logging.DEBUG)
- logging.basicConfig(level=logging.DEBUG)
- config = Configuration(opts)
- create_drop(config)
-
-
-if __name__ == "__main__":
- main()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/matti/__init__.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/matti/__init__.py Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-# -*- coding: latin-1 -*-
-
-#============================================================================
-#Name : __init__.py
-#Part of : Helium
-
-#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-#All rights reserved.
-#This component and the accompanying materials are made available
-#under the terms of the License "Eclipse Public License v1.0"
-#which accompanies this distribution, and is available
-#at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-#Initial Contributors:
-#Nokia Corporation - initial contribution.
-#
-#Contributors:
-#
-#Description:
-#===============================================================================
-""" nothing needed here"""
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/matti/template/matti_demo.xml
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/matti/template/matti_demo.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,128 +0,0 @@
-
-
-{{ configuration.testrun_name }}
-
-
-
-
-
-
-
-
-
- {%- set i = 0 -%}
-
-
-
-
-
- {% if configuration.image_list -%}
- {% for flash in configuration.image_list -%}
-
- {% endfor -%}
- {% endif %}
-
- makedir
-
-
-
-
- {% if configuration.sis_list -%}
- {% for sis in configuration.sis_list -%}
-
- install
-
-
-
-
-
-
-
-
- install-software
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {% endfor -%}
- {% endif %}
- {% for step in configuration.step_list -%}
-
- execute
-
-
-
-
-
-
-
-
-
-
- {% endfor -%}
-
-
- {%- set i = i + 1 -%}
-
-
- {% if configuration.report_email %}
-
- SendEmailAction
-
-
-
-
-
-
-
- {% endif %}
- {% if configuration.filelist %}
-
- {% for img in configuration.image_list -%}
- {{ img }}
- {% endfor -%}
- {% for sis in configuration.sis_list -%}
- {{ sis['path'] }}
- {% endfor -%}
- {% for file in configuration.filelist -%}
- {{ file }}
- {% endfor -%}
-
- {% endif %}
-
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/matti2.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/matti2.py Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,446 +0,0 @@
-# -*- encoding: latin-1 -*-
-
-#============================================================================
-#Name : matti.py
-#Part of : Helium
-
-#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-#All rights reserved.
-#This component and the accompanying materials are made available
-#under the terms of the License "Eclipse Public License v1.0"
-#which accompanies this distribution, and is available
-#at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-#Initial Contributors:
-#Nokia Corporation - initial contribution.
-#
-#Contributors:
-#
-#Description:
-#===============================================================================
-
-"""MATTI test drop generation."""
-
-# pylint: disable=R0201,R0903,R0902,W0142
-#W0142 => * and ** were used
-#R* removed during refactoring
-
-from optparse import OptionParser
-from xml.etree import ElementTree as et
-import logging
-import os
-import re
-import tempfile
-import zipfile
-import pkg_resources # pylint: disable=F0401
-from path import path # pylint: disable=F0401
-import amara
-import ntpath as atspath
-import jinja2 # pylint: disable=F0401
-import ats3.parsers as parser
-
-_logger = logging.getLogger('matti')
-
-# Shortcuts
-E = et.Element
-SE = et.SubElement
-
-class Configuration(object):
- """
- MATTI drop generation configuration.
- """
-
- def __init__(self, opts):
- """
- Initialize from optparse configuration options.
- """
-
- self._opts = opts
- # Customize some attributes from how optparse leaves them.
- self.build_drive = path(self._opts.build_drive)
- self.file_store = path(self._opts.file_store)
- self.flash_images = self.split_paths(self._opts.flash_images)
- self.matti_sis_files = self.split_paths(self._opts.matti_sis_files)
- self.test_assets = self.split_paths(self._opts.testasset_location)
- self.template_loc = path(self._opts.template_loc)
-
-
- def split_paths(self, arg, delim=","):
- """
- Split the string by delim, removing extra whitespace.
- """
- return [path(part.strip())
- for part in arg.split(delim) if part.strip()]
-
- def __getattr__(self, attr):
- return getattr(self._opts, attr)
-
- def __str__(self):
- dump = "Configuration:\n"
- seen = set()
- for key, value in vars(self).items():
- if not key.startswith("_"):
- dump += "\t%s = %s\n" % (key, value)
- seen.add(key)
- for key, value in vars(self._opts).items():
- if key not in seen:
- dump += "\t%s = %s\n" % (key, value)
- seen.add(key)
- return dump
-
-
-class MattiTestPlan(object):
- """
- Tells MATTI server what to test and how.
-
- The MATTI test plan from which the test.xml file can be written. The test
- plan requires TestAsset(s) to perform the tests
- """
-
- def __init__(self, config):
- self.pkg_parser = parser.PkgFileParser()
- self.file_store = config.file_store
- self.matti_timeout = config.matti_timeout
- self.test_profiles = config.test_profiles
- self.sierra_enabled = to_bool(config.sierra_enabled)
- self.sierra_parameters = config.sierra_parameters
- self.test_profiles = config.test_profiles.strip().split(",")
- self.build_drive = config.build_drive
- self.matti_sis_files = ""
- self.install_files = []
- self.matti_task_files = None
-
- def insert_execution_block(self, block_count=1, image_files=None, matti_sis_files=None, test_asset_path=None, matti_parameters=None):
- """
- Insert Matti tasks and test data files into execution block
- """
- self.matti_sis_files = matti_sis_files
- temp_sis_files = []
- if self.matti_sis_files != None:
- for sis_file in self.matti_sis_files:
- temp_sis_files.append(sis_file.split("#"))
-
- test_asset_path = test_asset_path
- if image_files is None:
- image_files = []
-
- exe_dict = dict(name="exe%d" % block_count, asset_path=test_asset_path, image_files=image_files, matti_sis_files=temp_sis_files)
- exe_dict = dict(exe_dict, test_timeout=self.matti_timeout)
- exe_dict = dict(exe_dict, matti_parameters=matti_parameters)
- exe_dict = dict(exe_dict, sierra_enabled=self.sierra_enabled.lower())
- exe_dict = dict(exe_dict, sierra_parameters=self.sierra_parameters)
-
-
- self.matti_task_files = self.create_matti_task_files_list(self.sierra_enabled, test_asset_path)
- exe_dict = dict(exe_dict, matti_task_files=self.matti_task_files)
-
- self.install_files = self.create_install_files_list(test_asset_path)
- exe_dict = dict(exe_dict, install_files=self.install_files)
- return exe_dict
-
- def create_matti_task_files_list(self, enabler=None, asset_path=None):
- """
- Creates list of files needed to include in MATTI execution tasks
- if sierra.enabled then
- profiles (.sip files) are included
- else
- all ruby (.rb) files are included
- """
-
- profiles = []
- rb_files = []
-
- #If sierra engine is enabled (set to True)
- if self.sierra_enabled.lower() == "true":
- profile_path = path(os.path.join(asset_path, "profile"))
- if os.path.exists(profile_path):
- for profile_name in self.test_profiles:
- item = list(profile_path.walkfiles("%s.sip"%profile_name.lower().strip()))
- if len(item) > 0:
- #profiles.append(os.path.join(profile_path, item[0]))
- profiles.append(asset_path.rsplit(os.sep, 1)[1] + "/" + "profile" + "/" + item[0].rsplit(os.sep, 1)[1])
- return profiles
- else: #If sierra engine is not enabled (set to False)
- if os.path.exists(asset_path):
- #returns list(asset_path.walkfiles("*.rb")):
- for item in list(asset_path.walkfiles("*.rb")):
- rb_files.append(asset_path.rsplit(os.sep, 1)[1] + "/" + item.rsplit(os.sep, 1)[1])
- # Sorting the result, so we ensure they are always in similar order.
- rb_files.sort()
- return rb_files
-
- def create_install_files_list(self, asset_path=None):
- """
- Collects all the .pkg files and extract data
- Creates a list of src, dst files.
- """
- pkg_files = []
- if os.path.exists(asset_path):
- pkg_files = list(asset_path.walkfiles("*.pkg"))
- return self.pkg_parser.get_data_files(pkg_files, self.build_drive)
- else:
- return None
-
- def __getitem__(self, key):
- return self.__dict__[key]
-
-
-
-class MattiTestDropGenerator(object):
- """
- Generate test drop zip file for Matti.
-
- Generates drop zip files file from Test Assets. The main
- responsibility of this class is to create testdrop and test.xml
- file and build a zip file for the MATTI drop.
-
- """
-
- def __init__(self):
- self.drop_path_root = path("MATTIDrop")
- self.drop_path = None
- self.defaults = {}
-
- def generate(self, xml_dict, output_file, template_loc=None):
- """Generate a test drop file."""
- xml = self.generate_xml(xml_dict, template_loc)
- return self.generate_drop(xml_dict, xml, output_file)
-
- def generate_drop(self, xml_dict, xml, output_file):
- """Generate test drop zip file."""
-
- zfile = zipfile.ZipFile(output_file, "w", zipfile.ZIP_DEFLATED)
- try:
- for drop_file, src_file in self.drop_files(xml_dict):
-
- _logger.info(" + Adding: %s" % src_file.strip())
- try:
- zfile.write(src_file.strip(), drop_file.encode('utf-8'))
- except OSError, expr:
- _logger.error(expr)
- doc = amara.parse(et.tostring(xml.getroot()))
- _logger.debug("XML output: %s" % doc.xml(indent=u"yes", encoding="ISO-8859-1"))
- zfile.writestr("test.xml", doc.xml(indent="yes", encoding="ISO-8859-1"))
- finally:
- _logger.info("Matti testdrop created successfully!")
- zfile.close()
-
- def generate_xml(self, xml_dict, template_loc):
- """ generate an XML file"""
- template_loc = path(template_loc).normpath()
- loader = jinja2.ChoiceLoader([jinja2.PackageLoader(__name__, 'templates')])
- env = jinja2.Environment(loader=loader)
- if template_loc is None or not ".xml" in template_loc.lower():
- template = env.from_string(pkg_resources.resource_string(__name__, 'matti_template.xml'))# pylint: disable=E1101
- else:
- template = env.from_string(open(template_loc).read())# pylint: disable=E1101
-
- xmltext = template.render(xml_dict=xml_dict, os=os, atspath=atspath, atsself=self).encode('ISO-8859-1')
- #print xmltext
- return et.ElementTree(et.XML(xmltext))
-
-
- def generate_testasset_zip(self, xml_dict, output_file=None):
- """Generate TestAsset.zip for the MATTI server"""
- filename = xml_dict["temp_directory"].joinpath(r"TestAsset.zip")
-
- if output_file != None:
- filename = output_file
-
- for exe_block in xml_dict["execution_blocks"]:
- testasset_location = path(exe_block["asset_path"])
-
- zfile = zipfile.ZipFile(filename, "w", zipfile.ZIP_DEFLATED)
- try:
- for file_ in list(testasset_location.walkfiles()):
- file_mod = file_.replace(testasset_location, "")
- zfile.write(file_, file_mod.encode('utf-8'))
- finally:
- zfile.close()
- return filename
-
- def drop_files(self, xml_dict):
- """Yield a list of drop files."""
-
- drop_set = set()
- drop_files = []
-
- #Adding test asset, there's an execution block for every test asset
- for execution_block in xml_dict["execution_blocks"]:
- testasset_location = path(execution_block["asset_path"])
- asset_files = list(testasset_location.walkfiles())
-
- drop_path = path(execution_block["name"])
-
- drop_files = ((drop_path.parent, "images", execution_block["image_files"]),
- (drop_path.parent, "sisfiles", execution_block["matti_sis_files"]),
- (drop_path.parent, "mattiparameters", execution_block["matti_parameters"]),
- (drop_path.parent, execution_block["name"], asset_files))
-
- for drop_dir, sub_dir, files in drop_files:
- for file_path in files:
- if file_path != None:
-
- #Adding image files to the top level,
- #Also adding mattiparameters.xml file
- if sub_dir.lower() == "images" or sub_dir.lower() == "mattiparameters":
- drop_file = drop_dir.joinpath(sub_dir, file_path.name)
-
- #Adding sisfiles, installation of matti sisfiles is a bit different
- #than normal sisfiles
- elif sub_dir.lower() == "sisfiles":
- drop_file = drop_dir.joinpath(sub_dir, path(file_path[0]).name)
- file_path = path(file_path[0])
-
- #Adding test asset files
- else:
- temp_file = file_path.rsplit(os.sep, 1)[0]
- replace_string = testasset_location.rsplit(os.sep, 1)[0]
- drop_file = drop_dir.joinpath(sub_dir + "\\" + temp_file.replace(replace_string, ""), file_path.name)
-
- drop_file = drop_file.normpath()
- if drop_file not in drop_set:
- drop_set.add(drop_file)
- yield (drop_file, file_path.normpath())
-
-
-class MattiComponentParser(object):
- """
- Add information to the XML dictionary
- """
- def __init__(self, config):
- self.flash_images = [path(p) for p in config.flash_images]
- self.matti_parameters = [path(config.matti_parameters).normpath()]
- self.matti_sis_files = config.matti_sis_files
- self.build_drive = config.build_drive
- self.test_timeout = config.matti_timeout
- self.diamonds_build_url = config.diamonds_build_url
- self.testrun_name = config.testrun_name
- self.alias_name = config.alias_name
- self.device_type = config.device_type
- self.report_email = config.report_email
- self.email_format = config.email_format
- self.email_subject = config.email_subject
-
- self.xml_dict = {}
-
-
- def insert_pre_data(self):
- """
- Creates a dictionary for the data before
- the block starts.
- """
- self.xml_dict = dict(self.xml_dict, temp_directory=path(tempfile.mkdtemp()))
- self.xml_dict = dict(self.xml_dict, diamonds_build_url=self.diamonds_build_url)
- self.xml_dict = dict(self.xml_dict, testrun_name=self.testrun_name)
- self.xml_dict = dict(self.xml_dict, alias_name=self.alias_name)
- self.xml_dict = dict(self.xml_dict, device_type=self.device_type)
-
- def create_execution_block(self, config):
- """Parse flash images and creates execution block for matti"""
- execution_block_list = []
- block_count = 0
- for test_asset in config.test_assets:
- if os.path.exists(test_asset):
- test_plan = MattiTestPlan(config)
- block_count += 1
- execution_block_list.append(test_plan.insert_execution_block(block_count, self.flash_images, self.matti_sis_files, test_asset, self.matti_parameters))
-
-
- self.xml_dict = dict(self.xml_dict, execution_blocks=execution_block_list)
-
- def insert_post_data(self):
- """
- Creates a dictionary for the data after
- the block ends. Or, Postaction data
- """
- self.xml_dict = dict(self.xml_dict, report_email=self.report_email)
- self.xml_dict = dict(self.xml_dict, email_format=self.email_format)
- self.xml_dict = dict(self.xml_dict, email_subject=self.email_subject)
-
- return self.xml_dict
-
-def create_drop(config):
- """Create a test drop."""
- xml_dict = {}
-
- _logger.debug("initialize Matti dictionary")
- drop_parser = MattiComponentParser(config)
-
- #Inserting data for test run and global through out the dictionary
- drop_parser.insert_pre_data()
-
- #for every asset path there should be a
- #separate execution block
- drop_parser.create_execution_block(config)
-
- #Inserting reporting and email data (post actions)
- xml_dict = drop_parser.insert_post_data()
-
- generator = MattiTestDropGenerator()
-
- _logger.info("generating drop file: %s" % config.drop_file)
- generator.generate(xml_dict, output_file=config.drop_file, template_loc=config.template_loc)
-
-def to_bool(param):
- """setting a true or false based on a param value"""
- param = str(param).lower()
- if "true" == param or "t" == param or "1" == param:
- return "True"
- else:
- return "False"
-
-def main():
- """Main entry point."""
-
-
- cli = OptionParser(usage="%prog [options] PATH1 [PATH2 [PATH3 ...]]")
- cli.add_option("--ats4-enabled", help="ATS4 enabled", default="True")
- cli.add_option("--build-drive", help="Build area root drive")
- cli.add_option("--drop-file", help="Name for the final drop zip file", default="MATTIDrop.zip")
-
- cli.add_option("--minimum-flash-images", help="Minimum amount of flash images", default=2)
- cli.add_option("--flash-images", help="Paths to the flash image files", default="")
- cli.add_option("--matti-sis-files", help="Sis files location", default="")
-
- cli.add_option("--testasset-location", help="MATTI test assets location", default="")
- cli.add_option("--template-loc", help="Custom template location", default="")
- cli.add_option("--sierra-enabled", help="Enabled or disabled Sierra", default=True)
- cli.add_option("--test-profiles", help="Test profiles e.g. bat, fute", default="")
- cli.add_option("--matti-parameters", help="Location of xml file contains additional parameters for Matti", default="")
-
- cli.add_option("--matti-timeout", help="Test execution timeout value (default: %default)", default="60")
- cli.add_option("--sierra-parameters", help="Additional sierra parameters for matti task", default="")
- cli.add_option("--file-store", help="Destination path for reports.", default="")
- cli.add_option("--report-email", help="Email notification receivers", default="")
- cli.add_option("--testrun-name", help="Name of the test run", default="run")
- cli.add_option("--alias-name", help="Name of the alias", default="sut_s60")
- cli.add_option("--device-type", help="Device type (e.g. 'PRODUCT')", default="unknown")
- cli.add_option("--diamonds-build-url", help="Diamonds build url")
- cli.add_option("--email-format", help="Format of an email", default="")
- cli.add_option("--email-subject", help="Subject of an email", default="Matti Testing")
-
-
- cli.add_option("--verbose", help="Increase output verbosity", action="store_true", default=False)
-
- opts, _ = cli.parse_args()
-
- ats4_enabled = to_bool(opts.ats4_enabled)
-
- if ats4_enabled == "False":
- cli.error("MATTI tests execute on ATS4. Set property 'ats4.enabled'")
-
- if not opts.flash_images:
- cli.error("no flash image files given")
- if len(opts.flash_images.split(",")) < int(opts.minimum_flash_images):
- cli.error("Not enough flash files: %i defined, %i needed" % (len(opts.flash_images.split(",")), int(opts.minimum_flash_images) ))
-
- if opts.verbose:
- _logger.setLevel(logging.DEBUG)
- logging.basicConfig(level=logging.DEBUG)
- _ = tempfile.mkdtemp()
- config = Configuration(opts)
- create_drop(config)
-
-if __name__ == "__main__":
- main()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/matti_template.xml
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/matti_template.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-
-
-
-
-
- {% if xml_dict['diamonds_build_url'] -%}
- {{ xml_dict['diamonds_build_url'] }}
- Smoke
- {% endif %}
- {{ xml_dict['testrun_name'] }}
-
-
-
-
-
-
-
-
-
- {% for exe_block in xml_dict['execution_blocks'] -%}
-
-
-
- {% if exe_block['image_files'] -%}
-
- FlashTask
-
- {% set i = 1 %}
- {% for img in exe_block['image_files'] -%}
-
- {% set i = i + 1 %}
- {% endfor -%}
-
-
- {% endif %}
-
-
- {% if exe_block['install_files'] != [] -%}
- {% for file in exe_block['install_files'] -%}
-
- FileUploadTask
-
-
-
-
-
- {% endfor -%}
- {% endif %}
-
- {% if exe_block['matti_sis_files'] != [] -%}
- {% for sisfile in exe_block['matti_sis_files'] -%}
-
- FileUploadTask
-
-
-
-
-
- {% endfor -%}
- {% endif %}
-
- {% for sis_file in exe_block["matti_sis_files"] -%}
-
- InstallSisTask
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {%- endfor -%}
-
-
- RebootTask
-
-
-
- CreateDirTask
-
-
-
-
-
-
- {% for task_file in exe_block["matti_task_files"] -%}
-
- MATTITask
-
-
-
-
-
-
-
-
- {% endfor -%}
-
-
-
- CleanupTask
-
-
-
-
-
-
- {% endfor -%}
-
-
-
- EmailAction
-
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/parsers.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/parsers.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/parsers.py Sun Oct 10 15:22:15 2010 +0300
@@ -222,7 +222,7 @@
_logger.debug(itm)
for itm in test_cases:
_logger.debug(itm)
- _logger.error(path_to_bld + ' test_sets are empty')
+ _logger.error(path_to_bld + ' - test sets are empty')
return test_sets
@@ -553,7 +553,7 @@
elif harness is "STIF":
dll_type = "executable"
- except:
+ except IOError:
traceback.print_exc()
else:
returnvals = None
@@ -596,7 +596,6 @@
self.drive = drive
self._files = []
self.pkg_files = []
- self.pkg_file_path = None
self.exclude = ""
self.location = None
self.bldpath = bldpath
@@ -638,7 +637,7 @@
return self.pkg_files
- def get_data_files(self, location = [], drive = "", exclude = ""):
+ def get_data_files(self, location=None, drive="", exclude=""):
"""
Returns data files, source and destination of the files to be installed
on the phone
@@ -656,7 +655,9 @@
if pkg file is not given, the function will try to find the file(s) on the given location with extension ".pkg"
"""
-
+ if location == None:
+ location = []
+
self.drive = drive
self.exclude = exclude
self._files = []
@@ -681,15 +682,13 @@
return self.read_pkg_file(self._files)
- def __map_pkg_path(self, pkg_line, pkg_file_path, pkg_file):
+ def __map_pkg_path(self, pkg_line, pkg_file_path, pkg_file, test_type, libraries):
"""Parse package file to get the src and dst paths" for installing files"""
- mmp_parser = MmpFileParser(self.bldpath)
ext = ""
val1 = ""
val2 = ""
map_src = ""
map_dst = ""
- self.pkg_file_path = pkg_file_path
if not self.exclude == "":
if re.search(r'%s' % self.exclude, pkg_line) is not None:
@@ -712,19 +711,20 @@
if "$(target)" in val1.lower() and self.build_target is not None:
val1 = val1.lower().replace("$(target)", self.build_target)
- #For MATTI PKG files in which location of the data files are unknown or can be changed
+ #For TDriver PKG files in which location of the data files are unknown or can be changed
if "[PKG_LOC]" in val1.upper():
- val1 = val1.replace("[PKG_LOC]", self.pkg_file_path)
+ val1 = val1.replace("[PKG_LOC]", pkg_file_path)
- if os.path.exists(val1):
- map_src = os.path.abspath(val1)
+ if os.path.isabs(os.path.normpath(val1)):
+ map_src = os.path.normpath(os.path.join(self.drive, val1))
+ elif re.search(r"\A\w", val1, 1):
+ map_src = os.path.normpath(os.path.join(pkg_file_path + os.sep, os.path.normpath(val1)))
else:
- if os.path.isabs(os.path.normpath(val1)):
- map_src = os.path.normpath(os.path.join(self.drive, val1))
- elif re.search(r"\A\w", val1, 1):
- map_src = os.path.normpath(os.path.join(self.pkg_file_path + os.sep, os.path.normpath(val1)))
- else:
- map_src = os.path.normpath(os.path.join(self.pkg_file_path, val1))
+ map_src = os.path.normpath(os.path.join(pkg_file_path, val1))
+
+ if os.sep == '\\':
+ if os.path.splitunc(val1)[0].strip() != "":
+ map_src = os.path.normpath(val1)
map_dst = os.path.normpath(val2)
else:
map_src, map_dst = val1, val2
@@ -739,14 +739,6 @@
ext = indx[1]
else:
_logger.warning("File extension not found for " + map_dst)
-
- _test_type_ = ""
- _target_filename_ = ""
-
- _target_filename_ = mmp_parser.get_target_filename(self.pkg_file_path)
- _test_type_ = mmp_parser.get_dll_type(self.pkg_file_path)
- _harness_ = mmp_parser.get_harness(self.pkg_file_path)
- _libraries_ = mmp_parser.get_libraries(self.pkg_file_path)
if ext == "ini":
file_type = "engine_ini"
@@ -754,24 +746,24 @@
file_type = "conf"
elif ext == "dll":
#adding type of dll (executable or dependent), if file type is dll
- if _test_type_ == "dependent":
- file_type = "data" + ":%s" % _test_type_
+ if test_type == "dependent":
+ file_type = "data" + ":%s" % test_type
else:
- if "qttest.lib" in _libraries_:
+ if "qttest.lib" in libraries:
file_type = "data" + ":qt:dependent"
else:
- if 'symbianunittestfw.lib' in _libraries_:
+ if 'symbianunittestfw.lib' in libraries:
file_type = "testmodule:sut"
else:
file_type = "testmodule"
- elif ext == 'exe' and 'rtest' in _libraries_:
+ elif ext == 'exe' and 'rtest' in libraries:
file_type = "testmodule:rtest"
elif ext == "exe":
- if _test_type_ == "dependent":
- file_type = "data" + ":%s" % _test_type_
+ if test_type == "dependent":
+ file_type = "data" + ":%s" % test_type
else:
- if "qttest.lib" in _libraries_:
+ if "qttest.lib" in libraries:
file_type = "testmodule:qt"
else:
file_type = "testmodule"
@@ -783,7 +775,7 @@
elif ext == "pmd":
file_type = "pmd"
elif ext == "script":
- if "testframeworkclient.lib" in _libraries_:
+ if "testframeworkclient.lib" in libraries:
file_type = "testscript:mtf:testframework.exe"
else:
file_type = "testscript:testexecute.exe"
@@ -796,7 +788,7 @@
elif exename == 'testexecute.exe':
file_type = "testscript:" + exename
else:
- if "testframeworkclient.lib" in _libraries_:
+ if "testframeworkclient.lib" in libraries:
file_type = "testscript:mtf:" + exename
else:
file_type = "testscript:" + exename
@@ -817,8 +809,8 @@
pkg_files = [pkg_files]
for pkg_file in pkg_files:
- if not os.path.exists( pkg_file ):
- _logger.error("No PKG -file in path specified")
+ if not os.path.exists(pkg_file):
+ _logger.error(pkg_file + ' not found')
continue
else:
file1 = codecs.open(pkg_file, 'r', 'utf16')
@@ -829,11 +821,13 @@
lines = file1.readlines()
pkg_file_path = path((pkg_file.rsplit(os.sep, 1))[0])
+
+ mmp_parser = MmpFileParser(self.bldpath)
+ test_type = mmp_parser.get_dll_type(pkg_file_path)
+ libraries = mmp_parser.get_libraries(pkg_file_path)
for line in lines:
- pkg_path = self.__map_pkg_path(line, pkg_file_path, os.path.basename(pkg_file))
- if pkg_path is None:
- continue
- else:
+ pkg_path = self.__map_pkg_path(line, pkg_file_path, os.path.basename(pkg_file), test_type, libraries)
+ if pkg_path:
pkg_paths.append(pkg_path)
return pkg_paths
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/tdriver.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/tdriver.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,454 @@
+# -*- encoding: latin-1 -*-
+
+#============================================================================
+#Name : tdriver.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+"""TDriver test drop generation."""
+
+
+#W0142 => * and ** were used
+#R* removed during refactoring
+
+from optparse import OptionParser
+from xml.etree import ElementTree as et
+import pkg_resources
+from path import path # pylint: disable=F0401
+import logging
+import os
+import re
+import tempfile
+import zipfile
+import amara
+import ntpath as atspath
+import jinja2 # pylint: disable=F0401
+import ats3.parsers
+
+_logger = logging.getLogger('tdriver')
+
+# Shortcuts
+E = et.Element
+SE = et.SubElement
+
+class Configuration(object):
+ """
+ TDriver drop generation configuration.
+ """
+
+ def __init__(self, opts):
+ """
+ Initialize from optparse configuration options.
+ """
+
+ self._opts = opts
+ # Customize some attributes from how optparse leaves them.
+ self.build_drive = path(self._opts.build_drive)
+ self.file_store = path(self._opts.file_store)
+ self.flash_images = self.split_paths(self._opts.flash_images)
+ self.tdriver_sis_files = self.split_paths(self._opts.tdriver_sis_files)
+ self.test_assets = self.split_paths(self._opts.testasset_location)
+ self.template_loc = path(self._opts.template_loc)
+
+
+ def split_paths(self, arg, delim=","):
+ """
+ Split the string by delim, removing extra whitespace.
+ """
+ return [path(part.strip())
+ for part in arg.split(delim) if part.strip()]
+
+ def __getattr__(self, attr):
+ return getattr(self._opts, attr)
+
+ def __str__(self):
+ dump = "Configuration:\n"
+ seen = set()
+ for key, value in vars(self).items():
+ if not key.startswith("_"):
+ dump += "\t%s = %s\n" % (key, value)
+ seen.add(key)
+ for key, value in vars(self._opts).items():
+ if key not in seen:
+ dump += "\t%s = %s\n" % (key, value)
+ seen.add(key)
+ return dump
+
+
+class TDriverTestPlan(object):
+ """ Tells TDriver server what to test and how.
+
+ The TDriver test plan from which the test.xml file can be written. The test
+ plan requires TestAsset(s) to perform the tests
+ """
+
+ def __init__(self, config):
+ self.pkg_parser = ats3.parsers.PkgFileParser()
+ self.file_store = config.file_store
+ self.tdriver_timeout = config.tdriver_timeout
+ self.test_profiles = config.test_profiles
+ self.tdrunner_enabled = to_bool(config.tdrunner_enabled)
+ self.tdrunner_parameters = config.tdrunner_parameters
+ self.test_profiles = config.test_profiles.strip().split(",")
+ self.build_drive = config.build_drive
+ self.tdriver_sis_files = ""
+ self.install_files = []
+ self.tdriver_task_files = None
+ self.ctc_enabled = 'False'
+ if hasattr(config, 'ctc_enabled'):
+ self.ctc_enabled = to_bool(config.ctc_enabled)
+
+ def insert_execution_block(self, block_count=1, image_files=None, tdriver_sis_files=None, test_asset_path=None, tdriver_parameters=None):
+ """
+ Insert TDriver tasks and test data files into execution block
+ """
+ self.tdriver_sis_files = tdriver_sis_files
+ temp_sis_files = []
+ if self.tdriver_sis_files != None:
+ for sis_file in self.tdriver_sis_files:
+ temp_sis_files.append(sis_file.split("#"))
+
+ test_asset_path = test_asset_path
+ if image_files is None:
+ image_files = []
+
+ exe_dict = dict(name="exe%d" % block_count, asset_path=test_asset_path, image_files=image_files, tdriver_sis_files=temp_sis_files, ctc_enabled=self.ctc_enabled)
+ exe_dict = dict(exe_dict, test_timeout=self.tdriver_timeout)
+ exe_dict = dict(exe_dict, tdriver_parameters=tdriver_parameters)
+ exe_dict = dict(exe_dict, tdrunner_enabled=self.tdrunner_enabled.lower())
+ exe_dict = dict(exe_dict, tdrunner_parameters=self.tdrunner_parameters)
+
+
+ self.tdriver_task_files = self._create_tdriver_task_files_list(test_asset_path)
+ exe_dict = dict(exe_dict, tdriver_task_files=self.tdriver_task_files)
+
+ self.install_files = self.create_install_files_list(test_asset_path)
+ exe_dict = dict(exe_dict, install_files=self.install_files)
+ return exe_dict
+
+ def _create_tdriver_task_files_list(self, asset_path=None):
+ """
+ Creates list of files needed to include in TDriver execution tasks
+ if tdrunner.enabled then
+ profiles (.sip files) are included
+ else
+ all ruby (.rb) files are included
+ """
+
+ profiles = []
+ rb_files = []
+
+ #If TDrunner engine is enabled (set to True)
+ if self.tdrunner_enabled.lower() == "true":
+ profile_path = path(os.path.join(asset_path, "profile"))
+ if os.path.exists(profile_path):
+ for profile_name in self.test_profiles:
+ item = list(profile_path.walkfiles("%s.sip"%profile_name.lower().strip()))
+ if len(item) > 0:
+ #profiles.append(os.path.join(profile_path, item[0]))
+ profiles.append(asset_path.rsplit(os.sep, 1)[1] + "/" + "profile" + "/" + item[0].rsplit(os.sep, 1)[1])
+ return profiles
+ else:
+ _logger.warning(profile_path + ' not found')
+ else: #If TDruner engine is not enabled (set to False)
+ if os.path.exists(asset_path):
+ #returns list(asset_path.walkfiles("*.rb")):
+ for item in list(asset_path.walkfiles("*.rb")):
+ rb_files.append(asset_path.rsplit(os.sep, 1)[1] + "/" + item.rsplit(os.sep, 1)[1])
+ # Sorting the result, so we ensure they are always in similar order.
+ rb_files.sort()
+ return rb_files
+ else:
+ _logger.warning(asset_path + ' not found')
+
+ def create_install_files_list(self, asset_path=None):
+ """
+ Collects all the .pkg files and extract data
+ Creates a list of src, dst files.
+ """
+ pkg_files = []
+ if os.path.exists(asset_path):
+ pkg_files = list(asset_path.walkfiles("*.pkg"))
+ return self.pkg_parser.get_data_files(pkg_files, self.build_drive)
+ else:
+ return None
+
+ def __getitem__(self, key):
+ return self.__dict__[key]
+
+
+
+class TDriverTestDropGenerator(object):
+ """
+ Generate test drop zip file for TDriver.
+
+ Generates drop zip files file from Test Assets. The main
+ responsibility of this class is to create testdrop and test.xml
+ file and build a zip file for the TDriver drop.
+
+ """
+
+ def __init__(self):
+ self.drop_path_root = path("TDriverDrop")
+ self.drop_path = None
+ self.defaults = {}
+ self.CTC_LOG_DIR = r"c:\data\ctc"
+
+ def generate(self, xml_dict, output_file, template_loc=None):
+ """Generate a test drop file."""
+ xml = self.generate_xml(xml_dict, template_loc)
+ return self.generate_drop(xml_dict, xml, output_file)
+
+ def generate_drop(self, xml_dict, xml, output_file):
+ """Generate test drop zip file."""
+
+ zfile = zipfile.ZipFile(output_file, "w", zipfile.ZIP_DEFLATED)
+ try:
+ for drop_file, src_file in self.drop_files(xml_dict):
+
+ _logger.info(" + Adding: %s" % src_file.strip())
+ try:
+ zfile.write(src_file.strip(), drop_file.encode('utf-8'))
+ except OSError, expr:
+ _logger.error(expr)
+ doc = amara.parse(et.tostring(xml.getroot()))
+ _logger.debug("XML output: %s" % doc.xml(indent=u"yes", encoding="ISO-8859-1"))
+ zfile.writestr("test.xml", doc.xml(indent="yes", encoding="ISO-8859-1"))
+ finally:
+ _logger.info("TDriver testdrop created successfully!")
+ zfile.close()
+
+ def generate_xml(self, xml_dict, template_loc):
+ """ generate an XML file"""
+ template_loc = path(template_loc).normpath()
+ loader = jinja2.ChoiceLoader([jinja2.PackageLoader(__package__, 'templates')])
+ env = jinja2.Environment(loader=loader)
+ if template_loc is None or not ".xml" in template_loc.lower():
+ template = env.from_string(pkg_resources.resource_string(__name__, 'tdriver_template.xml'))# pylint: disable=E1101
+ else:
+ template = env.from_string(open(template_loc).read())# pylint: disable=E1101
+
+ xmltext = template.render(xml_dict=xml_dict, test_plan=xml_dict, os=os, atspath=atspath, atsself=self).encode('ISO-8859-1')
+ _logger.info(xmltext)
+ return et.ElementTree(et.XML(xmltext))
+
+
+ def generate_testasset_zip(self, xml_dict, output_file=None):
+ """Generate TestAsset.zip for the TDriver server"""
+ filename = xml_dict["temp_directory"].joinpath(r"TestAsset.zip")
+
+ if output_file != None:
+ filename = output_file
+
+ for exe_block in xml_dict["execution_blocks"]:
+ testasset_location = path(exe_block["asset_path"])
+
+ zfile = zipfile.ZipFile(filename, "w", zipfile.ZIP_DEFLATED)
+ try:
+ for file_ in list(testasset_location.walkfiles()):
+ file_mod = file_.replace(testasset_location, "")
+ zfile.write(file_, file_mod.encode('utf-8'))
+ finally:
+ zfile.close()
+ return filename
+
+ def drop_files(self, xml_dict):
+ """Yield a list of drop files."""
+
+ drop_set = set()
+ drop_files = []
+
+ #Adding test asset, there's an execution block for every test asset
+ for execution_block in xml_dict["execution_blocks"]:
+ testasset_location = path(execution_block["asset_path"])
+ asset_files = list(testasset_location.walkfiles())
+
+ drop_path = path(execution_block["name"])
+
+ drop_files = ((drop_path.parent, "images", execution_block["image_files"]),
+ (drop_path.parent, "sisfiles", execution_block["tdriver_sis_files"]),
+ (drop_path.parent, "tdriverparameters", execution_block["tdriver_parameters"]),
+ (drop_path.parent, execution_block["name"], asset_files))
+
+ for drop_dir, sub_dir, files in drop_files:
+ for file_path in files:
+ if file_path != None:
+
+ #Adding image files to the top level,
+ #Also adding tdriverparameters.xml file
+ if sub_dir.lower() == "images" or sub_dir.lower() == "tdriverparameters":
+ drop_file = drop_dir.joinpath(sub_dir, file_path.name)
+
+ #Adding sisfiles, installation of tdriver sisfiles is a bit different
+ #than normal sisfiles
+ elif sub_dir.lower() == "sisfiles":
+ drop_file = drop_dir.joinpath(sub_dir, path(file_path[0]).name)
+ file_path = path(file_path[0])
+
+ #Adding test asset files
+ else:
+ temp_file = file_path.rsplit(os.sep, 1)[0]
+ replace_string = testasset_location.rsplit(os.sep, 1)[0]
+ drop_file = drop_dir.joinpath(sub_dir + "\\" + temp_file.replace(replace_string, ""), file_path.name)
+
+ drop_file = drop_file.normpath()
+ if drop_file not in drop_set:
+ drop_set.add(drop_file)
+ yield (drop_file, file_path.normpath())
+
+
+class TDriverComponentParser(object):
+ """
+ Add information to the XML dictionary
+ """
+ def __init__(self, config):
+ self.flash_images = [path(p) for p in config.flash_images]
+ self.tdriver_parameters = [path(config.tdriver_parameters).normpath()]
+ self.tdriver_sis_files = config.tdriver_sis_files
+ self.build_drive = config.build_drive
+ self.test_timeout = config.tdriver_timeout
+ self.diamonds_build_url = config.diamonds_build_url
+ self.testrun_name = config.testrun_name
+ self.alias_name = config.alias_name
+ self.device_type = config.device_type
+ self.report_email = config.report_email
+ self.email_format = config.email_format
+ self.email_subject = config.email_subject
+ self.file_store = config.file_store
+
+ self.xml_dict = {}
+
+
+ def insert_pre_data(self):
+ """
+ Creates a dictionary for the data before
+ the block starts.
+ """
+ self.xml_dict = dict(self.xml_dict, temp_directory=path(tempfile.mkdtemp()))
+ self.xml_dict = dict(self.xml_dict, diamonds_build_url=self.diamonds_build_url)
+ self.xml_dict = dict(self.xml_dict, testrun_name=self.testrun_name)
+ self.xml_dict = dict(self.xml_dict, alias_name=self.alias_name)
+ self.xml_dict = dict(self.xml_dict, device_type=self.device_type)
+
+ def create_execution_block(self, config):
+ """Parse flash images and creates execution block for TDriver"""
+ execution_block_list = []
+ block_count = 0
+ for test_asset in config.test_assets:
+ if os.path.exists(test_asset):
+ test_plan = TDriverTestPlan(config)
+ block_count += 1
+ execution_block_list.append(test_plan.insert_execution_block(block_count, self.flash_images, self.tdriver_sis_files, test_asset, self.tdriver_parameters))
+
+
+ self.xml_dict = dict(self.xml_dict, execution_blocks=execution_block_list)
+
+ def insert_post_data(self):
+ """
+ Creates a dictionary for the data after
+ the block ends. Or, Postaction data
+ """
+ self.xml_dict = dict(self.xml_dict, report_email=self.report_email)
+ self.xml_dict = dict(self.xml_dict, email_format=self.email_format)
+ self.xml_dict = dict(self.xml_dict, email_subject=self.email_subject)
+ self.xml_dict = dict(self.xml_dict, report_location=self.file_store)
+
+ return self.xml_dict
+
+def create_drop(config):
+ """Create a test drop."""
+ xml_dict = {}
+
+ _logger.debug("initialize TDriver dictionary")
+ drop_parser = TDriverComponentParser(config)
+
+ #Inserting data for test run and global through out the dictionary
+ drop_parser.insert_pre_data()
+
+ #for every asset path there should be a
+ #separate execution block
+ drop_parser.create_execution_block(config)
+
+ #Inserting reporting and email data (post actions)
+ xml_dict = drop_parser.insert_post_data()
+
+ generator = TDriverTestDropGenerator()
+
+ _logger.info("generating drop file: %s" % config.drop_file)
+ generator.generate(xml_dict, output_file=config.drop_file, template_loc=config.template_loc)
+
+def to_bool(param):
+ """setting a true or false based on a param value"""
+ param = str(param).lower()
+ if "true" == param or "t" == param or "1" == param:
+ return "True"
+ else:
+ return "False"
+
+def main():
+ """Main entry point."""
+
+
+ cli = OptionParser(usage="%prog [options] PATH1 [PATH2 [PATH3 ...]]")
+ cli.add_option("--ats4-enabled", help="ATS4 enabled", default="True")
+ cli.add_option("--build-drive", help="Build area root drive")
+ cli.add_option("--drop-file", help="Name for the final drop zip file", default="TDriverDrop.zip")
+
+ cli.add_option("--minimum-flash-images", help="Minimum amount of flash images", default=2)
+ cli.add_option("--flash-images", help="Paths to the flash image files", default="")
+ cli.add_option("--tdriver-sis-files", help="Sis files location", default="")
+
+ cli.add_option("--testasset-location", help="TDriver test assets location", default="")
+ cli.add_option("--template-loc", help="Custom template location", default="")
+ cli.add_option("--tdrunner-enabled", help="Enabled or disabled TDrunner", default=True)
+ cli.add_option("--test-profiles", help="Test profiles e.g. bat, fute", default="")
+ cli.add_option("--tdriver-parameters", help="Location of xml file contains additional parameters for TDriver", default="")
+
+ cli.add_option("--tdriver-timeout", help="Test execution timeout value (default: %default)", default="60")
+ cli.add_option("--tdrunner-parameters", help="Additional TDrunner parameters for TDriver task", default="")
+ cli.add_option("--file-store", help="Destination path for reports.", default="")
+ cli.add_option("--report-email", help="Email notification receivers", default="")
+ cli.add_option("--testrun-name", help="Name of the test run", default="run")
+ cli.add_option("--alias-name", help="Name of the alias", default="sut_s60")
+ cli.add_option("--device-type", help="Device type (e.g. 'PRODUCT')", default="unknown")
+ cli.add_option("--diamonds-build-url", help="Diamonds build url")
+ cli.add_option("--email-format", help="Format of an email", default="")
+ cli.add_option("--email-subject", help="Subject of an email", default="TDriver Testing")
+ cli.add_option("--ctc-enabled", help="CTC enabled", default="False")
+
+ cli.add_option("--verbose", help="Increase output verbosity", action="store_true", default=False)
+
+ opts, _ = cli.parse_args()
+
+ ats4_enabled = to_bool(opts.ats4_enabled)
+
+ if ats4_enabled == "False":
+ cli.error("TDriver tests execute on ATS4. Set property 'ats4.enabled'")
+
+ if not opts.flash_images:
+ cli.error("no flash image files given")
+ if len(opts.flash_images.split(",")) < int(opts.minimum_flash_images):
+ cli.error("Not enough flash files: %i defined, %i needed" % (len(opts.flash_images.split(",")), int(opts.minimum_flash_images) ))
+
+ if opts.verbose:
+ _logger.setLevel(logging.DEBUG)
+ logging.basicConfig(level=logging.DEBUG)
+ config = Configuration(opts)
+ create_drop(config)
+
+if __name__ == "__main__":
+ main()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/tdriver_template.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/tdriver_template.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,184 @@
+
+
+
+{% import 'ats4_macros.xml' as macros with context %}
+
+
+
+ {% if xml_dict['diamonds_build_url'] -%}
+ {{ xml_dict['diamonds_build_url'] }}
+ Smoke
+ {% endif %}
+ {{ xml_dict['testrun_name'] }}
+
+
+
+
+
+
+
+
+
+ {% for exe_block in xml_dict['execution_blocks'] -%}
+
+
+
+ {% if exe_block['image_files'] -%}
+
+ FlashTask
+
+ {% set i = 1 %}
+ {% for img in exe_block['image_files'] -%}
+
+ {% set i = i + 1 %}
+ {% endfor -%}
+
+
+ {% endif %}
+
+ {% if exe_block['install_files'] != [] -%}
+ {% for file in exe_block['install_files'] -%}
+
+ FileUploadTask
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+ {% if exe_block['tdriver_sis_files'] != [] -%}
+ {% for sisfile in exe_block['tdriver_sis_files'] -%}
+
+ FileUploadTask
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+ {% for sis_file in exe_block["tdriver_sis_files"] -%}
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {%- endfor -%}
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+ {% if exe_block["ctc_enabled"] == "True" -%}
+ {{ macros.ctc_initialization(exe_block) }}
+ {%- endif %}
+
+
+ {% if exe_block["tdriver_task_files"] -%}
+ {% for task_file in exe_block["tdriver_task_files"] -%}
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+
+ {% if exe_block["ctc_enabled"] == "True" -%}
+ {{ macros.ctc_finalization(exe_block) }}
+ {%- endif %}
+
+
+ CleanupTask
+
+
+
+
+
+
+ {% endfor -%}
+
+
+
+ EmailAction
+
+
+
+
+
+
+ {% if xml_dict['report_location'] -%}
+
+ FileStoreAction
+
+
+
+
+
+ {% endif %}
+ {% if xml_dict['diamonds_build_url'] -%}
+
+ DiamondsAction
+ {% if xml_dict['execution_blocks'] != [] and xml_dict['execution_blocks'][0]["ctc_enabled"] == "True" -%}
+
+
+
+ {%- endif %}
+
+ {%- endif %}
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ats3/templates/ats4_macros.xml
--- a/buildframework/helium/sf/python/pythoncore/lib/ats3/templates/ats4_macros.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ats3/templates/ats4_macros.xml Sun Oct 10 15:22:15 2010 +0300
@@ -19,7 +19,7 @@
============================================================================
-->
-{% macro ctc_initialization() -%}
+{% macro ctc_initialization(test_plan) -%}
CreateDirTask
@@ -35,7 +35,7 @@
{%- endmacro %}
-{% macro ctc_finalization(setd) -%}
+{% macro ctc_finalization(test_plan) -%}
NonTestExecuteTask
@@ -68,6 +68,7 @@
{% macro generate_runsteps_stif(setd) -%}
{% set ini_file = atsself.stif_init_file(setd['src_dst']) %}
{% if ini_file -%}
+ {% set ini_file_module_name = atsself.stifmodulename(ini_file[0]) %}
{% if test_plan['hti'] == 'True' -%}
StifRunCasesTask
@@ -90,7 +91,8 @@
{%- endif %}
- {% else -%}
+ {%- endif %}
+
{% for file in setd['src_dst'] -%}
{% if setd["test_harness"] == "STIF" or setd["test_harness"] == "STIFUNIT" -%}
{% if file[2] == "conf" and ".dll" not in file[1].lower() -%}
@@ -98,10 +100,17 @@
StifRunCasesTask
+ {% if ini_file_module_name.upper() == 'TEFTESTMODULE' -%}
+
+ {% else -%}
+ {%- endif %}
+ {% if ini_file_module_name.upper() == 'TEFTESTMODULE' and test_plan['ats_stf_enabled'].lower() == "true" -%}
+
+ {%- endif %}
{% else -%}
@@ -110,8 +119,13 @@
+ {% if ini_file_module_name.upper() == 'TEFTESTMODULE' -%}
+
+
+ {% else -%}
+ {%- endif %}
@@ -123,7 +137,7 @@
StifRunCasesTask
-
+
@@ -144,11 +158,13 @@
{%- endif %}
{%- endif %}
{%- endfor %}
- {%- endif %}
{%- endmacro %}
{% macro generate_runsteps_stif_single_set(setd) -%}
{% if setd["engine_ini_file"] != None -%}
+
+ {% set ini_file_module_name = atsself.stifmodulename(setd["engine_ini_file"]) %}
+
{% if test_plan['hti'] == 'True' -%}
StifRunCasesTask
@@ -171,16 +187,24 @@
{%- endif %}
- {% elif setd["config_files"] != [] -%}
+ {%- endif %}
+ {% if setd["config_files"] != [] -%}
{% for config_file in setd["config_files"] -%}
{% if test_plan['hti'] == 'True' -%}
StifRunCasesTask
+ {% if ini_file_module_name.upper() == 'TEFTESTMODULE' -%}
+
+ {% else -%}
+ {%- endif %}
+ {% if ini_file_module_name.upper() == 'TEFTESTMODULE' and test_plan['ats_stf_enabled'].lower() == "true" -%}
+
+ {%- endif %}
{% else -%}
@@ -223,4 +247,4 @@
{%- endif %}
{%- endfor %}
{%- endif %}
-{%- endmacro %}
\ No newline at end of file
+{%- endmacro %}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/atsant.py
--- a/buildframework/helium/sf/python/pythoncore/lib/atsant.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/atsant.py Sun Oct 10 15:22:15 2010 +0300
@@ -56,7 +56,7 @@
return None
if noncust:
return noncust
- raise Exception('iconfig not found in ' + self.imagesdir)
+ raise IOError('iconfig not found in ' + self.imagesdir)
def getimage(self, name):
"""get image"""
@@ -64,7 +64,7 @@
for fname in files:
if fname.lower() == name.lower():
return os.path.join(root, fname)
- raise Exception(name + ' not found in ' + self.imagesdir)
+ raise IOError(name + ' not found in ' + self.imagesdir)
def findimages(self):
"""find images"""
@@ -82,10 +82,10 @@
if os.path.exists(image):
output = output + image + ','
else:
- raise Exception(image + ' not found')
+ raise IOError(image + ' not found')
else:
if imagetype == 'core':
- raise Exception(imagetypename + '_FLASH not found in iconfig.xml in ' + self.imagesdir)
+ raise IOError(imagetypename + '_FLASH not found in iconfig.xml in ' + self.imagesdir)
print imagetypename + '_FLASH not found in iconfig.xml'
return output
@@ -120,7 +120,10 @@
for unit in component.unit:
if group not in modules:
modules[group] = []
- modules[group].append(builddrive + os.sep + unit.bldFile)
+ if os.sep == '\\':
+ modules[group].append(builddrive + os.sep + unit.bldFile)
+ else:
+ modules[group].append(unit.bldFile)
else:
sdf = sysdef.api.SystemDefinition(canonicalsysdeffile)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/build/model.py
--- a/buildframework/helium/sf/python/pythoncore/lib/build/model.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/build/model.py Sun Oct 10 15:22:15 2010 +0300
@@ -199,13 +199,7 @@
""" Initialisation. """
self._ccm_project = ccm_project
self._baselines = {}
- #TODO : could querying release attribute return the ccm object? Or add a release attribute to Project
- # class
- release = self._ccm_project['release']
- _logger.debug("Project release: '%s'" % release)
- self._ccm_release = None
- if release != '':
- self._ccm_project.session.create(release)
+ _logger.debug("Project release: '%s'" % self._ccm_project.release)
# capturing the frozen baseline.
_logger.debug('Capture baselines')
@@ -309,8 +303,8 @@
def _getsupplier(self):
"""get supplier"""
- if self._ccm_release != None:
- component = self._ccm_release.component
+ if self._ccm_project.release != None:
+ component = self._ccm_project.release.component
comparisons = {'MC': '^mc',
'S60': 'S60',
'SPP/NCP': '^spp_config|spp_psw|spp_tools|ncp_sw$',
@@ -458,12 +452,12 @@
for name in folder.name:
folder_name = unicode(name)
_logger.debug('folder_name: %s' % folder_name)
- if not old_folders.has_key(unicode(folder_name)):
- old_folders[unicode(folder_name)] = {}
- if hasattr(name, 'xml_attributes'):
- for attr_name, _ in sorted(name.xml_attributes.iteritems()):
- _logger.debug('attr_name: %s' % attr_name)
- old_folders[unicode(folder_name)][unicode(attr_name)] = unicode(getattr(name, attr_name))
+ if not old_folders.has_key(unicode(folder_name)):
+ old_folders[unicode(folder_name)] = {}
+ if hasattr(name, 'xml_attributes'):
+ for attr_name, _ in sorted(name.xml_attributes.iteritems()):
+ _logger.debug('attr_name: %s' % attr_name)
+ old_folders[unicode(folder_name)][unicode(attr_name)] = unicode(getattr(name, attr_name))
for task in recursive_node_scan(bom_log.bom.content, u'task'):
_logger.debug('task: %s' % task)
_logger.debug('task: %s' % task.id)
@@ -629,6 +623,14 @@
fix_node = doc.xml_create_element(u'fix', content=(unicode(task)), attributes = {u'type': unicode(fix.__class__.__name__)})
project_node.xml_append(fix_node)
+ self.write_icd_icfs(doc)
+ self.write_release_info(doc)
+
+ out = open(path, 'w')
+ doc.xml(out, indent='yes')
+ out.close()
+
+ def write_icd_icfs(self, doc):
if self._bom.icd_icfs != []:
# Add ICD info to BOM
doc.bom.content.xml_append(doc.xml_create_element(u'input'))
@@ -642,12 +644,13 @@
doc.bom.content.input.xml_append(doc.xml_create_element(u'version', content=(unicode(empty_bom_str))))
doc.bom.content.input.xml_append(doc.xml_create_element(u'icds'))
-
- # pylint: disable=R0914
- for i, icd in enumerate(self._bom.icd_icfs):
- doc.bom.content.input.icds.xml_append(doc.xml_create_element(u'icd'))
- doc.bom.content.input.icds.icd[i].xml_append(doc.xml_create_element(u'name', content=(unicode(icd))))
- #If currentRelease.xml exists then send s60 tag to diamonds
+
+ for i, icd in enumerate(self._bom.icd_icfs):
+ doc.bom.content.input.icds.xml_append(doc.xml_create_element(u'icd'))
+ doc.bom.content.input.icds.icd[i].xml_append(doc.xml_create_element(u'name', content=(unicode(icd))))
+
+ def write_release_info(self, doc):
+ # If currentRelease.xml exists then send s60 tag to diamonds
current_release_xml_path = self._bom.config['currentRelease.xml']
# data from the metadata will go first as they must be safer than the one
# given by the user
@@ -730,12 +733,6 @@
s60_input_source.xml_append(doc.xml_create_element(u'type', content=(unicode("unknown"))))
s60_input_node.xml_append(s60_input_source)
doc.bom.content.xml_append(s60_input_node)
-
-
- out = open(path, 'w')
- doc.xml(out, indent='yes')
- out.close()
-
def parse_status_log(self, log):
"""parse status log"""
_log_array = log.split('\r')
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ccm/__init__.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ccm/__init__.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ccm/__init__.py Sun Oct 10 15:22:15 2010 +0300
@@ -202,10 +202,11 @@
if mresult != None:
project = self._session.create(mresult.group(1))
self._output[project] = []
- mresult = re.match(r"^(.*)\s+(\w+#\d+)\s+(.+)$", line)
+ mresult = re.match(r"^(.*?)\s+(\w+#\d+(?:,\s+\w+#\d+)*)\s+(.+)$", line)
if mresult != None and project != None:
- self._output[project].append({'object': self._session.create(mresult.group(1)),
- 'task': self._session.create("Task %s" % mresult.group(2)),
+ for task in mresult.group(2).split(','):
+ self._output[project].append({'object': self._session.create(mresult.group(1)),
+ 'task': self._session.create("Task %s" % task),
'comment': mresult.group(3)})
mresult = re.match(r"^(\w+#\d+)\s+(.+)$", line)
if mresult != None and project != None:
@@ -340,7 +341,6 @@
match_warning = re.compile(r"^Warning:(.*)")
match_failed = re.compile(r"(Update failed)")
- # TODO: cleanup the parsing to do that in a more efficient way.
for line in output.splitlines():
_logger.info(line)
res = match_object_update.match(line)
@@ -723,9 +723,6 @@
def __repr__(self):
return self.__str__()
-
- def __del__(self):
- self.close()
def purposes(self, role=None):
""" Returns available purposes. """
@@ -922,7 +919,7 @@
try:
for session in self._free_sessions:
- session.role = session._set_role(role)
+ session.role = role
finally:
self._lock_pool = False
self._pool_lock.notifyAll()
@@ -1349,11 +1346,13 @@
def _getrelease(self):
""" Get the release of the current object. Returns a Releasedef object. """
- self._release = Releasedef(self._session, self['release'])
+ if self._release == None and (self['release'] != None and self['release'] != ''):
+ self._release = Releasedef(self._session, self['release'])
return self._release
def _setrelease(self, release):
""" Set the release of the current object. """
+ self._release = release
self['release'] = release['displayname']
def refresh(self):
@@ -1381,7 +1380,7 @@
if result.status != None and result.status != 0:
raise CCMException("Error setting basline of project '%s'\n%s" % (self.objectname, result.output))
- def set_update_method(self, name, recurse = False):
+ def set_update_method(self, name, recurse=False):
""" Set the update method for the project (and subproject if recurse is True). """
assert name != None, "name must not be None."
assert len(name) > 0, "name must not be an empty string."
@@ -1392,7 +1391,7 @@
if result.status != None and result.status != 0:
raise CCMException("Error setting reconfigure properties to %s for project '%s'\nStatus: %s\n%s" % (name, self.objectname, result.status, result.output))
- def apply_update_properties(self, baseline = True, tasks_and_folders = True, recurse=True):
+ def apply_update_properties(self, baseline=True, tasks_and_folders=True, recurse=True):
""" Apply update properties to subprojects. """
args = ""
if not baseline:
@@ -1423,7 +1422,7 @@
return result.output
raise CCMException("Error creation snapshot of %s,\n%s" % (self.objectname, result.output), result)
- def checkout(self, release, version=None, purpose=None, subprojects=True):
+ def checkout(self, release, version=None, purpose=None, subprojects=True, path=None):
""" Create a checkout of this project.
This will only checkout the project in Synergy. It does not create a work area.
@@ -1448,6 +1447,9 @@
self._session.role = get_role_for_purpose(self._session, purpose)
args += " -purpose \"%s\"" % purpose
+ if path:
+ args += " -path \"%s\"" % path
+
if subprojects:
args += " -subprojects"
result = self._session.execute("checkout -project \"%s\" -release \"%s\" -no_wa %s" \
@@ -1456,47 +1458,7 @@
self._session.role = role
if result.project == None:
raise CCMException("Error checking out project %s,\n%s" % (self.objectname, result.output), result)
- return result
-
- def create_release_tag(self, release, new_tag):
- """ creates new release tag """
- role = self._session.role
-
- if role is None:
- self._session.role = "developer"
- role = self._session.role
-
- args = "release -create %s -from %s -bl %s -active -allow_parallel_check_out" % (new_tag, release, release)
- self._session.role = "build_mgr"
-
- result = self._session.execute(" %s" \
- % (args), Result(self._session))
- self._session.role = role
-
- return result.output
-
- def delete_release_tag(self, release, new_tag):
- """ deletes new release tag """
-
- role = self._session.role
- if role is None:
- self._session.role = "developer"
- role = self._session.role
-
-
- self._session.role = "build_mgr"
-
- result = self._session.execute("pg -l -r %s -u" \
- % (new_tag), Result(self._session))
- result = self._session.execute("pg -d \"%s\" -m" \
- % (result.output), Result(self._session))
- result = self._session.execute("release -d %s -force" \
- % (new_tag), Result(self._session))
-
- self._session.role = role
-
- return result.output
-
+ return result
def work_area(self, maintain, recursive=None, relative=None, path=None, pst=None, wat=False):
""" Configure the work area. This allow to enable it or disable it, set the path, recursion... """
@@ -1629,6 +1591,44 @@
return self.name
component = property(_getcomponent)
+
+ def create_tag(self, new_tag):
+ """ creates new release tag """
+ role = self._session.role
+
+ if role is None:
+ self._session.role = "developer"
+ role = self._session.role
+
+ args = "release -create %s -from %s -bl %s -active -allow_parallel_check_out" % (new_tag, self.objectname, self.objectname)
+ self._session.role = "build_mgr"
+
+ result = self._session.execute(" %s" \
+ % (args), Result(self._session))
+ self._session.role = role
+
+ return result.output
+
+ def delete_tag(self, new_tag):
+ """ deletes new release tag """
+
+ role = self._session.role
+ if role is None:
+ self._session.role = "developer"
+ role = self._session.role
+
+ self._session.role = "build_mgr"
+
+ result = self._session.execute("pg -l -r %s -u" \
+ % (new_tag), Result(self._session))
+ result = self._session.execute("pg -d \"%s\" -m" \
+ % (result.output), Result(self._session))
+ result = self._session.execute("release -d \"%s\" -force" \
+ % (new_tag), Result(self._session))
+
+ self._session.role = role
+
+ return result.output
class Folder(CCMObject):
@@ -1751,7 +1751,6 @@
objects = property(_getobjects)
def __unicode__(self):
- # TODO: use optimised query that makes only 1 ccm query with suitable format
if self.__unicode_str_text == None:
self.__unicode_str_text = u'%s: %s' % (self['displayname'], self['task_synopsis'])
return self.__unicode_str_text
@@ -1771,6 +1770,7 @@
release = property(get_release_tag, set_release_tag)
+
class UpdateTemplate:
""" Allow to access Update Template property using Release and Purpose. """
def __init__(self, releasedef, purpose):
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/ccm/extra.py
--- a/buildframework/helium/sf/python/pythoncore/lib/ccm/extra.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/ccm/extra.py Sun Oct 10 15:22:15 2010 +0300
@@ -105,7 +105,7 @@
_logger.error( "Exception occurred in request #%s: %s" % (request.requestID, exc_info[1]))
exceptions.append(exc_info[1])
- def handle_result(result):
+ def handle_result(_, result):
""" append the result"""
results.append(result)
@@ -133,7 +133,7 @@
_logger.error( "Exception occured in request #%s: %s\n%s" % (request.requestID, exc_info[1], traceback.format_exception(exc_info[0], exc_info[1], exc_info[2])))
exceptions.append(exc_info[1])
- def handle_result(request, result):
+ def handle_result(_, result):
"""append the result"""
results.append(result)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/configuration.py
--- a/buildframework/helium/sf/python/pythoncore/lib/configuration.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/configuration.py Sun Oct 10 15:22:15 2010 +0300
@@ -558,10 +558,7 @@
A ConfigurationSet represents a number of Configuration objects
that all may need to be processed.
"""
- try:
- dom = xml.dom.minidom.parse(self.inputfile)
- except Exception, exc:
- raise Exception("XML file '%s' cannot be parsed properly: %s" % (self.inputfile, exc))
+ dom = xml.dom.minidom.parse(self.inputfile)
# The root element is typically but can be anything
self.rootNode = dom.documentElement
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/convertpkg.py
--- a/buildframework/helium/sf/python/pythoncore/lib/convertpkg.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/convertpkg.py Sun Oct 10 15:22:15 2010 +0300
@@ -64,6 +64,8 @@
submmpfile.write('//rtest\n')
elif testtype == 'stif':
submmpfile.write('LIBRARY stiftestinterface.lib\n')
+ elif testtype == 'sut':
+ submmpfile.write('LIBRARY symbianunittestfw.lib\n')
else:
raise Exception('Test type unknown: ' + testtype)
submmpfile.close()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/dependancygraph.py
--- a/buildframework/helium/sf/python/pythoncore/lib/dependancygraph.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/dependancygraph.py Sun Oct 10 15:22:15 2010 +0300
@@ -139,17 +139,18 @@
if os.path.isfile(filename) and fname.endswith('.egg'):
eggfile = zipfile.ZipFile(filename, 'r', zipfile.ZIP_DEFLATED)
-
- data = eggfile.read('EGG-INFO/PKG-INFO')
-
- library = readPkgInfo(data.split('\n'))
-
- if 'EGG-INFO/requires.txt' in eggfile.namelist():
- requiresdata = eggfile.read('EGG-INFO/requires.txt')
- readRequiresFile(requiresdata.split('\n'), library)
+ if 'EGG-INFO/PKG-INFO' in eggfile.namelist():
+ data = eggfile.read('EGG-INFO/PKG-INFO')
+
+ library = readPkgInfo(data.split('\n'))
- libraries.addLibrary(notinsubcon, library)
-
+ if 'EGG-INFO/requires.txt' in eggfile.namelist():
+ requiresdata = eggfile.read('EGG-INFO/requires.txt')
+ readRequiresFile(requiresdata.split('\n'), library)
+
+ libraries.addLibrary(notinsubcon, library)
+ else:
+ print 'EGG-INFO/PKG-INFO not in ' + filename
eggfile.close()
def readRequiresFile(data, library):
@@ -326,8 +327,9 @@
if macro:
output.append("\"%s\" [fontname=\"Times-Italic\"];" % str(targ.name))
output.append('subgraph \"cluster%s\" {label = \"%s\"; \"%s\"}\n' % (str(proj.name), str(proj.name), str(targ.name)))
- splt = str(signal).split(',')
+ splt = str(signal).split('(')
if len(splt) > 1:
+ splt[1] = splt[1].replace(')', '')
if splt[1] == 'now':
color = 'red'
elif splt[1] == 'defer':
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/fileutils.py
--- a/buildframework/helium/sf/python/pythoncore/lib/fileutils.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/fileutils.py Sun Oct 10 15:22:15 2010 +0300
@@ -310,7 +310,7 @@
except OSError:
if os.path.isdir(src):
if destinsrc(src, dst):
- raise Exception, "Cannot move a directory '%s' into itself '%s'." % (src, dst)
+ raise OSError, "Cannot move a directory '%s' into itself '%s'." % (src, dst)
shutil.copytree(src, dst, symlinks=True)
rmtree(src)
else:
@@ -376,10 +376,15 @@
except os.error:
continue
# Check if the path is a regular file
- if stat.S_ISREG(status[stat.ST_MODE]):
- mode = stat.S_IMODE(status[stat.ST_MODE])
- if mode & 0111:
+ if os.sep == '\\':
+ if os.path.isfile(filename):
return os.path.normpath(filename)
+ else:
+ # On Unix also check the executable rigths
+ if stat.S_ISREG(status[stat.ST_MODE]):
+ mode = stat.S_IMODE(status[stat.ST_MODE])
+ if mode & 0111:
+ return os.path.normpath(filename)
return None
@@ -407,8 +412,8 @@
def load_policy_content(filename):
""" Testing policy content loading. """
data = ''
+ fileh = codecs.open(filename, 'r', 'ascii')
try:
- fileh = codecs.open(filename, 'r', 'ascii')
data = fileh.read()
except ValueError:
raise IOError("Error loading '%s' as an ASCII file." % filename)
@@ -607,7 +612,7 @@
if drive_type == win32con.DRIVE_REMOTE:
win32wnet.WNetCancelConnection2(drive, win32netcon.CONNECT_UPDATE_PROFILE, 1)
else:
- raise Exception("%s couldn't be umount." % drive)
+ raise OSError("%s couldn't be umount." % drive)
else:
def rmdir(path):
@@ -653,14 +658,14 @@
p_subst = subprocess.Popen("subst %s %s" % (drive, path), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
errmsg = p_subst.communicate()[0]
if p_subst.returncode != 0:
- raise Exception("Error substing '%s' under '%s': %s" % (path, drive, errmsg))
+ raise OSError("Error substing '%s' under '%s': %s" % (path, drive, errmsg))
def unsubst(drive):
""" Unsubsting the drive. """
p_subst = subprocess.Popen("subst /D %s" % (drive), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
errmsg = p_subst.communicate()[0]
if p_subst.returncode != 0:
- raise Exception("Error unsubsting '%s': %s" % (drive, errmsg))
+ raise OSError("Error unsubsting '%s': %s" % (drive, errmsg))
def getSubstedDrives():
"""get substituted drive"""
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/fileutils.py.orig
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/fileutils.py.orig Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,698 @@
+#============================================================================
+#Name : fileutils.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+"""
+File manipulation related functionalities:
+ * Filescanner
+ * rmtree (fixed version)
+ * move (fixed version)
+"""
+import codecs
+import locale
+import logging
+import os
+import re
+import sys
+import shutil
+import hashlib
+import subprocess
+import string
+
+import pathaddition.match
+import stat
+
+if os.name == 'nt':
+ import win32api
+
+LOGGER = logging.getLogger('fileutils')
+LOGGER_LOCK = logging.getLogger('fileutils.lock')
+#LOGGER.addHandler(logging.FileHandler('default.log'))
+#logging.basicConfig(level=logging.DEBUG)
+#LOGGER.setLevel(logging.DEBUG)
+
+class AbstractScanner(object):
+ """ This class implements all the required infrastructure for filescanning. """
+
+ def __init__(self):
+ """ Initialization. """
+ self.includes = []
+ self.excludes = []
+ self.includes_files = []
+ self.excludes_files = []
+ self.selectors = []
+ self.filetypes = []
+
+ def add_include(self, include):
+ """ Adds an include path to the scanner. """
+ if include.endswith('/') or include.endswith('\\'):
+ include = include + '**'
+
+ self.includes.append(include)
+
+ def add_exclude(self, exclude):
+ """ Adds an exclude path to the scanner. """
+ if exclude.endswith('/') or exclude.endswith('\\'):
+ exclude = exclude + '**'
+
+ self.excludes.append(exclude)
+
+ def add_exclude_file(self, exclude):
+ """ Adds an exclude file to the scanner. """
+ self.excludes_files.append(exclude)
+
+ def add_selector(self, selector):
+ """ Add selector to the scanner. """
+ self.selectors.append(selector)
+
+ def add_filetype(self, filetype):
+ """ Adds a filetype selection to the scanner. """
+ self.filetypes.append(filetype)
+
+ def is_included(self, path):
+ """ Returns if path is included by the scanner. """
+ LOGGER.debug("is_included: path = " + path)
+ if path.replace('\\', '/') in self.includes_files or path in self.includes_files:
+ return True
+ for inc in self.includes:
+ if self.match(path, inc):
+ LOGGER.debug("Included: " + path + " by " + inc)
+ return True
+ return False
+
+ def is_excluded(self, path):
+ """ Returns if path is excluded by the scanner. """
+ LOGGER.debug("is_excluded: path = " + path)
+ if path.replace('\\', '/') in self.excludes_files or path in self.excludes_files:
+ return True
+ for ex in self.excludes:
+ if self.match(path, ex):
+ LOGGER.debug("Excluded: " + path + " by " + ex)
+ return True
+ return False
+
+ def is_selected(self, path):
+ """ Returns if path is selected by all selectors in the scanner. """
+ LOGGER.debug("is_selected: path = " + path)
+ for selector in self.selectors:
+ if not selector.is_selected(path):
+ return False
+ LOGGER.debug("Selected: " + path)
+ return True
+
+ def is_filetype(self, path):
+ """ Test if a file matches one filetype. """
+ if len(self.filetypes) == 0:
+ return True
+ LOGGER.debug("is_filetype: path = " + path)
+ for filetype in self.filetypes:
+ if self.match(path, filetype):
+ LOGGER.debug("Filetype: " + path + " by " + filetype)
+ return True
+ return False
+
+ def match(self, filename, pattern):
+ """ Is filename matching pattern? """
+ return pathaddition.match.ant_match(filename, pattern, casesensitive=(os.sep != '\\'))
+
+ def test_path(self, root, relpath):
+ """ Test if a path matches filetype, include, exclude, and selection process."""
+ return self.is_filetype(relpath) and self.is_included(relpath) \
+ and not self.is_excluded(relpath) and \
+ self.is_selected(os.path.join(root, relpath))
+
+ def __str__(self):
+ """ Returns a string representing this instance. """
+ content = []
+ for inc in self.includes:
+ content.append('include:' + os.path.normpath(inc))
+ for ex in self.excludes:
+ content.append('exclude:' + os.path.normpath(ex))
+ return ';'.join(content)
+
+ def __repr__(self):
+ """ Returns a string representing this instance. """
+ return self.__str__()
+
+ def scan(self):
+ """ Abstract method which much be overriden to implement the scanning process. """
+ raise Exception("scan method must be overriden")
+
+
+class FileScanner(AbstractScanner):
+ """Scans the filesystem for files that match the selection paths.
+
+ The scanner is configured with a root directory. Any number of include
+ and exclude paths can be added. The scan() method is a generator that
+ returns matching files one at a time when called as an iterator.
+
+ This is a revisited implementation of the filescanner. It now relies on
+ the module pathaddition.match that implements a Ant-like regular expression matcher.
+
+ Rules:
+ - Includes and excludes should not start with *
+ - Includes and excludes should not have wildcard searches ending with ** (e.g. wildcard**)
+
+ Supported includes and excludes:
+ - filename.txt
+ - filename.*
+ - dir/
+ - dir/*
+ - dir/**
+ """
+ def __init__(self, root_dir):
+ """ Initialization. """
+ AbstractScanner.__init__(self)
+ self.root_dir = os.path.normpath(root_dir)
+ if not self.root_dir.endswith(os.sep):
+ self.root_dir = self.root_dir + os.sep
+ # Add 1 so the final path separator is removed
+ #self.root_dirLength = len(self.root_dir) + 1
+
+ def scan(self):
+ """ Scans the files required to zip"""
+ #paths_cache = []
+
+ excludescopy = self.excludes[:]
+ for f_file in excludescopy:
+ if os.path.exists(os.path.normpath(os.path.join(self.root_dir, f_file))):
+ self.excludes_files.append(f_file)
+ self.excludes.remove(f_file)
+
+ includescopy = self.includes[:]
+ for f_file in includescopy:
+ if os.path.exists(os.path.normpath(os.path.join(self.root_dir, f_file))):
+ self.includes_files.append(f_file)
+ self.includes.remove(f_file)
+
+ LOGGER.debug('Scanning sub-root directories')
+ for root_dir in self.find_subroots():
+ for dirpath, subdirs, files in os.walk(unicode(root_dir)):
+ # Let's save the len before it's getting modified.
+ subdirsLen = len(subdirs)
+ subroot = dirpath[len(self.root_dir):]
+
+ dirs_to_remove = []
+ for subdir in subdirs:
+ if self.is_excluded(os.path.join(subroot, subdir)):
+ dirs_to_remove.append(subdir)
+
+ for dir_remove in dirs_to_remove:
+ subdirs.remove(dir_remove)
+
+ LOGGER.debug('Scanning directory: ' + dirpath)
+ for file_ in files:
+ path = os.path.join(subroot, file_)
+ if self.is_filetype(path) and self.is_included(path) and \
+ self.is_selected(os.path.join(dirpath, file_)) and not self.is_excluded(path):
+ ret_path = os.path.join(dirpath, file_)
+ yield ret_path
+
+ LOGGER.debug('Checking for empty directory: ' + dirpath)
+ # Check for including empty directories
+ if self.is_included(subroot) and not self.is_excluded(subroot):
+ if len(files) == 0 and subdirsLen == 0:
+ LOGGER.debug('Including empty dir: ' + dirpath)
+ yield dirpath
+
+
+ def find_subroots(self):
+ """Finds all the subdirectory roots based on the include paths.
+
+ Often large archive operations define a number of archives from the root
+ of the drive. Walking the tree from the root is very time-consuming, so
+ selecting more specific subdirectory roots improves performance.
+ """
+ def splitpath(path):
+ """ Returns the splitted path"""
+ return path.split(os.sep)
+
+ root_dirs = []
+
+ # Look for includes that start with wildcards.
+ subdirs_not_usable = False
+ for inc in self.includes + self.includes_files:
+ first_path_segment = splitpath(os.path.normpath(inc))[0]
+ if first_path_segment.find('*') != -1:
+ subdirs_not_usable = True
+
+ # Parse all includes for sub-roots
+ if not subdirs_not_usable:
+ for inc in self.includes + self.includes_files:
+ include = None
+ LOGGER.debug("===> inc %s" % inc)
+ contains_globs = False
+ for pathcomp in splitpath(os.path.normpath(inc)):
+ if pathcomp.find('*') != -1:
+ contains_globs = True
+ break
+ else:
+ if include == None:
+ include = pathcomp
+ else:
+ include = os.path.join(include, pathcomp)
+ if not contains_globs:
+ include = os.path.dirname(include)
+
+ LOGGER.debug("include %s" % include)
+ if include != None:
+ root_dir = os.path.normpath(os.path.join(self.root_dir, include))
+ is_new_root = True
+ for root in root_dirs[:]:
+ if destinsrc(root, root_dir):
+ LOGGER.debug("root contains include, skip it")
+ is_new_root = False
+ break
+ if destinsrc(root_dir, root):
+ LOGGER.debug("include contains root, so remove root")
+ root_dirs.remove(root)
+ if is_new_root:
+ root_dirs.append(root_dir)
+
+ if len(root_dirs) == 0:
+ root_dirs = [os.path.normpath(self.root_dir)]
+ LOGGER.debug('Roots = ' + str(root_dirs))
+ return root_dirs
+
+ def __str__(self):
+ return os.path.normpath(self.root_dir) + ';' + AbstractScanner.__str__(self)
+
+ def __repr__(self):
+ return self.__str__()
+
+
+def move(src, dst):
+ """Recursively move a file or directory to another location.
+
+ If the destination is on our current filesystem, then simply use
+ rename. Otherwise, copy src to the dst and then remove src.
+ A lot more could be done here... A look at a mv.c shows a lot of
+ the issues this implementation glosses over.
+
+ """
+ try:
+ os.rename(src, dst)
+ except OSError:
+ if os.path.isdir(src):
+ if destinsrc(src, dst):
+ raise Exception, "Cannot move a directory '%s' into itself '%s'." % (src, dst)
+ shutil.copytree(src, dst, symlinks=True)
+ rmtree(src)
+ else:
+ shutil.copy2(src, dst)
+ os.unlink(src)
+
+def rmtree(rootdir):
+ """ Catch shutil.rmtree failures on Windows when files are read-only. Thanks Google!"""
+ if sys.platform == 'win32':
+ rootdir = os.path.normpath(rootdir)
+ if not os.path.isabs(rootdir):
+ rootdir = os.path.join(os.path.abspath('.'), rootdir)
+ if not rootdir.startswith('\\\\'):
+ rootdir = u"\\\\?\\" + rootdir
+
+ def cb_handle_error(fcn, path, excinfo):
+ """ Error handler, removing readonly and deleting the file. """
+ os.chmod(path, 0666)
+ if os.path.isdir(path):
+ rmdir(path)
+ elif os.path.isfile(path):
+ remove(path)
+ else:
+ fcn(path)
+
+ if 'java' in sys.platform:
+ import java.io
+ import org.apache.commons.io.FileUtils
+ f_file = java.io.File(rootdir)
+ org.apache.commons.io.FileUtils.deleteDirectory(f_file)
+ else:
+ return shutil.rmtree(rootdir, onerror=cb_handle_error)
+
+def destinsrc(src, dst):
+ """ Fixed version of destinscr, that doesn't match dst with same root name."""
+ if os.sep == '\\':
+ src = src.lower()
+ dst = dst.lower()
+ src = os.path.abspath(src)
+ dst = os.path.abspath(dst)
+ if not src.endswith(os.path.sep):
+ src += os.path.sep
+ if not dst.endswith(os.path.sep):
+ dst += os.path.sep
+ return dst.startswith(src)
+
+
+def which(executable):
+ """ Search for executable in the PATH."""
+ pathlist = os.environ['PATH'].split(os.pathsep)
+ pathexts = ['']
+ if os.sep == '\\':
+ pathexts = os.environ['PATHEXT'].split(os.pathsep)
+
+ for folder in pathlist:
+ for pathext in pathexts:
+ exename = executable
+ if os.sep == '\\' and not exename.lower().endswith(pathext.lower()):
+ exename = exename + pathext
+ filename = os.path.join(folder, exename)
+ try:
+ status = os.stat(filename)
+ except os.error:
+ continue
+ # Check if the path is a regular file
+ if stat.S_ISREG(status[stat.ST_MODE]):
+ mode = stat.S_IMODE(status[stat.ST_MODE])
+ if mode & 0111:
+ return os.path.normpath(filename)
+ return None
+
+
+def read_policy_content(filename):
+ """ Read the policy number from the policy file.
+ strict allows to activate the new policy scanning.
+ """
+ value = None
+ error = ""
+ try:
+ LOGGER.debug('Opening policy file: ' + filename)
+ policy_data = load_policy_content(filename)
+ match = re.match(r'^((?:\d+)|(?:0842[0-9a-zA-Z]{3}))\s*$', policy_data, re.M|re.DOTALL)
+ if match != None:
+ value = match.group(1)
+ else:
+ error = "Content of '%s' doesn't match r'^\d+|0842[0-9a-zA-Z]{3}\s*$'." % filename
+ except Exception, exc:
+ error = str(exc)
+ if value is not None:
+ return value
+ # worse case....
+ raise Exception(error)
+
+def load_policy_content(filename):
+ """ Testing policy content loading. """
+ data = ''
+ try:
+ fileh = codecs.open(filename, 'r', 'ascii')
+ data = fileh.read()
+ except:
+ raise Exception("Error loading '%s' as an ASCII file." % filename)
+ finally:
+ fileh.close()
+ return data
+
+ENCODING_MATRIX = {
+ codecs.BOM_UTF8: 'utf_8',
+ codecs.BOM_UTF16: 'utf_16',
+ codecs.BOM_UTF16_BE: 'utf_16_be',
+ codecs.BOM_UTF16_LE: 'utf_16_le',
+}
+
+def guess_encoding(data):
+ """Given a byte string, guess the encoding.
+
+ First it tries for UTF8/UTF16 BOM.
+
+ Next it tries the standard 'UTF8', 'ISO-8859-1', and 'cp1252' encodings,
+ Plus several gathered from locale information.
+
+ The calling program *must* first call locale.setlocale(locale.LC_ALL, '')
+
+ If successful it returns (decoded_unicode, successful_encoding)
+ If unsuccessful it raises a ``UnicodeError``.
+
+ This was taken from http://www.voidspace.org.uk/python/articles/guessing_encoding.shtml
+ """
+ for bom, enc in ENCODING_MATRIX.items():
+ if data.startswith(bom):
+ return data.decode(enc), enc
+ encodings = ['ascii', 'UTF-8']
+ successful_encoding = None
+ try:
+ encodings.append(locale.getlocale()[1])
+ except (AttributeError, IndexError):
+ pass
+ try:
+ encodings.append(locale.getdefaultlocale()[1])
+ except (AttributeError, IndexError):
+ pass
+ # latin-1
+ encodings.append('ISO8859-1')
+ encodings.append('cp1252')
+ for enc in encodings:
+ if not enc:
+ continue
+ try:
+ decoded = unicode(data, enc)
+ successful_encoding = enc
+ break
+ except (UnicodeError, LookupError):
+ pass
+ if successful_encoding is None:
+ raise UnicodeError('Unable to decode input data. Tried the'
+ ' following encodings: %s.' %
+ ', '.join([repr(enc) for enc in encodings if enc]))
+ else:
+ if successful_encoding == 'ascii':
+ # our default ascii encoding
+ successful_encoding = 'ISO8859-1'
+ return (decoded, successful_encoding)
+
+def getmd5(fullpath, chunk_size=2**16):
+ """ returns the md5 value"""
+ file_handle = open(fullpath, "rb")
+ file_handle.seek(0, os.SEEK_END)
+ size = file_handle.tell()
+ file_handle.seek(0, os.SEEK_SET)
+ md5 = hashlib.md5()
+ while size > 0:
+ toread = chunk_size
+ if size < chunk_size:
+ toread = size
+ chunk = file_handle.read(toread)
+ size = size - len(chunk)
+ md5.update(chunk)
+ file_handle.close()
+ return md5.hexdigest()
+
+def read_symbian_policy_content(filename):
+ """ Read the policy category from the policy file. """
+ value = None
+ error = ""
+ try:
+ LOGGER.debug('Opening symbian policy file: ' + filename)
+ try:
+ fileh = codecs.open(filename, 'r', 'ascii')
+ except:
+ raise Exception("Error loading '%s' as an ASCII file." % filename)
+ for line in fileh:
+ match = re.match(r'^Category\s+([A-Z])\s*$', line, re.M|re.DOTALL)
+ if match != None:
+ value = match.group(1)
+ fileh.close()
+ return value
+ fileh.close()
+ if match == None:
+ error = "Content of '%s' doesn't match r'^Category\s+([A-Z])\s*$'." % filename
+ except Exception, exc:
+ error = str(exc)
+ if value is not None:
+ return value
+ # worse case....
+ raise Exception(error)
+
+
+class LockFailedException(Exception):
+ """ This class is used to indicate the failure in obtaining a Lock. """
+ pass
+
+if os.name == 'nt':
+ import win32file
+ import win32con
+ import winerror
+ import time
+ import win32netcon
+ import win32wnet
+
+ class Lock:
+ """ This object implement file locking for windows. """
+
+ def __init__(self, filename):
+ LOGGER_LOCK.debug("__init__")
+ self._filename = filename
+ self.f_desc = None
+
+ def lock(self, wait=False):
+ """lock the file"""
+ LOGGER_LOCK.debug("lock")
+ # Open the file
+ if self.f_desc == None:
+ self.f_desc = open(self._filename, "w+")
+ wfd = win32file._get_osfhandle(self.f_desc.fileno())
+ if not wait:
+ try:
+ win32file.LockFile(wfd, 0, 0, 0xffff, 0)
+ except:
+ raise LockFailedException()
+ else:
+ while True:
+ try:
+ win32file.LockFile(wfd, 0, 0, 0xffff, 0)
+ break
+ except win32file.error, exc:
+ if exc[0] != winerror.ERROR_LOCK_VIOLATION:
+ raise exc
+ LOGGER_LOCK.debug("waiting")
+ time.sleep(1)
+
+ def unlock(self):
+ """unlock the file"""
+ LOGGER_LOCK.debug("unlock")
+ if self.f_desc == None:
+ LOGGER_LOCK.debug("already unlocked")
+ return
+ wfd = win32file._get_osfhandle(self.f_desc.fileno())
+ try:
+ # pylint: disable-msg=E1101
+ win32file.UnlockFile(wfd, 0 , 0, 0xffff, 0)
+ self.f_desc.close()
+ self.f_desc = None
+ except win32file.error, exc:
+ if exc[0] != 158:
+ raise
+
+
+ def __del__(self):
+ LOGGER_LOCK.debug("__del__")
+ self.unlock()
+
+ def rmdir(path):
+ """ Catch os.rmdir failures on Windows when path is too long (more than 256 chars)."""
+ path = win32api.GetShortPathName(path)
+ win32file.RemoveDirectory(path)
+
+ def remove(filename):
+ """ Catch os.rmdir failures on Windows when path is too long (more than 256 chars)."""
+ filename = win32api.GetShortPathName(filename)
+ filename = filename.lstrip("\\\\?\\")
+ os.remove(filename)
+
+ def mount(drive, unc, username=None, password=None, persistent=False):
+ """ Windows helper function to map a network drive. """
+ flags = 0
+ if persistent:
+ flags = win32netcon.CONNECT_UPDATE_PROFILE
+ win32wnet.WNetAddConnection2(win32netcon.RESOURCETYPE_DISK, drive, unc, None, username, password, flags)
+
+
+ def umount(drive):
+ """ Windows helper function to map a network drive. """
+ drive_type = win32file.GetDriveType(drive)
+ if drive_type == win32con.DRIVE_REMOTE:
+ win32wnet.WNetCancelConnection2(drive, win32netcon.CONNECT_UPDATE_PROFILE, 1)
+ else:
+ raise Exception("%s couldn't be umount." % drive)
+
+else:
+ def rmdir(path):
+ """remove directory"""
+ return os.rmdir(path)
+
+ def remove(path):
+ """remove the files and folders"""
+ return os.remove(path)
+
+ class Lock:
+ """ This class represents a dummy lock """
+ def __init__(self, filename):
+ pass
+ def lock(self, wait=False):
+ """lock file - do nothing """
+ pass
+ def unlock(self):
+ """un lock file -do nothing """
+ pass
+
+if os.sep == '\\':
+ def get_next_free_drive():
+ """ Return the first free drive found else it raise an exception. """
+ if os.name == 'nt':
+ drive_labels = sorted(list(set(string.ascii_uppercase) - set(win32api.GetLogicalDriveStrings())), reverse=True)
+ if len(drive_labels) != 0 :
+ return drive_labels[0] + ":"
+ raise OSError("No free drive left.")
+ if 'java' in sys.platform:
+ import java.io
+ used = []
+ for _xx in java.io.File.listRoots():
+ used.append(str(_xx).replace(':\\', ''))
+ drive_labels = sorted(list(set(string.ascii_uppercase) - set(used)), reverse=True)
+ if len(drive_labels) != 0 :
+ return drive_labels[0] + ":"
+ raise OSError("No free drive left.")
+
+ def subst(drive, path):
+ """ Substing path as a drive. """
+ path = os.path.normpath(path)
+ p_subst = subprocess.Popen("subst %s %s" % (drive, path), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ errmsg = p_subst.communicate()[0]
+ if p_subst.returncode != 0:
+ raise Exception("Error substing '%s' under '%s': %s" % (path, drive, errmsg))
+
+ def unsubst(drive):
+ """ Unsubsting the drive. """
+ p_subst = subprocess.Popen("subst /D %s" % (drive), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ errmsg = p_subst.communicate()[0]
+ if p_subst.returncode != 0:
+ raise Exception("Error unsubsting '%s': %s" % (drive, errmsg))
+
+ def getSubstedDrives():
+ """get substituted drive"""
+ driveInformation = {}
+ subStedDriveList = []
+ p_subst = subprocess.Popen("subst", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ subStedDriveList = re.split('\\n', p_subst.communicate()[0])
+ del subStedDriveList[len(subStedDriveList)-1]
+ for path in subStedDriveList:
+ subStedDrivePath = []
+ if(re.search(r'UNC', path) is not None):
+ subStedDrivePath = re.split('=>', path)
+ (drive_to_unsubst, _) = os.path.splitdrive(os.path.normpath(subStedDrivePath[0]))
+ uncPath = re.sub('UNC', r'\\', subStedDrivePath[1].strip())
+ if(uncPath != subStedDrivePath[1].strip()):
+ driveInformation[drive_to_unsubst] = uncPath
+ else:
+ subStedDrivePath = re.split('=>', path)
+ (drive_to_unsubst, _) = os.path.splitdrive(os.path.normpath(subStedDrivePath[0]))
+ driveInformation[drive_to_unsubst] = os.path.normpath(subStedDrivePath[1].strip())
+
+ return driveInformation
+
+def touch(srcdir):
+ """
+ Recursively touches all the files in the source path mentioned.
+ It does not touch the directories.
+ """
+ srcnames = os.listdir(srcdir)
+ for name in srcnames:
+ srcfname = os.path.join(srcdir, name)
+ if os.path.isdir(srcfname):
+ touch(srcfname)
+ else:
+ if os.path.exists(srcfname):
+ os.utime(srcfname, None)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/idoprep.py
--- a/buildframework/helium/sf/python/pythoncore/lib/idoprep.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/idoprep.py Sun Oct 10 15:22:15 2010 +0300
@@ -28,23 +28,9 @@
logging.basicConfig(level=logging.INFO)
_logger = logging.getLogger("check_latest_release")
-
-def validate(grace, service, product, release):
- """ Validate s60 grace server, s60 grace service, s60 grace product and
- s60 grace release are set.
- """
- if not grace:
- raise EnvironmentError("Property 's60.grace.server' is not defined.")
- if not service:
- raise EnvironmentError("Property 's60.grace.service' is not defined.")
- if not product:
- raise EnvironmentError("Property 's60.grace.product' is not defined.")
- if not release:
- raise EnvironmentError("Property 's60.grace.release' is not defined.")
-def get_s60_env_details(grace, service, product, release, rev, cachefilename, s60gracecheckmd5, s60graceusetickler):
+def get_s60_env_details(server, service, product, release, rev, cachefilename, checkmd5, usetickler):
""" Return s60 environ details """
- validate(grace, service, product, release)
revision = r'(_\d{3})?'
if rev != None:
revision = rev
@@ -53,11 +39,11 @@
_logger.info(str("Using cache file: %s" % cachefilename))
checkmd5 = False
- if s60gracecheckmd5 != None:
- checkmd5 = str(s60gracecheckmd5).lower()
+ if checkmd5 != None:
+ checkmd5 = str(checkmd5).lower()
checkmd5 = ((checkmd5 == "true") or (checkmd5 == "1") or (checkmd5 == "on"))
- branch = os.path.join(grace, service, product)
+ branch = os.path.join(server, service, product)
if not os.path.exists(branch):
raise IOError("Error occurred: Could not find directory %s" % branch)
@@ -71,7 +57,7 @@
result.append(relpath)
result.sort(reverse=True)
use_tickler = False
- tickler_validation = str(s60graceusetickler).lower()
+ tickler_validation = str(usetickler).lower()
if tickler_validation != None:
use_tickler = ((tickler_validation == "true") or (tickler_validation == "1"))
validresults = []
@@ -99,7 +85,7 @@
result = validresults
if len(result) == 0:
- raise EnvironmentError("Error finding GRACE release.")
+ raise EnvironmentError("Error finding release.")
print result[0]
return result
@@ -117,11 +103,11 @@
_logger.info("Version file not found getting new environment...")
return version
-def create_ado_mapping(sysdefconfig, adomappingfile, adoqualitymappingfile, builddrive, adoqualitydirs):
+def create_ado_mapping(sysdefconfig, adomappingfile, qualityMapping, builddrive, adoqualitydirs):
""" Creates ado mapping and ado quality mapping files """
input_ = open(sysdefconfig, 'r')
output = open(adomappingfile, 'w')
- outputquality = open(adoqualitymappingfile, 'w')
+ print "ado mapping file: %s" % adomappingfile
for sysdef in input_.readlines():
sysdef = sysdef.strip()
if len(sysdef) > 0:
@@ -139,18 +125,11 @@
else:
component = os.path.normpath(os.path.join(builddrive, location)).replace('\\','/')
print "%s=%s\n" % (sysdef, component)
- output.write("%s=%s\n" % (sysdef, component))
- if adoqualitydirs == None:
- outputquality.write("%s=%s\n" % (sysdef, component))
+ if adoqualitydirs == None or qualityMapping == 'false':
+ output.write("%s=%s\n" % (sysdef, component))
else:
for dir_ in adoqualitydirs.split(','):
if os.path.normpath(dir_) == os.path.normpath(os.path.join(builddrive, os.environ['EPOCROOT'], location)):
- outputquality.write("%s=%s\n" % (sysdef, component))
-
-
- outputquality.close()
+ output.write("%s=%s\n" % (sysdef, component))
output.close()
- input_.close()
-
-
-
+ input_.close()
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/integration/quality.py
--- a/buildframework/helium/sf/python/pythoncore/lib/integration/quality.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/integration/quality.py Sun Oct 10 15:22:15 2010 +0300
@@ -33,6 +33,7 @@
import fileutils
import pathaddition.match
import logging
+import traceback
#logging.basicConfig(level=logging.DEBUG)
_logger = logging.getLogger("integration.quality")
@@ -111,7 +112,7 @@
class PolicyValidator(object):
""" Validate policy files on a hierarchy. """
- def __init__(self, policyfiles=None, csvfile=None, ignoreroot=False, excludes=None):
+ def __init__(self, policyfiles=None, ignoreroot=False, excludes=None):
"""The constructor """
if policyfiles is None:
policyfiles = ['distribution.policy.s60']
@@ -135,7 +136,16 @@
self._ids[row[0]] = row
if row[1].lower() != "yes" and row[1].lower() != "no" and row[1].lower() != "bin":
yield ["unknownstatus", row[0], row[2]]
-
+
+ def epl_load_policy_ids(self, csvfile):
+ """ Load the icds from the CSV file for epl check."""
+ self._ids = {}
+ reader = csv.reader(open(csvfile, "rU"))
+ for row in reader:
+ if len(row)>=3 and re.match(r"^\s*\d+\s*$", row[0]):
+ if row[1].lower() == "yes" or row[1].lower() == "bin":
+ self._ids[row[0]] = row
+
def validate_content(self, filename):
""" Validating the policy file content. If it cannot be decoded,
it reports an 'invalidencoding'.
@@ -151,6 +161,20 @@
if value not in self._ids:
yield ["notinidlist", filename, value]
+ def epl_validate_content(self, filename):
+ """ Validating the policy file content for epl"""
+ value = None
+ try:
+ value = fileutils.read_policy_content(filename)
+ except IOError, exc:
+ traceback.print_exc()
+ raise exc
+ if value is not None:
+ if self._ids != None:
+ if value not in self._ids:
+ return False
+ return True
+
def find_policy(self, path):
""" find the policy file under path using filenames under the list. """
for filename in self._policyfiles:
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/log2xml.py
--- a/buildframework/helium/sf/python/pythoncore/lib/log2xml.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/log2xml.py Sun Oct 10 15:22:15 2010 +0300
@@ -174,9 +174,11 @@
print exc
-def convert(inputfile, outputfile, fulllogging=True, configuration=DEFAULT_CONFIGURATION):
+def convert(inputfile, outputfile, fulllogging=True, configuration=None):
""" Convert an input log into an XML log and write an outputfile. """
-
+ if configuration == None:
+ configuration = DEFAULT_CONFIGURATION
+
# Compiling the regexp
built_config = {}
for category in configuration.keys():
@@ -243,9 +245,11 @@
# end file
xmllog.close()
-def convert_old(inputfile, outputfile, fulllogging=True, configuration=DEFAULT_CONFIGURATION):
+def convert_old(inputfile, outputfile, fulllogging=True, configuration=None):
""" Convert an input log into an XML log and write an outputfile. """
-
+ if configuration == None:
+ configuration = DEFAULT_CONFIGURATION
+
# Compiling the regexp
built_config = {}
for category in configuration.keys():
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/nokia/gscm.py
--- a/buildframework/helium/sf/python/pythoncore/lib/nokia/gscm.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/nokia/gscm.py Sun Oct 10 15:22:15 2010 +0300
@@ -35,7 +35,7 @@
""" Runs a command and returns the result data. """
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = process.stdout.read()
- process.poll()
+ process.wait()
status = process.returncode
return (output, status)
@@ -53,9 +53,11 @@
_logger.debug("Status: %s" % status)
_logger.debug("Output: %s" % output)
if status == 0 or status == None and not ("Can't locate" in output):
+ _logger.debug("Returning output")
return output.strip()
if not 'HLM_SUBCON' in os.environ:
- raise Exception("Error retrieving get_db_path info for '%s' database.\nOUTPUT:%s" % (dbname, output.strip()))
+ _logger.debug("Raising exception")
+ raise IOError("Error retrieving get_db_path info for '%s' database.\nOUTPUT:%s" % (dbname, output.strip()))
return None
def get_db_path(dbname):
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pkg2iby.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pkg2iby.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pkg2iby.py Sun Oct 10 15:22:15 2010 +0300
@@ -52,10 +52,16 @@
atsautoexec.write(r'md c:\logs\testresults' + '\n')
atsautoexec.write(r'md c:\logs\testexecute' + '\n')
+ for _, dst, _, _ in pkgfiles:
+ (_, dstsplit) = os.path.splitdrive(dst)
+ dst_nodrive = 'atsdata' + dstsplit
+ zdst = 'z:\\' + dst_nodrive
+ atsautoexec.write(r'md ' + os.path.dirname(dst) + '\n')
+ atsautoexec.write(r'copy ' + zdst + ' ' + dst + '\n')
+
for src, dst, filetype, _ in pkgfiles:
- (_, dst) = os.path.splitdrive(dst)
- dst_nodrive = 'atsdata' + dst
- dst = r'z:\atsdata' + dst
+ (_, dstsplit) = os.path.splitdrive(dst)
+ dst_nodrive = 'atsdata' + dstsplit
myiby.write('data=' + src + ' ' + dst_nodrive + '\n')
if 'testscript' in filetype and testtype == 'tef':
atsautoexec.write('testexecute.exe ' + dst + '\n')
@@ -75,7 +81,6 @@
atsautoexec.write(r'runtests \sys\bin\atsrtestexec.bat' + '\n')
myiby.write(r'data=' + rtestexecfilename + r' \sys\bin\atsrtestexec.bat' + '\n')
-
myiby.write(r'data=' + dummyexecfilename + r' z:\dummytest.txt' + '\n')
atsautoexec.write(r'RUNTESTS z:\dummytest.txt -p')
myiby.write("#endif\n")
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/preparation.py
--- a/buildframework/helium/sf/python/pythoncore/lib/preparation.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/preparation.py Sun Oct 10 15:22:15 2010 +0300
@@ -125,6 +125,10 @@
session = self.get_session()
project = session.create(self._config.name)
+ session.home = self._config['dir']
+ path = os.path.join(session.home, project.name)
+ project.work_area(False, True, True, path=path)
+
target_dir = os.path.normpath(os.path.join(self._config['dir'], project.name))
_logger.info("Deleting snapshot under %s." % target_dir)
if os.path.exists(target_dir):
@@ -209,13 +213,9 @@
for project in self.__get_subbaselines():
self._check_object(project)
-
- try:
- if (not os.path.exists(self._config['dir'])):
- os.makedirs(self._config['dir'])
- except Exception:
- _logger.info("ERROR: Not able to create the synergy workarea %s " % (self._config['dir']))
- raise Exception("ERROR: Not able to create the synergy workarea %s" % self._config.name)
+
+ if (not os.path.exists(self._config['dir'])):
+ os.makedirs(self._config['dir'])
# checking if the purpose exists
if self._config.has_key('purpose'):
@@ -241,6 +241,10 @@
session.home = self._config['dir']
result = self.__find_project(project)
+
+ path = os.path.join(session.home, project.name)
+ project.work_area(False, True, True, path=path)
+
if (result != None):
_logger.info("Project found: '%s'" % result)
role = session.role
@@ -308,9 +312,14 @@
_logger.info("Using version: '%s'" % version)
try:
+ if (not self._config.get_boolean('use.default_wa_path', True)):
+ wa_path = self._config['dir']
+ _logger.info("Using work area path to checkout directly")
+ result = project.checkout(session.create(self._config['release']), version=version, purpose=purpose, path=wa_path)
+ else:
+ result = project.checkout(session.create(self._config['release']), version=version, purpose=purpose)
+ ccm.log_result(result, ccm.CHECKOUT_LOG_RULES, _logger)
self.__setRole(session)
- result = project.checkout(session.create(self._config['release']), version=version, purpose=purpose)
- ccm.log_result(result, ccm.CHECKOUT_LOG_RULES, _logger)
except ccm.CCMException, exc:
ccm.log_result(exc.result, ccm.CHECKOUT_LOG_RULES, _logger)
raise exc
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_archive.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_archive.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_archive.py Sun Oct 10 15:22:15 2010 +0300
@@ -266,13 +266,14 @@
content = [s.strip() for s in content]
content.sort()
- print content
if os.sep == '\\':
expected_paths = [s.strip().lower() for s in expected_paths]
else:
expected_paths = [s.strip() for s in expected_paths]
expected_paths.sort()
- print expected_paths
+
+ _logger.info("expected_paths:\n" + str("\n".join(expected_paths)))
+ _logger.info("content:\n" + str("\n".join(content)))
assert content == expected_paths
def test_split_manifest_file_unicode(self):
@@ -890,6 +891,66 @@
self.assert_(content == expectedPaths)
self.assert_(content1 == expectedPaths1)
self.assert_(content2 == expectedPaths2)
+
+ def test_split_on_uncompressed_size_enabled(self):
+ """ Testing the policy mapper with split on uncompressed size enabled. """
+ configDict = {'root.dir': root_test_dir,
+ 'temp.build.dir': os.path.abspath(os.path.join(root_test_dir, 'temp_build_files')),
+ 'archives.dir': root_test_dir,
+ 'name': 's60_policy_mapper_test',
+ 'include': 's60/',
+ 'archive.tool': '7za',
+ 'mapper': 'policy',
+ 'max.files.per.archive': '1',
+ 'split.on.uncompressed.size.enabled': 'true',
+ 'policy.csv': os.path.join(os.environ['TEST_DATA'], 'data/distribution.policy.id_status.csv'),
+ }
+ config = configuration.Configuration(configDict)
+
+ builder = archive.ArchivePreBuilder(configuration.ConfigurationSet([config]), "config", index=0)
+ manifest_file_path = builder.build_manifest(config)
+ cmds = builder.manifest_to_commands(config, manifest_file_path)
+
+ expectedPaths0 = ['s60' + os.sep + 'component_private' + os.sep + 'Distribution.Policy.S60\n']
+ expectedPaths1 = ['s60' + os.sep + 'component_private' + os.sep + 'component_private_file.txt\n']
+ expectedPaths2 = ['s60' + os.sep + 'Distribution.Policy.S60\n']
+ expectedPaths3 = ['s60' + os.sep + 'component_public' + os.sep + 'Distribution.Policy.S60\n']
+ expectedPaths4 = ['s60' + os.sep + 'component_public' + os.sep + 'component_public_file.txt\n']
+ expectedPaths5 = ['s60' + os.sep + 'missing' + os.sep + 'subdir' + os.sep + 'Distribution.Policy.S60\n']
+
+ includeFilePath0 = os.path.join(root_test_dir, 'temp_build_files/s60_policy_mapper_test_part01_1.txt')
+ includeFilePath1 = os.path.join(root_test_dir, 'temp_build_files/s60_policy_mapper_test_part02_1.txt')
+ includeFilePath2 = os.path.join(root_test_dir, 'temp_build_files/s60_policy_mapper_test_part01_0.txt')
+ includeFilePath3 = os.path.join(root_test_dir, 'temp_build_files/s60_policy_mapper_test_part02_0.txt')
+ includeFilePath4 = os.path.join(root_test_dir, 'temp_build_files/s60_policy_mapper_test_part03_0.txt')
+ includeFilePath5 = os.path.join(root_test_dir, 'temp_build_files/s60_policy_mapper_test_part04_0.txt')
+
+ with open(includeFilePath0) as f_file:
+ content0 = f_file.readlines()
+ with open(includeFilePath1) as f_file:
+ content1 = f_file.readlines()
+ with open(includeFilePath2) as f_file:
+ content2 = f_file.readlines()
+ with open(includeFilePath3) as f_file:
+ content3 = f_file.readlines()
+ with open(includeFilePath4) as f_file:
+ content4 = f_file.readlines()
+ with open(includeFilePath5) as f_file:
+ content5 = f_file.readlines()
+
+ print "content0: ", content0
+ print "content1: ", content1
+ print "content2: ", content2
+ print "content3: ", content3
+ print "content4: ", content4
+ print "content5: ", content5
+
+ self.assert_(content0 == expectedPaths0 or content0 == expectedPaths1)
+ self.assert_(content1 == expectedPaths1 or content1 == expectedPaths0)
+ self.assert_(content2 == expectedPaths2)
+ self.assert_(content3 == expectedPaths3 or content3 == expectedPaths4)
+ self.assert_(content4 == expectedPaths4 or content4 == expectedPaths3)
+ self.assert_(content5 == expectedPaths5)
class CheckRootDirValueTest(unittest.TestCase):
"""test root drive value"""
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats3.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats3.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats3.py Sun Oct 10 15:22:15 2010 +0300
@@ -20,7 +20,6 @@
#===============================================================================
""" Testing ATS3 framework. """
-# pylint: disable=E1101,C0302,w0142,w0603,R0912,R0902,R0903,R0201,W0404, R0915
#w0142 => * and ** were used
#w0603 => global variables used TSRC_PATH etc
#R* => will be fixed while refactoring
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats3_aste.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats3_aste.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats3_aste.py Sun Oct 10 15:22:15 2010 +0300
@@ -20,8 +20,6 @@
#===============================================================================
""" Testing ATS3 ASTE framework. """
-
-# pylint: disable=W0603,W0142,R0903,R0911,R0912,R0902,R0901,R0201
# pylint: disable=E1101
#E1101 => Mocker shows mockery
#R* remove during refactoring
@@ -61,6 +59,7 @@
self.__dict__.update(kwargs)
+# pylint: disable=R0911
def equal_xml(xml1, xml2):
"""Check the equality of the given XML snippets.
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats4.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats4.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats4.py Sun Oct 10 15:22:15 2010 +0300
@@ -20,7 +20,6 @@
#===============================================================================
""" Testing ats4 framework. """
-# pylint: disable=E1101, C0302, W0142, W0603, R0902,R0903,R0912,R0915
#E1101 => Mocker shows mockery
#C0302 => too many lines
#W0142 => used * or ** magic
@@ -271,6 +270,11 @@
TestReportFileName= TestReport
TestReportFormat= TXT # Possible values: TXT or HTML
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+[New_Module]
+ModuleName= testscripter
""")
@@ -294,7 +298,7 @@
assert params[0].get("value") == "writefile"
assert params[1].get("value") == path(r"z:\sys\bin\ctcman.exe")
-def check_ctc_log(steps, testtype=""):
+def check_ctc_log(steps):
"""Fetches CTC Log"""
#For the ctcdata.txt to be published on the ATS network drive
step = steps.next()
@@ -772,6 +776,7 @@
mocker.expect(test_plan["report_email"]).result(self.report_email)
mocker.expect(test_plan["ctc_run_process_params"]).result(self.ctc_run_process_params)
mocker.expect(test_plan["report_type"]).result("")
+ mocker.expect(test_plan["file_store"]).result("")
if self.trace_enabled.lower() == "true":
mocker.expect(test_plan["trace_enabled"]).result("True")
@@ -937,6 +942,20 @@
assert params[0].get("value") == "*"
assert params[1].get("value") == "60"
assert params[2].get("value") == "c:\\testframework\\" + ntpath.basename(self.engine_ini_file)
+ step = steps.next()
+ assert step.findtext("./type") == "StifRunCasesTask"
+ params = step.findall("./parameters/parameter")
+ assert params[0].get("value") == "TESTSCRIPTER"
+ assert params[1].get("value") == "*"
+ assert params[2].get("value") == "60"
+ assert params[3].get("value") == r"e:\testing\conf\file1.cfg"
+ step = steps.next()
+ assert step.findtext("./type") == "StifRunCasesTask"
+ params = step.findall("./parameters/parameter")
+ assert params[0].get("value") == "TESTSCRIPTER"
+ assert params[1].get("value") == "*"
+ assert params[2].get("value") == "60"
+ assert params[3].get("value") == r"e:\testing\conf\file2.cfg"
def test_steps_trace_enabled(self):
""" Test steps trace enabled. """
@@ -1113,8 +1132,9 @@
self.custom_files = None
self.component_path = None
self.ctc_run_process_params = None
+ self.ats_stf_enabled = None
- def generate_xml(self, harness, trace_enabled="False"):
+ def generate_xml(self, harness, trace_enabled="False", tef_test_module=None, ats_stf_enabled="False"):
"""Generates XML"""
def files(*paths):
"""generates paths for the files"""
@@ -1125,6 +1145,59 @@
self.config_files = files("conf/file1.cfg", "conf/file2.cfg")
self.testmodule_files = files("testmodules/file1.dll", "testmodules/file2.dll")
self.image_files = files("output/images/file1.fpsx", "output/images/file2.fpsx")
+ if tef_test_module:
+ TEST_PATH.joinpath(r"tsrc" + os.sep + "init" + os.sep + "TestFramework.ini").write_text(
+ r"""
+# - Sets a device reset module's dll name(Reboot).
+# + If Nokia specific reset module is not available or it is not correct one
+# StifHWResetStub module may use as a template for user specific reset
+# module.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
+ 'TestCases' or 'FullReport'
+
+CreateTestReport= YES # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT # Possible values: TXT or HTML
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+[New_Module]
+ModuleName= teftestmodule
+
+ """)
+ else:
+ TEST_PATH.joinpath(r"tsrc" + os.sep + "init" + os.sep + "TestFramework.ini").write_text(
+ r"""
+# - Sets a device reset module's dll name(Reboot).
+# + If Nokia specific reset module is not available or it is not correct one
+# StifHWResetStub module may use as a template for user specific reset
+# module.
+
+[Engine_Defaults]
+
+TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
+ 'TestCases' or 'FullReport'
+
+CreateTestReport= YES # Possible values: YES or NO
+
+TestReportFilePath= C:\LOGS\TestFramework\
+TestReportFileName= TestReport
+
+TestReportFormat= TXT # Possible values: TXT or HTML
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+[New_Module]
+ModuleName= testscripter
+
+ """)
+
self.engine_ini_file = files("init/TestFramework.ini")[0]
self.report_email = "test.receiver@company.com"
self.file_store = path("path/to/reports")
@@ -1133,6 +1206,7 @@
self.pmd_files = TEST_FILES["pmd_file"]
self.trace_activation_files = files("trace_init/trace_activation_1.xml")
self.ctc_enabled = "True"
+ self.ats_stf_enabled = ats_stf_enabled
self.eunitexerunner_flags = "/E S60AppEnv /R Off"
self.custom_dir = "custom"
self.custom_files = files("custom/postpostaction.xml", "custom/prepostaction.xml")
@@ -1184,11 +1258,13 @@
mocker.expect(test_plan["device_hwid"]).result("5425")
mocker.expect(test_plan["trace_enabled"]).result(self.trace_enabled)
mocker.expect(test_plan["ctc_enabled"]).result(self.ctc_enabled)
+ mocker.expect(test_plan["ats_stf_enabled"]).result(self.ats_stf_enabled)
mocker.expect(test_plan["custom_dir"]).result("custom1A")
mocker.expect(test_plan.custom_dir).result(path(r"self.custom_dir"))
mocker.expect(test_plan["ctc_run_process_params"]).result(self.ctc_run_process_params)
mocker.expect(test_plan["report_email"]).result(self.report_email)
mocker.expect(test_plan["report_type"]).result("")
+ mocker.expect(test_plan["file_store"]).result("")
if self.trace_enabled == "False":
mocker.expect(test_plan.sets).result([
dict(name="set0", image_files=self.image_files, data_files=self.data_files,
@@ -1314,7 +1390,7 @@
self.check_install_step(steps, "EUNIT", set_count="1")
self.check_run_cases(steps, "EUNIT")
check_ctc_write(steps)
- check_ctc_log(steps, "withpkgfiles")
+ check_ctc_log(steps)
check_fetch_logs(steps, "EUNIT")
else:
self.check_install_step(steps, thar)
@@ -1322,6 +1398,66 @@
check_ctc_write(steps)
check_ctc_log(steps)
check_fetch_logs(steps, thar)
+
+ def test_case_steps_teftestmodule(self):
+ """Checks cases in steps in the test.xml file for TEFTESTMODULE"""
+ test_harness = ["STIF", "EUNIT", "MULTI_HARNESS"]
+ for thar in test_harness:
+ xml = self.generate_xml(thar, tef_test_module=True, ats_stf_enabled="True")
+ #print et.tostring(xml.getroot())
+ steps = iter(xml.findall(".//task"))
+ steps.next() # Flash images
+ check_ctc_start(steps)
+ check_log_dir(steps)
+ if "MULTI_HARNESS" in thar:
+ self.check_install_step(steps, "STIF")
+ self.check_run_cases(steps, "STIF", tef_test_module=True, ats_stf_enabled="True")
+ check_ctc_write(steps)
+ check_ctc_log(steps)
+ check_fetch_logs(steps, "STIF")
+
+ steps.next() # Flash images
+ check_ctc_start(steps)
+ check_log_dir(steps)
+ self.check_install_step(steps, "EUNIT", set_count="1")
+ self.check_run_cases(steps, "EUNIT")
+ check_ctc_write(steps)
+ check_ctc_log(steps)
+ check_fetch_logs(steps, "EUNIT")
+ else:
+ self.check_install_step(steps, thar)
+ self.check_run_cases(steps, thar, tef_test_module=True)
+ check_ctc_write(steps)
+ check_ctc_log(steps)
+ check_fetch_logs(steps, thar)
+ for thar in test_harness:
+ xml = self.generate_xml(thar, tef_test_module=True)
+ #print et.tostring(xml.getroot())
+ steps = iter(xml.findall(".//task"))
+ steps.next() # Flash images
+ check_ctc_start(steps)
+ check_log_dir(steps)
+ if "MULTI_HARNESS" in thar:
+ self.check_install_step(steps, "STIF")
+ self.check_run_cases(steps, "STIF", tef_test_module=True)
+ check_ctc_write(steps)
+ check_ctc_log(steps)
+ check_fetch_logs(steps, "STIF")
+
+ steps.next() # Flash images
+ check_ctc_start(steps)
+ check_log_dir(steps)
+ self.check_install_step(steps, "EUNIT", set_count="1")
+ self.check_run_cases(steps, "EUNIT")
+ check_ctc_write(steps)
+ check_ctc_log(steps)
+ check_fetch_logs(steps, "EUNIT")
+ else:
+ self.check_install_step(steps, thar)
+ self.check_run_cases(steps, thar, tef_test_module=True)
+ check_ctc_write(steps)
+ check_ctc_log(steps)
+ check_fetch_logs(steps, thar)
def check_install_step(self, steps, harness, set_count="0"):
"""Checks install steps in the test.xml file"""
@@ -1348,7 +1484,7 @@
assert ntpath.basename(dst) == filename
assert ntpath.dirname(dst) == drive + "\\sys\\bin"
- def check_run_cases(self, steps, harness="STIF"):
+ def check_run_cases(self, steps, harness="STIF", tef_test_module=None, ats_stf_enabled="False"):
"""Checks run cases in the test.xml file"""
step = steps.next()
if harness == "STIF":
@@ -1358,6 +1494,45 @@
assert params[0].get("value") == "*"
assert params[1].get("value") == "60"
assert params[2].get("value") == "c:\\sys\\bin\\" + ntpath.basename(self.engine_ini_file)
+ step = steps.next()
+ assert step.findtext("./type") == "StifRunCasesTask"
+ params = step.findall("./parameters/parameter")
+ assert params[0].get("value") == "file1.dll"
+ assert params[1].get("value") == "*"
+ assert params[2].get("value") == "60"
+ step = steps.next()
+ assert step.findtext("./type") == "StifRunCasesTask"
+ params = step.findall("./parameters/parameter")
+ assert params[0].get("value") == "file2.dll"
+ assert params[1].get("value") == "*"
+ assert params[2].get("value") == "60"
+ step = steps.next()
+ assert step.findtext("./type") == "StifRunCasesTask"
+ params = step.findall("./parameters/parameter")
+ if tef_test_module:
+ assert params[0].get("value") == "teftestmodule"
+ else:
+ assert params[0].get("value") == "TESTSCRIPTER"
+ assert params[1].get("value") == "*"
+ assert params[2].get("value") == "60"
+ assert params[3].get("value") == r"c:\sys\bin\file1.cfg"
+ if tef_test_module and ats_stf_enabled.lower() == "true":
+ assert params[4].get("value") == r"c:\spd_logs\xml\teftestmodule.xml"
+
+ step = steps.next()
+ assert step.findtext("./type") == "StifRunCasesTask"
+ params = step.findall("./parameters/parameter")
+ if tef_test_module:
+ assert params[0].get("value") == "teftestmodule"
+ else:
+ assert params[0].get("value") == "TESTSCRIPTER"
+ assert params[1].get("value") == "*"
+ assert params[2].get("value") == "60"
+ assert params[3].get("value") == r"c:\sys\bin\file2.cfg"
+ if tef_test_module and ats_stf_enabled.lower() == "true":
+ assert params[4].get("value") == r"c:\spd_logs\xml\teftestmodule.xml"
+
+
elif harness == "EUNIT":
_ = self.testmodule_files[0]
assert step.findtext("./type") == "EUnitTask"
@@ -1569,6 +1744,7 @@
mocker.expect(test_plan["ctc_run_process_params"]).result(self.ctc_run_process_params)
mocker.expect(test_plan["report_email"]).result(self.report_email)
mocker.expect(test_plan["report_type"]).result("")
+ mocker.expect(test_plan["file_store"]).result("")
mocker.expect(test_plan.sets).result([
dict(name="set0", image_files=self.image_files, sis_files=self.sis_files,
engine_ini_file=self.engine_ini_file, test_harness=self.harness, ctc_enabled="False", component_path=self.component_path, custom_dir=None),
@@ -1613,6 +1789,7 @@
assert params[-1].get("value") == "c:\\testframework\\" + ntpath.basename(filename)
def test_ats_sut():
+ """Test SymbianUnitTest"""
opts = Bunch(file_store='', flash_images='', diamonds_build_url='', testrun_name='', device_type='', report_email='', test_timeout='', drop_file='', config_file='', target_platform='', data_dir='', build_drive='', sis_files='', harness='', trace_enabled='', specific_pkg='', ats4_enabled='true', device_hwid='')
test_plan = ats3.Ats3TestPlan(opts)
@@ -1631,4 +1808,4 @@
step = steps.next()
assert step.findtext("./type") == "SymbianUnitTestTask"
params = step.findall("./parameters/parameter")
- assert params[1].get("value") == r"-tests=c:\sys\bin\file1.dll -noprompt"
\ No newline at end of file
+ assert params[1].get("value") == r"-tests=c:\sys\bin\file1.dll -noprompt"
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats4_aste.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats4_aste.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_ats4_aste.py Sun Oct 10 15:22:15 2010 +0300
@@ -21,7 +21,6 @@
""" Testing ATS4 ASTE framework. """
-# pylint: disable=E1101, R0903, R0911, R0912, W0603, W0142, R0902, R0201
#E1101 => Mocker shows mockery
#C0302 => too many lines
#W0142 => used * or ** magic
@@ -44,6 +43,8 @@
import ats3.aste
+import pythoncorecpythontests.test_ats3_aste
+
TEST_PATH = None
TEST_FILES = {}
TEST_ASSET_FILES = {}
@@ -63,75 +64,7 @@
self.__dict__.update(kwargs)
def equal_xml(xml1, xml2):
- """Check the equality of the given XML snippets.
-
- Tag name equality:
-
- >>> equal_xml(' ', ' ')
- True
- >>> equal_xml(' ', ' ')
- False
-
- Attribute equality:
-
- >>> equal_xml(' ', ' ')
- True
- >>> equal_xml(' ', ' ')
- False
-
- Text content equality:
-
- >>> equal_xml('v ', 'v ')
- True
- >>> equal_xml('v ', 'w ')
- False
- >>> equal_xml('v ', ' ')
- False
-
- Text content equality when whitespace differs:
- >>> equal_xml('v ', 'v ')
- True
-
- Equality of child elements:
-
- >>> equal_xml(' ', ' ')
- True
- >>> equal_xml(' ', ' ')
- False
- >>> equal_xml(' v ', ' w ')
- False
- >>> equal_xml(' v ', ' v ')
- True
-
- """
- if isinstance(xml1, basestring):
- xml1 = fromstring(xml1)
- if isinstance(xml2, basestring):
- xml2 = fromstring(xml2)
- if xml1.tag != xml2.tag:
- return False
- if xml1.attrib != xml2.attrib:
- return False
- if xml1.text:
- if not xml2.text:
- return False
- if xml2.text:
- if not xml1.text:
- return False
- if xml1.text and xml2.text and xml1.text.strip() != xml2.text.strip():
- return False
- if xml1.tail is not None and xml2.tail is not None:
- if xml1.tail.strip() != xml2.tail.strip():
- return False
- elif xml1.tail != xml2.tail:
- return False
- children1 = list(xml1.getchildren())
- children2 = list(xml2.getchildren())
- if len(children1) != len(children2):
- return False
- for child1, child2 in zip(children1, children2):
- return equal_xml(child1, child2)
- return True
+ return pythoncorecpythontests.test_ats3_aste.equal_xml(xml1, xml2)
def setup_module():
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_atsconfigparser.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_atsconfigparser.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_atsconfigparser.py Sun Oct 10 15:22:15 2010 +0300
@@ -100,3 +100,64 @@
self.assert_( ' ' in output)
self.assert_( ' ' not in output)
self.assert_( ' ' in output)
+
+
+ def test_converttestxml_ats4(self):
+ spectext = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+ testxmldataats4 = """
+
+ mybuild
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ """
+
+ (file_descriptor, filename) = tempfile.mkstemp()
+ file_handle = os.fdopen(file_descriptor, 'w')
+ file_handle.write(spectext)
+ file_handle.close()
+
+ output = ats3.atsconfigparser.converttestxml(filename, testxmldataats4)
+ os.remove(filename)
+
+ self.assert_( ' ' in output)
+ self.assert_( ' ' in output)
+ self.assert_( ' ' not in output)
+ self.assert_( ' ' in output)
+ self.assert_( ' ' not in output)
+ self.assert_( ' ' in output)
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_bootup_testing.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_bootup_testing.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,147 @@
+# -*- coding: latin-1 -*-
+
+#============================================================================
+#Name : test_bootup_testing.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+""" Testing Bootup tests framework. """
+
+# pylint: disable=E1101
+
+import logging
+logging.getLogger().setLevel(logging.INFO)
+import os
+#import shutil
+from path import path
+import ats3.bootup_testing
+import tempfile
+import zipfile
+import platform
+
+TEST_PATH = None
+TEST_FILES = {}
+OUTPUT = None
+TOTAL_TESTS_COUNT = 3
+
+
+class Bunch(object):
+ """ Configuration object. Argument from constructor are converted into class attributes. """
+ def __init__(self, **kwargs):
+ self.__dict__.update(kwargs)
+
+class SetUp(object):
+ """ Setup the module. """
+
+ def __init__(self):
+ """ Setup test environment. """
+ global TEST_PATH, OUTPUT
+
+ TEST_PATH = path(tempfile.mkdtemp())
+ component = TEST_PATH
+ component.joinpath("ats_build_drive").makedirs()
+ for path_parts in (("output", "images", "image1.fpsx"),
+ ("output", "images", "image2.fpsx"),
+ ("output", "ats", "temp.txt")):
+ filepath = component.joinpath(*path_parts)
+ if not filepath.parent.exists():
+ filepath.parent.makedirs()
+ filepath.touch()
+ TEST_FILES.setdefault(path_parts[1], []).append(filepath)
+
+ OUTPUT = component.joinpath(r"output")
+
+ if not filepath.parent.exists():
+ filepath.parent.makedirs()
+ filepath.touch()
+
+
+def teardown_module(test_run_count):
+ """ stuff to do after running the tests """
+
+ if test_run_count == 0:
+ path(TEST_PATH).rmtree()
+
+class TestBootupTestPlan(SetUp):
+ """ test BootupTestDrop.py """
+
+ def __init__(self):
+ """initialize bootup Tests"""
+ SetUp.__init__(self)
+ self.file_store = OUTPUT
+ self.build_drive = "j:"
+ self.drop_file = path(r"%s/ats/ATSBootupDrop.zip" %OUTPUT).normpath()
+
+ image_files = r"%s/images/image1.fpsx, %s/images/image2.fpsx " % (OUTPUT, OUTPUT)
+ self.flash_images = image_files
+ self.config = None
+
+ def read_xml(self, file_location, zip_file=False):
+ """reads test.xml file if a path is given"""
+
+ xml_text = ""
+ file_location = path(file_location)
+ if zip_file:
+ if zipfile.is_zipfile(file_location):
+ myzip = zipfile.ZipFile(file_location, 'r')
+ xml_text = myzip.read('test.xml')
+ myzip.close()
+
+ else:
+ hnd = open(file_location, 'r')
+ for line in hnd.readlines():
+ xml_text = xml_text + line
+
+ return xml_text
+
+ def test_xml_file(self):
+ """ test bootup_testing.py generates correct test.xml file"""
+ global TOTAL_TESTS_COUNT
+ opts = Bunch(build_drive=self.build_drive,
+ drop_file=path(r"%s/ats/ATSBootupDrop.zip" %OUTPUT).normpath(),
+ flash_images=self.flash_images,
+ template_loc="",
+ file_store=self.file_store,
+ report_email="firstname.lastname@domain.com",
+ testrun_name="Bootup test run",
+ alias_name="alias",
+ device_type="new_device",
+ diamonds_build_url="http://diamonds.com/1234",
+ email_format="simplelogger",
+ email_subject="Bootup test report",
+ verbose="false")
+
+ self.config = ats3.bootup_testing.Configuration(opts)
+ ats3.bootup_testing.create_drop(self.config)
+
+ xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/bootup_testing/test_bootup.xml')
+ stored_xml = self.read_xml(xml_loc, False).strip()
+ drop_loc = os.path.join(OUTPUT, 'ats/ATSBootupDrop.zip')
+ generated_xml = self.read_xml(drop_loc, True).strip()
+
+ if platform.system().lower() == "linux":
+ assert stored_xml.replace('\r', '') in generated_xml
+ else:
+ assert stored_xml in generated_xml
+
+ TOTAL_TESTS_COUNT -= 1
+ teardown_module(TOTAL_TESTS_COUNT)
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_buildmodel.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_buildmodel.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_buildmodel.py Sun Oct 10 15:22:15 2010 +0300
@@ -77,7 +77,7 @@
class BOMTest(unittest.TestCase):
""" Test BOM and related classes. """
-# TODO - removed until non-Synergy dependent tests can be provided.
+# Removed until non-Synergy dependent tests can be provided.
# def test_bom_output(self):
# """ Test basic BOM execution. Only new spec format will be covered!"""
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_logger.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_logger.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_logger.py Sun Oct 10 15:22:15 2010 +0300
@@ -21,6 +21,7 @@
import logging
import os
import unittest
+import urllib2
import helium.logger
import helium.outputer
@@ -88,10 +89,13 @@
mclogger.WriteToFile('log.xml')
_logger.info(mclogger)
-
- out = helium.outputer.XML2XHTML('log.xml')
- out.generate()
- out.WriteToFile('log.html')
+
+ try:
+ out = helium.outputer.XML2XHTML('log.xml')
+ out.generate()
+ out.WriteToFile('log.html')
+ except urllib2.URLError, e:
+ _logger.warning('Test cannont run properly as the configuration url cannot be accessed properly.')
os.unlink('log.xml')
os.unlink('log.html')
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_matti.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_matti.py Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-# -*- coding: latin-1 -*-
-
-#============================================================================
-#Name : test_matti.py
-#Part of : Helium
-
-#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-#All rights reserved.
-#This component and the accompanying materials are made available
-#under the terms of the License "Eclipse Public License v1.0"
-#which accompanies this distribution, and is available
-#at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-#Initial Contributors:
-#Nokia Corporation - initial contribution.
-#
-#Contributors:
-#
-#Description:
-#===============================================================================
-
-""" Testing MATTI framework. """
-
-# pylint: disable=E1101
-
-import logging
-logging.getLogger().setLevel(logging.ERROR)
-import os
-#import shutil
-from path import path
-import ats3.aste
-import ats3.matti.MattiDrops
-import tempfile
-
-TEST_FILE_NAME = 'test.xml'
-ZIP_FILE_NAME = os.path.join(tempfile.mkdtemp(), 'MATTIDrop.zip')
-
-class Bunch(object):
- """do something with the paramerters passed to it"""
- def __init__(self, **kwargs):
- self.__dict__.update(kwargs)
-
-
-def equal_xml(result, expect):
- """Check the equality of the given XML snippets. """
-# logging.info(" expect %s" % expect)
-# xml1 = objectify.fromstring(expect)
-# expect1 = etree.tostring(xml1)
-# logging.info(" expect1 %s" % expect1)
-# logging.info(" expect2 -------------%s" % expect2)
-#
-# xml2 = objectify.fromstring(result)
-# result2 = etree.tostring(xml2)
-# self.assertEquals(expect1, result1)
-#
-# if xml1.tag != xml2.tag:
-# return False
-# if xml1.attrib != xml2.attrib:
-# return False
-# if xml1.text:
-# if not xml2.text:
-# return False
-# if xml2.text:
-# if not xml1.text:
-# return False
-# if xml1.text and xml2.text and xml1.text.strip() != xml2.text.strip():
-# return False
-# if xml1.tail is not None and xml2.tail is not None:
-# if xml1.tail.strip() != xml2.tail.strip():
-# return False
-# elif xml1.tail != xml2.tail:
-# return False
-# children1 = list(xml1.getchildren())
-# children2 = list(xml2.getchildren())
-# if len(children1) != len(children2):
-# return False
-# for child1, child2 in zip(children1, children2):
-# return equal_xml(child1, child2)
-# return True
- if expect:
- return result
-
-
-def setup_module():
- """ stuff to do before running the tests """
- pass
-
-def teardown_module():
- """ stuff to do after running the tests """
- if os.path.exists(TEST_FILE_NAME):
- os.remove(TEST_FILE_NAME)
- if os.path.exists(ZIP_FILE_NAME):
- os.remove(ZIP_FILE_NAME)
-
-
-class TestPlanMatti():
- """ test MattiDrop.py """
- def __init__(self):
- self.config = None
- self.tp_result = None
-
- (_, self.image1) = tempfile.mkstemp()
- (_, self.image2) = tempfile.mkstemp()
- (_, self.image3) = tempfile.mkstemp()
- (_, self.sis1) = tempfile.mkstemp()
- (_, self.sis2) = tempfile.mkstemp()
-
- def test_all_present(self):
- """ test mattiDrops.py with all parameters present and correct"""
- teardown_module()
- opts = Bunch(build_drive="z:",
- matti_scripts=os.path.join(os.environ['TEST_DATA'], 'data/matti'),
- flash_images = '%s,%s,%s' % (self.image1, self.image2, self.image3),
- report_email="", harness="STIF",
- file_store=path(), testrun_name="testrun",
- device_type="product", device_hwid="5425", diamonds_build_url="", drop_file=ZIP_FILE_NAME,
- minimum_flash_images="2", plan_name="matti_test_plan",
- sis_files = '%s,%s' % (self.sis1, self.sis2),
- template_loc=os.path.join(os.path.dirname(__file__), '../ats3/matti/template/matti_demo.xml'),
- test_timeout="60", verbose="false")
-
- self.config = ats3.matti.MattiDrops.Configuration(opts)
- self.tp_result = ats3.matti.MattiDrops.create_drop(self.config)
- assert os.path.exists(ZIP_FILE_NAME)
- assert os.path.exists(TEST_FILE_NAME)
- #shutil.copy(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_all_present.xml'))
- #equal_xml(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_all_present.xml'))
-
- def test_no_sis_or_flash_files(self):
- """test mattiDrops.py with no sis or flash files in the parameters"""
- teardown_module()
- opts = Bunch(build_drive="z:",
- matti_scripts=os.path.join(os.environ['TEST_DATA'], 'data/matti'),
- flash_images = "",
- report_email="", harness="STIF",
- file_store=path(), testrun_name="testrun",
- device_type="product", device_hwid="5425", diamonds_build_url="", drop_file=ZIP_FILE_NAME,
- minimum_flash_images="2", plan_name="matti_test_plan",
- sis_files= "",
- template_loc=os.path.join(os.path.dirname(__file__), '../ats3/matti/template/matti_demo.xml'),
- test_timeout="60", verbose="true")
-
- self.config = ats3.matti.MattiDrops.Configuration(opts)
- self.tp_result = ats3.matti.MattiDrops.create_drop(self.config)
- assert os.path.exists(ZIP_FILE_NAME)
- assert os.path.exists(TEST_FILE_NAME)
- #shutil.copy(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_no_sis_or_flash.xml'))
- #equal_xml(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_no_sis_or_flash.xml'))
-
-
- def test_no_files(self):
- """ test mattiDtops.py with no filespresent at all"""
- teardown_module()
- opts = Bunch(build_drive="z:",
- matti_scripts=tempfile.mkdtemp(),
- flash_images = "",
- report_email="", harness="STIF",
- file_store=path(), testrun_name="testrun",
- device_type="product", device_hwid="5425", diamonds_build_url="", drop_file=ZIP_FILE_NAME,
- minimum_flash_images="2", plan_name="matti_test_plan",
- sis_files= "",
- template_loc=os.path.join(os.path.dirname(__file__), '../ats3/matti/template/matti_demo.xml'),
- test_timeout="60", verbose="true")
- self.config = ats3.matti.MattiDrops.Configuration(opts)
- self.tp_result = ats3.matti.MattiDrops.create_drop(self.config)
- assert not os.path.exists(ZIP_FILE_NAME)
- assert os.path.exists(TEST_FILE_NAME)
- #shutil.copy(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_no_files.xml'))
- #equal_xml(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_no_files.xml'))
-
- def test_no_params(self):
- """test MattiDrops.py with no parameters present at all"""
- teardown_module()
- opts = Bunch(build_drive="",
- matti_scripts="",
- flash_images = "",
- report_email="", harness="",
- file_store="", testrun_name="",
- device_type="", device_hwid="", diamonds_build_url="", drop_file="",
- minimum_flash_images="", plan_name="",
- sis_files= "",
- template_loc="",
- test_timeout="", verbose="true")
-
- self.config = ats3.matti.MattiDrops.Configuration(opts)
- self.tp_result = ats3.matti.MattiDrops.create_drop(self.config)
- assert not os.path.exists(ZIP_FILE_NAME)
- assert not os.path.exists(TEST_FILE_NAME)
-
- def test_some_not_present(self):
- """ test MattiDrops.py with an extra file not present in the dir"""
- teardown_module()
- opts = Bunch(build_drive="z:",
- matti_scripts=os.path.join(os.environ['TEST_DATA'], 'data/matti'),
- flash_images = '%s,%s,%s' % (self.image1, self.image2, self.image3),
- report_email="", harness="STIF",
- file_store=path(), testrun_name="testrun",
- device_type="product", device_hwid="5425", diamonds_build_url="", drop_file=ZIP_FILE_NAME,
- minimum_flash_images="2", plan_name="matti_test_plan",
- sis_files = '%s,%s' % (self.sis1, self.sis2),
- template_loc=os.path.join(os.path.dirname(__file__), '../ats3/matti/template/matti_demo.xml'),
- test_timeout="60", verbose="false")
-
- self.config = ats3.matti.MattiDrops.Configuration(opts)
- self.tp_result = ats3.matti.MattiDrops.create_drop(self.config)
- assert os.path.exists(ZIP_FILE_NAME)
- assert os.path.exists(TEST_FILE_NAME)
- #shutil.copy(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_some_not_present.xml'))
- #equal_xml(TEST_FILE_NAME, os.path.join(TMPDIR, 'test_some_not_present.xml'))
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_matti2.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_matti2.py Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,294 +0,0 @@
-# -*- coding: latin-1 -*-
-
-#============================================================================
-#Name : test_matti2.py
-#Part of : Helium
-
-#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-#All rights reserved.
-#This component and the accompanying materials are made available
-#under the terms of the License "Eclipse Public License v1.0"
-#which accompanies this distribution, and is available
-#at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-#Initial Contributors:
-#Nokia Corporation - initial contribution.
-#
-#Contributors:
-#
-#Description:
-#===============================================================================
-
-""" Testing MATTI framework. """
-
-# pylint: disable=E1101
-
-import logging
-logging.getLogger().setLevel(logging.INFO)
-import os
-#import shutil
-from path import path
-import ats3.matti2
-import tempfile
-import zipfile
-import platform
-
-TEST_PATH = None
-TEST_FILES = {}
-MATTI = None
-OUTPUT = None
-SISFILES = None
-TOTAL_TESTS_COUNT = 3
-
-
-class Bunch(object):
- """ Configuration object. Argument from constructor are converted into class attributes. """
- def __init__(self, **kwargs):
- self.__dict__.update(kwargs)
-
-class SetUp(object):
- """ Setup the module. """
-
- def __init__(self):
- """ Setup test environment. """
- global TEST_PATH, MATTI, OUTPUT, SISFILES
-
- TEST_PATH = path(tempfile.mkdtemp())
- component = TEST_PATH
- component.joinpath("matti").makedirs()
- for path_parts in (("matti_testcases", "profile", "all.sip"),
- ("matti_testcases", "profile", "bat.sip"),
- ("matti_testcases", "profile", "fute.sip"),
- ("matti_testcases", "hwdata", "paths.pkg"),
- ("matti_testcases", "hwdata", "file1.txt"),
- ("matti_testcases", "hwdata", "settings.ini"),
- ("matti_testcases", "matti_parameters", "matti_parameters.xml"),
- ("matti_testcases", "unit_test1.rb"),
- ("matti_testcases", "unit_test2.rb"),
- ("output", "images", "image1.fpsx"),
- ("output", "images", "image2.fpsx"),
- ("sisfiles", "abc.sis"),
- ("sisfiles", "xyz.sis"),
- ("output", "ats", "temp.txt")):
- filepath = component.joinpath(*path_parts)
- if not filepath.parent.exists():
- filepath.parent.makedirs()
- filepath.touch()
- TEST_FILES.setdefault(path_parts[1], []).append(filepath)
-
- OUTPUT = component.joinpath(r"output")
- MATTI = component.joinpath("matti_testcases")
- SISFILES = component.joinpath(r"sisfiles")
-
- if not filepath.parent.exists():
- filepath.parent.makedirs()
- filepath.touch()
-
- #mtc => matti_testcases
- mtc = component.joinpath("matti_testcases")
- mtc.joinpath("unit_test1.rb").write_text("unit_tests")
- mtc.joinpath("unit_test2.rb").write_text("unit_tests")
-
- # profiles
- profiles = component.joinpath("matti_testcases", "profile")
- profiles.joinpath("all.sip").write_text("sip profile")
- profiles.joinpath("bat.sip").write_text("sip profile")
- profiles.joinpath("fute.sip").write_text("sip profile")
-
- #hwdata => hardware data
- profiles = component.joinpath("matti_testcases", "hwdata")
- profiles.joinpath("file1.txt").write_text("data file")
- profiles.joinpath("settings.ini").write_text("settings initialization file")
- profiles.joinpath("paths.pkg").write_text(
- r"""
- ;Language - standard language definitions
- &EN
-
- ; standard SIS file header
- #{"BTEngTestApp"},(0x04DA27D5),1,0,0
-
- ;Supports Series 60 v 3.0
- (0x101F7961), 0, 0, 0, {"Series60ProductID"}
-
- ;Localized Vendor Name
- %{"BTEngTestApp"}
-
- ;Unique Vendor name
- :"Nokia"
-
- ; Files to copy
-
- "[PKG_LOC]\file1.txt"-"C:\Private\10202BE9\PERSISTS\file1.txt"
- "[PKG_LOC]\settings.ini"-"c:\sys\settings.ini"
- """.replace('\\', os.sep))
-
-
-def teardown_module(test_run_count):
- """ stuff to do after running the tests """
-
- if test_run_count == 0:
- path(TEST_PATH).rmtree()
-
-class TestMattiTestPlan(SetUp):
- """ test MattiDrop.py """
- global OUTPUT, MATTI, SISFILES
-
- def __init__(self):
- """initialize Matti Tests"""
- SetUp.__init__(self)
- self.file_store = OUTPUT
- self.test_asset_path = MATTI
- self.matti_sis_files = r"%s/abc.sis#f:\data\abc.sis#c:\abc.sis, %s/xyz.sis#f:\data\abc.sis#f:\xyz.sis" % (SISFILES, SISFILES)
- self.build_drive = "j:"
- self.drop_file = path(r"%s/ats/ATSMattiDrop.zip" %OUTPUT).normpath()
-
- image_files = r"%s/images/image1.fpsx, %s/images/image2.fpsx " % (OUTPUT, OUTPUT)
- self.flash_images = image_files
-
- self.template_loc = os.path.join(os.environ['TEST_DATA'], 'data/matti/matti_template.xml')
- self.template_loc = os.path.normpath(self.template_loc)
- self.matti_parameters = ""
- self.config = None
-
- def read_xml(self, file_location, zip_file=False):
- """reads test.xml file if a path is given"""
-
- xml_text = ""
- file_location = path(file_location)
- if zip_file:
- if zipfile.is_zipfile(file_location):
- myzip = zipfile.ZipFile(file_location, 'r')
- xml_text = myzip.read('test.xml')
- myzip.close()
-
- else:
- hnd = open(file_location, 'r')
- for line in hnd.readlines():
- xml_text = xml_text + line
-
- return xml_text
-
- def test_xml_with_all_parameters(self):
- """ test Matti2.py with all parameters present and correct and sierra is enabled"""
- global TOTAL_TESTS_COUNT
- opts = Bunch(build_drive=self.build_drive,
- drop_file=path(r"%s/ats/ATSMattiDrop1.zip" %OUTPUT).normpath(),
- flash_images=self.flash_images,
- matti_sis_files=self.matti_sis_files,
- testasset_location=self.test_asset_path,
- template_loc=self.template_loc,
- sierra_enabled="True",
- test_profiles="bat, fute",
- matti_parameters="",
- matti_timeout="1200",
- sierra_parameters="--teardown",
- file_store=self.file_store,
- report_email="firstname.lastname@domain.com",
- testrun_name="matti test run",
- alias_name="alias",
- device_type="new_device",
- diamonds_build_url="http://diamonds.com/1234",
- email_format="simplelogger",
- email_subject="Matti test report",
- verbode="false")
-
- self.config = ats3.matti2.Configuration(opts)
- ats3.matti2.create_drop(self.config)
-
- xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/matti/test_all_present.xml')
- stored_xml = self.read_xml(xml_loc, False).strip()
- drop_loc = os.path.join(OUTPUT, 'ats/ATSMattiDrop1.zip')
- generated_xml = self.read_xml(drop_loc, True).strip()
-
- if platform.system().lower() == "linux":
- assert stored_xml.replace('\r', '') in generated_xml
- else:
- assert stored_xml in generated_xml
-
- TOTAL_TESTS_COUNT -= 1
- teardown_module(TOTAL_TESTS_COUNT)
-
- def test_xml_if_sierra_is_not_enabled(self):
- """ test Matti2.py with all parameters present and correct and sierra is not enabled (or false)"""
- global TOTAL_TESTS_COUNT
- opts = Bunch(build_drive=self.build_drive,
- drop_file=path(r"%s/ats/ATSMattiDrop2.zip" %OUTPUT).normpath(),
- flash_images=self.flash_images,
- matti_sis_files=self.matti_sis_files,
- testasset_location=self.test_asset_path,
- template_loc=self.template_loc,
- sierra_enabled="False",
- test_profiles="bat, fute",
- matti_parameters="",
- matti_timeout="1200",
- sierra_parameters="--teardown",
- file_store=self.file_store,
- report_email="firstname.lastname@domain.com",
- testrun_name="matti test run",
- alias_name="alias",
- device_type="new_device",
- diamonds_build_url="http://diamonds.com/1234",
- email_format="simplelogger",
- email_subject="Matti test report",
- verbode="false")
-
- self.config = ats3.matti2.Configuration(opts)
- ats3.matti2.create_drop(self.config)
-
- xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/matti/test_all_present_sierra_disabled.xml')
- stored_xml = self.read_xml(xml_loc, False).strip()
- drop_loc = os.path.join(OUTPUT, 'ats/ATSMattiDrop2.zip')
- generated_xml = self.read_xml(drop_loc, True).strip()
-
- if platform.system().lower() == "linux":
- assert stored_xml.replace('\r', '') in generated_xml
- else:
- assert stored_xml in generated_xml
-
- TOTAL_TESTS_COUNT -= 1
- teardown_module(TOTAL_TESTS_COUNT)
-
- def test_xml_if_sierra_is_enabled_template_location_is_missing(self):
- """ test Matti2.py with all parameters present and correct and if sierra is enabled but template location is used as default one"""
- global TOTAL_TESTS_COUNT
- opts = Bunch(build_drive=self.build_drive,
- drop_file=path(r"%s/ats/ATSMattiDrop3.zip" %OUTPUT).normpath(),
- flash_images=self.flash_images,
- matti_sis_files=self.matti_sis_files,
- testasset_location=self.test_asset_path,
- template_loc="",
- sierra_enabled="True",
- test_profiles="bat, fute",
- matti_parameters="",
- matti_timeout="1200",
- sierra_parameters="--teardown",
- file_store=self.file_store,
- report_email="firstname.lastname@domain.com",
- testrun_name="matti test run",
- alias_name="alias",
- device_type="new_device",
- diamonds_build_url="http://diamonds.com/1234",
- email_format="simplelogger",
- email_subject="Matti test report",
- verbode="false")
-
- self.config = ats3.matti2.Configuration(opts)
- ats3.matti2.create_drop(self.config)
-
- xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/matti/test_all_present.xml')
- stored_xml = self.read_xml(xml_loc, False).strip()
- drop_loc = os.path.join(OUTPUT, 'ats/ATSMattiDrop3.zip')
- generated_xml = self.read_xml(drop_loc, True).strip()
-
- if platform.system().lower() == "linux":
- assert stored_xml.replace('\r', '') in generated_xml
- else:
- assert stored_xml in generated_xml
-
- TOTAL_TESTS_COUNT -= 1
- teardown_module(TOTAL_TESTS_COUNT)
-
-
-
-
-
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_quality.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_quality.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,59 @@
+#============================================================================
+#Name : test_quality.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+"""Test the archive.py module."""
+
+from __future__ import with_statement
+import os
+import unittest
+import logging
+import fileutils
+import pythoncorecpythontests.test_fileutils
+import integration.quality
+
+_logger = logging.getLogger('test.quality')
+
+
+root_test_dir = pythoncorecpythontests.test_fileutils.root_test_dir
+
+def setup_module():
+ """ Creates some test data files for file-related testing. """
+ pythoncorecpythontests.test_fileutils.setup_module()
+
+def teardown_module():
+ """ Cleans up test data files for file-related testing. """
+ pythoncorecpythontests.test_fileutils.teardown_module()
+
+
+class QualityTest(unittest.TestCase):
+
+ def test_epl_validate_content(self):
+ """Tests loading policy ID's from CSV file for EPL"""
+ pattern = "distribution.policy.s60,distribution.policy,distribution.policy.pp"
+ ignoreroot = False
+ excludes = ".static_wa,_ccmwaid.inf"
+ validator = integration.quality.PolicyValidator(pattern, ignoreroot=ignoreroot, excludes=excludes)
+
+ validator.epl_load_policy_ids(os.path.join(os.environ['TEST_DATA'], 'data/distribution.policy.extended_for_sf.id_status.csv'))
+
+ assert validator.epl_validate_content(os.path.join(os.environ['TEST_DATA'], 'data/distribution.policy.S60')) == True
+ assert validator.epl_validate_content(os.path.join(os.environ['TEST_DATA'], 'data/Invalid_distribution.policy.S60')) == False
+
+if __name__ == "__main__":
+ unittest.main()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_sphinx_ext.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_sphinx_ext.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,121 @@
+#============================================================================
+#Name : test_sphinx_ext.py
+#Part of : Helium
+
+#Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+""" Test sphinx_ext module. """
+import re
+
+import logging
+import os
+import time
+import unittest
+import sys
+import mocker
+import sphinx_ext
+
+_logger = logging.getLogger('test.sphinx_ext')
+random_number = 10
+
+class SphinxTest(mocker.MockerTestCase):
+ """ Class for testing sphinx_ext module """
+ def __init__(self, methodName="runTest"):
+ mocker.MockerTestCase.__init__(self, methodName)
+
+ def setUp(self):
+ # some dummy input
+ self.inlineDocument = r' '
+ sphinx_ext.exit_with_failure = 0
+ sphinx_ext.database_path = os.path.join(os.environ['TEST_DATA'], "data", "test_database.xml")
+
+ def test_handle_hlm_role_callback(self):
+ """ Check roles and description unit."""
+ obj = _MockApp()
+ sphinx_ext.setup(obj)
+ assert 'hlm-t' in obj.dict.keys()
+ assert 'hlm-p' in obj.dict.keys()
+ assert 'hlm-m' in obj.dict.keys()
+ assert sphinx_ext.handle_hlm_role == obj.dict['hlm-t']
+ assert sphinx_ext.handle_hlm_role == obj.dict['hlm-p']
+ assert sphinx_ext.handle_hlm_role == obj.dict['hlm-m']
+ assert ['property', 'ant-prop', 'pair: %s; property'] in obj.descUnit
+ assert ['target', 'ant-target', 'pair: %s; target'] in obj.descUnit
+
+ def test_handle_hlm_role_target(self):
+ """ Check target to build the link """
+ obj = self.mocker.mock(count=False)
+ mocker.expect(obj.document).result(self.inlineDocument)
+ self.mocker.replay()
+ response = sphinx_ext.handle_hlm_role('hlm-t' , "", 'cmaker-install', random_number, obj)
+ assert "../../api/helium/project-compile.cmaker.html#cmaker-install" in response[0][0].children[0].attributes['refuri']
+
+ def test_handle_hlm_role_property(self):
+ """ Check property to build the link """
+ obj = self.mocker.mock(count=False)
+ mocker.expect(obj.document).result(self.inlineDocument)
+ self.mocker.replay()
+ response = sphinx_ext.handle_hlm_role('hlm-p' , "", 'cmaker-export', random_number, obj)
+ assert "../../api/helium/project-compile.cmaker.html#cmaker-export" in response[0][0].children[0].attributes['refuri']
+
+
+ def test_handle_hlm_role_macro(self):
+ """ Check macro to build the link """
+ obj = self.mocker.mock(count=False)
+ mocker.expect(obj.document).result(self.inlineDocument)
+ self.mocker.replay()
+ response = sphinx_ext.handle_hlm_role('hlm-m' , "", 'cmaker-export', random_number, obj)
+ assert "../../api/helium/project-compile.cmaker.html#cmaker-export" in response[0][0].children[0].attributes['refuri']
+
+ def test_handle_hlm_role_missing_api(self):
+ """ Check for failure when there are missing api's """
+ error = ""
+ line = ""
+ obj = self.mocker.mock(count=False)
+ mocker.expect(obj.document).result(self.inlineDocument)
+ mocker.expect(obj.reporter.error('Missing API doc for "cmaker-clean".', line=random_number)).result('Missing API doc for "cmaker-clean".')
+ self.mocker.replay()
+ sphinx_ext.handle_hlm_role('hlm-t' , "", 'cmaker-clean', random_number, obj)
+
+ def test_handle_hlm_role_missing_field_value(self):
+ """ Check for failure when there are missing fields for api's """
+ error = ""
+ line = ""
+ obj = self.mocker.mock(count=False)
+ mocker.expect(obj.document).result(self.inlineDocument)
+ mocker.expect(obj.reporter.error('Field value cannot be found for API field: "cmaker-export[summary]".', line=random_number)).result('Field value cannot be found for API field: "cmaker-export[summary]".')
+ self.mocker.replay()
+ sphinx_ext.handle_hlm_role('hlm-t' , "", 'cmaker-export[summary]', random_number, obj)
+
+ def test_handle_hlm_role_valid_field_value(self):
+ """ Check when there is '[' present """
+ obj = self.mocker.mock(count=False)
+ mocker.expect(obj.document).result(self.inlineDocument)
+ self.mocker.replay()
+ response = sphinx_ext.handle_hlm_role('hlm-t' , "", 'cmaker-export[location]', random_number, obj)
+ assert r"C:\Helium_svn\helium\tools\compile\cmaker.ant.xml:87:" in response[0][0].data
+
+class _MockApp:
+
+ def __init__(self):
+ self.dict = {}
+ self.descUnit = []
+
+ def add_role(self, role, ref):
+ self.dict[role] = ref
+
+ def add_description_unit(self, text1, text2, text3):
+ self.descUnit.append([text1, text2, text3])
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_tdriver.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_tdriver.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,314 @@
+# -*- coding: latin-1 -*-
+
+#============================================================================
+#Name : test_tdriver.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+""" Testing TDriver framework. """
+
+# pylint: disable=E1101
+
+import logging
+logging.getLogger().setLevel(logging.INFO)
+import os
+#import shutil
+from path import path
+import ats3.tdriver
+import tempfile
+import zipfile
+import platform
+import unittest
+
+TEST_PATH = None
+TEST_FILES = {}
+TDRIVER = None
+OUTPUT = None
+SISFILES = None
+
+
+class Bunch(object):
+ """ Configuration object. Argument from constructor are converted into class attributes. """
+ def __init__(self, **kwargs):
+ self.__dict__.update(kwargs)
+
+def setup_module(_):
+ """ Setup the module. """
+ global TEST_PATH
+ global OUTPUT
+ global TDRIVER
+ global SISFILES
+
+ TEST_PATH = path(tempfile.mkdtemp())
+ component = TEST_PATH
+ component.joinpath("tdriver").makedirs()
+ for path_parts in (("tdriver_testcases", "profile", "all.sip"),
+ ("tdriver_testcases", "profile", "bat.sip"),
+ ("tdriver_testcases", "profile", "fute.sip"),
+ ("tdriver_testcases", "hwdata", "paths.pkg"),
+ ("tdriver_testcases", "hwdata", "file1.txt"),
+ ("tdriver_testcases", "hwdata", "settings.ini"),
+ ("tdriver_testcases", "tdriver_parameters", "tdriver_parameters.xml"),
+ ("tdriver_testcases", "unit_test1.rb"),
+ ("tdriver_testcases", "unit_test2.rb"),
+ ("output", "images", "image1.fpsx"),
+ ("output", "images", "image2.fpsx"),
+ ("sisfiles", "abc.sis"),
+ ("sisfiles", "xyz.sis"),
+ ("output", "ats", "temp.txt")):
+ filepath = component.joinpath(*path_parts)
+ if not filepath.parent.exists():
+ filepath.parent.makedirs()
+ filepath.touch()
+ TEST_FILES.setdefault(path_parts[1], []).append(filepath)
+
+ OUTPUT = component.joinpath(r"output")
+ TDRIVER = component.joinpath("tdriver_testcases")
+ SISFILES = component.joinpath(r"sisfiles")
+
+ if not filepath.parent.exists():
+ filepath.parent.makedirs()
+ filepath.touch()
+
+ #mtc => tdriver_testcases
+ mtc = component.joinpath("tdriver_testcases")
+ mtc.joinpath("unit_test1.rb").write_text("unit_tests")
+ mtc.joinpath("unit_test2.rb").write_text("unit_tests")
+
+ # profiles
+ profiles = component.joinpath("tdriver_testcases", "profile")
+ profiles.joinpath("all.sip").write_text("sip profile")
+ profiles.joinpath("bat.sip").write_text("sip profile")
+ profiles.joinpath("fute.sip").write_text("sip profile")
+
+ #hwdata => hardware data
+ profiles = component.joinpath("tdriver_testcases", "hwdata")
+ profiles.joinpath("file1.txt").write_text("data file")
+ profiles.joinpath("settings.ini").write_text("settings initialization file")
+ profiles.joinpath("paths.pkg").write_text(
+ r"""
+ ;Language - standard language definitions
+ &EN
+
+ ; standard SIS file header
+ #{"BTEngTestApp"},(0x04DA27D5),1,0,0
+
+ ;Supports Series 60 v 3.0
+ (0x101F7961), 0, 0, 0, {"Series60ProductID"}
+
+ ;Localized Vendor Name
+ %{"BTEngTestApp"}
+
+ ;Unique Vendor name
+ :"Nokia"
+
+ ; Files to copy
+
+ "[PKG_LOC]\file1.txt"-"C:\Private\10202BE9\PERSISTS\file1.txt"
+ "[PKG_LOC]\settings.ini"-"c:\sys\settings.ini"
+ """.replace('\\', os.sep))
+
+
+def teardown_module():
+ """ stuff to do after running the tests """
+ path(TEST_PATH).rmtree()
+
+class TestTDriverTestPlan(unittest.TestCase):
+ """ test TDriverDrop.py """
+
+ def setUp(self):
+ """initialize TDriver Tests"""
+ self.file_store = OUTPUT
+ self.test_asset_path = TDRIVER
+ self.tdriver_sis_files = r"%s/abc.sis#f:\data\abc.sis#c:\abc.sis, %s/xyz.sis#f:\data\abc.sis#f:\xyz.sis" % (SISFILES, SISFILES)
+ self.build_drive = "j:"
+ self.drop_file = path(r"%s/ats/ATSTDriverDrop.zip" %OUTPUT).normpath()
+
+ image_files = r"%s/images/image1.fpsx, %s/images/image2.fpsx " % (OUTPUT, OUTPUT)
+ self.flash_images = image_files
+
+ self.template_loc = os.path.join(os.environ['TEST_DATA'], 'data/tdriver/tdriver_template.xml')
+ self.template_loc = os.path.normpath(self.template_loc)
+ self.tdriver_parameters = ""
+ self.config = None
+
+ def read_xml(self, file_location, zip_file=False):
+ """reads test.xml file if a path is given"""
+
+ xml_text = ""
+ file_location = path(file_location)
+ if zip_file:
+ if zipfile.is_zipfile(file_location):
+ myzip = zipfile.ZipFile(file_location, 'r')
+ xml_text = myzip.read('test.xml')
+ myzip.close()
+ xml_text = xml_text.replace("\n", "")
+ xml_text = xml_text.replace("\t", "")
+
+ else:
+ hnd = open(file_location, 'r')
+ for line in hnd.readlines():
+ xml_text = xml_text + line.strip()
+
+ return xml_text
+
+ def test_xml_with_all_parameters(self):
+ """ test tdriver.py with all parameters present and correct and tdrunner is enabled"""
+ opts = Bunch(build_drive=self.build_drive,
+ drop_file=path(r"%s/ats/ATSTDriverDrop1.zip" %OUTPUT).normpath(),
+ flash_images=self.flash_images,
+ tdriver_sis_files=self.tdriver_sis_files,
+ testasset_location=self.test_asset_path,
+ template_loc=self.template_loc,
+ tdrunner_enabled="True",
+ test_profiles="bat, fute",
+ tdriver_parameters="",
+ tdriver_timeout="1200",
+ tdrunner_parameters="--teardown",
+ file_store="",
+ report_email="firstname.lastname@domain.com",
+ testrun_name="TDriver test run",
+ alias_name="alias",
+ device_type="new_device",
+ diamonds_build_url="http://diamonds.com/1234",
+ email_format="simplelogger",
+ email_subject="TDriver test report",
+ verbode="false")
+
+ self.config = ats3.tdriver.Configuration(opts)
+ ats3.tdriver.create_drop(self.config)
+
+ xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/tdriver/test_all_present.xml')
+ stored_xml = self.read_xml(xml_loc, False).strip()
+ drop_loc = os.path.join(OUTPUT, 'ats/ATSTDriverDrop1.zip')
+ generated_xml = self.read_xml(drop_loc, True).strip()
+
+ if platform.system().lower() == "linux":
+ assert stored_xml.replace('\r', '') in generated_xml
+ else:
+ assert stored_xml in generated_xml
+
+
+ def test_xml_if_tdrunner_is_not_enabled(self):
+ """ test tdriver.py with all parameters present and correct and tdrunner is not enabled (or false)"""
+ opts = Bunch(build_drive=self.build_drive,
+ drop_file=path(r"%s/ats/ATSTDriverDrop2.zip" %OUTPUT).normpath(),
+ flash_images=self.flash_images,
+ tdriver_sis_files=self.tdriver_sis_files,
+ testasset_location=self.test_asset_path,
+ template_loc=self.template_loc,
+ tdrunner_enabled="False",
+ test_profiles="bat, fute",
+ tdriver_parameters="",
+ tdriver_timeout="1200",
+ tdrunner_parameters="--teardown",
+ file_store=r"\\network\drive",
+ report_email="firstname.lastname@domain.com",
+ testrun_name="TDriver test run",
+ alias_name="alias",
+ device_type="new_device",
+ diamonds_build_url="http://diamonds.com/1234",
+ email_format="simplelogger",
+ email_subject="TDriver test report",
+ verbode="false")
+
+ self.config = ats3.tdriver.Configuration(opts)
+ ats3.tdriver.create_drop(self.config)
+
+ xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/tdriver/test_all_present_tdrunner_disabled.xml')
+ stored_xml = self.read_xml(xml_loc, False).strip()
+ drop_loc = os.path.join(OUTPUT, 'ats/ATSTDriverDrop2.zip')
+ generated_xml = self.read_xml(drop_loc, True).strip()
+
+ if platform.system().lower() == "linux":
+ assert stored_xml.replace('\r', '') in generated_xml
+ else:
+ assert stored_xml in generated_xml
+
+
+ def test_xml_if_tdrunner_is_enabled_template_location_is_missing(self):
+ """ test tdriver.py with all parameters present and correct and if tdrunner is enabled but template location is used as default one"""
+ opts = Bunch(build_drive=self.build_drive,
+ drop_file=path(r"%s/ats/ATSTDriverDrop3.zip" %OUTPUT).normpath(),
+ flash_images=self.flash_images,
+ tdriver_sis_files=self.tdriver_sis_files,
+ testasset_location=self.test_asset_path,
+ template_loc="",
+ tdrunner_enabled="True",
+ test_profiles="bat, fute",
+ tdriver_parameters="",
+ tdriver_timeout="1200",
+ tdrunner_parameters="--teardown",
+ file_store="",
+ report_email="firstname.lastname@domain.com",
+ testrun_name="TDriver test run",
+ alias_name="alias",
+ device_type="new_device",
+ diamonds_build_url="http://diamonds.com/1234",
+ email_format="simplelogger",
+ email_subject="TDriver test report",
+ verbode="false")
+
+ self.config = ats3.tdriver.Configuration(opts)
+ ats3.tdriver.create_drop(self.config)
+
+ xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/tdriver/test_all_present.xml')
+ stored_xml = self.read_xml(xml_loc, False).strip()
+ drop_loc = os.path.join(OUTPUT, 'ats/ATSTDriverDrop3.zip')
+ generated_xml = self.read_xml(drop_loc, True).strip()
+
+ if platform.system().lower() == "linux":
+ assert stored_xml.replace('\r', '') in generated_xml
+ else:
+ assert stored_xml in generated_xml
+
+ def test_ctc(self):
+ """ test ctc """
+ opts = Bunch(build_drive=self.build_drive,
+ drop_file=path(r"%s/ats/ATSTDriverDrop3.zip" %OUTPUT).normpath(),
+ flash_images=self.flash_images,
+ tdriver_sis_files=self.tdriver_sis_files,
+ testasset_location=self.test_asset_path,
+ template_loc="",
+ tdrunner_enabled="True",
+ test_profiles="bat, fute",
+ tdriver_parameters="",
+ tdriver_timeout="1200",
+ tdrunner_parameters="--teardown",
+ file_store="",
+ report_email="firstname.lastname@domain.com",
+ testrun_name="TDriver test run",
+ alias_name="alias",
+ device_type="new_device",
+ diamonds_build_url="http://diamonds.com/1234",
+ email_format="simplelogger",
+ email_subject="TDriver test report",
+ verbode="false",
+ ctc_enabled=True)
+
+ self.config = ats3.tdriver.Configuration(opts)
+ ats3.tdriver.create_drop(self.config)
+
+ xml_loc = os.path.join(os.environ['TEST_DATA'], 'data/tdriver/test_ctc.xml')
+ stored_xml = self.read_xml(xml_loc, False).strip()
+ drop_loc = os.path.join(OUTPUT, 'ats/ATSTDriverDrop3.zip')
+ generated_xml = self.read_xml(drop_loc, True).strip()
+
+ if platform.system().lower() == "linux":
+ assert stored_xml.replace('\r', '') in generated_xml
+ else:
+ assert stored_xml in generated_xml
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_timeout_launcher.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_timeout_launcher.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_timeout_launcher.py Sun Oct 10 15:22:15 2010 +0300
@@ -32,9 +32,9 @@
# Platform
WINDOWS = False
if sys.platform == "win32":
- import win32process
+# import win32process
import win32con
- import win32api
+# import win32api
WINDOWS = True
@@ -175,6 +175,6 @@
failed = False
try:
timeout_launcher.main()
- except Exception:
+ except (OSError, IOError):
failed = True
assert failed
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_amara.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_amara.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_amara.py Sun Oct 10 15:22:15 2010 +0300
@@ -31,12 +31,16 @@
"""test amara"""
xxx = amara.parse(r'Add rofsfiles for usage in paged images ')
assert str(xxx.commentLog.branchInfo) == 'Add rofsfiles for usage in paged images'
+ print "xxx: '" + str(xxx) + "'"
+ print xxx.xml()
xxx = amara.parse(r'1 2 ')
for yyy in xxx.commentLog.branchInfo:
assert str(yyy) == '1'
break
-
+ print "xxx: '" + str(xxx) + "'"
+ print xxx.xml()
+
myxml = """ """
xcf = amara.parse(myxml)
assert xcf.DpComponent['name'] == 'dp.cfg.xml'
@@ -118,6 +122,8 @@
newppxml = amara.parse(ppxml)
oldppxml = amara.parse(ppxml)
+ assert 'SettingsData' in newppxml.xml_child_elements
+
oldppdata = {}
for oldfeature in oldppxml.SettingsData.ProductProfile.Feature:
oldppdata[str(oldfeature.Index)] = oldfeature.Value
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccm_results.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccm_results.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccm_results.py Sun Oct 10 15:22:15 2010 +0300
@@ -332,6 +332,30 @@
assert len(result.output[subproj]) == 2, "%s should contain 2 conflicts" % subproj.objectname
+
+ def test_ConflictsResult_object_result(self):
+ """ Validating ConflictsResult with object checking output."""
+ behave = {'test_update' : """
+Project: Cartman-Release_v4
+
+header.h-8.1.1:incl:tr1test1#1 tr1test1#30010, tr1test1#42792 Implicitly required by multiple tasks - parallel
+header2.h-5.2.1:prj_spec:tr1test1#2 tr1test1#28554 Implicitly required but not included - parallel
+
+Project: Cartman_sub03-next
+
+ No conflicts detected.
+
+ """}
+ session = MockResultSession(behave)
+ result = session.execute('test_update', ccm.ConflictsResult(session))
+ #_logger.debug(result.output)
+ # pylint: disable=E1103
+ assert len(result.output.keys()) == 2, "Should detect 2 projects."
+ subproj = session.create("Cartman-Release_v4:project:%s#1" % session.database())
+ # 3 conflicts will be detected one per tasks.
+ assert len(result.output[subproj]) == 3, "%s should contain 3 conflicts" % subproj.objectname
+
+
def test_DataMapperListResult_result(self):
""" Validating DataMapperListResult."""
behave = {'test_query' : """>>>objectname>>>task5204-1:task:tr1test1>>>task_synopsis>>>Create Cartman_sub03>>>
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccmutil.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccmutil.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_ccmutil.py Sun Oct 10 15:22:15 2010 +0300
@@ -27,9 +27,8 @@
_logger = logging.getLogger('test.ccmutil')
logging.basicConfig(level=logging.INFO)
-def open_session(username=None, password=None, engine=None, dbpath=None, database=None, reuse=True):
+def open_session(username=None, password=None, engine=None, dbpath=None, database=None):
"""open session"""
- reuse = True #just for pylint
return MockSession(None, username, password, engine, dbpath, database)
nokia.nokiaccm.open_session = open_session
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_configuration.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_configuration.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_configuration.py Sun Oct 10 15:22:15 2010 +0300
@@ -157,8 +157,8 @@
-
-
+
+
@@ -166,8 +166,8 @@
-
-
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_gscm.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_gscm.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_gscm.py Sun Oct 10 15:22:15 2010 +0300
@@ -53,7 +53,7 @@
try:
_logger.info("get_db_path('not_valid_db'): %s" % nokia.gscm.get_db_path('not_valid_db'))
assert False, "Should raise Exception when giving unexisting db.'"
- except Exception, exc:
+ except IOError, exc:
_logger.info(exc)
def test_get_engine_host(self):
@@ -66,7 +66,7 @@
try:
_logger.info("get_engine_host('not_valid_db'): %s" % nokia.gscm.get_engine_host('not_valid_db'))
assert False, "Should raise Exception when giving unexisting db.'"
- except Exception, exc:
+ except IOError, exc:
_logger.info(exc)
def test_get_router_address(self):
@@ -78,5 +78,5 @@
try:
_logger.info("get_router_address('not_valid_db'): %s" % nokia.gscm.get_router_address('not_valid_db'))
assert False, "Should raise Exception when giving unexisting db.'"
- except Exception, exc:
+ except IOError, exc:
_logger.info(exc)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_idoprep.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_idoprep.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_idoprep.py Sun Oct 10 15:22:15 2010 +0300
@@ -34,22 +34,6 @@
"""called before any of the tests are run"""
self.server = os.path.join(os.environ['TEST_DATA'], "data/symrec/GRACE/")
- def test_validate_grace(self):
- """Verifiying validate(grace) method"""
- self.assertRaises(Exception, idoprep.validate, None, 'test', 'test', 'test')
-
- def test_validate_service(self):
- """Verifiying validate(service) method"""
- self.assertRaises(Exception, idoprep.validate, 'test', None, 'test', 'test')
-
- def test_validate_product(self):
- """Verifiying validate(product) method"""
- self.assertRaises(Exception, idoprep.validate, 'test', 'test', None, 'test')
-
- def test_validate_release(self):
- """Verifiying validate(release) method"""
- self.assertRaises(Exception, idoprep.validate, 'test', 'test', 'test', None)
-
def test_get_s60_env_details_valid(self):
"""Verifiying get_s60_env_details(valid args) method"""
(fileDes, cacheFilename) = tempfile.mkstemp()
@@ -91,47 +75,16 @@
"""Verifiying create_ado_mapping method"""
(sysdefFileDes, sysdefConfig) = tempfile.mkstemp()
(adoFileDes, adoMappingFile) = tempfile.mkstemp()
- (adoqtyFileDes, adoQualityMappingFile) = tempfile.mkstemp()
buildDrive = tempfile.gettempdir()
adoQualityDirs = None
testSysdefFile = os.path.join(os.environ['TEST_DATA'], 'data', 'packageiad', 'layers.sysdef.xml')
os.write(sysdefFileDes, testSysdefFile)
os.close(sysdefFileDes)
- idoprep.create_ado_mapping(sysdefConfig, adoMappingFile, adoQualityMappingFile, buildDrive, adoQualityDirs)
+ idoprep.create_ado_mapping(sysdefConfig, adoMappingFile, 'false', buildDrive, adoQualityDirs)
os.unlink(sysdefConfig)
os.close(adoFileDes)
- os.close(adoqtyFileDes)
adoFile = open(adoMappingFile, 'r')
adoMappingFileContents = adoFile.readlines()
adoFile.close()
- adoQtyFile = open(adoQualityMappingFile, 'r')
- adoQualityMappingFileContents = adoQtyFile.readlines()
- adoQtyFile.close()
os.unlink(adoMappingFile)
- os.unlink(adoQualityMappingFile)
- assert len(adoMappingFileContents) >= 1 and len(adoQualityMappingFileContents) >= 1
-
- def test_create_ado_mapping_adoqualitydirs(self):
- """Verifiying create_ado_mapping (with valid adoqualitydirs) method"""
- (sysdefFileDes, sysdefConfig) = tempfile.mkstemp()
- (adoFileDes, adoMappingFile) = tempfile.mkstemp()
- (adoqtyFileDes, adoQualityMappingFile) = tempfile.mkstemp()
- buildDrive = tempfile.gettempdir()
- testSysdefFile = os.path.join(os.environ['TEST_DATA'], 'data', 'packageiad', 'layers.sysdef.xml')
- location = ido.get_sysdef_location(testSysdefFile)
- adoQualityDirs = (os.path.normpath(os.path.join(buildDrive, os.environ['EPOCROOT'], location)))
- os.write(sysdefFileDes, testSysdefFile)
- os.close(sysdefFileDes)
- idoprep.create_ado_mapping(sysdefConfig, adoMappingFile, adoQualityMappingFile, buildDrive, adoQualityDirs)
- os.unlink(sysdefConfig)
- os.close(adoFileDes)
- os.close(adoqtyFileDes)
- adoFile = open(adoMappingFile, 'r')
- adoMappingFileContents = adoFile.readlines()
- adoFile.close()
- adoQtyFile = open(adoQualityMappingFile, 'r')
- adoQualityMappingFileContents = adoQtyFile.readlines()
- adoQtyFile.close()
- os.unlink(adoMappingFile)
- os.unlink(adoQualityMappingFile)
- assert len(adoMappingFileContents) >= 1 and len(adoQualityMappingFileContents) >= 1
+ assert len(adoMappingFileContents) >= 1
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_preparation.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_preparation.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_preparation.py Sun Oct 10 15:22:15 2010 +0300
@@ -18,8 +18,6 @@
#===============================================================================
""" Testing preparation module """
-# pylint: disable=R0201
-
import tempfile
from shutil import rmtree
import os
@@ -496,9 +494,9 @@
"""Emulating project.exists method"""
return True
- def snapshot(self, target_dir, status):
+ def snapshot(self, target_dir, _):
"""Emulating project.snapshot method"""
- print "Snapshot created"
+ print "Snapshot created: target_dir = " + str(target_dir)
def update(self, status, replace_subprojects, update_keepgoing, result):
"""Emulating project.update method"""
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_sysdef_io.py
--- a/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_sysdef_io.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/pythoncoretests/test_sysdef_io.py Sun Oct 10 15:22:15 2010 +0300
@@ -26,41 +26,45 @@
import unittest
from sysdef.io import FlashImageSizeWriter
+
_logger = logging.getLogger('test.sysdef.io')
logging.basicConfig(level=logging.INFO)
+
class FlashImageSizeWriterTest(unittest.TestCase):
"""Verifiying sysdef/io module"""
def test_write(self):
"""Verifiying write method"""
- (fileDes, filename) = tempfile.mkstemp()
- flashWriter = FlashImageSizeWriter(filename)
- oldOut = flashWriter._out
- flashWriter._out = duppedOut = StringIO()
+ output = StringIO()
+ flashWriter = FlashImageSizeWriter(output)
config_list = ("testconfig1","testconfig2")
flashWriter.write(_sysdef(), config_list)
- flashWriter._out = oldOut
+ assert len(output.getvalue().splitlines()) == 9
flashWriter.close()
- os.close(fileDes)
- os.unlink(filename)
- assert len(duppedOut.getvalue().splitlines()) == 9
+
# dummy classes to emulate sysdef configuration
class _sysdef():
"""Emulate sysdef """
def __init__(self):
self.configurations = {"name1": _config("testconfig1"), "name2" : _config("testconfig2")}
+
+
class _config():
"""Emulate config"""
def __init__(self, name):
self.name = name
self.units = (_unit(), _unit())
+
+
class _unit():
"""Emulate unit"""
def __init__(self):
self.name = "testUnit"
self.binaries = (_binary(), _binary())
+
+
class _binary():
"""Emulate binary"""
def __init__(self):
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/sphinx_ext.py
--- a/buildframework/helium/sf/python/pythoncore/lib/sphinx_ext.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/sphinx_ext.py Sun Oct 10 15:22:15 2010 +0300
@@ -1,7 +1,7 @@
#============================================================================
#Name : sphinx_ext.py
#Part of : Helium
-
+#
#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
#All rights reserved.
#This component and the accompanying materials are made available
@@ -16,61 +16,126 @@
#
#Description:
#===============================================================================
-""" aids to creating the API documentation"""
+""" Custom Sphinx operations to help with Helium doc linking. """
+
import os
import re
+import atexit
from docutils import nodes, utils
from docutils.parsers.rst import directives
import amara
+tree = None
treecache = None
+database_path = os.path.abspath(os.path.join(os.getcwd() + '/build', 'public_database.xml'))
+
+# Error count for custom sphinx operations
+exit_with_failure = 0
-def handle_hlm_role(role, rawtext, text, lineno, inliner,
- options=None, content=None):
+def check_cached_database():
+ """ Check the Ant database XML data is cached as needed. """
+ global tree
+ global treecache
+
+ if tree == None or treecache == None:
+ f = open(database_path)
+ tree = amara.parse(f)
+
+ treecache = {}
+ for project in tree.antDatabase.project:
+ for x in project.xml_children:
+ if hasattr(x, 'name'):
+ treecache[str(x.name)] = [str(project.name),'project']
+ if hasattr(tree.antDatabase, "antlib"):
+ for antlib in tree.antDatabase.antlib:
+ for x in antlib.xml_children:
+ if hasattr(x, 'name'):
+ treecache[str(x.name)] = [str(antlib.name),'antlib']
+
+def handle_hlm_role(role, _, text, lineno, inliner, options=None, content=None): # pylint: disable=W0613
""" Process a custom Helium ReStructuredText role to link to a target, property or macro. """
if options == None:
options = {}
if content == None:
content = []
+
+ # See if the role is used to embed a API element field
+ if '[' in text:
+ role_data = _embed_role_field(role, text, lineno, inliner)
+ else:
+ role_data = _build_link(text, lineno, inliner, options)
+
+ return role_data
+
+def _embed_role_field(role, text, lineno, inliner):
+ """ Insert the contents of an element field.
+
+ These take the form of e.g. hlm-p:`build.drive[summary]`
+ """
+ messages = []
+ node = nodes.Text('', '')
+
+ field_match = re.search("(.*?)\[(.*?)\]", text)
+ if field_match != None:
+ element_name = field_match.group(1)
+ field_name = field_match.group(2)
+ if field_name != None and len(field_name) > 0:
+ field_value = find_field_value(role, element_name, field_name)
+ if field_value != None and len(field_value) > 0:
+ node = nodes.Text(field_value, utils.unescape(field_value))
+ else:
+ messages.append(inliner.reporter.error(('Field value cannot be found for API field: "%s".' % text), line=lineno))
+ else:
+ messages.append(inliner.reporter.error(('Invalid field name for API value replacement: "%s".' % text), line=lineno))
+ return [node], messages
+
+def find_field_value(role, element_name, field_name):
+ """ Gets the value of a field from an API element. """
+ check_cached_database()
+
+ field_value = None
+ element = tree.xml_xpath('//' + roles[role] + "[name='" + element_name + "']")
+
+ if element != None and len(element) == 1:
+ field_value_list = element[0].xml_xpath(field_name)
+ if field_value_list != None and len(field_value_list) == 1:
+ field_value = str(field_value_list[0])
+ return field_value
+
+
+def _build_link(text, lineno, inliner, options):
+ """ Build an HTML link to the API doc location for API element. """
+ global exit_with_failure
full_path_match = re.search(r"'" % (exit_with_failure) )
+
+# Register a cleanup routine to handle exit with failure
+atexit.register(check_for_failure)
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/symrec.py
--- a/buildframework/helium/sf/python/pythoncore/lib/symrec.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/symrec.py Sun Oct 10 15:22:15 2010 +0300
@@ -306,7 +306,10 @@
result.append(ServicePack(spack))
return result
- filename = property(lambda self:self._filename)
+ @property
+ def filename(self):
+ return self._filename
+
service = property(lambda self:self.get_releasedetails_info('service'), lambda self, value:self.set_releasedetails_info('service', value))
product = property(lambda self:self.get_releasedetails_info('product'), lambda self, value:self.set_releasedetails_info('product', value))
release = property(lambda self:self.get_releasedetails_info('release'), lambda self, value:self.set_releasedetails_info('release', value))
@@ -346,6 +349,8 @@
def is_valid(self, checkmd5=True, checkPath=True):
""" Run the validation mechanism. """
+ valid = True
+
status = os.path.join(os.path.dirname(self._filename), 'HYDRASTATUS.xml')
if os.path.exists(status):
hydraxml = xml.dom.minidom.parse(open(status, "r"))
@@ -353,53 +358,63 @@
if t_name.nodeType == t_name.TEXT_NODE:
if t_name.nodeValue != 'Ready':
LOGGER.error("HYDRASTATUS.xml is not ready")
- return False
- if checkPath:
+ valid = False
+
+ if valid and checkPath:
if os.path.basename(self.location) != self.release:
LOGGER.error("Release doesn't match.")
- return False
+ valid = False
if os.path.basename(os.path.dirname(self.location)) != self.product:
LOGGER.error("Product doesn't match.")
- return False
+ valid = False
if os.path.basename(os.path.dirname(os.path.dirname(self.location))) != self.service:
LOGGER.error("Service doesn't match.")
- return False
+ valid = False
- for name in self.keys():
- path = os.path.join(self.location, name)
- if not os.path.exists(path):
- LOGGER.error("%s doesn't exist." % path)
- return False
- try:
- LOGGER.debug("Trying to open %s" % path)
- content_file = open(path)
- content_file.read(1)
- except IOError:
- LOGGER.error("%s is not available yet" % path)
- return False
-
- if checkmd5 and self[name].has_key('md5checksum'):
- if self[name]['md5checksum'] != None:
- if fileutils.getmd5(path).lower() != self[name]['md5checksum']:
- LOGGER.error("%s md5checksum missmatch." % path)
- return False
-
- for spack in self.servicepacks:
- for name in spack.files:
+ if valid:
+ for name in self.keys():
path = os.path.join(self.location, name)
if not os.path.exists(path):
LOGGER.error("%s doesn't exist." % path)
- return False
- for name in spack.instructions:
- path = os.path.join(self.location, name)
- if not os.path.exists(path):
- LOGGER.error("%s doesn't exist." % path)
- return False
+ valid = False
+ break
+ try:
+ LOGGER.debug("Trying to open %s" % path)
+ content_file = open(path)
+ content_file.read(1)
+ except IOError:
+ LOGGER.error("%s is not available yet" % path)
+ valid = False
+ break
+
+ if checkmd5 and self[name].has_key('md5checksum'):
+ if self[name]['md5checksum'] != None:
+ if fileutils.getmd5(path).lower() != self[name]['md5checksum']:
+ LOGGER.error("%s md5checksum missmatch." % path)
+ valid = False
+
+ if valid:
+ for spack in self.servicepacks:
+ if valid:
+ for name in spack.files:
+ path = os.path.join(self.location, name)
+ if not os.path.exists(path):
+ LOGGER.error("%s doesn't exist." % path)
+ valid = False
+ break
+ for name in spack.instructions:
+ path = os.path.join(self.location, name)
+ if not os.path.exists(path):
+ LOGGER.error("%s doesn't exist." % path)
+ valid = False
+ break
- dependency = self.get_dependsof()
- if dependency != None:
- return ValidateReleaseMetadata(dependency.filename).is_valid(checkmd5)
- return True
+ if valid:
+ dependency = self.get_dependsof()
+ if dependency != None:
+ return ValidateReleaseMetadata(dependency.filename).is_valid(checkmd5)
+
+ return valid
class MetadataMerger(object):
@@ -549,11 +564,11 @@
ValidateReleaseMetadataCached.__init__(self, filename)
self.location = os.path.dirname(filename)
- def is_valid(self, checkmd5=True):
+ def is_valid(self, checkmd5=True, checkPath=True):
""" Run the validation mechanism. """
tickler_path = os.path.join(self.location,"TICKLER")
if not os.path.exists(tickler_path):
LOGGER.error("Release not available yet")
return False
else:
- return ValidateReleaseMetadataCached.is_valid(self, checkmd5)
+ return ValidateReleaseMetadataCached.is_valid(self, checkmd5, checkPath)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/symrec.py.orig
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/lib/symrec.py.orig Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,564 @@
+#============================================================================
+#Name : symrec.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+
+""" SYMREC metadata file generation. """
+import xml.dom.minidom
+import codecs
+import os
+import re
+import logging
+import fileutils
+import csv
+
+LOGGER = logging.getLogger("symrec")
+logging.basicConfig(level=logging.INFO)
+
+def _cleanup_list(input):
+ """cleanup list"""
+ result = []
+ for chars in input:
+ if chars is not None and chars.strip() != "":
+ result.append(chars)
+ return result
+
+def xml_setattr(node, attr, value):
+ """ Create the attribute if needed. """
+ node.setAttribute(attr, value)
+
+def is_child_text_only(node):
+ """ Returns true if child node are all from TEXT_NODE type. """
+ for child in node.childNodes:
+ if child.nodeType != xml.dom.minidom.Node.TEXT_NODE:
+ return False
+ return True
+
+
+def ignore_whitespace_writexml(self, writer, indent="", addindent="", newl=""):
+ """ This version of writexml will ignore whitespace text to alway render
+ the output in a structure way.
+ indent = current indentation
+ addindent = indentation to add to higher levels
+ newl = newline string
+ """
+ writer.write(indent + "<" + self.tagName)
+
+ attrs = self._get_attributes()
+ a_names = attrs.keys()
+ a_names.sort()
+
+ for a_name in a_names:
+ writer.write(" %s=\"" % a_name)
+ xml.dom.minidom._write_data(writer, attrs[a_name].value)
+ writer.write("\"")
+ if self.childNodes:
+ writer.write(">")
+ if is_child_text_only(self):
+ for node in self.childNodes:
+ node.writexml(writer, '', '', '')
+ writer.write("%s>%s" % (self.tagName, newl))
+ else:
+ writer.write(newl)
+ for node in self.childNodes:
+ if node.nodeType == xml.dom.minidom.Node.TEXT_NODE and node.data.isspace():
+ pass
+ else:
+ node.writexml(writer, indent + addindent, addindent, newl)
+ writer.write("%s%s>%s" % (indent, self.tagName, newl))
+ else:
+ writer.write("/>%s" % (newl))
+
+xml.dom.minidom.Element.writexml = ignore_whitespace_writexml
+
+
+class ServicePack(object):
+ """ Create a ServicePack """
+ def __init__(self, node):
+ self.__xml = node
+
+ @property
+ def name(self):
+ """name"""
+ return self.__xml.getAttribute('name')
+
+ @property
+ def files(self):
+ """files"""
+ result = []
+ for filen in self.__xml.getElementsByTagName('file'):
+ result.append(filen.getAttribute('name'))
+ return result
+
+ @property
+ def instructions(self):
+ """instructions"""
+ result = []
+ for instr in self.__xml.getElementsByTagName('instructions'):
+ result.append(instr.getAttribute('name'))
+ return result
+
+class ReleaseMetadata(object):
+ """ Create or read Metadata XML from SYMREC/SYMDEC. """
+
+ def __init__(self, filename, service=None, product=None, release=None):
+ self._filename = filename
+ if filename and os.path.exists(filename):
+ self._xml = xml.dom.minidom.parse(open(filename, "r"))
+ releaseInformation = self._xml.getElementsByTagName(u"releaseInformation")
+ if releaseInformation != []:
+ self._releaseInformation = releaseInformation[0]
+ else:
+ self._releaseInformation = self._xml.createElement(u"releaseInformation")
+ releaseDetails = self._xml.getElementsByTagName(u'releaseDetails')
+ if releaseDetails != []:
+ self._releaseDetails = releaseDetails[0]
+ else:
+ self._releaseDetails = self._xml.createElement(u'releaseDetails')
+ releaseFiles = self._xml.getElementsByTagName(u'releaseFiles')
+ if releaseFiles != []:
+ self._releaseFiles = releaseFiles[0]
+ else:
+ self._releaseFiles = self._xml.createElement(u'releaseFiles')
+
+ if service != None:
+ self.service = service
+ if product != None:
+ self.product = product
+ if release != None:
+ self.release = release
+ elif service!=None and product!=None and release!=None:
+ self._xml = xml.dom.minidom.Document()
+ self._releaseInformation = self._xml.createElement(u"releaseInformation")
+ self._xml.appendChild(self._releaseInformation)
+ self._releaseDetails = self._xml.createElement(u'releaseDetails')
+ self._releaseInformation.appendChild(self._releaseDetails)
+ releaseID = self._xml.createElement(u'releaseID')
+ self._releaseDetails.appendChild(releaseID)
+
+ # service
+ serv = self._xml.createElement(u'service')
+ xml_setattr(serv, 'name', unicode(service))
+ releaseID.appendChild(serv)
+ # product
+ prod = self._xml.createElement(u'product')
+ xml_setattr(prod, 'name', unicode(product))
+ releaseID.appendChild(prod)
+ # release
+ rel = self._xml.createElement(u'release')
+ xml_setattr(rel, 'name', unicode(release))
+ releaseID.appendChild(rel)
+
+ # releaseFiles
+ self._releaseFiles = self._xml.createElement(u'releaseFiles')
+ self._releaseInformation.appendChild(self._releaseFiles)
+
+ # releaseFiles
+ self._releaseInformation.appendChild(self._xml.createElement(u'externalFiles'))
+ else:
+ raise Exception("Error metadata file doesn't exists.")
+
+
+ def get_dependsof(self):
+ """ Return a ReleaseMetada object pointing to the dependency release. """
+ if self.dependsof_service != None and self.dependsof_product != None and self.dependsof_release != None:
+ filename = os.path.join(os.path.dirname(self._filename), "../../..",
+ self.dependsof_service,
+ self.dependsof_product,
+ self.dependsof_release)
+ return ReleaseMetadata(find_latest_metadata(filename))
+ else:
+ return None
+
+
+ def set_dependsof(self, filename):
+ """ Setting the dependency release. """
+ metadata = ReleaseMetadata(filename)
+ self.dependsof_service = metadata.service
+ self.dependsof_product = metadata.product
+ self.dependsof_release = metadata.release
+
+ def add_package(self, name, type=None, default=True, filters=None, extract="single", md5checksum=None, size=None):
+ """ Adding a package to the metadata file. """
+ # check if update mode
+ package = None
+
+ for pkg in self._xml.getElementsByTagName('package'):
+ if (pkg.getAttribute('name').lower() == os.path.basename(name).lower()):
+ package = pkg
+ break
+
+ # if not found create new package.
+ if package is None:
+ package = self._xml.createElement(u'package')
+ self._releaseFiles.appendChild(package)
+
+ xml_setattr(package, 'name', os.path.basename(name))
+ if type != None:
+ xml_setattr(package, 'type', type)
+ else:
+ xml_setattr(package, 'type', os.path.splitext(name)[1].lstrip('.'))
+ xml_setattr(package, 'default', str(default).lower())
+ xml_setattr(package, 'extract', extract)
+ if filters and len(filters)>0:
+ xml_setattr(package, 'filters', ','.join(filters))
+ xml_setattr(package, 's60filter', ','.join(filters))
+ else:
+ xml_setattr(package, 'filters', '')
+ xml_setattr(package, 's60filter', '')
+ if md5checksum != None:
+ xml_setattr(package, unicode("md5checksum"), unicode(md5checksum))
+ if size != None:
+ xml_setattr(package, unicode("size"), unicode(size))
+
+
+ def keys(self):
+ """keys"""
+ keys = []
+ for pkg in self._releaseFiles.getElementsByTagName('package'):
+ keys.append(pkg.getAttribute('name'))
+ return keys
+
+ def __getitem__(self, key):
+ for pkg in self._releaseFiles.getElementsByTagName('package'):
+ if pkg.getAttribute('name').lower() == key.lower():
+ filters = []
+ s60filters = []
+ md5checksum = None
+ size = None
+ if pkg.hasAttribute(u'filters'):
+ filters = _cleanup_list(pkg.getAttribute('filters').split(','))
+ if pkg.hasAttribute(u's60filter'):
+ s60filters = _cleanup_list(pkg.getAttribute('s60filter').split(','))
+ if pkg.hasAttribute(u'md5checksum'):
+ md5checksum = pkg.getAttribute('md5checksum')
+ if pkg.hasAttribute(u'size'):
+ size = pkg.getAttribute('size')
+ return {'type': pkg.getAttribute('type'), 'extract': pkg.getAttribute('extract'), 'default': (pkg.getAttribute('default')=="true"), \
+ 'filters': filters, 's60filter': s60filters, 'md5checksum': md5checksum, 'size': size}
+ raise Exception("Key '%s' not found." % key)
+
+ def __setitem__(self, key, value):
+ self.add_package(key, value['type'], value['default'], value['filters'], value['extract'], value['md5checksum'], value['size'])
+
+ def set_releasedetails_info(self, name, value, details="releaseID"):
+ """ Generic function to set releaseid info. """
+ detailsnode = None
+ if self._releaseDetails.getElementsByTagName(details) == []:
+ detailsnode = self._xml.createElement(details)
+ self._releaseDetails.appendChild(detailsnode)
+ else:
+ detailsnode = self._releaseDetails.getElementsByTagName(details)[0]
+ namenode = None
+ if detailsnode.getElementsByTagName(name) == []:
+ namenode = self._xml.createElement(name)
+ namenode.setAttribute(u'name', unicode(value))
+ detailsnode.appendChild(namenode)
+ else:
+ namenode = detailsnode.getElementsByTagName(name)[0]
+ namenode.setAttribute('name', value)
+
+
+ def get_releasedetails_info(self, name, details="releaseID"):
+ """ Generic function to extract releaseid info. """
+ for group in self._releaseDetails.getElementsByTagName(details):
+ for i in group.getElementsByTagName(name):
+ return i.getAttribute('name')
+ return None
+
+ def getVariantPackage(self, variant_name):
+ """get variant package"""
+ for variant in self._xml.getElementsByTagName('variant'):
+ if variant.getAttribute('name').lower() == variant_name.lower():
+ for xxx in variant.getElementsByTagName('file'):
+ return xxx.getAttribute('name')
+
+ def xml(self):
+ """ Returning the XML as a string. """
+ return self._xml.toprettyxml()
+
+ def save(self, filename = None):
+ """ Saving the XML into the provided filename. """
+ if filename == None:
+ filename = self._filename
+ file_object = codecs.open(os.path.join(filename), 'w', "utf_8")
+ file_object.write(self.xml())
+ file_object.close()
+
+ @property
+ def servicepacks(self):
+ """ Getting the service pack names. """
+ result = []
+ for spack in self._releaseInformation.getElementsByTagName('servicePack'):
+ result.append(ServicePack(spack))
+ return result
+
+ filename = property(lambda self:self._filename)
+ service = property(lambda self:self.get_releasedetails_info('service'), lambda self, value:self.set_releasedetails_info('service', value))
+ product = property(lambda self:self.get_releasedetails_info('product'), lambda self, value:self.set_releasedetails_info('product', value))
+ release = property(lambda self:self.get_releasedetails_info('release'), lambda self, value:self.set_releasedetails_info('release', value))
+ dependsof_service = property(lambda self:self.get_releasedetails_info('service', 'dependsOf'), lambda self, value:self.set_releasedetails_info('service', value, 'dependsOf'))
+ dependsof_product = property(lambda self:self.get_releasedetails_info('product', 'dependsOf'), lambda self, value:self.set_releasedetails_info('product', value, 'dependsOf'))
+ dependsof_release = property(lambda self:self.get_releasedetails_info('release', 'dependsOf'), lambda self, value:self.set_releasedetails_info('release', value, 'dependsOf'))
+ baseline_service = property(lambda self:self.get_releasedetails_info('service', 'previousBaseline'), lambda self, value:self.set_releasedetails_info('service', value, 'previousBaseline'))
+ baseline_product = property(lambda self:self.get_releasedetails_info('product', 'previousBaseline'), lambda self, value:self.set_releasedetails_info('product', value, 'previousBaseline'))
+ baseline_release = property(lambda self:self.get_releasedetails_info('release', 'previousBaseline'), lambda self, value:self.set_releasedetails_info('release', value, 'previousBaseline'))
+
+
+class MD5Updater(ReleaseMetadata):
+ """ Update Metadata XML already created from SYMREC/SYMDEC. """
+ def __init__(self, filename):
+ ReleaseMetadata.__init__(self, filename)
+ self._filepath = os.path.dirname(filename)
+
+ def update(self):
+ """ Update each existing package md5checksum and size attribute."""
+ for name in self.keys():
+ fullname = os.path.join(self._filepath, name)
+ if os.path.exists(fullname):
+ LOGGER.info("Updating %s MD5." % fullname)
+ md5value = None
+ for trial in range(3):
+ try:
+ md5value = fileutils.getmd5(fullname)
+ result = self[name]
+ result['md5checksum'] = unicode(md5value)
+ result['size'] = unicode(os.path.getsize(fullname))
+ self[name] = result
+ break
+ except Exception, e:
+ LOGGER.warning(str(e))
+ else:
+ raise Exception('Error determining %s MD5' % fullname)
+
+class ValidateReleaseMetadata(ReleaseMetadata):
+ """ This class validate if a metadata file is stored in the correct location and
+ if all deps exists.
+ """
+ def __init__(self, filename):
+ ReleaseMetadata.__init__(self, filename)
+ self.location = os.path.dirname(filename)
+
+ def is_valid(self, checkmd5=True, checkPath=True):
+ """ Run the validation mechanism. """
+ status = os.path.join(os.path.dirname(self._filename), 'HYDRASTATUS.xml')
+ if os.path.exists(status):
+ hydraxml = xml.dom.minidom.parse(open(status, "r"))
+ for t_name in hydraxml.getElementsByTagName('state')[0].childNodes:
+ if t_name.nodeType == t_name.TEXT_NODE:
+ if t_name.nodeValue != 'Ready':
+ LOGGER.error("HYDRASTATUS.xml is not ready")
+ return False
+ if checkPath:
+ if os.path.basename(self.location) != self.release:
+ LOGGER.error("Release doesn't match.")
+ return False
+ if os.path.basename(os.path.dirname(self.location)) != self.product:
+ LOGGER.error("Product doesn't match.")
+ return False
+ if os.path.basename(os.path.dirname(os.path.dirname(self.location))) != self.service:
+ LOGGER.error("Service doesn't match.")
+ return False
+
+ for name in self.keys():
+ path = os.path.join(self.location, name)
+ if not os.path.exists(path):
+ LOGGER.error("%s doesn't exist." % path)
+ return False
+ try:
+ LOGGER.debug("Trying to open %s" % path)
+ content_file = open(path)
+ content_file.read(1)
+ except IOError:
+ LOGGER.error("%s is not available yet" % path)
+ return False
+
+ if checkmd5 and self[name].has_key('md5checksum'):
+ if self[name]['md5checksum'] != None:
+ if fileutils.getmd5(path).lower() != self[name]['md5checksum']:
+ LOGGER.error("%s md5checksum missmatch." % path)
+ return False
+
+ for spack in self.servicepacks:
+ for name in spack.files:
+ path = os.path.join(self.location, name)
+ if not os.path.exists(path):
+ LOGGER.error("%s doesn't exist." % path)
+ return False
+ for name in spack.instructions:
+ path = os.path.join(self.location, name)
+ if not os.path.exists(path):
+ LOGGER.error("%s doesn't exist." % path)
+ return False
+
+ dependency = self.get_dependsof()
+ if dependency != None:
+ return ValidateReleaseMetadata(dependency.filename).is_valid(checkmd5)
+ return True
+
+class MetadataMerger(object):
+ """ Merge packages definition to the root metadata. """
+
+ def __init__(self, metadata):
+ """ Construct a metadata merger providing root metadata filename. """
+ self._metadata = ReleaseMetadata(metadata)
+
+ def merge(self, filename):
+ """ Merge the content of filename into the root metadata. """
+ metadata = ReleaseMetadata(filename)
+ for name in metadata.keys():
+ if name in self._metadata.keys():
+ LOGGER.warning('Package %s already declared, overriding previous definition!' % name)
+ self._metadata[name] = metadata[name]
+
+ def xml(self):
+ """ Returning the XML as a string. """
+ return self._metadata.xml()
+
+ def save(self, filename = None):
+ """ Saving the XML into the provided filename. """
+ return self._metadata.save(filename)
+
+class Metadata2TDD(ReleaseMetadata):
+ """ Convert Metadata to a TDD file """
+ def __init__(self, filename, includes=None, excludes=None):
+ ReleaseMetadata.__init__(self, filename)
+ if includes is None:
+ includes = []
+ if excludes is None:
+ excludes = []
+ self.location = os.path.dirname(filename)
+ self.includes = includes
+ self.excludes = excludes
+
+ def archives_to_tdd(self, metadata):
+ """archives"""
+ tdd = "\t[\n"
+ for name in metadata.keys():
+ path_ = os.path.join(os.path.dirname(metadata.filename), name)
+ if (((len(self.includes) == 0) and metadata[name]['extract']) or (self.includes in metadata[name]['s60filter'])) and self.excludes not in metadata[name]['s60filter']:
+ tdd += "\t\t{\n"
+ tdd += "\t\t\t\"command\": \"unzip_%s\",\n" % metadata[name]['extract']
+ tdd += "\t\t\t\"src\": \"%s\",\n" % os.path.normpath(path_).replace('\\', '/')
+ tdd += "\t\t},\n"
+ tdd += "\t],\n"
+ return tdd
+
+ def to_tdd(self):
+ """ Generating a TDD file that contains a list of list of filenames. """
+ tdd = "[\n"
+ # generates unarchiving steps for dependency
+ dependency = self.get_dependsof()
+ if dependency != None:
+ tdd += self.archives_to_tdd(dependency)
+ # generates unarchiving steps
+ tdd += self.archives_to_tdd(self)
+ tdd += "]\n"
+ return tdd
+
+
+
+def find_latest_metadata(releasedir):
+ """ Finding the release latest release metadata file. """
+ try:
+ metadatas = []
+ for filename in os.listdir(releasedir):
+ if re.match(r'^release_metadata(_\d+)?\.xml$', filename, re.I) is not None:
+ LOGGER.debug("Found %s" % filename)
+ metadatas.append(filename)
+ # reverse the order...
+ metadatas.sort(reverse=True)
+ if len(metadatas) > 0:
+ return os.path.normpath(os.path.join(releasedir, metadatas[0]))
+ except Exception, exc:
+ LOGGER.error(exc)
+ return None
+ return None
+
+class ValidateReleaseMetadataCached(ValidateReleaseMetadata):
+ """ Cached version of the metadata validation. """
+ def __init__(self, filename, cachefile=None):
+ ValidateReleaseMetadata.__init__(self, filename)
+ self.__cachefile = cachefile
+
+ def is_valid(self, checkmd5=True, checkPath=True):
+ """ Check if file is in the local cache.
+ Add valid release to the cache.
+ """
+ metadatas = self.load_cache()
+ if self.in_cache(metadatas, os.path.normpath(self._filename)):
+ LOGGER.debug("Release found in cache.")
+ return self.value_from_cache(metadatas, os.path.normpath(self._filename))
+ else:
+ result = ValidateReleaseMetadata.is_valid(self, checkmd5, checkPath)
+ LOGGER.debug("Updating the cache.")
+ metadatas.append([os.path.normpath(self._filename), result])
+ self.update_cache(metadatas)
+ return result
+
+ def in_cache(self, metadatas, key):
+ """in cache"""
+ for metadata in metadatas:
+ if metadata[0] == key:
+ return True
+ return False
+
+ def value_from_cache(self, metadatas, key):
+ """value from cache"""
+ for metadata in metadatas:
+ if metadata[0] == key:
+ return metadata[1]
+ return None
+
+ def load_cache(self):
+ """load cache"""
+ metadatas = []
+ if self.__cachefile is not None and os.path.exists(self.__cachefile):
+ f_file = open(self.__cachefile, "rb")
+ for row in csv.reader(f_file):
+ if len(row) == 2:
+ metadatas.append([os.path.normpath(row[0]), row[1].lower() == "true"])
+ elif len(row) == 1:
+ # backward compatibility with old cache.
+ metadatas.append([os.path.normpath(row[0]), True])
+ f_file.close()
+ return metadatas
+
+ def update_cache(self, metadatas):
+ """update cache"""
+ if self.__cachefile is not None and os.path.exists(os.path.dirname(self.__cachefile)):
+ f_file = open(self.__cachefile, "wb")
+ writer = csv.writer(f_file)
+ writer.writerows(metadatas)
+ f_file.close()
+
+class ValidateTicklerReleaseMetadata(ValidateReleaseMetadataCached):
+ """ This class validate if a metadata file is stored in the correct location and
+ if all deps exists.
+ """
+ def __init__(self, filename):
+ ReleaseMetadata.__init__(self, filename)
+ self.location = os.path.dirname(filename)
+
+ def is_valid(self, checkmd5=True):
+ """ Run the validation mechanism. """
+ tickler_path = os.path.join(self.location,"TICKLER")
+ if not os.path.exists(tickler_path):
+ LOGGER.error("Release not available yet")
+ return False
+ else:
+ return ValidateReleaseMetadataCached.is_valid(self, checkmd5)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/sysdef/api.py
--- a/buildframework/helium/sf/python/pythoncore/lib/sysdef/api.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/sysdef/api.py Sun Oct 10 15:22:15 2010 +0300
@@ -382,7 +382,6 @@
reason = filter_out(self.filters, unit.filters)
if reason == None:
# Get the unit object from the cache if this is a string
- # TODO - remove once unitlist returns list of Unit objects
if isinstance(unit, types.UnicodeType):
unit = self._sysDef[unit]
result.append(unit)
@@ -458,7 +457,6 @@
""" Initialisation """
self.__xml = xml.dom.minidom.parse(open(filename, "r"))
self._cache = {}
- #TODO - why store these as hashes?
self._units = {}
self._layers = {}
self._modules = {}
@@ -551,7 +549,6 @@
def addElement(self, element):
""" Adds SysDef element to cache. """
- #TODO - handle duplicate names of different types
if not self._cache.has_key(element.get_id()):
self._cache[element.get_id()] = element
#_logger.info('Adding SysDef element to cache: %s' % str(element))
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/sysdef/io.py
--- a/buildframework/helium/sf/python/pythoncore/lib/sysdef/io.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/sysdef/io.py Sun Oct 10 15:22:15 2010 +0300
@@ -26,8 +26,11 @@
def __init__(self, output):
""" Initialisation. """
self.output = output
- self._out = file(output, 'w')
-
+ if isinstance(output, basestring):
+ self._out = file(output, 'w')
+ else:
+ self._out = output
+
def write(self, sys_def, config_list):
""" Write the .csv data to a file for the given System Definition and configuration name. """
self._out.write('component,binary,rom,rofs1,rofs2,rofs3\n')
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/timeout_launcher.py
--- a/buildframework/helium/sf/python/pythoncore/lib/timeout_launcher.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/timeout_launcher.py Sun Oct 10 15:22:15 2010 +0300
@@ -61,14 +61,15 @@
print "e.g: timeout_launcher.py --timeout=1 -- cmd /c sleep 10"
sys.exit(-1)
else:
- _logger.debug("Start command")
+ command = ' '.join(cmdline)
+ _logger.debug("Start command: " + command)
shell = True
if _windows:
shell = False
if timeout != None:
finish = time.time() + timeout
timedout = False
- p_file = subprocess.Popen(' '.join(cmdline), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=shell)
+ p_file = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=shell)
while (p_file.poll() == None):
if time.time() > finish:
timedout = True
@@ -82,12 +83,12 @@
handle = win32api.OpenProcess(True, win32con.PROCESS_TERMINATE, p_file.pid)
win32process.TerminateProcess(handle, -1)
print "ERROR: Process killed..."
- except Exception, exc:
+ except Exception, exc: # pylint: disable=W0703
print "ERROR: %s" % exc
else:
os.kill(p_file.pid, 9) # pylint: disable=E1101
print "ERROR: exiting..."
- raise Exception("Timeout exception.")
+ raise IOError("Timeout exception.")
else:
print p_file.communicate()[0]
sys.exit(p_file.returncode)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/lib/unittestadditions.py
--- a/buildframework/helium/sf/python/pythoncore/lib/unittestadditions.py Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/sf/python/pythoncore/lib/unittestadditions.py Sun Oct 10 15:22:15 2010 +0300
@@ -41,7 +41,7 @@
def __call__(self, f_file):
""" Returns the function f_file if shouldSkip is False. Else a stub function is returned. """
- def __skiptest(*args, **kargs):
+ def __skiptest(*args, **kargs): # pylint: disable=W0613
"""skip test"""
_logger.warning("Skipping test %s" % f_file.__name__)
return self.returns
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/Invalid_distribution.policy.S60
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/tests/data/Invalid_distribution.policy.S60 Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,1 @@
+1
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/bootup_testing/test_bootup.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/tests/data/bootup_testing/test_bootup.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,52 @@
+
+
+
+ http://diamonds.com/1234
+ Smoke
+ Bootup test run
+
+
+
+
+
+
+
+
+
+ FlashTask
+
+
+
+
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+
+
+ CleanupTask
+
+
+
+
+
+
+
+
+ EmailAction
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/matti/matti_template.xml
--- a/buildframework/helium/sf/python/pythoncore/tests/data/matti/matti_template.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-
-
-
-
-
- {% if xml_dict['diamonds_build_url'] -%}
- {{ xml_dict['diamonds_build_url'] }}
- Smoke
- {% endif %}
- {{ xml_dict['testrun_name'] }}
-
-
-
-
-
-
-
-
-
- {% for exe_block in xml_dict['execution_blocks'] -%}
-
-
-
- {% if exe_block['image_files'] -%}
-
- FlashTask
-
- {% set i = 1 %}
- {% for img in exe_block['image_files'] -%}
-
- {% set i = i + 1 %}
- {% endfor -%}
-
-
- {% endif %}
-
-
- {% if exe_block['install_files'] != [] -%}
- {% for file in exe_block['install_files'] -%}
-
- FileUploadTask
-
-
-
-
-
- {% endfor -%}
- {% endif %}
-
- {% if exe_block['matti_sis_files'] != [] -%}
- {% for sisfile in exe_block['matti_sis_files'] -%}
-
- FileUploadTask
-
-
-
-
-
- {% endfor -%}
- {% endif %}
-
- {% for sis_file in exe_block["matti_sis_files"] -%}
-
- InstallSisTask
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {%- endfor -%}
-
-
- RebootTask
-
-
-
- CreateDirTask
-
-
-
-
-
-
- {% for task_file in exe_block["matti_task_files"] -%}
-
- MATTITask
-
-
-
-
-
-
-
-
- {% endfor -%}
-
-
-
- CleanupTask
-
-
-
-
-
-
- {% endfor -%}
-
-
-
- EmailAction
-
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/matti/test.rb
--- a/buildframework/helium/sf/python/pythoncore/tests/data/matti/test.rb Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-# require needed Ruby, MATTI and Orbit files
-require 'test/unit'
-require 'otest/testcase'
-
-
- #TODO: Give suitable name for test class
-class TestClassName < Test::Unit::TestCase
-
- #no need to do anything for initialize method
- def initialize (args)
- super(args)
- # TODO define application name
- app_path("hbinputtest.exe")
- end
-
- # Test case method
- #TODO: name test method with suitable name
- # Must: Test method must start test_
- # Recomended: really descriping name
- def test_do_something
-
- # create test object app from defined sut
- app = @sut.run(:name => @app_name)
- sleep(10)
-
- #Application is closed after test
- app.close
- #Verifies it is closed
-
- end #End of test case test_do_something
-
-
-end#Testsuite
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/matti/test_all_present.xml
--- a/buildframework/helium/sf/python/pythoncore/tests/data/matti/test_all_present.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-
-
-
- http://diamonds.com/1234
- Smoke
- matti test run
-
-
-
-
-
-
-
-
-
- FlashTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- InstallSisTask
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- InstallSisTask
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RebootTask
-
-
-
- CreateDirTask
-
-
-
-
-
-
- MATTITask
-
-
-
-
-
-
-
-
-
- MATTITask
-
-
-
-
-
-
-
-
-
-
- CleanupTask
-
-
-
-
-
-
-
-
- EmailAction
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/matti/test_all_present_sierra_disabled.xml
--- a/buildframework/helium/sf/python/pythoncore/tests/data/matti/test_all_present_sierra_disabled.xml Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-
-
-
- http://diamonds.com/1234
- Smoke
- matti test run
-
-
-
-
-
-
-
-
-
- FlashTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- FileUploadTask
-
-
-
-
-
-
- InstallSisTask
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- InstallSisTask
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RebootTask
-
-
-
- CreateDirTask
-
-
-
-
-
-
- MATTITask
-
-
-
-
-
-
-
-
-
- MATTITask
-
-
-
-
-
-
-
-
-
-
- CleanupTask
-
-
-
-
-
-
-
-
- EmailAction
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/packageiad/sis/testPackage.zip
Binary file buildframework/helium/sf/python/pythoncore/tests/data/packageiad/sis/testPackage.zip has changed
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/tdriver/tdriver_template.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/tests/data/tdriver/tdriver_template.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,168 @@
+
+
+
+
+
+ {% if xml_dict['diamonds_build_url'] -%}
+ {{ xml_dict['diamonds_build_url'] }}
+ Smoke
+ {% endif %}
+ {{ xml_dict['testrun_name'] }}
+
+
+
+
+
+
+
+
+
+ {% for exe_block in xml_dict['execution_blocks'] -%}
+
+
+
+ {% if exe_block['image_files'] -%}
+
+ FlashTask
+
+ {% set i = 1 %}
+ {% for img in exe_block['image_files'] -%}
+
+ {% set i = i + 1 %}
+ {% endfor -%}
+
+
+ {% endif %}
+
+
+ {% if exe_block['install_files'] != [] -%}
+ {% for file in exe_block['install_files'] -%}
+
+ FileUploadTask
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+ {% if exe_block['tdriver_sis_files'] != [] -%}
+ {% for sisfile in exe_block['tdriver_sis_files'] -%}
+
+ FileUploadTask
+
+
+
+
+
+ {% endfor -%}
+ {% endif %}
+
+ {% for sis_file in exe_block["tdriver_sis_files"] -%}
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {%- endfor -%}
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+
+ {% for task_file in exe_block["tdriver_task_files"] -%}
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+ {% endfor -%}
+
+
+
+ CleanupTask
+
+
+
+
+
+
+ {% endfor -%}
+
+
+
+ EmailAction
+
+
+
+
+
+
+ {% if xml_dict['report_location'] -%}
+
+ FileStoreAction
+
+
+
+
+
+ {% endif %}
+ {% if xml_dict['diamonds_build_url'] -%}
+
+ DiamondsAction
+
+ {% endif %}
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test.rb Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,34 @@
+# require needed Ruby, MATTI and Orbit files
+require 'test/unit'
+require 'otest/testcase'
+
+
+ #TODO: Give suitable name for test class
+class TestClassName < Test::Unit::TestCase
+
+ #no need to do anything for initialize method
+ def initialize (args)
+ super(args)
+ # TODO define application name
+ app_path("hbinputtest.exe")
+ end
+
+ # Test case method
+ #TODO: name test method with suitable name
+ # Must: Test method must start test_
+ # Recomended: really descriping name
+ def test_do_something
+
+ # create test object app from defined sut
+ app = @sut.run(:name => @app_name)
+ sleep(10)
+
+ #Application is closed after test
+ app.close
+ #Verifies it is closed
+
+ end #End of test case test_do_something
+
+
+end#Testsuite
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test_all_present.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test_all_present.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,145 @@
+
+
+
+ http://diamonds.com/1234
+ Smoke
+ TDriver test run
+
+
+
+
+
+
+
+
+
+ FlashTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+
+
+ CleanupTask
+
+
+
+
+
+
+
+
+ EmailAction
+
+
+
+
+
+
+
+ DiamondsAction
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test_all_present_tdrunner_disabled.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test_all_present_tdrunner_disabled.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,152 @@
+
+
+
+ http://diamonds.com/1234
+ Smoke
+ TDriver test run
+
+
+
+
+
+
+
+
+
+ FlashTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+
+
+ CleanupTask
+
+
+
+
+
+
+
+
+ EmailAction
+
+
+
+
+
+
+
+ FileStoreAction
+
+
+
+
+
+
+ DiamondsAction
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test_ctc.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/python/pythoncore/tests/data/tdriver/test_ctc.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,190 @@
+
+
+
+ http://diamonds.com/1234
+ Smoke
+ TDriver test run
+
+
+
+
+
+
+
+
+
+ FlashTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ FileUploadTask
+
+
+
+
+
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ InstallSisTask
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RebootTask
+
+
+
+ CreateDirTask
+
+
+
+
+
+ CreateDirTask
+
+
+
+
+
+ NonTestExecuteTask
+
+
+
+
+
+
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+
+ TestabilityTask
+
+
+
+
+
+
+
+
+
+
+ NonTestExecuteTask
+
+
+
+
+
+
+
+
+ NonTestExecuteTask
+
+
+
+
+
+
+
+
+ CTCDATA
+
+ FileDownloadTask
+
+
+
+
+
+
+
+
+ CleanupTask
+
+
+
+
+
+
+
+
+ EmailAction
+
+
+
+
+
+
+
+ DiamondsAction
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/diamonds/build_roms_sample.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/diamonds/build_roms_sample.log Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,281 @@
+Starting build: 75090
+mkdir epoc32\rombuild\temp
+Number of threads: 4
+
+++ Started at Thu May 6 13:08:38 2010
++++ HiRes Start 1273147718
+-- cmd /c imaker WORKDIR=epoc32\rombuild\temp/config_482 -f /epoc32/rom/config/platform/productexample/image_conf_productexample_ui.mk TYPE=prd rofs3-dir
+iMaker 10.12.01, 23-Mar-2010.
+===============================================================================
+Target: rofs3-dir Duration: 00:02 Status: OK
+iMaker log = `Y:/output/release_flash_images/productexample/prd/customer/vanilla/rofs3/RM-XXX_010.014_00.01_79.92_prd_imaker_rofs3-dir.log'
+ROFS3 dir = `y:/output/release_flash_images/productexample/prd/customer/vanilla/rofs3'
+ROFS3 image = `y:/output/release_flash_images/productexample/prd/customer/vanilla/rofs3/RM-XXX_010.014_00.01_79.92_prd.rofs3.img' - DOESN'T EXIST
+ROFS3 symbols = `y:/output/release_flash_images/productexample/prd/customer/vanilla/rofs3/RM-XXX_010.014_00.01_79.92_prd.rofs3.symbol' - DOESN'T EXIST
+ROFS3 flash = `y:/output/release_flash_images/productexample/prd/customer/vanilla/RM-XXX_010.014_00.01_79.92_prd.rofs3.fpsx' - DOESN'T EXIST
+-------------------------------------------------------------------------------
+Total duration: 00:03 Status: OK
+===============================================================================
++++ HiRes End 1273147721
+++ Finished at Thu May 6 13:08:41 2010
+++ Started at Thu May 6 13:08:41 2010
++++ HiRes Start 1273147721
+-- cmd /c imaker WORKDIR=epoc32\rombuild\temp/config_484 -f /epoc32/rom/config/platform/productexample/image_conf_productexample_ui.mk TYPE=rnd udaerase-dir
+iMaker 10.12.01, 23-Mar-2010.
+===============================================================================
+Target: udaerase-dir Duration: 00:01 Status: OK
+iMaker log = `Y:/output/release_flash_images/productexample/rnd/uda/udaerase/udadata/RM-XXX_010.014_79.92.2010.15_rnd_imaker_udaerase-dir.log'
+UDA Erase flash = `y:/output/release_flash_images/productexample/rnd/uda/RM-XXX_010.014_79.92.2010.15_rnd.udaerase.fpsx' - DOESN'T EXIST
+-------------------------------------------------------------------------------
+Total duration: 00:02 Status: OK
+===============================================================================
++++ HiRes End 1273147723
+++ Finished at Thu May 6 13:08:43 2010
+++ Started at Thu May 6 13:08:41 2010
++++ HiRes Start 1273147721
+-- cmd /c imaker WORKDIR=epoc32\rombuild\temp/config_485 -f /epoc32/rom/config/platform/productexample/image_conf_productexample_ui.mk TYPE=prd udaerase-dir
+iMaker 10.12.01, 23-Mar-2010.
+===============================================================================
+Target: udaerase-dir Duration: 00:01 Status: OK
+iMaker log = `Y:/output/release_flash_images/productexample/prd/uda/udaerase/udadata/RM-XXX_010.014_79.92_prd_imaker_udaerase-dir.log'
+UDA Erase flash = `y:/output/release_flash_images/productexample/prd/uda/RM-XXX_010.014_79.92_prd.udaerase.fpsx' - DOESN'T EXIST
+-------------------------------------------------------------------------------
+Total duration: 00:02 Status: OK
+===============================================================================
++++ HiRes End 1273147723
+++ Finished at Thu May 6 13:08:43 2010
+++ Started at Thu May 6 13:08:41 2010
++++ HiRes Start 1273147721
+-- cmd /c imaker WORKDIR=epoc32\rombuild\temp/config_486 -f /epoc32/rom/config/platform/productexample/image_conf_productexample_ui.mk TYPE=subcon udaerase-dir
+iMaker 10.12.01, 23-Mar-2010.
+===============================================================================
+Target: udaerase-dir Duration: 00:01 Status: OK
+iMaker log = `Y:/output/release_flash_images/productexample/subcon/uda/udaerase/udadata/RM-XXX_010.014_79.92_subcon_imaker_udaerase-dir.log'
+UDA Erase flash = `y:/output/release_flash_images/productexample/subcon/uda/RM-XXX_010.014_79.92_subcon.udaerase.fpsx' - DOESN'T EXIST
+-------------------------------------------------------------------------------
+Total duration: 00:02 Status: OK
+===============================================================================
++++ HiRes End 1273147723
+++ Finished at Thu May 6 13:08:43 2010
+++ Started at Thu May 6 13:08:40 2010
++++ HiRes Start 1273147720
+-- cmd /c imaker WORKDIR=epoc32\rombuild\temp/config_483 -f /epoc32/rom/config/platform/productexample/image_conf_productexample_ui.mk TYPE=subcon rofs3-dir
+iMaker 10.12.01, 23-Mar-2010.
+===============================================================================
+Target: rofs3-dir Duration: 00:02 Status: OK
+iMaker log = `Y:/output/release_flash_images/productexample/subcon/customer/vanilla/rofs3/RM-XXX_010.014_00.01_79.92_subcon_imaker_rofs3-dir.log'
+ROFS3 dir = `y:/output/release_flash_images/productexample/subcon/customer/vanilla/rofs3'
+ROFS3 image = `y:/output/release_flash_images/productexample/subcon/customer/vanilla/rofs3/RM-XXX_010.014_00.01_79.92_subcon.rofs3.img' - DOESN'T EXIST
+ROFS3 symbols = `y:/output/release_flash_images/productexample/subcon/customer/vanilla/rofs3/RM-XXX_010.014_00.01_79.92_subcon.rofs3.symbol' - DOESN'T EXIST
+ROFS3 flash = `y:/output/release_flash_images/productexample/subcon/customer/vanilla/RM-XXX_010.014_00.01_79.92_subcon.rofs3.fpsx' - DOESN'T EXIST
+-------------------------------------------------------------------------------
+Total duration: 00:03 Status: OK
+===============================================================================
++++ HiRes End 1273147724
+++ Finished at Thu May 6 13:08:44 2010
+-- imaker -f /epoc32/rom/config/platform/productexample/image_conf_productexample_ui.mk TYPE=rnd core-image
+++ Started at Thu May 6 13:08:45 2010
++++ HiRes Start 1273147725.83
+imaker WORKDIR=epoc32\rombuild\temp/config_16 -f /epoc32/rom/config/platform/productexample/image_conf_productexample_ui.mk TYPE=rnd core-image
+iMaker 10.12.01, 23-Mar-2010.
+Generating file(s) for Core (ROM & ROFS1) image creation
+Generating Feature manager file(s)
+Creating Core (ROM & ROFS1) SOS image
+
+Missing file(s):
+1) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(1686): Missing file: '/epoc32/data/Z/resource/apps/MPSettingsROPModel.rsc' in statement 'data='
+2) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(1824): Missing file: '/epoc32/data/Z/private/20021377/backup_registration.xml' in statement 'data='
+3) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(2596): Missing file: '/epoc32/data/z/data/system/application/licenses/product/data.xml' in statement 'data='
+4) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(2597): Missing file: '/epoc32/data/z/data/system/application/licenses/product/key' in statement 'data='
+5) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(2614): Missing file: '/epoc32/data/Z/Resource/wappush/si.dtd' in statement 'data='
+6) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(2615): Missing file: '/epoc32/data/Z/Resource/wappush/sl.dtd' in statement 'data='
+7) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(2616): Missing file: '/epoc32/data/Z/Resource/wappush/si10.tok' in statement 'data='
+8) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(2617): Missing file: '/epoc32/data/Z/Resource/wappush/sl10.tok' in statement 'data='
+9) y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_core_master.oby(4905): Missing file: '/epoc32/data/Z/resource/help/juicehelp.hlp' in statement 'data='
+
+Warning(s):
+ 1) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x000003f5
+ 2) WARNING: the value of attribute statusflags has been overridden in original feature 0x000003f5
+ 3) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x0000000b
+ 4) WARNING: the value of attribute statusflags has been overridden in original feature 0x0000000b
+ 5) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x00000584
+ 6) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000584
+ 7) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x0000019b
+ 8) WARNING: the value of attribute statusflags has been overridden in original feature 0x0000019b
+ 9) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000007
+ 10) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x000005ff
+ 11) WARNING: the value of attribute statusflags has been overridden in original feature 0x000005ff
+ 12) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x000001f8
+ 13) WARNING: the value of attribute statusflags has been overridden in original feature 0x000001f8
+ 14) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x0000000c
+ 15) WARNING: the value of attribute statusflags has been overridden in original feature 0x0000000c
+ 16) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x0000007a
+ 17) WARNING: the value of attribute statusflags has been overridden in original feature 0x0000007a
+ 18) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x00000059
+ 19) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000059
+ 20) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x00000003
+ 21) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000003
+ 22) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x00000126
+ 23) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000126
+ 24) WARNING: the value of attribute statusflags has been overridden in original feature 0x0000005b
+ 25) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x00000066
+ 26) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000066
+ 27) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x00000001
+ 28) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000001
+ 29) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x0000006b
+ 30) WARNING: the value of attribute statusflags has been overridden in original feature 0x0000006b
+ 31) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x000005f9
+ 32) WARNING: the value of attribute statusflags has been overridden in original feature 0x000005f9
+ 33) WARNING: the value of attribute statusflags has been overridden in original feature 0x00000072
+ 34) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x0000000d
+ 35) WARNING: the value of attribute statusflags has been overridden in original feature 0x0000000d
+ 36) WARNING: the value of attribute hrhmacro has been overridden in original feature 0x000006a9
+ 37) WARNING: the value of attribute statusflags has been overridden in original feature 0x000006a9
+ 38) WARNING: Error in reading features database file "/epoc32/include/s60customswfeatures.xml"
+ 39) WARNING: Unknown keyword 'LOCALISE_ALL_RESOURCES_BEGIN'. Line 2133 ignored
+ 40) WARNING: Unknown keyword 'LOCALISE_ALL_RESOURCES_END'. Line 2134 ignored
+ 41) WARNING: Unknown keyword '-----------------------------------------------------------'. Line 2210 ignored
+ 42) WARNING: Unknown keyword '-----------------------------------------------------------'. Line 2337 ignored
+ 43) WARNING: Unknown keyword '-----------------------------------------------------------'. Line 2338 ignored
+ 44) WARNING: Unknown keyword '***'. Line 2602 ignored
+ 45) WARNING: Unknown keyword 'LOCALISE_ALL_RESOURCES_BEGIN'. Line 2133 ignored
+ 46) WARNING: Unknown keyword 'LOCALISE_ALL_RESOURCES_END'. Line 2134 ignored
+ 47) WARNING: Unknown keyword '-----------------------------------------------------------'. Line 2210 ignored
+ 48) WARNING: Unknown keyword '-----------------------------------------------------------'. Line 2337 ignored
+ 49) WARNING: Unknown keyword '-----------------------------------------------------------'. Line 2338 ignored
+ 50) WARNING: Unknown keyword '***'. Line 2602 ignored
+ 51) WARNING: Kernel/variant/extension
+ 52) WARNING: Kernel/variant/extension
+ 53) WARNING: Kernel/variant/extension
+ 54) Warning: Can't open "\epoc32\release\ARMV5\urel\AR_LServer.exe.map" or "\epoc32\release\ARMV5\urel\AR_LServer.map"
+ 55) Warning: Can't open "\epoc32\release\ARMV5\urel\AP_CES_CoreComponents.dll.map" or "\epoc32\release\ARMV5\urel\AP_CES_CoreComponents.map"
+ 56) Warning: Can't open "\epoc32\release\ARMV5\urel\AP_HDMetafile2.dll.map" or "\epoc32\release\ARMV5\urel\AP_HDMetafile2.map"
+ 57) Warning: Can't open "\epoc32\release\ARMV5\urel\AP_HDOfficeCommon2.dll.map" or "\epoc32\release\ARMV5\urel\AP_HDOfficeCommon2.map"
+ 58) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_QORecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_QORecognizer.map"
+ 59) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_S60_CoreComponents.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_S60_CoreComponents.map"
+ 60) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_DeviceTransport.DLL.map" or "\epoc32\release\ARMV5\urel\ap_CES_DeviceTransport.map"
+ 61) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_zip.dll.map" or "\epoc32\release\ARMV5\urel\ap_zip.map"
+ 62) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_syb_XMLarchive.dll.map" or "\epoc32\release\ARMV5\urel\ap_syb_XMLarchive.map"
+ 63) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_FMPluginBase.dll.map" or "\epoc32\release\ARMV5\urel\ap_FMPluginBase.map"
+ 64) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_FILELISTFMPLUGIN.DLL.map" or "\epoc32\release\ARMV5\urel\ap_CES_FILELISTFMPLUGIN.map"
+ 65) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_QO_FileManager.exe.map" or "\epoc32\release\ARMV5\urel\ap_QO_FileManager.map"
+ 66) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_ces_ziprecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_ces_ziprecognizer.map"
+ 67) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_PptRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_PptRecognizer.map"
+ 68) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_PptXRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_PptXRecognizer.map"
+ 69) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_XlsRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_XlsRecognizer.map"
+ 70) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_XlsXRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_XlsXRecognizer.map"
+ 71) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_TxtRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_TxtRecognizer.map"
+ 72) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_WrdRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_WrdRecognizer.map"
+ 73) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_WrdXRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_WrdXRecognizer.map"
+ 74) Warning: Can't open "\epoc32\release\ARMV5\urel\AP_CES_QPDFDescriptor.DLL.map" or "\epoc32\release\ARMV5\urel\AP_CES_QPDFDescriptor.map"
+ 75) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_PdfRecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_PdfRecognizer.map"
+ 76) Warning: Can't open "\epoc32\release\ARMV5\urel\AP_CES_PDFFILTERINFO.DLL.map" or "\epoc32\release\ARMV5\urel\AP_CES_PDFFILTERINFO.map"
+ 77) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_applicationStub.exe.map" or "\epoc32\release\ARMV5\urel\ap_applicationStub.map"
+ 78) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_quickpdf.exe.map" or "\epoc32\release\ARMV5\urel\ap_quickpdf.map"
+ 79) WARNING: File \epoc32\data\Z\Resource\APPS\ap_registration.rom does not exist or is 0 bytes in length.
+ 80) Warning: Can't open "\epoc32\release\ARMV5\urel\ap_CES_HTTP.dll.map" or "\epoc32\release\ARMV5\urel\ap_CES_HTTP.map"
+ 81) WARNING: File \epoc32\data\Z\private\102033E6\installer\inst_plugins.cfg does not exist or is 0 bytes in length.
+ 82) Warning: Can't open "\epoc32\release\ARMV5\urel\arcimagefundamental.dll.map" or "\epoc32\release\ARMV5\urel\arcimagefundamental.map"
+ 83) Warning: Can't open "\epoc32\release\ARMV5\urel\arcplatform.dll.map" or "\epoc32\release\ARMV5\urel\arcplatform.map"
+ 84) Warning: Can't open "\epoc32\release\ARMV5\urel\arcimagecodecs.dll.map" or "\epoc32\release\ARMV5\urel\arcimagecodecs.map"
+ 85) Warning: Can't open "\epoc32\release\ARMV5\urel\photoeditor.exe.map" or "\epoc32\release\ARMV5\urel\photoeditor.map"
+ 86) Warning: Can't open "\epoc32\release\ARMV5\urel\arcamui.dll.map" or "\epoc32\release\ARMV5\urel\arcamui.map"
+ 87) Warning: Can't open "\epoc32\release\ARMV5\urel\arcpebasictool.dll.map" or "\epoc32\release\ARMV5\urel\arcpebasictool.map"
+ 88) Warning: Can't open "\epoc32\release\ARMV5\urel\arcpebase.dll.map" or "\epoc32\release\ARMV5\urel\arcpebase.map"
+ 89) Warning: Can't open "\epoc32\release\ARMV5\urel\arcpemanager.dll.map" or "\epoc32\release\ARMV5\urel\arcpemanager.map"
+ 90) Warning: Can't open "\epoc32\release\ARMV5\urel\arcampe.dll.map" or "\epoc32\release\ARMV5\urel\arcampe.map"
+ 91) Warning: Can't open "\epoc32\release\ARMV5\urel\photoeditoraiwplugin.dll.map" or "\epoc32\release\ARMV5\urel\photoeditoraiwplugin.map"
+ 92) WARNING: File \epoc32\data\Z\Resource\APPS\registration.rom does not exist or is 0 bytes in length.
+ 93) Warning: Can't open "\epoc32\release\ARMV5\urel\QO_LServer.exe.map" or "\epoc32\release\ARMV5\urel\QO_LServer.map"
+ 94) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_devicetransport.dll.map" or "\epoc32\release\ARMV5\urel\ces_devicetransport.map"
+ 95) Warning: Can't open "\epoc32\release\ARMV5\urel\CES_CoreComponents.dll.map" or "\epoc32\release\ARMV5\urel\CES_CoreComponents.map"
+ 96) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_pdfrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_pdfrecognizer.map"
+ 97) Warning: Can't open "\epoc32\release\ARMV5\urel\CES_OGLES_Charts.dll.map" or "\epoc32\release\ARMV5\urel\CES_OGLES_Charts.map"
+ 98) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_filelistfmplugin.dll.map" or "\epoc32\release\ARMV5\urel\ces_filelistfmplugin.map"
+ 99) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_pptfilterinfo.dll.map" or "\epoc32\release\ARMV5\urel\ces_pptfilterinfo.map"
+100) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_pptfilter.dll.map" or "\epoc32\release\ARMV5\urel\ces_pptfilter.map"
+101) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_pptrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_pptrecognizer.map"
+102) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_pptxfilterinfo.dll.map" or "\epoc32\release\ARMV5\urel\ces_pptxfilterinfo.map"
+103) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_ziprecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_ziprecognizer.map"
+104) Warning: Can't open "\epoc32\release\ARMV5\urel\QO_PPTX_Engine_Conv.dll.map" or "\epoc32\release\ARMV5\urel\QO_PPTX_Engine_Conv.map"
+105) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_pptxrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_pptxrecognizer.map"
+106) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_qorecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_qorecognizer.map"
+107) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_qshdescriptor.dll.map" or "\epoc32\release\ARMV5\urel\ces_qshdescriptor.map"
+108) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_qwddescriptor.dll.map" or "\epoc32\release\ARMV5\urel\ces_qwddescriptor.map"
+109) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_qptdescriptor.dll.map" or "\epoc32\release\ARMV5\urel\ces_qptdescriptor.map"
+110) Warning: Can't open "\epoc32\release\ARMV5\urel\CES_PPTXFILTER.DLL.map" or "\epoc32\release\ARMV5\urel\CES_PPTXFILTER.map"
+111) Warning: Can't open "\epoc32\release\ARMV5\urel\CES_QWS_SpellChecker.dll.map" or "\epoc32\release\ARMV5\urel\CES_QWS_SpellChecker.map"
+112) Warning: Can't open "\epoc32\release\ARMV5\urel\CES_RichText_Engine.dll.map" or "\epoc32\release\ARMV5\urel\CES_RichText_Engine.map"
+113) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_txtfilter.dll.map" or "\epoc32\release\ARMV5\urel\ces_txtfilter.map"
+114) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_txtfilterinfo.dll.map" or "\epoc32\release\ARMV5\urel\ces_txtfilterinfo.map"
+115) Warning: Can't open "\epoc32\release\ARMV5\urel\CES_S60_CoreComponents.dll.map" or "\epoc32\release\ARMV5\urel\CES_S60_CoreComponents.map"
+116) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_txtrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_txtrecognizer.map"
+117) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_wrdfilter.dll.map" or "\epoc32\release\ARMV5\urel\ces_wrdfilter.map"
+118) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_wrdfilterinfo.dll.map" or "\epoc32\release\ARMV5\urel\ces_wrdfilterinfo.map"
+119) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_wrdrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_wrdrecognizer.map"
+120) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_wrdxfilterinfo.dll.map" or "\epoc32\release\ARMV5\urel\ces_wrdxfilterinfo.map"
+121) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_wrdxrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_wrdxrecognizer.map"
+122) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_wrdxfilter.dll.map" or "\epoc32\release\ARMV5\urel\ces_wrdxfilter.map"
+123) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_xlsfilter.dll.map" or "\epoc32\release\ARMV5\urel\ces_xlsfilter.map"
+124) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_xlsfilterinfo.dll.map" or "\epoc32\release\ARMV5\urel\ces_xlsfilterinfo.map"
+125) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_xlsrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_xlsrecognizer.map"
+126) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_xlsxfilterinfo.dll.map" or "\epoc32\release\ARMV5\urel\ces_xlsxfilterinfo.map"
+127) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_xlsxrecognizer.dll.map" or "\epoc32\release\ARMV5\urel\ces_xlsxrecognizer.map"
+128) Warning: Can't open "\epoc32\release\ARMV5\urel\FMPluginBase.dll.map" or "\epoc32\release\ARMV5\urel\FMPluginBase.map"
+129) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_xlsxfilter.dll.map" or "\epoc32\release\ARMV5\urel\ces_xlsxfilter.map"
+130) Warning: Can't open "\epoc32\release\ARMV5\urel\HDExcel2.dll.map" or "\epoc32\release\ARMV5\urel\HDExcel2.map"
+131) Warning: Can't open "\epoc32\release\ARMV5\urel\HDMetafile2.dll.map" or "\epoc32\release\ARMV5\urel\HDMetafile2.map"
+132) Warning: Can't open "\epoc32\release\ARMV5\urel\HDOfficeCommon2.dll.map" or "\epoc32\release\ARMV5\urel\HDOfficeCommon2.map"
+133) Warning: Can't open "\epoc32\release\ARMV5\urel\QO_FileManager.exe.map" or "\epoc32\release\ARMV5\urel\QO_FileManager.map"
+134) Warning: Can't open "\epoc32\release\ARMV5\urel\HDPowerPoint2.dll.map" or "\epoc32\release\ARMV5\urel\HDPowerPoint2.map"
+135) Warning: Can't open "\epoc32\release\ARMV5\urel\HDWord2.dll.map" or "\epoc32\release\ARMV5\urel\HDWord2.map"
+136) Warning: Can't open "\epoc32\release\ARMV5\urel\quickpoint.exe.map" or "\epoc32\release\ARMV5\urel\quickpoint.map"
+137) Warning: Can't open "\epoc32\release\ARMV5\urel\quicksheet.exe.map" or "\epoc32\release\ARMV5\urel\quicksheet.map"
+138) Warning: Can't open "\epoc32\release\ARMV5\urel\Quickpoint_DOM.dll.map" or "\epoc32\release\ARMV5\urel\Quickpoint_DOM.map"
+139) Warning: Can't open "\epoc32\release\ARMV5\urel\Quicksheet_DOM.dll.map" or "\epoc32\release\ARMV5\urel\Quicksheet_DOM.map"
+140) Warning: Can't open "\epoc32\release\ARMV5\urel\Quickword.exe.map" or "\epoc32\release\ARMV5\urel\Quickword.map"
+141) Warning: Can't open "\epoc32\release\ARMV5\urel\SYB_XMLArchive.dll.map" or "\epoc32\release\ARMV5\urel\SYB_XMLArchive.map"
+142) Warning: Can't open "\epoc32\release\ARMV5\urel\Quickword_DOM.dll.map" or "\epoc32\release\ARMV5\urel\Quickword_DOM.map"
+143) Warning: Can't open "\epoc32\release\ARMV5\urel\QuickPDFStub.exe.map" or "\epoc32\release\ARMV5\urel\QuickPDFStub.map"
+144) Warning: Can't open "\epoc32\release\ARMV5\urel\CES_HTTP.dll.map" or "\epoc32\release\ARMV5\urel\CES_HTTP.map"
+145) Warning: Can't open "\epoc32\release\ARMV5\urel\ces_pdffilterinfostub.dll.map" or "\epoc32\release\ARMV5\urel\ces_pdffilterinfostub.map"
+146) Warning: Can't open "\epoc32\release\ARMV5\urel\zip.dll.map" or "\epoc32\release\ARMV5\urel\zip.map"
+147) Warning: Can't open "\epoc32\release\ARMV5\urel\videoeditor.exe.map" or "\epoc32\release\ARMV5\urel\videoeditor.map"
+148) Warning: Can't open "\epoc32\release\ARMV5\urel\amur.dll.map" or "\epoc32\release\ARMV5\urel\amur.map"
+149) Warning: Can't open "\epoc32\release\ARMV5\urel\arcavcodecs.dll.map" or "\epoc32\release\ARMV5\urel\arcavcodecs.map"
+150) Warning: Can't open "\epoc32\release\ARMV5\urel\amvesession.dll.map" or "\epoc32\release\ARMV5\urel\amvesession.map"
+151) Warning: Can't open "\epoc32\release\ARMV5\urel\videoeditoraiwplugin.dll.map" or "\epoc32\release\ARMV5\urel\videoeditoraiwplugin.map"
+152) Warning: Can't open "\epoc32\release\ARMV5\urel\3GPExtParser.dll.map" or "\epoc32\release\ARMV5\urel\3GPExtParser.map"
+153) Warning: Can't open "\epoc32\release\ARMV5\urel\VtcpCmpFilter.dll.map" or "\epoc32\release\ARMV5\urel\VtcpCmpFilter.map"
+154) Warning: Can't open "\epoc32\release\ARMV5\urel\SenVtcpTransport.dll.map" or "\epoc32\release\ARMV5\urel\SenVtcpTransport.map"
+155) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmkeystorage.dll.map" or "\epoc32\release\ARMV5\urel\wmdrmkeystorage.map"
+156) Warning: Can't open "\epoc32\release\ARMV5\urel\hxwmdrmplugin.dll.map" or "\epoc32\release\ARMV5\urel\hxwmdrmplugin.map"
+157) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmota.dll.map" or "\epoc32\release\ARMV5\urel\wmdrmota.map"
+158) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmpkclient.dll.map" or "\epoc32\release\ARMV5\urel\wmdrmpkclient.map"
+159) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmpkserver.exe.map" or "\epoc32\release\ARMV5\urel\wmdrmpkserver.map"
+160) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmpkclientwrapper.dll.map" or "\epoc32\release\ARMV5\urel\wmdrmpkclientwrapper.map"
+161) Warning: Can't open "\epoc32\release\ARMV5\urel\cameseutility.dll.map" or "\epoc32\release\ARMV5\urel\cameseutility.map"
+162) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmagent.dll.map" or "\epoc32\release\ARMV5\urel\wmdrmagent.map"
+163) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmdla.dll.map" or "\epoc32\release\ARMV5\urel\wmdrmdla.map"
+164) Warning: Can't open "\epoc32\release\ARMV5\urel\wmdrmpd.dll.map" or "\epoc32\release\ARMV5\urel\wmdrmpd.map"
+165) Warning: Can't open "\epoc32\release\gcce\urel\zipmanager.exe.map" or "\epoc32\release\gcce\urel\zipmanager.map"
+166) Warning: Can't open "\epoc32\release\armv5\udeb\ctcmangui.exe.map" or "\epoc32\release\armv5\udeb\ctcmangui.map"
+167) Warning: Can't open "\epoc32\release\ARMV5\urel\eunits60gui.exe.map" or "\epoc32\release\ARMV5\urel\eunits60gui.map"
+168) Warning: Can't open "\epoc32\release\ARMV5\urel\eunitappenvironment.exe.map" or "\epoc32\release\ARMV5\urel\eunitappenvironment.map"
+169) Warning: Can't open "\epoc32\release\ARMV5\urel\euniteikappenvironment.exe.map" or "\epoc32\release\ARMV5\urel\euniteikappenvironment.map"
+170) Warning: Can't open "\epoc32\release\ARMV5\urel\qakitcommonui.dll.map" or "\epoc32\release\ARMV5\urel\qakitcommonui.map"
+171) Warning: Can't open "\epoc32\release\ARMV5\urel\digiaconnect.exe.map" or "\epoc32\release\ARMV5\urel\digiaconnect.map"
+
+Error(s):
+1) ERROR: (/epoc32/include/s60customswfeatures.xml) Feature "KFEATUREIDFFMOBILITYMANAGEMENTERRORS" already exists
+===============================================================================
+Target: core-image Duration: 14:26 Status: OK
+iMaker log = `Y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd_imaker_core-image.log'
+Core (ROM & ROFS1) dir = `y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd'
+Core ROM image = `y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd.rom.img'
+Core ROM symbols = `y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd.rom.symbol'
+Core ROFS1 image = `y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd.rofs1.img'
+Core ROFS1 symbols = `y:/output/release_flash_images/productexample/rnd/core/RM-XXX_010.014_79.92.2010.15_rnd/RM-XXX_010.014_79.92.2010.15_rnd.rofs1.symbol'
+-------------------------------------------------------------------------------
+Total duration: 14:29 Status: OK
+===============================================================================
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_failure/.static/default.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_failure/.static/default.css Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,843 @@
+/**
+ * Sphinx Doc Design
+ */
+
+body {
+ font-family: sans-serif;
+ font-size: 100%;
+ background-color: #11303d;
+ color: #000;
+ margin: 0;
+ padding: 0;
+}
+
+/* :::: LAYOUT :::: */
+
+div.document {
+ background-color: #1c4e63;
+}
+
+div.documentwrapper {
+ float: left;
+ width: 100%;
+}
+
+div.bodywrapper {
+ margin: 0 0 0 230px;
+}
+
+div.body {
+ background-color: white;
+ padding: 0 20px 30px 20px;
+}
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 230px;
+ margin-left: -100%;
+ font-size: 90%;
+}
+
+div.clearer {
+ clear: both;
+}
+
+div.footer {
+ color: #fff;
+ width: 100%;
+ padding: 9px 0 9px 0;
+ text-align: center;
+ font-size: 75%;
+}
+
+div.footer a {
+ color: #fff;
+ text-decoration: underline;
+}
+
+div.related {
+ background-color: #133f52;
+ color: #fff;
+ width: 100%;
+ height: 30px;
+ line-height: 30px;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+div.related a {
+ color: white;
+}
+
+/* ::: TOC :::: */
+div.sphinxsidebar h3 {
+ font-family: 'Trebuchet MS', sans-serif;
+ color: white;
+ font-size: 1.4em;
+ font-weight: normal;
+ margin: 0;
+ padding: 0;
+}
+
+div.sphinxsidebar h4 {
+ font-family: 'Trebuchet MS', sans-serif;
+ color: white;
+ font-size: 1.3em;
+ font-weight: normal;
+ margin: 5px 0 0 0;
+ padding: 0;
+}
+
+div.sphinxsidebar p {
+ color: white;
+}
+
+div.sphinxsidebar p.topless {
+ margin: 5px 10px 10px 10px;
+}
+
+div.sphinxsidebar ul {
+ margin: 10px;
+ padding: 0;
+ list-style: none;
+ color: white;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar a {
+ color: #98dbcc;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+/* :::: MODULE CLOUD :::: */
+div.modulecloud {
+ margin: -5px 10px 5px 10px;
+ padding: 10px;
+ line-height: 160%;
+ border: 1px solid #cbe7e5;
+ background-color: #f2fbfd;
+}
+
+div.modulecloud a {
+ padding: 0 5px 0 5px;
+}
+
+/* :::: SEARCH :::: */
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* :::: COMMON FORM STYLES :::: */
+
+div.actions {
+ padding: 5px 10px 5px 10px;
+ border-top: 1px solid #cbe7e5;
+ border-bottom: 1px solid #cbe7e5;
+ background-color: #e0f6f4;
+}
+
+form dl {
+ color: #333;
+}
+
+form dt {
+ clear: both;
+ float: left;
+ min-width: 110px;
+ margin-right: 10px;
+ padding-top: 2px;
+}
+
+input#homepage {
+ display: none;
+}
+
+div.error {
+ margin: 5px 20px 0 0;
+ padding: 5px;
+ border: 1px solid #d00;
+ font-weight: bold;
+}
+
+/* :::: INLINE COMMENTS :::: */
+
+div.inlinecomments {
+ position: absolute;
+ right: 20px;
+}
+
+div.inlinecomments a.bubble {
+ display: block;
+ float: right;
+ background-image: url(style/comment.png);
+ background-repeat: no-repeat;
+ width: 25px;
+ height: 25px;
+ text-align: center;
+ padding-top: 3px;
+ font-size: 0.9em;
+ line-height: 14px;
+ font-weight: bold;
+ color: black;
+}
+
+div.inlinecomments a.bubble span {
+ display: none;
+}
+
+div.inlinecomments a.emptybubble {
+ background-image: url(style/nocomment.png);
+}
+
+div.inlinecomments a.bubble:hover {
+ background-image: url(style/hovercomment.png);
+ text-decoration: none;
+ color: #3ca0a4;
+}
+
+div.inlinecomments div.comments {
+ float: right;
+ margin: 25px 5px 0 0;
+ max-width: 50em;
+ min-width: 30em;
+ border: 1px solid #2eabb0;
+ background-color: #f2fbfd;
+ z-index: 150;
+}
+
+div#comments {
+ border: 1px solid #2eabb0;
+ margin-top: 20px;
+}
+
+div#comments div.nocomments {
+ padding: 10px;
+ font-weight: bold;
+}
+
+div.inlinecomments div.comments h3,
+div#comments h3 {
+ margin: 0;
+ padding: 0;
+ background-color: #2eabb0;
+ color: white;
+ border: none;
+ padding: 3px;
+}
+
+div.inlinecomments div.comments div.actions {
+ padding: 4px;
+ margin: 0;
+ border-top: none;
+}
+
+div#comments div.comment {
+ margin: 10px;
+ border: 1px solid #2eabb0;
+}
+
+div.inlinecomments div.comment h4,
+div.commentwindow div.comment h4,
+div#comments div.comment h4 {
+ margin: 10px 0 0 0;
+ background-color: #2eabb0;
+ color: white;
+ border: none;
+ padding: 1px 4px 1px 4px;
+}
+
+div#comments div.comment h4 {
+ margin: 0;
+}
+
+div#comments div.comment h4 a {
+ color: #d5f4f4;
+}
+
+div.inlinecomments div.comment div.text,
+div.commentwindow div.comment div.text,
+div#comments div.comment div.text {
+ margin: -5px 0 -5px 0;
+ padding: 0 10px 0 10px;
+}
+
+div.inlinecomments div.comment div.meta,
+div.commentwindow div.comment div.meta,
+div#comments div.comment div.meta {
+ text-align: right;
+ padding: 2px 10px 2px 0;
+ font-size: 95%;
+ color: #538893;
+ border-top: 1px solid #cbe7e5;
+ background-color: #e0f6f4;
+}
+
+div.commentwindow {
+ position: absolute;
+ width: 500px;
+ border: 1px solid #cbe7e5;
+ background-color: #f2fbfd;
+ display: none;
+ z-index: 130;
+}
+
+div.commentwindow h3 {
+ margin: 0;
+ background-color: #2eabb0;
+ color: white;
+ border: none;
+ padding: 5px;
+ font-size: 1.5em;
+ cursor: pointer;
+}
+
+div.commentwindow div.actions {
+ margin: 10px -10px 0 -10px;
+ padding: 4px 10px 4px 10px;
+ color: #538893;
+}
+
+div.commentwindow div.actions input {
+ border: 1px solid #2eabb0;
+ background-color: white;
+ color: #135355;
+ cursor: pointer;
+}
+
+div.commentwindow div.form {
+ padding: 0 10px 0 10px;
+}
+
+div.commentwindow div.form input,
+div.commentwindow div.form textarea {
+ border: 1px solid #3c9ea2;
+ background-color: white;
+ color: black;
+}
+
+div.commentwindow div.error {
+ margin: 10px 5px 10px 5px;
+ background-color: #fbe5dc;
+ display: none;
+}
+
+div.commentwindow div.form textarea {
+ width: 99%;
+}
+
+div.commentwindow div.preview {
+ margin: 10px 0 10px 0;
+ background-color: #70d0d4;
+ padding: 0 1px 1px 25px;
+}
+
+div.commentwindow div.preview h4 {
+ margin: 0 0 -5px -20px;
+ padding: 4px 0 0 4px;
+ color: white;
+ font-size: 1.3em;
+}
+
+div.commentwindow div.preview div.comment {
+ background-color: #f2fbfd;
+}
+
+div.commentwindow div.preview div.comment h4 {
+ margin: 10px 0 0 0!important;
+ padding: 1px 4px 1px 4px!important;
+ font-size: 1.2em;
+}
+
+/* :::: SUGGEST CHANGES :::: */
+div#suggest-changes-box input, div#suggest-changes-box textarea {
+ border: 1px solid #ccc;
+ background-color: white;
+ color: black;
+}
+
+div#suggest-changes-box textarea {
+ width: 99%;
+ height: 400px;
+}
+
+
+/* :::: PREVIEW :::: */
+div.preview {
+ background-image: url(style/preview.png);
+ padding: 0 20px 20px 20px;
+ margin-bottom: 30px;
+}
+
+
+/* :::: INDEX PAGE :::: */
+
+table.contentstable {
+ width: 90%;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* :::: INDEX STYLES :::: */
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+form.pfform {
+ margin: 10px 0 20px 0;
+}
+
+/* :::: GLOBAL STYLES :::: */
+
+.docwarning {
+ background-color: #ffe4e4;
+ padding: 10px;
+ margin: 0 -20px 0 -20px;
+ border-bottom: 1px solid #f66;
+}
+
+p.subhead {
+ font-weight: bold;
+ margin-top: 20px;
+}
+
+/*BMT added 16/10/08 */
+a:link {
+ color: blue;
+ text-decoration: none;
+}
+
+a:visited {
+ color: navy;
+ text-decoration: none;
+}
+
+a:hover {
+ color: purple;
+ text-decoration: underline;
+}
+/* BMT end added 16/10/08 */
+
+
+div.body h1,
+div.body h2,
+div.body h3,
+div.body h4,
+div.body h5,
+div.body h6 {
+ font-family: 'Trebuchet MS', sans-serif;
+ background-color: #f2f2f2;
+ font-weight: normal;
+ color: #20435c;
+ border-bottom: 1px solid #ccc;
+ margin: 20px -20px 10px -20px;
+ padding: 3px 0 3px 10px;
+}
+
+div.body h1 { margin-top: 0; font-size: 250%; color:black;}
+div.body h2 { font-size: 190%; color:#36237f;}
+div.body h3 { font-size: 150%; color:#4933af;}
+div.body h4 { font-size: 120%; color:#6223df;}
+div.body h5 { font-size: 100%; color:#6f23ef;}
+div.body h6 { font-size: 80%; color:#5a62ff;}
+
+a.headerlink {
+ color: #c60f0f;
+ font-size: 0.8em;
+ padding: 0 4px 0 4px;
+ text-decoration: none;
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+a.headerlink:hover {
+ background-color: #c60f0f;
+ color: white;
+}
+
+div.body p, div.body dd, div.body li {
+ text-align: left;
+ line-height: 130%;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+ul.fakelist {
+ list-style: none;
+ margin: 10px 0 10px 20px;
+ padding: 0;
+}
+
+.field-list ul {
+ padding-left: 1em;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+/* "Footnotes" heading */
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+/* "Topics" */
+
+div.topic {
+ background-color: #eee;
+ border: 1px solid #ccc;
+ padding: 0 7px 0 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* Admonitions */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+div.admonition p {
+ display: inline;
+}
+
+div.seealso {
+ background-color: #ffc;
+ border: 1px solid #ff6;
+}
+
+div.warning {
+ background-color: #ffe4e4;
+ border: 1px solid #f66;
+}
+
+div.note {
+ background-color: #eee;
+ border: 1px solid #ccc;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+ display: inline;
+}
+
+p.admonition-title:after {
+ content: ":";
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+table.docutils {
+ border: 0;
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 0;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+dl {
+ margin-bottom: 15px;
+ clear: both;
+}
+
+dd p {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+.refcount {
+ color: #060;
+}
+
+dt:target,
+.highlight {
+ background-color: #fbe54e;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+pre {
+ padding: 5px;
+ background-color: #efc;
+ color: #333;
+ border: 1px solid #ac9;
+ border-left: none;
+ border-right: none;
+ overflow: auto;
+ word-wrap: break-word;
+}
+
+td.linenos pre {
+ padding: 5px 0px;
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ margin-left: 0.5em;
+}
+
+table.highlighttable td {
+ padding: 0 0.5em 0 0.5em;
+}
+
+tt {
+ background-color: #ecf0f3;
+ padding: 0 1px 0 1px;
+ font-size: 0.95em;
+}
+
+tt.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+tt.descclassname {
+ background-color: transparent;
+}
+
+tt.xref, a tt {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+.footnote:target { background-color: #ffa }
+
+h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+ background-color: transparent;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+form.comment {
+ margin: 0;
+ padding: 10px 30px 10px 30px;
+ background-color: #eee;
+}
+
+form.comment h3 {
+ background-color: #326591;
+ color: white;
+ margin: -10px -30px 10px -30px;
+ padding: 5px;
+ font-size: 1.4em;
+}
+
+form.comment input,
+form.comment textarea {
+ border: 1px solid #ccc;
+ padding: 2px;
+ font-family: sans-serif;
+ font-size: 100%;
+}
+
+form.comment input[type="text"] {
+ width: 240px;
+}
+
+form.comment textarea {
+ width: 100%;
+ height: 200px;
+ margin-bottom: 10px;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+/* :::: PRINT :::: */
+@media print {
+ div.document,
+ div.documentwrapper,
+ div.bodywrapper {
+ margin: 0;
+ width : 100%;
+ }
+
+ div.sphinxsidebar,
+ div.related,
+ div.footer,
+ div#comments div.new-comment-box,
+ #top-link {
+ display: none;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_failure/.templates/indexcontent.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_failure/.templates/indexcontent.html Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,38 @@
+{% extends "defindex.html" %}
+{% block tables %}
+ Parts of the documentation:
+
+
+ Release notes
+ what's new
+ Quick Start Guide
+ start here
+ Feature list
+ what is supported
+ Manual
+ reference docs
+
+ HowTos
+ specific use cases
+ Helium API
+ or check Targets , Properties , Macros
+ Ant libraries
+ when you just have to customize
+ Development
+ for helium hackers everywhere
+ Architecture
+ many pieces, loosely joined
+
+
+
+ Customer documentation:
+
+
+ IDO
+ integration domains
+
+ TeamCI
+ development teams
+
+
+{% endblock %}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_failure/.templates/sidebar.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_failure/.templates/sidebar.html Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,6 @@
+
+Docs for other versions
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_failure/conf.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_failure/conf.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,183 @@
+# -*- coding: utf-8 -*-
+#============================================================================
+#Name : ant.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+#
+# Helium Documentation documentation build configuration file, created by
+# sphinx-quickstart on Fri May 09 09:49:44 2008.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# The contents of this file are pickled, so don't put values in the namespace
+# that aren't pickleable (module imports are okay, they're removed automatically).
+#
+# All configuration values have a default value; values that are commented out
+# serve to show the default value.
+
+import sys, os
+
+# If your extensions are in another directory, add it here. If the directory
+# is relative to the documentation root, use os.path.abspath to make it
+# absolute, like shown here.
+#sys.path.append(os.path.abspath('some/directory'))
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx_ext']
+#api_doc_base_url =
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['.templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General substitutions.
+project = 'Helium'
+copyright = '2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.eclipse.org/legal/epl-v10.html'
+
+# The default replacements for |version| and |release|, also used in various
+# other places throughout the built documents.
+#
+# The short X.Y version.
+version = '0.23'
+# The full version, including alpha/beta/rc tags.
+release = '0.23'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directories, that shouldn't be searched
+# for source files.
+#exclude_dirs = []
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'default.css'
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+#html_title = None
+
+# The name of an image file (within the static path) to place at the top of
+# the sidebar.
+html_logo = 'helium_pallot_small.jpg'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['.static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+html_sidebars = {
+ 'index': 'sidebar.html'
+}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+html_additional_pages = {
+ 'index': 'indexcontent.html',
+}
+
+# If false, no module index is generated.
+html_use_modindex = False
+
+# If true, the reST sources are included in the HTML build as _sources/.
+#html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Helium doc'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, document class [howto/manual]).
+latex_documents = [
+ ('index', 'Helium.tex', 'Helium Documentation', 'The Helium Team', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_failure/helium_pallot_small.jpg
Binary file buildframework/helium/tests/data/doc/input_for_failure/helium_pallot_small.jpg has changed
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_failure/index.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_failure/index.rst Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,33 @@
+.. ============================================================================
+ Name : index.rst
+ Part of : Helium
+
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ ============================================================================
+
+###################################
+ Helium
+###################################
+
+":hlm-p:`this.property.doesnt.exist`"
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_pass/.static/default.css
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_pass/.static/default.css Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,843 @@
+/**
+ * Sphinx Doc Design
+ */
+
+body {
+ font-family: sans-serif;
+ font-size: 100%;
+ background-color: #11303d;
+ color: #000;
+ margin: 0;
+ padding: 0;
+}
+
+/* :::: LAYOUT :::: */
+
+div.document {
+ background-color: #1c4e63;
+}
+
+div.documentwrapper {
+ float: left;
+ width: 100%;
+}
+
+div.bodywrapper {
+ margin: 0 0 0 230px;
+}
+
+div.body {
+ background-color: white;
+ padding: 0 20px 30px 20px;
+}
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 230px;
+ margin-left: -100%;
+ font-size: 90%;
+}
+
+div.clearer {
+ clear: both;
+}
+
+div.footer {
+ color: #fff;
+ width: 100%;
+ padding: 9px 0 9px 0;
+ text-align: center;
+ font-size: 75%;
+}
+
+div.footer a {
+ color: #fff;
+ text-decoration: underline;
+}
+
+div.related {
+ background-color: #133f52;
+ color: #fff;
+ width: 100%;
+ height: 30px;
+ line-height: 30px;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+div.related a {
+ color: white;
+}
+
+/* ::: TOC :::: */
+div.sphinxsidebar h3 {
+ font-family: 'Trebuchet MS', sans-serif;
+ color: white;
+ font-size: 1.4em;
+ font-weight: normal;
+ margin: 0;
+ padding: 0;
+}
+
+div.sphinxsidebar h4 {
+ font-family: 'Trebuchet MS', sans-serif;
+ color: white;
+ font-size: 1.3em;
+ font-weight: normal;
+ margin: 5px 0 0 0;
+ padding: 0;
+}
+
+div.sphinxsidebar p {
+ color: white;
+}
+
+div.sphinxsidebar p.topless {
+ margin: 5px 10px 10px 10px;
+}
+
+div.sphinxsidebar ul {
+ margin: 10px;
+ padding: 0;
+ list-style: none;
+ color: white;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar a {
+ color: #98dbcc;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+/* :::: MODULE CLOUD :::: */
+div.modulecloud {
+ margin: -5px 10px 5px 10px;
+ padding: 10px;
+ line-height: 160%;
+ border: 1px solid #cbe7e5;
+ background-color: #f2fbfd;
+}
+
+div.modulecloud a {
+ padding: 0 5px 0 5px;
+}
+
+/* :::: SEARCH :::: */
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* :::: COMMON FORM STYLES :::: */
+
+div.actions {
+ padding: 5px 10px 5px 10px;
+ border-top: 1px solid #cbe7e5;
+ border-bottom: 1px solid #cbe7e5;
+ background-color: #e0f6f4;
+}
+
+form dl {
+ color: #333;
+}
+
+form dt {
+ clear: both;
+ float: left;
+ min-width: 110px;
+ margin-right: 10px;
+ padding-top: 2px;
+}
+
+input#homepage {
+ display: none;
+}
+
+div.error {
+ margin: 5px 20px 0 0;
+ padding: 5px;
+ border: 1px solid #d00;
+ font-weight: bold;
+}
+
+/* :::: INLINE COMMENTS :::: */
+
+div.inlinecomments {
+ position: absolute;
+ right: 20px;
+}
+
+div.inlinecomments a.bubble {
+ display: block;
+ float: right;
+ background-image: url(style/comment.png);
+ background-repeat: no-repeat;
+ width: 25px;
+ height: 25px;
+ text-align: center;
+ padding-top: 3px;
+ font-size: 0.9em;
+ line-height: 14px;
+ font-weight: bold;
+ color: black;
+}
+
+div.inlinecomments a.bubble span {
+ display: none;
+}
+
+div.inlinecomments a.emptybubble {
+ background-image: url(style/nocomment.png);
+}
+
+div.inlinecomments a.bubble:hover {
+ background-image: url(style/hovercomment.png);
+ text-decoration: none;
+ color: #3ca0a4;
+}
+
+div.inlinecomments div.comments {
+ float: right;
+ margin: 25px 5px 0 0;
+ max-width: 50em;
+ min-width: 30em;
+ border: 1px solid #2eabb0;
+ background-color: #f2fbfd;
+ z-index: 150;
+}
+
+div#comments {
+ border: 1px solid #2eabb0;
+ margin-top: 20px;
+}
+
+div#comments div.nocomments {
+ padding: 10px;
+ font-weight: bold;
+}
+
+div.inlinecomments div.comments h3,
+div#comments h3 {
+ margin: 0;
+ padding: 0;
+ background-color: #2eabb0;
+ color: white;
+ border: none;
+ padding: 3px;
+}
+
+div.inlinecomments div.comments div.actions {
+ padding: 4px;
+ margin: 0;
+ border-top: none;
+}
+
+div#comments div.comment {
+ margin: 10px;
+ border: 1px solid #2eabb0;
+}
+
+div.inlinecomments div.comment h4,
+div.commentwindow div.comment h4,
+div#comments div.comment h4 {
+ margin: 10px 0 0 0;
+ background-color: #2eabb0;
+ color: white;
+ border: none;
+ padding: 1px 4px 1px 4px;
+}
+
+div#comments div.comment h4 {
+ margin: 0;
+}
+
+div#comments div.comment h4 a {
+ color: #d5f4f4;
+}
+
+div.inlinecomments div.comment div.text,
+div.commentwindow div.comment div.text,
+div#comments div.comment div.text {
+ margin: -5px 0 -5px 0;
+ padding: 0 10px 0 10px;
+}
+
+div.inlinecomments div.comment div.meta,
+div.commentwindow div.comment div.meta,
+div#comments div.comment div.meta {
+ text-align: right;
+ padding: 2px 10px 2px 0;
+ font-size: 95%;
+ color: #538893;
+ border-top: 1px solid #cbe7e5;
+ background-color: #e0f6f4;
+}
+
+div.commentwindow {
+ position: absolute;
+ width: 500px;
+ border: 1px solid #cbe7e5;
+ background-color: #f2fbfd;
+ display: none;
+ z-index: 130;
+}
+
+div.commentwindow h3 {
+ margin: 0;
+ background-color: #2eabb0;
+ color: white;
+ border: none;
+ padding: 5px;
+ font-size: 1.5em;
+ cursor: pointer;
+}
+
+div.commentwindow div.actions {
+ margin: 10px -10px 0 -10px;
+ padding: 4px 10px 4px 10px;
+ color: #538893;
+}
+
+div.commentwindow div.actions input {
+ border: 1px solid #2eabb0;
+ background-color: white;
+ color: #135355;
+ cursor: pointer;
+}
+
+div.commentwindow div.form {
+ padding: 0 10px 0 10px;
+}
+
+div.commentwindow div.form input,
+div.commentwindow div.form textarea {
+ border: 1px solid #3c9ea2;
+ background-color: white;
+ color: black;
+}
+
+div.commentwindow div.error {
+ margin: 10px 5px 10px 5px;
+ background-color: #fbe5dc;
+ display: none;
+}
+
+div.commentwindow div.form textarea {
+ width: 99%;
+}
+
+div.commentwindow div.preview {
+ margin: 10px 0 10px 0;
+ background-color: #70d0d4;
+ padding: 0 1px 1px 25px;
+}
+
+div.commentwindow div.preview h4 {
+ margin: 0 0 -5px -20px;
+ padding: 4px 0 0 4px;
+ color: white;
+ font-size: 1.3em;
+}
+
+div.commentwindow div.preview div.comment {
+ background-color: #f2fbfd;
+}
+
+div.commentwindow div.preview div.comment h4 {
+ margin: 10px 0 0 0!important;
+ padding: 1px 4px 1px 4px!important;
+ font-size: 1.2em;
+}
+
+/* :::: SUGGEST CHANGES :::: */
+div#suggest-changes-box input, div#suggest-changes-box textarea {
+ border: 1px solid #ccc;
+ background-color: white;
+ color: black;
+}
+
+div#suggest-changes-box textarea {
+ width: 99%;
+ height: 400px;
+}
+
+
+/* :::: PREVIEW :::: */
+div.preview {
+ background-image: url(style/preview.png);
+ padding: 0 20px 20px 20px;
+ margin-bottom: 30px;
+}
+
+
+/* :::: INDEX PAGE :::: */
+
+table.contentstable {
+ width: 90%;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* :::: INDEX STYLES :::: */
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable dl, table.indextable dd {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+form.pfform {
+ margin: 10px 0 20px 0;
+}
+
+/* :::: GLOBAL STYLES :::: */
+
+.docwarning {
+ background-color: #ffe4e4;
+ padding: 10px;
+ margin: 0 -20px 0 -20px;
+ border-bottom: 1px solid #f66;
+}
+
+p.subhead {
+ font-weight: bold;
+ margin-top: 20px;
+}
+
+/*BMT added 16/10/08 */
+a:link {
+ color: blue;
+ text-decoration: none;
+}
+
+a:visited {
+ color: navy;
+ text-decoration: none;
+}
+
+a:hover {
+ color: purple;
+ text-decoration: underline;
+}
+/* BMT end added 16/10/08 */
+
+
+div.body h1,
+div.body h2,
+div.body h3,
+div.body h4,
+div.body h5,
+div.body h6 {
+ font-family: 'Trebuchet MS', sans-serif;
+ background-color: #f2f2f2;
+ font-weight: normal;
+ color: #20435c;
+ border-bottom: 1px solid #ccc;
+ margin: 20px -20px 10px -20px;
+ padding: 3px 0 3px 10px;
+}
+
+div.body h1 { margin-top: 0; font-size: 250%; color:black;}
+div.body h2 { font-size: 190%; color:#36237f;}
+div.body h3 { font-size: 150%; color:#4933af;}
+div.body h4 { font-size: 120%; color:#6223df;}
+div.body h5 { font-size: 100%; color:#6f23ef;}
+div.body h6 { font-size: 80%; color:#5a62ff;}
+
+a.headerlink {
+ color: #c60f0f;
+ font-size: 0.8em;
+ padding: 0 4px 0 4px;
+ text-decoration: none;
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+a.headerlink:hover {
+ background-color: #c60f0f;
+ color: white;
+}
+
+div.body p, div.body dd, div.body li {
+ text-align: left;
+ line-height: 130%;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+ul.fakelist {
+ list-style: none;
+ margin: 10px 0 10px 20px;
+ padding: 0;
+}
+
+.field-list ul {
+ padding-left: 1em;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+/* "Footnotes" heading */
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+/* "Topics" */
+
+div.topic {
+ background-color: #eee;
+ border: 1px solid #ccc;
+ padding: 0 7px 0 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* Admonitions */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+div.admonition p {
+ display: inline;
+}
+
+div.seealso {
+ background-color: #ffc;
+ border: 1px solid #ff6;
+}
+
+div.warning {
+ background-color: #ffe4e4;
+ border: 1px solid #f66;
+}
+
+div.note {
+ background-color: #eee;
+ border: 1px solid #ccc;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+ display: inline;
+}
+
+p.admonition-title:after {
+ content: ":";
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+table.docutils {
+ border: 0;
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 0;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+dl {
+ margin-bottom: 15px;
+ clear: both;
+}
+
+dd p {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+.refcount {
+ color: #060;
+}
+
+dt:target,
+.highlight {
+ background-color: #fbe54e;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+pre {
+ padding: 5px;
+ background-color: #efc;
+ color: #333;
+ border: 1px solid #ac9;
+ border-left: none;
+ border-right: none;
+ overflow: auto;
+ word-wrap: break-word;
+}
+
+td.linenos pre {
+ padding: 5px 0px;
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ margin-left: 0.5em;
+}
+
+table.highlighttable td {
+ padding: 0 0.5em 0 0.5em;
+}
+
+tt {
+ background-color: #ecf0f3;
+ padding: 0 1px 0 1px;
+ font-size: 0.95em;
+}
+
+tt.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+tt.descclassname {
+ background-color: transparent;
+}
+
+tt.xref, a tt {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+.footnote:target { background-color: #ffa }
+
+h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
+ background-color: transparent;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+form.comment {
+ margin: 0;
+ padding: 10px 30px 10px 30px;
+ background-color: #eee;
+}
+
+form.comment h3 {
+ background-color: #326591;
+ color: white;
+ margin: -10px -30px 10px -30px;
+ padding: 5px;
+ font-size: 1.4em;
+}
+
+form.comment input,
+form.comment textarea {
+ border: 1px solid #ccc;
+ padding: 2px;
+ font-family: sans-serif;
+ font-size: 100%;
+}
+
+form.comment input[type="text"] {
+ width: 240px;
+}
+
+form.comment textarea {
+ width: 100%;
+ height: 200px;
+ margin-bottom: 10px;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+/* :::: PRINT :::: */
+@media print {
+ div.document,
+ div.documentwrapper,
+ div.bodywrapper {
+ margin: 0;
+ width : 100%;
+ }
+
+ div.sphinxsidebar,
+ div.related,
+ div.footer,
+ div#comments div.new-comment-box,
+ #top-link {
+ display: none;
+ }
+}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_pass/.templates/indexcontent.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_pass/.templates/indexcontent.html Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,38 @@
+{% extends "defindex.html" %}
+{% block tables %}
+ Parts of the documentation:
+
+
+ Release notes
+ what's new
+ Quick Start Guide
+ start here
+ Feature list
+ what is supported
+ Manual
+ reference docs
+
+ HowTos
+ specific use cases
+ Helium API
+ or check Targets , Properties , Macros
+ Ant libraries
+ when you just have to customize
+ Development
+ for helium hackers everywhere
+ Architecture
+ many pieces, loosely joined
+
+
+
+ Customer documentation:
+
+
+ IDO
+ integration domains
+
+ TeamCI
+ development teams
+
+
+{% endblock %}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_pass/.templates/sidebar.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_pass/.templates/sidebar.html Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,6 @@
+
+Docs for other versions
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_pass/conf.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_pass/conf.py Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,183 @@
+# -*- coding: utf-8 -*-
+#============================================================================
+#Name : ant.py
+#Part of : Helium
+
+#Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#All rights reserved.
+#This component and the accompanying materials are made available
+#under the terms of the License "Eclipse Public License v1.0"
+#which accompanies this distribution, and is available
+#at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+#Initial Contributors:
+#Nokia Corporation - initial contribution.
+#
+#Contributors:
+#
+#Description:
+#===============================================================================
+#
+# Helium Documentation documentation build configuration file, created by
+# sphinx-quickstart on Fri May 09 09:49:44 2008.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# The contents of this file are pickled, so don't put values in the namespace
+# that aren't pickleable (module imports are okay, they're removed automatically).
+#
+# All configuration values have a default value; values that are commented out
+# serve to show the default value.
+
+import sys, os
+
+# If your extensions are in another directory, add it here. If the directory
+# is relative to the documentation root, use os.path.abspath to make it
+# absolute, like shown here.
+#sys.path.append(os.path.abspath('some/directory'))
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx_ext']
+#api_doc_base_url =
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['.templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General substitutions.
+project = 'Helium'
+copyright = '2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. License: http://www.eclipse.org/legal/epl-v10.html'
+
+# The default replacements for |version| and |release|, also used in various
+# other places throughout the built documents.
+#
+# The short X.Y version.
+version = '0.23'
+# The full version, including alpha/beta/rc tags.
+release = '0.23'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directories, that shouldn't be searched
+# for source files.
+#exclude_dirs = []
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'default.css'
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+#html_title = None
+
+# The name of an image file (within the static path) to place at the top of
+# the sidebar.
+html_logo = 'helium_pallot_small.jpg'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['.static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+html_sidebars = {
+ 'index': 'sidebar.html'
+}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+html_additional_pages = {
+ 'index': 'indexcontent.html',
+}
+
+# If false, no module index is generated.
+html_use_modindex = False
+
+# If true, the reST sources are included in the HTML build as _sources/.
+#html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Helium doc'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, document class [howto/manual]).
+latex_documents = [
+ ('index', 'Helium.tex', 'Helium Documentation', 'The Helium Team', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_pass/helium_pallot_small.jpg
Binary file buildframework/helium/tests/data/doc/input_for_pass/helium_pallot_small.jpg has changed
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/data/doc/input_for_pass/index.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/data/doc/input_for_pass/index.rst Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,32 @@
+.. ============================================================================
+ Name : index.rst
+ Part of : Helium
+
+ Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ All rights reserved.
+ This component and the accompanying materials are made available
+ under the terms of the License "Eclipse Public License v1.0"
+ which accompanies this distribution, and is available
+ at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+ Initial Contributors:
+ Nokia Corporation - initial contribution.
+
+ Contributors:
+
+ Description:
+
+ ============================================================================
+
+###################################
+ Helium
+###################################
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/ats/build.xml
--- a/buildframework/helium/tests/minibuilds/ats/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/ats/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -56,7 +56,8 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/compile/build.xml
--- a/buildframework/helium/tests/minibuilds/compile/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/compile/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -34,10 +34,14 @@
-
+
+
+
+
+
@@ -221,7 +225,7 @@
-
+
@@ -254,7 +258,26 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -286,6 +309,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/docs/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/minibuilds/docs/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/docs/hlm.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/minibuilds/docs/hlm.bat Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,20 @@
+@echo off
+
+rem
+rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+rem All rights reserved.
+rem This component and the accompanying materials are made available
+rem under the terms of the License "Eclipse Public License v1.0"
+rem which accompanies this distribution, and is available
+rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
+rem
+rem Initial Contributors:
+rem Nokia Corporation - initial contribution.
+rem
+rem Contributors:
+rem
+rem Description:
+rem
+
+..\..\..\hlm.bat %*
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/docs/test_docs_minibuild.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/minibuilds/docs/test_docs_minibuild.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,59 @@
+
+
+
+
+ Targets to test docs minibuild job
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/ido-sbs-coverity/build.xml
--- a/buildframework/helium/tests/minibuilds/ido-sbs-coverity/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/ido-sbs-coverity/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -32,8 +32,10 @@
+
+
+
-
@@ -50,7 +52,9 @@
-
+
+
+
'${arm.compiler.version}'
@@ -67,9 +71,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/ido-sbs/build.xml
--- a/buildframework/helium/tests/minibuilds/ido-sbs/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/ido-sbs/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -26,6 +26,7 @@
+
@@ -33,8 +34,14 @@
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/ido-sbs/common.sbsinput.ant.xml
--- a/buildframework/helium/tests/minibuilds/ido-sbs/common.sbsinput.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/ido-sbs/common.sbsinput.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,6 +25,10 @@
Common sbs input config.
+
+
+
+
@@ -51,6 +55,7 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/ido/build.xml
--- a/buildframework/helium/tests/minibuilds/ido/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/ido/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -35,6 +35,7 @@
+
@@ -47,20 +48,35 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
+
+
+
@@ -86,7 +102,8 @@
-
+
+
-
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/ido/config/build.sbsinput.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/minibuilds/ido/config/build.sbsinput.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,278 @@
+
+
+
+
+ ido sbs input
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/ido/config/common.sbsinput.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tests/minibuilds/ido/config/common.sbsinput.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,184 @@
+
+
+
+
+ Common sbs input config.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/imaker/build.xml
--- a/buildframework/helium/tests/minibuilds/imaker/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/imaker/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -166,18 +166,16 @@
-
+
-
-
-
+
-
-
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/linux-build/ido/build.xml
--- a/buildframework/helium/tests/minibuilds/linux-build/ido/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/linux-build/ido/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -201,7 +201,9 @@
-
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tests/minibuilds/qt/build.xml
--- a/buildframework/helium/tests/minibuilds/qt/build.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tests/minibuilds/qt/build.xml Sun Oct 10 15:22:15 2010 +0300
@@ -39,11 +39,13 @@
-
+
-
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/blocks/blocks.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/blocks/blocks.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,267 @@
+
+
+
+
+
+ Blocks integration.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Reusing current workspace.
+
+
+
+ Creating new workspace under ${build.drive}${file.separator}.
+
+
+
+
+
+
+
+
+
+ Creating new repsoitory for workspace ID ${blocks.workspace.id}.
+
+
+
+
+
+ 'blocks.repositories.id' reference doesn't exist/repository already exists.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nothing to do, blocks.bundle.filters.id reference doesn't exist.
+
+
+
+
+
+
+
+
+
+
+ Nothing to do, blocks.group.filters.id reference doesn't exist.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 'blocks.repositories.id' reference doesn't exist/repository already exists.
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/common/common.ant.xml
--- a/buildframework/helium/tools/common/common.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/common/common.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -153,7 +153,7 @@
-
+
@@ -328,12 +328,24 @@
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -352,6 +364,11 @@
+
+
+
+
+
@@ -375,32 +392,34 @@
-
-
-
+
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
@@ -422,7 +441,7 @@
-
+
-
+
-
+
+
+
@@ -536,7 +519,7 @@
-""" internal.codescanner.drive """
+#internal.codescanner.drive
import os
if os.sep == '\\':
import fileutils
@@ -596,7 +579,7 @@
try:
self.log(str("Unsubsting %s..." % drive))
fileutils.unsubst(drive)
- except Exception, e:
+ except OSError, e:
if failonerror:
raise e
else:
@@ -609,8 +592,8 @@
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/common/default_config.ant.xml
--- a/buildframework/helium/tools/common/default_config.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/common/default_config.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -36,7 +36,7 @@
@scope private
-->
-
+
ant: antProperties()
@@ -71,24 +71,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -409,4 +440,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Coverity command '@{command}' errors: ${total.coverity.errors}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Coverity command '@{command}' errors: ${total.coverity.output.errors}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/compile/ec/ec.ant.xml
--- a/buildframework/helium/tools/compile/ec/ec.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/compile/ec/ec.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -345,6 +345,7 @@
Building ${sysdef.configuration}....
+set JYTHONPATH=
set
${ec.emake} --emake-build-label=${build.id}.${sysdef.configuration} --emake-class=${ec.build.class} --emake-priority=normal --emake-maxagents=${ec.maxagents} --emake-job-limit=0 --emake-mem-limit=${ec.mem.limit} --emake-history=${ec.history.option} --emake-annodetail=basic,history,file,waiting --emake-annofile=${compile.log.dir}\${build.id}.${sysdef.configuration}.emake.anno.xml --emake-historyfile=${ec.historyfile} --emake-debug=${emake_debug_flag} --emake-logfile=${compile.log.dir}\${build.id}.${sysdef.configuration}.emake.g.dlog --emake-root=%EMAKE_ROOT%;${helium.dir} --emake-autodepend=1 -k -i -f ${build.drive}/${sysdef.configuration}.make LOGBUILDTIME="" VERBOSE="" SAVESPACE="" ${sysdef.configuration}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/compile/qt/antunit/test_qt.ant.xml
--- a/buildframework/helium/tools/compile/qt/antunit/test_qt.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/compile/qt/antunit/test_qt.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -61,16 +61,17 @@
-
-
+
+
-
-
+
+
+
@@ -78,6 +79,7 @@
ant: antProperties()
+
@@ -101,6 +103,7 @@
+
@@ -108,6 +111,7 @@
ant: antProperties()
+
@@ -119,11 +123,11 @@
-
-
+
+
-
-
+
+
@@ -149,11 +153,11 @@
-
-
+
+
-
-
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/compile/qt/qt.ant.xml
--- a/buildframework/helium/tools/compile/qt/qt.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/compile/qt/qt.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -60,6 +60,9 @@
+
+
+
+
+
+
+
+
+
+ Coverity tool summary information.
+
+
+
+
+
+
Coverity Summary
+ <#assign htmlString = covsummary?replace("["," ")>
+ <#assign htmlString = htmlString?replace("]"," ")>
+ <#list htmlString?split(",") as line>
+ <#if line?starts_with(" ")>
+ ${line}
+ <#elseif !line?contains("cov-analyze")>
+ ${line}
+ #if>
+ #list>
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/compile/templates/coverity.summary.xml.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/compile/templates/coverity.summary.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,36 @@
+<#--
+============================================================================
+Name : coverity.summary.xml.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+
+ <#assign htmlString = covsummary?replace("["," ")>
+ <#assign htmlString = htmlString?replace("]"," ")>
+ <#list htmlString?split(",") as line>
+ <#if !line?contains("cov-analyze") && !line?starts_with("---") && !line?contains("summary") && !line?contains("defects") >
+ <#assign words = line?split(":")>
+ <#if words[1]??>
+ <#assign firstword=words[0]?trim secondword=words[1]?trim>
+
+ #if>
+ #if>
+ #list>
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/logging/logging.ant.xml
--- a/buildframework/helium/tools/logging/logging.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/logging/logging.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -288,7 +288,7 @@
-
dbPath: ${metadata.dbfile}
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/logging/templates/db2xml.xml.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/logging/templates/db2xml.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,32 @@
+<#--
+============================================================================
+Name : db2xml.xml.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+<#assign table_info = pp.loadData('com.nokia.helium.metadata.SQLFMPPLoader', "${dbPath}") >
+
+
+
+
+<#list table_info['select * from metadata INNER JOIN logfiles ON logfiles.id=metadata.logfile_id INNER JOIN severity ON severity.id=metadata.severity_id where severity=\'ERROR\' and path like \'${r\'%\'}${log}\''] as recordentry >
+
+#list>
+
+
+
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/logging/templates/logging.conf.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/logging/templates/logging.conf.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,58 @@
+<#--
+============================================================================
+Name : logging.conf.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+[formatters]
+keys: simple,detailed
+
+[handlers]
+keys: console,syslog
+
+[loggers]
+keys: root,dp
+
+[formatter_simple]
+format: %(levelname)s:%(name)s:%(message)s
+
+[formatter_detailed]
+format: %(levelname)s:%(name)s: %(module)s:%(lineno)d: %(message)s
+
+[handler_console]
+class: StreamHandler
+args: []
+formatter: simple
+
+[handler_syslog]
+class: handlers.SysLogHandler
+args: [('myhost.mycorp.net', handlers.SYSLOG_UDP_PORT), handlers.SysLogHandler.LOG_USER]
+formatter: detailed
+
+[logger_root]
+level: INFO
+handlers: syslog
+
+[logger_dp]
+<#if ant?keys?seq_contains("dp.debug") || ant?keys?seq_contains("debug")>
+level: DEBUG
+<#else>
+level: INFO
+#if>
+handlers: console
+qualname: dp
\ No newline at end of file
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/bom.ant.xml
--- a/buildframework/helium/tools/preparation/bom/bom.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/preparation/bom/bom.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -63,71 +63,68 @@
import traceback
session = None
-try:
- runccm = ant.get_property(r'${ccm.enabled}')
- database = ant.get_property(r'${ccm.database}')
- username = ant.get_property(r'${ccm.user.login}')
- password = ant.get_property(r'${ccm.user.password}')
- engine = ant.get_property(r'${ccm.engine.host}')
- dbpath = ant.get_property(r'${ccm.database.path}')
- waroot = ant.get_property(r'${create.bom.workarea.root}')
- buildid = ant.get_property(r'${build.id}')
- buildlogdir = ant.get_property(r'${build.log.dir}')
- deliveryfile = ant.get_property(r'${prep.delivery.conf.parsed}')
- oldbom = ant.get_property(r'${old.bom.log}')
- bom = None
- bomfilename = r"%s/%s_bom.xml" % (buildlogdir, buildid)
- if runccm and deliveryfile:
- cache = None
- if ant.get_property(r'${ccm.cache.xml}') is not None:
- cache = str(ant.get_property(r'${ccm.cache.xml}'))
- provider = ccm.extra.CachedSessionProvider(opener=nokia.nokiaccm.open_session, cache=cache)
-
- configBuilder = configuration.NestedConfigurationBuilder(open(deliveryfile, 'r'))
- configSet = configBuilder.getConfiguration()
- for config in configSet.getConfigurations():
- waroot = config['dir']
- print "Found wa for project %s" % waroot
-
- if database != None:
- session = provider.get(username, password, database=database)
- else:
- session = provider.get(username, password, engine, dbpath)
-
- ccmproject = ccm.extra.get_toplevel_project(session, waroot)
+
+runccm = ant.get_property(r'${ccm.enabled}')
+database = ant.get_property(r'${ccm.database}')
+username = ant.get_property(r'${ccm.user.login}')
+password = ant.get_property(r'${ccm.user.password}')
+engine = ant.get_property(r'${ccm.engine.host}')
+dbpath = ant.get_property(r'${ccm.database.path}')
+waroot = ant.get_property(r'${create.bom.workarea.root}')
+buildid = ant.get_property(r'${build.id}')
+buildlogdir = ant.get_property(r'${build.log.dir}')
+deliveryfile = ant.get_property(r'${prep.delivery.conf.parsed}')
+oldbom = ant.get_property(r'${old.bom.log}')
+bom = None
+bomfilename = r"%s/%s_bom.xml" % (buildlogdir, buildid)
+if deliveryfile and runccm == 'true':
+ cache = None
+ if ant.get_property(r'${ccm.cache.xml}') is not None:
+ cache = str(ant.get_property(r'${ccm.cache.xml}'))
+ provider = ccm.extra.CachedSessionProvider(opener=nokia.nokiaccm.open_session, cache=cache)
+
+ configBuilder = configuration.NestedConfigurationBuilder(open(deliveryfile, 'r'))
+ configSet = configBuilder.getConfiguration()
+ for config in configSet.getConfigurations():
+ waroot = config['dir']
+ print "Found wa for project %s" % waroot
+
+ if database != None:
+ session = provider.get(username, password, database=database)
+ else:
+ session = provider.get(username, password, engine, dbpath)
- config_data = {'delivery': deliveryfile, 'prep.xml': ant.get_property(r'${prep.config.file.parsed}'), 'build.id': buildid, 'ccm.database': database, 'symbian_rel_week': ant.get_property(r'${symbian.version.week}'), 'symbian_rel_ver': ant.get_property(r'${symbian.version}'), 'symbian_rel_year': ant.get_property(r'${symbian.version.year}'), 's60_version': ant.get_property(r'${s60.version}'), 's60_release': ant.get_property(r'${s60.release}'), 'currentRelease.xml': ant.get_property(r'${build.drive}') + "/currentRelease.xml", 'release_regexp': ant.get_property(r'${bom.release.regex}') }
- config = configuration.Configuration(config_data)
-
- # let's only support the new spec model!
- bom = build.model.SynergyBOM(config, ccmproject, username=username, password=password, provider=provider)
-
- xml_writer = build.model.BOMXMLWriter(bom)
- xml_writer.write(bomfilename)
- if not bom and os.path.exists(bomfilename):
- config_data = {'prep.xml': ant.get_property(r'${prep.config.file.parsed}'), 'build.id': buildid, 'symbian_rel_week': ant.get_property(r'${symbian.version.week}'), 'symbian_rel_ver': ant.get_property(r'${symbian.version}'), 'symbian_rel_year': ant.get_property(r'${symbian.version.year}'), 's60_version': ant.get_property(r'${s60.version}'), 's60_release': ant.get_property(r'${s60.release}'), 'currentRelease.xml': ant.get_property(r'${build.drive}') + "/currentRelease.xml"}
- config = configuration.Configuration(config_data)
- bom = build.model.SimpleBOM(config, bomfilename)
- if os.path.exists(oldbom):
- xml_delta_writer = build.model.BOMDeltaXMLWriter(bom, oldbom)
- xml_delta_writer.write(buildlogdir + "/" + buildid + "_bom_delta.xml")
- delta_bom_content_validity = xml_delta_writer.validate_delta_bom_contents(buildlogdir + "/" + buildid + "_bom_delta.xml", bomfilename, oldbom)
- if((delta_bom_content_validity == False) and (ant.get_property(r'${hlm.enable.asserts}') is not None)):
- print 'Bom delta contents are not matching'
- raise Exception
- elif((delta_bom_content_validity == True) or (delta_bom_content_validity == None)):
- print 'Bom delta contents are matching.'
- elif(delta_bom_content_validity == False):
- print 'Bom delta contents are not matching.'
- else:
- print 'Old BOM log cannot be found ' + oldbom + ', skipping BOM delta creation.'
- if runccm:
- bom.close()
- if session:
- session.close()
-except Exception, ex:
- print 'Caught exception in BOM: ' + str(ex)
- traceback.print_exc()
+ ccmproject = ccm.extra.get_toplevel_project(session, waroot)
+
+ config_data = {'delivery': deliveryfile, 'prep.xml': ant.get_property(r'${prep.config.file.parsed}'), 'build.id': buildid, 'ccm.database': database, 'symbian_rel_week': ant.get_property(r'${symbian.version.week}'), 'symbian_rel_ver': ant.get_property(r'${symbian.version}'), 'symbian_rel_year': ant.get_property(r'${symbian.version.year}'), 's60_version': ant.get_property(r'${s60.version}'), 's60_release': ant.get_property(r'${s60.release}'), 'currentRelease.xml': ant.get_property(r'${build.drive}') + "/currentRelease.xml", 'release_regexp': ant.get_property(r'${bom.release.regex}') }
+ config = configuration.Configuration(config_data)
+
+ # let's only support the new spec model!
+ bom = build.model.SynergyBOM(config, ccmproject, username=username, password=password, provider=provider)
+
+ xml_writer = build.model.BOMXMLWriter(bom)
+ xml_writer.write(bomfilename)
+if not bom and os.path.exists(bomfilename):
+ config_data = {'prep.xml': ant.get_property(r'${prep.config.file.parsed}'), 'build.id': buildid, 'symbian_rel_week': ant.get_property(r'${symbian.version.week}'), 'symbian_rel_ver': ant.get_property(r'${symbian.version}'), 'symbian_rel_year': ant.get_property(r'${symbian.version.year}'), 's60_version': ant.get_property(r'${s60.version}'), 's60_release': ant.get_property(r'${s60.release}'), 'currentRelease.xml': ant.get_property(r'${build.drive}') + "/currentRelease.xml"}
+ config = configuration.Configuration(config_data)
+ bom = build.model.SimpleBOM(config, bomfilename)
+if bom and os.path.exists(oldbom):
+ xml_delta_writer = build.model.BOMDeltaXMLWriter(bom, oldbom)
+ xml_delta_writer.write(buildlogdir + "/" + buildid + "_bom_delta.xml")
+ delta_bom_content_validity = xml_delta_writer.validate_delta_bom_contents(buildlogdir + "/" + buildid + "_bom_delta.xml", bomfilename, oldbom)
+ if((delta_bom_content_validity == False) and (ant.get_property(r'${hlm.enable.asserts}') is not None)):
+ print 'Bom delta contents are not matching'
+ raise Exception
+ elif((delta_bom_content_validity == True) or (delta_bom_content_validity == None)):
+ print 'Bom delta contents are matching.'
+ elif(delta_bom_content_validity == False):
+ print 'Bom delta contents are not matching.'
+else:
+ print 'Old BOM log cannot be found ' + oldbom + ', skipping BOM delta creation.'
+if runccm == 'true':
+ bom.close()
+if session:
+ session.close()
@@ -136,7 +133,7 @@
-
macro: ${helium.dir}/tools/common/templates/macro
@@ -189,10 +186,13 @@
-
+
+
+
+
-
macro: ${helium.dir}/tools/common/templates/macro
@@ -287,7 +287,7 @@
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/bom.html.ftl
--- a/buildframework/helium/tools/preparation/bom/bom.html.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-<#--
-============================================================================
-Name : bom.html.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-
-
-
- <#include "/@macro/logger/logger.ftl" />
-
- Bill of Materials
- <@helium_logger_html_head/>
-
-
-
-
-<#macro printtype project title type>
- <#assign helium_node_id = helium_node_id + 1>
- <@helium_logger_node_head nodeid="${helium_node_id}" title="${title}">
- <@helium_message_box nodeid="${helium_node_id}" type="${type}" count=project?size/>
- @helium_logger_node_head>
- <@helium_logger_node_content nodeid="${helium_node_id}">
- <#list project as node>
- <@helium_logger_print type="${type}">
- ${node}
- @helium_logger_print>
- #list>
- @helium_logger_node_content>
-#macro>
-
-<#macro printTasks project>
- <#list project.task as node>
- <@helium_logger_print type="task">
- ${node.id}:${node.synopsis}
- @helium_logger_print>
- #list>
-#macro>
-
-<#macro printTasksAndFolders project title>
- <#assign helium_node_id = helium_node_id + 1>
- <@helium_logger_node_head nodeid="${helium_node_id}" title="${title}">
- <@helium_message_box nodeid="${helium_node_id}" type="task" count=project["count(//task)"]/>
- @helium_logger_node_head>
- <@helium_logger_node_content nodeid="${helium_node_id}">
- <@printTasks project=project/>
- <#list project.folder as node>
- <#assign helium_node_id = helium_node_id + 1>
- <@helium_logger_node_head nodeid="${helium_node_id}" title="${node.name}">
- <@helium_message_box nodeid="${helium_node_id}" type="task" count=project.task?size/>
- @helium_logger_node_head>
- <@helium_logger_node_content nodeid="${helium_node_id}">
- <@printTasks project=node/>
- @helium_logger_node_content>
- #list>
- @helium_logger_node_content>
-#macro>
-
-<#macro printproject project>
- <#assign helium_node_id = helium_node_id + 1>
- <@helium_logger_node_head nodeid="${helium_node_id}" title="${project.name}">
- <@helium_message_box nodeid="${helium_node_id}" type="baseline" count=project.baseline?size/>
- <@helium_message_box nodeid="${helium_node_id}" type="task" count=project["count(//task)"]/>
- <@helium_message_box nodeid="${helium_node_id}" type="fix" count=project.fix?size/>
- @helium_logger_node_head>
- <@helium_logger_node_content nodeid="${helium_node_id}">
- <@printtype project=project.baseline title="Baselines" type="baseline"/>
- <@printTasksAndFolders project=project title="Tasks"/>
- <@printtype project=project.fix title="Fix" type="fix"/>
- @helium_logger_node_content>
-#macro>
-
-
-
- <@helium_logger_header title="${doc.bom.build} build"/>
-
- <@helium_logger_content title="Baseline and Task details">
- <#list doc.bom.content.project as project>
- <@printproject project=project />
- #list>
- @helium_logger_content>
-
- <@helium_logger_content title="ICDs / ICFs">
- <@printtype project=doc.bom.content.input.icds.icd.name title="ICDs / ICFs" type="icd"/>
- @helium_logger_content>
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/bom.txt.ftl
--- a/buildframework/helium/tools/preparation/bom/bom.txt.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-<#--
-============================================================================
-Name : bom.txt.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-Bill Of Materials
-=================
-
-Build: ${doc.bom.build}
-
-<#list doc.bom.content.project as project>
-
-Project
--------
-
-${project.name}
-
-Baselines
-`````````
-<#list project.baseline as baseline>
-${baseline}
-#list>
-
-Tasks
-`````
-<#list project.task as task>
-${task.id}
-${task.synopsis}
-#list>
-<#list project.folder as folder>
-<#list folder.task as task>
-${task.id}
-${task.synopsis}
-#list>
-#list>
-
-Folders
-```````
-<#list project.folder as folder>
-<#list folder.name as name>
-${name}
-#list>
-#list>
-#list>
-
-Symbian ICD/ICFs
-----------------
-
-<#list doc.bom.content.input.icds.icd as icd>
-${icd.name}
-#list>
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/bom_delta.html.ftl
--- a/buildframework/helium/tools/preparation/bom/bom_delta.html.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-<#--
-============================================================================
-Name : bom_delta.html.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-<#assign delta = doc.bomDelta>
-
-
-
-
- BOM delta for ${delta.buildTo}
-
-
-
-
-
- BOM delta for ${delta.buildTo}
-
-
Build from ${delta.buildFrom} to ${delta.buildTo}
-
-
-
-
Task added
-
-
- <#list delta.content.task as tasks>
- <#if tasks.@status == "added">
- ${tasks}
- #if>
- #list>
-
-
-
-
-
Task removed
-
- <#list delta.content.task as tasks>
- <#if tasks.@status == "deleted">
- ${tasks}
- #if>
- #list>
-
-
-
-
Baseline added
-
- <#list delta.content.baseline as baselines>
- <#if baselines.@status == "added">
- ${baselines}
- #if>
- #list>
-
-
-
-
Baseline removed
-
- <#list delta.content.baseline as baselines>
- <#if baselines.@status == "deleted">
- ${baselines}
- #if>
- #list>
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/bom_delta.txt.ftl
--- a/buildframework/helium/tools/preparation/bom/bom_delta.txt.ftl Wed Sep 29 17:48:06 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-<#--
-============================================================================
-Name : bom_delta.txt.ftl
-Part of : Helium
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-This component and the accompanying materials are made available
-under the terms of the License "Eclipse Public License v1.0"
-which accompanies this distribution, and is available
-at the URL "http://www.eclipse.org/legal/epl-v10.html".
-
-Initial Contributors:
-Nokia Corporation - initial contribution.
-
-Contributors:
-
-Description:
-
-============================================================================
--->
-Bill Of Materials
-=================
-
-Build from: ${doc.bomDelta.buildFrom}
-Build to: ${doc.bomDelta.buildTo}
-
-
-Baselines
----------
-<#list doc.bomDelta.content.baseline as baseline>
-<#if baseline.@status == "added">
-+ ${baseline}
-#if>
-<#if baseline.@status == "deleted">
-- ${baseline}
-#if>
-#list>
-
-Tasks
------
-<#list doc.bomDelta.content.task as task>
-<#if task.@status == "added">
-+ ${task}
-#if>
-<#if task.@status == "deleted">
-- ${task}
-#if>
-#list>
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/templates/bom.html.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/preparation/bom/templates/bom.html.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,104 @@
+<#--
+============================================================================
+Name : bom.html.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+
+
+ <#include "/@macro/logger/logger.ftl" />
+
+ Bill of Materials
+ <@helium_logger_html_head/>
+
+
+
+
+<#macro printtype project title type>
+ <#assign helium_node_id = helium_node_id + 1>
+ <@helium_logger_node_head nodeid="${helium_node_id}" title="${title}">
+ <@helium_message_box nodeid="${helium_node_id}" type="${type}" count=project?size/>
+ @helium_logger_node_head>
+ <@helium_logger_node_content nodeid="${helium_node_id}">
+ <#list project as node>
+ <@helium_logger_print type="${type}">
+ ${node}
+ @helium_logger_print>
+ #list>
+ @helium_logger_node_content>
+#macro>
+
+<#macro printTasks project>
+ <#list project.task as node>
+ <@helium_logger_print type="task">
+ ${node.id}:${node.synopsis}
+ @helium_logger_print>
+ #list>
+#macro>
+
+<#macro printTasksAndFolders project title>
+ <#assign helium_node_id = helium_node_id + 1>
+ <@helium_logger_node_head nodeid="${helium_node_id}" title="${title}">
+ <@helium_message_box nodeid="${helium_node_id}" type="task" count=project["count(//task)"]/>
+ @helium_logger_node_head>
+ <@helium_logger_node_content nodeid="${helium_node_id}">
+ <@printTasks project=project/>
+ <#list project.folder as node>
+ <#assign helium_node_id = helium_node_id + 1>
+ <@helium_logger_node_head nodeid="${helium_node_id}" title="${node.name}">
+ <@helium_message_box nodeid="${helium_node_id}" type="task" count=project.task?size/>
+ @helium_logger_node_head>
+ <@helium_logger_node_content nodeid="${helium_node_id}">
+ <@printTasks project=node/>
+ @helium_logger_node_content>
+ #list>
+ @helium_logger_node_content>
+#macro>
+
+<#macro printproject project>
+ <#assign helium_node_id = helium_node_id + 1>
+ <@helium_logger_node_head nodeid="${helium_node_id}" title="${project.name}">
+ <@helium_message_box nodeid="${helium_node_id}" type="baseline" count=project.baseline?size/>
+ <@helium_message_box nodeid="${helium_node_id}" type="task" count=project["count(//task)"]/>
+ <@helium_message_box nodeid="${helium_node_id}" type="fix" count=project.fix?size/>
+ @helium_logger_node_head>
+ <@helium_logger_node_content nodeid="${helium_node_id}">
+ <@printtype project=project.baseline title="Baselines" type="baseline"/>
+ <@printTasksAndFolders project=project title="Tasks"/>
+ <@printtype project=project.fix title="Fix" type="fix"/>
+ @helium_logger_node_content>
+#macro>
+
+
+
+ <@helium_logger_header title="${doc.bom.build} build"/>
+
+ <@helium_logger_content title="Baseline and Task details">
+ <#list doc.bom.content.project as project>
+ <@printproject project=project />
+ #list>
+ @helium_logger_content>
+
+ <@helium_logger_content title="ICDs / ICFs">
+ <@printtype project=doc.bom.content.input.icds.icd.name title="ICDs / ICFs" type="icd"/>
+ @helium_logger_content>
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/templates/bom.txt.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/preparation/bom/templates/bom.txt.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,68 @@
+<#--
+============================================================================
+Name : bom.txt.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+Bill Of Materials
+=================
+
+Build: ${doc.bom.build}
+
+<#list doc.bom.content.project as project>
+
+Project
+-------
+
+${project.name}
+
+Baselines
+`````````
+<#list project.baseline as baseline>
+${baseline}
+#list>
+
+Tasks
+`````
+<#list project.task as task>
+${task.id}
+${task.synopsis}
+#list>
+<#list project.folder as folder>
+<#list folder.task as task>
+${task.id}
+${task.synopsis}
+#list>
+#list>
+
+Folders
+```````
+<#list project.folder as folder>
+<#list folder.name as name>
+${name}
+#list>
+#list>
+#list>
+
+Symbian ICD/ICFs
+----------------
+
+<#list doc.bom.content.input.icds.icd as icd>
+${icd.name}
+#list>
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/templates/bom_delta.html.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/preparation/bom/templates/bom_delta.html.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,147 @@
+<#--
+============================================================================
+Name : bom_delta.html.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+<#assign delta = doc.bomDelta>
+
+
+
+
+ BOM delta for ${delta.buildTo}
+
+
+
+
+
+ BOM delta for ${delta.buildTo}
+
+
Build from ${delta.buildFrom} to ${delta.buildTo}
+
+
+
+
Task added
+
+
+ <#list delta.content.task as tasks>
+ <#if tasks.@status == "added">
+ ${tasks}
+ #if>
+ #list>
+
+
+
+
+
Task removed
+
+ <#list delta.content.task as tasks>
+ <#if tasks.@status == "deleted">
+ ${tasks}
+ #if>
+ #list>
+
+
+
+
Baseline added
+
+ <#list delta.content.baseline as baselines>
+ <#if baselines.@status == "added">
+ ${baselines}
+ #if>
+ #list>
+
+
+
+
Baseline removed
+
+ <#list delta.content.baseline as baselines>
+ <#if baselines.@status == "deleted">
+ ${baselines}
+ #if>
+ #list>
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/bom/templates/bom_delta.txt.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/preparation/bom/templates/bom_delta.txt.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,50 @@
+<#--
+============================================================================
+Name : bom_delta.txt.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+Bill Of Materials
+=================
+
+Build from: ${doc.bomDelta.buildFrom}
+Build to: ${doc.bomDelta.buildTo}
+
+
+Baselines
+---------
+<#list doc.bomDelta.content.baseline as baseline>
+<#if baseline.@status == "added">
++ ${baseline}
+#if>
+<#if baseline.@status == "deleted">
+- ${baseline}
+#if>
+#list>
+
+Tasks
+-----
+<#list doc.bomDelta.content.task as task>
+<#if task.@status == "added">
++ ${task}
+#if>
+<#if task.@status == "deleted">
+- ${task}
+#if>
+#list>
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/ci.ant.xml
--- a/buildframework/helium/tools/preparation/ci.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/preparation/ci.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -73,8 +73,6 @@
try:
self.log(str("Removing %s" % dir_))
fileutils.rmtree(dir_)
- except Exception, exc:
- self.log(str("ERROR: %s" % exc))
except IOException, ioExc:
self.log(str("ERROR: %s" % ioExc))
@@ -183,14 +181,10 @@
update_session = False
if update_session:
- try:
- self.log(str("Opening a new session for %s..." % database))
- session = nokia.nokiaccm.open_session(database=database, engine=engine, dbpath=dbpath)
- session.close_on_exit = False
- config[database] = session.addr()
- except Exception, exc:
- traceback.print_exc()
- raise exc
+ self.log(str("Opening a new session for %s..." % database))
+ session = nokia.nokiaccm.open_session(database=database, engine=engine, dbpath=dbpath)
+ session.close_on_exit = False
+ config[database] = session.addr()
self.log(str("Updating the file %s..." % sessionFile))
config.store(open(sessionFile, 'w+'))
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/ido-prep.ant.xml
--- a/buildframework/helium/tools/preparation/ido-prep.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/preparation/ido-prep.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -30,31 +30,16 @@
* IBY export (old way)
-
-
-
-
-
-
-
-
-
-
+
@@ -78,6 +63,27 @@
@type boolean
@scope private
-->
+
+
+
+
+
+
+
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+idoprep.create_ado_mapping(project.getProperty(r"prep.dynamic.sysdef.config"), attributes.get(r"adomapfile"), attributes.get(r"mapforquality"), project.getProperty(r"build.drive"), project.getProperty(r"ado.quality.dirs.path"))
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
dbPath: ${metadata.dbfile}
@@ -276,7 +325,7 @@
-
dbPath: ${metadata.dbfile}
@@ -317,7 +366,7 @@
@type string
@scope public
-->
-
+
-
+
+
+
- inputfile: antProperty(ado.mapping.file)
+ inputfile: antProperty(prep.copy.mapping.file)
ant: antProperties()
data: eval('
java.io.FileInputStream pin = new java.io.FileInputStream(filename);
@@ -347,9 +398,9 @@
@@ -364,7 +415,7 @@
@@ -385,24 +436,34 @@
-
-
-
+
+
+
+
-
-
+
+
-
-
-
+
+
+
+
+
+
+ inputfile: antProperty(codescanner.mapping.file)
+ ant: antProperties()
+ data: eval('
+ java.io.FileInputStream pin = new java.io.FileInputStream(filename);
+ java.util.Properties props = new java.util.Properties();
+ props.load(pin);
+ return props;
+ ', {filename:get(inputfile)})
+
+
+
+
+
+
+
+
+
+
@@ -439,6 +523,7 @@
+
-
-
-
+
+
+
- inputfile: antProperty(ado.quality.mapping.file)
+ inputfile: antProperty(cmt.mapping.file)
ant: antProperties()
data: eval('
java.io.FileInputStream pin = new java.io.FileInputStream(filename);
@@ -492,16 +578,16 @@
-
-
+
+
+
-
- inputfile: antProperty(ado.mapping.file)
+ inputfile: antProperty(create.copy.mapping.file)
ant: antProperties()
data: eval('
java.io.FileInputStream pin = new java.io.FileInputStream(filename);
@@ -550,94 +636,172 @@
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
-
+
+
+
+
@@ -653,9 +822,9 @@
-
+
- Location of the new S60 release:${s60.getenv.path}
+ Location of the new release:${s60.getenv.path}
@@ -703,7 +872,7 @@
variant_pkg = rel_metadata.getVariantPackage(project.getProperty('ido.variant'))
project.setProperty('ido.variant.package', os.path.join(rel_path, variant_pkg))
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/password.ant.xml
--- a/buildframework/helium/tools/preparation/password.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/preparation/password.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -75,12 +75,6 @@
-
-
-
-
-
-
@@ -190,18 +184,5 @@
- ccm.session.created = ${ccm.session.created}
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/preparation/preparation.ant.xml
--- a/buildframework/helium/tools/preparation/preparation.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/preparation/preparation.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -120,7 +120,7 @@
-
+
@@ -373,7 +373,6 @@
-
@@ -443,7 +442,10 @@
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/quality/templates/build-duplicates.html.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/quality/templates/build-duplicates.html.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,58 @@
+<#--
+============================================================================
+Name : build-duplicates.html.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+
+
+ <#include "/@macro/logger/logger.ftl" />
+
+ Build duplicates
+ <@helium_logger_html_head/>
+
+
+
+<#macro printconflict node>
+ <#assign helium_node_id = helium_node_id + 1>
+ <@helium_logger_node_head nodeid="${helium_node_id}" title="${node.@name}">
+ <@helium_message_box nodeid="${helium_node_id}" type="conflict" count=node[".//component"]?size/>
+ @helium_logger_node_head>
+ <@helium_logger_node_content nodeid="${helium_node_id}">
+ <#list node[".//component"] as component>
+ <@helium_logger_print type="conflict">
+ ${component.@name}
+ @helium_logger_print>
+ #list>
+ @helium_logger_node_content>
+#macro>
+
+
+ <@helium_logger_header title="${ant['build.id']} build"/>
+
+
+ <@helium_logger_content title="Errors and warnings details">
+ <#list doc.buildconflicts["./file"] as conflict>
+ <@printconflict conflict/>
+ #list>
+ @helium_logger_content>
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/quality/templates/cone-validate.xml.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/quality/templates/cone-validate.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,58 @@
+<#--
+============================================================================
+Name : cone-validate.xml.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+
+
+
+ <#if os?lower_case?starts_with('win')>
+ <#assign exe_file="cmd.exe"/>
+ <#else>
+ <#assign exe_file="bash"/>
+ #if>
+ <#list ant['product.list']?split(',') as product>
+
+ Validating cone configuration for ${product}_root.confml
+
+ <#if os?lower_case?starts_with('win')>
+
+
+ <#else>
+
+ #if>
+
+
+
+
+
+
+
+
+
+
+
+ #list>
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/quality/templates/internal-exports.html.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/quality/templates/internal-exports.html.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,57 @@
+<#--
+============================================================================
+Name : internal-exports.html.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+
+
+ <#include "/@macro/logger/logger.ftl" />
+
+ Internal Exports
+ <@helium_logger_html_head/>
+
+
+
+<#macro printconflict node>
+ <#assign helium_node_id = helium_node_id + 1>
+ <@helium_logger_node_head nodeid="${helium_node_id}" title="${node.@name}">
+ <@helium_message_box nodeid="${helium_node_id}" type="InternalExport" count=node[".//file"]?size/>
+ @helium_logger_node_head>
+ <@helium_logger_node_content nodeid="${helium_node_id}">
+ <#list node[".//file"] as file>
+ <@helium_logger_print type="InternalExport">
+ ${file.@name}
+ @helium_logger_print>
+ #list>
+ @helium_logger_node_content>
+#macro>
+
+
+ <@helium_logger_header title="${ant['build.id']} build"/>
+
+ <@helium_logger_content title="Errors and warnings details">
+ <#list doc.internalexports["./component"] as component>
+ <@printconflict component/>
+ #list>
+ @helium_logger_content>
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/quality/templates/validate-policy.log.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/quality/templates/validate-policy.log.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,43 @@
+<#--
+============================================================================
+Name : validate-policy.log.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+CSV validation:
+<#list doc["./policyvalidation/error[@type='unknownstatus']"] as unknownstatus>
+ ${unknownstatus.@message} (${unknownstatus.@value})
+#list>
+
+Errors:
+<#list doc["./policyvalidation/error"] as error>
+ <#if error.@type=='A' || error.@type=='B' || error.@type=='C' || error.@type=='D'>
+ ${error.@type} Found incorrect for ${error.@message?replace('([\\\\/][^\\\\/]+?)$', '', 'ris')}, ${error.@value}
+ #if>
+#list>
+
+Missing policy files in:
+<#list doc["./policyvalidation/error[@type='missing']"] as missing>
+ ${missing.@message}
+#list>
+
+
+Incorrect policy files in:
+<#list doc["./policyvalidation/error[@type='invalidencoding']"] as error>
+ ${error.@message}
+#list>
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/quality/templates/validate-policy.log.xml.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/quality/templates/validate-policy.log.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,49 @@
+<#--
+============================================================================
+Name : validate-policy.log.xml.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+
+
+
+<#list doc["./policyvalidation/error[@type='unknownstatus']"] as unknownstatus>
+
+#list>
+
+
+<#list doc["./policyvalidation/error"] as error>
+ <#if error.@type=='A' || error.@type=='B' || error.@type=='C' || error.@type=='D'>
+
+ #if>
+#list>
+
+
+Missing policy files in:
+<#list doc["./policyvalidation/error[@type='missing']"] as missing>
+
+#list>
+
+
+<#list doc["./policyvalidation/error[@type='invalidencoding']"] as error>
+
+#list>
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/quality/validate-policy.ant.xml
--- a/buildframework/helium/tools/quality/validate-policy.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/quality/validate-policy.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -219,7 +219,7 @@
Render the policy validation xml file ('validate.policy.log') into an text output.
-->
-
+
macro: ${helium.dir}/tools/common/templates/macro
@@ -228,7 +228,7 @@
ant: antProperties()
-
+
macro: ${helium.dir}/tools/common/templates/macro
@@ -249,9 +249,11 @@
-
+
+
+
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/release/release.ant.xml
--- a/buildframework/helium/tools/release/release.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/release/release.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -32,43 +32,7 @@
@type string
@scope private
-->
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
+
@@ -152,16 +113,15 @@
mconfigstr = project.getProperty('s60.build.robot.date')
if mconfigstr != None:
for configstr in mconfigstr.split(';'):
- config = map(lambda x: x.strip(), configstr.split(','))
- try:
- if ido.is_in_interval(int(config[0]), config[1], int(config[2]), config[3]):
- self.log("It is release time!")
- projects.append(config[4])
- project.setProperty('robot.release.project', ",".join(projects))
- else:
- self.log("It is not release time!")
- except Exception, e:
- self.log("'%s' invalid configuration." % configstr)
+ config = [x.strip() for x in configstr.split(',')]
+ if len(config) < 4:
+ raise Exception(configstr + ' is invalid config')
+ if ido.is_in_interval(int(config[0]), config[1], int(config[2]), config[3]):
+ self.log("It is release time!")
+ projects.append(config[4])
+ project.setProperty('robot.release.project', ",".join(projects))
+ else:
+ self.log("It is not release time!")
else:
self.log("'s60.build.robot.date' is not defined.")
]]>
@@ -173,19 +133,21 @@
zip them all and send to the specified location. There is only one but mandatory
property to tell the location of the build server which is "s60.build.robot.path".
-->
-
+
+
+
-
+
-
+
- inputfile: antProperty(ado.mapping.file)
+ inputfile: antProperty(robot.mapping.file)
ant: antProperties()
data: eval('
java.io.FileInputStream pin = new java.io.FileInputStream(filename);
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/release/scm_release.ant.xml
--- a/buildframework/helium/tools/release/scm_release.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/release/scm_release.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -40,7 +40,7 @@
* update
* maintain the work area
-->
-
+
@@ -61,25 +61,14 @@
# enabling logging
logging.basicConfig(level=logging.INFO)
-builder = None
+configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
+configSet = configBuilder.getConfiguration()
+password = ant.get_property(r'${ccm.user.password}')
+builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
try:
- configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
- configSet = configBuilder.getConfiguration()
- password = ant.get_property(r'${ccm.user.password}')
- builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
builder.extract_release_data(r'${release.log.dir}/${build.id}_releasable.xml')
+finally:
builder.close()
-except Exception, e:
- print "ERROR: error found during preparation phase:"
- for l in traceback.format_exc().splitlines(False):
- print "ERROR: %s" % l
- print "ERROR: this is a critical error, build will fail now:"
- for l in str(e).splitlines(False):
- print "ERROR: %s" % l
- if builder != None:
- builder.close()
- sys.exit(-1)
-sys.exit(0)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/release/templates/ido-robot-zip.ant.xml.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/release/templates/ido-robot-zip.ant.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,46 @@
+<#--
+============================================================================
+Name : ido-robot-zip.ant.xml.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+
+
+
+
+ <#if ((data?keys?size > 0) && (ant['robot.release.project']?split(';')?size > 0))>
+ <#list data?keys as name>
+ <#list ant['robot.release.project']?split(',') as project>
+ <#if name?replace('\\', '/')?lower_case?contains("/${project}/${project}"?lower_case)>
+ <#-- 7za u test.7z output/analysisdata/ -->
+
+
+
+
+
+
+
+
+
+ #if>
+ #list>
+ #list>
+ #if>
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/release/templates/ready.txt.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/tools/release/templates/ready.txt.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -0,0 +1,29 @@
+<#--
+============================================================================
+Name : ready.txt.ftl
+Part of : Helium
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+This component and the accompanying materials are made available
+under the terms of the License "Eclipse Public License v1.0"
+which accompanies this distribution, and is available
+at the URL "http://www.eclipse.org/legal/epl-v10.html".
+
+Initial Contributors:
+Nokia Corporation - initial contribution.
+
+Contributors:
+
+Description:
+
+============================================================================
+-->
+ido_name:${ant['build.name']}
+date(gt):${pp.now?string("EEE MMM d HH:mm:ss yyyy")}
+source_path:${ant['ccm.project.wa_path']}
+<#if ant?keys?seq_contains('email.from')>email:${ant['email.from']}#if>
+<#if ant?keys?seq_contains('robot.email.to')><#list ant['robot.email.to']?split(',') as email>
+email:${email}
+#list>#if>
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/release/templates/release_ccm_project.ant.xml.ftl
--- a/buildframework/helium/tools/release/templates/release_ccm_project.ant.xml.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/release/templates/release_ccm_project.ant.xml.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -1,6 +1,6 @@
<#--
============================================================================
-Name : modificationset.log.xml.ftl
+Name : release_ccm_project.ant.xml.ftl
Part of : Helium
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/relnotes/relnotes.ant.xml
--- a/buildframework/helium/tools/relnotes/relnotes.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/relnotes/relnotes.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -207,10 +207,7 @@
print 'Error: ' + waroot + ' must be a synergy project and still be in database'
else:
project.setProperty("ccm.toplevel.project", str(cmproject))
- session.close()
-except Exception, ex:
- print 'Caught exception: ' + str(ex)
- traceback.print_exc()
+finally:
if session:
session.close()
@@ -230,10 +227,7 @@
session = ccmutil.get_session(database, username, password, engine, dbpath)
cmproject = session.create(ant.get_property(r'${ccm.toplevel.project}'))
print cmproject.baseline
- session.close()
-except Exception, ex:
- print 'Caught exception: ' + str(ex)
- traceback.print_exc()
+finally:
if session:
session.close()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/rombuild/features/helium_upct.mk
--- a/buildframework/helium/tools/rombuild/features/helium_upct.mk Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/rombuild/features/helium_upct.mk Sun Oct 10 15:22:15 2010 +0300
@@ -127,7 +127,7 @@
%-create-upct-config:
@echo Building $*
- -@imaker -p$(PRODUCT_NAME) -c$(COREPLAT_NAME) -f /epoc32/rom/config/helium_upct.mk -f $* step-CREATE_UPCT_CONF
+ -@imaker -p$(PRODUCT_NAME) -f /epoc32/rom/config/helium_upct.mk -f $* step-CREATE_UPCT_CONF
create-upct-configs: $(foreach config,$(ALL_UPCT_CONFS),$(config)-create-upct-config)
@@ -140,7 +140,7 @@
%-create-makeupct-config:
@echo Building $*
- -@imaker -p$(PRODUCT_NAME) -c$(COREPLAT_NAME) -f /epoc32/rom/config/helium_upct.mk -f $* step-MAKEUPCT_FOTA_CNF
+ -@imaker -p$(PRODUCT_NAME) -f /epoc32/rom/config/helium_upct.mk -f $* step-MAKEUPCT_FOTA_CNF
create-makeupct-configs: $(foreach config,$(ALL_MAKEUPCT_CONFS),$(config)-create-makeupct-config)
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/rombuild/imaker.ant.xml
--- a/buildframework/helium/tools/rombuild/imaker.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/rombuild/imaker.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -29,7 +29,7 @@
@@ -116,7 +116,7 @@
@type string
@scope private
-->
-
+
ant: antProperties()
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/testing/ats/ats.ant.xml
--- a/buildframework/helium/tools/testing/ats/ats.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/testing/ats/ats.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -25,7 +25,7 @@
ATS testing targets.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
-
-
@@ -185,12 +268,6 @@
@since 11.0
-->
-
-
-
+
+
+
+
-
+
@@ -291,9 +373,13 @@
-
-
-
+
+
+
+
+
+
+
@@ -321,7 +407,21 @@
+
+
+
+
+
+
@@ -345,7 +445,7 @@
-
@@ -406,20 +506,26 @@
-
-
+
+
+
+
+
+
+
-
-
+
+
+
-
-
+
+
-
+
@@ -455,6 +561,7 @@
+
@@ -511,7 +618,7 @@
ic = None
try:
ic = atsant.IConfigATS(project.getProperty('release.images.dir'), project.getProperty('ats.product.name'))
- except Exception, ex:
+ except IOError, ex:
print ex
if ic:
project.setProperty('ats.flash.images', ic.findimages())
@@ -538,6 +645,11 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
+
@@ -986,48 +1110,109 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
+
-
+
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/testing/ats/templates/ats4_naviengine_template.xml
--- a/buildframework/helium/tools/testing/ats/templates/ats4_naviengine_template.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/testing/ats/templates/ats4_naviengine_template.xml Sun Oct 10 15:22:15 2010 +0300
@@ -87,7 +87,7 @@
EmailAction
-
+
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/testing/ats/templates/monsym-file-list.txt.ftl
--- a/buildframework/helium/tools/testing/ats/templates/monsym-file-list.txt.ftl Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/testing/ats/templates/monsym-file-list.txt.ftl Sun Oct 10 15:22:15 2010 +0300
@@ -20,6 +20,6 @@
============================================================================
-->
${ant['build.drive']}/mon.sym
-<#list data["//unit"] as unit>
+<#list data["//unit[@bldFile]"] as unit>
${ant['build.drive']}${unit.@bldFile}/mon.sym
#list>
diff -r 27cf35f95864 -r b8d81fa19e7d buildframework/helium/tools/testing/eunit/eunit.ant.xml
--- a/buildframework/helium/tools/testing/eunit/eunit.ant.xml Wed Sep 29 17:48:06 2010 +0100
+++ b/buildframework/helium/tools/testing/eunit/eunit.ant.xml Sun Oct 10 15:22:15 2010 +0300
@@ -40,12 +40,6 @@
@scope public
-->
-