# HG changeset patch
# User wbernard
# Date 1276696300 -10800
# Node ID c7c26511138fbd7846a2835fd4dea89aa7038ca7
# Parent 85df38eb40125c279225a0186b5ef9c0d0d4fe83
helium-10.0.0-bc45d50958fe
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/builder/build.xml
--- a/buildframework/helium/builder/build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/builder/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -25,7 +25,7 @@
-
+
+
@@ -63,22 +64,26 @@
+
+
+
+
@@ -86,6 +91,7 @@
+
@@ -94,6 +100,7 @@
+
@@ -101,6 +108,7 @@
+
@@ -108,6 +116,7 @@
Testing: @{file}
+
@@ -115,18 +124,23 @@
-
+
+
+
-
+
+
+
+
@@ -141,6 +155,7 @@
+
@@ -154,6 +169,7 @@
+
@@ -179,7 +195,7 @@
module="helium-${config}-config" revision="1.0"
inline="true" type="egg"
pattern="${source.root.dir}/external/python/lib/auto/[artifact]-[revision].[ext]" />
-
+
project: antProject()
@@ -254,6 +270,7 @@
+
@@ -268,10 +285,12 @@
+
+
@@ -287,6 +306,7 @@
+
@@ -308,4 +328,7 @@
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/builder/delivery.ant.xml
--- a/buildframework/helium/builder/delivery.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/builder/delivery.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -95,29 +95,35 @@
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/builder/java/config/java_checkstyle_config.xml
--- a/buildframework/helium/builder/java/config/java_checkstyle_config.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/builder/java/config/java_checkstyle_config.xml Wed Jun 16 16:51:40 2010 +0300
@@ -72,7 +72,11 @@
-
+
+
+
+
+
@@ -189,6 +193,13 @@
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/builder/java/macros.ant.xml
--- a/buildframework/helium/builder/java/macros.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/builder/java/macros.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -29,13 +29,16 @@
+
+
+
@@ -45,12 +48,15 @@
+
+
+
Running checkstyle on ${ant.project.name}.
@@ -66,6 +72,7 @@
+
@@ -75,6 +82,7 @@
+
+
+
+
@@ -122,7 +133,7 @@
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/config/diamonds_config.xml.ftl
--- a/buildframework/helium/config/diamonds_config.xml.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/config/diamonds_config.xml.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -49,6 +49,8 @@
logfile="${ant['temp.build.dir']}/build/doc/ivy/tool-dependencies-${ant['build.type']}.xml" ant-properties="true"/>
+
+
@@ -76,6 +78,9 @@
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/config/ivy/ivy.xml
--- a/buildframework/helium/config/ivy/ivy.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/config/ivy/ivy.xml Wed Jun 16 16:51:40 2010 +0300
@@ -59,7 +59,7 @@
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/config/ivy/modules/ccm-6.5.ivy.xml
--- a/buildframework/helium/config/ivy/modules/ccm-6.5.ivy.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/config/ivy/modules/ccm-6.5_7.1.ivy.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/config/ivy/modules/ccm-6.5_7.1.ivy.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/config/ivy/tools_ivy_settings.xml
--- a/buildframework/helium/config/ivy/tools_ivy_settings.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/config/ivy/tools_ivy_settings.xml Wed Jun 16 16:51:40 2010 +0300
@@ -24,6 +24,8 @@
+
+
@@ -41,7 +43,7 @@
-
+
@@ -53,21 +55,20 @@
-
+ target="install"
+ event="post-download-artifact"
+ prefix="artifact"/>
-
-
-
-
+
+
+
+
@@ -78,4 +79,11 @@
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/config/metadata_filter_config_default.ant.xml
--- a/buildframework/helium/config/metadata_filter_config_default.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/config/metadata_filter_config_default.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -57,6 +57,11 @@
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/config/signaling_config_default.ant.xml
--- a/buildframework/helium/config/signaling_config_default.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/config/signaling_config_default.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -25,8 +25,6 @@
Definitions of helium signals.
-
-
+<#include "api.ftllib"/>
+
+<#list doc.antDatabase.antlib as antlib>
+<@pp.changeOutputFile name="antlib-${antlib.name}.rst" />
+
+
+.. index::
+ ${antlib.name}
+
+==========================================================
+Antlib ${antlib.name}
+==========================================================
+
+.. contents::
+
+:Location: <@helium_api_location_path location="${antlib.location}"/>
+
+<#if antlib.macro?size > 0>
+
+Macros
+===========
+
+<#assign macroCache = {}>
+<#list antlib.macro as macro>
+ <#assign macroCache = macroCache + {macro.name: macro}>
+#list>
+
+<#list macroCache?keys?sort as name>
+<#assign macro=macroCache[name]>
+
+.. index::
+ ${macro.name}
+
+${macro.name}
+----------------------------------------------------------
+
+<#if macro.deprecated?length > 0>
+..warning:: ${macro.deprecated}
+#if>
+
+:Location: <@helium_api_location_path location="${macro.location}"/>
+:Scope: ${macro.scope}
+
+<#recurse macro.documentation>
+
+**Usage**
+
+::
+
+ ${macro.usage?replace("^", " ", "rm")}
+
+**Source code**
+
+::
+
+ ${macro.source?replace("^", " ", "rm")}
+
+#list>
+#if>
+
+#list>
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/api.ftllib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/api.ftllib Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,80 @@
+<#--
+============================================================================
+Name :
+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 ant?keys?seq_contains("tracurl")>
+ <#assign helium_browser_trunk=ant.tracurl>
+<#else>
+ <#assign helium_browser_trunk="">
+#if>
+
+<#macro helium_api_location_path location>
+ <#assign target_line=""/>
+ <#assign res = location?matches(":(\\d+):$") />
+ <#list res as m>
+ <#assign target_line="#L${m?groups[1]}"/>
+ #list>
+ <#assign location_path=location/>
+ <#if location?index_of("helium\\") > 0>
+ <#assign location_path=location?substring(location?last_index_of('helium\\'))/>
+ #if>
+<#-- <#assign target_url=location_path?replace("\\", "/")?replace(":(\\d+):", "", 'ri') />
+ ${location_path} -->
+ ``${location_path}``
+#macro>
+
+<#macro helium_project_path location>
+ <#assign location_path=location/>
+ <#if location?index_of("helium\\") > 0>
+ <#assign location_path=location?substring(location?last_index_of('helium\\'))/>
+ #if>
+ <#assign target_url=location_path?replace("\\", "/")?replace(":(\\d+):", "", 'ri') />
+ ${target_url}
+#macro>
+
+<#-- Macros for recursively handling random HTML elements inside documentation elements. -->
+<#macro tt> <#recurse> #macro>
+
+<#macro div><#recurse>#macro>
+
+<#macro p><#recurse>
+
+#macro>
+
+<#macro ul>
+
+<#recurse>
+
+#macro>
+
+<#macro li> - <#recurse>
+#macro>
+
+<#macro b>**<#recurse>**#macro>
+
+<#macro pre>
+
+ <#recurse>
+
+#macro>
+
+<#macro @text>${.node?trim}#macro>
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/index.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/index.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,35 @@
+<#--
+============================================================================
+Name : packages.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:
+
+============================================================================
+-->
+<#include "api.ftllib"/>
+
+Helium API Packages
+============================================
+
+.. toctree::
+ :maxdepth: 2
+
+<#list doc.antDatabase.package as package>
+ package-${package.name}
+
+#list>
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/macros_list.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/macros_list.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,43 @@
+<#--
+============================================================================
+Name : macros_list.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:
+
+============================================================================
+-->
+
+=============
+Macros list
+=============
+
+<#assign macroCache = {}>
+<#list doc.antDatabase.project.macro as macro>
+ <#assign macroCache = macroCache + {macro.name: macro}>
+#list>
+<#list doc.antDatabase.antlib.macro as macro>
+ <#assign macroCache = macroCache + {macro.name: macro}>
+#list>
+
+.. csv-table:: Helium macros
+ :header: "Macro", "Project", "Summary"
+
+<#list macroCache?keys?sort as name>
+<#assign macro=macroCache[name]>
+ ":hlm-t:`${name}`", "${macro?parent.name}", "${macro.summary?replace("^", " ", "rm")?replace("\"", "\"\"", "rm")?trim}"
+#list>
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/package.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/package.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,49 @@
+<#--
+============================================================================
+Name : package.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:
+
+============================================================================
+-->
+<#include "api.ftllib"/>
+
+<#list doc.antDatabase.package as package>
+<@pp.changeOutputFile name="package-${package.name}.rst" />
+
+.. index::
+ ${package.name}
+
+==========================================================
+Package ${package.name}
+==========================================================
+
+.. toctree::
+ :maxdepth: 2
+
+<#assign projectList=package.projectRef.name?sort>
+<#list projectList as project>
+ project-${project}
+#list>
+<#assign antlibList=package.antlibRef.name?sort>
+<#list antlibList as antlib>
+ antlib-${antlib}
+#list>
+
+
+#list>
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/project.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/project.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,204 @@
+<#--
+============================================================================
+Name : project.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:
+
+============================================================================
+-->
+<#include "api.ftllib"/>
+
+<#list doc.antDatabase.project as project>
+<@pp.changeOutputFile name="project-${project.name}.rst" />
+
+
+.. index::
+ ${project.name}
+
+==========================================================
+Project ${project.name}
+==========================================================
+
+.. contents::
+
+:Location: <@helium_api_location_path location="${project.location}"/>
+
+<#recurse project.description>
+
+**Project dependencies**
+
+<#assign filelist = project.projectDependency>
+<#list filelist as filelistvar>
+- ``${filelistvar}``
+#list>
+
+Targets
+=========
+
+<#assign targetCache = {}>
+<#list project.target as target>
+ <#assign targetCache = targetCache + {target.name: target}>
+#list>
+
+<#list targetCache?keys?sort as name>
+<#assign target=targetCache[name]>
+
+.. index::
+ ${target.name}
+
+${target.name}
+----------------------------------------------------------
+
+<#if target.deprecated?length > 0>
+..warning:: ${target.deprecated}
+#if>
+
+<#if target.description?length > 0>
+:Description: ${target.description}
+#if>
+:Location: <@helium_api_location_path location="${target.location}"/>
+:Scope: ${target.scope}
+<#if target.ifDependency?length > 0>
+:Condition: Target **is** run if property defined: :hlm-p:`${target.ifDependency}`
+#if>
+<#if target.unlessDependency?length > 0>
+:Condition: Target **is not** run if property defined: ``${target.unlessDependency}``
+#if>
+
+<#recurse target.documentation>
+
+<#assign propertyList=target.propertyDependency?sort>
+<#if propertyList?size > 0>
+**Property dependencies**
+
+<#list propertyList as property>
+- :hlm-p:`${property}`
+#list>
+#if>
+
+
+**Target dependencies**
+
+.. raw:: html
+
+
+
+
+.. raw:: html
+ :file: ../../api/helium/target-${target.name}.dot.cmap
+
+.. raw:: html
+
+
+
+**Source code**
+
+::
+
+ ${target.source?replace("^", " ", "rm")}
+
+#list>
+
+
+<#if project.property?size > 0>
+
+Properties
+===========
+
+<#assign propertyCache = {}>
+<#list project.property as property>
+ <#assign propertyCache = propertyCache + {property.name: property}>
+#list>
+
+<#list propertyCache?keys?sort as name>
+<#assign property=propertyCache[name]>
+
+.. index::
+ ${property.name}
+
+${property.name}
+----------------------------------------------------------
+
+<#if property.deprecated?length > 0>
+..warning:: ${property.deprecated}
+#if>
+
+:Location: <@helium_api_location_path location="${property.location}"/>
+:Type: ${property.type}
+:Scope: ${property.scope}
+:Editable: ${property.editable}
+<#if property.defaultValue?size > 1>
+:Default value: ``${property.defaultValue}``
+#if>
+
+<#recurse property.documentation>
+
+**Source code**
+
+::
+
+ ${property.source}
+
+#list>
+#if>
+
+<#if project.macro?size > 0>
+
+Macros
+===========
+
+<#assign macroCache = {}>
+<#list project.macro as macro>
+ <#assign macroCache = macroCache + {macro.name: macro}>
+#list>
+
+<#list macroCache?keys?sort as name>
+<#assign macro=macroCache[name]>
+
+.. index::
+ ${macro.name}
+
+${macro.name}
+----------------------------------------------------------
+
+<#if macro.deprecated?length > 0>
+..warning:: ${macro.deprecated}
+#if>
+
+:Location: <@helium_api_location_path location="${macro.location}"/>
+:Scope: ${macro.scope}
+
+<#recurse macro.documentation>
+
+**Usage**
+
+::
+
+ ${macro.usage?replace("^", " ", "rm")}
+
+**Source code**
+
+::
+
+ ${macro.source?replace("^", " ", "rm")}
+
+#list>
+#if>
+
+#list>
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/properties_list.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/properties_list.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,40 @@
+<#--
+============================================================================
+Name : properties_list.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:
+
+============================================================================
+-->
+
+===============
+Properties list
+===============
+
+<#assign propertyCache = {}>
+<#list doc.antDatabase.project.property as property>
+ <#assign propertyCache = propertyCache + {property.name: property}>
+#list>
+
+.. csv-table:: Helium properties
+ :header: "Property", "Project", "Summary"
+
+<#list propertyCache?keys?sort as name>
+<#assign property=propertyCache[name]>
+ ":hlm-t:`${name}`", "${property?parent.name}", "${property.summary?replace("^", " ", "rm")?replace("\"", "\"\"", "rm")?trim}"
+#list>
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/target-dependencies.dot.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/target-dependencies.dot.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,105 @@
+<#--
+============================================================================
+Name :
+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.antDatabase.project as project>
+<#list project.target as target>
+<@pp.changeOutputFile name="target-${target.name}.dot" />
+
+strict digraph G {
+ rankdir=LR;
+ rotate=180;
+ ordering=out;
+<#assign currentTarget = target.name>
+
+<#macro targetFunc targetMain caller>
+<#-- Define the targets that call this target. -->
+<#if caller == 0>
+ "${targetMain.name}" [fontcolor=blue,fontsize=12,shape=box,style=filled,href="project-${targetMain?parent.name}.html#${targetMain.name}"];
+ <#list doc.antDatabase.project.target as callingTarget>
+ <#list callingTarget.dependency as dependency>
+ <#if targetMain.name == dependency>
+ <#if callingTarget.name != currentTarget>
+ "${callingTarget.name}" [fontcolor=brown,fontsize=12,shape=box,href="project-${callingTarget?parent.name}.html#${callingTarget.name}"];
+ #if>
+ <#if dependency.@type == "direct">
+ "${callingTarget.name}" -> "${targetMain.name}" [color=navyblue,fontsize=12];
+ #if>
+ <#if dependency.@type == "exec">
+ "${callingTarget.name}" -> "${targetMain.name}" [color=limegreen,fontsize=12];
+ #if>
+ #if>
+ #list>
+ #list>
+#if>
+<#if caller == 1>
+ "${targetMain.name}" [fontcolor=brown,fontsize=12,shape=box,href="project-${targetMain?parent.name}.html#${targetMain.name}"];
+#if>
+
+<#if targetMain.dependency?size == 1>
+ <#list targetMain.dependency as dependency>
+ "${dependency}" [fontcolor=brown,fontsize=12,shape=box,href="project-${targetMain?parent.name}.html#${dependency}"];
+ #list>
+#if>
+
+<#assign depTotal=targetMain.dependency?size>
+<#assign depLastIndex=targetMain.dependency?size-1>
+
+<#if depTotal > 1>
+ <#list 0..depLastIndex as index>
+ <#if targetMain.dependency[index].@type == "direct">
+ "${targetMain.name}" -> "${targetMain.dependency[index]}" [color=navyblue,label="${index+1}",fontsize=12];
+ #if>
+ <#if targetMain.dependency[index].@type == "exec">
+ "${targetMain.name}" -> "${targetMain.dependency[index]}" [color=limegreen,label="${index+1}",fontsize=12];
+ #if>
+ <#list doc.antDatabase.project.target as targetDep>
+ <#if targetDep.name == targetMain.dependency[index]>
+ <@targetFunc targetMain=targetDep caller=1 />
+ #if>
+ #list>
+ #list>
+#if>
+
+<#attempt>
+<#if depTotal == 1>
+ <#if targetMain.dependency.@type == "direct">
+ "${targetMain.name}" -> "${targetMain.dependency[depTotal-1]}" [color=navyblue];
+ #if>
+ <#if targetMain.dependency.@type == "exec">
+ "${targetMain.name}" -> "${targetMain.dependency[depTotal-1]}" [color=limegreen];
+ #if>
+ <#list doc.antDatabase.project.target as targetDep>
+ <#if targetDep.name == targetMain.dependency>
+ <@targetFunc targetMain=targetDep caller=1 />
+ #if>
+ #list>
+#if>
+<#recover>
+
+#attempt>
+
+#macro>
+
+<@targetFunc targetMain=target caller=0 />
+}
+#list>
+#list>
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/api_rst/targets_list.rst.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/doc/api_rst/targets_list.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,40 @@
+<#--
+============================================================================
+Name : targets_list.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:
+
+============================================================================
+-->
+
+=============
+Targets list
+=============
+
+<#assign targetCache = {}>
+<#list doc.antDatabase.project.target as target>
+ <#assign targetCache = targetCache + {target.name: target}>
+#list>
+
+.. csv-table:: Helium targets
+ :header: "Target", "Project", "Summary"
+
+<#list targetCache?keys?sort as name>
+<#assign target=targetCache[name]>
+ ":hlm-t:`${name}`", "${target?parent.name}", "${target.summary?replace("^", " ", "rm")?replace("\"", "\"\"", "rm")?trim}"
+#list>
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/.templates/indexcontent.html.ftl
--- a/buildframework/helium/doc/src/.templates/indexcontent.html.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/.templates/indexcontent.html.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -40,7 +40,7 @@
HowTos
specific use cases
Helium API
- reference for Helium configuration
+ or check Targets , Properties , Macros
Ant libraries
when you just have to customize
Development
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/development/coding_conventions.rst
--- a/buildframework/helium/doc/src/development/coding_conventions.rst Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/development/coding_conventions.rst Wed Jun 16 16:51:40 2010 +0300
@@ -340,7 +340,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 py-unittest``.
+* The test suite is run by calling :hlm-t:`py-unittest`.
.. _Nose : http://somethingaboutorange.com/mrl/projects/nose/
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/development/developer_guide.rst
--- a/buildframework/helium/doc/src/development/developer_guide.rst Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/development/developer_guide.rst Wed Jun 16 16:51:40 2010 +0300
@@ -73,20 +73,17 @@
.. index::
single: Custom Ant library
-Custom Ant library
-==================
+Custom Ant libraries
+====================
-All custom Ant tasks and loggers should be added as new component under the sf folder. If the component you are creating is Java based, then add
-it inside the java folder. Your component directory must contain a build.xml file that imports the ${builder.dir}/java/macros.ant.xml file. Also the name
-of the project must be the name of the future jar file e.g::
+All custom Ant tasks, types and loggers should be added as new components under the ``/sf`` folder. If the component being created is Java-based, then add it inside the ``/java`` folder. The component directory must contain a ``build.xml`` file that imports ``${builder.dir}/java/macros.ant.xml``. Also the name of the project must be the name of the future JAR file e.g::
-The component also need an Ivy file (ivy.xml) in order to be detected and built. The file must defined the correct list of
-dependencies for the component so it get built in the correct order.
+The component also need an Ivy file (``ivy.xml``) in order to be detected and built. The file must define the correct list of dependencies for the component so it get built in the correct order.
.. index::
single: How to build the delivery?
@@ -94,8 +91,7 @@
How to build the delivery?
==========================
-From Helium 9.0 onward, the delivery will be released as source code, without any pre-built binaries. In order to build
-the release please follow the next instructions.
+From Helium 9.0 onward, the delivery will be released as source code, without any pre-built binaries. In order to build the release please follow the next instructions.
Building the dependencies
-------------------------
@@ -110,8 +106,7 @@
Retrieving Helium dependencies
------------------------------
-Building the dependency will not bring Helium in a workable stage. It is a preparation stage where components could be unit tested in isolation for example.
-Retrieving Helium dependencies based on the version of Helium you desire is then needed. The builder can achieve this operation by running the following command::
+Building the dependency will not bring Helium in a workable stage. It is a preparation stage where components could be unit tested in isolation for example. Retrieving Helium dependencies based on the version of Helium you desire is then needed. The builder can achieve this operation by running the following command::
> cd builder
> bld -Dconfig=sf get-deps
@@ -121,12 +116,37 @@
Packaging up the built version
------------------------------
-Deliverable zip pacakge of binary version of Helium can be created using the following command::
+A deliverable ZIP package of binary version of Helium can be created using the following commands::
+
+ > cd builder
+ > bld -Dconfig=sf create-releasable
+
+The archive can be found at ``build/helium-bin.zip``.
+
+.. index::
+ single: Testing
+
+Testing
+=======
+
+Components
+-----------
- > cd builder
- > bld -Dconfig=sf create-releasable
+Component tests can be run using::
+
+ > cd builder
+ > bld unittest
+
+A specific type of tests can be selected using::
-The archive can be found under: build/helium-bin.zip
+ > bld -Dcomponent.type=java unittest
+
+A specific component can be selected using::
+
+ > bld -Dcomponent=sbs unittest
+
+Debug logs for component tests can be found at ``/build/components//xunit``.
+
.. index::
single: Assertions
@@ -175,3 +195,4 @@
helium/config/ivy/modules/jars-1.0.ivy.xml
A new Ivy config file can be added for a non-jar or egg type file.
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/manual/configuring.rst
--- a/buildframework/helium/doc/src/manual/configuring.rst Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/manual/configuring.rst Wed Jun 16 16:51:40 2010 +0300
@@ -84,7 +84,7 @@
-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.
+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.
Refer to the `configuration reference`_ for a full list of all Helium Ant properties.
@@ -298,6 +298,26 @@
....
+
+If it is necessary to use the Helium tasks before importing ``helium.ant.xml``, first import ``helium_preinclude.ant.xml``, e.g::
+
+
+
+ Helium pre include test.
+
+
+
+
+
+
+ Should not print anything.
+
+ Should print something.
+
+
+
+
+
.. index::
single: System definition configuration files
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/manual/stage_ats.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_ats.rst.inc.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/manual/stage_ats.rst.inc.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -30,7 +30,7 @@
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 ``ats-test`` target.
+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
@@ -115,23 +115,24 @@
:header: "Property name", "Edit status", "Description"
":hlm-p:`ats.server`", "[must]", "For example: ``4fix012345`` or ``catstresrv001.cats.noklab.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 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.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`", "[recommended]", "The EUnit package name to be unzipped on the environment, for executing EUnit tests."
- ":hlm-p:`eunitexerunner.flags`", "[recommended]", "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`", "[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-separated email addresses."
+ ":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"
":hlm-p:`ats.flashfiles.minlimit`", "[recommended]", "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`", "[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.script.type`", "[recommended]", "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`", "[recommended]", "Sets target platform for compiling test components. Default value is ``armv5 urel``."
- ":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.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 consist of build id, product name, major and minor versions."
- ":hlm-p:`ats.trace.enabled`", "[recommended]", "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`", "[recommended]", "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`", "[recommended]", "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`", "[recommended]", "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``", "[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."
+ ":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}``."
@@ -141,6 +142,7 @@
":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.create.singledrop.file`", "[recommended]", "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."
An example of setting up properties:
@@ -183,7 +185,7 @@
To execute the target, a property should be set(`` ``).
-Then call ``ats-test``, which will create the ATSDrop.zip (test package).
+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.
@@ -326,7 +328,7 @@
Stage: ATS - ASTE
===================
-Explanation of the process for getting ATS `ASTE`_ tests compiled and executed by Helium, through the use of the ``ats-aste`` target.
+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
@@ -429,7 +431,7 @@
To execute the target, a property should be set(`` ``).
-Then call ``ats-aste``, which will create the ATSDrop.zip (test package).
+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.
@@ -439,3 +441,13 @@
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 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/manual/stage_compilation.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_compilation.rst.inc.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/manual/stage_compilation.rst.inc.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -98,4 +98,16 @@
hlm -Dbuild.system=ec-helium -Dec.mode=serial
-Also the ``--emake-debug`` flag could be configured either by the environment using the ``EMAKE_DEBUG`` variable or using the ``emake_debug_flag`` property. Its default value is ``g``.
\ No newline at end of file
+Also the ``--emake-debug`` flag could be configured either by the environment using the ``EMAKE_DEBUG`` variable or using the ``emake_debug_flag`` property. Its default value is ``g``.
+
+
+Raptor compilation
+------------------
+
+Enabling CTC integration
+ It is possible to enable CTC instrumenting while building with SBSv2. To proceed you need to define the **sbs.build.ctc** to true.
+ If default options are not satisfying (default command line arguments: "-i m"), you can override the **ctc.instrument.type** property to
+ define an another instrumentation type. Or if you need to define additional arguments you can then override
+ the argSet referenced by **ctc.build.options**.
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/manual/stage_releasing.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_releasing.rst.inc.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/manual/stage_releasing.rst.inc.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -65,6 +65,42 @@
.. index::
+ single: Stage - Synergy Releasing
+
+Stage: Synergy releasing
+========================
+
+This stage consists in creating automatically a baseline using the prep-work-area configuration. You first need to add the
+``releasable`` property set to true and what release to use using the ``baseline.release`` property.
+
+Here is an example of configuration:
+
+.. code-block:: xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+You can then use the :hlm-t:`release-work-area` target (see Helium API) to at the end of your release cycle baseline and release your content automatically.
+
+
+.. index::
single: Stage - Release Notes
Stage: Release notes
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/manual/stage_source_preparation.rst.inc.ftl
--- a/buildframework/helium/doc/src/manual/stage_source_preparation.rst.inc.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/manual/stage_source_preparation.rst.inc.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -123,6 +123,8 @@
- ci.custom.query: Extend the synergy query for CC modificationset checking eg.(release='MinibuildDomain/next').
- show.conflicts: boolean value to check for task conflicts.
- show.conflicts.objects: boolean value to check for object conflicts.
+ - releasable: boolean value which defines if the project should be considered by the release-work-area target.
+ - baseline.release: defines what release should be used while releasing the project and creating the baseline.
Snapshot: define type of the spec as snapshot and name as the baseline name.
The following properties are required:
- dir : the location of your target snapshot.
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/manual/stages.rst.ftl
--- a/buildframework/helium/doc/src/manual/stages.rst.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/manual/stages.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -107,4 +107,12 @@
.. include:: stage_ats.rst.inc
-.. include:: stage_matti.rst.inc
\ No newline at end of file
+.. include:: stage_matti.rst.inc
+
+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.
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/manual/sysdef3.rst
--- a/buildframework/helium/doc/src/manual/sysdef3.rst Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/manual/sysdef3.rst Wed Jun 16 16:51:40 2010 +0300
@@ -8,7 +8,7 @@
How to configure the feature?
-----------------------------
-In order to enable the support you first need to define the **new.schema** property to true. Then define a resource ant element to either
+In order to enable the support you first need to define the **schema.new** property to true. Then define a resource ant element to either
point to root definition file or package_definition.xml file.
e.g:
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/quick_start_guide.rst.ftl
--- a/buildframework/helium/doc/src/quick_start_guide.rst.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/quick_start_guide.rst.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -1,6 +1,6 @@
<#--
============================================================================
-Name :
+Name : quick_start_guide.rst.ftl
Part of : Helium
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
@@ -20,54 +20,37 @@
============================================================================
-->
########################
-Helium Quick Start Guide
+Helium Quick-Start Guide
########################
.. index::
- module: Helium Quick Start Guide
+ module: Helium Quick-Start Guide
.. contents::
Introduction
============
-This document is a quick start guide for Ant based Helium build framework. More information can be found from `Helium manual`_.
+This document is a quick-start guide for the Ant-based Helium build framework. More information can be found from `Helium manual`_.
-.. _`Helium manual`: index.html#index-65
-
-This quick start guide is aimed at getting you helium on the build machine and showing you how to run helium in the very
-simplest of ways. Further reading and configuration is required to perform a complete build of a component or a product.
+.. _`Helium manual`: manual/index.html
.. index::
single: Helium configuration
-Helium configuration
---------------------
-
-- Helium is configured using a combination of Ant configuration elements (properties, filesets, etc) and other XML files for more complex
- configuration of particular parts of the build. For initial tests run in this quick start guide you do not need to configure anything, but
- do please read the following references for more information:
-
- - `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.
-
-
Installation
=============
<#if !ant?keys?seq_contains("sf")>
-The quickest way to get Helium is to check out from Subversion. Go to a directory and enter::
+Helium can be retrieved from the Hydra_ service:
+
+.. _Hydra: http://wikis.in.nokia.com/Hydra
- svn co http://helium.nmp.nokia.com/svn/helium/tags/helium-8.0
-
-Modify the path for the version of Helium you need.
-
-Read `Retrieving Helium`_ for additional ways to get Helium.
-
-.. _`Retrieving Helium`: manual/retrieving.html
+:URL: http://trhdr001.nmp.nokia.com/services/90?page=1
+:Service: SoftwareBuildSolutions_Tools
+:Product: BuildEnvironment
#if>
@@ -77,6 +60,19 @@
#if>
+
+Configuration
+=============
+
+- Helium is configured using a combination of Ant configuration elements (properties, filesets, etc) and other XML files for more complex
+ configuration of particular parts of the build. For initial tests run in this quick-start guide you do not need to configure anything, but
+ do please read the following references for more information:
+
+ - `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.
+
+
.. index::
single: Running builds with Helium
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/tutorials/configuration/SimplestConfiguration.rst
--- a/buildframework/helium/doc/src/tutorials/configuration/SimplestConfiguration.rst Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-
-
-Basic Helium configuration
-==========================
-
-These two files define the smallest Helium configuration possible:
-
-First the build.xml, it consists in two Ant instructions:
-
- * The creation of a 'env' property which stores current environment variables (see http://ant.apache.org/manual/CoreTasks/property.html).
- * Then the inclusion of Helium features importing the ${helium.dir}/helium.ant.xml, the helium.dir is automatically defined by the Helium bootstrapper.
-
-build.xml:
-
-.. code-block:: xml
-
-
-
-
-
-
-
-
-Finally the Helium bootstrapper, which consists in a simple batch file (or shell script under Linux).
-Its job is to redirect calls to the hlm.bat script under the HELIUM_HOME dir. Additional checks could be added there e.g:
-
- * check if the user has defined the HELIUM_HOME environment variable.
- * set/modify environment
- * define the HELIUM_HOME if Helium is in a known location
-
-hlm.bat::
-
- @echo off
- setlocal
- if not defined HELIUM_HOME (
- echo HELIUM_HOME is not defined.
- goto :eof
- )
- %HELIUM_HOME%\hlm.bat %*
- endlocal
-
-
-
-Download the example:
-`simple_config.zip `_
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/tutorials/configuration/UseHlmTasksInConfiguration.rst
--- a/buildframework/helium/doc/src/tutorials/configuration/UseHlmTasksInConfiguration.rst Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-
-
-How to use Helium ant tasks in configuration
-=============================================
-
-Sometimes customer may need to use helium ant tasks from their configurations and in the
-following way customer can use helium ant tasks by importing helium_preinclude.ant.xml:
-
-Here is a example of build.xml:
-
- * The creation of a 'env' property which stores current environment variables (see http://ant.apache.org/manual/CoreTasks/property.html).
- * Import ${helium.dir}/helium_preinclude.ant.xml to include helium ant tasks.
- * Then a target which is using a helium ant task.
- * Then the inclusion of Helium features importing the ${helium.dir}/helium.ant.xml, the helium.dir is automatically defined by the Helium bootstrapper.
-
-build.xml:
-
-.. code-block:: xml
-
-
-
- Helium pre include test.
-
-
-
-
-
-
- Should not print anything.
-
- Should print something.
-
-
-
-
-
-
-Finally the Helium bootstrapper, which consists in a simple batch file (or shell script under Linux).
-Its job is to redirect calls to the hlm.bat script under the HELIUM_HOME dir. Additional checks could be added there e.g:
-
- * check if the user has defined the HELIUM_HOME environment variable.
- * set/modify environment
- * define the HELIUM_HOME if Helium is in a known location
-
-hlm.bat::
-
- @echo off
- setlocal
- if not defined HELIUM_HOME (
- echo HELIUM_HOME is not defined.
- goto :eof
- )
- %HELIUM_HOME%\hlm.bat %*
- endlocal
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/tutorials/configuration/simple_config.zip
Binary file buildframework/helium/doc/src/tutorials/configuration/simple_config.zip has changed
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/doc/src/tutorials/index.rst
--- a/buildframework/helium/doc/src/tutorials/index.rst Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/doc/src/tutorials/index.rst Wed Jun 16 16:51:40 2010 +0300
@@ -28,8 +28,6 @@
qt_build.rst
rom_image.rst
- configuration/SimplestConfiguration.rst
- configuration/UseHlmTasksInConfiguration.rst
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/helium.ant.xml
--- a/buildframework/helium/helium.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/helium.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -25,6 +25,7 @@
Main full build targets and properties
+
+
Helium task definations. User can import this file and use helium and helium-antlib tasks.
+
@@ -35,4 +37,6 @@
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/hlm.bat
--- a/buildframework/helium/hlm.bat Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/hlm.bat Wed Jun 16 16:51:40 2010 +0300
@@ -32,7 +32,7 @@
call %HELIUM_HOME%\runtime\runtime_env.bat
)
-if not exist "%HELIUM_HOME%\extensions\nokia\distribution.policy.S60" (
+if not exist "%HELIUM_HOME%\extensions\nokia\build.xml" (
set HLM_SUBCON=1
set HLM_DISABLE_INTERNAL_DATA=1
)
@@ -52,7 +52,9 @@
set /p PID=< %TEMP%\%USERNAME%pid.txt
REM Configure Apache Ant
-set TESTED_ANT=C:\APPS\ant_1.7
+if not defined TESTED_ANT (
+ set TESTED_ANT=C:\APPS\ant_1.7
+)
if exist "%TESTED_ANT%" (set ANT_HOME=%TESTED_ANT%)
if not exist "%ANT_HOME%" ( echo *** Ant cannot be found & goto :errorstop )
if not defined ANT_OPTS (
@@ -117,12 +119,14 @@
TITLE Helium
if not exist "%HELIUM_HOME%\external\antlibs2\helium-checktools-1.0.jar" (
-echo *** Error: Please build helium from builder dir run "bld && bld get-deps -Dconfig=sf or nokia"
+echo *** Error: Please build helium from nokia_builder or builder dir run "bld && bld get-deps"
goto errorstop
)
call "%JAVA_HOME%\bin\java" -cp "%HELIUM_HOME%\external\antlibs2\helium-checktools-1.0.jar" com.nokia.helium.checktools.HeliumToolsCheckerMain -config "%HELIUM_HOME%\config\helium.basic.tools.config"
+if not defined HLM_DISABLE_TOOL_CHECK (
if "%ERRORLEVEL%" neq "0" (goto errorstop)
+)
REM Call the Helium generated batch file if it exists
REM This must match with the cache.dir property in helium.ant.xml
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/deps/com.nokia.helium.config/helium-sf-config/1.0/ivy.xml
--- a/buildframework/helium/sf/deps/com.nokia.helium.config/helium-sf-config/1.0/ivy.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/deps/com.nokia.helium.config/helium-sf-config/1.0/ivy.xml Wed Jun 16 16:51:40 2010 +0300
@@ -50,6 +50,8 @@
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/deps/org.python/jython/2.5/ivy.xml
--- a/buildframework/helium/sf/deps/org.python/jython/2.5/ivy.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/deps/org.python/jython/2.5/ivy.xml Wed Jun 16 16:51:40 2010 +0300
@@ -29,6 +29,6 @@
revision="2.5" />
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/deps/setuptools/setuptools/0.6c5/ivy.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/deps/setuptools/setuptools/0.6c5/ivy.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/deps/setuptools/setuptools/0.6c5/setuptools-0.6c5.py2.5.egg
Binary file buildframework/helium/sf/deps/setuptools/setuptools/0.6c5/setuptools-0.6c5.py2.5.egg has changed
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antcoverage/src/com/nokia/helium/ant/coverage/AntTargets.java
--- a/buildframework/helium/sf/java/antcoverage/src/com/nokia/helium/ant/coverage/AntTargets.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antcoverage/src/com/nokia/helium/ant/coverage/AntTargets.java Wed Jun 16 16:51:40 2010 +0300
@@ -119,15 +119,15 @@
public boolean equals(Object obj) {
if (obj instanceof String) {
String str = (String)obj;
- for (Target t : instances) {
- if (t.getName().equals(str)) {
+ for (Target target : instances) {
+ if (target.getName().equals(str)) {
return true;
}
}
} else if (obj instanceof Target) {
Target target = (Target) obj;
- for (Target t : instances) {
- if (t.getLocation().equals(target.getLocation())) {
+ for (Target targetInstance : instances) {
+ if (targetInstance.getLocation().equals(target.getLocation())) {
return true;
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antcoverage/src/com/nokia/helium/ant/coverage/listener/HlmAntUnitListener.java
--- a/buildframework/helium/sf/java/antcoverage/src/com/nokia/helium/ant/coverage/listener/HlmAntUnitListener.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antcoverage/src/com/nokia/helium/ant/coverage/listener/HlmAntUnitListener.java Wed Jun 16 16:51:40 2010 +0300
@@ -204,9 +204,9 @@
@SuppressWarnings("unchecked")
private void addTargets(Project project) {
Hashtable projectTargets = project.getTargets();
- Enumeration e = projectTargets.keys();
- while (e.hasMoreElements()) {
- String key = e.nextElement();
+ Enumeration targetEnum = projectTargets.keys();
+ while (targetEnum.hasMoreElements()) {
+ String key = targetEnum.nextElement();
System.out.println(key + ": " + projectTargets.get(key));
if (!isAntUnitTestTarget(key) && key.length() > 0) {
antTargets.add((Target) projectTargets.get(key));
@@ -222,9 +222,9 @@
@SuppressWarnings("unchecked")
private void addMacros(Project project) {
Hashtable projectMacros = project.getTaskDefinitions();
- Enumeration e = projectMacros.keys();
- while (e.hasMoreElements()) {
- String key = e.nextElement();
+ Enumeration macrosEnum = projectMacros.keys();
+ while (macrosEnum.hasMoreElements()) {
+ String key = macrosEnum.nextElement();
Class newTask = projectMacros.get(key);
if (newTask.getName().equals(
"org.apache.tools.ant.taskdefs.MacroInstance")) {
@@ -245,9 +245,9 @@
@SuppressWarnings("unchecked")
private void addScriptDefs(Project project) {
Hashtable projectMacros = project.getTaskDefinitions();
- Enumeration e = projectMacros.keys();
- while (e.hasMoreElements()) {
- String key = e.nextElement();
+ Enumeration scriptDefsEnum = projectMacros.keys();
+ while (scriptDefsEnum.hasMoreElements()) {
+ String key = scriptDefsEnum.nextElement();
Class newTask = projectMacros.get(key);
if (newTask
.getName()
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntComment.java
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntComment.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/AntComment.java Wed Jun 16 16:51:40 2010 +0300
@@ -96,7 +96,8 @@
while (tokenizer.hasMoreElements()) {
String tagText = (String) tokenizer.nextElement();
String[] tagParts = tagText.split("\\s", 2);
- tags.put(tagParts[0], tagParts[1].trim());
+ if (tagParts.length > 1)
+ tags.put(tagParts[0], tagParts[1].trim());
}
}
}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/MacroMeta.java Wed Jun 16 16:51:40 2010 +0300
@@ -47,9 +47,9 @@
if (defaultval.equals("")) {
defaultval = "value";
}
- else {
- defaultval = "" + defaultval + " ";
- }
+// else {
+// defaultval = "" + defaultval + " ";
+// }
usage = usage + statement.valueOf("@name") + "=\"" + defaultval + "\"" + " ";
}
@@ -57,14 +57,14 @@
statements = getNode().selectNodes(
"//scriptdef[@name='" + macroName + "']/element | //macrodef[@name='" + macroName + "']/element");
for (Node statement : statements) {
- macroElements = "<" + statement.valueOf("@name") + "/>\n" + macroElements;
+ macroElements = " <" + statement.valueOf("@name") + "/>\n" + macroElements;
}
if (macroElements.equals("")) {
- return "<hlm:" + macroName + " " + usage + "/>";
+ return " ";
}
else {
- return "<hlm:" + macroName + " " + usage + ">\n" + macroElements + "</hlm:" + macroName + ">";
+ return "\n" + macroElements + " ";
}
}
}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/ProjectMeta.java Wed Jun 16 16:51:40 2010 +0300
@@ -99,7 +99,7 @@
@SuppressWarnings("unchecked")
public List getProperties() throws IOException {
List properties = new ArrayList();
- List propertyNodes = getNode().selectNodes("//property");
+ List propertyNodes = getNode().selectNodes("//property[string-length(@name)>0]");
for (Node propNode : propertyNodes) {
PropertyMeta propertyMeta = new PropertyMeta(this, propNode);
propertyMeta.setRuntimeProject(getRuntimeProject());
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/database.xml.ftl
--- a/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/database.xml.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antdata/src/com/nokia/helium/ant/data/database.xml.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -26,8 +26,8 @@
${macro.scope}
${macro.deprecated}
${macro.location}
-
-
+ ${macro.summary}
+ ${wiki(macro.documentation)}
<#list macro.signals as signal>
@@ -38,18 +38,17 @@
${macro.source}]]>
#macro>
-
-
+
<#list projects as project>
${project.name}
${project.default}
-
+ ${wiki(project.description)}
${project.scope}
${project.deprecated}
${project.location}
-
-
+ ${project.summary}
+ ${wiki(project.documentation)}
<#list project.projectDependencies as dependency>
${dependency}
@@ -66,12 +65,12 @@
${target.name}
${target.if}
${target.unless}
-
+ ${target.description}
${target.scope}
${target.deprecated}
${target.location}
-
-
+ ${target.summary}
+ ${wiki(target.documentation)}
<#list target.depends as dependency>
${dependency}
@@ -111,8 +110,8 @@
${property.scope}
${property.deprecated}
${property.location}
-
-
+ ${property.summary}
+ ${wiki(property.documentation)}
@@ -127,8 +126,8 @@
${property.scope}
${property.deprecated}
${property.location}
-
-
+ ${property.summary}
+ ${wiki(property.documentation)}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/AntFile.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/AntFile.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +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 java.util.ArrayList;
-
-/**
- * AntFile
is used to hold information about the antlint checkings
- * such as number of errors and warnings found for the given ant file.
- *
- */
-public class AntFile implements Comparable {
- private String name;
- private int warningCount;
- private int errorCount;
-
- private ArrayList propertiesVisited = new ArrayList();
-
- /**
- * Create an instance of {@link AntFile}.
- *
- * @param name
- * is the name of the Ant file.
- */
- public AntFile(String name) {
- this.name = name;
- }
-
- /**
- * Increment warnings count by one.
- */
- public void incrementWarningCount() {
- warningCount++;
- }
-
- /**
- * Return total number of warnings found.
- *
- * @return the total number of warnings.
- */
- public int getWarningCount() {
- return warningCount;
- }
-
- /**
- * Increment error count by one.
- */
- public void incrementErrorCount() {
- errorCount++;
- }
-
- /**
- * Return total number of errors found.
- *
- * @return the total number of errors.
- */
- public int getErrorCount() {
- return errorCount;
- }
-
- /**
- * Mark the given property as visited.
- *
- * @param propertyName
- * is the property to be marked.
- */
- public void markPropertyAsVisited(String propertyName) {
- propertiesVisited.add(propertyName);
- }
-
- /**
- * Check whether the given property is already visited or not.
- *
- * @param propertyName
- * is the property to lookup for.
- * @return true if the property is marked visited; otherwise false.
- */
- public boolean isPropertyVisited(String propertyName) {
- return propertiesVisited.contains(propertyName);
- }
-
- /**
- * Return a string representation of this object.
- *
- * @return a string representation of this object.
- */
- public String toString() {
- return errorCount + " errors and " + warningCount + " warnings " + name;
- }
-
- /**
- * {@inheritDoc}
- */
- public int compareTo(AntFile otherAntFile) {
- return new Integer(otherAntFile.getWarningCount())
- .compareTo(new Integer(this.warningCount))
- * -1;
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/AntLintHandler.java Wed Jun 16 16:51:40 2010 +0300
@@ -20,7 +20,8 @@
import org.xml.sax.Locator;
import org.xml.sax.helpers.DefaultHandler;
-import com.nokia.helium.antlint.checks.Check;
+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
@@ -46,7 +47,7 @@
* @param check
* is the check to be performed.
*/
- public AntLintHandler(Check check) {
+ public AntLintHandler(AbstractCheck check) {
super();
this.check = check;
}
@@ -66,13 +67,6 @@
}
/**
- * {@inheritDoc}
- */
- public void endDocument() {
-
- }
-
- /**
* Set whether the handler should check for indentation or not.
*
* @param indentationCheck
@@ -125,7 +119,9 @@
private void checkIndent() {
if (indentationCheck) {
if ((indentSpace != indentLevel) && !textElement) {
- check.log(locator.getLineNumber() + ": Bad indentation!");
+ check.getReporter().report(check.getSeverity(),
+ "Bad indentation", check.getAntFile(),
+ locator.getLineNumber());
}
}
}
@@ -147,24 +143,25 @@
int numSpaces = 0;
for (int i = 0; i < strBuff.length(); i++) {
switch (strBuff.charAt(i)) {
- case '\t':
- numSpaces += 4;
- if (tabCharacterCheck) {
- check.log(locator.getLineNumber()
- + ": Tabs should not be used!");
- }
- break;
- case '\n':
- numSpaces = 0;
- break;
- case '\r':
- break;
- case ' ':
- numSpaces++;
- break;
- default:
- textElement = true;
- break;
+ 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;
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/AntProjectVisitor.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/AntProjectVisitor.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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 java.util.Collection;
-
-import org.dom4j.Element;
-import org.dom4j.VisitorSupport;
-
-import com.nokia.helium.antlint.checks.Check;
-
-/**
- * AntProjectVisitor
extends {@link VisitorSupport} and is used to
- * visit the various nodes of the given project and run the antlint checklist
- * against those nodes.
- *
- */
-public class AntProjectVisitor extends VisitorSupport {
-
- private Collection checks;
-
- /**
- * Create an instance of {@link AntProjectVisitor}.
- *
- * @param checks is the antlint checklist.
- */
- public AntProjectVisitor(Collection checks) {
- this.checks = checks;
- }
-
- /**
- * Visit the given node and run the antlint checklist.
- */
- public void visit(Element node) {
- for (Check check : checks) {
- if (check.isEnabled())
- check.run(node);
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/AntlintException.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/AntlintException.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+/**
+ * Exception class for Antlint implementation
+ *
+ */
+public class AntlintException extends Exception {
+
+ private static final long serialVersionUID = 3420280191500760182L;
+
+ /**
+ * Constructor.
+ *
+ * @param message
+ */
+ public AntlintException(String message) {
+ super(message);
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/Reporter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/Reporter.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,59 @@
+/*
+ * 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;
+
+import java.io.File;
+
+import org.apache.tools.ant.Task;
+
+/**
+ * To report the antlint errors into antlint task.
+ */
+
+public interface Reporter {
+
+ /**
+ * Open the reporting session.
+ * Ant attribute validation should preferably
+ * happen here.
+ *
+ */
+ void open();
+
+ /**
+ * Closing the reporting session.
+ */
+ void close();
+
+ /**
+ * To report the errors into antlint task.
+ *
+ * @param severity
+ * @param message
+ * @param filename
+ * @param lineNo
+ */
+ void report(Severity severity, String message, File filename, int lineNo);
+
+ /**
+ * To set the task calling reporter.
+ *
+ * @param task
+ */
+ void setTask(Task task);
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/Severity.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/Severity.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+import org.apache.tools.ant.types.EnumeratedAttribute;
+
+/**
+ * To store the antlint severties.
+ */
+public class Severity extends EnumeratedAttribute {
+
+ private static final String[] VALUES = { "error", "warning" };
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
+ */
+ @Override
+ public String[] getValues() {
+ return VALUES;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -24,7 +24,30 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/taskdefs/AntLintTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -19,24 +19,17 @@
import java.io.File;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import java.util.Vector;
-
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.FileSet;
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.dom4j.Visitor;
-import org.dom4j.io.SAXReader;
-import org.dom4j.DocumentException;
-
-import com.nokia.helium.antlint.AntFile;
-import com.nokia.helium.antlint.AntProjectVisitor;
-import com.nokia.helium.antlint.ant.types.Checker;
-import com.nokia.helium.antlint.checks.Check;
+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;
/**
* AntLint Task. This task checks for common coding conventions and errors in
@@ -56,8 +49,6 @@
* CheckPresetDefMacroDefName : checks the naming convention of presetdef
* and macrodef
* CheckProjectName : checks the naming convention of project
- * CheckPropertiesInDataModel : checks whether the properties are defined in
- * data model
* CheckPropertyName : checks the naming convention of properties
*
* CheckPythonTasks : checks the coding convention of python tasks
@@ -94,34 +85,23 @@
* <include name="*build.xml"/>
* <include name="*.antlib.xml"/>
* </fileset>
- * <checker name="CheckTabCharacter" severity="error" />
- * .
- * .
- * <checker name="CheckTargetName" severity="warning">([a-z0-9[\\d\\-]]*)</checker>
+ * <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"/>
* </antlint>
*
*
* @ant.task name="antlint" category="AntLint"
*
*/
-public class AntLintTask extends Task {
-
- private List checkerList = new Vector();
- private List antFileSetList = new ArrayList();
-
- private List antFilelist = new ArrayList();
- private List checkList = new ArrayList();
+public class AntLintTask extends Task implements Reporter {
- /**
- * Add the given {@link Checker} to the checklist.
- *
- * @param checker
- * is the checker to be added.
- * @ant.required
- */
- public void addChecker(Checker checker) {
- checkerList.add(checker);
- }
+ private List checkerList = new Vector();
+ private List antFileSetList = new ArrayList();
+ private List reporters = new ArrayList();
+ private int errorCount;
+ private boolean failOnError = true;
+ private ConsoleReporter consoleReporter = new ConsoleReporter();
/**
* Add a set of files to copy.
@@ -138,117 +118,50 @@
* Execute the antlint task.
*/
public final void execute() {
+ if (checkerList.size() == 0) {
+ throw new BuildException("No antlint checks are defined.");
+ }
try {
- initialize();
- startAntLintCheck(); // trigger antlint checking
- } catch (DocumentException e) {
+ // Adding console reported by default if no
+ // other reporter are mentioned.
+ if (reporters.size() == 0) {
+ reporters.add(consoleReporter);
+ }
+ setTask(this);
+ open();
+ doAntLintCheck();
+ } catch (AntlintException e) {
throw new BuildException(
"Exception occured while running AntLint task "
+ e.getMessage());
+ } finally {
+ // Closing all reporter session.
+ close();
}
- int errorCount = 0;
- for (AntFile antFile : antFilelist) {
- errorCount = errorCount + antFile.getErrorCount();
- log(antFile.toString());
- }
- if (errorCount > 0) {
- throw new BuildException(errorCount + " errors found.");
+ if (failOnError && (errorCount > 0)) {
+ throw new BuildException("Build failed because of AntLint errors.");
}
- }
-
- /**
- * Initialize the checklist setting the checkers against their corresponding
- * Checks.
- */
- private void initialize() {
- Check check = null;
- for (Checker checker : checkerList) {
- check = getCheckObject(checker.getName());
- if (check != null) {
- check.setChecker(checker);
- checkList.add(check);
- }
- }
- }
- /**
- * Instantiate the given {@link Check}.
- *
- * @param checkerName
- * is the name of the Check object to be instantiated.
- * @return an instance of requested {@link Check}.
- */
- @SuppressWarnings("unchecked")
- private Check getCheckObject(String checkerName) {
- Check check = null;
- try {
- Class clazz = Class.forName("com.nokia.helium.antlint.checks."
- + checkerName);
- if (clazz != null) {
- check = (Check) clazz.newInstance();
- }
- } catch (ClassNotFoundException th) {
- throw new BuildException("Error in Antlint configuration-ClassNotFoundException:", th);
- } catch (InstantiationException th) {
- throw new BuildException("Error in Antlint configuration-InstantiationException:", th);
- } catch (IllegalAccessException th) {
- throw new BuildException("Error in Antlint configuration-IllegalAccessException:", th);
- }
- return check;
}
/**
* Triggers the antlint checking.
*
+ * @throws AntlintException
+ *
* @throws Exception
* if the checking fails.
*/
- private void startAntLintCheck() throws DocumentException {
- runOneTimeCheck();
+ 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];
- getProject().log("*************** Ant File: " + antFileName);
-
- run(antFileName);
-
- SAXReader saxReader = new SAXReader();
- Document doc = saxReader.read(new File(antFileName));
- treeWalk(doc);
- }
- Collections.sort(antFilelist);
- }
- }
-
- /**
- * Parse the given document.
- *
- * @param document
- * is the document to be parsed.
- */
- private void treeWalk(final Document document) {
- Element rootElement = document.getRootElement();
- Visitor visitorRootElement = new AntProjectVisitor(checkList);
- rootElement.accept(visitorRootElement);
- }
-
- /**
- * Runs one time antlint checks.
- *
- */
- private void runOneTimeCheck() {
- AntFile antFile = new AntFile("General");
- antFilelist.add(antFile);
- for (Check check : checkList) {
- if (check.isEnabled()) {
- check.setAntFile(antFile);
- check.run();
+ String antFilename = basedir + File.separator + srcFiles[i];
+ runChecks(new File(antFilename));
}
}
}
@@ -258,15 +171,89 @@
*
* @param antFileName
* is the name of the ant file to be checked.
+ * @throws AntlintException
*/
- private void run(String antFileName) {
- AntFile antFile = new AntFile(antFileName);
- antFilelist.add(antFile);
- for (Check check : checkList) {
+ private void runChecks(File antFilename) throws AntlintException {
+ for (Check check : checkerList) {
if (check.isEnabled()) {
- check.setAntFile(antFile);
- check.run(antFileName);
+ check.validateAttributes();
+ check.setReporter(this);
+ check.run(antFilename);
}
}
+
}
+
+ /**
+ * To add Antlint checkers.
+ *
+ * @param c
+ */
+ public void add(Check c) {
+ checkerList.add(c);
+ }
+
+ /**
+ * To add reporters.
+ *
+ * @param reporter
+ */
+ public void add(Reporter reporter) {
+ reporter.setTask(this);
+ reporters.add(reporter);
+ }
+
+ /**
+ * @param failOnError
+ * the failOnError to set
+ */
+ public void setFailOnError(boolean failOnError) {
+ this.failOnError = failOnError;
+ }
+
+ /*
+ * (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) {
+ if (severity.getValue().toUpperCase().equals("ERROR")) {
+ errorCount++;
+ }
+
+ for (Reporter reporter : reporters) {
+ reporter.report(severity, message, filename, lineNo);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.helium.antlint.ant.Reporter#setTask(org.apache.tools.ant.Task)
+ */
+ @Override
+ public void setTask(Task task) {
+ for (Reporter reporter : reporters) {
+ reporter.setTask(task);
+ }
+ }
+
+ @Override
+ public void close() {
+ for (Reporter reporter : reporters) {
+ reporter.close();
+ }
+ }
+
+ @Override
+ public void open() {
+ for (Reporter reporter : reporters) {
+ reporter.open();
+ }
+ }
+
}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractCheck.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractCheck.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,134 @@
+/*
+ * 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.BuildException;
+import org.apache.tools.ant.types.DataType;
+import org.dom4j.Element;
+import org.dom4j.Node;
+import com.nokia.helium.antlint.ant.Reporter;
+import com.nokia.helium.antlint.ant.Severity;
+
+/**
+ * AbstractCheck
is an abstract implementation of {@link Check}.
+ *
+ */
+public abstract class AbstractCheck extends DataType implements Check {
+
+ private boolean enabled;
+ private Severity severity;
+ private Reporter reporter;
+
+ /**
+ * @param enabled
+ * the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.helium.antlint.ant.types.Check#setReporter(com.nokia.helium
+ * .antlint.ant.Reporter)
+ */
+ public void setReporter(Reporter reporter) {
+ this.reporter = reporter;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#getReporter()
+ */
+ public Reporter getReporter() {
+ return this.reporter;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.helium.antlint.ant.types.Check#setSeverity(com.nokia.helium
+ * .antlint.ant.Severity)
+ */
+ public void setSeverity(Severity severity) {
+ this.severity = severity;
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#getSeverity()
+ */
+ public Severity getSeverity() {
+ return severity;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(Element node) {
+ // ignore
+ }
+
+ /**
+ * Return the nodes matching search element.
+ *
+ * @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);
+ }
+ }
+ }
+
+ /**
+ * To validate checker attributes.
+ *
+ * @return
+ */
+ public void validateAttributes() {
+ if (severity == null) {
+ throw new BuildException(
+ "'severity' attribute should be specified for checker '"
+ + this.toString() + "'");
+ }
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractScriptCheck.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractScriptCheck.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,111 @@
+/*
+ * 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.PrintWriter;
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.io.IOException;
+
+import org.apache.tools.ant.BuildException;
+
+/**
+ * AbstractScriptCheck
is an abstract implementation of
+ * {@link Check} and contains some concrete methods related to script.
+ *
+ */
+public abstract class AbstractScriptCheck extends AbstractCheck {
+
+ /**
+ * Write a script with the given name and the text.
+ *
+ * @param name
+ * is the name of the script
+ * @param text
+ * is the script text.
+ */
+ 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);
+ }
+ 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();
+ }
+ } catch (IOException e) {
+ throw new BuildException("Not able to write JEP File " + name
+ + "_jep.py");
+ }
+ }
+
+ /**
+ * Check for the properties in the given script text.
+ *
+ * @param text
+ * is the script text to lookup.
+ */
+ 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));
+ }
+ /*
+ * for (String group : props) { checkPropertyInModel(group); }
+ */
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Check.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Check.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,113 @@
+/*
+ * 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.dom4j.Element;
+
+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.
+ *
+ */
+public interface Check {
+
+ /**
+ * Method runs the configured checks against the given node.
+ *
+ * @param node
+ * is the node of the xml to be checked.
+ */
+ 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;
+
+ /**
+ * Return whether this is check is enabled or not.
+ *
+ * @return true if a checker is available for this check; otherwise false.
+ */
+ boolean isEnabled();
+
+ /**
+ * To set the checker enabled.
+ *
+ * @param enabled
+ */
+ void setEnabled(boolean enabled);
+
+ /**
+ * To set checker Severity.
+ *
+ * @param severity
+ */
+ void setSeverity(Severity severity);
+
+ /**
+ * To return current severity.
+ *
+ * @return
+ */
+ Severity getSeverity();
+
+ /**
+ * To validate the attributes passed.
+ */
+ void validateAttributes();
+
+ /**
+ * To set the reporter.
+ *
+ * @param reporter
+ */
+ void setReporter(Reporter reporter);
+
+ /**
+ * To get the current reporter.
+ *
+ * @return
+ */
+ Reporter getReporter();
+
+ /**
+ * Return ant file.
+ *
+ * @return
+ */
+ File getAntFile();
+
+ /**
+ * To return current checker name.
+ *
+ * @return
+ */
+ String toString();
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckAntCall.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckAntCall.java Wed Jun 16 16:51:40 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.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;
+
+/**
+ * CheckAntCall
is used to check whether antcall is used with no
+ * param elements and calls the target with no dependencies
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckAntCall" severity="error" enabled="true"/>
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckAntCall" category="AntLint"
+ */
+public class CheckAntCall extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@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);
+ }
+ }
+ }
+ }
+
+ /*
+ * (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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDescription.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDescription.java Wed Jun 16 16:51:40 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.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;
+
+/**
+ * CheckDescription
is used to check whether project description is
+ * present or not.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckDescription" severity="error" enabled="true"/>
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckDescription" category="AntLint"
+ */
+public class CheckDescription extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@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);
+ }
+ }
+
+ /*
+ * (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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDuplicateNames.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckDuplicateNames.java Wed Jun 16 16:51:40 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.antlint.ant.types;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Hashtable;
+
+/**
+ * CheckDuplicateNames
is used to check for duplicate macro names.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckDuplicateNames" severity="error" enabled="true"/>
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckDuplicateNames" category="AntLint"
+ */
+public class CheckDuplicateNames extends AbstractCheck {
+
+ private File antFile;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
+ */
+ @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);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.tools.ant.types.DataType#toString()
+ */
+ public String toString() {
+ return "CheckDuplicateNames";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
+ */
+ public File getAntFile() {
+ return this.antFile;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckFileName.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckFileName.java Wed Jun 16 16:51:40 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 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.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckFileName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)"/>
+ * </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)
+ */
+ 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);
+ }
+ }
+ }
+
+ /**
+ * @param regExp
+ * the regExp to set
+ */
+ public void setRegExp(String regExp) {
+ this.regExp = regExp;
+ }
+
+ /**
+ * @return the regExp
+ */
+ 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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckIndentation.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckIndentation.java Wed Jun 16 16:51:40 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.antlint.ant.types;
+
+import java.io.File;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.xml.sax.SAXException;
+import java.io.IOException;
+
+import com.nokia.helium.antlint.AntLintHandler;
+import com.nokia.helium.antlint.ant.AntlintException;
+
+/**
+ * CheckIndentation
is used to check the indentations in the ant
+ * files.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckIndentation" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckIndentation" category="AntLint"
+ *
+ */
+public class CheckIndentation extends AbstractCheck {
+ private File antFile;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
+ */
+ 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());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.tools.ant.types.DataType#toString()
+ */
+ public String toString() {
+ return "CheckIndentation";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
+ */
+ public File getAntFile() {
+ return this.antFile;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckJythonScript.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckJythonScript.java Wed Jun 16 16:51:40 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.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;
+
+/**
+ * CheckJepJythonScript
is used to check the coding convention in
+ * Jep and Jython scripts
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckJepJythonScript" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckJepJythonScript" 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);
+ }
+ }
+ }
+
+ /**
+ * Check against the given node.
+ *
+ * @param node
+ * is the node to check.
+ */
+ @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);
+ }
+
+ }
+
+ /**
+ * @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 "CheckJepJythonScript";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
+ */
+ public File getAntFile() {
+ return this.antFile;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPresetDefMacroDefName.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPresetDefMacroDefName.java Wed Jun 16 16:51:40 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.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;
+
+/**
+ * CheckPresetDefMacroDefName
is used to check the naming
+ * convention of presetdef and macrodef
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckPresetDefMacroDefName" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckPresetDefMacroDefName" category="AntLint"
+ *
+ */
+public class CheckPresetDefMacroDefName extends AbstractCheck {
+
+ 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);
+
+ }
+
+ List attributeList = node.elements("attribute");
+ for (Element attributeElement : attributeList) {
+ String attributeName = attributeElement.attributeValue("name");
+ checkDefName(attributeName);
+ }
+ }
+ }
+
+ /**
+ * 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)
+ *
+ * @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
+ */
+ public void setRegExp(String regExp) {
+ this.regExp = regExp;
+ }
+
+ /**
+ * @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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckProjectName.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckProjectName.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,140 @@
+/*
+ * 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.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;
+
+/**
+ * CheckProjectName
is used to check the naming convention of
+ * project names.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckProjectName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckProjectName" category="AntLint"
+ *
+ */
+public class CheckProjectName extends AbstractCheck {
+ private String regExp;
+ private File antFile;
+
+ /**
+ * {@inheritDoc}
+ *
+ * @throws SAXException
+ * @throws ParserConfigurationException
+ */
+ 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);
+ }
+
+ }
+ }
+
+ /**
+ * 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)
+ *
+ * @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
+ */
+ public void setRegExp(String regExp) {
+ this.regExp = regExp;
+ }
+
+ /**
+ * @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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPropertyName.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPropertyName.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,163 @@
+/*
+ * 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.io.SAXReader;
+
+import com.nokia.helium.antlint.ant.AntlintException;
+
+/**
+ * CheckPropertyName
is used to check the naming convention of
+ * property names.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckPropertyName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckPropertyName" category="AntLint"
+ *
+ */
+public class CheckPropertyName extends AbstractCheck {
+
+ 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);
+ }
+ }
+ }
+
+ /**
+ * 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)
+ *
+ * @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
+ */
+ public void setRegExp(String regExp) {
+ this.regExp = regExp;
+ }
+
+ /**
+ * @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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPythonTasks.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckPythonTasks.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,161 @@
+/*
+ * 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.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.io.IOException;
+
+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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckRunTarget.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckRunTarget.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,145 @@
+/*
+ * 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 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;
+
+/**
+ * CheckRunTarget
is used to check whether runtarget calls a target
+ * that has dependencies.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckRunTarget" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckRunTarget" category="AntLint"
+ *
+ */
+public class CheckRunTarget extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@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);
+ }
+ }
+ }
+ }
+
+ /*
+ * (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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptCondition.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptCondition.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,139 @@
+/*
+ * 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 org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+import com.nokia.helium.antlint.ant.AntlintException;
+
+/**
+ * CheckScriptCondition
is used to check the coding convention in
+ * script condition
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckScriptCondition" severity="error" enabled="true" />
+ * </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);
+ }
+ }
+
+ /**
+ * Check against the given node.
+ *
+ * @param node
+ * is the node to check.
+ */
+ @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);
+ }
+
+ }
+
+ /**
+ * @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 "CheckScriptCondition";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
+ */
+ public File getAntFile() {
+ return this.antFile;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDef.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDef.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,205 @@
+/*
+ * 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.PrintWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.io.IOException;
+
+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("} }");
+ 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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefNameAttributes.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefNameAttributes.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,136 @@
+/*
+ * 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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefStyle.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptDefStyle.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,141 @@
+/*
+ * 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;
+
+/**
+ * CheckScriptDefStyle
is used to check the coding style of
+ * 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>
+ * <CheckScriptDefStyle" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckScriptDefStyle" category="AntLint"
+ *
+ */
+public class CheckScriptDefStyle extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(Element node) {
+ if (node.getName().equals("scriptdef")) {
+ String scriptdefname = node.attributeValue("name");
+ checkScriptDefStyle(scriptdefname, node);
+ }
+ }
+
+ /**
+ * Check against the given node.
+ *
+ * @param node
+ * is the node to check.
+ */
+ @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));
+ }
+
+ ArrayList attributes = new ArrayList();
+ for (Node statement : statements) {
+ attributes.add(statement.valueOf("@name"));
+ }
+
+ 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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptSize.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckScriptSize.java Wed Jun 16 16:51:40 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.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;
+
+/**
+ * CheckScriptSize
is used to check the size of script. By default,
+ * the script should not contain more than 1000 characters.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckScriptSize" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckScriptSize" category="AntLint"
+ *
+ */
+public class CheckScriptSize extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(Element node) {
+ if (node.getName().equals("target")) {
+ checkSizeOfScript(node);
+ }
+ }
+
+ /**
+ * Check against the given node.
+ *
+ * @param node
+ * is the node to check.
+ */
+ @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);
+ }
+ }
+ }
+
+ 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 "CheckScriptSize";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#getAntFile()
+ */
+ public File getAntFile() {
+ return this.antFile;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTabCharacter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTabCharacter.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,134 @@
+/*
+ * 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 java.io.IOException;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.xml.sax.SAXException;
+import org.dom4j.Element;
+import org.dom4j.Node;
+
+import com.nokia.helium.antlint.AntLintHandler;
+import com.nokia.helium.antlint.ant.AntlintException;
+
+/**
+ * CheckTabCharacter
is used to check the tab characters inside the
+ * ant files.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckTabCharacter" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckTabCharacter" category="AntLint"
+ *
+ */
+public class CheckTabCharacter extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(Element node) {
+ checkTabsInScript(node);
+ }
+
+ /**
+ * Check against the given node.
+ *
+ * @param node
+ * is the node to check.
+ */
+ @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);
+ }
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.nokia.helium.antlint.ant.types.Check#run(java.io.File)
+ */
+ 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());
+ }
+ }
+
+ /*
+ * (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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTargetName.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckTargetName.java Wed Jun 16 16:51:40 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.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;
+
+/**
+ * CheckTargetName
is used to check the naming convention of the
+ * target names.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckTargetName" severity="error" enabled="true" regexp="([a-z0-9[\\d\\-]]*)" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckTargetName" category="AntLint"
+ *
+ */
+public class CheckTargetName extends AbstractCheck {
+
+ private String regExp;
+ private File antFile;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(Element node) {
+ if (node.getName().equals("target")) {
+ String target = node.attributeValue("name");
+ 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);
+ }
+ } else {
+ log("Target name not specified!");
+ }
+ }
+
+ /**
+ * @return the regExp
+ */
+ public String getRegExp() {
+ return regExp;
+ }
+
+ /**
+ * @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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfEqualsTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfEqualsTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,111 @@
+/*
+ * 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 org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+
+import com.nokia.helium.antlint.ant.AntlintException;
+
+/**
+ * CheckUseOfEqualsTask
is used to check the usage of equals task
+ * as against istrue task.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckUseOfEqualsTask" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckUseOfEqualsTask" category="AntLint"
+ */
+public class CheckUseOfEqualsTask extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void run(Element node) {
+ if (node.getName().equals("equals")) {
+ String text = node.attributeValue("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);
+ }
+ }
+ }
+
+ /*
+ * (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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfIfInTargets.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckUseOfIfInTargets.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,163 @@
+/*
+ * 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 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;
+
+/**
+ * CheckUseOfIfInTargets
is used to check the usage of if task as
+ * against the condition task or <target if|unless="property.name"> inside
+ * targets.
+ *
+ *
+ * Usage:
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ * <CheckUseOfIfInTargets" severity="error" enabled="true" />
+ * </antlint>
+ *
+ *
+ * @ant.task name="CheckUseOfIfInTargets" category="AntLint"
+ *
+ */
+public class CheckUseOfIfInTargets extends AbstractCheck {
+
+ private File antFile;
+
+ /**
+ * {@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";
+
+ 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);
+ }
+ }
+ }
+ List statements = node.selectNodes("//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 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;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Checker.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/Checker.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +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 org.apache.tools.ant.types.DataType;
-
-/**
- * Checker
is a datatype used to hold information related to
- * antlint check configurations.
- *
- *
- * Usage:
- *
- * <checker name="CheckTargetName" severity="warning">([a-z0-9[\\d\\-]]*)</checker>
- *
- *
- */
-public class Checker extends DataType {
-
- private String name;
- private String text;
- private String 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 String getSeverity() {
- return severity;
- }
-
- /**
- * Set the severity. (Valid values : error|warning)
- *
- * @param severity
- * is the severity to set.
- * @ant.required
- */
- public void setSeverity(String severity) {
- this.severity = severity;
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckstyleXmlReporter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/CheckstyleXmlReporter.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,161 @@
+/*
+ * 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.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.DataType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.nokia.helium.antlint.ant.Reporter;
+import com.nokia.helium.antlint.ant.Severity;
+
+/**
+ * This reporter will generate a Checkstyle compatible XML to
+ * report Antlint issues.
+ *
+ * Usage:
+ *
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ *
+ * ...
+ *
+ * <antlintCheckstyleReporter file="report.xml" />
+ * </antlint>
+ *
+ *
+ * @ant.type name="antlintCheckstyleReporter" category="AntLint"
+ */
+public class CheckstyleXmlReporter extends DataType implements Reporter {
+
+ private Task task;
+ private Document doc;
+ private File file;
+ private Element currentFileNode;
+ private File currentFile;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void report(Severity severity, String message, File filename,
+ int lineNo) {
+ if (doc != null) {
+ if (currentFile == null || !currentFile.equals(filename)) {
+ currentFileNode = doc.createElement("file");
+ doc.getDocumentElement().appendChild(currentFileNode);
+ currentFile = filename;
+ currentFileNode.setAttribute("name", currentFile.getAbsolutePath());
+ }
+ Element element = doc.createElement("error");
+ element.setAttribute("severity", severity.getValue());
+ element.setAttribute("message", message);
+ element.setAttribute("line", "" + lineNo);
+ element.setAttribute("source", "antlint");
+ currentFileNode.appendChild(element);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setTask(Task task) {
+ this.task = task;
+ }
+
+ /**
+ * Closing the reporting session. It will generates
+ * the xml file.
+ */
+ @Override
+ public void close() {
+ task.log("Creating " + file);
+ try {
+ // set up a transformer
+ TransformerFactory transfac = TransformerFactory.newInstance();
+ Transformer trans = transfac.newTransformer();
+ trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ trans.setOutputProperty(OutputKeys.INDENT, "yes");
+
+ // create string from xml tree
+ Writer writer = new FileWriter(file);
+ StreamResult result = new StreamResult(writer);
+ DOMSource source = new DOMSource(doc);
+ trans.transform(source, result);
+ } catch (TransformerException e) {
+ throw new BuildException(e.getMessage(), e);
+ } catch (IOException e) {
+ throw new BuildException(e.getMessage(), e);
+ } finally {
+ task = null;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void open() {
+ if (file == null) {
+ throw new BuildException("'file' attribute is not defined.");
+ }
+ try {
+ DocumentBuilderFactory builder = DocumentBuilderFactory.newInstance();
+ DocumentBuilder docBuilder;
+ docBuilder = builder.newDocumentBuilder();
+ doc = docBuilder.newDocument();
+ Element root = doc.createElement("checkstyle");
+ root.setAttribute("version", "5.0");
+ doc.appendChild(root);
+ } catch (ParserConfigurationException e) {
+ throw new BuildException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Defines the output file.
+ * @param file
+ * @ant.required
+ */
+ public void setFile(File file) {
+ this.file = file;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/ConsoleReporter.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/ConsoleReporter.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,113 @@
+/*
+ * 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.Task;
+import org.apache.tools.ant.types.DataType;
+
+import com.nokia.helium.antlint.ant.Reporter;
+import com.nokia.helium.antlint.ant.Severity;
+
+/**
+ * This reporter will produce Antlint reporting using ant logging
+ * system.
+ *
+ * Usage:
+ *
+ *
+ * <antlint>
+ * <fileset id="antlint.files" dir="${antlint.test.dir}/data">
+ * <include name="*.ant.xml"/>
+ * <include name="*build.xml"/>
+ * <include name="*.antlib.xml"/>
+ * </fileset>
+ *
+ * ...
+ *
+ * <antlintCheckstyleReporter />
+ * </antlint>
+ *
+ *
+ * @ant.type name="antlintConsoleReporter" category="AntLint"
+ */
+public class ConsoleReporter extends DataType implements Reporter {
+
+ private Task task;
+ private File antFilename;
+
+ /*
+ * (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) {
+ String errorMessage;
+ if (this.antFilename == null) {
+ this.antFilename = filename;
+ task.log("\nError(s)/Warning(s) for: " + this.antFilename);
+ task
+ .log("----------------------------------------------------------");
+ } else if (!this.antFilename.equals(filename)) {
+ this.antFilename = filename;
+ task.log("\nError(s)/Warning(s) for: " + this.antFilename);
+ task
+ .log("----------------------------------------------------------");
+ }
+ if (lineNo > 0) {
+ errorMessage = severity.getValue().toUpperCase() + ": " + lineNo
+ + ": " + message;
+
+ } else {
+ errorMessage = severity.getValue().toUpperCase() + ": " + message;
+ }
+ task.log(errorMessage);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.nokia.helium.antlint.ant.Reporter#setTask(org.apache.tools.ant.Task)
+ */
+ @Override
+ public void setTask(Task task) {
+ this.task = task;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void close() {
+ this.task = null;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void open() {
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/AbstractCheck.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/AbstractCheck.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +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.checks;
-
-//import java.io.File;
-//import java.util.List;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Target;
-import org.dom4j.Document;
-import org.dom4j.Element;
-//import org.dom4j.Node;
-import org.dom4j.io.SAXReader;
-
-import com.nokia.helium.antlint.AntFile;
-import com.nokia.helium.antlint.ant.types.Checker;
-
-/**
- * AbstractCheck
is an abstract implementation of {@link Check}.
- *
- */
-public abstract class AbstractCheck implements Check {
-
- private Checker checker;
- private AntFile antFile;
- private boolean enabled;
-
- /**
- * {@inheritDoc}
- */
- public void setChecker(Checker checker) {
- this.checker = checker;
- this.enabled = true;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setAntFile(AntFile antFile) {
- this.antFile = antFile;
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * {@inheritDoc}
- */
- public Checker getChecker() {
- return this.checker;
- }
-
- /**
- * Return the {@link AntFile} set.
- *
- * @return the {@link AntFile}
- */
- protected AntFile getAntFile() {
- return antFile;
- }
-
- /**
- * {@inheritDoc}
- */
- public void log(String message) {
- if (checker.getSeverity() != null
- && checker.getSeverity().equalsIgnoreCase("error")) {
- logError(message);
- antFile.incrementErrorCount();
- } else {
- logWarning(message);
- antFile.incrementWarningCount();
- }
- }
-
- /**
- * Get the {@link Pattern} associated with current {@link Check}.
- *
- * @return the Pattern.
- */
- protected String getPattern() {
- return checker.getPattern();
- }
-
- /**
- * Get the {@link Project}.
- *
- * @return the {@link Project}
- */
- protected Project getProject() {
- return checker.getProject();
- }
-
- /**
- * 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
- */
- protected boolean checkTargetDependency(String targetName) {
- boolean dependencyCheck = false;
- Target targetDependency = (Target) getProject().getTargets().get(
- targetName);
- dependencyCheck = targetDependency != null
- && targetDependency.getDependencies().hasMoreElements();
- return dependencyCheck;
- }
-
- /**
- * Check the whether the given property is defined in the data model.
- *
- * @param customerProp
- * is the property to check for.
- */
- @SuppressWarnings("unchecked")
- protected void checkPropertyInModel(String customerProp) {
- SAXReader xmlReader = new SAXReader();
- Document antDoc = null;
-
- // TODO
-
-// try {
-// File model = new File(getProject().getProperty("data.model.parsed"));
-// antDoc = xmlReader.read(model);
-// } catch (Exception e) {
-// throw new BuildException("Not able to read data model file "
-// + getProject().getProperty("data.model.parsed"));
-// }
-//
-// List statements = antDoc.selectNodes("//property");
-//
-// for (Node statement : statements) {
-// if (customerProp.equals(statement.valueOf("name"))) {
-// return;
-// }
-// }
-// log(customerProp + " not in data model");
- }
-
- /**
- * Log the given message as an error.
- *
- * @param message
- * is the message to log.
- */
- private void logError(String message) {
- getProject().log("E: " + message);
- }
-
- /**
- * Log the given message as an warning.
- *
- * @param message
- * is the message to log.
- */
- private void logWarning(String message) {
- getProject().log("W: " + message);
- }
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- // ignore
- }
-
- /**
- * {@inheritDoc}
- */
- public void run(String text) {
- // ignore
- }
-
- /**
- * {@inheritDoc}
- */
- public void run() {
- // ignore
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/AbstractScriptCheck.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/AbstractScriptCheck.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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.checks;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-
-/**
- * AbstractScriptCheck
is an abstract implementation of
- * {@link Check} and contains some concrete methods related to script.
- *
- */
-public abstract class AbstractScriptCheck extends AbstractCheck {
-
- /**
- * Write a script with the given name and the text.
- *
- * @param name is the name of the script
- * @param text is the script text.
- */
- protected void writeJepFile(String name, String text) {
- if (text.contains("${")) {
- log("${ found in " + name);
- }
- try {
- String heliumpath = new File(getProject().getProperty(
- "helium.build.dir")).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 t : text.split("\n"))
- output.write(" " + t + "\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();
- }
- } catch (IOException e) {
- throw new BuildException("Not able to write JEP File "
- + name + "_jep.py");
- }
- }
-
- /**
- * Check for the properties in the given script text.
- *
- * @param text is the script text to lookup.
- */
- 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));
- }
- for (String group : props)
- checkPropertyInModel(group);
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/Check.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/Check.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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.checks;
-
-import org.dom4j.Element;
-
-import com.nokia.helium.antlint.AntFile;
-import com.nokia.helium.antlint.ant.types.Checker;
-
-/**
- * Check
represents a basic antlint component responsible for
- * running the user configured checks.
- *
- */
-public interface Check {
-
- /**
- * Method runs the configured checks. Usually checks which have to be run
- * only time should be used here.
- */
- void run();
-
- /**
- * Method runs the configured checks against the given node.
- *
- * @param node
- * is the node of the xml to be checked.
- */
- void run(Element node);
-
- /**
- * Method runs the configured checks against the given ant file.
- *
- * @param fileName
- * is the name of the ant file.
- */
- void run(String fileName);
-
- /**
- * Set the {@link Checker} configured for this check.
- *
- * @param checker
- * is the {@link Checker} to set.
- */
- void setChecker(Checker checker);
-
- /**
- * Set the ant file to hold information about the checks conducted on the
- * file.
- *
- * @param antFile
- * is the {@link AntFile} to set.
- */
- void setAntFile(AntFile antFile);
-
- /**
- * Return whether this is check is enabled or not.
- *
- * @return true if a checker is available for this check; otherwise false.
- */
- boolean isEnabled();
-
- /**
- * Log the given message.
- *
- * @param message is the message to be logged.
- */
- void log(String message);
-
- /**
- * Return the {@link Checker} configured for this {@link Check}.
- *
- * @return the {@link Checker}.
- */
- Checker getChecker();
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckAntCall.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckAntCall.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +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.checks;
-
-import java.util.List;
-
-import org.dom4j.Element;
-
-/**
- * CheckAntCall
is used to check whether antcall is used with no param
- * elements and calls the target with no dependencies
- *
- */
-public class CheckAntCall extends AbstractCheck {
-
- /**
- * {@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)) {
- log(" is used with no param elements and calls the target "
- + antcallName
- + " that has no dependencies! ( could be used instead.)");
- }
- }
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckDescription.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckDescription.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +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.checks;
-
-import org.dom4j.Element;
-
-/**
- * CheckDescription
is used to check whether project description is
- * present or not.
- *
- */
-public class CheckDescription extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("project")
- && node.element("description") == null) {
- log("Description not specified!");
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckDuplicateNames.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckDuplicateNames.java Tue Apr 27 08:33:08 2010 +0300
+++ /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:
- *
- */
-package com.nokia.helium.antlint.checks;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-
-/**
- * CheckDuplicateNames
is used to check for duplicate macro names.
- *
- */
-public class CheckDuplicateNames extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- public void run() {
-
- Hashtable> taskdefs = getProject()
- .getTaskDefinitions();
- ArrayList macros = new ArrayList(taskdefs.keySet());
- for (String macroName : macros) {
- if (macros.contains(macroName + "Macro")
- || macros.contains(macroName + "macro"))
- log(macroName + " and " + macroName + "Macro"
- + " found duplicate name");
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckFileName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckFileName.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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.checks;
-
-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.
- *
- */
-public class CheckFileName extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(String arg) {
- if (arg != null) {
- boolean found = false;
- Pattern p1 = Pattern.compile(getPattern());
- Matcher m1 = p1.matcher(new File(arg).getName());
- while (m1.find()) {
- found = true;
- }
- if (!found) {
- log("INVALID File Name: " + arg);
- }
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckIndentation.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckIndentation.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +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.checks;
-
-import java.io.File;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.xml.sax.SAXException;
-import java.io.IOException;
-
-import com.nokia.helium.antlint.AntLintHandler;
-
-/**
- * CheckIndentation
is used to check the indentations in the ant files.
- *
- */
-public class CheckIndentation extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(String antFileName) {
- try {
- SAXParserFactory saxFactory = SAXParserFactory.newInstance();
- saxFactory.setNamespaceAware(true);
- saxFactory.setValidating(true);
- SAXParser parser = saxFactory.newSAXParser();
- AntLintHandler handler = new AntLintHandler(this);
- handler.setIndentationCheck(true);
- parser.parse(new File(antFileName), handler);
- } catch (ParserConfigurationException e) {
- throw new RuntimeException(e);
- } catch (SAXException e) {
- throw new RuntimeException(e);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckJepJythonScript.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckJepJythonScript.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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.checks;
-
-import java.util.List;
-
-import org.dom4j.Element;
-
-/**
- * CheckJepJythonScript
is used to check the coding convention in Jep and
- * Jython scripts
- *
- */
-public class CheckJepJythonScript extends AbstractScriptCheck {
-
- /**
- * {@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("jep") || language.equals("jython")) {
- writeJepFile(scriptdefname, node.getText());
- }
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node is the node to check.
- */
- @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("jep") || language.equals("jython")) {
- writeJepFile("target_" + target, scriptElement.getText());
- }
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPresetDefMacroDefName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPresetDefMacroDefName.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +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.checks;
-
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Element;
-
-/**
- * CheckPresetDefMacroDefName
is used to check the naming
- * convention of presetdef and macrodef
- *
- */
-public class CheckPresetDefMacroDefName extends AbstractCheck {
-
- /**
- * {@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);
- }
-
- List attributeList = node.elements("attribute");
- for (Element attributeElement : attributeList) {
- String attributeName = attributeElement.attributeValue("name");
- checkDefName(attributeName);
- }
- }
- }
-
- /**
- * Check the given text.
- *
- * @param text
- * is the text to check.
- */
- private void checkDefName(String text) {
- Pattern p1 = Pattern.compile(getPattern());
- Matcher m1 = p1.matcher(text);
- if (!m1.matches()) {
- log("INVALID PRESETDEF/MACRODEF Name: " + text);
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckProjectName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckProjectName.java Tue Apr 27 08:33:08 2010 +0300
+++ /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.antlint.checks;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Element;
-
-/**
- * CheckProjectName
is used to check the naming convention of
- * project names.
- *
- */
-public class CheckProjectName extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("project")) {
- String text = node.attributeValue("name");
- if (text != null && !text.isEmpty()) {
- checkProjectName(text);
- } else {
- log("Project name not specified!");
- }
-
- }
- }
-
- /**
- * Check the given the project name.
- *
- * @param text is the text to check.
- */
- private void checkProjectName(String text) {
- Pattern p1 = Pattern.compile(getPattern());
- Matcher m1 = p1.matcher(text);
- if (!m1.matches()) {
- log("INVALID Project Name: " + text);
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPropertiesInDataModel.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPropertiesInDataModel.java Tue Apr 27 08:33:08 2010 +0300
+++ /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.antlint.checks;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Element;
-
-/**
- * CheckPropertiesInDataModel
is used to check whether the properties are
- * defined in data model
- *
- */
-public class CheckPropertiesInDataModel extends AbstractScriptCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkInScripts(node);
- checkInScriptConditions(node);
- checkInPythonTasks(node);
- }
-
- if (node.getName().equals("scriptdef")) {
- String language = node.attributeValue("language");
-
- if (language.equals("jep") || language.equals("jython")) {
- checkJepPropertiesInText(node.getText());
- }
- }
- }
-
- /**
- * Check the properties defined inside script condition.
- *
- * @param node is the node to check.
- */
- @SuppressWarnings("unchecked")
- private void checkInScriptConditions(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("jep") || language.equals("jython")) {
- checkJepPropertiesInText(scriptElement.getText());
- }
- }
- }
-
- /**
- * Check the properties defined inside scripts.
- *
- * @param node is the node to check.
- */
- @SuppressWarnings("unchecked")
- private void checkInScripts(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("jep") || language.equals("jython")) {
- checkJepPropertiesInText(scriptElement.getText());
- }
- }
- }
-
- /**
- * Check the properties defined inside python tasks.
- *
- * @param node is the node to check.
- */
- @SuppressWarnings("unchecked")
- private void checkInPythonTasks(Element node) {
- String target = node.attributeValue("name");
- List pythonList = node.selectNodes("//target[@name='" + target
- + "']/descendant::*[name()=\"hlm:python\"]");
- for (Element pythonElement : pythonList) {
- checkPropertiesInText(pythonElement.getText());
- }
- }
-
- /**
- * Check for the properties in the given text.
- *
- * @param text is the text to lookup.
- */
- private void checkPropertiesInText(String text) {
- Pattern p1 = Pattern.compile("r[\"']\\$\\{([a-zA-Z0-9\\.]*)\\}[\"']");
- Matcher m1 = p1.matcher(text);
- ArrayList props = new ArrayList();
- while (m1.find()) {
- props.add(m1.group(1));
- }
- for (String group : props)
- checkPropertyInModel(group);
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPropertyName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPropertyName.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +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.checks;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Element;
-
-/**
- * CheckPropertyName
is used to check the naming convention of
- * property names.
- *
- */
-public class CheckPropertyName extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("property")) {
- String text = node.attributeValue("name");
- if (text != null && !text.isEmpty()) {
- checkPropertyName(text);
- }
- }
- }
-
- /**
- * Check the given property name.
- *
- * @param propertyName is the property name to check.
- */
- private void checkPropertyName(String propertyName) {
- Pattern p1 = Pattern.compile(getPattern());
- Matcher m1 = p1.matcher(propertyName);
- if (!m1.matches() && !isPropertyAlreadyVisited(propertyName)) {
- log("INVALID Property Name: " + propertyName);
- getAntFile().markPropertyAsVisited(propertyName);
- }
- }
-
- /**
- * 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 getAntFile().isPropertyVisited(propertyName);
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPythonTasks.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckPythonTasks.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +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.checks;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.List;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-import org.dom4j.Element;
-
-/**
- * CheckPythonTasks
is used to the check the coding convention of
- * python tasks.
- *
- */
-public class CheckPythonTasks extends AbstractCheck {
-
- /**
- * {@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) {
- try {
- String heliumpath = new File(getProject().getProperty(
- "helium.build.dir")).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 t : text.split("\n"))
- output.write(" " + t + "\n");
- }
- output.close();
- } catch (IOException e) {
- e.printStackTrace();
- throw new BuildException("IOException:Not able to write python file " + name
- + ".py");
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckRunTarget.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckRunTarget.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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.checks;
-
-import java.util.List;
-
-import org.dom4j.Element;
-
-/**
- * CheckRunTarget
is used to check whether runtarget calls a target
- * that has dependencies.
- *
- */
-public class CheckRunTarget extends AbstractCheck {
-
- /**
- * {@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)) {
- log(" calls the target " + runTargetName
- + " that has dependencies!");
- }
- }
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptCondition.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptCondition.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +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.checks;
-
-import java.util.List;
-
-import org.dom4j.Element;
-
-/**
- * CheckScriptCondition
is used to check the coding convention in
- * script condition
- *
- */
-public class CheckScriptCondition extends AbstractScriptCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkScriptConditions(node);
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
- */
- @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("jep") || language.equals("jython")) {
- writeJepFile("scriptcondition_" + target, scriptElement
- .getText());
- }
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptDef.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptDef.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +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.checks;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-import org.dom4j.Element;
-import org.dom4j.Node;
-
-/**
- * CheckScriptDef
is used to check the coding convention in
- * scriptdef.
- *
- */
-public class CheckScriptDef extends AbstractScriptCheck {
-
- /**
- * {@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"))) {
- // for (String x : props)
- // log(x);
- log("Scriptdef " + name + " does not use "
- + statement.valueOf("@name"));
- }
- }
- }
- }
-
- /**
- * 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) {
- scriptdefname = "Beanshell" + scriptdefname;
- try {
- String heliumpath = new File(getProject().getProperty(
- "helium.build.dir")).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("} }");
- output.close();
- } catch (IOException e) {
- throw new BuildException("Not able to write Beanshell File "
- + scriptdefname + ".java");
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptDefNameAttributes.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptDefNameAttributes.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +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.checks;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Element;
-import org.dom4j.Node;
-
-/**
- * CheckScriptDefNameAttributes
is used to check the naming
- * convention of scriptdef name attributes
- *
- */
-public class CheckScriptDefNameAttributes extends AbstractCheck {
-
- /**
- * {@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 x : props) {
- if (!attributes.contains(x)) {
- log("Scriptdef " + name + " does not have attribute " + x);
- }
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptDefStyle.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptDefStyle.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +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.checks;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Element;
-import org.dom4j.Node;
-
-/**
- * CheckScriptDefStyle
is used to check the coding style of
- * scriptdef.
- *
- */
-public class CheckScriptDefStyle extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("scriptdef")) {
- String scriptdefname = node.attributeValue("name");
- checkScriptDefStyle(scriptdefname, node);
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
- */
- @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));
- }
-
- ArrayList attributes = new ArrayList();
- for (Node statement : statements) {
- attributes.add(statement.valueOf("@name"));
- }
-
- if (!statements.isEmpty() && props.isEmpty()) {
- log("Scriptdef " + name
- + " doesn't reference attributes directly, poor style");
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptSize.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckScriptSize.java Tue Apr 27 08:33:08 2010 +0300
+++ /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:
- *
- */
-package com.nokia.helium.antlint.checks;
-
-import java.util.List;
-
-import org.dom4j.Element;
-import org.dom4j.Node;
-
-/**
- * CheckScriptSize
is used to check the size of script. By default,
- * the script should not contain more than 1000 characters.
- *
- */
-public class CheckScriptSize extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("target")) {
- checkSizeOfScript(node);
- }
- }
-
- /**
- * Check against the given node.
- *
- * @param node is the node to check.
- */
- @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) {
- log("Target " + target + " has a script with " + size
- + " characters, code should be inside a python file");
- }
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckTabCharacter.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckTabCharacter.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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.checks;
-
-import java.io.File;
-import java.util.List;
-import java.io.IOException;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import org.xml.sax.SAXException;
-import org.dom4j.Element;
-import org.dom4j.Node;
-
-import com.nokia.helium.antlint.AntLintHandler;
-
-/**
- * CheckTabCharacter
is used to check the tab characters inside the
- * ant files.
- *
- */
-public class CheckTabCharacter extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- checkTabsInScript(node);
- }
-
- /**
- * Check against the given node.
- *
- * @param node
- * is the node to check.
- */
- @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")) {
- log("Target " + target + " has a script with tabs");
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public void run(String antFileName) {
- try {
- SAXParserFactory saxFactory = SAXParserFactory.newInstance();
- saxFactory.setNamespaceAware(true);
- saxFactory.setValidating(true);
- SAXParser parser = saxFactory.newSAXParser();
- AntLintHandler handler = new AntLintHandler(this);
- handler.setTabCharacterCheck(true);
- parser.parse(new File(antFileName), handler);
- } catch (ParserConfigurationException e) {
- throw new RuntimeException(e);
- } catch (SAXException e) {
- throw new RuntimeException(e);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckTargetName.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckTargetName.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +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.checks;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.dom4j.Element;
-
-/**
- * CheckTargetName
is used to check the naming convention of the
- * target names.
- *
- */
-public class CheckTargetName extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("target")) {
- String target = node.attributeValue("name");
- checkTargetName(target);
- }
- }
-
- /**
- * 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(getPattern());
- Matcher m1 = p1.matcher(targetName);
- if (!m1.matches()) {
- log("INVALID Target Name: " + targetName);
- }
- } else {
- log("Target name not specified!");
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckUseOfEqualsTask.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckUseOfEqualsTask.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +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.checks;
-
-import org.dom4j.Element;
-
-/**
- * CheckUseOfEqualsTask
is used to check the usage of equals task
- * as against istrue task.
- *
- */
-public class CheckUseOfEqualsTask extends AbstractCheck {
-
- /**
- * {@inheritDoc}
- */
- public void run(Element node) {
- if (node.getName().equals("equals")) {
- String text = node.attributeValue("arg2");
- if (text.equals("true") || text.equals("yes")) {
- log(node.attributeValue("arg1")
- + " uses 'equals' should use 'istrue' task");
- }
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckUseOfIfInTargets.java
--- a/buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/checks/CheckUseOfIfInTargets.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +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.checks;
-
-import java.util.List;
-
-import org.dom4j.Element;
-import org.dom4j.Node;
-
-/**
- * CheckUseOfIfInTargets
is used to check the usage of if task as
- * against the condition task or <target if|unless="property.name"> inside
- * targets.
- *
- */
-public class CheckUseOfIfInTargets extends AbstractCheck {
-
- /**
- * {@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";
-
- 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) {
- log("Target "
- + target
- + " poor use of if-else-property statement, use condition task");
- } else if (statement.selectNodes("./else").size() == 0) {
- log("Target "
- + target
- + " poor use of if-then-property statement, use condition task");
- }
- }
- }
- List statements = node.selectNodes("//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) {
- log("Target "
- + target
- + " poor use of if statement, use
+
+
- -------------------------------------------------------------------------------
-
+
+
-
- -------------------------------------------------------------------------------
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- ([a-z0-9[\\d\\_\\.\\@\\{\\}\\$]]*)
- ([a-z0-9[\\d\\-]]*)
-
- ([a-z0-9][a-zA-Z0-9]*)
- ([a-z0-9[\\d\\.\\_\\-]]*)
-
- ^build.xml$|ant.xml$|antlib.xml$
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${report.xml}
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/tests/data/build.xml
--- a/buildframework/helium/sf/java/antlint/tests/data/build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antlint/tests/data/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -22,4 +22,8 @@
-->
+
+ Test target
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/tests/data/invalid.build.xml
--- a/buildframework/helium/sf/java/antlint/tests/data/invalid.build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antlint/tests/data/invalid.build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -21,5 +21,8 @@
============================================================================
-->
+
+ Testing for invalid file name
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/tests/data/sample.ant.xml
--- a/buildframework/helium/sf/java/antlint/tests/data/sample.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antlint/tests/data/sample.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -26,7 +26,15 @@
-
+
+
+
+
+ pow
+
+
+
+
@@ -35,6 +43,13 @@
check PresetDef Name
+
+
+
+ @{parameter}
+
+
+
Hello Checking Tab Character
@@ -231,4 +246,6 @@
checking indentation
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/antlint/tests/data/sample.antlib.xml
--- a/buildframework/helium/sf/java/antlint/tests/data/sample.antlib.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antlint/tests/data/sample.antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -31,11 +31,7 @@
-
-
- pow
-
-
+
result = None
@@ -47,6 +43,12 @@
target = str(attributes.get('attr0'))
+
+
+
+
+
+target = str(attributes.get('attr0'))
@@ -67,4 +69,8 @@
target = str(attributes.get('target'))
+
+
+target = str(attributes.get('target'))
+
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/antunit/src/com/nokia/helium/antunit/ant/types/CustomListener.java Wed Jun 16 16:51:40 2010 +0300
@@ -110,9 +110,9 @@
@Override
public void startTest(String name) {
listeners.clear();
- for (Listener l : listenerDefinitions) {
- BuildListener bl = l.instantiate();
- l.setProject(currentProject);
+ for (Listener listener : listenerDefinitions) {
+ BuildListener bl = listener.instantiate();
+ listener.setProject(currentProject);
if (bl != null) {
listeners.add(bl);
bl.buildStarted(new BuildEvent(currentProject));
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,30 @@
+
+
+
+ Helium Antlib Legacy build file.
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/ivy.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/ivy.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/antlib.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/AddTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/AddTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,68 @@
+/*
+* 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.ccmtask.ant.commands;
+
+import java.util.Vector;
+
+import com.nokia.helium.ccmtask.ant.types.Task;
+
+/**
+ * This object creates new ccm task and contains all the Tasks in a list.
+ *
+ */
+public class AddTask extends CcmCommand
+{
+ private String folder;
+ private Vector tasks = new Vector();
+
+ /**
+ * Get the dest folder.
+ * @return the dest folder, or null if not defined.
+ */
+ public String getFolder()
+ {
+ return folder;
+ }
+
+ /**
+ * Define the folder to add the task in.
+ * @param folder
+ */
+ public void setFolder(String folder)
+ {
+ this.folder = folder;
+ }
+
+ /**
+ * Add a nested task element.
+ * @return a Task element
+ */
+ public Task createTask() {
+ Task task = new Task();
+ tasks.add(task);
+ return task;
+ }
+
+ /**
+ * Get all nested tasks
+ * @return an array of nested tasks
+ */
+ public Task[] getTasks() {
+ return tasks.toArray(new Task[tasks.size()]);
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/CcmCommand.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/CcmCommand.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+import com.nokia.helium.ccmtask.ant.taskdefs.CcmTask;
+
+/**
+ * Creates command string based on runtime class name.
+ *
+ */
+public class CcmCommand
+{
+ private CcmTask task;
+
+ /**
+ * @return the task
+ */
+ public CcmTask getTask()
+ {
+ return task;
+ }
+
+ /**
+ * @param task
+ * the task to set
+ */
+ public void setTask(CcmTask task)
+ {
+ this.task = task;
+ }
+
+
+ public String getName()
+ {
+ String className = getClass().getName();
+ String commandName = className.substring(className.lastIndexOf('.') + 1).toLowerCase();
+ return commandName;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/ChangeReleaseTag.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/ChangeReleaseTag.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* 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.ccmtask.ant.commands;
+
+/**
+ * This object contains the current release tag.
+ *
+ */
+public class ChangeReleaseTag extends CcmCommand
+{
+ private String folder;
+ private String newreleasetag;
+
+ /**
+ * Get the folder to scan.
+ * @return the folder, or null if not defined.
+ */
+ public String getFolder()
+ {
+ return folder;
+ }
+
+ /**
+ * Set the folder to update the task.
+ * @param folder
+ */
+ public void setFolder(String folder)
+ {
+ this.folder = folder;
+ }
+
+ /**
+ * Get the release to re-tag the tasks with.
+ * @param newreleasetag
+ */
+ public String getReleaseTag()
+ {
+ return newreleasetag;
+ }
+
+ /**
+ * Set the release to re-tag the tasks with.
+ * @param newreleasetag
+ */
+ public void setReleasetag(String newreleasetag)
+ {
+ this.newreleasetag = newreleasetag;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Checkout.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Checkout.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,158 @@
+/*
+* 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.ccmtask.ant.commands;
+
+/**
+ * This object is used to check out a ccm project.
+ *
+ */
+public class Checkout extends CcmCommand
+{
+ private String project;
+ private String release;
+ private String version;
+ private String purpose;
+ private String wa;
+ private boolean recursive;
+ private boolean relative;
+
+ /**
+ * Get the project to checkout.
+ * @return
+ */
+ public String getProject()
+ {
+ return project;
+ }
+
+ /**
+ * Set the project to checkout.
+ * @return the project four part name
+ */
+ public void setProject(String project)
+ {
+ this.project = project;
+ }
+
+ /**
+ * Get the release to use for the checkout.
+ * @return
+ */
+ public String getRelease()
+ {
+ return release;
+ }
+
+ /**
+ * Set the release to use for the checkout.
+ * @return the release
+ */
+ public void setRelease(String release)
+ {
+ this.release = release;
+ }
+
+ /**
+ * Get the version to set while checking out.
+ * @return
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * Set the version
+ * @param version
+ */
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+
+ /**
+ * Get the purpose of the checkout
+ */
+ public String getPurpose()
+ {
+ return purpose;
+ }
+
+ /**
+ * Set the purpose of the checkout
+ * @param purpose
+ */
+ public void setPurpose(String purpose)
+ {
+ this.purpose = purpose;
+ }
+
+ /**
+ * Get the workarea location
+ * @return
+ */
+ public String getWa()
+ {
+ return wa;
+ }
+
+ /**
+ * Set the workarea location
+ * @param wa
+ */
+ public void setWa(String wa)
+ {
+ this.wa = wa;
+ }
+
+ /**
+ * Shall it be a recursive checkout
+ * @return
+ */
+ public boolean getRecursive()
+ {
+ return recursive;
+ }
+
+ /**
+ * Set if the checkout should be a recursive.
+ * @param recursive
+ */
+ public void setRecursive(boolean recursive)
+ {
+ this.recursive = recursive;
+ }
+
+ /**
+ * Shall subprojects workarea be maintained relatively to the parent.
+ * @return
+ */
+ public boolean getRelative()
+ {
+ return relative;
+ }
+
+ /**
+ * Set if the subprojects workarea be maintained relatively to the parent.
+ * @param relative
+ */
+ public void setRelative(boolean relative)
+ {
+ this.relative = relative;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Close.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Close.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* 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.ccmtask.ant.commands;
+/**
+ * To close the ccm session
+ *
+ */
+public class Close extends CcmCommand
+{
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/CreateReleaseTag.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/CreateReleaseTag.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+/**
+ * This object stores the new releast tag creation information.
+ *
+ */
+public class CreateReleaseTag extends CcmCommand
+{
+ private String newtag;
+
+ private String release;
+
+ private String project;
+
+ public String getProject()
+ {
+ return project;
+ }
+
+ /*
+ * Helper function to set the project information for creating the new release.
+ * @param prj - project info to be set for creating a new release tag.
+ */
+ public void setProject(String prj) {
+ project = prj;
+ }
+
+ /*
+ * Helper function to get the release information for creating the new release tag.
+ * @return - release info to be used to create the new release tag.
+ */
+ public String getRelease()
+ {
+ return release;
+ }
+
+ /*
+ * Helper function to set the release information for creating the new release tag.
+ * @param rel - release info to be used to create the new release tag.
+ */
+ public void setRelease(String rel)
+ {
+ release = rel;
+ }
+
+ /**
+ * Get the release tag to be created.
+ * @return newreleasetag to create it.
+ */
+ public String getNewTag()
+ {
+ return newtag;
+ }
+
+ /**
+ * Set the new release tag to be used.
+ * @param newtag
+ */
+ public void setNewTag(String tag)
+ {
+ newtag = tag;
+ }
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/DeleteReleaseTag.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/DeleteReleaseTag.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+/**
+ * This object contains info requred to delete the release tag.
+ *
+ */
+public class DeleteReleaseTag extends CcmCommand
+{
+
+ private String newtag;
+
+ private String release;
+
+ private String purpose;
+
+ private String project;
+
+ /*
+ * Helper function to get the project information for delete the new release tag.
+ * @return the project used for creating new release tag.
+ */
+ public String getProject()
+ {
+ return project;
+ }
+
+ /*
+ * Helper function to set the project information for delete the new release tag.
+ * @param prj - project info to be set for deleting a new release tag.
+ */
+ public void setProject(String prj) {
+ project = prj;
+ }
+
+ /*
+ * Helper function to get the release information for delete the new release tag.
+ * @param prj - project info to be set for deleting a new release tag.
+ */
+ public String getRelease()
+ {
+ return release;
+ }
+
+ /*
+ * Helper function to set the release information for delete the new release tag.
+ * @param rel - project info to be set for deleting a new release tag.
+ */
+ public void setRelease(String rel)
+ {
+ release = rel;
+ }
+
+ /**
+ * Get the new release tag info.
+ * @return newtag
+ */
+ public String getNewTag()
+ {
+ return newtag;
+ }
+
+ /**
+ * Set the new release tag info.
+ * @param tag - newtag information to be used to create the new release tag.
+ */
+ public void setNewTag(String tag)
+ {
+ newtag = tag;
+ }
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Reconcile.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Reconcile.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+/**
+ * This object is used to reconcile a ccm project.
+ *
+ */
+public class Reconcile extends CcmCommand
+{
+ private String project;
+
+ /**
+ * Get the project to reconcile.
+ * @return
+ */
+ public String getProject()
+ {
+ return project;
+ }
+
+ /**
+ * Set the project to reconcile.
+ * @param project
+ */
+ public void setProject(String project)
+ {
+ this.project = project;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Role.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Role.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+/**
+ * This object is used to switch synergy role.
+ *
+ */
+public class Role extends CcmCommand {
+ private String role;
+
+ /**
+ * Set the role to switch to.
+ * @param role
+ */
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ /**
+ * Get the role to switch to.
+ * @return
+ */
+ public String getRole() {
+ return role;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Snapshot.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Snapshot.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+/**
+ * This object is used to snap shot a ccm project.
+ *
+ */
+public class Snapshot extends CcmCommand
+{
+ private String project;
+ private String dir;
+ private boolean recursive;
+ private boolean fast;
+
+ /**
+ * Get the project to snapshot.
+ * @return
+ */
+ public String getProject()
+ {
+ return project;
+ }
+
+ /**
+ * Set the project to snapshot.
+ * @param project
+ */
+ public void setProject(String project)
+ {
+ this.project = project;
+ }
+
+ /**
+ * Get the location where to snapshot
+ * @return
+ */
+ public String getDir()
+ {
+ return dir;
+ }
+
+ /**
+ * Set the location where to snapshot
+ * @param dir
+ */
+ public void setDir(String dir)
+ {
+ this.dir = dir;
+ }
+
+ /**
+ * Shall sub-projects be snapshotted?
+ * @return
+ */
+ public boolean getRecursive()
+ {
+ return recursive;
+ }
+
+ /**
+ * Set if sub-projects should be snapshotted.
+ * @return
+ */
+ public void setRecursive(boolean recursive)
+ {
+ this.recursive = recursive;
+ }
+
+ /**
+ * Shall multi-threaded snapshot be used.?
+ * @return
+ */
+ public boolean getFast()
+ {
+ return fast;
+ }
+
+ /**
+ * Set if multi-threaded snapshot should be used.
+ * @param fast
+ */
+ public void setFast(boolean fast)
+ {
+ this.fast = fast;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Synchronize.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Synchronize.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+/**
+ * This object is used to Synchronize a ccm project.
+ *
+ */
+public class Synchronize extends CcmCommand
+{
+ private String project;
+ private boolean recursive = true;
+
+
+ /**
+ * Get the project to checkout.
+ * @return
+ */
+ public String getProject()
+ {
+ return project;
+ }
+
+ /**
+ * Set the project to checkout.
+ * @return the project four part name
+ */
+ public void setProject(String project)
+ {
+ this.project = project;
+ }
+
+ /**
+ * Shall subprojects workarea be maintained relatively to the parent.
+ * @return
+ */
+ public boolean getRecursive()
+ {
+ return recursive;
+ }
+
+ /**
+ * Set if the checkout should be a recursive.
+ * @param recursive
+ */
+ public void setRecursive(boolean recursive)
+ {
+ this.recursive = recursive;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Update.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Update.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+
+/**
+ * This object is used to update a ccm project.
+ *
+ */
+public class Update extends CcmCommand
+{
+ private String project;
+
+ /**
+ * Get the project to update
+ * @return
+ */
+ public String getProject()
+ {
+ return project;
+ }
+
+ /**
+ * De
+ * @param project
+ */
+ public void setProject(String project)
+ {
+ this.project = project;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Workarea.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/commands/Workarea.java Wed Jun 16 16:51:40 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.ccmtask.ant.commands;
+/**
+ * Creates interface to get\set workarea informations for a given project.
+ *
+ */
+public class Workarea extends CcmCommand
+{
+ private String project;
+ private String path;
+ private String pst;
+ private boolean maintain;
+ private boolean recursive;
+ private boolean relative;
+ private boolean wat;
+
+ public String getProject()
+ {
+ return project;
+ }
+
+ public void setProject(String project)
+ {
+ this.project = project;
+ }
+
+ public boolean getMaintain()
+ {
+ return maintain;
+ }
+
+ public void setMaintain(boolean maintain)
+ {
+ this.maintain = maintain;
+ }
+
+ public boolean getRecursive()
+ {
+ return recursive;
+ }
+
+ public void setRecursive(boolean recursive)
+ {
+ this.recursive = recursive;
+ }
+
+ public boolean getRelative()
+ {
+ return relative;
+ }
+
+ public void setRelative(boolean relative)
+ {
+ this.relative = relative;
+ }
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ public void setPath(String path)
+ {
+ this.path = path;
+ }
+
+ public String getPst()
+ {
+ return pst;
+ }
+
+ public void setPst(String pst)
+ {
+ this.pst = pst;
+ }
+
+ public boolean getWat()
+ {
+ return wat;
+ }
+
+ public void setWat(boolean wat)
+ {
+ this.wat = wat;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/taskdefs/CcmTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/taskdefs/CcmTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,238 @@
+/*
+* 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.ccmtask.ant.taskdefs;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+
+import org.python.util.PythonInterpreter;
+
+import com.nokia.helium.ccmtask.ant.commands.AddTask;
+import com.nokia.helium.ccmtask.ant.commands.CcmCommand;
+import com.nokia.helium.ccmtask.ant.commands.ChangeReleaseTag;
+import com.nokia.helium.ccmtask.ant.commands.Checkout;
+import com.nokia.helium.ccmtask.ant.commands.Close;
+import com.nokia.helium.ccmtask.ant.commands.Reconcile;
+import com.nokia.helium.ccmtask.ant.commands.Role;
+import com.nokia.helium.ccmtask.ant.commands.Snapshot;
+import com.nokia.helium.ccmtask.ant.commands.Synchronize;
+import com.nokia.helium.ccmtask.ant.commands.Update;
+import com.nokia.helium.ccmtask.ant.commands.Workarea;
+import com.nokia.helium.ccmtask.ant.types.SessionSet;
+import com.nokia.helium.ccmtask.ant.commands.CreateReleaseTag;
+import com.nokia.helium.ccmtask.ant.commands.DeleteReleaseTag;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+
+/**
+ * Synergy task.
+ *
+ * <hlm:createSessionMacro database="to1tobet" reference="test.session" />
+ * <hlm:ccm verbose="false">
+ * <hlm:sessionset refid="test.session" />
+ * <hlm:addtask folder="tr1test1#2079">
+ * <task name="tr1test1#5310" />
+ * </hlm:addtask>
+ * <hlm:snapshot project="helium-to1tobet#helium_3.0:project:vc1s60p1#1" dir="c:\test" fast="true" recursive="true" />
+ * <hlm:synchronize project="helium-to1tobet#helium_3.0:project:vc1s60p1#1" recursive="true" />
+ * <hlm:close />
+ * </hlm:ccm>
+ *
+ * @ant.task category="SCM"
+ */
+public class CcmTask extends Task
+{
+ private String username;
+
+ private String password;
+
+ private List commands = new ArrayList();
+ private Vector sessionSets = new Vector();
+ private boolean verbose;
+
+ public void setVerbose(boolean value) {
+ verbose = value;
+ }
+
+ public boolean getVerbose() {
+ return verbose;
+ }
+
+ public String getUsername()
+ {
+ return username;
+ }
+
+ public final void setUsername(final String username)
+ {
+ this.username = username;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public final void setPassword(final String password)
+ {
+ this.password = password;
+ }
+
+ public CcmCommand[] getCommands()
+ {
+ return commands.toArray(new CcmCommand[commands.size()]);
+ }
+
+ public void addUpdate(Update a)
+ {
+ addCommand(a);
+ }
+
+ public void addSynchronize(Synchronize a)
+ {
+ addCommand(a);
+ }
+
+ public void addReconcile(Reconcile a)
+ {
+ addCommand(a);
+ }
+
+ public void addSnapshot(Snapshot a)
+ {
+ addCommand(a);
+ }
+
+ public void addChangeReleaseTag(ChangeReleaseTag a)
+ {
+ addCommand(a);
+ }
+
+ public void addCreateReleaseTag(CreateReleaseTag a)
+ {
+ addCommand(a);
+ }
+
+ public void addDeleteReleaseTag(DeleteReleaseTag a)
+ {
+ addCommand(a);
+ }
+
+ public void addCheckout(Checkout a)
+ {
+ addCommand(a);
+ }
+
+ public void addWorkarea(Workarea a)
+ {
+ addCommand(a);
+ }
+
+ public void addRole(Role a)
+ {
+ addCommand(a);
+ }
+
+ private void addCommand(CcmCommand cmd)
+ {
+ cmd.setTask(this);
+ commands.add(cmd);
+ }
+
+ public AddTask createAddTask()
+ {
+ AddTask cmd = new AddTask();
+ addCommand(cmd);
+ return cmd;
+ }
+
+ public Role createRole()
+ {
+ Role cmd = new Role();
+ addCommand(cmd);
+ return cmd;
+ }
+
+ public Close createClose()
+ {
+ Close cmd = new Close();
+ addCommand(cmd);
+ return cmd;
+ }
+
+ public SessionSet createSessionSet()
+ {
+ SessionSet sessionSet = new SessionSet();
+ sessionSets.add(sessionSet);
+ return sessionSet;
+ }
+
+ public SessionSet[] getSessionSets() {
+ SessionSet[] result = new SessionSet[sessionSets.size()];
+ sessionSets.copyInto(result);
+ return result;
+ }
+
+ public final void execute()
+ {
+ File jar = getJarFile();
+ if (jar == null) {
+ throw new BuildException("Could not find the jar file for class " + this.getClass().getCanonicalName());
+ }
+ try {
+ JarFile jarFile = new JarFile(jar);
+ String entryName = this.getClass().getPackage().getName().replace('.', '/') + "/ccmtask.py";
+ ZipEntry entry = jarFile.getEntry(entryName);
+ if (entry == null) {
+ throw new BuildException("CcmTask internal error: Could not find the following entry: " + entryName);
+ }
+ PythonInterpreter pi = new PythonInterpreter();
+ pi.set("java_ccmtask", this);
+ pi.set("project", getProject());
+ pi.execfile(jarFile.getInputStream(entry), "ccmtask.py");
+ } catch (IOException e) {
+ throw new BuildException(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Returns the jar file name containing this class
+ * @return a File object or null if not found.
+ * @throws IMakerException
+ */
+ protected File getJarFile() {
+ URL url = this.getClass().getClassLoader().getResource(this.getClass().getName().replace('.', '/') + ".class");
+ if (url.getProtocol().equals("jar") && url.getPath().contains("!/")) {
+ String fileUrl = url.getPath().split("!/")[0];
+ try {
+ return new File(new URL(fileUrl).getPath());
+ } catch (MalformedURLException e) {
+ throw new BuildException("Error determining the jar file where "
+ + this.getClass().getName() + " is located.", e);
+ }
+ }
+ return null;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/taskdefs/ccmtask.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/taskdefs/ccmtask.py Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,260 @@
+#============================================================================
+#Name : ccmtask.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 to process Ant task commands. """
+
+import ccm
+import ccm.extra
+import sys
+import logging
+import ant
+import string
+
+logging.basicConfig(level=logging.INFO)
+antlogger = ant.AntHandler(java_ccmtask)
+rlogger = logging.getLogger('')
+# replacing default handler by Ant one.
+if len(rlogger.handlers) > 0:
+ rlogger.removeHandler(rlogger.handlers[0])
+rlogger.addHandler(antlogger)
+logging.getLogger("ccm").setLevel(logging.INFO)
+logger = logging.getLogger("ccm.ant")
+session = None
+
+def execute_update(command):
+ java_ccmtask.log(str('Updating project: ' + command.getProject()))
+ project = session.create(command.getProject())
+ project.update()
+
+def execute_role(command):
+ if not command.getRole():
+ raise Exception("The 'role' attribute has not been defined.")
+ java_ccmtask.log(str('Updating role: ' + command.getRole()))
+ session.role = command.getRole()
+
+def execute_synchronize(command):
+ if not command.getProject():
+ raise Exception("The 'project' attribute has not been defined.")
+ java_ccmtask.log(str('Synchronizing project: ' + command.getProject()))
+ java_ccmtask.log(str("Recursive: %s" % command.getRecursive()))
+ project = session.create(command.getProject())
+ project.sync(command.getRecursive())
+
+def execute_reconcile(command):
+ if not command.getProject():
+ raise Exception("The 'project' attribute has not been defined.")
+ java_ccmtask.log(str('Reconciling project: ' + command.getProject()))
+ project = session.create(command.getProject())
+ project.reconcile()
+
+def execute_snapshot(command):
+ if not command.getProject():
+ raise Exception("The 'project' attribute has not been defined.")
+ if not command.getDir():
+ raise Exception("The 'dir' attribute has not been defined.")
+ java_ccmtask.log(str('Snapshot of project: ' + command.getProject() + ' to ' + command.getDir()))
+ project = session.create(command.getProject())
+ if command.getFast()== True:
+ ccm.extra.FastSnapshot(project, command.getDir())
+ else:
+ project.snapshot(command.getDir(), command.getRecursive())
+
+def execute_changereleasetag(command):
+ if not command.getFolder():
+ raise Exception("The 'folder' attribute has not been defined.")
+ if not command.getReleaseTag():
+ raise Exception("The 'releaseTag' attribute has not been defined.")
+ java_ccmtask.log(str('Changing release tag for all tasks in the folder : ' + command.getFolder() + ' as ' + command.getReleaseTag()))
+ #Search all task from the folder
+ folder = session.create("Folder " + str(command.getFolder()))
+ for task in folder.tasks:
+ if task.release != str(command.getReleaseTag()):
+ task.release = str(command.getReleaseTag())
+
+def execute_checkout(command):
+ if not command.getProject():
+ raise Exception("The 'project' attribute has not been defined.")
+ java_ccmtask.log(str('Checking out project: ' + command.getProject() + ' with release tag ' + command.getRelease()))
+ project = session.create(command.getProject())
+ if (command.getRelease()):
+ if command.getWa():
+ wa = command.getWa()
+ else:
+ wa = None
+ if command.getRecursive():
+ recursive = command.getRecursive()
+ else:
+ recursive = None
+ if command.getRelative():
+ relative = command.getRelative()
+ else:
+ relative = None
+ if command.getVersion():
+ version = command.getVersion()
+ else:
+ version = None
+ if command.getPurpose():
+ purpose = command.getPurpose()
+ else:
+ purpose = None
+ project.checkout(session.create(command.getRelease()), version, purpose, recursive)
+
+def execute_createreleasetag(command):
+ java_ccmtask.log(str('creating a release tag'))
+ if not command.getProject():
+ raise Exception("The 'project' attribute has not been defined.")
+ project = session.create(command.getProject())
+ if (command.getNewTag()):
+ new_release_tag = command.getNewTag();
+ project.create_release_tag(command.getRelease(), new_release_tag)
+
+def execute_deletereleasetag(command):
+ java_ccmtask.log(str('deleting a release tag'))
+ if not command.getProject():
+ raise Exception("The 'project' attribute has not been defined.")
+ project = session.create(command.getProject())
+ if (command.getNewTag()):
+ new_release_tag = command.getNewTag();
+ project.delete_release_tag(command.getRelease(), new_release_tag)
+
+def execute_workarea(command):
+ if not command.getProject():
+ raise Exception("The 'project' attribute has not been defined.")
+ java_ccmtask.log(str('Modifying work area for the project : ' + command.getProject()))
+ project = session.create(command.getProject())
+ if command.getMaintain():
+ maintain = command.getMaintain()
+ else:
+ maintain = None
+ if command.getRecursive():
+ recursive = command.getRecursive()
+ else:
+ recursive = None
+ if command.getRelative():
+ relative = command.getRelative()
+ else:
+ relative = None
+ if command.getPath():
+ path = command.getPath()
+ else:
+ path = None
+ if command.getPst():
+ pst = command.getPst()
+ else:
+ pst = None
+ if command.getWat():
+ wat = command.getWat()
+ else:
+ wat = None
+ project.work_area(maintain, recursive, relative, path, pst, wat)
+
+def execute_addtask(command):
+ if command.getFolder() != None:
+ tasks = []
+ ccmfolder = session.create("Folder " + command.getFolder())
+ role = find_folder_information(command)
+ if role == "build_mgr":
+ java_ccmtask.log("Changing role to %s" % role)
+ session.role = "build_mgr"
+
+ folder = session.create("Folder %s" % str(command.getFolder()))
+ for task in folder.tasks:
+ folder.remove(task)
+
+ java_ccmtask.log("Adding task to folder %s" % ccmfolder)
+ tasks.extend(map(lambda task: session.create("Task " + task.getName()), command.getTasks()))
+ for task in tasks:
+ ccmfolder.append(task)
+
+def find_folder_information(command):
+ cmdline = "folder -sh i " + command.getFolder()
+ result = session.execute(cmdline)
+ result_array = str(result).split('\r')
+ for ldata in result_array :
+ if ldata.find('Writable By:') > 0:
+ wb,wd = ldata.split(':',1)
+ if wd.lstrip() == "Build Manager":
+ return "build_mgr"
+ else:
+ return "developer"
+
+def execute_exists(command):
+ fpn = None
+ if command.getObject() != None:
+ fpn = command.getObject()
+ elif command.getFolder() != None:
+ fpn = "Folder " + command.getFolder()
+ elif command.getTask() != None:
+ fpn = "Task " + command.getTask()
+
+ if fpn == None:
+ raise Exception("You need to define either a 'task'/'folder'/'object' attribute.")
+ ccmo = session.create(fpn)
+ if ccmo.exists():
+ java_ccmtask.log("'%s' exists." % ccmo)
+ else:
+ raise Exception("Could not find '%s'." % ccmo)
+
+def execute_close(command):
+ global session
+ java_ccmtask.log(str("Closing session %s." % session))
+ session.close_on_exit = True
+ session.close()
+ session = None
+
+def referenceToObject(obj):
+ if obj.isReference() == 1:
+ ref = project.getReference(str(obj.getRefid().getRefId()))
+ if ref == None:
+ raise Exception("Could not find reference '%s'" % str(obj.getRefid().getRefId()))
+ return ref
+ else:
+ return obj
+
+sessionIds = []
+for session_set in java_ccmtask.getSessionSets():
+ sessionIds.extend(map(lambda session: session.getAddr(), referenceToObject(session_set).getSessions()))
+
+print "Session list: ", sessionIds
+if len(sessionIds) > 0:
+ sessionid = sessionIds.pop()
+ session = ccm.Session(username=None, engine=None, dbpath=None, ccm_addr=sessionid, close_on_exit=False)
+else:
+ username = java_ccmtask.getUsername()
+ password = java_ccmtask.getPassword()
+ session = ccm.open_session(username=username, password=password)
+
+if java_ccmtask.getVerbose() == 1:
+ logging.getLogger("ccm").setLevel(logging.DEBUG)
+
+#print dir(sys.modules['__main__'] )
+ccm_commands = java_ccmtask.getCommands()
+for command in ccm_commands:
+ print "Running command '%s'" % command.getName()
+ method_name = 'execute_' + command.getName()
+ method = sys.modules['__main__'].__dict__[method_name]
+ try:
+ method(command)
+ except Exception, e:
+ if java_ccmtask.getVerbose() == 1:
+ import traceback
+ logger.error(traceback.print_exc(file=sys.stdout))
+ if 'result' in e:
+ logger.error(e.result)
+ logger.error(e)
+ raise e
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/Session.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/Session.java Wed Jun 16 16:51:40 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:
+*
+*/
+
+package com.nokia.helium.ccmtask.ant.types;
+
+import org.apache.tools.ant.types.DataType;
+
+/**
+ * This class abstract a synergy session.
+ * It store the address to an already existing session.
+ * @ant.type name="session" category="SCM"
+ */
+public class Session extends DataType {
+ // store the ccm_addr value
+ private String addr;
+
+ /**
+ * Sets the synergy address.
+ * @param addr string representing the ccm_addr
+ */
+ public void setAddr(String addr) {
+ this.addr = addr;
+ }
+
+ /**
+ * Get the synergy address.
+ * @return string representing the ccm_addr
+ */
+ public String getAddr() {
+ return this.addr;
+ }
+}
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/SessionSet.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/SessionSet.java Wed Jun 16 16:51:40 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.ccmtask.ant.types;
+
+import org.apache.tools.ant.types.DataType;
+import java.util.Vector;
+
+/**
+ * This class implement an Ant Datatype that represents a set of
+ * synergy sessions.
+ * @ant.type name="sessionset" category="SCM"
+ */
+public class SessionSet extends DataType {
+ private Vector sessions = new Vector();
+
+ /**
+ * Create and register a Session object.
+ * @return a Session object.
+ */
+ public Session createSession() {
+ Session session = new Session();
+ sessions.add(session);
+ return session;
+ }
+
+ /**
+ * Returns an array of Session object.
+ * @returns an array of Session object
+ */
+ public Session[] getSessions() {
+ Session[] result = new Session[sessions.size()];
+ sessions.copyInto(result);
+ return result;
+ }
+}
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/Task.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/Task.java Wed Jun 16 16:51:40 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.ccmtask.ant.types;
+
+import org.apache.tools.ant.types.DataType;
+
+/**
+ * This class abstract a synergy session.
+ * It store the address to an already existing session.
+ */
+public class Task extends DataType {
+ // store the ccm_addr value
+ private String name;
+
+ /**
+ * Sets the synergy address.
+ * @param name string representing the ccm_addr
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the synergy address.
+ * @return string representing the ccm_addr
+ */
+ public String getName() {
+ return name;
+ }
+}
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/TaskSet.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/src/com/nokia/helium/ccmtask/ant/types/TaskSet.java Wed Jun 16 16:51:40 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.ccmtask.ant.types;
+
+import org.apache.tools.ant.types.DataType;
+import java.util.Vector;
+
+/**
+ * This class abstract a synergy session.
+ * It store the address to an already existing session.
+ */
+public class TaskSet extends DataType {
+ // store the Task objects
+ private Vector tasks = new Vector();
+
+ /**
+ * Create and register a Session object.
+ * @return a Session object.
+ */
+ public Task createTask() {
+ Task task = new Task();
+ tasks.add(task);
+ return task;
+ }
+
+ /**
+ * Returns an array of Session object.
+ * @returns an array of Session object
+ */
+ public Task[] getSessions() {
+ Task[] result = new Task[tasks.size()];
+ tasks.copyInto(result);
+ return result;
+ }
+}
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/tests/antunit/test_ccmtask.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/tests/antunit/test_ccmtask.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,194 @@
+
+
+
+
+ Testing the ccm task
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/tests/bld.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/tests/bld.sh Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,26 @@
+#!/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
+
+# Adding custom mock up tools to the path
+export PATH=$(dirname $(readlink /proc/$$/fd/255))/ccm_mock:$PATH
+
+ant $*
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/tests/build.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/tests/build.bat Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,35 @@
+@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%)
+
+REM Adding custom mock up tools to the path
+set PATH=%~dp0ccm_mock;%PATH%
+
+call ant %*
+if "%ERRORLEVEL%" neq "0" (goto error)
+endlocal
+goto :eof
+
+:error
+endlocal
+if "%OS%"=="Windows_NT" color 00
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/tests/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/tests/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,27 @@
+
+
+
+ Helium antlib legacy tests.
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/tests/ccm_mock/ccm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/tests/ccm_mock/ccm Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,24 @@
+#!/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
+
+unset PYTHONPATH
+python $(dirname $(readlink -f $0))/ccm_mock.py $*
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/tests/ccm_mock/ccm.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/tests/ccm_mock/ccm.bat Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,21 @@
+@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
+set PYTHONPATH=
+@python %~dp0ccm_mock.py %*
+endlocal
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/ccmtask/tests/ccm_mock/ccm_mock.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/ccmtask/tests/ccm_mock/ccm_mock.py Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,34 @@
+#============================================================================
+#Name : ccmtask.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
+
+if len(sys.argv) == 4 and sys.argv[1] == 'set' and sys.argv[2] == 'role':
+ sys.exit(0)
+elif len(sys.argv) == 2 and sys.argv[1] == 'status':
+ print """Sessions for user wbernard:
+
+Command Interface @ FAKESESSION:9999:192.168.0.1 (current session)
+Database: /path/to/db/database
+
+Current project could not be identified.
+"""
+elif len(sys.argv) == 6 and sys.argv[1] == 'folder':
+ print "Added 1 task to " + sys.argv[5]
+
+sys.exit(0)
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/demo/build.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/demo/build.bat Wed Jun 16 16:51:40 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 ANT_ARGS= -lib %CD%\..\..\..\..\external\antlibs2 -lib %HELIUM_HOME%\build\components\helium-core\bin\helium-core.jar
+ant %*
+endlocal
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/demo/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/demo/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,73 @@
+
+
+
+ Helium java core demo.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${drive.variable} is substituted
+
+
+
+
+
+
+
+
+
+ Letters @{drive.letter} is unsubstituted
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/ivy.xml
--- a/buildframework/helium/sf/java/core/ivy.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/ivy.xml Wed Jun 16 16:51:40 2010 +0300
@@ -33,6 +33,7 @@
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/EmailDataSender.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/EmailDataSender.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/EmailDataSender.java Wed Jun 16 16:51:40 2010 +0300
@@ -268,6 +268,9 @@
try {
InternetAddress fromAddress = getFromAddress();
message.setFrom(fromAddress);
+ } catch (HlmAntLibException e) {
+ // We are Ignoring the errors as no need to fail the build.
+ log.debug("Error retrieving current user email address: " + e.getMessage(), e);
} catch (javax.mail.internet.AddressException e) {
// We are Ignoring the errors as no need to fail the build.
log.debug("Error retrieving current user email address: " + e.getMessage(), e);
@@ -358,9 +361,11 @@
NamingEnumeration en = ctx.search("", "uid=" + username, controls);
if (en.hasMore()) {
SearchResult sr = en.next();
- String email = (String) sr.getAttributes().get("mail").get();
- log.debug("getUserEmail:" + email);
- return email;
+ if (sr.getAttributes().get("mail") != null) {
+ String email = (String) sr.getAttributes().get("mail").get();
+ log.debug("getUserEmail:" + email);
+ return email;
+ }
}
} catch (javax.naming.NameNotFoundException ex) {
throw new HlmAntLibException("Error finding user email for " + username );
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/FileUtils.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/FileUtils.java Wed Jun 16 16:51:40 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.core;
+
+import java.io.File;
+
+/**
+ * This tool class provides file or system functionalities:
+ * - Find executable location
+ *
+ */
+public final class FileUtils {
+
+ private FileUtils() {
+ }
+
+ /**
+ * Find an executable based on given name from the PATH. PATHEXT will be used on windows plaform
+ * to search by extension.
+ * @param executableName the executable name
+ * @return the executable as a File, or null if not found.
+ */
+ public static File findExecutableOnPath(String executableName) {
+ String systemPath = System.getenv("PATH");
+ String[] pathDirs = systemPath.split(File.pathSeparator);
+ return findExecutableOnPath(executableName, pathDirs);
+ }
+
+ /**
+ * Find an executable based on given name from the PATH. PATHEXT will be used on windows plaform
+ * to search by extension.
+ * @param executableName the executable name.
+ * @param pathDirs array of directory to look for
+ * @return the executable as a File, or null if not found.
+ */
+ public static File findExecutableOnPath(String executableName, String[] pathDirs) {
+ String[] extensions = {""};
+
+ // Using PATHEXT to get the supported extensions on windows platform
+ if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
+ extensions = System.getenv("PATHEXT").split(File.pathSeparator);
+ }
+
+ for (String extension : extensions) {
+ String checkName = executableName;
+ if (System.getProperty("os.name").toLowerCase().startsWith("win") && !executableName.toLowerCase().endsWith(extension.toLowerCase())) {
+ checkName = executableName + extension;
+ }
+
+ File file = new File(checkName);
+ if (file.isAbsolute()) {
+ if (file.isFile()) {
+ return file;
+ }
+ }
+ for (String pathDir : pathDirs) {
+ file = new File(pathDir, checkName);
+ if (file.isFile()) {
+ return file;
+ }
+ }
+ }
+ return null;
+ }
+
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/AntCall.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/AntCall.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* 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.taskdefs.Ant;
+import org.apache.tools.ant.taskdefs.CallTarget;
+
+/**
+ * This task extends current AntCall task by
+ * supporting any kind of Reference object.
+ *
+ * @ant.task name="antcall" category="Core"
+ */
+public class AntCall extends CallTarget {
+
+ /**
+ * Add a Reference object.
+ * @param ref the reference object.
+ */
+ public void add(Ant.Reference ref) {
+ this.addReference(ref);
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/MappedVariable.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/MappedVariable.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* 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;
+
+/**
+ * This interface describe the methods a Mapped
+ * parameter must implement.
+ */
+public interface MappedVariable extends Variable {
+
+ /**
+ * Get the name of the parameter.
+ * @return the parameter name
+ */
+ String getName();
+
+ /**
+ * Get the value of the parameter
+ * @return the value.
+ */
+ String getValue();
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/Variable.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/Variable.java Wed Jun 16 16:51:40 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.core.ant;
+
+/**
+ * This interface describe the methods a command line variable
+ * must implement.
+ */
+public interface Variable
+{
+
+ /**
+ * Get the command line parameter. It uses '=' character as the default
+ * separator.
+ * @return the parameter as a command line string
+ */
+ String getParameter();
+
+ /**
+ * Get the command line parameter. Use custom parameter for joining
+ * the mapped parameters.
+ * @param separator mapped value separator
+ * @return the parameter as a command line string
+ */
+ String getParameter(String separator);
+
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/VariableIFImpl.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/VariableIFImpl.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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.core.ant;
-
-import org.apache.tools.ant.types.DataType;
-import com.nokia.helium.core.ant.types.Variable;
-import java.util.Collection;
-
-/**
- * Interface to get the list of variables of type VariableSet
- */
-public class VariableIFImpl extends DataType
-{
-
-
- /**
- * Get the name of the variable.
- * @return name.
- */
- public Collection getVariables() {
- //Implemented by sub class
- return null;
- }
-
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/VariableInterface.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/VariableInterface.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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.core.ant;
-
-import com.nokia.helium.core.ant.types.Variable;
-import java.util.Collection;
-
-/**
- * Interface to get the list of variables of type VariableSet
- */
-public interface VariableInterface
-{
-
-
- /**
- * Get the name of the variable.
- * @return name.
- */
- Collection getVariables();
-
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/VariableMap.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/VariableMap.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* 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.util.Collection;
+
+/**
+ * This interface describe the method a Map of variable must
+ * implements.
+ */
+public interface VariableMap
+{
+
+ /**
+ * Get the name of the variable.
+ * @return name.
+ */
+ Collection getVariables();
+
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -23,17 +23,18 @@
-
-
+
+
+
-
-
+
+
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/listener/TargetTimesLogGeneratorListener.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/listener/TargetTimesLogGeneratorListener.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/listener/TargetTimesLogGeneratorListener.java Wed Jun 16 16:51:40 2010 +0300
@@ -92,8 +92,8 @@
targetTimesLogCsv, true);
timesLogOut = new DataOutputStream(timesLogFileStream);
// Display (sorted) hashtable.
- for (String s : targetTimesTable)
- timesLogOut.writeBytes(s + "\n");
+ for (String targetTime : targetTimesTable)
+ timesLogOut.writeBytes(targetTime + "\n");
timesLogOut.close();
}
} catch (java.io.FileNotFoundException ex) {
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/AntCall.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/AntCall.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +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.core.ant.taskdefs;
-
-import org.apache.tools.ant.taskdefs.Ant;
-import org.apache.tools.ant.taskdefs.CallTarget;
-
-/**
- * This task extends current AntCall task by
- * supporting any kind of Reference object.
- *
- * @ant.task name="antcall" category="Core"
- */
-public class AntCall extends CallTarget {
-
- /**
- * Add a Reference object.
- * @param ref the reference object.
- */
- public void add(Ant.Reference ref) {
- this.addReference(ref);
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetFreeDriveTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetFreeDriveTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010-2011 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 org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import java.io.File;
+import org.apache.tools.ant.taskdefs.condition.Os;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Returns Next Free Drive available to use
+ *
+ *
+ * Usage: <hlm:getfreedrive property="build.drive"/>
+ *
+ * @ant.task name="getfreedrive" category="Core"
+ */
+public class GetFreeDriveTask extends Task {
+ // property to set with the available drive
+ private String property;
+
+ /**
+ * To find the free drives available to use
+ *
+ * @return First free drive available
+ */
+ private String getNextFreeDrive() {
+ List drives = new ArrayList(Arrays.asList(File.listRoots()));
+ for (char i = 'Z'; i >= 'A'; i--) {
+ File file = new File(i + ":" + File.separator);
+ if (!drives.contains(file)) {
+ return i + ":";
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Name of the property to be set.
+ *
+ * @param property
+ * the property name
+ * @ant.required
+ */
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
+ @Override
+ public void execute() {
+ if (property == null) {
+ throw new BuildException("'property' attribute is not defined");
+ }
+ if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
+ throw new BuildException("Task getfreedrive is supported only on windows");
+ }
+ String returnValue = getNextFreeDrive();
+ if (returnValue != null) {
+ getProject().setNewProperty(property, returnValue);
+ }
+ else {
+ throw new BuildException("No free drive available");
+ }
+
+
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSet.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSet.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +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.core.ant.taskdefs;
-
-import org.apache.tools.ant.BuildException;
-import java.util.Vector;
-import java.util.Collection;
-import com.nokia.helium.core.ant.VariableIFImpl;
-import org.apache.tools.ant.Task;
-import com.nokia.helium.core.ant.types.Variable;
-
-
-/**
- * To retrive a variable value from a collection of variable set based on name, which contains property-value in pair.
- *
- *
- * Example:
- *
- * <hlm:argSet id="test.variableSet">
- * <variable name="v1" value="the_value_1"/>
- * <variable name="v2" value="the_value_2"/>
- * <variable name="v3" value="the_value_3"/>
- * </hlm:argSet>
- *
- * <hlm:getVariableValue name="v3" property="v1.value">
- * <hlm:argSet refid="test.variableSet"/>
- * </hlm:getVariableValue>
- *
- * @ant.task name="getVariableValue"
- */
-public class GetValueFromVariableSet extends Task {
- private String name;
- private String property;
- private boolean failOnError = true;
-
- private Vector variableIntefaces = new Vector();
-
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Helper function to set failonerror attribute for the task.
- * @param failStatus, if true will fail the build if no variable is found for
- * matching name.
- */
- public void setFailOnError(boolean failStatus) {
- failOnError = failStatus;
- }
-
- /**
- * Helper function to store the name of the property where the value to be stored
- * @param property name of the property where the result to be stored
- */
- public void setProperty(String property) {
- this.property = property;
- }
-
- /**
- * Helper function to create the VariableIFImpl object.
- * @return created VariableIFImpl instance
- */
- public VariableIFImpl createVariableIFImpl() {
- VariableIFImpl var = new VariableIFImpl();
- add(var);
- return var;
- }
-
-
- /**
- * Helper function to add the newly created variable set. Called by ant.
- * @param vs variable set to be added.
- */
- public void add(VariableIFImpl vs) {
- variableIntefaces.add(vs);
- }
-
- public VariableIFImpl getVariableInterface() {
- if (variableIntefaces.isEmpty()) {
- throw new BuildException("variable interface cannot be null");
- }
- if (variableIntefaces.size() > 1 ) {
- throw new BuildException("maximum one variable interface can be set");
- }
- return variableIntefaces.elementAt(0);
- }
-
-
- /**
- * Task to get the name / value pair
- * @return return the name / value pair for the variable set.
- */
- public void execute() {
- if (name == null)
- throw new BuildException("'name' attribute has not been defined.");
- if (property == null)
- throw new BuildException(
- "'property' attribute has not been defined.");
- VariableIFImpl varInterface = getVariableInterface();
- Collection variables = varInterface.getVariables();
- for (Variable var : variables) {
- if (var.getName().equals(name)) {
- getProject().setProperty(property, var.getValue());
- return;
- }
- }
- if (failOnError) {
- throw new BuildException("Could not find '" + name + "' variable.");
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/GetValueFromVariableSetTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* 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 org.apache.tools.ant.BuildException;
+import java.util.Vector;
+
+import com.nokia.helium.core.ant.MappedVariable;
+import com.nokia.helium.core.ant.VariableMap;
+import org.apache.tools.ant.Task;
+import com.nokia.helium.core.ant.types.VariableSet;
+
+
+/**
+ * To retrive a variable value from a collection of variable set based on name, which contains property-value in pair.
+ *
+ *
+ * Example:
+ *
+ * <hlm:argSet id="test.variableSet">
+ * <variable name="v1" value="the_value_1"/>
+ * <variable name="v2" value="the_value_2"/>
+ * <variable name="v3" value="the_value_3"/>
+ * </hlm:argSet>
+ *
+ * <hlm:getVariableValue name="v3" property="v1.value">
+ * <hlm:argSet refid="test.variableSet"/>
+ * </hlm:getVariableValue>
+ *
+ * @ant.task name="getVariableValue"
+ */
+public class GetValueFromVariableSetTask extends Task {
+ private String name;
+ private String property;
+ private boolean failOnError = true;
+
+ private Vector variableMaps = new Vector();
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Helper function to set failonerror attribute for the task.
+ * @param failStatus, if true will fail the build if no variable is found for
+ * matching name.
+ */
+ public void setFailOnError(boolean failStatus) {
+ failOnError = failStatus;
+ }
+
+ /**
+ * Helper function to store the name of the property where the value to be stored
+ * @param property name of the property where the result to be stored
+ */
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
+ /**
+ * Helper function to create the VariableIFImpl object.
+ * @return created VariableIFImpl instance
+ */
+ public VariableSet createVariableIFImpl() {
+ VariableSet var = new VariableSet();
+ add(var);
+ return var;
+ }
+
+
+ /**
+ * Helper function to add the newly created variable set. Called by ant.
+ * @param vs variable set to be added.
+ */
+ public void add(VariableMap vs) {
+ variableMaps.add(vs);
+ }
+
+ public VariableMap getVariableInterface() {
+ if (variableMaps.isEmpty()) {
+ throw new BuildException("variable interface cannot be null");
+ }
+ if (variableMaps.size() > 1 ) {
+ throw new BuildException("maximum one variable interface can be set");
+ }
+ return variableMaps.elementAt(0);
+ }
+
+
+ /**
+ * Task to get the name / value pair
+ * @return return the name / value pair for the variable set.
+ */
+ public void execute() {
+ if (name == null)
+ throw new BuildException("'name' attribute has not been defined.");
+ if (property == null)
+ throw new BuildException(
+ "'property' attribute has not been defined.");
+ VariableMap variableMap = getVariableInterface();
+ for (MappedVariable var : variableMap.getVariables()) {
+ if (var.getName().equals(name)) {
+ getProject().setProperty(property, var.getValue());
+ return;
+ }
+ }
+ if (failOnError) {
+ throw new BuildException("Could not find '" + name + "' variable.");
+ }
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/LDAP.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/LDAP.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +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.core.ant.taskdefs;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.BuildException;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-
-/**
- * Task is to search data from LDAP server.
- *
- *
- * Usage: <hlm:ldap url="${ldap.server.url}"
- * rootdn="${ldap.root.dn}"
- * filter="uid=${env.USERNAME}"
- * outputproperty="email.from"
- * key="mail"/>
- *
- * @ant.task name="ldap" category="Core"
- */
-public class LDAP extends Task {
- private String url;
- private String rootdn;
- private String filter;
- private String key;
- private String property;
-
- /**
- * Method executes current task.
- */
- public void execute() {
- if (url == null)
- throw new BuildException("'url' attribute is not defined");
- if (rootdn == null)
- throw new BuildException("'rootdn' attribute is not defined");
- if (filter == null)
- throw new BuildException("'filter' attribute is not defined");
- if (property == null)
- throw new BuildException("'property' attribute is not defined");
- if (key == null)
- throw new BuildException("'key' attribute is not defined");
-
- // Set up environment for creating initial context
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY,
- "com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.PROVIDER_URL, url + "/" + rootdn);
-
- // Create initial context
- try {
- DirContext ctx = new InitialDirContext(env);
- SearchControls controls = new SearchControls();
- controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
- NamingEnumeration en = ctx.search("", filter,
- controls);
- if (en.hasMore()) {
- SearchResult sr = en.next();
- getProject().setProperty(property,
- (String) sr.getAttributes().get(key).get());
- return;
- }
- } catch (NamingException exc) {
- throw new BuildException(exc.getMessage());
- }
- }
-
- /**
- * Return the LDAP server URL.
- *
- * @return the LDAP server URL.
- */
- public String getUrl() {
- return url;
- }
-
- /**
- * Set LDAP server URL.
- *
- * @param url is the LDAP server URL to set.
- * @ant.required
- */
- public void setUrl(String url) {
- this.url = url;
- }
-
- /**
- * Return LDAP root distinguished name.
- *
- * @return LDAP root distinguished name
- */
- public String getRootdn() {
- return rootdn;
- }
-
- /**
- * Set LDAP root distinguished name.
- *
- * @param rootdn is the LDAP root distinguished name to set.
- * @ant.required
- */
- public void setRootdn(String rootdn) {
- this.rootdn = rootdn;
- }
-
- /**
- * Return object name to search in the LDAP.
- *
- * @return the object name to search in the LDAP
- */
- public String getFilter() {
- return filter;
- }
-
- /**
- * Set the object name to search in the LDAP.
- *
- * @param filter is the object name to set.
- * @ant.required
- */
- public void setFilter(String filter) {
- this.filter = filter;
- }
-
- /**
- * Return the output property to set.
- *
- * @return is the output property to set.
- */
- public String getOutputProperty() {
- return property;
- }
-
- /**
- * Set the output property if the user found.
- *
- * @param property is the property to be set.
- * @ant.required
- */
- public void setOutputProperty(String property) {
- this.property = property;
- }
-
- /**
- * Return the key search element to search user information.
- *
- * @return the key search element.
- */
- public String getKey() {
- return key;
- }
-
- /**
- * Set the key search element to search the user information.
- *
- * @param key is the key search element to set.
- * @ant.required
- */
- public void setKey(String key) {
- this.key = key;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/LDAPTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/LDAPTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,178 @@
+/*
+ * 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 org.apache.tools.ant.Task;
+import org.apache.tools.ant.BuildException;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+
+/**
+ * Task is to search data from LDAP server.
+ *
+ *
+ * Usage: <hlm:ldap url="${ldap.server.url}"
+ * rootdn="${ldap.root.dn}"
+ * filter="uid=${env.USERNAME}"
+ * outputproperty="email.from"
+ * key="mail"/>
+ *
+ * @ant.task name="ldap" category="Core"
+ */
+public class LDAPTask extends Task {
+ private String url;
+ private String rootdn;
+ private String filter;
+ private String key;
+ private String property;
+
+ /**
+ * Method executes current task.
+ */
+ public void execute() {
+ if (url == null)
+ throw new BuildException("'url' attribute is not defined");
+ if (rootdn == null)
+ throw new BuildException("'rootdn' attribute is not defined");
+ if (filter == null)
+ throw new BuildException("'filter' attribute is not defined");
+ if (property == null)
+ throw new BuildException("'property' attribute is not defined");
+ if (key == null)
+ throw new BuildException("'key' attribute is not defined");
+
+ // Set up environment for creating initial context
+ Hashtable env = new Hashtable();
+ env.put(Context.INITIAL_CONTEXT_FACTORY,
+ "com.sun.jndi.ldap.LdapCtxFactory");
+ env.put(Context.PROVIDER_URL, url + "/" + rootdn);
+
+ // Create initial context
+ try {
+ DirContext ctx = new InitialDirContext(env);
+ SearchControls controls = new SearchControls();
+ controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ NamingEnumeration en = ctx.search("", filter,
+ controls);
+ if (en.hasMore()) {
+ SearchResult sr = en.next();
+ getProject().setProperty(property,
+ (String) sr.getAttributes().get(key).get());
+ return;
+ }
+ } catch (NamingException exc) {
+ throw new BuildException(exc.getMessage());
+ }
+ }
+
+ /**
+ * Return the LDAP server URL.
+ *
+ * @return the LDAP server URL.
+ */
+ public String getUrl() {
+ return url;
+ }
+
+ /**
+ * Set LDAP server URL.
+ *
+ * @param url is the LDAP server URL to set.
+ * @ant.required
+ */
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ /**
+ * Return LDAP root distinguished name.
+ *
+ * @return LDAP root distinguished name
+ */
+ public String getRootdn() {
+ return rootdn;
+ }
+
+ /**
+ * Set LDAP root distinguished name.
+ *
+ * @param rootdn is the LDAP root distinguished name to set.
+ * @ant.required
+ */
+ public void setRootdn(String rootdn) {
+ this.rootdn = rootdn;
+ }
+
+ /**
+ * Return object name to search in the LDAP.
+ *
+ * @return the object name to search in the LDAP
+ */
+ public String getFilter() {
+ return filter;
+ }
+
+ /**
+ * Set the object name to search in the LDAP.
+ *
+ * @param filter is the object name to set.
+ * @ant.required
+ */
+ public void setFilter(String filter) {
+ this.filter = filter;
+ }
+
+ /**
+ * Return the output property to set.
+ *
+ * @return is the output property to set.
+ */
+ public String getOutputProperty() {
+ return property;
+ }
+
+ /**
+ * Set the output property if the user found.
+ *
+ * @param property is the property to be set.
+ * @ant.required
+ */
+ public void setOutputProperty(String property) {
+ this.property = property;
+ }
+
+ /**
+ * Return the key search element to search user information.
+ *
+ * @return the key search element.
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * Set the key search element to search the user information.
+ *
+ * @param key is the key search element to set.
+ * @ant.required
+ */
+ public void setKey(String key) {
+ this.key = key;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/ValidateUserLogin.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/ValidateUserLogin.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +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.core.ant.taskdefs;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import javax.naming.*;
-import javax.naming.directory.*;
-import java.util.Hashtable;
-import org.apache.tools.ant.taskdefs.condition.Condition;
-
-/**
- * Task is to validate noe user with LDAP server.
- *
- * Usage: <hlm:ldapauthenticate url="${email.ldap.server}"
- rootdn="${email.ldap.rootdn}"
- searchdn="${ldap.organization.unit.rootdn}, ${ldap.people.rootdn}"
- filter="uid=${env.USERNAME}"
- outputproperty="is.authentication.sucess"
- key="employeeNumber"
- password="${noe.password}"/>
-
-
- * Usage: <condition property="is.authentication.sucess" >
- <hlm:ldapauthenticate url="${email.ldap.server}"
- rootdn="${email.ldap.rootdn}"
- searchdn="${ldap.organization.unit.rootdn}, ${ldap.people.rootdn}"
- filter="uid=${env.USERNAME}"
- key="employeeNumber"
- password="${noe.password}"/>
- <condition/>
-
- @ant.task name="ldapauthenticate" category="Core"
- */
-public class ValidateUserLogin extends Task implements Condition
-{
- private String url;
- private String rootdn;
- private String filter;
- private String key;
- private String property;
- private String searchdn;
- private String password;
-
- public void execute()
- {
-
- if (property == null)
- throw new BuildException("'property' attribute is not defined");
- validateParameters(url, rootdn, filter, key, searchdn, password);
- log("Authenticating the user...");
- if (authenticateUser(url, searchUser(url, rootdn, filter, key, searchdn))) {
- getProject().setProperty(property, "true");
- }
- else {
- getProject().setProperty(property, "false");
- }
- }
-
- public boolean eval() {
-
- validateParameters(url, rootdn, filter, key, searchdn, password);
- return authenticateUser(url, searchUser(url, rootdn, filter, key, searchdn));
-
- }
-
- public String searchUser(String url, String rootdn, String filter, String key, String searchdn) {
-
- String userSearchDN = null;
- // Set up environment for creating initial context
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY,
- "com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.PROVIDER_URL, url + "/" + rootdn);
-
- // Create initial context
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- DirContext ctx = null;
- NamingEnumeration results = null;
- try {
- ctx = new InitialDirContext(env);
- SearchControls controls = new SearchControls();
- controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
- results = ctx.search("", filter, controls);
- while (results.hasMore()) {
- SearchResult searchResult = (SearchResult) results.next();
- Attributes attributes = searchResult.getAttributes();
- Attribute attr = attributes.get(key);
- userSearchDN = key + "=" + (String) attr.get() + ", " + searchdn + ", " + rootdn;
- }
- } catch (NamingException e) {
- e.printStackTrace();
- throw new BuildException("LDAP Naming exception");
- }
- return userSearchDN;
- }
-
- public void validateParameters(String url, String rootdn, String filter, String key, String searchdn, String password) {
-
- if (url == null)
- throw new BuildException("'url' attribute is not defined");
- if (rootdn == null)
- throw new BuildException("'rootdn' attribute is not defined");
- if (filter == null)
- throw new BuildException("'filter' attribute is not defined");
- if (key == null)
- throw new BuildException("'key' attribute is not defined");
- if (searchdn == null)
- throw new BuildException("'searchdn' attribute is not defined");
- if (password == null)
- throw new BuildException("'password' attribute is not defined");
- }
-
- public boolean authenticateUser(String ldapurl, String rooTdn) {
-
- Hashtable env = new Hashtable(11);
- env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
- env.put(Context.PROVIDER_URL, ldapurl);
- env.put(Context.SECURITY_AUTHENTICATION, "simple");
- env.put(Context.SECURITY_PRINCIPAL, rooTdn);
- env.put(Context.SECURITY_CREDENTIALS, password);
- try {
- DirContext authContext = new InitialDirContext(env);
- return true;
- } catch (NamingException e) {
- // We are Ignoring the errors as no need to fail the build.
- log("Not able to validate the user. " + e.getMessage(), Project.MSG_DEBUG);
- return false;
- }
-
- }
- public String getUrl()
- {
- return url;
- }
- /**
- * ldap URL
- * @ant.required
- */
- public void setUrl(String url)
- {
- this.url = url;
- }
-
-
- public String getRootdn()
- {
- return rootdn;
- }
- /**
- * user password to authenticate
- * @ant.required
- */
- public void setpassword(String password)
- {
- this.password = password;
- }
-
- public String getpassword()
- {
- return password;
- }
- /**
- * ldap root distinguished name to search user.
- * @ant.required
- */
- public void setRootdn(String rootdn)
- {
- this.rootdn = rootdn;
- }
-
- public String getsearchdn()
- {
- return searchdn;
- }
- /**
- * ldap distinguished name to search user
- * @ant.required
- */
- public void setsearchdn(String searchdn)
- {
- this.searchdn = searchdn;
- }
-
- public String getFilter()
- {
- return filter;
- }
- /**
- * object name to search in the ldap.
- * @ant.required
- */
- public void setFilter(String filter)
- {
- this.filter = filter;
- }
-
- public String getOutputProperty()
- {
- return property;
- }
- /**
- * output property to set if the user found.
- * @ant.required
- */
- public void setOutputProperty(String property)
- {
- this.property = property;
- }
-
- public String getKey()
- {
- return key;
- }
- /**
- * key to search the user information
- * @ant.required
- */
- public void setKey(String key)
- {
- this.key = key;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/ValidateUserLoginTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/ValidateUserLoginTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,239 @@
+/*
+* 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 org.apache.tools.ant.Task;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.BuildException;
+import javax.naming.*;
+import javax.naming.directory.*;
+import java.util.Hashtable;
+import org.apache.tools.ant.taskdefs.condition.Condition;
+
+/**
+ * Task is to validate noe user with LDAP server.
+ *
+ * Usage: <hlm:ldapauthenticate url="${email.ldap.server}"
+ rootdn="${email.ldap.rootdn}"
+ searchdn="${ldap.organization.unit.rootdn}, ${ldap.people.rootdn}"
+ filter="uid=${env.USERNAME}"
+ outputproperty="is.authentication.sucess"
+ key="employeeNumber"
+ password="${noe.password}"/>
+
+
+ * Usage: <condition property="is.authentication.sucess" >
+ <hlm:ldapauthenticate url="${email.ldap.server}"
+ rootdn="${email.ldap.rootdn}"
+ searchdn="${ldap.organization.unit.rootdn}, ${ldap.people.rootdn}"
+ filter="uid=${env.USERNAME}"
+ key="employeeNumber"
+ password="${noe.password}"/>
+ <condition/>
+
+ @ant.task name="ldapauthenticate" category="Core"
+ */
+public class ValidateUserLoginTask extends Task implements Condition
+{
+ private String url;
+ private String rootdn;
+ private String filter;
+ private String key;
+ private String property;
+ private String searchdn;
+ private String password;
+
+ public void execute()
+ {
+
+ if (property == null)
+ throw new BuildException("'property' attribute is not defined");
+ validateParameters(url, rootdn, filter, key, searchdn, password);
+ log("Authenticating the user...");
+ if (authenticateUser(url, searchUser(url, rootdn, filter, key, searchdn))) {
+ getProject().setProperty(property, "true");
+ }
+ else {
+ getProject().setProperty(property, "false");
+ }
+ }
+
+ public boolean eval() {
+
+ validateParameters(url, rootdn, filter, key, searchdn, password);
+ return authenticateUser(url, searchUser(url, rootdn, filter, key, searchdn));
+
+ }
+
+ public String searchUser(String url, String rootdn, String filter, String key, String searchdn) {
+
+ String userSearchDN = null;
+ // Set up environment for creating initial context
+ Hashtable env = new Hashtable();
+ env.put(Context.INITIAL_CONTEXT_FACTORY,
+ "com.sun.jndi.ldap.LdapCtxFactory");
+ env.put(Context.PROVIDER_URL, url + "/" + rootdn);
+
+ // Create initial context
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ DirContext ctx = null;
+ NamingEnumeration results = null;
+ try {
+ ctx = new InitialDirContext(env);
+ SearchControls controls = new SearchControls();
+ controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
+ results = ctx.search("", filter, controls);
+ while (results.hasMore()) {
+ SearchResult searchResult = (SearchResult) results.next();
+ Attributes attributes = searchResult.getAttributes();
+ Attribute attr = attributes.get(key);
+ userSearchDN = key + "=" + (String) attr.get() + ", " + searchdn + ", " + rootdn;
+ }
+ } catch (NamingException e) {
+ e.printStackTrace();
+ throw new BuildException("LDAP Naming exception");
+ }
+ return userSearchDN;
+ }
+
+ public void validateParameters(String url, String rootdn, String filter, String key, String searchdn, String password) {
+
+ if (url == null)
+ throw new BuildException("'url' attribute is not defined");
+ if (rootdn == null)
+ throw new BuildException("'rootdn' attribute is not defined");
+ if (filter == null)
+ throw new BuildException("'filter' attribute is not defined");
+ if (key == null)
+ throw new BuildException("'key' attribute is not defined");
+ if (searchdn == null)
+ throw new BuildException("'searchdn' attribute is not defined");
+ if (password == null)
+ throw new BuildException("'password' attribute is not defined");
+ }
+
+ public boolean authenticateUser(String ldapurl, String rooTdn) {
+
+ Hashtable env = new Hashtable(11);
+ env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
+ env.put(Context.PROVIDER_URL, ldapurl);
+ env.put(Context.SECURITY_AUTHENTICATION, "simple");
+ env.put(Context.SECURITY_PRINCIPAL, rooTdn);
+ env.put(Context.SECURITY_CREDENTIALS, password);
+ try {
+ DirContext authContext = new InitialDirContext(env);
+ return true;
+ } catch (NamingException e) {
+ // We are Ignoring the errors as no need to fail the build.
+ log("Not able to validate the user. " + e.getMessage(), Project.MSG_DEBUG);
+ return false;
+ }
+
+ }
+ public String getUrl()
+ {
+ return url;
+ }
+ /**
+ * ldap URL
+ * @ant.required
+ */
+ public void setUrl(String url)
+ {
+ this.url = url;
+ }
+
+
+ public String getRootdn()
+ {
+ return rootdn;
+ }
+ /**
+ * user password to authenticate
+ * @ant.required
+ */
+ public void setpassword(String password)
+ {
+ this.password = password;
+ }
+
+ public String getpassword()
+ {
+ return password;
+ }
+ /**
+ * ldap root distinguished name to search user.
+ * @ant.required
+ */
+ public void setRootdn(String rootdn)
+ {
+ this.rootdn = rootdn;
+ }
+
+ public String getsearchdn()
+ {
+ return searchdn;
+ }
+ /**
+ * ldap distinguished name to search user
+ * @ant.required
+ */
+ public void setsearchdn(String searchdn)
+ {
+ this.searchdn = searchdn;
+ }
+
+ public String getFilter()
+ {
+ return filter;
+ }
+ /**
+ * object name to search in the ldap.
+ * @ant.required
+ */
+ public void setFilter(String filter)
+ {
+ this.filter = filter;
+ }
+
+ public String getOutputProperty()
+ {
+ return property;
+ }
+ /**
+ * output property to set if the user found.
+ * @ant.required
+ */
+ public void setOutputProperty(String property)
+ {
+ this.property = property;
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+ /**
+ * key to search the user information
+ * @ant.required
+ */
+ public void setKey(String key)
+ {
+ this.key = key;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/XMLLogCount.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/XMLLogCount.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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.core.ant.taskdefs;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import com.nokia.helium.core.ant.conditions.XMLLogCondition;
-
-/**
- * This class sets a property to the number of matching severity inside a XML log.
- *
- * @ant.task name="countSeverity" category="Core"
- */
-public class XMLLogCount extends Task {
-
- private File fileName;
- private String severity;
- private String logRegexp;
- private String property;
-
- /**
- * File to be parsed.
- *
- * @param filename
- * @ant.required
- */
- public void setFile(File filename) {
- fileName = filename;
- }
-
- /**
- * Defines the severity name to be counted.
- *
- * @param severity
- * @ant.required
- */
- public void setSeverity(String severity) {
- this.severity = severity;
- }
-
- /**
- * Name of the property to be set.
- * @param property the property name
- * @ant.required
- */
- public void setProperty(String property) {
- this.property = property;
- }
-
- /**
- * Regular expression which used to match a specific log filename.
- * @param regex
- * @ant.not-required
- */
- public void setLogMatcher(String regex) {
- this.logRegexp = regex;
- }
-
- /**
- * Execute the task. Set the property with number of severities.
- * @throws BuildException
- */
- public void execute() {
- if (property == null)
- throw new BuildException("'property' attribute is not defined");
-
- XMLLogCondition cond = new XMLLogCondition();
- cond.setFile(fileName);
- cond.setLogMatcher(logRegexp);
- cond.setSeverity(severity);
- getProject().setNewProperty(property, "" + cond.getSeverity());
- }
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/XMLLogCountTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/taskdefs/XMLLogCountTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,90 @@
+/*
+ * 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.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import com.nokia.helium.core.ant.conditions.XMLLogCondition;
+
+/**
+ * This class sets a property to the number of matching severity inside a XML log.
+ *
+ * @ant.task name="countSeverity" category="Core"
+ */
+public class XMLLogCountTask extends Task {
+
+ private File fileName;
+ private String severity;
+ private String logRegexp;
+ private String property;
+
+ /**
+ * File to be parsed.
+ *
+ * @param filename
+ * @ant.required
+ */
+ public void setFile(File filename) {
+ fileName = filename;
+ }
+
+ /**
+ * Defines the severity name to be counted.
+ *
+ * @param severity
+ * @ant.required
+ */
+ public void setSeverity(String severity) {
+ this.severity = severity;
+ }
+
+ /**
+ * Name of the property to be set.
+ * @param property the property name
+ * @ant.required
+ */
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
+ /**
+ * Regular expression which used to match a specific log filename.
+ * @param regex
+ * @ant.not-required
+ */
+ public void setLogMatcher(String regex) {
+ this.logRegexp = regex;
+ }
+
+ /**
+ * Execute the task. Set the property with number of severities.
+ * @throws BuildException
+ */
+ public void execute() {
+ if (property == null)
+ throw new BuildException("'property' attribute is not defined");
+
+ XMLLogCondition cond = new XMLLogCondition();
+ cond.setFile(fileName);
+ cond.setLogMatcher(logRegexp);
+ cond.setSeverity(severity);
+ getProject().setNewProperty(property, "" + cond.getSeverity());
+ }
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/Variable.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/Variable.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +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.core.ant.types;
-
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.BuildException;
-import org.apache.log4j.Logger;
-
-/**
- * Helper class to store the command line variables
- * with name / value pair.
- * @ant.type name="arg" category="Core"
- * @ant.type name="makeOption" category="Core"
- */
-public class Variable extends DataType
-{
- private static Logger log = Logger.getLogger(Variable.class);
- private String name;
- private String value;
- private String cmdLine;
-
-
- public Variable() {
- }
-
- /**
- * Set the name of the variable.
- * @param name
- */
- public void setName(String nm) {
- name = nm;
- }
-
-
- /**
- * Get the name of the variable.
- * @return name.
- */
- public String getName() {
- if ( cmdLine == null) {
- if (name == null ) {
- throw new BuildException( "name should not be null");
- }
- if (value == null) {
- throw new BuildException( "value should not be null");
- }
- return name;
- } else {
- if (name != null && value != null) {
- throw new BuildException( "you can define either name, value or line attribute and not both");
- }
- String cmdPart = cmdLine.trim();
- String[] cmdArgs = cmdPart.split(" ");
- return cmdArgs[0];
- }
- }
-
- /**
- * Set the value of the variable.
- * @param value
- */
- public void setValue(String vlue) {
- value = vlue;
- }
-
- /**
- * Helper function to set the command line string
- * @param line, string as input to command line.
- */
- public void setLine(String line) {
- cmdLine = line;
- }
-
- /**
- * Get the value of the variable.
- * @return value.
- */
- public String getValue() {
- if ( cmdLine == null) {
- if (name == null ) {
- throw new BuildException( "name should not be null");
- }
- if (value == null) {
- throw new BuildException( "value should not be null");
- }
- return value;
- } else {
- if (name != null && value != null) {
- throw new BuildException( "you can define either name, value or line attribute and not both");
- }
- return cmdLine;
- }
- }
- /**
- * Get the command line parameter
- * @return command line string.
- */
- public String getParameter() {
- if ( cmdLine == null) {
- if (name == null ) {
- throw new BuildException( "name should not be null");
- }
- if (value == null) {
- throw new BuildException( "value should not be null");
- }
- return name + "=" + value;
- } else {
- if (name != null && value != null) {
- throw new BuildException( "you can define either name, value or line attribute and not both");
- }
- return cmdLine;
- }
- }
-
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/VariableImpl.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/VariableImpl.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,145 @@
+/*
+* 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.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.types.DataType;
+import org.apache.tools.ant.BuildException;
+import org.apache.commons.lang.StringUtils;
+
+import com.nokia.helium.core.ant.MappedVariable;
+import java.util.Arrays;
+
+/**
+ * Helper class to store the command line variables
+ * with name / value pair.
+ * @ant.type name="arg" category="Core"
+ * @ant.type name="makeOption" category="Core"
+ */
+public class VariableImpl extends DataType implements MappedVariable
+{
+ private String name;
+ private String value;
+ private String cmdLine;
+
+ /**
+ * Set the name of the variable.
+ * @param name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Get the name of the variable. Will return name is name attribute is set
+ * or first command line parameter if line is used.
+ * @return name.
+ */
+ public String getName() {
+ if ( cmdLine == null) {
+ if (name == null ) {
+ throw new BuildException( "'name' attribute must be defined");
+ }
+ if (value == null) {
+ throw new BuildException( "'value' attribute must be defined");
+ }
+ return name;
+ } else {
+ if (name != null && value != null) {
+ throw new BuildException( "You can define either name, value or line attribute and not both");
+ }
+ String cmdPart = cmdLine.trim();
+ String[] cmdArgs = cmdPart.split(" ");
+ return cmdArgs[0];
+ }
+ }
+
+ /**
+ * Set the value of the variable.
+ * @param value
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Helper function to set the command line string
+ * @param line, string as input to command line.
+ */
+ public void setLine(String line) {
+ cmdLine = line;
+ }
+
+ /**
+ * Get the value of the variable. Returns value if name/value are used, or the line attribute minus
+ * the first command line parameter.
+ * @return value.
+ */
+ public String getValue() {
+ if ( cmdLine == null) {
+ if (name == null ) {
+ throw new BuildException( "'name' attribute must be defined");
+ }
+ if (value == null) {
+ throw new BuildException( "'value' attribute must be defined");
+ }
+ return value;
+ } else {
+ if (name != null && value != null) {
+ throw new BuildException( "You can define either name, value or line attribute but not both");
+ }
+
+ String cmdPart = cmdLine.trim();
+ List cmdList = new ArrayList(Arrays.asList(cmdPart.split(" ")));
+ if (cmdList.size() > 0) {
+ cmdList.remove(0);
+ }
+ return StringUtils.join(cmdList.toArray(), " "); // "-c armv5 -c foobar" : " armv5 -c foobar"
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getParameter() {
+ return getParameter("=");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getParameter(String separator) {
+ if ( cmdLine == null) {
+ if (name == null ) {
+ throw new BuildException( "'name' attribute must be defined");
+ }
+ if (value == null) {
+ throw new BuildException( "'value' attribute must be defined");
+ }
+ return name + separator + value;
+ } else {
+ if (name != null && value != null) {
+ throw new BuildException( "You can define either name, value or line attribute but not both");
+ }
+ return cmdLine;
+ }
+ }
+
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/VariableSet.java
--- a/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/VariableSet.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/src/com/nokia/helium/core/ant/types/VariableSet.java Wed Jun 16 16:51:40 2010 +0300
@@ -17,48 +17,27 @@
package com.nokia.helium.core.ant.types;
-import java.util.Vector;
+import java.util.Collection;
import java.util.HashMap;
import java.util.List;
-import com.nokia.helium.core.ant.VariableIFImpl;
-import java.util.Collection;
-import org.apache.tools.ant.types.Reference;
+
+import com.nokia.helium.core.ant.MappedVariable;
+import com.nokia.helium.core.ant.Variable;
+import com.nokia.helium.core.ant.VariableMap;
+
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.DataType;
import java.util.ArrayList;
-import org.apache.log4j.Logger;
/**
* Helper class to store the variable set (list of variables
* with name / value pair)
* @ant.type name="argSet" category="Core"
*/
-public class VariableSet extends VariableIFImpl {
-
- private static Logger log = Logger.getLogger(VariableSet.class);
-
- private HashMap variablesMap = new HashMap();
-
- private List variables = new ArrayList ();
-
- private Vector varSets = new Vector();
+public class VariableSet extends DataType implements Variable, VariableMap {
- private VariableSet currentSet;
-
- /**
- * Constructor
- */
- public VariableSet() {
- }
-
- /**
- * Helper function to add the created varset
- * @param filter to be added to the varset
- */
- public void add(VariableSet varSet) {
- currentSet = null;
- if (varSet != null) {
- varSets.add(varSet);
- }
- }
+ private List variables = new ArrayList();
/**
* Creates an empty variable element and adds
@@ -66,9 +45,9 @@
* @return empty Variable pair
*/
public VariableSet createArgSet() {
- VariableSet varSet = new VariableSet();
- add(varSet);
- return varSet;
+ VariableSet variableSet = new VariableSet();
+ variables.add(variableSet);
+ return variableSet;
}
/**
@@ -77,25 +56,17 @@
* @return empty Variable pair
*/
public Variable createArg() {
- Variable var = new Variable();
- add(var);
- return var;
+ Variable variable = new VariableImpl();
+ variables.add(variable);
+ return variable;
}
-
- private void addVariable(Variable var) {
- variables.add(var);
- }
-
+
/**
* Add a given variable to the list
* @param var variable to add
*/
- public void add(Variable var) {
- if ( currentSet == null) {
- currentSet = new VariableSet();
- varSets.add(currentSet);
- }
- currentSet.addVariable(var);
+ public void add(Variable variable) {
+ variables.add(variable);
}
/**
@@ -106,49 +77,81 @@
return variables;
}
+ /**
+ * Get the list of nested VariableSet.
+ * @return the list of VariableSet.
+ */
public List getVariableSets() {
- return varSets;
+ List variableSets = new ArrayList();
+ for (Variable variable : variables) {
+ if (variable instanceof VariableSet) {
+ variableSets.add((VariableSet)variable);
+ }
+ }
+ return variableSets;
}
-
-
- /**
- * Helper function to return the list of variables and its references
- * @return variable list for this set and its references.
- */
- public Collection getVariables() {
- HashMap varMap = getVariablesMap();
- //if (varMap.isEmpty()) {
- // throw new BuildException("Variable should not be empty and should contain one arg");
- //}
- return getVariablesMap().values();
- }
+
/**
* Returns the list of variables available in the VariableSet
* @return variable list
*/
- public HashMap getVariablesMap() {
- HashMap allVariables = new HashMap();
- // Then filters as reference in filterset
- Reference refId = getRefid();
- Object varSetObject = null;
- if (refId != null) {
- varSetObject = refId.getReferencedObject();
+ public HashMap getVariablesMap() {
+ if (this.isReference()) {
+ Object varSetObject = this.getRefid().getReferencedObject();
if (varSetObject != null && varSetObject instanceof VariableSet) {
- HashMap varSetMap = ((VariableSet)varSetObject).getVariablesMap();
- allVariables.putAll(varSetMap);
+ return ((VariableSet)varSetObject).getVariablesMap();
+ } else {
+ throw new BuildException("The '" + this.getRefid().getRefId() + "' reference is not referencing a VariableSet");
}
+ } else {
+ HashMap allVariables = new HashMap();
+ for (Variable variable : variables) {
+ if (variable instanceof MappedVariable) {
+ allVariables.put(((MappedVariable)variable).getName(), (MappedVariable)variable);
+ } else if (variable instanceof VariableSet)
+ allVariables.putAll(((VariableSet)variable).getVariablesMap());
+ }
+ return allVariables;
}
- if (varSets != null && (!varSets.isEmpty())) {
- for (VariableSet varSet : varSets) {
- HashMap variablesMap = varSet.getVariablesMap();
- allVariables.putAll(variablesMap);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getParameter() {
+ return getParameter("=");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String getParameter(String separator) {
+ if (this.isReference()) {
+ Object varSetObject = this.getRefid().getReferencedObject();
+ if (varSetObject != null && varSetObject instanceof VariableSet) {
+ return ((VariableSet)varSetObject).getParameter(separator);
+ } else {
+ throw new BuildException("The '" + this.getRefid().getRefId() + "' reference is not referencing a VariableSet");
}
+ } else {
+ String parameter = "";
+ for (Variable variable : variables) {
+
+ parameter += " " + variable.getParameter(separator);
+ }
+ return parameter;
}
- if (variables != null && !variables.isEmpty()) {
- for (Variable var : variables) {
- allVariables.put(var.getName(), var);
- }
- }
- return allVariables;
}
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Collection getVariables() {
+ return this.getVariablesMap().values();
+ }
+
+
}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/tests/antunit/ldap/test_ldap.ant.xml
--- a/buildframework/helium/sf/java/core/tests/antunit/ldap/test_ldap.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/tests/antunit/ldap/test_ldap.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -23,7 +23,6 @@
Helium antlib core ldap tests.
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/tests/antunit/pythontask/test_pythontask.ant.xml
--- a/buildframework/helium/sf/java/core/tests/antunit/pythontask/test_pythontask.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/tests/antunit/pythontask/test_pythontask.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -23,7 +23,6 @@
Helium antlib core ldap tests.
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/tests/antunit/retrytask/test_retrytask.ant.xml
--- a/buildframework/helium/sf/java/core/tests/antunit/retrytask/test_retrytask.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/tests/antunit/retrytask/test_retrytask.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -23,7 +23,6 @@
Helium antlib core ldap tests.
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/tests/antunit/test_getfreedrive.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/antunit/test_getfreedrive.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,64 @@
+
+
+
+
+
+ Testing getFreeDrive targets
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/tests/antunit/variableset/test_variableset.ant.xml
--- a/buildframework/helium/sf/java/core/tests/antunit/variableset/test_variableset.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/core/tests/antunit/variableset/test_variableset.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -23,12 +23,11 @@
Helium antlib core variableset tests.
-
+
-
-
+
@@ -55,9 +54,9 @@
-
+
-
+
@@ -66,16 +65,16 @@
-
+
-
+
-
+
-
+
@@ -83,9 +82,9 @@
-
+
-
+
@@ -94,33 +93,33 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/core/tests/src/com/nokia/helium/core/tests/TestFileUtils.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/core/tests/src/com/nokia/helium/core/tests/TestFileUtils.java Wed Jun 16 16:51:40 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.core.tests;
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.nokia.helium.core.FileUtils;
+
+public class TestFileUtils {
+
+ /**
+ * This test search the foobar excutable that should not exists.
+ */
+ @Test
+ public void findNonExistingBinary() {
+ assertTrue(FileUtils.findExecutableOnPath("foobar") == null);
+ }
+
+ /**
+ * This test is looking for ant executable, which must exists as
+ * we are running the test through Ant.
+ */
+ @Test
+ public void findExistingBinary() {
+ assertTrue(FileUtils.findExecutableOnPath("ant") != null);
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsClient.java Wed Jun 16 16:51:40 2010 +0300
@@ -197,6 +197,10 @@
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) {
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/DiamondsListenerImpl.java Wed Jun 16 16:51:40 2010 +0300
@@ -126,10 +126,10 @@
+ "diamonds-full-results.xml");
FileUtils.getFileUtils().copyFile(first, fullResultsFile);
XMLMerger merger = new XMLMerger(fullResultsFile);
- HashSet h = new HashSet(finalLogList);
- for (File f : h) {
+ HashSet fileHash = new HashSet(finalLogList);
+ for (File file : fileHash) {
try {
- merger.merge(f);
+ merger.merge(file);
} catch (XMLMerger.XMLMergerException xe) {
log.debug("Error during the merge: ", xe);
}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/StageDiamondsListener.java Wed Jun 16 16:51:40 2010 +0300
@@ -18,14 +18,14 @@
package com.nokia.helium.diamonds;
import org.apache.tools.ant.BuildEvent;
+
+
import org.apache.tools.ant.Target;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.BuildException;
-
-
-
import java.util.Date;
-
+import java.util.LinkedHashMap;
+import java.util.Set;
import java.util.HashMap;
import java.util.List;
import java.util.Enumeration;
@@ -35,11 +35,8 @@
import java.util.Vector;
import java.util.ArrayList;
import org.apache.log4j.Logger;
-
import com.nokia.helium.core.PropertiesSource;
import com.nokia.helium.core.TemplateInputSource;
-
-
import com.nokia.helium.core.XMLTemplateSource;
/**
@@ -57,15 +54,16 @@
private Map stageTargetEndMap = new HashMap();
+ private Map stageStartTargetMap = new HashMap();
+
+ private Map stageStartTargetTimeMap = new HashMap();
+
private boolean isTargetMapInitialized;
private Project project;
- private String currentStartTargetName;
-
private List stages;
- private Date currentStartTargetTime;
public StageDiamondsListener() {
stages = DiamondsConfig.getStages();
@@ -73,6 +71,7 @@
public void targetBegin(BuildEvent buildEvent) throws DiamondsException {
project = buildEvent.getProject();
+ int hashCode = project.hashCode();
String targetName = buildEvent.getTarget().getName();
if (!isTargetMapInitialized && stages != null) {
log
@@ -80,104 +79,150 @@
initStageTargetsMap();
isTargetMapInitialized = true;
}
- log.debug("targetBegin targetName: " + targetName + " - currentStartTargetName:" + currentStartTargetName);
- if (currentStartTargetName == null) {
- findAndSetStartTimeForTargetInStageList(targetName);
+ 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, int hasCode) {
+ String startTargetName = stage.getStartTargetName();
+ String endTargetName = stage.getEndTargetName();
+ 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 Stage getStageBasedOnEndTarget(String targetName, int hashCode) {
+ Stage stage = stageTargetEndMap.get(targetName);
+ if (stage != null) {
+ String currentStageTargetName = stageStartTargetMap.get(
+ stage.getStartTargetName() + "-" + hashCode);
+ log.debug("getStageBasedOnEndTarget: currentStargetTargetName" + currentStageTargetName);
+ if (currentStageTargetName != null) {
+ return stage;
+ }
+ }
+ return null;
+ }
@SuppressWarnings("unchecked")
public void targetEnd(BuildEvent buildEvent) throws DiamondsException {
- if (currentStartTargetName != null) {
- String targetName = buildEvent.getTarget().getName();
- Stage stage = stageTargetEndMap.get(targetName);
- if (stage != null && getIsInitialized() ) {
- //initDiamondsClient();
- String stageName = stage.getStageName();
- String sourceFile = stage.getSourceFile();
- log
- .debug("diamonds:StageDiamondsListener: finished recording for stage: "
- + stageName);
- if (sourceFile == null) {
- sourceFile = getSourceFile(stageName);
- }
- project.setProperty("logical.stage", stageName);
- project.setProperty("stage.start.time", getTimeFormat()
- .format(currentStartTargetTime));
- project.setProperty("stage.end.time", getTimeFormat()
- .format(new Date()));
- currentStartTargetName = null;
- // Look for template file with stage name
- String stageTemplateFileName = stageName + ".xml.ftl";
- File stageTemplateFile = new File(stageTemplateFileName);
- if (stageTemplateFile.exists()) {
- String output = DiamondsConfig.getOutputDir()
- + File.separator + stageName + ".xml";
- try {
- List sourceList = new ArrayList();
- sourceList.add(new PropertiesSource("ant", project
- .getProperties()));
- sourceList
- .add(new XMLTemplateSource("doc", new File(sourceFile)));
- getTemplateProcessor().convertTemplate(DiamondsConfig
- .getTemplateDir(), stageTemplateFileName,
- output, sourceList);
- mergeToFullResults(new File(output));
-
- // String mergedFile = mergeFiles(new File(output));
-
- log.info("Sending data to diamonds for stage: "
- + stageName);
- getDiamondsClient().sendData(output, DiamondsConfig
- .getDiamondsProperties().getDiamondsBuildID());
- } catch (com.nokia.helium.core.TemplateProcessorException e1) {
- throw new DiamondsException(
- "template conversion error for stage: "
- + stageName + " : " + e1.getMessage());
- }
- } else {
- log.debug("diamonds:StageDiamondsListener:tempalte file: "
- + stageTemplateFile + " does not exist");
- }
-
- String output = DiamondsConfig.getOutputDir() + File.separator
- + stageName + "-time.xml";
- // Store the time for the current stage and send it
- stageTemplateFileName = "diamonds_stage.xml.ftl";
+ String targetName = buildEvent.getTarget().getName();
+ project = buildEvent.getProject();
+ int hashCode = project.hashCode();
+ String targetNameWithHashCode = targetName + "-" + hashCode;
+ log.debug("targetEnd: targetNamewith-hashcode: " + targetNameWithHashCode);
+
+ Stage stage = getStageBasedOnEndTarget(targetName, hashCode);
+ if (stage != null && getIsInitialized() ) {
+ //initDiamondsClient();
+ String stageName = stage.getStageName();
+ String sourceFile = stage.getSourceFile();
+ log.debug("targetEnd: stageName: " + stageName);
+ log
+ .debug("diamonds:StageDiamondsListener: finished recording for stage: "
+ + stageName);
+ if (sourceFile == null) {
+ sourceFile = getSourceFile(stageName);
+ }
+ log.debug("targetEnd: logical.stage: " + stageName);
+ Date startTime = getStartTime(stage, hashCode);
+ log.debug("targetEnd: starttime: " + startTime);
+ log.debug("targetEnd: endtime: " +
+ getTimeFormat().format(new Date()));
+ project.setProperty("logical.stage", stageName);
+ project.setProperty("stage.start.time", getTimeFormat()
+ .format(startTime));
+ project.setProperty("stage.end.time", getTimeFormat()
+ .format(new Date()));
+ // Look for template file with stage name
+ String stageTemplateFileName = stageName + ".xml.ftl";
+ File stageTemplateFile = new File(stageTemplateFileName);
+ if (stageTemplateFile.exists()) {
+ String output = DiamondsConfig.getOutputDir()
+ + File.separator + stageName + ".xml";
try {
List sourceList = new ArrayList();
sourceList.add(new PropertiesSource("ant", project
.getProperties()));
- sourceList.add(new XMLTemplateSource("doc", new File(sourceFile)));
+ sourceList
+ .add(new XMLTemplateSource("doc", new File(sourceFile)));
getTemplateProcessor().convertTemplate(DiamondsConfig
- .getTemplateDir(), stageTemplateFileName, output,
- sourceList);
+ .getTemplateDir(), stageTemplateFileName,
+ output, sourceList);
mergeToFullResults(new File(output));
- // List filesToMerge = new ArrayList();
-
- // mergedFile = mergeFiles(output);
+ log.info("Sending data to diamonds for stage: "
+ + stageName);
getDiamondsClient().sendData(output, DiamondsConfig
.getDiamondsProperties().getDiamondsBuildID());
} catch (com.nokia.helium.core.TemplateProcessorException e1) {
- throw new DiamondsException("template conversion error while sending data for stage: "
- + stageName + " : " + e1.getMessage());
+ throw new DiamondsException(
+ "template conversion error for stage: "
+ + stageName + " : " + e1.getMessage());
}
+ } else {
+ log.debug("diamonds:StageDiamondsListener:tempalte file: "
+ + stageTemplateFile + " does not exist");
+ }
+
+ String output = DiamondsConfig.getOutputDir() + File.separator
+ + stageName + "-time.xml";
+ log.debug("targetEnd: output " + output);
+ // Store the time for the current stage and send it
+ stageTemplateFileName = "diamonds_stage.xml.ftl";
+ try {
+ List sourceList = new ArrayList();
+ sourceList.add(new PropertiesSource("ant", project
+ .getProperties()));
+ sourceList.add(new XMLTemplateSource("doc", new File(sourceFile)));
+ getTemplateProcessor().convertTemplate(DiamondsConfig
+ .getTemplateDir(), stageTemplateFileName, output,
+ sourceList);
+ mergeToFullResults(new File(output));
+ // List filesToMerge = new ArrayList();
+
+ // mergedFile = mergeFiles(output);
+ getDiamondsClient().sendData(output, DiamondsConfig
+ .getDiamondsProperties().getDiamondsBuildID());
+ } catch (com.nokia.helium.core.TemplateProcessorException e1) {
+ throw new DiamondsException("template conversion error while sending data for stage: "
+ + stageName + " : " + e1.getMessage());
}
}
}
- private void findAndSetStartTimeForTargetInStageList(String targetName)
- throws DiamondsException {
+ 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: "
+ 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());
- currentStartTargetName = targetName;
- currentStartTargetTime = new Date();
+ stageStartTargetMap.put(targetNameWithHashCode, targetName);
+ stageStartTargetTimeMap.put(targetNameWithHashCode, new Date());
}
}
}
@@ -189,7 +234,7 @@
// stage begin process
Stage stage = iter.next();
String startTargetName = stage.getStartTargetName();
- Map stageMap = new HashMap();
+ Map stageMap = new LinkedHashMap();
Vector arrayList = null;
try {
arrayList = project.topoSort(startTargetName, project
@@ -211,6 +256,13 @@
// stage end process
String endTargetName = stage.getEndTargetName();
// fast lookup
+ Stage existingStage = stageTargetEndMap.get(endTargetName);
+ if (existingStage != null) {
+ throw new BuildException("Not supported: two stages with" +
+ "same ending target defined by:stage1: " +
+ existingStage.getStageName() +
+ "stage2: " + stage.getStageName());
+ }
stageTargetEndMap.put(endTargetName, stage);
log.debug(" - End target: " + endTargetName);
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/XMLMerger.java
--- a/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/XMLMerger.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/XMLMerger.java Wed Jun 16 16:51:40 2010 +0300
@@ -100,22 +100,22 @@
@SuppressWarnings("unchecked")
protected void mergeNode(Element dest, Element src) {
for (Iterator node = src.elements().iterator(); node.hasNext();) {
- Element e = node.next();
+ Element element = node.next();
- List ses = dest.elements(e.getName());
+ List ses = dest.elements(element.getName());
boolean add = true;
for (Element se : ses) {
- if (areSame(se, e)) {
- log.debug("Element " + e.getName() + " already found in dest.");
+ if (areSame(se, element)) {
+ log.debug("Element " + element.getName() + " already found in dest.");
add = false;
}
}
if (add) {
- log.debug("Adding node " + e.getName() + " to " + dest.getName());
- dest.add(e.detach());
+ log.debug("Adding node " + element.getName() + " to " + dest.getName());
+ dest.add(element.detach());
} else if (ses.size() > 0) {
- log.debug("Merging " + ses.get(0).getName() + " to " + e.getName());
- mergeNode(ses.get(0), e);
+ log.debug("Merging " + ses.get(0).getName() + " to " + element.getName());
+ mergeNode(ses.get(0), element);
}
}
}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/src/com/nokia/helium/diamonds/ant/HeliumListener.java Wed Jun 16 16:51:40 2010 +0300
@@ -229,9 +229,9 @@
private void cleanup() {
String loggingoutputfile = project.getProperty("logging.output.file");
if (loggingoutputfile != null) {
- File f = new File(loggingoutputfile);
- if (f.exists())
- f.delete();
+ File file = new File(loggingoutputfile);
+ if (file.exists())
+ file.delete();
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/antunit/run-scenario.ant.xml
--- a/buildframework/helium/sf/java/diamonds/tests/antunit/run-scenario.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/tests/antunit/run-scenario.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -24,7 +24,7 @@
Helium Antlib logger macro.
-
+
@@ -36,15 +36,16 @@
+
-
+
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/antunit/test_diamonds.ant.xml
--- a/buildframework/helium/sf/java/diamonds/tests/antunit/test_diamonds.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/tests/antunit/test_diamonds.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -25,7 +25,7 @@
-
+
@@ -43,5 +43,10 @@
+
+
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/config/diamonds_config.xml.ftl
--- a/buildframework/helium/sf/java/diamonds/tests/config/diamonds_config.xml.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/tests/config/diamonds_config.xml.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -43,10 +43,25 @@
-
+
+
+
+
+
+
+
+
#list>
#if>
-${count}#macro>
\ No newline at end of file
+${count}
+#macro>
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/scenarii/build/build.xml
--- a/buildframework/helium/sf/java/diamonds/tests/scenarii/build/build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/build/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -40,6 +40,7 @@
+
@@ -155,8 +156,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ test-invalid-target-input-file,test-invalid-stage-input-file, test-depend-target,
+ test-ant-call, test-ant-call-multiple, test-ant-call-multiple-parallel,
+ sequence-config-test-target-1,sequence-config-test-target-2 " />
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-address/build.xml
--- a/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-address/build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-address/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -20,7 +20,7 @@
============================================================================
-->
-
+
Helium Antlib diamonds unittests.
@@ -29,7 +29,7 @@
-
+
@@ -43,7 +43,6 @@
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates-1/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates-1/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,53 @@
+
+
+
+ Helium Antlib diamonds unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates-1/diamonds_config.xml.ftl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates-1/diamonds_config.xml.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates/build.xml
--- a/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates/build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/diamonds/tests/scenarii/invalid-templates/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -20,11 +20,11 @@
============================================================================
-->
-
+
Helium Antlib diamonds unittests.
-
+
@@ -40,7 +40,6 @@
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/Command.java
--- a/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/Command.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/Command.java Wed Jun 16 16:51:40 2010 +0300
@@ -139,8 +139,8 @@
for (String arg : getArguments()) {
cmdLine += " " + arg;
}
- for (Entry e : getVariables().entrySet()) {
- cmdLine += " " + e.getKey() + "=" + e.getValue();
+ for (Entry varEnum : getVariables().entrySet()) {
+ cmdLine += " " + varEnum.getKey() + "=" + varEnum.getValue();
}
cmdLine += " " + getTarget();
return cmdLine;
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/engines/JavaEngine.java
--- a/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/engines/JavaEngine.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/engines/JavaEngine.java Wed Jun 16 16:51:40 2010 +0300
@@ -138,11 +138,11 @@
File tempDir = imaker.createWorkDir();
args.add("WORKDIR=" + tempDir.getAbsolutePath());
// Pushing custom variables
- for (Entry e : cmd.getVariables().entrySet()) {
- if (e.getKey().equals("WORKDIR")) {
+ for (Entry cmdEnum : cmd.getVariables().entrySet()) {
+ if (cmdEnum.getKey().equals("WORKDIR")) {
task.log("WORKDIR cannot be defined by the user, the value will be ignored.", Project.MSG_WARN);
} else {
- args.add(e.getKey() + "=" + e.getValue());
+ args.add(cmdEnum.getKey() + "=" + cmdEnum.getValue());
}
}
// Setting the target
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/engines/build_imaker_roms_signing.mk.ftl
--- a/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/engines/build_imaker_roms_signing.mk.ftl Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/engines/build_imaker_roms_signing.mk.ftl Wed Jun 16 16:51:40 2010 +0300
@@ -54,11 +54,11 @@
<#list cmds as cmd>
<#assign cmdline="">
<#list cmd.getArguments() as arg>
- <#assign cmdline="${cmdline} ${arg}">
+ <#assign cmdline="${cmdline} \"${arg}\"">
#list>
<#assign vars=cmd.getVariables()>
<#list vars?keys as var>
- <#assign cmdline="${cmdline} ${var}=${vars[var]}">
+ <#assign cmdline="${cmdline} \"${var}=${vars[var]}\"">
#list>
@echo $(call iif,$(USE_UNIX),,cmd /c) ${cmd.getCommand()} WORKDIR=$(ROMBUILD_TEMPDIR)/config_${iid} ${cmdline} ${cmd.getTarget()}-dir >> $(ROMBUILD_TEMPDIR)/command-dir-list-${cid}.txt
<#assign iid=iid+1>
@@ -70,11 +70,11 @@
<#list cmds as cmd>
<#assign cmdline="">
<#list cmd.getArguments() as arg>
- <#assign cmdline="${cmdline} ${arg}">
+ <#assign cmdline="${cmdline} \"${arg}\"">
#list>
<#assign vars=cmd.getVariables()>
<#list vars?keys as var>
- <#assign cmdline="${cmdline} ${var}=${vars[var]}">
+ <#assign cmdline="${cmdline} \"${var}=${vars[var]}\"">
#list>
#
# Building configuration ${iid}.
@@ -104,11 +104,11 @@
<#list cmds as cmd>
<#assign cmdline="">
<#list cmd.getArguments() as arg>
- <#assign cmdline="${cmdline} ${arg}">
+ <#assign cmdline="${cmdline} \"${arg}\"">
#list>
<#assign vars=cmd.getVariables()>
<#list vars?keys as var>
- <#assign cmdline="${cmdline} ${var}=${vars[var]}">
+ <#assign cmdline="${cmdline} \"${var}=${vars[var]}\"">
#list>
@echo $(call iif,$(USE_UNIX),,cmd /c) ${cmd.getCommand()} WORKDIR=$(ROMBUILD_TEMPDIR)/config_${iid} ${cmdline} ${cmd.getTarget()}-e2flash >> $(ROMBUILD_TEMPDIR)/command-e2flash-list-${cid}.txt
<#assign iid=iid+1>
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/taskdefs/IMakerTask.java
--- a/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/taskdefs/IMakerTask.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/taskdefs/IMakerTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -115,6 +115,10 @@
engine.setTask(this);
return engine;
} else {
+ log("Using engine: " + engineRefId);
+ if (this.getProject().getReference(engineRefId) == null) {
+ throw new BuildException("Could not find engine reference: '" + engineRefId + "'.");
+ }
try {
Engine engine = (Engine)this.getProject().getReference(engineRefId);
engine.setTask(this);
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/utils/ParallelExecutor.java
--- a/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/utils/ParallelExecutor.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/utils/ParallelExecutor.java Wed Jun 16 16:51:40 2010 +0300
@@ -71,10 +71,10 @@
for (int i = 0; st.hasMoreTokens(); i++) {
cmdArray[i] = st.nextToken();
}
- Process p;
+ Process process;
try {
- p = new ProcessBuilder(cmdArray).redirectErrorStream(true).start();
- BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ process = new ProcessBuilder(cmdArray).redirectErrorStream(true).start();
+ BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
StringBuffer buffer = new StringBuffer();
SimpleDateFormat df = new SimpleDateFormat("EEE MMM d HH:mm:ss yyyy");
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/imaker/tests/antunit/test_imaker.ant.xml
--- a/buildframework/helium/sf/java/imaker/tests/antunit/test_imaker.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/imaker/tests/antunit/test_imaker.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -278,4 +278,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/imaker/tests/antunit/test_imaker_drive_letter.ant.xml
--- a/buildframework/helium/sf/java/imaker/tests/antunit/test_imaker_drive_letter.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/imaker/tests/antunit/test_imaker_drive_letter.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -41,13 +41,15 @@
-------------------------------------------------------------------------------
-
+
+
Usin custom epocroot.
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/bin/com/nokia/helium/internaldata/ant/antlib.xml
--- a/buildframework/helium/sf/java/internaldata/bin/com/nokia/helium/internaldata/ant/antlib.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-
-
-
-
-
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/bin/com/nokia/helium/internaldata/ant/helium.antlib.xml
--- a/buildframework/helium/sf/java/internaldata/bin/com/nokia/helium/internaldata/ant/helium.antlib.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-
-
-
-
- Ant task definition declarations.
-
-
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/antlib.xml
--- a/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/antlib.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -22,5 +22,5 @@
-->
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/AssertNode.java
--- a/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/AssertNode.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/AssertNode.java Wed Jun 16 16:51:40 2010 +0300
@@ -18,7 +18,7 @@
package com.nokia.helium.internaldata.ant.listener;
//import com.nokia.ant.taskdefs.HlmAssertMessage;
-import com.nokia.helium.internaldata.ant.taskdefs.HlmAssertMessage;
+import com.nokia.helium.internaldata.ant.taskdefs.HlmAssertMessageTask;
/**
* Object to set end time for a task.
*
@@ -34,7 +34,7 @@
private int line = -1;
private String assertName;
- public AssertNode(DataNode parent, HlmAssertMessage task) {
+ public AssertNode(DataNode parent, HlmAssertMessageTask task) {
super(parent, task);
name = task.getTaskName();
this.setFilename(task.getLocation().getFileName());
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/Listener.java
--- a/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/Listener.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/Listener.java Wed Jun 16 16:51:40 2010 +0300
@@ -19,7 +19,7 @@
import java.util.Hashtable;
import java.util.Date;
-import com.nokia.helium.internaldata.ant.taskdefs.HlmAssertMessage;
+import com.nokia.helium.internaldata.ant.taskdefs.HlmAssertMessageTask;
import org.apache.tools.ant.BuildEvent;
import org.apache.tools.ant.BuildListener;
import org.apache.tools.ant.Project;
@@ -187,7 +187,7 @@
// Ignoring task information
}
- public void addAssertTask(HlmAssertMessage assertTask) {
+ public void addAssertTask(HlmAssertMessageTask assertTask) {
if (buildNode != null) {
DataNode parentNode = buildNode.find(assertTask.getOwningTarget());
if (parentNode != null) {
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/XMLRenderer.java
--- a/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/XMLRenderer.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/listener/XMLRenderer.java Wed Jun 16 16:51:40 2010 +0300
@@ -191,8 +191,8 @@
protected void createProperties(Element statistics) {
Element propertiesElt = statistics.addElement("properties");
if (properties != null) {
- for (Enumeration e = properties.keys(); e.hasMoreElements() ; ) {
- String key = e.nextElement();
+ for (Enumeration propertyEnum = properties.keys(); propertyEnum.hasMoreElements() ; ) {
+ String key = propertyEnum.nextElement();
Element propertyElt = propertiesElt.addElement("property");
propertyElt.addAttribute("name", key);
propertyElt.addAttribute("value", properties.get(key));
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/taskdefs/HlmAssertMessage.java
--- a/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/taskdefs/HlmAssertMessage.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +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.internaldata.ant.taskdefs;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.BuildException;
-import com.nokia.helium.internaldata.*;
-import com.nokia.helium.internaldata.ant.listener.Listener;
-
-import javax.naming.*;
-import javax.naming.directory.*;
-
-/**
- * Task to identify failing assert.
- *
- * Usage: <hlm:hlmassertmessage assertName="hlm:assertPropertySet" message="Warning: @{message}"/>
- */
-
-public class HlmAssertMessage extends Task {
-
- private String message;
- private String assertName;
-
- public void execute() {
-
- if (assertName == null)
- throw new BuildException("'assertName' attribute is not defined");
- if (message == null)
- throw new BuildException("'message' attribute is not defined");
-
- for (int i = 0 ; i < getProject().getBuildListeners().size() ; i++) {
- if (getProject().getBuildListeners().get(i) instanceof Listener) {
- Listener listen = (Listener)getProject().getBuildListeners().get(i);
- listen.addAssertTask(this);
- break;
- }
- }
- }
- /**
- * Returns assert name.
- * @return
- */
- public String getAssertName()
- {
- return assertName;
- }
- /**
- * Set the assertname.
- * @param assertName
- */
- public void setAssertName(String assertName)
- {
- this.assertName = assertName;
- }
- /**
- * Return the assert message.
- * @return
- */
- public String getMessage()
- {
- return message;
- }
- /**
- * Set the assert message.
- * @param message
- */
- public void setMessage(String message)
- {
- this.message = message;
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/taskdefs/HlmAssertMessageTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/internaldata/src/com/nokia/helium/internaldata/ant/taskdefs/HlmAssertMessageTask.java Wed Jun 16 16:51:40 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.internaldata.ant.taskdefs;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.BuildException;
+import com.nokia.helium.internaldata.ant.listener.Listener;
+
+
+/**
+ * Task to identify failing assert and push them to the internal data database.
+ *
+ * Usage:
+ *
+ * <hlm:hlmassertmessage assertName="hlm:assertPropertySet" message="Warning: @{message}"/>
+ *
+ *
+ * @ant.task name=hlmassertmessage category=internaldata
+ */
+public class HlmAssertMessageTask extends Task {
+
+ private String message;
+ private String assertName;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute() {
+
+ if (assertName == null)
+ throw new BuildException("'assertName' attribute is not defined");
+ if (message == null)
+ throw new BuildException("'message' attribute is not defined");
+
+ for (int i = 0 ; i < getProject().getBuildListeners().size() ; i++) {
+ if (getProject().getBuildListeners().get(i) instanceof Listener) {
+ Listener listen = (Listener)getProject().getBuildListeners().get(i);
+ listen.addAssertTask(this);
+ break;
+ }
+ }
+ }
+ /**
+ * Returns assert name.
+ * @return
+ */
+ public String getAssertName()
+ {
+ return assertName;
+ }
+ /**
+ * Set the assertname.
+ * @param assertName
+ */
+ public void setAssertName(String assertName)
+ {
+ this.assertName = assertName;
+ }
+ /**
+ * Return the assert message.
+ * @return
+ */
+ public String getMessage()
+ {
+ return message;
+ }
+ /**
+ * Set the assert message.
+ * @param message
+ */
+ public void setMessage(String message)
+ {
+ this.message = message;
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/internaldata/tests/antunit/test_HlmAssertMessage.ant.xml
--- a/buildframework/helium/sf/java/internaldata/tests/antunit/test_HlmAssertMessage.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/internaldata/tests/antunit/test_HlmAssertMessage.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -23,15 +23,14 @@
Helium Antlib internal unittests.
-
-
+
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMEntityManager.java
--- a/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMEntityManager.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMEntityManager.java Wed Jun 16 16:51:40 2010 +0300
@@ -129,7 +129,7 @@
* @return entity manager
*/
public EntityManager getEntityManager() {
- log.debug("ORMEntityManager: getEntityManager: " + entityManager);
+ //log.debug("ORMEntityManager: getEntityManager: " + entityManager);
return entityManager;
}
@@ -178,11 +178,13 @@
entityManager = null;
}
if (factory != null) {
+ log.debug("closing the factory");
factory.close();
factory = null;
}
// Shutting down the derby database access, so files get unlocked.
try {
+ log.debug("shutting down the db");
DriverManager.getConnection("jdbc:derby:" + urlPath + ";shutdown=true");
} catch (SQLException e) {
log.debug(e.getMessage());
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMReader.java
--- a/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMReader.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMReader.java Wed Jun 16 16:51:40 2010 +0300
@@ -22,7 +22,7 @@
import org.apache.log4j.Logger;
import java.util.List;
import javax.persistence.Query;
-
+import javax.persistence.FlushModeType;
/**
* This class provides an interface to read data from the
* database using JPA.
@@ -36,11 +36,14 @@
private ORMEntityManager manager;
private int startPos;
+
+ private String dbPath;
/**Constructor:
* @param dbPath - path of the database to connect to.
*/
- public ORMReader(String dbPath) {
+ public ORMReader(String path) {
+ dbPath = path;
ORMUtil.initializeORM(dbPath);
manager = ORMUtil.getEntityManager(dbPath);
}
@@ -54,28 +57,31 @@
*/
public List executeNativeQuery(String queryString, String type) {
int maxResults = READ_CACHE_LIMIT;
- String queryWithSubSet = queryString + " OFFSET " + startPos +
- " ROWS FETCH FIRST " + maxResults + " ROW ONLY";
- Query query = null;
- if (type != null) {
- try {
- query = manager.getEntityManager().createNativeQuery(queryWithSubSet,
- Class.forName(type));
- } catch (ClassNotFoundException ex) {
- log.debug("Exception during native query", ex);
+ Object mutexObject = ORMUtil.getMutexObject();
+ synchronized (mutexObject) {
+ String queryWithSubSet = queryString + " OFFSET " + startPos +
+ " ROWS FETCH FIRST " + maxResults + " ROW ONLY";
+ Query query = null;
+ if (type != null) {
+ try {
+ query = manager.getEntityManager().createNativeQuery(queryWithSubSet,
+ Class.forName(type));
+ } catch (ClassNotFoundException ex) {
+ log.debug("Exception during native query", ex);
+ }
+ } else {
+ query = manager.getEntityManager().createNativeQuery(queryWithSubSet);
}
- } else {
- query = manager.getEntityManager().createNativeQuery(queryWithSubSet);
+ query.setHint("eclipselink.maintain-cache", "false");
+ List results = query.getResultList();
+ int resultsSize = results.size();
+ if (resultsSize == 0 || resultsSize < READ_CACHE_LIMIT) {
+ startPos += resultsSize;
+ } else {
+ startPos += maxResults;
+ }
+ return results;
}
- query.setHint("eclipselink.maintain-cache", "false");
- List results = query.getResultList();
- int resultsSize = results.size();
- if (resultsSize == 0 || resultsSize < READ_CACHE_LIMIT) {
- startPos += resultsSize;
- } else {
- startPos += maxResults;
- }
- return results;
}
/**
@@ -85,20 +91,23 @@
* @return an Object of return type.
*/
public Object executeSingleResult(String queryString, String type) {
- log.debug("executeSingleResult: " + queryString);
- Query query = manager.getEntityManager().createQuery(queryString);
- query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
- query.setHint("eclipselink.maintain-cache", "false");
- query.setHint("eclipselink.read-only", "true");
- Object obj = null;
- try {
- obj = query.getSingleResult();
- } catch (javax.persistence.NoResultException nex) {
- log.debug("no results:", nex);
- } catch (javax.persistence.NonUniqueResultException nux) {
- log.debug("more than one result returned:", nux);
+ Object mutexObject = ORMUtil.getMutexObject();
+ synchronized (mutexObject) {
+ Query query = manager.getEntityManager().createQuery(queryString);
+ query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
+ query.setHint("eclipselink.maintain-cache", "false");
+ query.setHint("eclipselink.read-only", "true");
+ query.setFlushMode(FlushModeType.COMMIT);
+ Object obj = null;
+ try {
+ obj = query.getSingleResult();
+ } catch (javax.persistence.NoResultException nex) {
+ log.debug("no results:", nex);
+ } catch (javax.persistence.NonUniqueResultException nux) {
+ log.debug("more than one result returned:", nux);
+ }
+ return obj;
}
- return obj;
}
/**
@@ -106,22 +115,29 @@
* @param queryString - jpa query string
* @return List of objects read from database.
*/
- public List executeQuery (String queryString) {
- int maxResults = READ_CACHE_LIMIT;
- Query query = manager.getEntityManager().createQuery(queryString);
- query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
- query.setHint("eclipselink.maintain-cache", "false");
- query.setHint("eclipselink.read-only", "true");
- query.setFirstResult(startPos);
- query.setMaxResults(maxResults);
- List results = (List) query.getResultList();
- int resultsSize = results.size();
- log.debug("result size: " + resultsSize);
- if (results.size() == 0 || resultsSize < READ_CACHE_LIMIT) {
- startPos += resultsSize;
- } else {
- startPos += maxResults;
+ public List executeQuery(String queryString) {
+ Object mutexObject = ORMUtil.getMutexObject();
+ synchronized (mutexObject) {
+ int maxResults = READ_CACHE_LIMIT;
+ Query query = manager.getEntityManager().createQuery(queryString);
+ query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
+ query.setHint("eclipselink.maintain-cache", "false");
+ query.setHint("eclipselink.read-only", "true");
+ query.setFirstResult(startPos);
+ query.setMaxResults(maxResults);
+ List results = (List) query.getResultList();
+ int resultsSize = results.size();
+ log.debug("result size: " + resultsSize);
+ if (results.size() == 0 || resultsSize < READ_CACHE_LIMIT) {
+ startPos += resultsSize;
+ } else {
+ startPos += maxResults;
+ }
+ return results;
}
- return results;
+ }
+
+ public void close() {
+ ORMUtil.finalizeORM(dbPath);
}
}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMUtil.java
--- a/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMUtil.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/ORMUtil.java Wed Jun 16 16:51:40 2010 +0300
@@ -38,6 +38,10 @@
private static HashMap emMap =
new HashMap();
+ private static HashMap emMapCount =
+ new HashMap();
+
+ private static Object mutexObject = new Object();
private ORMUtil() {
}
@@ -50,13 +54,22 @@
log.debug("initializeORM: urlpath: " + urlPath);
if (manager == null) {
try {
+ log.debug("initializing for the first time");
manager = new ORMEntityManager(urlPath);
emMap.put(urlPath, manager);
+ Integer countObj = new Integer(1);
+ emMapCount.put(urlPath, countObj);
log.debug("initializeORM: manager: " + manager);
log.debug("initializeORM: manager: " + manager.getEntityManager());
} catch ( IOException ex ) {
throw new BuildException("Entity Manager creation failure");
}
+ } else {
+ Integer countObj = emMapCount.get(urlPath);
+ log.debug("object exists and incrementing the value");
+ countObj = new Integer(countObj.intValue() + 1);
+ log.debug("object exists count value: " + countObj.intValue());
+ emMapCount.put(urlPath, countObj);
}
}
@@ -64,7 +77,7 @@
* Helper Function to return the entity manager.
* @return entity manager created during initialization.
*/
- public static ORMEntityManager getEntityManager(String urlPath) {
+ public static synchronized ORMEntityManager getEntityManager(String urlPath) {
log.debug("getEntityManager: urlpath: " + urlPath);
ORMEntityManager manager = emMap.get(urlPath);
if (manager != null) {
@@ -80,14 +93,30 @@
/**
* Finalize the entity manager and release all the objects.
*/
- public static void finalizeORM(String urlPath) {
+ public static synchronized void finalizeORM(String urlPath) {
ORMEntityManager manager = emMap.get(urlPath);
log.debug("finalizeORM: urlpath: " + urlPath);
if (manager != null) {
- manager.finalizeEntityManager();
- manager = null;
- log.debug("finalizeORM: manager" + manager);
- emMap.remove(urlPath);
+ Integer countObj = emMapCount.get(urlPath);
+ if (countObj != null) {
+ int count = countObj.intValue();
+ count = count - 1;
+ if (count > 0) {
+ countObj = new Integer(count);
+ log.debug("countOBj value: " + countObj.intValue());
+ emMapCount.put(urlPath, countObj);
+ } else {
+ manager.finalizeEntityManager();
+ manager = null;
+ log.debug("finalizeORM: manager" + manager);
+ emMap.remove(urlPath);
+ emMapCount.remove(urlPath);
+ }
+ }
}
}
+
+ public static Object getMutexObject() {
+ return mutexObject;
+ }
}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/entity/metadata/Metadata.java
--- a/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/entity/metadata/Metadata.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/entity/metadata/Metadata.java Wed Jun 16 16:51:40 2010 +0300
@@ -35,6 +35,7 @@
import javax.persistence.Query;
import javax.persistence.CascadeType;
import com.nokia.helium.jpa.ORMCommitCount;
+import com.nokia.helium.jpa.ORMUtil;
import com.nokia.helium.jpa.ORMEntityManager;
/**
@@ -236,9 +237,10 @@
private void loadFromDB(String path) {
LogFile logFile = null;
logFiles = new Hashtable();
+ Query query = manager.getEntityManager().createQuery("SELECT l FROM LogFile l");
+ query.setFlushMode(FlushModeType.COMMIT);
List logFilesList =
- (List) manager.getEntityManager().createQuery(
- "SELECT l FROM LogFile l").getResultList();
+ (List) query.getResultList();
for (LogFile file : logFilesList) {
log.debug("getting logfile from db: " + file.getPath());
logFiles.put(file.getPath(), file);
@@ -260,18 +262,20 @@
* @param obj - object to be stored in the data.
*/
private void persist(Object obj) {
- synchronized (manager) {
- EntityManager em = manager.getEntityManager();
- ORMCommitCount countObject = manager.getCommitCountObject();
- //log.debug("object: " + obj);
- //log.debug("object: " + em);
- em.persist(obj);
- countObject.decreaseCount();
- if (countObject.isCommitRequired()) {
- countObject.reset();
- em.getTransaction().commit();
- em.clear();
- em.getTransaction().begin();
+ Object mutexObject = ORMUtil.getMutexObject();
+ synchronized (mutexObject) {
+ synchronized (manager) {
+ EntityManager em = manager.getEntityManager();
+ ORMCommitCount countObject = manager.getCommitCountObject();
+ //log.debug("object: " + em);
+ em.persist(obj);
+ countObject.decreaseCount();
+ if (countObject.isCommitRequired()) {
+ countObject.reset();
+ em.getTransaction().commit();
+ em.clear();
+ em.getTransaction().begin();
+ }
}
}
}
@@ -315,11 +319,13 @@
* Internal function to cache the logpath for performance.
*/
private void initializeLogPath() {
- EntityManager em = manager.getEntityManager();
- Query q = em.createQuery("select m from LogFile m");
+ EntityManager entityManager = manager.getEntityManager();
+ Query query = entityManager.createQuery("select m from LogFile m");
+ query.setFlushMode(FlushModeType.COMMIT);
+
name = "metadata";
- if (q.getResultList().size() == 0) {
- log.debug("query result: size" + q.getResultList().size());
+ if (query.getResultList().size() == 0) {
+ log.debug("query result: size" + query.getResultList().size());
populatePriorities();
populateDB(logPath);
} else {
@@ -474,7 +480,7 @@
private void addMetadata(String priority, Component component,
int lineNo, String logText) {
MetadataEntry entry = new MetadataEntry();
- log.debug("logfile : " + component.getLogFile().getPath());
+ log.debug("logfile: " + component.getLogFile().getPath());
entry.setLogFile(component.getLogFile());
entry.setComponent(component);
entry.setLineNumber(lineNo);
@@ -489,7 +495,6 @@
* priority.
*/
public final void removeEntries() {
- EntityManager em = manager.getEntityManager();
LogFile file = (LogFile)executeSingleQuery("select l from LogFile l where l.path like '%" + logPath + "'");
if ( file != null ) {
log.debug("removing entries for : " + file.getPath());
@@ -510,19 +515,22 @@
* @return object - record from the executed query.
*/
private Object executeSingleQuery (String queryString) {
- EntityManager em = manager.getEntityManager();
- Query query = em.createQuery(queryString);
- query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
- query.setHint("eclipselink.maintain-cache", "false");
- query.setHint("eclipselink.read-only", "true");
- query.setFlushMode(FlushModeType.COMMIT);
+ Object mutexObject = ORMUtil.getMutexObject();
Object obj = null;
- try {
- obj = query.getSingleResult();
- } catch (javax.persistence.NoResultException nex) {
- log.debug("no results for query: " + queryString, nex);
- } catch (javax.persistence.NonUniqueResultException nux) {
- log.debug("more than one result returned by query: " + queryString, nux);
+ synchronized (mutexObject) {
+ EntityManager em = manager.getEntityManager();
+ Query query = em.createQuery(queryString);
+ query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
+ query.setHint("eclipselink.maintain-cache", "false");
+ query.setHint("eclipselink.read-only", "true");
+ query.setFlushMode(FlushModeType.COMMIT);
+ try {
+ obj = query.getSingleResult();
+ } catch (javax.persistence.NoResultException nex) {
+ log.debug("no results for query: " + queryString, nex);
+ } catch (javax.persistence.NonUniqueResultException nux) {
+ log.debug("more than one result returned by query: " + queryString, nux);
+ }
}
return obj;
}
@@ -532,19 +540,22 @@
* @param queryString - query string for whcih the result to be obtained.
*/
private void removeEntries(String queryString) {
- EntityManager em = manager.getEntityManager();
- Query query = em.createNativeQuery(queryString);
- query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
- query.setHint("eclipselink.maintain-cache", "false");
- query.setFlushMode(FlushModeType.COMMIT);
- try {
- int deletedRecords = query.executeUpdate();
- log.debug("total records deleted " + deletedRecords
- + "for query:" + queryString);
- } catch (javax.persistence.NoResultException nex) {
- log.debug("no results:", nex);
- } catch (javax.persistence.NonUniqueResultException nux) {
- log.debug("more than one result returned:", nux);
+ Object mutexObject = ORMUtil.getMutexObject();
+ synchronized (mutexObject) {
+ EntityManager em = manager.getEntityManager();
+ Query query = em.createNativeQuery(queryString);
+ query.setHint("eclipselink.persistence-context.reference-mode", "WEAK");
+ query.setHint("eclipselink.maintain-cache", "false");
+ query.setFlushMode(FlushModeType.COMMIT);
+ try {
+ int deletedRecords = query.executeUpdate();
+ log.debug("total records deleted " + deletedRecords
+ + "for query:" + queryString);
+ } catch (javax.persistence.NoResultException nex) {
+ log.debug("no results:", nex);
+ } catch (javax.persistence.NonUniqueResultException nux) {
+ log.debug("more than one result returned:", nux);
+ }
}
}
@@ -567,7 +578,7 @@
private float elapsedTime;
- private String priroityText;
+ private String priorityText;
private WhatEntry whatEntry;
@@ -604,7 +615,7 @@
int lineNumber, float time, WhatEntry entry) {
PriorityEnum prty = null;
String prtyText = priorityTxt.trim().toLowerCase();
- priroityText = prtyText;
+ priorityText = prtyText;
if (prtyText.equals("error")) {
prty = PriorityEnum.ERROR;
} else if (prtyText.equals("warning")) {
@@ -622,7 +633,7 @@
} else {
log.debug("Error: priority " + prtyText + " is not acceptable by metadata and set to Error");
prty = PriorityEnum.ERROR;
- priroityText = "error";
+ priorityText = "error";
//throw new Exception("priority should not be null");
}
@@ -647,7 +658,6 @@
{
return logPath;
}
-
public int getLineNumber()
{
@@ -670,7 +680,7 @@
}
public String getPriorityText() {
- return priroityText;
+ return priorityText;
}
public float getElapsedTime() {
@@ -696,6 +706,10 @@
return whatEntry;
}
+ public String toString() {
+ return "file:" + logPath + "[" + lineNumber + "], component:" + component + ", priority:" +
+ priorityText + " \n" + text;
+ }
}
/** Levels of log entry types. */
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/entity/metadata/MetadataUtil.java
--- a/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/entity/metadata/MetadataUtil.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/jpa/src/com/nokia/helium/jpa/entity/metadata/MetadataUtil.java Wed Jun 16 16:51:40 2010 +0300
@@ -69,9 +69,11 @@
* Finalize the orm, calls ORMUtil finalize function to close
* entity manager.
*/
- public static void finalizeMetadata(String logPath) {
+ public static void finalizeMetadata(String urlPath, String logPath) {
synchronized (mutexObject) {
- log.debug("finalizing metadata");
+ ORMEntityManager manager = ORMUtil.getEntityManager(urlPath);
+ manager.commitToDB();
+ log.debug("finalizing metadata: " + logPath);
metadataMap.remove(logPath);
}
}
@@ -106,7 +108,7 @@
synchronized (mutexObject) {
metadata = getMetadata(logPath, urlPath);
metadata.removeEntries();
- finalizeMetadata(logPath);
+ finalizeMetadata(urlPath, logPath);
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/Antlib.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/Antlib.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/Antlib.java Wed Jun 16 16:51:40 2010 +0300
@@ -143,9 +143,9 @@
* any tasks that derive from Definer.
*/
public final void execute() {
- for (Task t : tasks) {
- if (t instanceof UnknownElement) {
- UnknownElement ue = (UnknownElement)t;
+ for (Task task : tasks) {
+ if (task instanceof UnknownElement) {
+ UnknownElement ue = (UnknownElement)task;
setLocation(ue.getLocation());
ue.maybeConfigure();
Object configuredObject = ue.getRealThing();
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/BuildStatusDef.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/BuildStatusDef.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/BuildStatusDef.java Wed Jun 16 16:51:40 2010 +0300
@@ -67,8 +67,8 @@
if (!output.isEmpty())
{
log("*** Configuration report ***", Project.MSG_INFO);
- for (String x : output)
- log(x, Project.MSG_INFO);
+ for (String outputStr : output)
+ log(outputStr, Project.MSG_INFO);
}
}
@@ -94,11 +94,11 @@
sorted = project.topoSort(targetNames[0], targets);
// Find the desiredTarget Target object
- for (Target t : sorted)
+ for (Target target : sorted)
{
- if (t.getName().equals(desiredTarget))
+ if (target.getName().equals(desiredTarget))
{
- return t;
+ return target;
}
}
throw new BuildException("Could not find target matching " + desiredTarget + "\n");
@@ -114,49 +114,49 @@
String location = target.getLocation().getFileName();
try {
- String heliumpath = new File(project.getProperty("helium.dir")).getCanonicalPath();
- String targetpath = new File(location).getCanonicalPath();
-
- if (!targetpath.contains(heliumpath))
- {
- ArrayList antcallTargets = new ArrayList();
- Visitor visitorTarget = new AntTargetVisitor(antcallTargets, project);
+ String heliumpath = new File(project.getProperty("helium.dir")).getCanonicalPath();
+ String targetpath = new File(location).getCanonicalPath();
- Element element = findTargetElement(target, project);
- if (element != null)
- element.accept(visitorTarget);
- for (String depTargetString : antcallTargets)
+ if (!targetpath.contains(heliumpath))
+ {
+ ArrayList antcallTargets = new ArrayList();
+ Visitor visitorTarget = new AntTargetVisitor(antcallTargets, project);
+
+ Element element = findTargetElement(target, project);
+ if (element != null)
+ element.accept(visitorTarget);
+ for (String depTargetString : antcallTargets)
+ {
+ String[] array = { depTargetString };
+ try {
+ Target depTarget = findTarget(depTargetString, project, array);
+ targetCallsHeliumTarget(depTarget, project);
+ } catch (BuildException x) {
+ // We are Ignoring the errors as no need to fail the build.
+ log("Exception occured while target defined outside helium are calling a private Helium target " + x.toString(), Project.MSG_DEBUG);
+ x = null;
+ }
+ }
+
+
+ for (Enumeration depsEnum = target.getDependencies(); depsEnum.hasMoreElements();)
+ {
+ String depTargetString = depsEnum.nextElement();
+ String[] array = { depTargetString };
+ try {
+ Target depTarget = findTarget(depTargetString, project, array);
+ targetCallsHeliumTarget(depTarget, project);
+ } catch (BuildException x) {
+ //We are Ignoring the errors as no need to fail the build.
+ log("Exception occured while target defined outside helium are calling a private Helium target " + x.toString(), Project.MSG_DEBUG);
+ x = null;
+ }
+ }
+ }
+ else
{
- String[] array = { depTargetString };
- try {
- Target depTarget = findTarget(depTargetString, project, array);
- targetCallsHeliumTarget(depTarget, project);
- } catch (BuildException x) {
- // We are Ignoring the errors as no need to fail the build.
- log("Exception occured while target defined outside helium are calling a private Helium target " + x.toString(), Project.MSG_DEBUG);
- x = null;
- }
+ checkIfTargetPrivate(target, project);
}
-
-
- for (Enumeration e = target.getDependencies(); e.hasMoreElements();)
- {
- String depTargetString = e.nextElement();
- String[] array = { depTargetString };
- try {
- Target depTarget = findTarget(depTargetString, project, array);
- targetCallsHeliumTarget(depTarget, project);
- } catch (BuildException x) {
- //We are Ignoring the errors as no need to fail the build.
- log("Exception occured while target defined outside helium are calling a private Helium target " + x.toString(), Project.MSG_DEBUG);
- x = null;
- }
- }
- }
- else
- {
- checkIfTargetPrivate(target, project);
- }
} catch (IOException e) {
//We are Ignoring the errors as no need to fail the build.
@@ -218,11 +218,11 @@
String projectName = antDoc.valueOf("/project/@name");
for (Iterator iterator = antDoc.selectNodes("//target").iterator(); iterator.hasNext();)
{
- Element e = iterator.next();
+ Element element = iterator.next();
- String targetName = e.attributeValue("name");
+ String targetName = element.attributeValue("name");
if (targetName.equals(target.getName()) || (projectName + "." + targetName).equals(target.getName()))
- return e;
+ return element;
}
return null;
}
@@ -281,11 +281,11 @@
com.nokia.helium.ant.data.Database db = new com.nokia.helium.ant.data.Database(project, "private");
ArrayList customerProps = getCustomerProperties(project);
- for (PropertyMeta x : db.getProperties())
+ for (PropertyMeta propertyMeta : db.getProperties())
{
- if (x.getLocation().contains(heliumpath) && x.getScope().equals("private") && customerProps.contains(x.getName()))
+ if (propertyMeta.getLocation().contains(heliumpath) && propertyMeta.getScope().equals("private") && customerProps.contains(propertyMeta.getName()))
{
- output.add("Warning: " + x.getName() + " property has been overridden");
+ output.add("Warning: " + propertyMeta.getName() + " property has been overridden");
}
}
} catch (IOException e) { e.printStackTrace(); }
@@ -299,9 +299,9 @@
try {
String heliumpath = new File(project.getProperty("helium.dir")).getCanonicalPath();
- for (Object o : db.getAntFiles(project))
+ for (Object object : db.getAntFiles(project))
{
- String antFile = (String)o;
+ String antFile = (String)object;
antFile = new File(antFile).getCanonicalPath();
if (!antFile.contains(heliumpath))
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/Database.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/Database.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/Database.java Wed Jun 16 16:51:40 2010 +0300
@@ -105,12 +105,12 @@
public void setRefid(Reference r)
{
- Object o = r.getReferencedObject();
- if (!(o instanceof ResourceCollection))
+ Object object = r.getReferencedObject();
+ if (!(object instanceof ResourceCollection))
{
throw new BuildException(r.getRefId() + " doesn\'t denote a ResourceCollection");
}
- rc = (ResourceCollection) o;
+ rc = (ResourceCollection) object;
}
public Document createDOM() throws DocumentException, IOException {
@@ -337,10 +337,10 @@
Iterator extraFilesIter = rc.iterator();
while (extraFilesIter.hasNext())
{
- FileResource f = (FileResource) extraFilesIter.next();
- String extrafile = f.getFile().getCanonicalPath();
+ FileResource fileResource = (FileResource) extraFilesIter.next();
+ String extrafile = fileResource.getFile().getCanonicalPath();
- if (!antFiles.contains(f.toString()) && !f.getFile().getName().startsWith("test_"))
+ if (!antFiles.contains(fileResource.toString()) && !fileResource.getFile().getName().startsWith("test_"))
{
if (homeOnly)
{
@@ -742,11 +742,11 @@
* @param allTaskdefs
* @param criteria
*/
- private HashMap < String, String > filterTasks ( Hashtable > allTaskdefs ) {
+ private HashMap < String, String > filterTasks( Hashtable > allTaskdefs ) {
HashMap tasks = new HashMap ();
Enumeration taskdefsenum = allTaskdefs.keys();
- while ( taskdefsenum.hasMoreElements () ) {
+ while ( taskdefsenum.hasMoreElements() ) {
String key = taskdefsenum.nextElement();
Class> clazz = allTaskdefs.get(key);
String className = clazz.getName();
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/HeliumLogger.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/HeliumLogger.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/HeliumLogger.java Wed Jun 16 16:51:40 2010 +0300
@@ -131,9 +131,9 @@
private void cleanup() {
String loggingoutputfile = project.getProperty("logging.output.file");
if (loggingoutputfile != null) {
- File f = new File(loggingoutputfile);
- if (f.exists()) {
- f.delete();
+ File file = new File(loggingoutputfile);
+ if (file.exists()) {
+ file.delete();
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/Signal.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/Signal.java Wed Jun 16 16:51:40 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.ant;
+
+/**
+ * This class stores a signal while being deferred.
+ *
+ */
+public class Signal {
+
+ private String name;
+ private String message;
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/XmlLogger.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/XmlLogger.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/XmlLogger.java Wed Jun 16 16:51:40 2010 +0300
@@ -159,8 +159,8 @@
event.getException().toString());
// print the stacktrace in the build file it is always useful...
// better have too much info than not enough.
- Throwable t = event.getException();
- Text errText = doc.createCDATASection(StringUtils.getStackTrace(t));
+ Throwable exception = event.getException();
+ Text errText = doc.createCDATASection(StringUtils.getStackTrace(exception));
Element stacktrace = doc.createElement(STACKTRACE_TAG);
stacktrace.appendChild(errText);
buildElement.element.appendChild(stacktrace);
@@ -279,8 +279,8 @@
return element;
}
- for (Enumeration e = tasks.keys(); e.hasMoreElements();) {
- Task key = (Task) e.nextElement();
+ for (Enumeration taskEnum = tasks.keys(); taskEnum.hasMoreElements();) {
+ Task key = (Task) taskEnum.nextElement();
if (key instanceof UnknownElement) {
if (((UnknownElement) key).getTask() == task) {
return (TimedElement) tasks.get(key);
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/antlib.xml
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/antlib.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -23,19 +23,12 @@
-
-
-
+
-
-
-
-
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/conditions/AtsCondition.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/conditions/AtsCondition.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/conditions/AtsCondition.java Wed Jun 16 16:51:40 2010 +0300
@@ -73,16 +73,16 @@
for (Iterator iterator = antDoc.selectNodes("//test/failed").iterator(); iterator.hasNext();)
{
testsfound = true;
- Element e = (Element) iterator.next();
- String failed = e.getText();
+ Element element = (Element) iterator.next();
+ String failed = element.getText();
if (!failed.equals("0"))
{
log.error("ATS tests failed");
for (Iterator iterator2 = antDoc.selectNodes("//actual_result").iterator(); iterator2.hasNext();)
{
- Element e2 = (Element) iterator2.next();
- log.error(e2.getText());
+ Element resultElement = (Element) iterator2.next();
+ log.error(resultElement.getText());
}
return false;
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/listener/CoverageRecorderEntry.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/listener/CoverageRecorderEntry.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,451 @@
+/*
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.ant.listener;
+
+import java.io.*;
+import org.apache.tools.ant.util.DOMElementWriter;
+import org.apache.tools.ant.util.DateUtils;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.apache.tools.ant.*;
+import java.util.*;
+import javax.xml.parsers.ParserConfigurationException;
+
+/**
+ * This is a class that represents a XML recorder. This is the listener to the
+ * build process.
+ *
+ */
+public class CoverageRecorderEntry implements BuildLogger, SubBuildListener {
+
+ //////////////////////////////////////////////////////////////////////
+ // ATTRIBUTES
+
+ /** XML element name for a build. */
+ private static final String BUILD_TAG = "build";
+ /** XML element name for a target. */
+ private static final String TARGET_TAG = "target";
+ /** XML element name for a task. */
+ private static final String TASK_TAG = "task";
+ /** XML attribute name for a name. */
+ private static final String NAME_ATTR = "name";
+ /** XML attribute name for a time. */
+ private static final String TIME_ATTR = "time";
+ /** XML attribute name for a file location. */
+ private static final String LOCATION_ATTR = "location";
+
+ /** DocumentBuilder to use when creating the document to start with. */
+ private static DocumentBuilder builder = getDocumentBuilder();
+
+ private String recordTaskName;
+
+ /** The name of the file associated with this recorder entry. */
+ private String filename;
+ /** The state of the recorder (recorder on or off). */
+ private boolean record = true;
+ /** The current verbosity level to record at. */
+ private int loglevel = Project.MSG_INFO;
+ /** The output PrintStream to record to. */
+ private PrintStream outStream;
+ /** The start time of the last know target. */
+ private long targetStartTime;
+ /** project instance the recorder is associated with */
+ private Project project;
+
+ /** The complete log document for this build. */
+ private Document doc = builder.newDocument();
+ /** Mapping for when tasks started (Task to TimedElement). */
+ private Hashtable tasks = new Hashtable();
+ /** Mapping for when targets started (Task to TimedElement). */
+ private Hashtable targets = new Hashtable();
+ /**
+ * Mapping of threads to stacks of elements
+ * (Thread to Stack of TimedElement).
+ */
+ private Hashtable> threadStacks = new Hashtable>();
+ /**
+ * When the build started.
+ */
+ private TimedElement buildElement;
+
+ //////////////////////////////////////////////////////////////////////
+ // CONSTRUCTORS / INITIALIZERS
+
+ /**
+ * @param name The name of this recorder (used as the filename).
+ */
+ public CoverageRecorderEntry(String name, String recordTaskName) {
+ filename = name;
+ this.recordTaskName = recordTaskName;
+ startBuild();
+ }
+
+ /**
+ * Returns a default DocumentBuilder instance or throws an
+ * ExceptionInInitializerError if it can't be created.
+ *
+ * @return a default DocumentBuilder instance.
+ */
+ protected static DocumentBuilder getDocumentBuilder() {
+ try {
+ return DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ } catch (ParserConfigurationException exc) {
+ throw new ExceptionInInitializerError(exc.getMessage());
+ }
+ }
+
+ /** Utility class representing the time an element started. */
+ protected static class TimedElement {
+ /**
+ * Start time in milliseconds
+ * (as returned by System.currentTimeMillis()
).
+ */
+ private long startTime;
+ /** Element created at the start time. */
+ private Element element;
+ public String toString() {
+ return element.getTagName() + ":" + element.getAttribute("name");
+ }
+ }
+
+ /**
+ * Returns the stack of timed elements for the current thread.
+ * @return the stack of timed elements for the current thread
+ */
+ protected Stack getStack() {
+ Stack threadStack = threadStacks.get(Thread.currentThread());
+ if (threadStack == null) {
+ threadStack = new Stack();
+ threadStacks.put(Thread.currentThread(), threadStack);
+ }
+ /* For debugging purposes uncomment:
+ org.w3c.dom.Comment s = doc.createComment("stack=" + threadStack);
+ buildElement.element.appendChild(s);
+ */
+ return threadStack;
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // ACCESSOR METHODS
+
+ /**
+ * @return the name of the file the output is sent to.
+ */
+ public String getFilename() {
+ return filename;
+ }
+
+ /**
+ * Turns off or on this recorder.
+ *
+ * @param state true for on, false for off, null for no change.
+ */
+ public void setRecordState(Boolean state) {
+ if (state != null) {
+ record = state.booleanValue();
+ }
+ }
+
+ /**
+ * @see org.apache.tools.ant.BuildListener#buildStarted(BuildEvent)
+ */
+ /** {@inheritDoc}. */
+ public void buildStarted(BuildEvent event) {
+
+ }
+
+ /**
+ * @see org.apache.tools.ant.BuildListener#buildFinished(BuildEvent)
+ */
+ /** {@inheritDoc}. */
+ public void buildFinished(BuildEvent event) {
+ cleanup();
+ }
+
+ /**
+ * Cleans up any resources held by this recorder entry at the end
+ * of a subbuild if it has been created for the subbuild's project
+ * instance.
+ *
+ * @param event the buildFinished event
+ *
+ * @since Ant 1.6.2
+ */
+ public void subBuildFinished(BuildEvent event) {
+ if (event.getProject() == project) {
+ cleanup();
+ }
+ }
+
+ /**
+ * Empty implementation to satisfy the BuildListener interface.
+ *
+ * @param event the buildStarted event
+ *
+ * @since Ant 1.6.2
+ */
+ public void subBuildStarted(BuildEvent event) {
+ }
+
+ /**
+ * @see org.apache.tools.ant.BuildListener#targetStarted(BuildEvent)
+ */
+ /** {@inheritDoc}. */
+ public void targetStarted(BuildEvent event) {
+ Target target = event.getTarget();
+ TimedElement targetElement = new TimedElement();
+ targetElement.startTime = System.currentTimeMillis();
+ targetElement.element = doc.createElement(TARGET_TAG);
+ targetElement.element.setAttribute(NAME_ATTR, target.getName());
+ targets.put(target, targetElement);
+ getStack().push(targetElement);
+ }
+
+ /**
+ * @see org.apache.tools.ant.BuildListener#targetFinished(BuildEvent)
+ */
+ /** {@inheritDoc}. */
+ public void targetFinished(BuildEvent event) {
+ Target target = event.getTarget();
+ TimedElement targetElement = (TimedElement) targets.get(target);
+ if (targetElement != null) {
+ long totalTime
+ = System.currentTimeMillis() - targetElement.startTime;
+ targetElement.element.setAttribute(TIME_ATTR,
+ DateUtils.formatElapsedTime(totalTime));
+
+ TimedElement parentElement = null;
+ Stack threadStack = getStack();
+ if (!threadStack.empty()) {
+ threadStack.pop();
+// if (poppedStack != targetElement) {
+// throw new RuntimeException("Mismatch - popped element = "
+// + poppedStack
+// + " finished target element = "
+// + targetElement);
+// }
+ if (!threadStack.empty()) {
+ parentElement = threadStack.peek();
+ }
+ }
+ if (parentElement == null) {
+ buildElement.element.appendChild(targetElement.element);
+ } else {
+ parentElement.element.appendChild(targetElement.element);
+ }
+ }
+ targets.remove(target);
+ }
+
+ /**
+ * @see org.apache.tools.ant.BuildListener#taskStarted(BuildEvent)
+ */
+ /** {@inheritDoc}. */
+ public void taskStarted(BuildEvent event) {
+ TimedElement taskElement = new TimedElement();
+ taskElement.startTime = System.currentTimeMillis();
+ taskElement.element = doc.createElement(TASK_TAG);
+
+ Task task = event.getTask();
+ String name = event.getTask().getTaskName();
+ if (name == null) {
+ name = "";
+ }
+ taskElement.element.setAttribute(NAME_ATTR, name);
+ taskElement.element.setAttribute(LOCATION_ATTR,
+ event.getTask().getLocation().toString());
+ tasks.put(task, taskElement);
+ getStack().push(taskElement);
+ }
+
+ /**
+ * @see org.apache.tools.ant.BuildListener#taskFinished(BuildEvent)
+ */
+ /** {@inheritDoc}. */
+ public void taskFinished(BuildEvent event) {
+
+// if (event.getTask().getTaskName() != recordTaskName) {
+ Task task = event.getTask();
+ TimedElement taskElement = tasks.get(task);
+ if (taskElement != null) {
+ long totalTime = System.currentTimeMillis() - taskElement.startTime;
+ taskElement.element.setAttribute(TIME_ATTR,
+ DateUtils.formatElapsedTime(totalTime));
+ Target target = task.getOwningTarget();
+ TimedElement targetElement = null;
+ if (target != null) {
+ targetElement = (TimedElement) targets.get(target);
+ }
+ if (targetElement == null) {
+ buildElement.element.appendChild(taskElement.element);
+ } else {
+ targetElement.element.appendChild(taskElement.element);
+ }
+ Stack threadStack = getStack();
+ if (!threadStack.empty()) {
+ threadStack.pop();
+// if (poppedStack != taskElement) {
+// throw new RuntimeException("Mismatch - popped element = "
+// + poppedStack + " finished task element = "
+// + taskElement);
+// }
+ }
+ tasks.remove(task);
+// } else {
+// throw new RuntimeException("Unknown task " + task + " not in " + tasks);
+// }
+ }
+ }
+
+ /**
+ * Get the TimedElement associated with a task.
+ *
+ * Where the task is not found directly, search for unknown elements which
+ * may be hiding the real task
+ */
+ protected TimedElement getTaskElement(Task task) {
+ TimedElement element = (TimedElement) tasks.get(task);
+ if (element != null) {
+ return element;
+ }
+
+ for (Task key : tasks.keySet()) {
+ if (key instanceof UnknownElement) {
+ if (((UnknownElement) key).getTask() == task) {
+ return tasks.get(key);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @see org.apache.tools.ant.BuildListener#messageLogged(BuildEvent)
+ */
+ /** {@inheritDoc}. */
+ public void messageLogged(BuildEvent event) {
+
+ }
+
+ /**
+ * @see BuildLogger#setMessageOutputLevel(int)
+ */
+ /** {@inheritDoc}. */
+ public void setMessageOutputLevel(int level) {
+ if (level >= Project.MSG_ERR && level <= Project.MSG_DEBUG) {
+ loglevel = level;
+ }
+ }
+
+ /**
+ * @see BuildLogger#setOutputPrintStream(PrintStream)
+ */
+ /** {@inheritDoc}. */
+ public void setOutputPrintStream(PrintStream output) {
+ outStream = output;
+ }
+
+
+ /**
+ * @see BuildLogger#setErrorPrintStream(PrintStream)
+ */
+ /** {@inheritDoc}. */
+ public void setErrorPrintStream(PrintStream err) {
+ setOutputPrintStream(err);
+ }
+
+ /**
+ * Set the project associated with this recorder entry.
+ *
+ * @param project the project instance
+ *
+ * @since 1.6.2
+ */
+ public void setProject(Project project) {
+ this.project = project;
+ if (project != null) {
+ project.addBuildListener(this);
+ }
+ }
+
+ /**
+ * @since 1.6.2
+ */
+ public void cleanup() {
+ closeFile();
+ if (project != null) {
+ project.removeBuildListener(this);
+ }
+ project = null;
+ }
+
+ /**
+ * Closes the file associated with this recorder.
+ * Used by Recorder.
+ * @since 1.6.3
+ */
+ void closeFile() {
+ finishBuild();
+ Writer out = null;
+ try {
+ // specify output in UTF8 otherwise accented characters will blow
+ // up everything
+ OutputStream stream = outStream;
+ if (stream == null) {
+ stream = new FileOutputStream(filename);
+ }
+ out = new OutputStreamWriter(stream, "UTF8");
+ out.write("\n");
+ (new DOMElementWriter()).write(buildElement.element, out, 0, "\t");
+ out.flush();
+ } catch (IOException exc) {
+ throw new BuildException("Unable to write log file " + exc.getMessage(), exc);
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ e = null; // ignore
+ }
+ }
+ }
+ buildElement = null;
+ }
+
+ void startBuild() {
+ buildElement = new TimedElement();
+ buildElement.startTime = System.currentTimeMillis();
+ buildElement.element = doc.createElement(BUILD_TAG);
+ }
+
+ void finishBuild() {
+ long totalTime = System.currentTimeMillis() - buildElement.startTime;
+ buildElement.element.setAttribute(TIME_ATTR,
+ DateUtils.formatElapsedTime(totalTime));
+ }
+
+ @Override
+ public void setEmacsMode(boolean emacsMode) {
+ // Not needed.
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/AbstractScmBaseTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/AbstractScmBaseTask.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,446 +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 java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.List;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-
-/**
- * AbstractScmBaseTask
is an abstract class for GSCM related tasks
- * such as rebaseline and deconfigure.
- *
- * @ant.task category="SCM"
- *
- */
-public abstract class AbstractScmBaseTask extends Task {
-
- // common attributes
- private String database; // -d dbname = Database name (or database path)
- private String password; // -U password = UNIX password
- private String ccmProject; // -p projectname = Project name (incompatible
- // with -B)
-
- private Integer verbosity;
-
- private StringBuffer commandString = new StringBuffer();
- private List commands = new ArrayList();
-
- /**
- * Return the Synergy project name.
- *
- * @return the Synergy project name.
- */
- public String getCcmProject() {
- return ccmProject;
- }
-
- /**
- * Set Synergy Project Name to be used.
- *
- * @param ccmProject
- * is the Synergy project name to set
- * @ant.required
- */
- public void setCcmProject(String ccmProject) {
- this.ccmProject = ccmProject;
- log("Set ccmProject to " + ccmProject);
- }
-
- /**
- * Return the database name.
- *
- * @return the database name.
- */
- public String getDatabase() {
- return database;
- }
-
- /**
- * Set Synergy Database name to be used.
- *
- * @param database
- * is the name of the Synergy database to set.
- * @ant.required
- */
- public void setDatabase(String database) {
- this.database = database;
- log("Set database to " + database);
- }
-
- /**
- * Return the Synergy password.
- *
- * @return the Synergy password.
- */
- public String getPassword() {
- return password;
- }
-
- /**
- * Set Synergy Password to be used.
- *
- * @param password
- * is the password to set.
- * @ant.required
- */
- public void setPassword(String password) {
- this.password = password;
- log("Set password to ****** ");
- }
-
- /**
- * Return the verbosity.
- *
- * @return the verbosity.
- */
- public Integer getVerbosity() {
- return verbosity;
- }
-
- /**
- * Set verbosity level to be used. Verbosity level ( 0 - quiet, 1 - verbose,
- * 2 - very verbose). Exception will be raised for any other value.
- *
- * @param verbosity
- * is the verbosity level to set.
- * @ant.not-required
- */
- public void setVerbosity(Integer verbosity) {
- this.verbosity = verbosity;
- log("Set verbosity to " + verbosity);
- }
-
- /**
- * Method executes the current task.
- *
- */
- @Override
- public void execute() {
- // Set execution script
- setExecutionScript();
-
- // Build command argument list
- buildCommandList();
-
- // handle the command arguments
- handleCommandArguments();
-
- // configure verbosity
- configureVerbosity();
-
- // Execute the command-line launching as a separate process
- runCommand();
- log("Completed successfully.");
- }
-
- /**
- * Method appends the given prefix and the command to the command string if
- * the input cmd string is not null.
- *
- * @param prefix
- * is the prefix of the cmd string input.
- * @param cmd
- * is the cmd string to be appended to main command string.
- */
- protected void append2CommandString(String prefix, Object cmd) {
- if (cmd != null) {
- commandString.append(prefix);
- commandString.append(" ");
- commandString.append(cmd);
- commandString.append(" ");
- }
- }
-
- /**
- * Method appends the given prefix to the command string if the boolean
- * value input is set true.
- *
- * @param prefix
- * is the prefix to be appended to the command string.
- * @param bool
- * indicates whether to append the prefix or not.
- */
- protected void append2CommandString(String prefix, Boolean bool) {
- if (bool != null && bool) {
- append2CommandString(prefix);
- }
- }
-
- /**
- * Method appends the given cmd to the command string.
- *
- * @param cmd
- * is the command string to be appended.
- */
- protected void append2CommandString(String cmd) {
- commandString.append(cmd);
- commandString.append(" ");
- }
-
- /**
- * Method is used to throw a {@link BuildException} with the specified error
- * message.
- *
- * @param errorMessage
- * is the error message.
- */
- protected void raiseError(String errorMessage) {
- StringBuffer buffer = new StringBuffer("[").append(getTaskName())
- .append("] Error: ").append(errorMessage);
- throw new BuildException(buffer.toString());
- }
-
- /**
- * Add the given command argument to the command list.
- *
- * @param fieldName
- * is the name of the task field.
- * @param cmdArg
- * is the command argument to be added to the command list.
- * @param required
- * indicates whether the command argument is mandatory or not.
- * @param fieldValue is the value of the given field
- */
- protected void addCommandArg(String fieldName, String cmdArg,
- Boolean required, Object fieldValue ) {
- SCMCommandArgument cmdObj = new SCMCommandArgument(fieldName, cmdArg,
- required, fieldValue );
- commands.add(cmdObj);
- }
-
- /**
- * Add the given command argument to the command list. By default, the input
- * command argument will be optional.
- *
- * @param fieldName
- * is the name of the task field.
- * @param cmdArg
- * is the command argument to be added to the command list.
- * @param fieldValue is the value of the given field
- */
- protected void addCommandArg(String fieldName, String cmdArg, Object fieldValue ) {
- addCommandArg(fieldName, cmdArg, false, fieldValue);
- }
-
- /**
- * Method validates the given arguments.
- */
- protected abstract void validateArguments();
-
- /**
- * Set the execution script.
- *
- */
- protected abstract void setExecutionScript();
-
- /**
- * Build a command list consisting of all the required and optional command
- * arguments of the current task.
- */
- protected abstract void buildCommandList();
-
- /**
- * Method returns the correct verbosity level for the input choice.
- *
- * @param choice
- * is the verbosity choice set by user.
- * @return the verbosity level to set.
- */
- protected abstract String getVerbosity(int choice);
-
- // ----------------------------------- PRIVATE METHODS --------------------------------------
-
- /**
- * Method returns the requested {@link Field} object from the input
- * {@link Class}. If the requested field is not found in the given
- * {@link Class} then all its super classes are searched recursively.
- *
- * @param clazz
- * is the {@link Class} of which the field is requested.
- * @param fieldName
- * is the name of the requested field.
- * @return the requested field.
- */
- private Field getField(Class> clazz, String fieldName) {
- Field field = null;
- if (clazz != null) {
- try {
- field = clazz.getDeclaredField(fieldName);
- } catch (NoSuchFieldException nsfe) {
- field = getField(clazz.getSuperclass(), fieldName);
- }
- }
- return field;
- }
-
- /**
- * Method process the command arguments set in the command list.
- *
- * @throws Exception
- * if any error occurs while processing the command arguments.
- */
- private void handleCommandArguments() {
- StringBuffer missingArgs = new StringBuffer();
- Field field = null;
- for (SCMCommandArgument cmdObj : commands) {
- field = getField(getClass(), cmdObj.fieldName);
- if (field != null) {
- Object fieldValue = field.getType().cast( cmdObj.fieldValue );
- check4MandatoryCmdArguments(cmdObj, fieldValue, missingArgs);
- buildCommand(cmdObj, fieldValue);
- }
- }
- // handle missing args if any
- handleMissingArguments(missingArgs);
- validateArguments();
- }
-
- /**
- * Method checks for the mandatory command arguments.
- *
- * @param cmdObj
- * is the {@link SCMCommandArgument} used in verification
- * @param fieldValue
- * is the field value to verify
- * @param missingArgs
- * contains the mandatory command arguments which are missing.
- */
- private void check4MandatoryCmdArguments(SCMCommandArgument cmdObj,
- Object fieldValue, StringBuffer missingArgs) {
- if (cmdObj.required && fieldValue == null) {
- missingArgs.append(cmdObj.fieldName);
- missingArgs.append(" ");
- }
- }
-
- /**
- * Method is used to construct an executable command string.
- *
- * @param cmdObj
- * is the {@link SCMCommandArgument}
- * @param fieldValue
- * is the fieldValue containing the actual command argument.
- */
- private void buildCommand(SCMCommandArgument cmdObj, Object fieldValue) {
- if (fieldValue instanceof Boolean) {
- append2CommandString(cmdObj.commandArgument, (Boolean) fieldValue);
- } else {
- append2CommandString(cmdObj.commandArgument, fieldValue);
- }
- }
-
- /**
- * Method throws a {@link BuildException} if any mandatory command arguments
- * are missing.
- *
- * @param missingArgs
- * is the {@link StringBuffer} consisting of mandatory command
- * arguments which are missing.
- */
- private void handleMissingArguments(StringBuffer missingArgs) {
- if (missingArgs.length() > 0) {
- raiseError("mandatory attributes are not defined - "
- + missingArgs.toString());
- }
- }
-
- /**
- * Configure the verbosity set by the user.
- */
- private void configureVerbosity() {
- if (verbosity != null) {
- append2CommandString(getVerbosity(verbosity));
- }
- }
-
- /**
- * Execute the specified command.
- *
- * @throws Exception
- * if execution fails or any error occurs while execution of the
- * command.
- */
- private void runCommand() {
- String[] cmdline = commandString.toString().split(" ");
- /*
- * Note: static method call to Execute.runCommand doesnot run the given
- * perl script here due to the setting of vmLauncher which acutally
- * tries executing the script using Runtime.getRuntime().exec() method
- * and this method cannot run the script without reference to the cmd or
- * shell. (Similar with ExecTask)
- *
- * So creating an instance of Execute class helps to disable the
- * vmLauncher and an OS dependent shellLauncher will be available for
- * the execution of the script.
- */
- Execute exe = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
- Project.MSG_ERR));
- exe.setAntRun(getProject());
- exe.setCommandline(cmdline);
- exe.setVMLauncher(false);
- try {
- int retval = exe.execute();
- if (Execute.isFailure(retval)) {
- raiseError("Script execution failure.");
- }
- } catch (IOException th) {
- th.printStackTrace();
- raiseError("Script execution failure.");
- }
- }
-
- // ************************************* PRIVATE CLASSES ***************************************
-
- /**
- * SCMCommandArgument
is a private class and represents a
- * normal java bean which is used to hold the information related to SCM
- * command arguments.
- */
- private class SCMCommandArgument {
-
- private String fieldName;
- private Object fieldValue;
- private String commandArgument;
- private Boolean required;
-
- /**
- * Create an instance of {@link SCMCommandArgument}.
- *
- * @param fieldName
- * is the name of the task field
- * @param commandArg
- * is the SCM command argument
- * @param reqd
- * indicates the input command argument is mandatory or not.
- */
- protected SCMCommandArgument(String fieldName, String commandArg,
- Boolean reqd, Object fieldValue ) {
- this.fieldName = fieldName;
- this.commandArgument = commandArg;
- this.required = reqd;
- this.fieldValue = fieldValue;
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/AntDependencyTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/AntDependencyTask.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/AntDependencyTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -202,7 +202,7 @@
String mavenUrl = "http://repo2.maven.org/maven2/";
Enumeration jarfiles = jar.entries();
boolean found = false;
- while (!found && jarfiles.hasMoreElements ()) {
+ while (!found && jarfiles.hasMoreElements()) {
ZipEntry file = (ZipEntry) jarfiles.nextElement();
if (file.isDirectory())
{
@@ -301,7 +301,7 @@
HashSet classlist = new HashSet();
Enumeration taskdefsenum = taskdefs.keys();
- while (taskdefsenum.hasMoreElements ()) {
+ while (taskdefsenum.hasMoreElements()) {
String key = (String) taskdefsenum.nextElement();
Class value = (Class) taskdefs.get(key);
if (!key.contains("nokia") && !value.toString().contains("org.apache.tools.ant"))
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CcmTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CcmTask.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +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 java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.python.util.PythonInterpreter;
-
-import com.nokia.ant.taskdefs.ccm.commands.*;
-import com.nokia.ant.types.ccm.SessionSet;
-
-import org.apache.tools.ant.Task;
-
-/**
- * Synergy task.
- *
- * <hlm:createSessionMacro database="to1tobet" reference="test.session" />
- * <hlm:ccm verbose="false">
- * <hlm:sessionset refid="test.session" />
- * <hlm:addtask folder="tr1test1#2079">
- * <task name="tr1test1#5310" />
- * </hlm:addtask>
- * <hlm:snapshot project="helium-to1tobet#helium_3.0:project:vc1s60p1#1" dir="c:\test" fast="true" recursive="true" />
- * <hlm:synchronize project="helium-to1tobet#helium_3.0:project:vc1s60p1#1" recursive="true" />
- * <hlm:close />
- * </hlm:ccm>
- *
- * @ant.task category="SCM"
- */
-public class CcmTask extends Task
-{
- private String username;
-
- private String password;
-
- private List commands = new ArrayList();
- private Vector sessionSets = new Vector();
- private boolean verbose;
-
- public void setVerbose(boolean value) {
- verbose = value;
- }
-
- public boolean getVerbose() {
- return verbose;
- }
-
- public String getUsername()
- {
- return username;
- }
-
- public final void setUsername(final String username)
- {
- this.username = username;
- }
-
- public String getPassword()
- {
- return password;
- }
-
- public final void setPassword(final String password)
- {
- this.password = password;
- }
-
- public CcmCommand[] getCommands()
- {
- return commands.toArray(new CcmCommand[0]);
- }
-
- public void addUpdate(Update a)
- {
- addCommand(a);
- }
-
- public void addSynchronize(Synchronize a)
- {
- addCommand(a);
- }
-
- public void addReconcile(Reconcile a)
- {
- addCommand(a);
- }
-
- public void addSnapshot(Snapshot a)
- {
- addCommand(a);
- }
-
- public void addChangeReleaseTag(ChangeReleaseTag a)
- {
- addCommand(a);
- }
-
- public void addCheckout(Checkout a)
- {
- addCommand(a);
- }
-
- public void addWorkarea(Workarea a)
- {
- addCommand(a);
- }
-
- private void addCommand(CcmCommand cmd)
- {
- cmd.setTask(this);
- commands.add(cmd);
- }
-
- public AddTask createAddTask()
- {
- AddTask cmd = new AddTask();
- addCommand(cmd);
- return cmd;
- }
-
- public Close createClose()
- {
- Close cmd = new Close();
- addCommand(cmd);
- return cmd;
- }
-
- public SessionSet createSessionSet()
- {
- SessionSet sessionSet = new SessionSet();
- sessionSets.add(sessionSet);
- return sessionSet;
- }
-
- public SessionSet[] getSessionSets() {
- SessionSet[] result = new SessionSet[sessionSets.size()];
- sessionSets.copyInto(result);
- return result;
- }
-
- public final void execute()
- {
- String ccmtaskScript = getProject().getProperty("ccmtask.python.script.file");
- PythonInterpreter pi = new PythonInterpreter();
- pi.set("java_ccmtask", this);
- pi.set("project", getProject());
- pi.execfile(ccmtaskScript);
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CopyParallelTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CopyParallelTask.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CopyParallelTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -62,10 +62,10 @@
*/
public final void execute()
{
- super.execute();
- //wait until all copy threads are dead
- while (copyThreadCount > 0)
- {
+ super.execute();
+ //wait until all copy threads are dead
+ while (copyThreadCount > 0)
+ {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
@@ -74,7 +74,7 @@
}
log("Copy parallel task has been interrupted " + e.getMessage(), Project.MSG_ERR);
}
- }
+ }
}
@@ -117,10 +117,10 @@
+ " to " + destDir.getAbsolutePath() + " using " + maxThreadCount
+ " threads in parallel.");
- Enumeration e = fileCopyMap.keys();
- while (e.hasMoreElements())
+ Enumeration fileEnum = fileCopyMap.keys();
+ while (fileEnum.hasMoreElements())
{
- String fromFile = (String) e.nextElement();
+ String fromFile = (String) fileEnum.nextElement();
String[] toFiles = (String[]) fileCopyMap.get(fromFile);
for (int i = 0; i < toFiles.length; i++) {
@@ -145,28 +145,28 @@
while (true)
{
- if ( copyThreadCount < maxThreadCount)
- {
- CopyThread copyThread = new CopyThread(fromFile, toFile, executionFilters);
- copyThread.start();
- copyThreadCount++;
- break;
- }
+ if ( copyThreadCount < maxThreadCount)
+ {
+ CopyThread copyThread = new CopyThread(fromFile, toFile, executionFilters);
+ copyThread.start();
+ copyThreadCount++;
+ break;
+ }
}
}
}
}
if (includeEmpty) {
- Enumeration e = dirCopyMap.elements();
+ Enumeration dirEnum = dirCopyMap.elements();
int createCount = 0;
- while (e.hasMoreElements()) {
- String[] dirs = (String[]) e.nextElement();
+ while (dirEnum.hasMoreElements()) {
+ String[] dirs = (String[]) dirEnum.nextElement();
for (int i = 0; i < dirs.length; i++) {
- File d = new File(dirs[i]);
- if (!d.exists()) {
- if (!d.mkdirs()) {
+ File file = new File(dirs[i]);
+ if (!file.exists()) {
+ if (!file.mkdirs()) {
log("Unable to create directory "
- + d.getAbsolutePath(), Project.MSG_ERR);
+ + file.getAbsolutePath(), Project.MSG_ERR);
} else {
createCount++;
}
@@ -208,7 +208,7 @@
message.append(LINE_SEPARATOR);
message.append(
"This is normally due to the input file containing invalid");
- message.append(LINE_SEPARATOR);
+ message.append(LINE_SEPARATOR);
message.append("bytes for the character encoding used : ");
message.append(
getEncoding() == null
@@ -244,7 +244,7 @@
public void run()
{
try {
- fileUtils.copyFile(fromFile, toFile, executionFilters,
+ fileUtils.copyFile(fromFile, toFile, executionFilters,
filterChains, forceOverwrite,
preserveLastModified, inputEncoding,
outputEncoding, getProject());
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CoverageRecorderEntry.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CoverageRecorderEntry.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,451 +0,0 @@
-/*
- * 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
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.ant.taskdefs;
-
-import java.io.*;
-import org.apache.tools.ant.util.DOMElementWriter;
-import org.apache.tools.ant.util.DateUtils;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.apache.tools.ant.*;
-import java.util.*;
-import javax.xml.parsers.ParserConfigurationException;
-
-/**
- * This is a class that represents a XML recorder. This is the listener to the
- * build process.
- *
- */
-public class CoverageRecorderEntry implements BuildLogger, SubBuildListener {
-
- //////////////////////////////////////////////////////////////////////
- // ATTRIBUTES
-
- /** XML element name for a build. */
- private static final String BUILD_TAG = "build";
- /** XML element name for a target. */
- private static final String TARGET_TAG = "target";
- /** XML element name for a task. */
- private static final String TASK_TAG = "task";
- /** XML attribute name for a name. */
- private static final String NAME_ATTR = "name";
- /** XML attribute name for a time. */
- private static final String TIME_ATTR = "time";
- /** XML attribute name for a file location. */
- private static final String LOCATION_ATTR = "location";
-
- /** DocumentBuilder to use when creating the document to start with. */
- private static DocumentBuilder builder = getDocumentBuilder();
-
- private String recordTaskName;
-
- /** The name of the file associated with this recorder entry. */
- private String filename;
- /** The state of the recorder (recorder on or off). */
- private boolean record = true;
- /** The current verbosity level to record at. */
- private int loglevel = Project.MSG_INFO;
- /** The output PrintStream to record to. */
- private PrintStream outStream;
- /** The start time of the last know target. */
- private long targetStartTime;
- /** project instance the recorder is associated with */
- private Project project;
-
- /** The complete log document for this build. */
- private Document doc = builder.newDocument();
- /** Mapping for when tasks started (Task to TimedElement). */
- private Hashtable tasks = new Hashtable();
- /** Mapping for when targets started (Task to TimedElement). */
- private Hashtable targets = new Hashtable();
- /**
- * Mapping of threads to stacks of elements
- * (Thread to Stack of TimedElement).
- */
- private Hashtable> threadStacks = new Hashtable>();
- /**
- * When the build started.
- */
- private TimedElement buildElement;
-
- //////////////////////////////////////////////////////////////////////
- // CONSTRUCTORS / INITIALIZERS
-
- /**
- * @param name The name of this recorder (used as the filename).
- */
- protected CoverageRecorderEntry(String name, String recordTaskName) {
- filename = name;
- this.recordTaskName = recordTaskName;
- startBuild();
- }
-
- /**
- * Returns a default DocumentBuilder instance or throws an
- * ExceptionInInitializerError if it can't be created.
- *
- * @return a default DocumentBuilder instance.
- */
- protected static DocumentBuilder getDocumentBuilder() {
- try {
- return DocumentBuilderFactory.newInstance().newDocumentBuilder();
- } catch (ParserConfigurationException exc) {
- throw new ExceptionInInitializerError(exc.getMessage());
- }
- }
-
- /** Utility class representing the time an element started. */
- protected static class TimedElement {
- /**
- * Start time in milliseconds
- * (as returned by System.currentTimeMillis()
).
- */
- private long startTime;
- /** Element created at the start time. */
- private Element element;
- public String toString() {
- return element.getTagName() + ":" + element.getAttribute("name");
- }
- }
-
- /**
- * Returns the stack of timed elements for the current thread.
- * @return the stack of timed elements for the current thread
- */
- protected Stack getStack() {
- Stack threadStack = threadStacks.get(Thread.currentThread());
- if (threadStack == null) {
- threadStack = new Stack();
- threadStacks.put(Thread.currentThread(), threadStack);
- }
- /* For debugging purposes uncomment:
- org.w3c.dom.Comment s = doc.createComment("stack=" + threadStack);
- buildElement.element.appendChild(s);
- */
- return threadStack;
- }
-
- //////////////////////////////////////////////////////////////////////
- // ACCESSOR METHODS
-
- /**
- * @return the name of the file the output is sent to.
- */
- public String getFilename() {
- return filename;
- }
-
- /**
- * Turns off or on this recorder.
- *
- * @param state true for on, false for off, null for no change.
- */
- public void setRecordState(Boolean state) {
- if (state != null) {
- record = state.booleanValue();
- }
- }
-
- /**
- * @see org.apache.tools.ant.BuildListener#buildStarted(BuildEvent)
- */
- /** {@inheritDoc}. */
- public void buildStarted(BuildEvent event) {
-
- }
-
- /**
- * @see org.apache.tools.ant.BuildListener#buildFinished(BuildEvent)
- */
- /** {@inheritDoc}. */
- public void buildFinished(BuildEvent event) {
- cleanup();
- }
-
- /**
- * Cleans up any resources held by this recorder entry at the end
- * of a subbuild if it has been created for the subbuild's project
- * instance.
- *
- * @param event the buildFinished event
- *
- * @since Ant 1.6.2
- */
- public void subBuildFinished(BuildEvent event) {
- if (event.getProject() == project) {
- cleanup();
- }
- }
-
- /**
- * Empty implementation to satisfy the BuildListener interface.
- *
- * @param event the buildStarted event
- *
- * @since Ant 1.6.2
- */
- public void subBuildStarted(BuildEvent event) {
- }
-
- /**
- * @see org.apache.tools.ant.BuildListener#targetStarted(BuildEvent)
- */
- /** {@inheritDoc}. */
- public void targetStarted(BuildEvent event) {
- Target target = event.getTarget();
- TimedElement targetElement = new TimedElement();
- targetElement.startTime = System.currentTimeMillis();
- targetElement.element = doc.createElement(TARGET_TAG);
- targetElement.element.setAttribute(NAME_ATTR, target.getName());
- targets.put(target, targetElement);
- getStack().push(targetElement);
- }
-
- /**
- * @see org.apache.tools.ant.BuildListener#targetFinished(BuildEvent)
- */
- /** {@inheritDoc}. */
- public void targetFinished(BuildEvent event) {
- Target target = event.getTarget();
- TimedElement targetElement = (TimedElement) targets.get(target);
- if (targetElement != null) {
- long totalTime
- = System.currentTimeMillis() - targetElement.startTime;
- targetElement.element.setAttribute(TIME_ATTR,
- DateUtils.formatElapsedTime(totalTime));
-
- TimedElement parentElement = null;
- Stack threadStack = getStack();
- if (!threadStack.empty()) {
- threadStack.pop();
-// if (poppedStack != targetElement) {
-// throw new RuntimeException("Mismatch - popped element = "
-// + poppedStack
-// + " finished target element = "
-// + targetElement);
-// }
- if (!threadStack.empty()) {
- parentElement = threadStack.peek();
- }
- }
- if (parentElement == null) {
- buildElement.element.appendChild(targetElement.element);
- } else {
- parentElement.element.appendChild(targetElement.element);
- }
- }
- targets.remove(target);
- }
-
- /**
- * @see org.apache.tools.ant.BuildListener#taskStarted(BuildEvent)
- */
- /** {@inheritDoc}. */
- public void taskStarted(BuildEvent event) {
- TimedElement taskElement = new TimedElement();
- taskElement.startTime = System.currentTimeMillis();
- taskElement.element = doc.createElement(TASK_TAG);
-
- Task task = event.getTask();
- String name = event.getTask().getTaskName();
- if (name == null) {
- name = "";
- }
- taskElement.element.setAttribute(NAME_ATTR, name);
- taskElement.element.setAttribute(LOCATION_ATTR,
- event.getTask().getLocation().toString());
- tasks.put(task, taskElement);
- getStack().push(taskElement);
- }
-
- /**
- * @see org.apache.tools.ant.BuildListener#taskFinished(BuildEvent)
- */
- /** {@inheritDoc}. */
- public void taskFinished(BuildEvent event) {
-
-// if (event.getTask().getTaskName() != recordTaskName) {
- Task task = event.getTask();
- TimedElement taskElement = tasks.get(task);
- if (taskElement != null) {
- long totalTime = System.currentTimeMillis() - taskElement.startTime;
- taskElement.element.setAttribute(TIME_ATTR,
- DateUtils.formatElapsedTime(totalTime));
- Target target = task.getOwningTarget();
- TimedElement targetElement = null;
- if (target != null) {
- targetElement = (TimedElement) targets.get(target);
- }
- if (targetElement == null) {
- buildElement.element.appendChild(taskElement.element);
- } else {
- targetElement.element.appendChild(taskElement.element);
- }
- Stack threadStack = getStack();
- if (!threadStack.empty()) {
- threadStack.pop();
-// if (poppedStack != taskElement) {
-// throw new RuntimeException("Mismatch - popped element = "
-// + poppedStack + " finished task element = "
-// + taskElement);
-// }
- }
- tasks.remove(task);
-// } else {
-// throw new RuntimeException("Unknown task " + task + " not in " + tasks);
-// }
- }
- }
-
- /**
- * Get the TimedElement associated with a task.
- *
- * Where the task is not found directly, search for unknown elements which
- * may be hiding the real task
- */
- protected TimedElement getTaskElement(Task task) {
- TimedElement element = (TimedElement) tasks.get(task);
- if (element != null) {
- return element;
- }
-
- for (Task key : tasks.keySet()) {
- if (key instanceof UnknownElement) {
- if (((UnknownElement) key).getTask() == task) {
- return tasks.get(key);
- }
- }
- }
- return null;
- }
-
- /**
- * @see org.apache.tools.ant.BuildListener#messageLogged(BuildEvent)
- */
- /** {@inheritDoc}. */
- public void messageLogged(BuildEvent event) {
-
- }
-
- /**
- * @see BuildLogger#setMessageOutputLevel(int)
- */
- /** {@inheritDoc}. */
- public void setMessageOutputLevel(int level) {
- if (level >= Project.MSG_ERR && level <= Project.MSG_DEBUG) {
- loglevel = level;
- }
- }
-
- /**
- * @see BuildLogger#setOutputPrintStream(PrintStream)
- */
- /** {@inheritDoc}. */
- public void setOutputPrintStream(PrintStream output) {
- outStream = output;
- }
-
-
- /**
- * @see BuildLogger#setErrorPrintStream(PrintStream)
- */
- /** {@inheritDoc}. */
- public void setErrorPrintStream(PrintStream err) {
- setOutputPrintStream(err);
- }
-
- /**
- * Set the project associated with this recorder entry.
- *
- * @param project the project instance
- *
- * @since 1.6.2
- */
- public void setProject(Project project) {
- this.project = project;
- if (project != null) {
- project.addBuildListener(this);
- }
- }
-
- /**
- * @since 1.6.2
- */
- public void cleanup() {
- closeFile();
- if (project != null) {
- project.removeBuildListener(this);
- }
- project = null;
- }
-
- /**
- * Closes the file associated with this recorder.
- * Used by Recorder.
- * @since 1.6.3
- */
- void closeFile() {
- finishBuild();
- Writer out = null;
- try {
- // specify output in UTF8 otherwise accented characters will blow
- // up everything
- OutputStream stream = outStream;
- if (stream == null) {
- stream = new FileOutputStream(filename);
- }
- out = new OutputStreamWriter(stream, "UTF8");
- out.write("\n");
- (new DOMElementWriter()).write(buildElement.element, out, 0, "\t");
- out.flush();
- } catch (IOException exc) {
- throw new BuildException("Unable to write log file " + exc.getMessage(), exc);
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (IOException e) {
- e = null; // ignore
- }
- }
- }
- buildElement = null;
- }
-
- void startBuild() {
- buildElement = new TimedElement();
- buildElement.startTime = System.currentTimeMillis();
- buildElement.element = doc.createElement(BUILD_TAG);
- }
-
- void finishBuild() {
- long totalTime = System.currentTimeMillis() - buildElement.startTime;
- buildElement.element.setAttribute(TIME_ATTR,
- DateUtils.formatElapsedTime(totalTime));
- }
-
- @Override
- public void setEmacsMode(boolean emacsMode) {
- // Not needed.
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CoverageRecorderTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CoverageRecorderTask.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/CoverageRecorderTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -25,6 +25,8 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Recorder;
+import com.nokia.ant.listener.CoverageRecorderEntry;
+
/**
* Adds a listener, which inherits the Ant Record task, to the current build process that records the
* output to a XML file.
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/DeconfigureTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/DeconfigureTask.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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;
-
-
-/**
- * ANT wrapper task for the GSCM deconfigure.pl script.
- *
- * @ant.task category="SCM"
- */
-public class DeconfigureTask extends AbstractScmBaseTask {
- // The attributes of this task
- private Boolean considerBranchReleases;
-
- /**
- * Return the considerBranchReleases.
- *
- * @return the considerBranchReleases.
- */
- public Boolean getConsiderBranchReleases() {
- return considerBranchReleases;
- }
-
- /**
- * Set if we want deconfigure.pl script to check for branch differences
- * based on the 'included_releases' attribute of project.
- *
- * @param considerBranchReleases
- * @ant.not-required Default is no.
- */
- public void setconsiderBranchReleases(Boolean considerBranchReleases) {
- this.considerBranchReleases = considerBranchReleases;
- log("Set considerBranchReleases to " + considerBranchReleases);
- }
-
- /**
- * Build a command list consisting of all the required and optional command
- * arguments of the current task.
- */
- protected void buildCommandList() {
- addCommandArg("database", "-d", true, getDatabase());
- addCommandArg("password", "-P", true, getPassword());
- addCommandArg("ccmProject", "-p", true, getCcmProject());
- addCommandArg("considerBranchReleases", "-b", getConsiderBranchReleases());
- }
-
- /**
- * Method validates the given arguments.
- */
- protected void validateArguments() {
- // Do nothing
- }
-
- /**
- * Set the execution script.
- *
- */
- protected void setExecutionScript() {
- append2CommandString("deconfigure.pl");
- }
-
- /**
- * Method returns the correct verbosity level for the input choice.
- *
- * @param choice
- * is the verbosity choice set by user.
- * @return the verbosity level to set.
- */
- protected String getVerbosity(int choice) {
- String cmd = "";
- switch (choice) {
- case 0:
- cmd = "-q ";
- break;
- case 1:
- cmd = "-V ";
- break;
- case 2:
- cmd = "-W ";
- break;
- default:
- raiseError("Verbosity level is not recognised. "
- + "Legal values are: 0 - quiet, 1 - verbose or 2 - very verbose");
- }
- return cmd;
- }
-
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/HlmExecTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/HlmExecTask.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/HlmExecTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -38,28 +38,28 @@
*/
public void execute()
{
- String p = getProject().getProperty("number.of.threads");
- if (p != null)
+ String property = getProject().getProperty("number.of.threads");
+ if (property != null)
{
- ((ThreadPoolExecutor)threadPool).setCorePoolSize(Integer.parseInt(p));
- ((ThreadPoolExecutor)threadPool).setMaximumPoolSize(Integer.parseInt(p));
+ ((ThreadPoolExecutor)threadPool).setCorePoolSize(Integer.parseInt(property));
+ ((ThreadPoolExecutor)threadPool).setMaximumPoolSize(Integer.parseInt(property));
}
- TaskRunnable tr = new TaskRunnable();
- threadPool.submit(tr);
+ TaskRunnable taskRunnable = new TaskRunnable();
+ threadPool.submit(taskRunnable);
try {
synchronized (semaphore) {
- while (!tr.isFinished())
+ while (!taskRunnable.isFinished())
semaphore.wait();
}
} catch (InterruptedException e) { e.printStackTrace(); }
- Throwable t = tr.getException();
- if (t != null)
+ Throwable exception = taskRunnable.getException();
+ if (exception != null)
{
- if (t instanceof BuildException)
- throw (BuildException)t;
+ if (exception instanceof BuildException)
+ throw (BuildException)exception;
else
- t.printStackTrace();
+ exception.printStackTrace();
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/RBTTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/RBTTask.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,502 +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;
-
-
-/**
- * ANT wrapper task for the GSCM rbt.pl script.
- *
- *
- * Deconfigure Only:
- *
- * Usage: <hlm:rebaseanddeconf database="${dbname}"
- * password="${UNIX-password}"
- * verbosity="${0-3}"
- * ccmProject="${ccm.project.name}"
- * release="${release.name}"
- * deconfigure="yes" />
- *
- *
- *
- * Rebaseline Only:
- *
- * Usage: <hlm:rebaseanddeconf database="${dbname}"
- * password="${UNIX-password}"
- * verbosity="${0-3}"
- * ccmProject="${ccm.project.name}"
- * release="${release.name}"
- * releaseBaseline="yes"
- * skipDeconfigure="yes" />
- *
- *
- *
- * Rebaseline with deconfigure:
- *
- * Usage: <hlm:rebaseanddeconf database="${dbname}"
- * password="${UNIX-password}"
- * verbosity="${0-3}"
- * ccmProject="${ccm.project.name}"
- * release="${release.name}"
- * releaseBaseline="yes"
- * deconfigure="yes" />
- *
- *
- * @ant.task name="rebaseanddeconf" category="SCM"
- */
-public class RBTTask extends AbstractScmBaseTask {
-
- // The attributes of this task
- private String baseline; // -B baselinename = Four-part name of existing
- // baseline (incompatible with -p and -n)
- private String version; // -v version = New project hierarchy version
- private String release; // -r release = New release object name (Two-part
- // name)
- private String newBaselineName; // -n name = New baseline name
-
- private Boolean releaseBaseline; // -R = Release the newly created baseline
- private Boolean publish; // -P = Publish the newly created baseline
- private Boolean deconfigure; // -s = Replace subprojects only (NO
- // REBASELINE)
- private Boolean leaveFoldersWritable; // -F = Don't freeze folders (Leave
- // folders writable)
- private Boolean enableTaskRebadgingGenericRelease; // -t = Enable task
- // rebadging (associated
- // modifiable tasks with
- // generic release only)
- private Boolean enableTaskRebadging; // -T = Enable task rebadging (all
- // associated modifiable tasks)
- private Boolean rebadgeObjectVersions; // -o = Rebadge object versions
- // (requires ccm_admin)
- private Boolean createBaselineForRollingReleaseTag; // -i = Create
- // additional
- // integration baseline
- // for rolling-release
- // tag
- private Boolean skipDeconfigure; // -S = Do NOT replace subprojects (NO
- // DECONFIGURE)
- private Boolean active; // -a = Specified release remains active
- private Boolean useBranchReleaseMethodology; // -b = Utilize branch release
-
- // methodology
-
- /**
- * Return the baseline.
- *
- * @return the baseline.
- */
- public String getBaseline() {
- return baseline;
- }
-
- /**
- * Set four-part name of existing baseline (incompatible with 'projectName'
- * and 'baselineName' attributes) to be used by rebaseline.pl script.
- *
- * @param baseline
- * is the baseline to set
- * @ant.not-required
- */
- public void setBaseline(String baseline) {
- this.baseline = baseline;
- log("Set baseline to " + baseline);
- }
-
- /**
- * Return the version.
- *
- * @return the version.
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Set version of new project created.
- *
- * @param version
- * is the version to set.
- * @ant.not-required
- */
- public void setVersion(String version) {
- this.version = version;
- log("Set version to " + version);
- }
-
- /**
- * Return the leaveFoldersWritable.
- *
- * @return the leaveFoldersWritable.
- */
- public Boolean getLeaveFoldersWritable() {
- return leaveFoldersWritable;
- }
-
- /**
- * Set whether to leave the folders writable in the baseline project
- * created.
- *
- * @param leaveFoldersWritable
- * indicates whether to leave folders writable.
- * @ant.not-required Default is no.
- */
- public void setLeaveFoldersWritable(Boolean leaveFoldersWritable) {
- this.leaveFoldersWritable = leaveFoldersWritable;
- log("Set leaveFoldersWritable to " + leaveFoldersWritable);
- }
-
- /**
- * Return the rebadgeObjectVersions
- *
- * @return the rebadgeObjectVersions.
- */
- public Boolean getRebadgeObjectVersions() {
- return rebadgeObjectVersions;
- }
-
- /**
- * Set whether to rebadge object versions in the rebaseline.pl script.
- *
- * @param rebadgeObjectVersions
- * indicates whether to rebadge object versions to a given release tag.
- * @ant.not-required Default is no.
- */
- public void setRebadgeObjectVersions(Boolean rebadgeObjectVersions) {
- this.rebadgeObjectVersions = rebadgeObjectVersions;
- log("Set rebadgeObjectVersions to " + rebadgeObjectVersions);
- }
-
- /**
- * Return the releaseBaseline.
- *
- * @return the releaseBaseline.
- */
- public Boolean getReleaseBaseline() {
- return releaseBaseline;
- }
-
- /**
- * Set whether to release the newly created baseline or not.
- *
- * @param releaseBaseline
- * indicates whether to release the newly created baseline
- */
- public void setReleaseBaseline(Boolean releaseBaseline) {
- this.releaseBaseline = releaseBaseline;
- log("Set releaseBaseline to " + releaseBaseline);
- }
-
- /**
- * Return the publish.
- *
- * @return the publish.
- */
- public Boolean getPublish() {
- return publish;
- }
-
- /**
- * Set whether to publish the newly created baseline or not.
- *
- * @param publish
- * the publish to set
- */
- public void setPublish(Boolean publish) {
- this.publish = publish;
- log("Set publish to " + publish);
- }
-
- /**
- * Return the createBaselineForRollingReleaseTag.
- *
- * @return the createBaselineForRollingReleaseTag.
- */
- public Boolean getCreateBaselineForRollingReleaseTag() {
- return createBaselineForRollingReleaseTag;
- }
-
- /**
- * Set whether to create additional integration baseline for rolling-release
- * tag.
- *
- * @param createBaselineForRollingReleaseTag
- * @ant.not-required Default is no.
- */
- public void setCreateBaselineForRollingReleaseTag(
- Boolean createBaselineForRollingReleaseTag) {
- this.createBaselineForRollingReleaseTag = createBaselineForRollingReleaseTag;
- log("Set createBaselineForRollingReleaseTag to "
- + createBaselineForRollingReleaseTag);
- }
-
- /**
- * Return the enableTaskRebadgingGenericRelease.
- *
- * @return the enableTaskRebadgingGenericRelease.
- */
- public Boolean getEnableTaskRebadgingGenericRelease() {
- return enableTaskRebadgingGenericRelease;
- }
-
- /**
- * Set enable task rebadging (associated modifiable tasks with generic
- * release only). Not supported in rebaseline.pl
- *
- * @param enableTaskRebadgingGenericRelease
- * the enableTaskRebadgingGenericRelease to set
- */
- public void setEnableTaskRebadgingGenericRelease(
- Boolean enableTaskRebadgingGenericRelease) {
- this.enableTaskRebadgingGenericRelease = enableTaskRebadgingGenericRelease;
- log("Set enableTaskRebadgingGenericRelease to "
- + enableTaskRebadgingGenericRelease);
- }
-
- /**
- * Return the enableTaskRebadging
- *
- * @return the enableTaskRebadging.
- */
- public Boolean getEnableTaskRebadging() {
- return enableTaskRebadging;
- }
-
- /**
- * Set enable task rebadging (all associated modifiable tasks). Not supported in rebaseline.pl
- *
- * @param enableTaskRebadging
- * the enableTaskRebadging to set
- */
- public void setEnableTaskRebadging(Boolean enableTaskRebadging) {
- this.enableTaskRebadging = enableTaskRebadging;
- log("Set enableTaskRebadging to " + enableTaskRebadging);
- }
-
- /**
- * Return the skipDeconfigure.
- *
- * @return the skipDeconfigure.
- */
- public Boolean getSkipDeconfigure() {
- return skipDeconfigure;
- }
-
- /**
- * Set to skip deconfigure.
- *
- * @param skipDeconfigure
- * the skipDeconfigure to set
- */
- public void setSkipDeconfigure(Boolean skipDeconfigure) {
- this.skipDeconfigure = skipDeconfigure;
- log("Set skipDeconfigure to " + skipDeconfigure);
- }
-
- /**
- * Return the deconfigure
- *
- * @return the deconfigure.
- */
- public Boolean getDeconfigure() {
- return deconfigure;
- }
-
- /**
- * Set deconfigure.
- *
- * @param deconfigure
- * the deconfigure to set
- */
- public void setDeconfigure(Boolean deconfigure) {
- this.deconfigure = deconfigure;
- log("Set deconfigure to " + deconfigure);
- }
-
- /**
- * Return the active.
- *
- * @return the active.
- */
- public Boolean getActive() {
- return active;
- }
-
- /**
- * Set whether the current release is active or not.
- *
- * @param active
- * the active to set
- */
- public void setActive(Boolean active) {
- this.active = active;
- log("Set active to " + active);
- }
-
- /**
- * Return useBranchReleaseMethodology.
- *
- * @return the useBranchReleaseMethodology.
- */
- public Boolean getUseBranchReleaseMethodology() {
- return useBranchReleaseMethodology;
- }
-
- /**
- * Set whether to utilize branch release methodology or not.
- *
- * @param useBranchReleaseMethodology
- * is the boolean value to set.
- * @ant.not-required Default is no.
- */
- public void setUseBranchReleaseMethodology(
- Boolean useBranchReleaseMethodology) {
- this.useBranchReleaseMethodology = useBranchReleaseMethodology;
- log("Set useBranchReleaseMethodology to " + useBranchReleaseMethodology);
- }
-
- /**
- * Return the release tag.
- *
- * @return the release tag.
- */
- public String getRelease() {
- return release;
- }
-
- /**
- * Set release tag (Two-part name) for the release project created.
- *
- * @param release
- * is the release tag to set
- * @ant.not-required
- */
- public void setRelease(String release) {
- this.release = release;
- log("Set release to " + release);
- }
-
- /**
- * Return the newBaselineName.
- *
- * @return the newBaselineName.
- */
- public String getNewBaselineName() {
- return newBaselineName;
- }
-
- /**
- * Set new baseline name to use.
- *
- * @param newBaselineName
- * is the new baseline name to set.
- * @ant.not-required
- */
- public void setNewBaselineName(String newBaselineName) {
- this.newBaselineName = newBaselineName;
- log("Set newBaselineName to " + newBaselineName);
- }
-
- /**
- * Set the execution script.
- *
- */
- protected void setExecutionScript() {
- append2CommandString("rbt.pl");
- }
-
- /**
- * Build a command list consisting of all the required and optional command
- * arguments of the current task.
- */
- protected void buildCommandList() {
- addCommandArg("database", "-d", true, getDatabase());
- addCommandArg("password", "-U", true, getPassword());
- addCommandArg("ccmProject", "-p", getCcmProject());
- addCommandArg("baseline", "-B", getBaseline());
- addCommandArg("version", "-v", getVersion());
- addCommandArg("releaseBaseline", "-R", getReleaseBaseline());
- addCommandArg("publish", "-P", getPublish());
- addCommandArg("deconfigure", "-s", getDeconfigure());
- addCommandArg("leaveFoldersWritable", "-F", getLeaveFoldersWritable());
- addCommandArg("enableTaskRebadgingGenericRelease", "-t", getEnableTaskRebadgingGenericRelease());
- addCommandArg("enableTaskRebadging", "-T", getEnableTaskRebadging());
- addCommandArg("rebadgeObjectVersions", "-o", getRebadgeObjectVersions());
- addCommandArg("createBaselineForRollingReleaseTag", "-i", getCreateBaselineForRollingReleaseTag());
- addCommandArg("active", "-a", getActive());
- addCommandArg("skipDeconfigure", "-S", getSkipDeconfigure());
- addCommandArg("useBranchReleaseMethodology", "-b", getUseBranchReleaseMethodology());
- addCommandArg("release", "-r", getRelease());
- addCommandArg("newBaselineName", "-n", getNewBaselineName());
- }
-
- /**
- * Method validates the given arguments.
- */
- protected void validateArguments() {
-
- if (baseline != null && (getCcmProject() != null || newBaselineName != null)) {
- raiseError("Option 'baseline' cannot be used with 'ccmProject' and 'newBaselineName'");
- }
-
- if (deconfigure != null && deconfigure && skipDeconfigure != null
- && skipDeconfigure) {
- raiseError("Use option either 'deconfigure' or 'skipDeconfigure'");
- }
-
- if (deconfigure != null && deconfigure && release == null) {
- raiseError("Option 'release' is mandatory if 'deconfigure' is set");
- }
-
- if (publish != null && publish && releaseBaseline != null
- && releaseBaseline) {
- raiseError("Use Option either 'publish' or 'releaseBaseline'");
- }
-
- if (enableTaskRebadging != null && enableTaskRebadging
- && enableTaskRebadgingGenericRelease != null
- && enableTaskRebadgingGenericRelease) {
- raiseError("Use Option either 'enableTaskRebadging' or 'enableTaskRebadgingGenericRelease'");
- }
- }
-
- /**
- * {@inheritDoc}
- */
- protected String getVerbosity(int choice) {
- String cmd = "";
- switch (choice) {
- case 0:
- cmd = "-Q";
- break;
- case 1:
- cmd = "-V";
- break;
- case 2:
- cmd = "-I";
- break;
- case 3:
- cmd = "-W";
- break;
- default:
- raiseError("Verbosity level is not recognised. "
- + "Legal values are: 0 - quiet, 1 - verbose, 2 - Interactive "
- + "or 3 - Walk-through Rehearsal");
- }
- return cmd;
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/RebaselineTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/RebaselineTask.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,109 +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;
-
-
-/**
- * ANT wrapper task for the GSCM rebaseline.pl script.
- * <hlm:rebaseline database="to1tobet" ccmProject="helium-to1tobet#helium_4.49:project:vc1s60p1#1" password="test"/>
- * @ant.task name="rebaseline" category="SCM"
- */
-public class RebaselineTask extends RBTTask {
- // The attributes of this task
- private Boolean disableTaskRebadging;
-
- /**
- * Return disableTaskRebadging
- *
- * @return the disableTaskRebadging.
- */
- public Boolean getDisableTaskRebadging() {
- return disableTaskRebadging;
- }
-
- /**
- * Set whether to disable task rebadging (incompatible with
- * 'rebadgeObjectVersions' attribute) in the rebaseline.pl script.
- *
- * @param disableTaskRebadging
- * @ant.not-required Default is no.
- */
- public void setdisableTaskRebadging(Boolean disableTaskRebadging) {
- this.disableTaskRebadging = disableTaskRebadging;
- log("Set disableTaskRebadging to " + disableTaskRebadging);
- }
-
- /**
- * Set the execution script.
- *
- */
- protected void setExecutionScript() {
- append2CommandString("rebaseline.pl");
- }
-
- /**
- * Build a command list consisting of all the required and optional command
- * arguments of the current task.
- */
- protected void buildCommandList() {
- addCommandArg("database", "-d", true, getDatabase());
- addCommandArg("password", "-P", true, getPassword());
- addCommandArg("ccmProject", "-p", true, getCcmProject());
- addCommandArg("release", "-r", getRelease());
- addCommandArg("baseline", "-B", getBaseline());
- addCommandArg("version", "-v", getVersion());
- addCommandArg("newBaselineName", "-n", getNewBaselineName());
- addCommandArg("releaseBaseline", "-R", getReleaseBaseline());
- addCommandArg("leaveFolderswritable", "-w", getLeaveFoldersWritable());
- addCommandArg("disableTaskRebadging", "-x", getDisableTaskRebadging());
- addCommandArg("rebadgeObjectVersions", "-a", getRebadgeObjectVersions());
- addCommandArg("useBranchReleaseMethodology", "-b", getUseBranchReleaseMethodology());
- addCommandArg("createBaselineForRollingReleaseTag", "-i", getCreateBaselineForRollingReleaseTag());
- }
-
- /**
- * Method returns the correct verbosity level for the input choice.
- *
- * @param choice
- * is the verbosity choice set by user.
- * @return the verbosity level to set.
- */
- protected String getVerbosity(int choice) {
- String cmd = "";
- switch (choice) {
- case 0:
- cmd = "-q ";
- break;
- case 1:
- cmd = "-V ";
- break;
- default:
- raiseError("Verbosity level is not recognised. "
- + "Legal values are: 0 - quiet, 1 - verbose.");
- }
- return cmd;
- }
-
- /**
- * Method validates the given arguments.
- */
- protected void validateArguments() {
- // Do nothing
- }
-
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/Signal.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/Signal.java Tue Apr 27 08:33:08 2010 +0300
+++ /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:
-*
-*/
-
-
-package com.nokia.ant.taskdefs;
-
-/**
- * This class stores a signal while being deferred.
- *
- */
-public class Signal {
-
- private String name;
- private String message;
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/StopLogToConsole.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/StopLogToConsole.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +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 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"
- */
-public class StopLogToConsole 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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/StopLogToConsoleTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/StopLogToConsoleTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* 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 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"
+ */
+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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/AddTask.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/AddTask.java Tue Apr 27 08:33:08 2010 +0300
+++ /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:
-*
-*/
-
-package com.nokia.ant.taskdefs.ccm.commands;
-
-import java.util.Vector;
-import com.nokia.ant.types.ccm.Task;
-
-/**
- * This object creates new ccm task and contains all the Tasks in a list.
- *
- */
-public class AddTask extends CcmCommand
-{
- private String folder;
- private Vector tasks = new Vector();
-
- public String getFolder()
- {
- return folder;
- }
-
- public void setFolder(String folder)
- {
- this.folder = folder;
- }
-
- public Task createTask() {
- Task task = new Task();
- tasks.add(task);
- return task;
- }
-
- public Task[] getTasks() {
- Task[] result = new Task[tasks.size()];
- tasks.copyInto(result);
- return result;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/CcmCommand.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/CcmCommand.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +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.ccm.commands;
-
-import com.nokia.ant.taskdefs.CcmTask;
-
-/**
- * Creates command string based on runtime class name.
- *
- */
-public class CcmCommand
-{
- private CcmTask task;
-
- /**
- * @return the task
- */
- public CcmTask getTask()
- {
- return task;
- }
-
- /**
- * @param task
- * the task to set
- */
- public void setTask(CcmTask task)
- {
- this.task = task;
- }
-
-
- public String getName()
- {
- String className = getClass().getName();
- String commandName = className.substring(className.lastIndexOf('.') + 1).toLowerCase();
- return commandName;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/ChangeReleaseTag.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/ChangeReleaseTag.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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.ccm.commands;
-
-/**
- * This object contains the current release tag.
- *
- */
-public class ChangeReleaseTag extends CcmCommand
-{
- private String folder;
- private String newreleasetag;
-
-
- public String getFolder()
- {
- return folder;
- }
-
- public void setFolder(String folder)
- {
- this.folder = folder;
- }
-
- public String getReleaseTag()
- {
- return newreleasetag;
- }
-
- public void setReleasetag(String newreleasetag)
- {
- this.newreleasetag = newreleasetag;
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Checkout.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Checkout.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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.ccm.commands;
-
-/**
- * This object is used to check out a ccm project.
- *
- */
-public class Checkout extends CcmCommand
-{
- private String project;
- private String release;
- private String version;
- private String purpose;
- private String wa;
- private boolean recursive;
- private boolean relative;
-
- public String getProject()
- {
- return project;
- }
-
- public void setProject(String project)
- {
- this.project = project;
- }
-
- public String getRelease()
- {
- return release;
- }
-
- public void setRelease(String release)
- {
- this.release = release;
- }
-
- public String getVersion()
- {
- return version;
- }
-
- public void setVersion(String version)
- {
- this.version = version;
- }
-
- public String getPurpose()
- {
- return purpose;
- }
-
- public void setPurpose(String purpose)
- {
- this.purpose = purpose;
- }
-
- public String getWa()
- {
- return wa;
- }
-
- public void setWa(String wa)
- {
- this.wa = wa;
- }
-
- public boolean getRecursive()
- {
- return recursive;
- }
-
- public void setRecursive(boolean recursive)
- {
- this.recursive = recursive;
- }
-
- public boolean getRelative()
- {
- return relative;
- }
-
- public void setRelative(boolean relative)
- {
- this.relative = relative;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Close.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Close.java Tue Apr 27 08:33:08 2010 +0300
+++ /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.ant.taskdefs.ccm.commands;
-/**
- * To close the ccm session
- *
- */
-public class Close extends CcmCommand
-{
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Reconcile.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Reconcile.java Tue Apr 27 08:33:08 2010 +0300
+++ /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.taskdefs.ccm.commands;
-
-/**
- * This object is used to reconcile a ccm project.
- *
- */
-public class Reconcile extends CcmCommand
-{
- private String project;
-
- public String getProject()
- {
- return project;
- }
-
- public void setProject(String project)
- {
- this.project = project;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Snapshot.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Snapshot.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +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.ccm.commands;
-
-/**
- * This object is used to snap shot a ccm project.
- *
- */
-public class Snapshot extends CcmCommand
-{
- private String project;
- private String dir;
- private boolean recursive;
- private boolean fast;
-
- public String getProject()
- {
- return project;
- }
-
- public void setProject(String project)
- {
- this.project = project;
- }
-
- public String getDir()
- {
- return dir;
- }
-
- public void setDir(String dir)
- {
- this.dir = dir;
- }
-
- public boolean getRecursive()
- {
- return recursive;
- }
-
- public void setRecursive(boolean recursive)
- {
- this.recursive = recursive;
- }
-
- public boolean getFast()
- {
- return fast;
- }
-
- public void setFast(boolean fast)
- {
- this.fast = fast;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Synchronize.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Synchronize.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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.ccm.commands;
-
-/**
- * This object is used to Synchronize a ccm project.
- *
- */
-public class Synchronize extends CcmCommand
-{
- private String project;
- private boolean recursive = true;
-
-
- public String getProject()
- {
- return project;
- }
-
- public void setProject(String project)
- {
- this.project = project;
- }
-
- public boolean getRecursive()
- {
- return recursive;
- }
-
- public void setRecursive(boolean recursive)
- {
- this.recursive = recursive;
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Update.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Update.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +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.ccm.commands;
-/**
- * This object is used to update a ccm project.
- *
- */
-public class Update extends CcmCommand
-{
- private String project;
-
- public String getProject()
- {
- return project;
- }
-
- public void setProject(String project)
- {
- this.project = project;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Workarea.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/taskdefs/ccm/commands/Workarea.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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.ccm.commands;
-/**
- * Creates interface to get\set workarea informations for a given project.
- *
- */
-public class Workarea extends CcmCommand
-{
- private String project;
- private String path;
- private String pst;
- private boolean maintain;
- private boolean recursive;
- private boolean relative;
- private boolean wat;
-
- public String getProject()
- {
- return project;
- }
-
- public void setProject(String project)
- {
- this.project = project;
- }
-
- public boolean getMaintain()
- {
- return maintain;
- }
-
- public void setMaintain(boolean maintain)
- {
- this.maintain = maintain;
- }
-
- public boolean getRecursive()
- {
- return recursive;
- }
-
- public void setRecursive(boolean recursive)
- {
- this.recursive = recursive;
- }
-
- public boolean getRelative()
- {
- return relative;
- }
-
- public void setRelative(boolean relative)
- {
- this.relative = relative;
- }
-
- public String getPath()
- {
- return path;
- }
-
- public void setPath(String path)
- {
- this.path = path;
- }
-
- public String getPst()
- {
- return pst;
- }
-
- public void setPst(String pst)
- {
- this.pst = pst;
- }
-
- public boolean getWat()
- {
- return wat;
- }
-
- public void setWat(boolean wat)
- {
- this.wat = wat;
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/Session.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/Session.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +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.types.ccm;
-
-import org.apache.tools.ant.types.DataType;
-
-/**
- * This class abstract a synergy session.
- * It store the address to an already existing session.
- * @ant.type name="session" category="SCM"
- */
-public class Session extends DataType {
- // store the ccm_addr value
- private String addr;
-
- /**
- * Sets the synergy address.
- * @param addr string representing the ccm_addr
- */
- public void setAddr(String addr) {
- this.addr = addr;
- }
-
- /**
- * Get the synergy address.
- * @return string representing the ccm_addr
- */
- public String getAddr() {
- return this.addr;
- }
-}
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/SessionSet.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/SessionSet.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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.types.ccm;
-
-import org.apache.tools.ant.types.DataType;
-import java.util.Vector;
-
-/**
- * This class implement an Ant Datatype that represents a set of
- * synergy sessions.
- * @ant.type name="sessionset" category="SCM"
- */
-public class SessionSet extends DataType {
- private Vector sessions = new Vector();
-
- /**
- * Create and register a Session object.
- * @return a Session object.
- */
- public Session createSession() {
- Session session = new Session();
- sessions.add(session);
- return session;
- }
-
- /**
- * Returns an array of Session object.
- * @returns an array of Session object
- */
- public Session[] getSessions() {
- Session[] result = new Session[sessions.size()];
- sessions.copyInto(result);
- return result;
- }
-}
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/Task.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/Task.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +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.types.ccm;
-
-import org.apache.tools.ant.types.DataType;
-
-/**
- * This class abstract a synergy session.
- * It store the address to an already existing session.
- */
-public class Task extends DataType {
- // store the ccm_addr value
- private String name;
-
- /**
- * Sets the synergy address.
- * @param name string representing the ccm_addr
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Get the synergy address.
- * @return string representing the ccm_addr
- */
- public String getName() {
- return name;
- }
-}
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/TaskSet.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ant/types/ccm/TaskSet.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +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.types.ccm;
-
-import org.apache.tools.ant.types.DataType;
-import java.util.Vector;
-
-/**
- * This class abstract a synergy session.
- * It store the address to an already existing session.
- */
-public class TaskSet extends DataType {
- // store the Task objects
- private Vector tasks = new Vector();
-
- /**
- * Create and register a Session object.
- * @return a Session object.
- */
- public Task createTask() {
- Task task = new Task();
- tasks.add(task);
- return task;
- }
-
- /**
- * Returns an array of Session object.
- * @returns an array of Session object
- */
- public Task[] getSessions() {
- Task[] result = new Task[tasks.size()];
- tasks.copyInto(result);
- return result;
- }
-}
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/ivy/ToolResolver.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/ivy/ToolResolver.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/ivy/ToolResolver.java Wed Jun 16 16:51:40 2010 +0300
@@ -132,8 +132,8 @@
continue;
}
if (versionMatcher.needModuleDescriptor(mrid, foundMrid)) {
- ResolvedResource r = rmdparser.parse(rres.getResource(), rres.getRevision());
- ModuleDescriptor md = ((MDResolvedResource)r).getResolvedModuleRevision().getDescriptor();
+ ResolvedResource resolvedResource = rmdparser.parse(rres.getResource(), rres.getRevision());
+ ModuleDescriptor md = ((MDResolvedResource)resolvedResource).getResolvedModuleRevision().getDescriptor();
if (md.isDefault()) {
Message.debug("\t" + name + ": default md rejected by version matcher requiring module descriptor: " + rres);
rejected.add(rres.getRevision() + " (MD)");
@@ -143,7 +143,7 @@
rejected.add(rres.getRevision() + " (MD)");
continue;
} else {
- found = r;
+ found = resolvedResource;
}
} else {
found = rres;
@@ -242,13 +242,13 @@
Message.debug("\t\tm2compatible: " + isM2compatible());
Message.debug("\t\tivy patterns:");
for (ListIterator iter = getIvyPatterns().listIterator(); iter.hasNext();) {
- String p = (String)iter.next();
- Message.debug("\t\t\t" + p);
+ String pattern = (String)iter.next();
+ Message.debug("\t\t\t" + pattern);
}
Message.debug("\t\tartifact patterns:");
for (ListIterator iter = getArtifactPatterns().listIterator(); iter.hasNext();) {
- String p = (String)iter.next();
- Message.debug("\t\t\t" + p);
+ String pattern = (String)iter.next();
+ Message.debug("\t\t\t" + pattern);
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/src/com/nokia/tools/configuration/CONFIGURATIONTool.java
--- a/buildframework/helium/sf/java/legacy/src/com/nokia/tools/configuration/CONFIGURATIONTool.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/legacy/src/com/nokia/tools/configuration/CONFIGURATIONTool.java Wed Jun 16 16:51:40 2010 +0300
@@ -17,8 +17,8 @@
package com.nokia.tools.configuration;
+import com.nokia.helium.core.ant.MappedVariable;
import com.nokia.helium.core.ant.types.VariableSet;
-import com.nokia.helium.core.ant.types.Variable;
import com.nokia.tools.*;
import org.apache.tools.ant.Project;
@@ -45,7 +45,7 @@
String report = null;
String varName;
String value;
- for (Variable variable : varSet.getVariables()) {
+ for (MappedVariable variable : varSet.getVariables()) {
varName = variable.getName();
value = variable.getValue();
if (varName.equals("path")) {
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/tests/antunit/test_deconfigure_task.ant.xml
--- a/buildframework/helium/sf/java/legacy/tests/antunit/test_deconfigure_task.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-
-
-
-
- Deconfigure testing targets for script deconfigure.pl
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/tests/antunit/test_rebaseanddeconf_task.ant.xml
--- a/buildframework/helium/sf/java/legacy/tests/antunit/test_rebaseanddeconf_task.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,263 +0,0 @@
-
-
-
-
- Rebaseline and Deconfigure testing targets for script rbt.pl
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/legacy/tests/antunit/test_rebaseline_task.ant.xml
--- a/buildframework/helium/sf/java/legacy/tests/antunit/test_rebaseline_task.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-
-
-
-
- Rebaseline testing targets for script rebaseline.pl
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -22,9 +22,9 @@
-->
-
-
-
+
+
+
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/AntLoggingHandler.java Wed Jun 16 16:51:40 2010 +0300
@@ -44,15 +44,14 @@
*/
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 HashMap fileCreatedMap;
private boolean isStageRecordingHappening;
private boolean loggingStarted;
- private boolean isStageInformationInited;
- private boolean isDefaultStageStarted;
private int loglevel = -1;
private VerbosityLevelChoices antLogLevel;
private Logger log = Logger.getLogger(AntLoggingHandler.class);
@@ -71,7 +70,7 @@
stageRecordMap = new HashMap();
depStartTargetMap = new HashMap>();
stageStartTargetMap = new HashMap();
- fileCreatedMap = new HashMap();
+ initStagesInformation(project);
}
/**
@@ -93,7 +92,11 @@
log.debug("Stopping stage logging for [" + currentStageName
+ "] for target [" + event.getTarget().getName() + "]");
stopLog(currentStageName, "default");
- startLog("default");
+ if (!isDefaultStageStarted)
+ {
+ startLog("default");
+ isDefaultStageStarted = true;
+ }
currentStageName = null;
}
}
@@ -104,25 +107,23 @@
public void handleTargetStarted(BuildEvent event) {
// log.debug("Started target [" + event.getTarget().getName() + "]");
- if (!this.isStageInformationInited) {
- initStagesInformation(event.getProject());
- this.isStageInformationInited = true;
+
+ if (getLoggingStarted() && !isDefaultStageStarted) {
+ startLog("default");
+ isDefaultStageStarted = true;
}
- if (this.isStageInformationInited && getLoggingStarted()
- && !this.isDefaultStageStarted) {
- startLog("default");
- this.isDefaultStageStarted = true;
- }
-
- if (currentStageName == null && !getIsStageRecordingHappening()
- && (getLoggingStarted())) {
- String stageName = isStageValid(event.getTarget(), event
- .getProject());
+ 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() + "]");
- stopLog("default", stageName);
+
+ if (isDefaultStageStarted)
+ {
+ stopLog("default", stageName);
+ isDefaultStageStarted = false;
+ }
startLog(stageName);
currentStageName = stageName;
}
@@ -147,7 +148,11 @@
*/
if (getLoggingStarted() && getIsStageRecordingHappening()) {
stopLog(currentStageName, "default");
- startLog("default");
+ if (!isDefaultStageStarted)
+ {
+ startLog("default");
+ isDefaultStageStarted = true;
+ }
currentStageName = null;
}
@@ -155,8 +160,9 @@
* If default stage logging happening stop logging into default ant log
* file.
*/
- if (this.isDefaultStageStarted && getLoggingStarted()) {
+ if (isDefaultStageStarted && getLoggingStarted()) {
stopLog("default", null, event);
+ isDefaultStageStarted = false;
}
this.cleanup();
}
@@ -202,6 +208,7 @@
private void cleanup() {
log.debug("Cleaning up recorder entries of stagerecord");
recorderEntries.clear();
+ fileCreatedMap.clear();
}
@@ -239,6 +246,8 @@
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();
@@ -337,7 +346,6 @@
* @param stageName
*/
private void startLog(String stageName) {
-
File fileName;
String message;
String time = getDateTime();
@@ -371,8 +379,7 @@
* @param stageLogging
* @return
*/
- private boolean isFilePresent(RecorderEntry recorderEntry, File fileName,
- StageLogging stageLogging) {
+ private boolean isFilePresent(RecorderEntry recorderEntry, File fileName, StageLogging stageLogging) {
log.debug("isFilePresent? " + fileName);
if (!fileCreatedMap.get(fileName)) {
if (!fileName.getParentFile().exists()) {
@@ -381,12 +388,8 @@
}
if (fileName.exists()) {
long timestamp = System.currentTimeMillis();
- StatusAndLogListener.getStatusAndLogListener().getProject()
- .log(
- "Backing up of " + fileName + " into "
- + fileName + "." + timestamp);
- fileName.renameTo(new File(fileName.getAbsoluteFile() + "."
- + timestamp));
+ getProject().log("Backing up of " + fileName + " into " + fileName + "." + timestamp);
+ fileName.renameTo(new File(fileName.getAbsoluteFile() + "." + timestamp));
}
recorderEntry.openFile(stageLogging.getAppend());
fileCreatedMap.put(fileName, true);
@@ -416,7 +419,6 @@
*/
private void stopLog(String stopStageName, String startStageName,
BuildEvent event) {
-
File fileName;
String message;
String time = getDateTime();
@@ -463,7 +465,8 @@
recorderEntry.setMessageOutputLevel(loglevel);
recorderEntry.setEmacsMode(false);
recorderEntry.setRecordState(false);
- fileCreatedMap.put(fileName, false);
+ if (fileCreatedMap.get(fileName) == null)
+ fileCreatedMap.put(fileName, false);
}
/**
@@ -474,14 +477,9 @@
* @return
*/
private String isStageValid(Target target, Project proj) {
-
- if (!proj.getName().equals(
- StatusAndLogListener.getStatusAndLogListener().getProject()
- .getName())
- && (StatusAndLogListener.getStatusAndLogListener().getProject()
- .getName() != null)) {
+ //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())
@@ -672,8 +670,7 @@
}
}
}
- throw new BuildException(
- "There should be one default stagerecord datatype.");
+ throw new BuildException("There should be one default stagerecord datatype.");
}
/**
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/RecorderEntry.java Wed Jun 16 16:51:40 2010 +0300
@@ -333,14 +333,14 @@
* Registering ourselves to the StatusAndLogListener.
*/
public void register() {
- StatusAndLogListener l = StatusAndLogListener.getStatusAndLogListener();
- if (l != null) {
+ StatusAndLogListener listener = StatusAndLogListener.getStatusAndLogListener();
+ if (listener != null) {
this.log.debug("register");
- synchronized (l) {
- l.register((BuildEventHandler)this);
- l.register((TargetEventHandler)this);
- l.register((TaskEventHandler)this);
- l.register((MessageEventHandler)this);
+ synchronized (listener) {
+ listener.register((BuildEventHandler)this);
+ listener.register((TargetEventHandler)this);
+ listener.register((TaskEventHandler)this);
+ listener.register((MessageEventHandler)this);
}
}
}
@@ -349,14 +349,14 @@
* Unregistering ourselves from the StatusAndLogListener.
*/
public void unregister() {
- StatusAndLogListener l = StatusAndLogListener.getStatusAndLogListener();
- if (l != null) {
+ StatusAndLogListener listener = StatusAndLogListener.getStatusAndLogListener();
+ if (listener != null) {
this.log.debug("unregister");
- synchronized (l) {
- l.remove((MessageEventHandler)this);
- l.remove((TaskEventHandler)this);
- l.remove((TargetEventHandler)this);
- l.remove((BuildEventHandler)this);
+ synchronized (listener) {
+ listener.remove((MessageEventHandler)this);
+ listener.remove((TaskEventHandler)this);
+ listener.remove((TargetEventHandler)this);
+ listener.remove((BuildEventHandler)this);
}
}
}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/listener/StatusAndLogListener.java Wed Jun 16 16:51:40 2010 +0300
@@ -188,7 +188,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void register ( Handler handler ) {
+ public synchronized void register( Handler handler ) {
Vector tmpBuildHandlers = new Vector(buildHandlers);
tmpBuildHandlers.add( handler );
buildHandlers = tmpBuildHandlers;
@@ -203,7 +203,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void remove ( Handler handler ) {
+ public synchronized void remove( Handler handler ) {
Vector tmpBuildHandlers = new Vector(buildHandlers);
tmpBuildHandlers.remove( handler );
buildHandlers = tmpBuildHandlers;
@@ -218,7 +218,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void register ( BuildEventHandler handler ) {
+ public synchronized void register( BuildEventHandler handler ) {
Vector tmp = new Vector(buildHandlers);
tmp.add( handler );
buildHandlers = tmp;
@@ -230,7 +230,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void remove ( BuildEventHandler handler ) {
+ public synchronized void remove( BuildEventHandler handler ) {
Vector tmp = new Vector(buildHandlers);
tmp.remove( handler );
buildHandlers = tmp;
@@ -242,7 +242,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void register ( TargetEventHandler handler ) {
+ public synchronized void register( TargetEventHandler handler ) {
Vector tmp = new Vector(targetHandlers);
tmp.add( handler );
targetHandlers = tmp;
@@ -254,7 +254,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void remove ( TargetEventHandler handler ) {
+ public synchronized void remove( TargetEventHandler handler ) {
Vector tmp = new Vector(targetHandlers);
tmp.remove( handler );
targetHandlers = tmp;
@@ -267,7 +267,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void register ( SubBuildEventHandler handler ) {
+ public synchronized void register( SubBuildEventHandler handler ) {
Vector tmp = new Vector(subBuildHandlers);
tmp.add( handler );
subBuildHandlers = tmp;
@@ -279,7 +279,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void remove ( SubBuildEventHandler handler ) {
+ public synchronized void remove( SubBuildEventHandler handler ) {
Vector tmp = new Vector(subBuildHandlers);
tmp.remove( handler );
subBuildHandlers = tmp;
@@ -291,7 +291,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void register ( MessageEventHandler handler ) {
+ public synchronized void register( MessageEventHandler handler ) {
Vector tmp = new Vector(messageHandlers);
tmp.add( handler );
messageHandlers = tmp;
@@ -303,7 +303,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void remove ( MessageEventHandler handler ) {
+ public synchronized void remove( MessageEventHandler handler ) {
Vector tmp = new Vector(messageHandlers);
tmp.remove( handler );
messageHandlers = tmp;
@@ -315,7 +315,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void register ( TaskEventHandler handler ) {
+ public synchronized void register( TaskEventHandler handler ) {
Vector tmp = new Vector(taskHandlers);
tmp.add( handler );
taskHandlers = tmp;
@@ -327,7 +327,7 @@
* @param handler
* is the handler to register
*/
- public synchronized void remove ( TaskEventHandler handler ) {
+ public synchronized void remove( TaskEventHandler handler ) {
Vector tmp = new Vector(taskHandlers);
tmp.remove( handler );
taskHandlers = tmp;
@@ -339,7 +339,7 @@
* @return
*/
public Project getProject() {
- return project;
+ return project;
}
/**
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogRecorder.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogRecorder.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,368 +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.taskdefs;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-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.types.RecordFilter;
-import com.nokia.helium.logger.ant.types.RecordFilterSet;
-
-/**
- * For recording ant logging output.
- *
- *
- * <hlm:record name="${build.log.dir}/${build.id}_test.log" action="start" append="false" backup="true" loglevel="info">
- * <hlm:recordfilterset refid="recordfilter.config"/>
- * <hlm:recordfilter category="info" regexp="^INFO:" />
- * </hlm:record>
- *
- *
- *
- * @ant.task name="Record" category="Logging".
- *
- */
-
-public class LogRecorder extends Task implements Handler {
-
- private static Hashtable recorderEntries = new Hashtable();
- private File fileName;
- private boolean append ;
- private Boolean start ;
- private boolean backup;
- private String backupProperty;
- private int loglevel = -1;
- private boolean emacsMode ;
- private Vector recordFilters = new Vector();
- private Vector recordFilterSet = new Vector();
- private Vector regExpList = new Vector();
-
-
- /**
- * Run by the task.
- */
- public void execute () {
- if (StatusAndLogListener.getStatusAndLogListener() == null) {
- log("The StatusAndLogListener is not available.", Project.MSG_WARN);
- return;
- }
- AntLoggingHandler antLoggingHandler = (AntLoggingHandler)StatusAndLogListener.getStatusAndLogListener().getHandler(AntLoggingHandler.class);
-
- /* To validate attributes passed. */
- validateAttributes();
-
- /* to add regular filters */
- addAllRecordFilters();
-
-
- /* Init password/record filter and replace any unset properties */
- initAndReplaceProperties();
-
- //Create the root folder path.
- if (this.start && this.start.booleanValue() && this.backup) {
- if (fileName.exists()) {
- File backupFile;
- try {
- backupFile = File.createTempFile(fileName.getName(), null, fileName.getParentFile());
- backupFile.delete();
- log("Backing up " + fileName + " as " + backupFile);
- if (!fileName.renameTo(backupFile)) {
- log("Error renaming the backup file.", Project.MSG_ERR);
- }
- if (backupFile.exists() && backupProperty != null) {
- getProject().setNewProperty(backupProperty, backupFile.getAbsolutePath());
- }
- } catch (IOException e) {
- log("Error creating the backup file: " + e, Project.MSG_ERR);
- }
- }
- }
- if (!fileName.getParentFile().exists()) {
- fileName.getParentFile().mkdirs();
- }
-
- RecorderEntry recorder = getRecorder(fileName, getProject());
- // set the values on the recorder
- recorder.setMessageOutputLevel(loglevel);
- recorder.setEmacsMode(emacsMode);
- if (start != null) {
- if (start.booleanValue()) {
- 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();
- recorder.setRecordState(start.booleanValue());
- } else {
- recorder.setRecordState(start.booleanValue());
- recorder.closeFile();
- if (antLoggingHandler != null) {
- if (antLoggingHandler.getCurrentStageName() != null) {
- antLoggingHandler.doLoggingAction(antLoggingHandler.getCurrentStageName(), true, "Starting", this, getOwningTarget());
- } else {
- antLoggingHandler.doLoggingAction("default", true, "Starting", this, getOwningTarget());
- }
- }
- }
- }
-
- }
- /**
- * To Validate is the fileName set for recording.
- */
- private void validateAttributes() {
- if (fileName == null) {
- throw new BuildException("filename attribute should be specified for helium recorder task.");
- }
-
- }
-
- /**
- * Set the file name to record.
- * @param fileName
- * @ant.required
- */
- public void setName(File fileName) {
- this.fileName = fileName;
- }
-
- /**
- * Return the fileName.
- * @return
- */
- public File getName() {
- return this.fileName;
- }
-
- /**
- * Set the append parameter.
- * @param append
- * @ant.not-required Default is false
- */
- public void setAppend(boolean append) {
- this.append = append;
- }
-
-
-
- /**
- * Enable backup of
- * @param backup
- * @ant.not-required
- */
- public void setBackup(boolean backup) {
- this.backup = backup;
- }
-
- /**
- * Name of the property that will contains the backed up log.
- * @param property a property name.
- * @ant.not-required Only works if backup is true.
- */
- public void setBackupProperty(String property) {
- this.backupProperty = property;
- }
-
- /**
- * Set logLevel to log the information.
- * @param level
- * @ant.not-required
- */
- public void setLoglevel(VerbosityLevelChoices level) {
- loglevel = level.getLevel();
- }
-
- /**
- * Set the EmacsMode.
- * @param emacsMode
- * @ant.not-required
- */
- public void setEmacsMode(boolean emacsMode) {
- this.emacsMode = emacsMode;
- }
-
- /**
- * Return the emacsMode.
- * @return
- */
- public boolean getEmacsMode() {
- return this.emacsMode;
- }
-
- /**
- * create the type of recorderfilter.
- * @param logFilter
- */
- public void addRecordFilter(RecordFilter logFilter) {
- if (!recordFilters.contains(logFilter)) {
- recordFilters.add(logFilter);
- }
- }
-
- /**
- * Create the type of recoderfilterset
- * @param logFilterSet
- */
- public void addRecordFilterSet(RecordFilterSet logFilterSet) {
- if (!recordFilterSet.contains(logFilterSet)) {
- recordFilterSet.add(logFilterSet);
- }
- }
-
- /**
- * Set the action of stop/start.
- * @param action
- * @ant.not-required
- */
- public void setAction(ActionChoices action) {
- if (action.getValue().equalsIgnoreCase("start")) {
- start = Boolean.TRUE;
- } else {
- start = Boolean.FALSE;
- }
- }
-
- /**
- * To get the action state of current recorder.
- * @return
- */
- public boolean getAction() {
- return start.booleanValue();
- }
-
-
- /**
- * A list of possible values for the setAction()
method.
- * Possible values include: start and stop.
- */
- public static class ActionChoices extends EnumeratedAttribute {
- private static final String[] VALUES = {"start", "stop"};
-
- /**
- * @see EnumeratedAttribute#getValues()
- */
- /** {@inheritDoc}. */
- public String[] getValues() {
- return VALUES;
- }
- }
-
- /**
- * To set the verbosity levels
- *
- *
- */
- public static class VerbosityLevelChoices extends LogLevel {
- }
-
-
- /**
- * To register the recorder entry
- */
- protected RecorderEntry getRecorder(File name, Project proj) {
- RecorderEntry entry = recorderEntries.get(name);
- if (entry == null) {
- // create a recorder entry
- entry = new RecorderEntry(name);
- for (String regExp : regExpList) {
- if (!regExp.equals("")) {
- String pattern = Pattern.quote(regExp);
- entry.addRegexp(pattern);
- }
- }
- entry.openFile(append);
- recorderEntries.put(fileName, entry);
- }
- return entry;
- }
-
- /**
- * Get all the recorderfilters from recorderfilterset refid.
- */
- public void addAllRecordFilters() {
- for (RecordFilterSet recFilterSet : recordFilterSet ) {
- recordFilters.addAll(recFilterSet.getAllFilters());
- }
- }
-
- public void handleBuildFinished(BuildEvent event) {
- // TODO Auto-generated method stub
-
- }
-
- 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
-
- }
-
- /**
- * To init password and record filters.
- * Replace with values if any property values are unset.
- */
- public void initAndReplaceProperties() {
-
- Pattern pattern = null;
- Matcher match = null;
- for (RecordFilter recordFilter : recordFilters) {
- if (recordFilter.getRegExp() == null) {
- throw new BuildException("\"regexp\" attribute should not have null value for recordfilter");
- }
- if (recordFilter.getRegExp() != null) {
- pattern = Pattern.compile("\\$\\{(.*)}");
- match = pattern.matcher(recordFilter.getRegExp());
- if (match.find()) {
- regExpList.add(getProject().replaceProperties(recordFilter.getRegExp()));
- } else {
- regExpList.add(recordFilter.getRegExp());
- }
- }
- }
- }
-
-
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogRecorderTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogRecorderTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,368 @@
+/*
+* 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.taskdefs;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Hashtable;
+import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildEvent;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+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.types.RecordFilter;
+import com.nokia.helium.logger.ant.types.RecordFilterSet;
+
+/**
+ * For recording ant logging output.
+ *
+ *
+ * <hlm:record name="${build.log.dir}/${build.id}_test.log" action="start" append="false" backup="true" loglevel="info">
+ * <hlm:recordfilterset refid="recordfilter.config"/>
+ * <hlm:recordfilter category="info" regexp="^INFO:" />
+ * </hlm:record>
+ *
+ *
+ *
+ * @ant.task name="Record" category="Logging".
+ *
+ */
+
+public class LogRecorderTask extends Task implements Handler {
+
+ private static Hashtable recorderEntries = new Hashtable();
+ private File fileName;
+ private boolean append ;
+ private Boolean start ;
+ private boolean backup;
+ private String backupProperty;
+ private int loglevel = -1;
+ private boolean emacsMode ;
+ private Vector recordFilters = new Vector();
+ private Vector recordFilterSet = new Vector();
+ private Vector regExpList = new Vector();
+
+
+ /**
+ * Run by the task.
+ */
+ public void execute() {
+ StatusAndLogListener statusAndLogListener = new StatusAndLogListener();
+ AntLoggingHandler antLoggingHandler = new AntLoggingHandler(getProject());
+ antLoggingHandler.setLoggingStarted(true);
+ statusAndLogListener.register(antLoggingHandler);
+
+ /* To validate attributes passed. */
+ validateAttributes();
+
+ /* to add regular filters */
+ addAllRecordFilters();
+
+ /* Init password/record filter and replace any unset properties */
+ initAndReplaceProperties();
+
+ //Create the root folder path.
+ if (this.start && this.start.booleanValue() && this.backup) {
+ if (fileName.exists()) {
+ File backupFile;
+ try {
+ backupFile = File.createTempFile(fileName.getName(), null, fileName.getParentFile());
+ backupFile.delete();
+ log("Backing up " + fileName + " as " + backupFile);
+ if (!fileName.renameTo(backupFile)) {
+ log("Error renaming the backup file.", Project.MSG_ERR);
+ }
+ if (backupFile.exists() && backupProperty != null) {
+ getProject().setNewProperty(backupProperty, backupFile.getAbsolutePath());
+ }
+ } catch (IOException e) {
+ log("Error creating the backup file: " + e, Project.MSG_ERR);
+ }
+ }
+ }
+ if (!fileName.getParentFile().exists()) {
+ fileName.getParentFile().mkdirs();
+ }
+
+ RecorderEntry recorder = getRecorder(fileName, getProject());
+ // set the values on the recorder
+ recorder.setMessageOutputLevel(loglevel);
+ 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();
+ 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());
+ }
+ }
+ }
+ }
+
+ }
+ /**
+ * To Validate is the fileName set for recording.
+ */
+ private void validateAttributes() {
+ if (fileName == null) {
+ throw new BuildException("filename attribute should be specified for helium recorder task.");
+ }
+
+ }
+
+ /**
+ * Set the file name to record.
+ * @param fileName
+ * @ant.required
+ */
+ public void setName(File fileName) {
+ this.fileName = fileName;
+ }
+
+ /**
+ * Return the fileName.
+ * @return
+ */
+ public File getName() {
+ return this.fileName;
+ }
+
+ /**
+ * Set the append parameter.
+ * @param append
+ * @ant.not-required Default is false
+ */
+ public void setAppend(boolean append) {
+ this.append = append;
+ }
+
+
+
+ /**
+ * Enable backup of
+ * @param backup
+ * @ant.not-required
+ */
+ public void setBackup(boolean backup) {
+ this.backup = backup;
+ }
+
+ /**
+ * Name of the property that will contains the backed up log.
+ * @param property a property name.
+ * @ant.not-required Only works if backup is true.
+ */
+ public void setBackupProperty(String property) {
+ this.backupProperty = property;
+ }
+
+ /**
+ * Set logLevel to log the information.
+ * @param level
+ * @ant.not-required
+ */
+ public void setLoglevel(VerbosityLevelChoices level) {
+ loglevel = level.getLevel();
+ }
+
+ /**
+ * Set the EmacsMode.
+ * @param emacsMode
+ * @ant.not-required
+ */
+ public void setEmacsMode(boolean emacsMode) {
+ this.emacsMode = emacsMode;
+ }
+
+ /**
+ * Return the emacsMode.
+ * @return
+ */
+ public boolean getEmacsMode() {
+ return this.emacsMode;
+ }
+
+ /**
+ * create the type of recorderfilter.
+ * @param logFilter
+ */
+ public void addRecordFilter(RecordFilter logFilter) {
+ if (!recordFilters.contains(logFilter)) {
+ recordFilters.add(logFilter);
+ }
+ }
+
+ /**
+ * Create the type of recoderfilterset
+ * @param logFilterSet
+ */
+ public void addRecordFilterSet(RecordFilterSet logFilterSet) {
+ if (!recordFilterSet.contains(logFilterSet)) {
+ recordFilterSet.add(logFilterSet);
+ }
+ }
+
+ /**
+ * Set the action of stop/start.
+ * @param action
+ * @ant.not-required
+ */
+ public void setAction(ActionChoices action) {
+ if (action.getValue().equalsIgnoreCase("start")) {
+ start = Boolean.TRUE;
+ } else {
+ start = Boolean.FALSE;
+ }
+ }
+
+ /**
+ * To get the action state of current recorder.
+ * @return
+ */
+ public boolean getAction() {
+ return start.booleanValue();
+ }
+
+
+ /**
+ * A list of possible values for the setAction()
method.
+ * Possible values include: start and stop.
+ */
+ public static class ActionChoices extends EnumeratedAttribute {
+ private static final String[] VALUES = {"start", "stop"};
+
+ /**
+ * @see EnumeratedAttribute#getValues()
+ */
+ /** {@inheritDoc}. */
+ public String[] getValues() {
+ return VALUES;
+ }
+ }
+
+ /**
+ * To set the verbosity levels
+ *
+ *
+ */
+ public static class VerbosityLevelChoices extends LogLevel {
+ }
+
+
+ /**
+ * To register the recorder entry
+ */
+ protected RecorderEntry getRecorder(File name, Project proj) {
+ RecorderEntry entry = recorderEntries.get(name);
+ if (entry == null) {
+ // create a recorder entry
+ entry = new RecorderEntry(name);
+ for (String regExp : regExpList) {
+ if (!regExp.equals("")) {
+ String pattern = Pattern.quote(regExp);
+ entry.addRegexp(pattern);
+ }
+ }
+ entry.openFile(append);
+ recorderEntries.put(fileName, entry);
+ }
+ return entry;
+ }
+
+ /**
+ * Get all the recorderfilters from recorderfilterset refid.
+ */
+ public void addAllRecordFilters() {
+ for (RecordFilterSet recFilterSet : recordFilterSet ) {
+ recordFilters.addAll(recFilterSet.getAllFilters());
+ }
+ }
+
+ public void handleBuildFinished(BuildEvent event) {
+ // TODO Auto-generated method stub
+
+ }
+
+ 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
+
+ }
+
+ /**
+ * To init password and record filters.
+ * Replace with values if any property values are unset.
+ */
+ public void initAndReplaceProperties() {
+
+ Pattern pattern = null;
+ Matcher match = null;
+ for (RecordFilter recordFilter : recordFilters) {
+ if (recordFilter.getRegExp() == null) {
+ throw new BuildException("\"regexp\" attribute should not have null value for recordfilter");
+ }
+ if (recordFilter.getRegExp() != null) {
+ pattern = Pattern.compile("\\$\\{(.*)}");
+ match = pattern.matcher(recordFilter.getRegExp());
+ if (match.find()) {
+ regExpList.add(getProject().replaceProperties(recordFilter.getRegExp()));
+ } else {
+ regExpList.add(recordFilter.getRegExp());
+ }
+ }
+ }
+ }
+
+
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogReplace.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogReplace.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +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.taskdefs;
-
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-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;
-
-/**
- * To replace the property values with real values if the properties are not set at the begining of the build.
- *
- * pre>
- * <hlm:logreplace regexp="${property.not.set}"/>
- *
- *
- * @ant.task name="logreplace" category="Logging".
- */
-public class LogReplace extends Task {
-
- private String regExp;
-
- /**
- * Run by the task.
- */
-
- public void execute () {
- if (StatusAndLogListener.getStatusAndLogListener() == null) {
- this.log("The StatusAndLogListener 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.");
- }
-
- if (antLoggingHandler != null) {
- String pattern = Pattern.quote(regExp);
- antLoggingHandler.addRegExp(pattern);
- }
- }
-
- /**
- * @param regExp the regExp to set
- * @ant.required
- */
- public void setRegExp(String regExp) {
- this.regExp = regExp;
- }
-
- /**
- * @return the regExp
- */
- public String getRegExp() {
- return regExp;
- }
-
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogReplaceTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/LogReplaceTask.java Wed Jun 16 16:51:40 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.logger.ant.taskdefs;
+
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+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;
+
+/**
+ * To replace the property values with real values if the properties are not set at the begining of the build.
+ *
+ * pre>
+ * <hlm:logreplace regexp="${property.not.set}"/>
+ *
+ *
+ * @ant.task name="logreplace" category="Logging".
+ */
+public class LogReplaceTask extends Task {
+
+ private String regExp;
+
+ /**
+ * Run by the task.
+ */
+
+ public void execute() {
+ if (StatusAndLogListener.getStatusAndLogListener() == null) {
+ this.log("The StatusAndLogListener 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.");
+ }
+
+ if (antLoggingHandler != null) {
+ String pattern = Pattern.quote(regExp);
+ antLoggingHandler.addRegExp(pattern);
+ }
+ }
+
+ /**
+ * @param regExp the regExp to set
+ * @ant.required
+ */
+ public void setRegExp(String regExp) {
+ this.regExp = regExp;
+ }
+
+ /**
+ * @return the regExp
+ */
+ public String getRegExp() {
+ return regExp;
+ }
+
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/TriggerLogger.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/TriggerLogger.java Tue Apr 27 08:33:08 2010 +0300
+++ /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:
-*
-*/
-package com.nokia.helium.logger.ant.taskdefs;
-
-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 org.apache.log4j.Logger;
-
-/**
- * This task is used to start the helium logging listener.
- * @ant.task name="triggerlogger" category="Logging"
- */
-public class TriggerLogger extends Task {
-
- private Logger log = Logger.getLogger(TriggerLogger.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);
- return;
- }
- AntLoggingHandler antLoggingHandler = (AntLoggingHandler)StatusAndLogListener.getStatusAndLogListener().getHandler(AntLoggingHandler.class);
- 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.");
- }
- } else {
- log.debug("Could not find the AntLoggingHandler instance.");
- }
- }
-
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/TriggerLoggerTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/taskdefs/TriggerLoggerTask.java Wed Jun 16 16:51:40 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.logger.ant.taskdefs;
+
+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 org.apache.log4j.Logger;
+
+/**
+ * This task is used to start the helium logging listener.
+ * @ant.task name="triggerlogger" category="Logging"
+ */
+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);
+ 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.");
+ }
+ } else {
+ log.debug("Could not find the AntLoggingHandler instance.");
+ }
+ }
+
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/Stage.java
--- a/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/Stage.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/Stage.java Wed Jun 16 16:51:40 2010 +0300
@@ -90,7 +90,7 @@
* @param target
* @return
*/
- public boolean isStartTarget ( String target ) {
+ public boolean isStartTarget( String target ) {
return this.startTarget.equals( target );
}
@@ -99,7 +99,7 @@
* @param target
* @return
*/
- public boolean isEndTarget ( String target ) {
+ public boolean isEndTarget( String target ) {
return this.endTarget.equals( target );
}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageLogging.java Wed Jun 16 16:51:40 2010 +0300
@@ -19,8 +19,6 @@
import java.io.File;
import org.apache.tools.ant.types.DataType;
-import com.nokia.helium.logger.ant.listener.AntLoggingHandler;
-import com.nokia.helium.logger.ant.listener.StatusAndLogListener;
import org.apache.log4j.Logger;
/**
@@ -53,16 +51,6 @@
private String stageRefId;
private Logger log = Logger.getLogger(getClass());
- /**
- * Constructor which will register the logging handler
- */
- public StageLogging () {
- if (!isAntLoggerRegistered && StatusAndLogListener.getStatusAndLogListener() != null) {
- log.debug("Registering stage record to the StatusAndLogListener listener");
- StatusAndLogListener.getStatusAndLogListener().register(new AntLoggingHandler(getProject()));
- isAntLoggerRegistered = true;
- }
- }
/**
* Sets output log file name.
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/src/com/nokia/helium/logger/ant/types/StageSummary.java Wed Jun 16 16:51:40 2010 +0300
@@ -17,7 +17,7 @@
package com.nokia.helium.logger.ant.types;
import java.io.File;
-
+import org.apache.tools.ant.Project;
import org.apache.log4j.Logger;
import org.apache.tools.ant.types.DataType;
@@ -43,7 +43,9 @@
private File template;
private Logger log = Logger.getLogger(getClass());
- public StageSummary () {
+ 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() );
@@ -56,7 +58,7 @@
*
* @return the template to display build stage summary.
*/
- public File getTemplate () {
+ public File getTemplate() {
return template;
}
@@ -67,7 +69,7 @@
* the template to set
* @ant.required
*/
- public void setTemplate ( File template ) {
+ public void setTemplate( File template ) {
this.template = template;
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/tests/antunit/run-scenario.ant.xml
--- a/buildframework/helium/sf/java/logging/tests/antunit/run-scenario.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/tests/antunit/run-scenario.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -20,7 +20,7 @@
============================================================================
-->
-
+
Helium Antlib logger macro.
@@ -36,18 +36,28 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/tests/scenarii/logger/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/logger/build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/logger/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -22,7 +22,8 @@
-->
Helium Antlib logger unittests.
-
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/tests/scenarii/valid_build/build.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/build.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/build.xml Wed Jun 16 16:51:40 2010 +0300
@@ -63,6 +63,7 @@
+
@@ -255,5 +256,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/logging/tests/scenarii/valid_build/prep-ccm-get-input.ant.xml
--- a/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/prep-ccm-get-input.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/logging/tests/scenarii/valid_build/prep-ccm-get-input.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -22,7 +22,7 @@
-->
Helium Antlib Logging unittests.
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ORMFMPPLoader.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ORMFMPPLoader.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ORMFMPPLoader.java Wed Jun 16 16:51:40 2010 +0300
@@ -31,8 +31,6 @@
import freemarker.template.SimpleNumber;
import freemarker.template.TemplateModelIterator;
import com.nokia.helium.jpa.ORMReader;
-import com.nokia.helium.jpa.ORMUtil;
-
import org.apache.log4j.Logger;
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
@@ -113,10 +111,10 @@
@Override
public void notifyProgressEvent(Engine engine, int event, File src,
int pMode, Throwable error, Object param) throws Exception {
- if (event == ProgressListener.EVENT_END_PROCESSING_SESSION) {
- log.debug("notifyProgressEvent - finalizeORM");
- ORMUtil.finalizeORM(dbPath);
- }
+ //if (event == ProgressListener.EVENT_END_PROCESSING_SESSION) {
+ // log.debug("notifyProgressEvent - finalizeORM");
+ // ORMUtil.finalizeORM(dbPath);
+ //}
}
}
@@ -144,16 +142,21 @@
//log.debug("QueryTemplateModel: query" + query);
if (queryMode.equals("jpasingle")) {
//log.debug("query executing with single result mode");
- resultObject = getModel((new ORMReader(dbPath)).executeSingleResult(query, returnType));
+ resultObject = getModel(dbPath, query, returnType);
+
} else {
//log.debug("query executing with multiple result mode");
- resultObject = new ORMQueryModel(new ORMReader(dbPath), query, queryMode, returnType);
+ resultObject = new ORMQueryModel(dbPath, query, queryMode, returnType);
}
return resultObject;
}
- private TemplateModel getModel(Object result) {
- return new ORMSequenceModel(result);
+ private TemplateModel getModel(String dbPath, String query,
+ String returnType) {
+ ORMReader reader = new ORMReader(dbPath);
+ ORMSequenceModel model = new ORMSequenceModel(reader.executeSingleResult(query, returnType));
+ reader.close();
+ return model;
}
public boolean isEmpty() {
@@ -199,8 +202,8 @@
private String query;
private String returnType;
- public ORMQueryModel (ORMReader reader, String queryString, String type, String retType) {
- ormReader = reader;
+ public ORMQueryModel(String dbPath, String queryString, String type, String retType) {
+ ormReader = new ORMReader(dbPath);
queryType = type;
query = queryString;
returnType = retType;
@@ -275,6 +278,7 @@
}
if (rowList == null || rowList.size() == 0) {
finished = true;
+ ormReader.close();
}
}
}
@@ -286,6 +290,5 @@
public ORMObjectModel(Object obj) {
super(obj, new BeansWrapper());
}
-
}
}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -22,18 +22,19 @@
-->
-
-
+
+
+
-
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/conditions/MetaDataLogCondition.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/conditions/MetaDataLogCondition.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/conditions/MetaDataLogCondition.java Wed Jun 16 16:51:40 2010 +0300
@@ -105,14 +105,17 @@
// log file under the DB is always represented with / and not \.
String logname = logFile.replace('\\', '/');
String query = "select Count(m.id) from MetadataEntry m JOIN m.logFile as l JOIN m.priority as p where l.path like '%" + logname + "' and UPPER(p.priority)='" + severity.toUpperCase() + "'";
- Number number = (Number) (new ORMReader(fileName.getAbsolutePath())).executeSingleResult(query, null);
+ ORMReader reader = new ORMReader(fileName.getAbsolutePath());
+ Number number = (Number)reader.executeSingleResult(query, null);
+ int retValue = number.intValue();
// Looking for missing file as error
if (countMissing && prty == Metadata.PriorityEnum.ERROR) {
String queryMissing = "select Count(m.id) from WhatLogEntry m JOIN m.component as c JOIN c.logFile as l where l.path like '%" + logname + "' and m.missing=1";
- Number numberMissing = (Number) (new ORMReader(fileName.getAbsolutePath())).executeSingleResult(queryMissing, null);
- return number.intValue() + numberMissing.intValue();
+ Number numberMissing = (Number) reader.executeSingleResult(queryMissing, null);
+ retValue = number.intValue() + numberMissing.intValue();
}
- return number.intValue();
+ reader.close();
+ return retValue;
}
/**
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/conditions/MetaDataRegexTestCondition.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/conditions/MetaDataRegexTestCondition.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/conditions/MetaDataRegexTestCondition.java Wed Jun 16 16:51:40 2010 +0300
@@ -93,19 +93,19 @@
* @return true if the string is matched with any of the pattern in the given priority, false otherwise.
*/
public boolean eval() {
- if (this.severity == null || (this.severity != null && this.severity.trim().isEmpty()))
- throw new BuildException("'severity' attribute is not defined");
- if (this.string == null || (this.string != null && this.string.isEmpty()))
- throw new BuildException("'string' attribute is not defined");
- for (MetaDataFilterSet set : filterSets) {
- for (MetaDataFilter filter : set.getAllFilters()) {
- Pattern p = filter.getPattern();
- Matcher m = p.matcher(this.string);
- if (m.matches()) {
- return this.severity.equalsIgnoreCase(filter.getPriority());
- }
- }
- }
- return false;
+ if (this.severity == null || (this.severity != null && this.severity.trim().isEmpty()))
+ throw new BuildException("'severity' attribute is not defined");
+ if (this.string == null || (this.string != null && this.string.isEmpty()))
+ throw new BuildException("'string' attribute is not defined");
+ for (MetaDataFilterSet set : filterSets) {
+ for (MetaDataFilter filter : set.getAllFilters()) {
+ Pattern pattern = filter.getPattern();
+ Matcher matcher = pattern.matcher(this.string);
+ if (matcher.matches()) {
+ return this.severity.equalsIgnoreCase(filter.getPriority());
+ }
+ }
+ }
+ return false;
}
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataDelete.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataDelete.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +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.metadata.ant.taskdefs;
-
-import org.apache.tools.ant.types.FileSet;
-
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Task;
-import java.util.Vector;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.log4j.Logger;
-import com.nokia.helium.metadata.db.*;
-
-/**
- * This task provide a way to delete the data from db for a log file set.
- *
- *
- * Example 1:
- * <metadadelete database="compile_log.db">
- * <fileset casesensitive="false" file="sbs.log.file"/>
- * </metadadelete>
- *
- *
- * @ant.task name="metadatadelete" category="Metadata"
- */
-public class MetaDataDelete extends Task {
-
- private static Logger log = Logger.getLogger(MetaDataDelete.class);
-
- private String database;
-
- private boolean failOnError = true;
-
- private Vector fileSetList = new Vector();
-
- /**
- * Helper function to set the database parameter
- *
- * @ant.required
- */
- public void setDatabase(String dbFile) {
- database = dbFile;
- }
-
- public void setFailOnError(String failNotify) {
- if (failNotify.equals("false")) {
- failOnError = false;
- }
- }
-
- /**
- * Updates the list of filelist from the input fileset.
- * @param fileSetList input fileset list
- * @return the matched files including the base dir.
- */
- private List getFileListFromFileSet() {
- List fileList = new ArrayList();
- for (FileSet fs : fileSetList) {
- DirectoryScanner ds = fs.getDirectoryScanner(getProject());
- String[] includedFiles = ds.getIncludedFiles();
- for ( String file : includedFiles ) {
- fileList.add(file);
- log.debug("includedfiles: " + file);
- }
- }
- log.debug("fileList.size" + fileList.size());
- return fileList;
- }
-
- /**
- * 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);
- }
-
- /**
- * Helper function to get the database
- *
- */
- public String getDatabase() {
- return database;
- }
-
-
- @Override
- public void execute() {
- /*
- MetaDataDb metadataDb = null;
- try {
- log.debug("Initializing DB: " + database + "to delete");
- log("time before removing entries from db" + new Date());
- metadataDb = new MetaDataDb(database);
- metadataDb.removeEntries(getFileListFromFileSet());
- log("time after removing entries from db" + new Date());
- } catch (BuildException ex1) {
- if (failOnError) {
- throw ex1;
- }
- } catch (Exception ex) {
- if (failOnError) {
- throw new BuildException("Failed during writing data to db");
- }
- } finally {
- log.debug("finalizing DB: " + database);
- if (metadataDb != null) {
- metadataDb.finalizeDB();
- }
- }
- */
- }
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataDeleteTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataDeleteTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,130 @@
+/*
+ * 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.taskdefs;
+
+import org.apache.tools.ant.types.FileSet;
+
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Task;
+import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.log4j.Logger;
+import com.nokia.helium.metadata.db.*;
+
+/**
+ * This task provide a way to delete the data from db for a log file set.
+ *
+ *
+ * Example 1:
+ * <metadadelete database="compile_log.db">
+ * <fileset casesensitive="false" file="sbs.log.file"/>
+ * </metadadelete>
+ *
+ *
+ * @ant.task name="metadatadelete" category="Metadata"
+ */
+public class MetaDataDeleteTask extends Task {
+
+ private static Logger log = Logger.getLogger(MetaDataDeleteTask.class);
+
+ private String database;
+
+ private boolean failOnError = true;
+
+ private Vector fileSetList = new Vector();
+
+ /**
+ * Helper function to set the database parameter
+ *
+ * @ant.required
+ */
+ public void setDatabase(String dbFile) {
+ database = dbFile;
+ }
+
+ public void setFailOnError(String failNotify) {
+ if (failNotify.equals("false")) {
+ failOnError = false;
+ }
+ }
+
+ /**
+ * Updates the list of filelist from the input fileset.
+ * @param fileSetList input fileset list
+ * @return the matched files including the base dir.
+ */
+ private List getFileListFromFileSet() {
+ List fileList = new ArrayList();
+ for (FileSet fs : fileSetList) {
+ DirectoryScanner ds = fs.getDirectoryScanner(getProject());
+ String[] includedFiles = ds.getIncludedFiles();
+ for ( String file : includedFiles ) {
+ fileList.add(file);
+ log.debug("includedfiles: " + file);
+ }
+ }
+ log.debug("fileList.size" + fileList.size());
+ return fileList;
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * Helper function to get the database
+ *
+ */
+ public String getDatabase() {
+ return database;
+ }
+
+
+ @Override
+ public void execute() {
+ /*
+ MetaDataDb metadataDb = null;
+ try {
+ log.debug("Initializing DB: " + database + "to delete");
+ log("time before removing entries from db" + new Date());
+ metadataDb = new MetaDataDb(database);
+ metadataDb.removeEntries(getFileListFromFileSet());
+ log("time after removing entries from db" + new Date());
+ } catch (BuildException ex1) {
+ if (failOnError) {
+ throw ex1;
+ }
+ } catch (Exception ex) {
+ if (failOnError) {
+ throw new BuildException("Failed during writing data to db");
+ }
+ } finally {
+ log.debug("finalizing DB: " + database);
+ if (metadataDb != null) {
+ metadataDb.finalizeDB();
+ }
+ }
+ */
+ }
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataLogCount.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataLogCount.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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.metadata.ant.taskdefs;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import com.nokia.helium.metadata.ant.conditions.MetaDataLogCondition;
-
-/**
- * This class sets a property to the number of matching severity inside a Metadata db for a log.
- * Example:
- *
- * <hlm:metadataCountSeverity severity="error" log="*_fixslashes_raptor.log" db="${build.log.dir}/metadata.db" property="fixslashes.error"/>
- *
-
- * @ant.task name="metadataCountSeverity" category="Metadata"
- */
-public class MetaDataLogCount extends Task {
-
- private File fileName;
- private String logFile;
- private String severity;
- private String property;
- private boolean countMissing = true;
-
- /**
- * File to be parsed.
- *
- * @param filename
- * @ant.required
- */
- public void setDb(File filename) {
- fileName = filename;
- }
-
- public void setLog(String log) {
- logFile = log;
- }
-
- /**
- * Defines the severity name to be counted.
- *
- * @param severity
- * @ant.required
- */
- public void setSeverity(String severity) {
- this.severity = severity;
- }
-
- /**
- * Name of the property to be set.
- * @param property the property name
- * @ant.required
- */
- public void setProperty(String property) {
- this.property = property;
- }
-
- /**
- * Should the count of missing files for error severity.
- * @param countMissing enable the count of missing files
- * for error severity
- * @ant.not-required Default is true
- */
- public void setCountMissing(boolean countMissing) {
- this.countMissing = countMissing;
- }
-
- /**
- * Execute the task. Set the property with number of severities.
- * @throws BuildException
- */
- public void execute() {
- if (property == null)
- throw new BuildException("'property' attribute is not defined");
-
- MetaDataLogCondition cond = new MetaDataLogCondition();
- cond.setDb(fileName);
- cond.setLog(logFile);
- cond.setSeverity(severity);
- cond.setCountMissing(countMissing);
- getProject().setNewProperty(property, "" + cond.getSeverity());
- }
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataLogCountTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataLogCountTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,101 @@
+/*
+ * 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.taskdefs;
+
+import java.io.File;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import com.nokia.helium.metadata.ant.conditions.MetaDataLogCondition;
+
+/**
+ * This class sets a property to the number of matching severity inside a Metadata db for a log.
+ * Example:
+ *
+ * <hlm:metadataCountSeverity severity="error" log="*_fixslashes_raptor.log" db="${build.log.dir}/metadata.db" property="fixslashes.error"/>
+ *
+
+ * @ant.task name="metadataCountSeverity" category="Metadata"
+ */
+public class MetaDataLogCountTask extends Task {
+
+ private File fileName;
+ private String logFile;
+ private String severity;
+ private String property;
+ private boolean countMissing = true;
+
+ /**
+ * File to be parsed.
+ *
+ * @param filename
+ * @ant.required
+ */
+ public void setDb(File filename) {
+ fileName = filename;
+ }
+
+ public void setLog(String log) {
+ logFile = log;
+ }
+
+ /**
+ * Defines the severity name to be counted.
+ *
+ * @param severity
+ * @ant.required
+ */
+ public void setSeverity(String severity) {
+ this.severity = severity;
+ }
+
+ /**
+ * Name of the property to be set.
+ * @param property the property name
+ * @ant.required
+ */
+ public void setProperty(String property) {
+ this.property = property;
+ }
+
+ /**
+ * Should the count of missing files for error severity.
+ * @param countMissing enable the count of missing files
+ * for error severity
+ * @ant.not-required Default is true
+ */
+ public void setCountMissing(boolean countMissing) {
+ this.countMissing = countMissing;
+ }
+
+ /**
+ * Execute the task. Set the property with number of severities.
+ * @throws BuildException
+ */
+ public void execute() {
+ if (property == null)
+ throw new BuildException("'property' attribute is not defined");
+
+ MetaDataLogCondition cond = new MetaDataLogCondition();
+ cond.setDb(fileName);
+ cond.setLog(logFile);
+ cond.setSeverity(severity);
+ cond.setCountMissing(countMissing);
+ getProject().setNewProperty(property, "" + cond.getSeverity());
+ }
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataRecord.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataRecord.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +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.metadata.ant.taskdefs;
-
-import com.nokia.helium.metadata.CustomMetaDataProvider;
-import com.nokia.helium.metadata.MetaDataInput;
-import com.nokia.helium.jpa.entity.metadata.Metadata;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import java.util.Vector;
-import java.util.Iterator;
-import org.apache.log4j.Logger;
-import com.nokia.helium.metadata.db.*;
-import java.util.Date;
-
-/**
- * This task provide a way to record the data in the Database.
- *
- *
- * Example 1:
- * <metadatarecord database="compile_log.db">
- * <sbsmetadatainput>
- * <fileset casesensitive="false" file="sbs.log.file"/>
- * <metadatafiltelistref refid="compilation"/>
- * </sbsmetadatainput>
- * </metadatarecord>
- *
- * Example 2:
- *
- * <metadatarecord database="metadata.db">
- * <antmetadatainput>
- * <fileset casesensitive="false" file="${build.id}_ant_build.log"/>
- * <metadatafiltelistref refid="compilation"/>
- * </antmetadatainput>
- * </metadatarecord>
-
- *
- *
- * @ant.task name="metadatarecord" category="Metadata"
- */
-public class MetaDataRecord extends Task {
-
- private static Logger log = Logger.getLogger(MetaDataRecord.class);
-
- private String database;
-
- private boolean failOnError = true;
-
- private Vector metadataList = new Vector();
-
- /**
- * Helper function to set the database parameter
- *
- * @ant.required
- */
- public void setDatabase(String dbFile) {
- database = dbFile;
- }
-
- public void setFailOnError(String failNotify) {
- if (failNotify.equals("false")) {
- failOnError = false;
- }
- }
- /**
- * Helper function to get the database
- *
- */
- public String getDatabase() {
- return database;
- }
-
- /**
- * Helper function to return the metadatalist
- * @return build metadata object
- *
- */
- public Vector getMetaDataList() throws Exception {
- if (metadataList.isEmpty()) {
- throw new Exception("metadata list is empty");
- }
- return metadataList;
- }
-
- /**
- * Helper function to add the metadatalist
- * @param build metadata list to add
- *
- */
- public void add(MetaDataInput interf) {
- metadataList.add(interf);
- }
-
-
- @Override
- public void execute() {
- ORMMetadataDB ormDB = null;
- try {
- log.debug("Getting Contents to write to db: " + database);
- log.debug("Initializing DB: " + database);
- log.debug("initializing ORM db");
- ormDB = new ORMMetadataDB(database);
- log.debug("Parsing the input and writing to DB");
- Date before = new Date();
- log("Time before recording to db: " + before);
- for (MetaDataInput metadataInput : metadataList) {
- boolean removed = false;
- String logPath = null;
- Iterator inputIterator = metadataInput.iterator();
- while (inputIterator.hasNext()) {
- Metadata.LogEntry logEntry = inputIterator.next();
- if (!removed) {
- logPath = logEntry.getLogPath();
- ormDB.removeEntries(logPath);
- removed = true;
- }
- //initializes the metadata if none exists
- ormDB.addLogEntry(logEntry);
- }
- if (logPath != null && metadataInput instanceof CustomMetaDataProvider) {
- CustomMetaDataProvider provider = (CustomMetaDataProvider)metadataInput;
- provider.provide(ormDB, logPath);
- }
- if (logPath != null) {
- ormDB.finalizeMetadata(logPath);
- }
- }
- Date after = new Date();
- log("Time after recording to db: " + after);
- log("Elapsed time: " + (after.getTime() - before.getTime()) + " ms");
- log.debug("Successfully writen to DB");
- } catch (BuildException ex1) {
- log.debug("BuildException during writing to db: ", ex1);
- if (failOnError) {
- throw ex1;
- }
- } finally {
- if (ormDB != null) {
- ormDB.finalizeDB();
- }
- }
- }
-}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataRecordTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/taskdefs/MetaDataRecordTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,177 @@
+/*
+ * 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.taskdefs;
+
+import com.nokia.helium.metadata.CustomMetaDataProvider;
+import com.nokia.helium.metadata.MetaDataInput;
+import com.nokia.helium.jpa.entity.metadata.Metadata;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import java.util.Vector;
+import java.util.Iterator;
+import org.apache.log4j.Logger;
+import com.nokia.helium.metadata.db.*;
+import java.util.Date;
+
+/**
+ * This task provide a way to record the data in the Database.
+ *
+ *
+ * Example 1:
+ * <metadatarecord database="compile_log.db">
+ * <sbsmetadatainput>
+ * <fileset casesensitive="false" file="sbs.log.file"/>
+ * <metadatafiltelistref refid="compilation"/>
+ * </sbsmetadatainput>
+ * </metadatarecord>
+ *
+ * Example 2:
+ *
+ * <metadatarecord database="metadata.db">
+ * <antmetadatainput>
+ * <fileset casesensitive="false" file="${build.id}_ant_build.log"/>
+ * <metadatafiltelistref refid="compilation"/>
+ * </antmetadatainput>
+ * </metadatarecord>
+
+ *
+ *
+ * @ant.task name="metadatarecord" category="Metadata"
+ */
+public class MetaDataRecordTask extends Task {
+
+ private static Logger log = Logger.getLogger(MetaDataRecordTask.class);
+
+ private String database;
+
+ private boolean failOnError = true;
+
+ private Vector metadataList = new Vector();
+
+ /**
+ * Helper function to set the database parameter
+ *
+ * @ant.required
+ */
+ public void setDatabase(String dbFile) {
+ database = dbFile;
+ }
+
+ public void setFailOnError(String failNotify) {
+ if (failNotify.equals("false")) {
+ failOnError = false;
+ }
+ }
+ /**
+ * Helper function to get the database
+ *
+ */
+ public String getDatabase() {
+ return database;
+ }
+
+ /**
+ * Helper function to return the metadatalist
+ * @return build metadata object
+ *
+ */
+ public Vector getMetaDataList() throws Exception {
+ if (metadataList.isEmpty()) {
+ throw new Exception("metadata list is empty");
+ }
+ return metadataList;
+ }
+
+ /**
+ * Helper function to add the metadatalist
+ * @param build metadata list to add
+ *
+ */
+ public void add(MetaDataInput interf) {
+ metadataList.add(interf);
+ }
+
+
+ @Override
+ public void execute() {
+ ORMMetadataDB ormDB = null;
+ try {
+ log.debug("Getting Contents to write to db: " + database);
+ log.debug("Initializing DB: " + database);
+ log.debug("initializing ORM db");
+ ormDB = new ORMMetadataDB(database);
+ log.debug("Parsing the input and writing to DB");
+ Date before = new Date();
+ log("Time before recording to db: " + before);
+ for (MetaDataInput metadataInput : metadataList) {
+ boolean removed = false;
+ String logPath = null;
+ String currentLogPath = null;
+ Iterator inputIterator = metadataInput.iterator();
+ while (inputIterator.hasNext()) {
+ //Todo: better way of log handling, with metadatainput
+ // metadata initialization for each logfile within
+ //metadatainput itself would be better. this is temporary.
+ Metadata.LogEntry logEntry = inputIterator.next();
+ logPath = logEntry.getLogPath();
+ if (currentLogPath == null) {
+ currentLogPath = logPath;
+ removed = false;
+ } else if (!currentLogPath.equals(logPath)) {
+ finalizeForLogPath(currentLogPath, metadataInput, ormDB);
+ currentLogPath = logPath;
+ removed = false;
+ }
+ if (!removed ) {
+ log.debug("processing for log: " + logPath);
+ ormDB.removeEntries(logPath);
+ removed = true;
+ }
+ //initializes the metadata if none exists
+ ormDB.addLogEntry(logEntry);
+ }
+ finalizeForLogPath(currentLogPath, metadataInput, ormDB);
+ }
+ Date after = new Date();
+ log("Time after recording to db: " + after);
+ log("Elapsed time: " + (after.getTime() - before.getTime()) + " ms");
+ log.debug("Successfully writen to DB");
+ } catch (BuildException ex1) {
+ log.debug("BuildException during writing to db: ", ex1);
+ if (failOnError) {
+ throw ex1;
+ }
+ } finally {
+ if (ormDB != null) {
+ ormDB.finalizeDB();
+ }
+ }
+ }
+
+ private void finalizeForLogPath(String currentLogPath,
+ MetaDataInput metadataInput, ORMMetadataDB ormDB) {
+ if (currentLogPath != null) {
+ if (metadataInput instanceof CustomMetaDataProvider) {
+ CustomMetaDataProvider provider =
+ (CustomMetaDataProvider)metadataInput;
+ provider.provide(ormDB, currentLogPath);
+ }
+ ormDB.finalizeMetadata(currentLogPath);
+ }
+ }
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/AbldLogMetaDataInput.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/AbldLogMetaDataInput.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/AbldLogMetaDataInput.java Wed Jun 16 16:51:40 2010 +0300
@@ -133,28 +133,28 @@
setCurrentReader(currentReader);
} catch (FileNotFoundException ex) {
log.debug("FileNotFoundException in AbldLogMetadata", ex);
- try {
- currentReader.close();
- } catch ( IOException iex) {
- // We are Ignoring the errors as no need to fail the build.
- log.debug("Exception in closing reader", iex);
- }
- currentReader = null;
- setCurrentReader(null);
- exceptions = exceptions + ex.getMessage() + "\n";
- return false;
+ try {
+ currentReader.close();
+ } catch ( IOException iex) {
+ // We are Ignoring the errors as no need to fail the build.
+ log.debug("Exception in closing reader", iex);
+ }
+ currentReader = null;
+ setCurrentReader(null);
+ exceptions = exceptions + ex.getMessage() + "\n";
+ return false;
} catch (IOException ex) {
log.debug("IOException in AbldLogMetadata", ex);
- try {
- currentReader.close();
- } catch ( IOException iex) {
+ try {
+ currentReader.close();
+ } catch ( IOException iex) {
// We are Ignoring the errors as no need to fail the build.
log.debug("IOException in closing reader", iex);
- }
- currentReader = null;
- setCurrentReader(null);
- exceptions = exceptions + ex.getMessage() + "\n";
- return false;
+ }
+ currentReader = null;
+ setCurrentReader(null);
+ exceptions = exceptions + ex.getMessage() + "\n";
+ return false;
}
if (!exceptions.equals("")) {
throw new BuildException(exceptions);
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/IMakerLogMetaDataInput.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/IMakerLogMetaDataInput.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,215 @@
+/*
+ * 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.*;
+import org.apache.tools.ant.BuildException;
+import java.util.*;
+
+import org.apache.log4j.Logger;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+/**
+ * This Type is to specify and use the abld logparser type to parse and store
+ * the data.
+ *
+ *
+ * <hlm:metadatafilterset id="abld.metadata.filter">
+ * <metadatafilterset filterfile="common.csv" />
+ * </hlm:metadatafilterset>
+ *
+ * <hlm:imakermetadatainput>
+ * <fileset dir="${project.dir}/../data/">
+ * <include name="*_compile*.log"/>
+ * </fileset>
+ * <metadatafilterset refid="abld.metadata.filter" />
+ * </hlm:imakermetadatainput>
+ *
+ *
+ * @ant.task name="imakermetadatainput" category="Metadata"
+ */
+public class IMakerLogMetaDataInput extends TextLogMetaDataInput {
+
+ /** Internal data storage. */
+ private class Entry {
+
+ private String fileName;
+ private int lineNumber;
+ private String text;
+ private String severity;
+
+ public Entry(String fileName, int lineNumber, String text, String severity) {
+ super();
+ this.text = text;
+ this.lineNumber = lineNumber;
+ this.fileName = fileName;
+ this.severity = severity;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public int getLineNumber() {
+ return lineNumber;
+ }
+
+ public String getFileName() {
+ return fileName;
+ }
+
+ public String getSeverity() {
+ return severity;
+ }
+
+ }
+
+ private Logger log = Logger.getLogger(AbldLogMetaDataInput.class);
+
+ private Pattern iMakerFpsxPattern = Pattern.compile("/([^/]*?\\.fpsx)");
+
+ private String currentComponent;
+
+ private boolean entryCreated;
+
+ private boolean isRecordingIssues;
+
+ public IMakerLogMetaDataInput() {
+ }
+
+ /**
+ * Function to check from the input stream if is there any entries
+ * available.
+ *
+ * @return true if there are any entry available otherwise false.
+ */
+ public boolean isEntryCreated(File currentFile) {
+ String exceptions = "";
+ entryCreated = false;
+ int lineNumber = getLineNumber();
+ BufferedReader currentReader = getCurrentReader();
+ log.debug("Getting next set of log entries for iMaker input");
+ try {
+ if (currentReader == null) {
+ lineNumber = 0;
+ setLineNumber(lineNumber);
+ log.debug("Processing iMaker log file name: " + currentFile);
+ currentReader = new BufferedReader(new FileReader(currentFile));
+ setCurrentReader(currentReader);
+ }
+
+ List entriesCache = new ArrayList();
+ String logText = null;
+ while ((logText = currentReader.readLine()) != null) {
+ lineNumber++;
+ setLineNumber(lineNumber);
+
+ // Remove Ant task comment text, e.g. "[imaker]"
+ logText = logText.replaceFirst("'^\\s*\\[.+?\\]\\s*", "");
+ // log.debug("Parsing log line: " + logText);
+
+ // See if the line should be captured
+ if (isRecordingIssues) {
+ // Check for a line with an issue
+ String severity = getSeverity(logText);
+ if (severity != null) {
+ Entry entry = new Entry(currentFile.toString(), lineNumber, logText, severity);
+ entriesCache.add(entry);
+ }
+
+ // Check if the iMaker FPSX image name is on this line, to
+ // get the component
+ if (currentComponent == null) {
+ Matcher componentMatch = iMakerFpsxPattern.matcher(logText);
+ if (componentMatch.find()) {
+ currentComponent = componentMatch.group(1);
+ log.debug("Matched component: " + currentComponent);
+ }
+ }
+
+ // See if the component log block has ended
+ if (logText.startsWith("++ Finished at")) {
+ // Add all cached issues
+ if (currentComponent != null && entriesCache.size() > 0) {
+ for (int i = 0; i < entriesCache.size(); i++) {
+ Entry entry = entriesCache.get(i);
+ addEntry(entry.getSeverity(), currentComponent, entry.getFileName(), entry.getLineNumber(), entry.getText());
+ }
+ entryCreated = true;
+ currentComponent = null;
+ return true;
+ }
+ // Or add a default entry to record the logfile
+ else {
+ addEntry("DEFAULT", currentComponent, currentFile.toString(), lineNumber, "");
+ entryCreated = true;
+ currentComponent = null;
+ return true;
+ }
+ }
+ }
+ else {
+ // Check for the start of a block
+ if (logText.startsWith("++ Started at")) {
+ isRecordingIssues = true;
+ }
+ }
+ }
+ currentReader.close();
+ currentReader = null;
+ setCurrentReader(currentReader);
+ }
+ catch (FileNotFoundException ex) {
+ log.debug("FileNotFoundException in AbldLogMetadata", ex);
+ try {
+ if (currentReader != null) {
+ currentReader.close();
+ }
+ }
+ catch (IOException iex) {
+ // We are Ignoring the errors as no need to fail the build.
+ log.debug("Exception in closing reader", iex);
+ }
+ currentReader = null;
+ setCurrentReader(null);
+ exceptions = exceptions + ex.getMessage() + "\n";
+ return false;
+ }
+ catch (IOException ex) {
+ log.debug("IOException in AbldLogMetadata", ex);
+ try {
+ if (currentReader != null) {
+ currentReader.close();
+ }
+ }
+ catch (IOException iex) {
+ // We are Ignoring the errors as no need to fail the build.
+ log.debug("IOException in closing reader", iex);
+ }
+ currentReader = null;
+ setCurrentReader(null);
+ exceptions = exceptions + ex.getMessage() + "\n";
+ return false;
+ }
+ if (!exceptions.equals("")) {
+ throw new BuildException(exceptions);
+ }
+ return entryCreated;
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/LogMetaDataInput.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/LogMetaDataInput.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/LogMetaDataInput.java Wed Jun 16 16:51:40 2010 +0300
@@ -147,29 +147,29 @@
*/
boolean isEntryAvailable() {
- int fileListSize = getFileList().size();
- while (currentFileIndex < fileListSize) {
- boolean entryCreated = false;
- File currentFile = getCurrentFile();
- entryCreated = isEntryCreated(currentFile);
- if (entryCreated) {
- if (!entryAddedForLog) {
- entryAddedForLog = true;
- }
- return entryCreated;
- }
+ int fileListSize = getFileList().size();
+ while (currentFileIndex < fileListSize) {
+ boolean entryCreated = false;
+ File currentFile = getCurrentFile();
+ entryCreated = isEntryCreated(currentFile);
+ if (entryCreated) {
if (!entryAddedForLog) {
- // If no entry, then logfile is added to the database.
- addEntry("default", "general",
- getCurrentFile().toString(), -1, "", -1, null);
entryAddedForLog = true;
- return true;
}
- if (isAdditionalEntry()) {
- return true;
- }
- currentFileIndex ++;
+ return entryCreated;
}
+ if (!entryAddedForLog) {
+ // If no entry, then logfile is added to the database.
+ addEntry("default", "general",
+ getCurrentFile().toString(), -1, "", -1, null);
+ entryAddedForLog = true;
+ return true;
+ }
+ if (isAdditionalEntry()) {
+ return true;
+ }
+ currentFileIndex ++;
+ }
return false;
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/MetaDataFilterSet.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/MetaDataFilterSet.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/MetaDataFilterSet.java Wed Jun 16 16:51:40 2010 +0300
@@ -97,7 +97,7 @@
return allFilters;
}
log.debug("Filterset object is not instance of MetaDataFilterSet");
- throw new BuildException ("Filterset object is not instance of MetaDataFilterSet");
+ throw new BuildException("Filterset object is not instance of MetaDataFilterSet");
}
// Add any nested filtersets
for (MetaDataFilterSet filterSet : filterSets) {
@@ -188,22 +188,22 @@
throw iex;
}
int size = 0;
- log.debug("filter CSV record size: " + csvs.size());
- size = csvs.size();
- for (int i = 0; i < size; i++) {
- TemplateSequenceModel model = (TemplateSequenceModel) csvs
- .get(i);
- int modelSize = model.size();
- if (modelSize != 3 ) {
- log.debug("Metadata CSV file filter file format is invalid. It has row size " + size);
- throw new Exception("Metadata CSV file filter file format is invalid. It has row size " + size);
- }
- MetaDataFilter filter = new MetaDataFilter();
- filter.setPriority(model.get(0).toString());
- filter.setRegex(model.get(1).toString());
- filter.setDescription(model.get(2).toString());
- filters.add(filter);
+ log.debug("filter CSV record size: " + csvs.size());
+ size = csvs.size();
+ for (int i = 0; i < size; i++) {
+ TemplateSequenceModel model = (TemplateSequenceModel) csvs
+ .get(i);
+ int modelSize = model.size();
+ if (modelSize != 3 ) {
+ log.debug("Metadata CSV file filter file format is invalid. It has row size " + size);
+ throw new Exception("Metadata CSV file filter file format is invalid. It has row size " + size);
}
+ MetaDataFilter filter = new MetaDataFilter();
+ filter.setPriority(model.get(0).toString());
+ filter.setRegex(model.get(1).toString());
+ filter.setDescription(model.get(2).toString());
+ filters.add(filter);
+ }
}
}
diff -r 85df38eb4012 -r c7c26511138f 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 Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/PolicyLogMetaDataInput.java Wed Jun 16 16:51:40 2010 +0300
@@ -77,7 +77,7 @@
* @param streamReader: the input stream reader which contains the xml data to be parsed for recording data.
* @return true if there are any element to be added to the database.
*/
- boolean startElement (XMLStreamReader streamReader) {
+ boolean startElement(XMLStreamReader streamReader) {
String tagName = streamReader.getLocalName();
if (tagName.equalsIgnoreCase("error")) {
currentAttributeMap = getAttributes(streamReader);
@@ -92,33 +92,33 @@
*/
boolean endElement(XMLStreamReader streamReader) {
boolean retValue = false;
- String tagName = streamReader.getLocalName();
- String priority = "ERROR";
- log.debug("endElement: " + tagName);
- if (tagName.equalsIgnoreCase("error")) {
- log.debug("tagName matches error");
- String errorType = currentAttributeMap.get("type");
- log.debug("errorType:" + errorType);
- if (errorType.equals("unknownstatus")) {
- addEntry(priority, "CSV validation", getCurrentFile().toString(), -1, currentAttributeMap.get("message") +
- currentAttributeMap.get("value"));
- retValue = true;
- } 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);
- addEntry(priority, "Issues", getCurrentFile().toString(), -1,
- errorType + "Found incorrect value for" +
- pattern.matcher(currentAttributeMap.get("message")).replaceAll(""));
- retValue = true;
- } else if (errorType.equals("missing")) {
- addEntry(priority, "Missing", getCurrentFile().toString(), -1, currentAttributeMap.get("message"));
- retValue = true;
- } else if (errorType.equals("invalidencoding")) {
- addEntry(priority, "Incorrect policy files", getCurrentFile().toString(), -1, currentAttributeMap.get("message"));
- retValue = true;
- }
+ String tagName = streamReader.getLocalName();
+ String priority = "ERROR";
+ log.debug("endElement: " + tagName);
+ if (tagName.equalsIgnoreCase("error")) {
+ log.debug("tagName matches error");
+ String errorType = currentAttributeMap.get("type");
+ log.debug("errorType:" + errorType);
+ if (errorType.equals("unknownstatus")) {
+ addEntry(priority, "CSV validation", getCurrentFile().toString(), -1, currentAttributeMap.get("message") +
+ currentAttributeMap.get("value"));
+ retValue = true;
+ } 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);
+ addEntry(priority, "Issues", getCurrentFile().toString(), -1,
+ errorType + "Found incorrect value for" +
+ pattern.matcher(currentAttributeMap.get("message")).replaceAll(""));
+ retValue = true;
+ } else if (errorType.equals("missing")) {
+ addEntry(priority, "Missing", getCurrentFile().toString(), -1, currentAttributeMap.get("message"));
+ retValue = true;
+ } else if (errorType.equals("invalidencoding")) {
+ addEntry(priority, "Incorrect policy files", getCurrentFile().toString(), -1, currentAttributeMap.get("message"));
+ retValue = true;
}
+ }
return retValue;
}
@@ -126,7 +126,7 @@
* @param streamReader: the input stream reader which contains the xml data to be parsed for recording data.
* @return true if there are any element to be added to the database.
*/
- boolean characters (XMLStreamReader streamReader) {
+ boolean characters(XMLStreamReader streamReader) {
return false;
}
}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/SBSLogMetaDataInput.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/SBSLogMetaDataInput.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/SBSLogMetaDataInput.java Wed Jun 16 16:51:40 2010 +0300
@@ -159,7 +159,7 @@
*/
@Deprecated
public void setCleanLogFile(File logFile) {
- log("The usage of the cleanLogFile is deprecated.");
+ log("The usage of the cleanLogFile is deprecated.");
}
/**
@@ -217,7 +217,7 @@
toProcess.put(text.trim(), streamReader.getLocation().getLineNumber() + i);
}
i++;
- }
+ }
boolean entryCreated = false;
//Check for any general errors.
for (String textString : toProcess.keySet()) {
@@ -238,64 +238,64 @@
* @return true if there are any element to be added to the database.
*/
public boolean startElement (XMLStreamReader streamReader) {
- String tagName = streamReader.getLocalName();
- if (tagName.equalsIgnoreCase("buildlog")) {
- logger.debug("starting with buildlog");
- inMainDataSection = true;
+ String tagName = streamReader.getLocalName();
+ if (tagName.equalsIgnoreCase("buildlog")) {
+ logger.debug("starting with buildlog");
+ inMainDataSection = true;
+ }
+ if (tagName.equalsIgnoreCase("recipe") ) {
+ lineNumber = streamReader.getLocation().getLineNumber();
+ currentComponent = getComponent(streamReader);
+ recordText = true;
+ inMainDataSection = false;
+ recipeStatus = "ok";
+ } if (tagName.equalsIgnoreCase("status") ) {
+ String exit = streamReader.getAttributeValue(null, "exit");
+ recipeStatus = (exit != null) ? exit : "ok";
+ } else if (tagName.equalsIgnoreCase("error")
+ || tagName.equalsIgnoreCase("warning")) {
+ lineNumber = streamReader.getLocation().getLineNumber();
+ currentComponent = getComponent(streamReader);
+ recordText = true;
+ inMainDataSection = false;
+ } else if (tagName.equalsIgnoreCase("whatlog")) {
+ members.clear();
+ currentComponent = getComponent(streamReader);
+ inMainDataSection = false;
+ inWhatLogSection = true;
+ } else if (inWhatLogSection && tagName.equals("export")) {
+ String text = SBSLogMetaDataInput.getAttribute("destination", streamReader);
+ if (text != null && text.trim().length() > 0) {
+ String member = SBSLogMetaDataInput.removeDriveAndBldInf(text);
+ boolean exists = (new File(text)).exists();
+ Metadata.WhatLogMember entry = new Metadata.WhatLogMember(member, exists);
+ members.add(entry);
}
- if (tagName.equalsIgnoreCase("recipe") ) {
- lineNumber = streamReader.getLocation().getLineNumber();
- currentComponent = getComponent(streamReader);
- recordText = true;
- inMainDataSection = false;
- recipeStatus = "ok";
- } if (tagName.equalsIgnoreCase("status") ) {
- String exit = streamReader.getAttributeValue(null, "exit");
- recipeStatus = (exit != null) ? exit : "ok";
- } else if (tagName.equalsIgnoreCase("error")
- || tagName.equalsIgnoreCase("warning")) {
- lineNumber = streamReader.getLocation().getLineNumber();
- currentComponent = getComponent(streamReader);
- recordText = true;
- inMainDataSection = false;
- } else if (tagName.equalsIgnoreCase("whatlog")) {
- members.clear();
- currentComponent = getComponent(streamReader);
- inMainDataSection = false;
- inWhatLogSection = true;
- } else if (inWhatLogSection && tagName.equals("export")) {
- String text = SBSLogMetaDataInput.getAttribute("destination", streamReader);
- if (text != null && text.trim().length() > 0) {
- String member = SBSLogMetaDataInput.removeDriveAndBldInf(text);
- boolean exists = (new File(text)).exists();
- Metadata.WhatLogMember entry = new Metadata.WhatLogMember(member, exists);
- members.add(entry);
+ } else if (inWhatLogSection && !tagName.equals("export")) {
+ logTextInfo = "";
+ recordText = true;
+ } else if (tagName.equalsIgnoreCase("time")) {
+ inMainDataSection = false;
+ currentElapsedTime = Float.valueOf(getAttribute("elapsed", streamReader)).floatValue();
+ logger.debug("currentElapsedTime: " + currentElapsedTime);
+ if (currentComponent != null) {
+ TimeEntry timeObject = componentTimeMap.get(currentComponent);
+ logger.debug("currentComponent:" + currentComponent);
+ if (timeObject == null) {
+ timeObject = new TimeEntry(currentElapsedTime, getCurrentFile().toString());
+ componentTimeMap.put(currentComponent, timeObject);
+ logger.debug("creating to new time object");
+ } else {
+ timeObject.addElapsedTime(currentElapsedTime);
+ logger.debug("adding it to existing time object");
}
- } else if (inWhatLogSection && !tagName.equals("export")) {
- logTextInfo = "";
- recordText = true;
- } else if (tagName.equalsIgnoreCase("time")) {
- inMainDataSection = false;
- currentElapsedTime = Float.valueOf(getAttribute("elapsed", streamReader)).floatValue();
- logger.debug("currentElapsedTime: " + currentElapsedTime);
- if (currentComponent != null) {
- TimeEntry timeObject = componentTimeMap.get(currentComponent);
- logger.debug("currentComponent:" + currentComponent);
- if (timeObject == null) {
- timeObject = new TimeEntry(currentElapsedTime, getCurrentFile().toString());
- componentTimeMap.put(currentComponent, timeObject);
- logger.debug("creating to new time object");
- } else {
- timeObject.addElapsedTime(currentElapsedTime);
- logger.debug("adding it to existing time object");
- }
- }
- } else if (tagName.equalsIgnoreCase("clean")) {
- inMainDataSection = false;
- } else if (tagName.equalsIgnoreCase("info")) {
- inMainDataSection = false;
- recordText = true;
}
+ } else if (tagName.equalsIgnoreCase("clean")) {
+ inMainDataSection = false;
+ } else if (tagName.equalsIgnoreCase("info")) {
+ inMainDataSection = false;
+ recordText = true;
+ }
return false;
}
@@ -306,40 +306,40 @@
* @return true if there are any element to be added to the database.
*/
public boolean isAdditionalEntry() {
- if (!componentTimeMap.isEmpty()) {
- Set componentSet = componentTimeMap.keySet();
- for (String component : componentSet) {
-
- TimeEntry entry = componentTimeMap.get(component);
- addEntry("default", component, entry.getFilePath(), -1,
- null, entry.getElapsedTime(), null);
- componentTimeMap.remove(component);
- return true;
+ if (!componentTimeMap.isEmpty()) {
+ Set componentSet = componentTimeMap.keySet();
+ for (String component : componentSet) {
+
+ TimeEntry entry = componentTimeMap.get(component);
+ addEntry("default", component, entry.getFilePath(), -1,
+ null, entry.getElapsedTime(), null);
+ componentTimeMap.remove(component);
+ return true;
+ }
+ }
+ if (!categorizationCompleted) {
+ if (cleanLogFile != null) {
+ if (categorizationHandler == null ) {
+ logger.debug("initializing categorization handler");
+ categorizationHandler =
+ new CategorizationHandler(cleanLogFile, generalTextEntries);
}
}
- if (!categorizationCompleted) {
- if (cleanLogFile != null) {
- if (categorizationHandler == null ) {
- logger.debug("initializing categorization handler");
- categorizationHandler =
- new CategorizationHandler(cleanLogFile, generalTextEntries);
+ if (categorizationHandler != null && categorizationHandler.hasNext()) {
+ try {
+ CategoryEntry entry = categorizationHandler.getNext();
+ if (entry != null) {
+ addEntry(entry.getSeverity(), entry.getCategory(), entry.getLogFile(),
+ entry.getLineNumber(), entry.getText());
+ return true;
}
+ } catch (XMLStreamException ex) {
+ logger.debug("Exception during categorization handler", ex);
+ return false;
}
- if (categorizationHandler != null && categorizationHandler.hasNext()) {
- try {
- CategoryEntry entry = categorizationHandler.getNext();
- if (entry != null) {
- addEntry(entry.getSeverity(), entry.getCategory(), entry.getLogFile(),
- entry.getLineNumber(), entry.getText());
- return true;
- }
- } catch (XMLStreamException ex) {
- logger.debug("Exception during categorization handler", ex);
- return false;
- }
- }
- categorizationCompleted = true;
}
+ categorizationCompleted = true;
+ }
return false;
}
@@ -349,68 +349,68 @@
* @return true if there are any element to be added to the database.
*/
public boolean endElement(XMLStreamReader streamReader) {
- String tagName = streamReader.getLocalName();
- if (tagName.equalsIgnoreCase("recipe")) {
- inMainDataSection = true;
- recordText = false;
- if (logTextInfo != null) {
- if (currentComponent == null) {
- currentComponent = "general";
- }
- Statistics stat = new Statistics();
- boolean entryCreated = findAndAddEntries(logTextInfo, currentComponent,
- getCurrentFile().toString(), lineNumber, stat);
- if (stat.getSeveriry("error") == 0 && recipeStatus.equals("failed")) {
- addEntry("error", currentComponent, getCurrentFile().toString(),
- lineNumber, FAILED_STATUS_MESSAGE);
- entryCreated = true;
- }
- logTextInfo = "";
- recipeStatus = "ok";
- return entryCreated;
- }
- } else if (tagName.equalsIgnoreCase("error")
- || tagName.equalsIgnoreCase("warning")) {
- inMainDataSection = true;
- recordText = false;
+ String tagName = streamReader.getLocalName();
+ if (tagName.equalsIgnoreCase("recipe")) {
+ inMainDataSection = true;
+ recordText = false;
+ if (logTextInfo != null) {
if (currentComponent == null) {
currentComponent = "general";
}
- addEntry(tagName, currentComponent, getCurrentFile().toString(), lineNumber,
- logTextInfo);
- logTextInfo = "";
- return true;
- } else if (tagName.equalsIgnoreCase("whatlog") ) {
- inWhatLogSection = false;
- inMainDataSection = true;
- recordText = false;
- logTextInfo = "";
- addEntry("default", currentComponent, getCurrentFile().toString(),
- streamReader.getLocation().getLineNumber(), "what log info", -1, new Metadata.WhatEntry(currentComponent, members));
- return true;
- } else if (inWhatLogSection && !tagName.equalsIgnoreCase("export") && !tagName.equalsIgnoreCase("whatlog")) {
- if (logTextInfo.trim().length() > 0) {
- String member = SBSLogMetaDataInput.removeDriveAndBldInf(logTextInfo.trim());
- boolean exists = (new File(logTextInfo.trim())).exists();
- Metadata.WhatLogMember entry = new Metadata.WhatLogMember(member, exists);
- members.add(entry);
+ Statistics stat = new Statistics();
+ boolean entryCreated = findAndAddEntries(logTextInfo, currentComponent,
+ getCurrentFile().toString(), lineNumber, stat);
+ if (stat.getSeveriry("error") == 0 && recipeStatus.equals("failed")) {
+ addEntry("error", currentComponent, getCurrentFile().toString(),
+ lineNumber, FAILED_STATUS_MESSAGE);
+ entryCreated = true;
}
logTextInfo = "";
- recordText = false;
- } else if (tagName.equalsIgnoreCase("clean")) {
- inMainDataSection = true;
- } else if (tagName.equalsIgnoreCase("info")) {
- inMainDataSection = true;
- recordText = false;
- if (logTextInfo != null) {
- Matcher m = buildTimeMatcher.matcher(logTextInfo);
- if (m.matches()) {
- buildTime = Integer.parseInt(m.group(1));
- logger.info("Run time: " + buildTime);
- }
+ recipeStatus = "ok";
+ return entryCreated;
+ }
+ } else if (tagName.equalsIgnoreCase("error")
+ || tagName.equalsIgnoreCase("warning")) {
+ inMainDataSection = true;
+ recordText = false;
+ if (currentComponent == null) {
+ currentComponent = "general";
+ }
+ addEntry(tagName, currentComponent, getCurrentFile().toString(), lineNumber,
+ logTextInfo);
+ logTextInfo = "";
+ return true;
+ } else if (tagName.equalsIgnoreCase("whatlog") ) {
+ inWhatLogSection = false;
+ inMainDataSection = true;
+ recordText = false;
+ logTextInfo = "";
+ addEntry("default", currentComponent, getCurrentFile().toString(),
+ streamReader.getLocation().getLineNumber(), "what log info", -1, new Metadata.WhatEntry(currentComponent, members));
+ return true;
+ } else if (inWhatLogSection && !tagName.equalsIgnoreCase("export") && !tagName.equalsIgnoreCase("whatlog")) {
+ if (logTextInfo.trim().length() > 0) {
+ String member = SBSLogMetaDataInput.removeDriveAndBldInf(logTextInfo.trim());
+ boolean exists = (new File(logTextInfo.trim())).exists();
+ Metadata.WhatLogMember entry = new Metadata.WhatLogMember(member, exists);
+ members.add(entry);
+ }
+ logTextInfo = "";
+ recordText = false;
+ } else if (tagName.equalsIgnoreCase("clean")) {
+ inMainDataSection = true;
+ } else if (tagName.equalsIgnoreCase("info")) {
+ inMainDataSection = true;
+ recordText = false;
+ if (logTextInfo != null) {
+ Matcher matcher = buildTimeMatcher.matcher(logTextInfo);
+ if (matcher.matches()) {
+ buildTime = Integer.parseInt(matcher.group(1));
+ logger.info("Run time: " + buildTime);
}
- logTextInfo = "";
}
+ logTextInfo = "";
+ }
return false;
}
@@ -725,27 +725,27 @@
while (xmlStreamReader.hasNext()) {
int eventType = xmlStreamReader.next();
switch (eventType) {
- case XMLEvent.START_ELEMENT:
- startElement(xmlStreamReader);
- break;
- case XMLEvent.END_ELEMENT:
- endElement(xmlStreamReader);
- break;
- case XMLEvent.CHARACTERS:
- String path = characters(xmlStreamReader);
- if (path != null ) {
- currentList = getEntry(path);
- if (currentList != null && !currentList.isEmpty()) {
- if (currentComponent != null) {
- updateCategoryEntries(currentList, currentComponent);
- CategoryEntry entry = (CategoryEntry)currentList.remove(0);
- return entry;
+ case XMLEvent.START_ELEMENT:
+ startElement(xmlStreamReader);
+ break;
+ case XMLEvent.END_ELEMENT:
+ endElement(xmlStreamReader);
+ break;
+ case XMLEvent.CHARACTERS:
+ String path = characters(xmlStreamReader);
+ if (path != null ) {
+ currentList = getEntry(path);
+ if (currentList != null && !currentList.isEmpty()) {
+ if (currentComponent != null) {
+ updateCategoryEntries(currentList, currentComponent);
+ CategoryEntry entry = (CategoryEntry)currentList.remove(0);
+ return entry;
+ }
}
}
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
}
}
if (xmlStreamReader != null) {
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/XMLLogMetaDataInput.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/XMLLogMetaDataInput.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/ant/types/XMLLogMetaDataInput.java Wed Jun 16 16:51:40 2010 +0300
@@ -46,11 +46,11 @@
* Constructor
*/
public XMLLogMetaDataInput() {
- inParsing = true;
- xmlInputFactory = XMLInputFactory.newInstance();
- xmlInputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES,Boolean.TRUE);
- xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES,Boolean.FALSE);
- xmlInputFactory.setProperty(XMLInputFactory.IS_COALESCING , Boolean.TRUE);
+ inParsing = true;
+ xmlInputFactory = XMLInputFactory.newInstance();
+ xmlInputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES,Boolean.TRUE);
+ xmlInputFactory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES,Boolean.FALSE);
+ xmlInputFactory.setProperty(XMLInputFactory.IS_COALESCING , Boolean.TRUE);
}
@@ -88,17 +88,17 @@
while (xmlStreamReader.hasNext()) {
eventType = xmlStreamReader.next();
switch (eventType) {
- case XMLEvent.START_ELEMENT:
- entryCreated = startElement(xmlStreamReader);
- break;
- case XMLEvent.END_ELEMENT:
- entryCreated = endElement(xmlStreamReader);
- break;
- case XMLEvent.CHARACTERS:
- entryCreated = characters(xmlStreamReader);
- break;
- default:
- break;
+ case XMLEvent.START_ELEMENT:
+ entryCreated = startElement(xmlStreamReader);
+ break;
+ case XMLEvent.END_ELEMENT:
+ entryCreated = endElement(xmlStreamReader);
+ break;
+ case XMLEvent.CHARACTERS:
+ entryCreated = characters(xmlStreamReader);
+ break;
+ default:
+ break;
}
if ( entryCreated) {
return true;
@@ -115,7 +115,7 @@
log.debug("FileNotFoundException in isEntryCreated" + ex);
// CheckStyle:IllegalCatch OFF
} catch (RuntimeException ex) { //have to catch this otherwise it crashes other parts of the code
- throw new BuildException ("Failed during writing data to db: ", ex);
+ throw new BuildException("Failed during writing data to db: ", ex);
}
// CheckStyle:IllegalCatch ON
return false;
@@ -127,7 +127,7 @@
* @param streamReader: the input stream reader which contains the xml data to be parsed for recording data.
* @return true if there are any element to be added to the database.
*/
- abstract boolean startElement (XMLStreamReader streamReader) ;
+ abstract boolean startElement(XMLStreamReader streamReader) ;
/**
* Function implemented by the subclasses to process the end event of xml stream callback.
@@ -141,5 +141,5 @@
* @param streamReader: the input stream reader which contains the xml data to be parsed for recording data.
* @return true if there are any element to be added to the database.
*/
- abstract boolean characters (XMLStreamReader streamReader);
+ abstract boolean characters(XMLStreamReader streamReader);
}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/db/ORMMetadataDB.java
--- a/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/db/ORMMetadataDB.java Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/metadata/src/com/nokia/helium/metadata/db/ORMMetadataDB.java Wed Jun 16 16:51:40 2010 +0300
@@ -58,7 +58,7 @@
}
public void finalizeMetadata(String logPath) {
- MetadataUtil.finalizeMetadata(logPath);
+ MetadataUtil.finalizeMetadata(dbPath, logPath);
}
public void finalizeDB() {
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/antunit/test_metadata.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/tests/antunit/test_metadata.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,146 @@
+
+
+
+ Helium antlib metadata tests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ macro: ${basedir}/../src/templates
+
+
+ templatedir: "${basedir}/src/templates"
+ template: "components_status.xml.ftl"
+ dbPath: "tests/metadata_db"
+ countOnly: "true"
+ tableName: "out"
+ queryString: "where priority='WARNING' or priority='error'"
+ limit: "500"
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dbPath: ${basedir}\metadata_db
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/antunit/test_regex.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/tests/antunit/test_regex.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,800 @@
+
+
+ Helium Antlib metadata unittests.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dbPath: ${test.temp.dir}/categorization_db
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+
+
+
+
+ cleanlog_errors: ${cleanlog_errors}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ test-categorization-nocleanlog: ${nocleanlog_errors}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ macro: ${project.dir}/../../src/templates
+
+
+
+ dbPath: ${test.temp.dir}/log-entry-category_component_check_db
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ macro: ${project.dir}/../../src/templates/macro
+
+
+ dbPath: ${metadata-read-db}
+ loginfo: xml(${project.dir}/../data/ido_abs_mcl_devlon70_robot_MCL.70.500_info.log)
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dbPath: ${test.temp.dir}/whatlog_db
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ dbPath: ${test.temp.dir}/test-release-database-fmpp_db
+ ant: antProperties()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/antunit/test_validity.ant.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/tests/antunit/test_validity.ant.xml Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,67 @@
+
+
+
+ Helium Antlib diamonds unittests.
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/data/all_regex1_type.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/tests/data/all_regex1_type.log Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,67 @@
+
+
+sbs: version 2.5.3 [2009-03-12 release]
+
+SBS_HOME E:/Build_E/ido-config-df/sbs
+Set-up E:/Build_E/ido-config-df/sbs/sbs_init.xml
+E:/build_e/sbs_2.8.4/sbs/win32/mingw/bin/cpp.exe:
+Command-line-arguments -s z:\output/build/canonical_system_definition_build.xml -k -c armv5 -j 4 -m z:\output\logs/ido_imm_mcl_devlon70_robot_5.1.005__armv5_multiple_thread_build_Makefile --filters=FilterHeliumLog -f z:\output\logs/ido_imm_mcl_devlon70_robot_5.1.005__armv5_multiple_thread_build_compile.log
+
+
++ RV=0
++ set +x
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/data/build_roms_sample.log
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/tests/data/build_roms_sample.log Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,282 @@
+Starting build: 75090
+mkdir epoc32\rombuild\temp
+mkdir epoc32\rombuild\temp\config_0
+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/ncp79/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/ncp79/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/ncp79/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/ncp79/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/ncp79/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/ncp79/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/ncp79/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/quickoffice/licenses/corolla/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/quickoffice/licenses/corolla/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_QuickofficeStub.exe.map" or "\epoc32\release\ARMV5\urel\ap_QuickofficeStub.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 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/functionality/test_regex.ant.xml
--- a/buildframework/helium/sf/java/metadata/tests/functionality/test_regex.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,759 +0,0 @@
-
-
- Helium Antlib metadata unittests.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dbPath: ${test.temp.dir}/categorization_db
- ant: antProperties()
-
-
-
-
-
-
-
-
-
-
-
-
-
- cleanlog_errors: ${cleanlog_errors}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- test-categorization-nocleanlog: ${nocleanlog_errors}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- macro: ${project.dir}/../../src/templates
-
-
-
- dbPath: ${test.temp.dir}/log-entry-category_component_check_db
- ant: antProperties()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- macro: ${project.dir}/../../src/templates/macro
-
-
- dbPath: ${metadata-read-db}
- loginfo: xml(${project.dir}/../data/ido_abs_mcl_devlon70_robot_MCL.70.500_info.log)
- ant: antProperties()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dbPath: ${test.temp.dir}/whatlog_db
- ant: antProperties()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- dbPath: ${test.temp.dir}/test-release-database-fmpp_db
- ant: antProperties()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/output.txt
--- a/buildframework/helium/sf/java/metadata/tests/output.txt Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1336 +0,0 @@
-Buildfile: functionality\test_regex.ant.xml
-
-test-readdata:
- [fmpp] args.size:1
- [fmpp] arg-list:E:\Build_E\eclipse_fasym013\helium-antlib-trunk\sf\metadata\tests\functionality/../output/log_all_filterfile.db
- [fmpp] QueryModel:select * from priority
- [fmpp] query in SQLTemplateModelselect * from priority
- [fmpp] QueryModel:select * from component
- [fmpp] query in SQLTemplateModelselect * from component
- [fmpp] QueryModel:select * from logpath
- [fmpp] query in SQLTemplateModelselect * from logpath
- [fmpp] isDataRead:false
- [fmpp] sql queryselect * from priority
- [fmpp] data:0
- [fmpp] data:''
- [fmpp] data:1
- [fmpp] data:ERROR
- [fmpp] data:2
- [fmpp] data:WARNING
- [fmpp] data:3
- [fmpp] data:CRITICAL
- [fmpp] data:4
- [fmpp] data:REMARK
- [fmpp] indexmap size5
- [fmpp] indexmap size5
- [fmpp] QueryModel:3
- [fmpp] datalist size1
- [fmpp] QueryModel:select count(logText) as COUNT from metadata_table where priority_id=3
- [fmpp] query in SQLTemplateModelselect count(logText) as COUNT from metadata_table where priority_id=3
- [fmpp] isDataRead:false
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=3
- [fmpp] data:2
- [fmpp] indexmap size1
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=3
- [fmpp] columnName:COUNT
- [fmpp] resultSet MetaData column Count=1
- [fmpp] adding records
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] QueryModel:select count(logText) as COUNT from metadata_table where priority_id=2
- [fmpp] query in SQLTemplateModelselect count(logText) as COUNT from metadata_table where priority_id=2
- [fmpp] isDataRead:false
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=2
- [fmpp] data:36
- [fmpp] indexmap size1
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=2
- [fmpp] columnName:COUNT
- [fmpp] resultSet MetaData column Count=1
- [fmpp] adding records
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] QueryModel:select count(logText) as COUNT from metadata_table where priority_id=1
- [fmpp] query in SQLTemplateModelselect count(logText) as COUNT from metadata_table where priority_id=1
- [fmpp] isDataRead:false
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=1
- [fmpp] data:32
- [fmpp] indexmap size1
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=1
- [fmpp] columnName:COUNT
- [fmpp] resultSet MetaData column Count=1
- [fmpp] adding records
- [fmpp] indexmap size5
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] QueryModel:select count(logText) as COUNT from metadata_table where priority_id=0
- [fmpp] query in SQLTemplateModelselect count(logText) as COUNT from metadata_table where priority_id=0
- [fmpp] isDataRead:false
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=0
- [fmpp] data:0
- [fmpp] indexmap size1
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=0
- [fmpp] columnName:COUNT
- [fmpp] resultSet MetaData column Count=1
- [fmpp] adding records
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] QueryModel:select count(logText) as COUNT from metadata_table where priority_id=4
- [fmpp] query in SQLTemplateModelselect count(logText) as COUNT from metadata_table where priority_id=4
- [fmpp] isDataRead:false
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=4
- [fmpp] data:12
- [fmpp] indexmap size1
- [fmpp] sql queryselect count(logText) as COUNT from metadata_table where priority_id=4
- [fmpp] columnName:COUNT
- [fmpp] resultSet MetaData column Count=1
- [fmpp] adding records
- [fmpp] indexmap size5
- [fmpp] QueryModel:3
- [fmpp] datalist size1
- [fmpp] QueryModel:select * from metadata_table where priority_id=3
- [fmpp] query in SQLTemplateModelselect * from metadata_table where priority_id=3
- [fmpp] iterator constructor called
- [fmpp] checking any more element
- [fmpp] getting records
- [fmpp] sql queryselect * from metadata_table where priority_id=3 limit 5000 offset 0;
- [fmpp] columnName:component_id
- [fmpp] columnName:priority_id
- [fmpp] columnName:logText
- [fmpp] columnName:lineNumber
- [fmpp] columnName:logname_id
- [fmpp] resultSet MetaData column Count=5
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] next:count:0
- [fmpp] logtext:next:mingw_make.exe: error
- [fmpp] checking any more element
- [fmpp] isDataRead:false
- [fmpp] sql queryselect * from component
- [fmpp] data:0
- [fmpp] data:z:/sf/app/camera/group/bld.inf
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:1
- [fmpp] logtext:next:mingw_make.exe: error
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] QueryModel:select * from metadata_table where priority_id=2
- [fmpp] query in SQLTemplateModelselect * from metadata_table where priority_id=2
- [fmpp] iterator constructor called
- [fmpp] checking any more element
- [fmpp] getting records
- [fmpp] sql queryselect * from metadata_table where priority_id=2 limit 5000 offset 0;
- [fmpp] columnName:component_id
- [fmpp] columnName:priority_id
- [fmpp] columnName:logText
- [fmpp] columnName:lineNumber
- [fmpp] columnName:logname_id
- [fmpp] resultSet MetaData column Count=5
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] next:count:0
- [fmpp] logtext:next:WARNING:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:1
- [fmpp] logtext:next:LINK : warning
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:2
- [fmpp] logtext:next::10: warning: cannot find matching deallocation function
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:3
- [fmpp] logtext:next:100) : WARNING: TEST123
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:4
- [fmpp] logtext:next:MAKEDEF WARNING: TEST
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:5
- [fmpp] logtext:next:TEST 123 \\(10) : Warning: (400)
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:6
- [fmpp] logtext:next:BLDMAKE WARNING: bldm warning
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:7
- [fmpp] logtext:next:MAKEDEF WARNING: make warning
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:8
- [fmpp] logtext:next:atest(100) : warning C aasdfa
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:9
- [fmpp] logtext:next:testas 100: warning: test123
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:10
- [fmpp] logtext:next:usage Usage Warning: warn1
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:11
- [fmpp] logtext:next:abcd mwld.exe: abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:12
- [fmpp] logtext:next:Command line warning abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:13
- [fmpp] logtext:next:anything ERROR: bad relocation: test123
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:14
- [fmpp] logtext:next:10 warning in component1
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:15
- [fmpp] logtext:next:EventType: Error Source: SweepNTabcde
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:16
- [fmpp] logtext:next:WARN test
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:17
- [fmpp] logtext:next:abcd :10: warning: cannot find matching deallocation function 100:note abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:18
- [fmpp] logtext:next:WARNING:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:19
- [fmpp] logtext:next:LINK : warning
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:20
- [fmpp] logtext:next::10: warning: cannot find matching deallocation function
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:21
- [fmpp] logtext:next:100) : WARNING: TEST123
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:22
- [fmpp] logtext:next:MAKEDEF WARNING: TEST
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:23
- [fmpp] logtext:next:TEST 123 \\(10) : Warning: (400)
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:24
- [fmpp] logtext:next:BLDMAKE WARNING: bldm warning
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:25
- [fmpp] logtext:next:MAKEDEF WARNING: make warning
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:26
- [fmpp] logtext:next:atest(100) : warning C aasdfa
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:27
- [fmpp] logtext:next:testas 100: warning: test123
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:28
- [fmpp] logtext:next:usage Usage Warning: warn1
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:29
- [fmpp] logtext:next:abcd mwld.exe: abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:30
- [fmpp] logtext:next:Command line warning abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:31
- [fmpp] logtext:next:anything ERROR: bad relocation: test123
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:32
- [fmpp] logtext:next:10 warning in component1
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:33
- [fmpp] logtext:next:EventType: Error Source: SweepNTabcde
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:34
- [fmpp] logtext:next:WARN test
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:35
- [fmpp] logtext:next:abcd :10: warning: cannot find matching deallocation function 100:note abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] QueryModel:select * from metadata_table where priority_id=1
- [fmpp] query in SQLTemplateModelselect * from metadata_table where priority_id=1
- [fmpp] iterator constructor called
- [fmpp] checking any more element
- [fmpp] getting records
- [fmpp] sql queryselect * from metadata_table where priority_id=1 limit 5000 offset 0;
- [fmpp] columnName:component_id
- [fmpp] columnName:priority_id
- [fmpp] columnName:logText
- [fmpp] columnName:lineNumber
- [fmpp] columnName:logname_id
- [fmpp] resultSet MetaData column Count=5
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] next:count:0
- [fmpp] logtext:next:test FATAL ERROR(S):abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:1
- [fmpp] logtext:next:): Missing file:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:2
- [fmpp] logtext:next:abcd FLEXlm error:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:3
- [fmpp] logtext:next:ABLD ERROR: 1234
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:4
- [fmpp] logtext:next:BLDMAKE ERROR: 43543
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:5
- [fmpp] logtext:next:fatal error U1077 error occured
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:6
- [fmpp] logtext:next:test warning U4010
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:7
- [fmpp] logtext:next:make[10]: ***abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:8
- [fmpp] logtext:next:make[10]: abcd not remade because of errors
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:9
- [fmpp] logtext:next:ERROR: build error
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:10
- [fmpp] logtext:next:ERROR EC95940: ec error
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:11
- [fmpp] logtext:next:Errors caused tool to abort. asdfasdf
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:12
- [fmpp] logtext:next:test no rule to make target
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:13
- [fmpp] logtext:next:ERROR,.*no rule to make.*,
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:14
- [fmpp] logtext:next:ERROR testing
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:15
- [fmpp] logtext:next:"abcd , line 100: Error: 100abcd:. abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:16
- [fmpp] logtext:next:test FATAL ERROR(S):abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:17
- [fmpp] logtext:next:): Missing file:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:18
- [fmpp] logtext:next:abcd FLEXlm error:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:19
- [fmpp] logtext:next:ABLD ERROR: 1234
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:20
- [fmpp] logtext:next:BLDMAKE ERROR: 43543
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:21
- [fmpp] logtext:next:fatal error U1077 error occured
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:22
- [fmpp] logtext:next:test warning U4010
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:23
- [fmpp] logtext:next:make[10]: ***abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:24
- [fmpp] logtext:next:make[10]: abcd not remade because of errors
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:25
- [fmpp] logtext:next:ERROR: build error
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:26
- [fmpp] logtext:next:ERROR EC95940: ec error
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:27
- [fmpp] logtext:next:Errors caused tool to abort. asdfasdf
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:28
- [fmpp] logtext:next:test no rule to make target
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:29
- [fmpp] logtext:next:ERROR,.*no rule to make.*,
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:30
- [fmpp] logtext:next:ERROR testing
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:31
- [fmpp] logtext:next:"abcd , line 100: Error: 100abcd:. abcd
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] indexmap size5
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] QueryModel:select * from metadata_table where priority_id=0
- [fmpp] query in SQLTemplateModelselect * from metadata_table where priority_id=0
- [fmpp] iterator constructor called
- [fmpp] checking any more element
- [fmpp] getting records
- [fmpp] sql queryselect * from metadata_table where priority_id=0 limit 5000 offset 0;
- [fmpp] columnName:component_id
- [fmpp] columnName:priority_id
- [fmpp] columnName:logText
- [fmpp] columnName:lineNumber
- [fmpp] columnName:logname_id
- [fmpp] resultSet MetaData column Count=5
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] QueryModel:select * from metadata_table where priority_id=4
- [fmpp] query in SQLTemplateModelselect * from metadata_table where priority_id=4
- [fmpp] iterator constructor called
- [fmpp] checking any more element
- [fmpp] getting records
- [fmpp] sql queryselect * from metadata_table where priority_id=4 limit 5000 offset 0;
- [fmpp] columnName:component_id
- [fmpp] columnName:priority_id
- [fmpp] columnName:logText
- [fmpp] columnName:lineNumber
- [fmpp] columnName:logname_id
- [fmpp] resultSet MetaData column Count=5
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] next:count:0
- [fmpp] logtext:next:REMARK:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:1
- [fmpp] logtext:next:INFO:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:2
- [fmpp] logtext:next:anything Command line warning D4025 : test
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:3
- [fmpp] logtext:next:REMARK: test remark anything
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:4
- [fmpp] logtext:next:EventType: Error Source: GNU Make.
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:5
- [fmpp] logtext:next:INFO: any info match
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:6
- [fmpp] logtext:next:REMARK:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:7
- [fmpp] logtext:next:INFO:
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:8
- [fmpp] logtext:next:anything Command line warning D4025 : test
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:9
- [fmpp] logtext:next:REMARK: test remark anything
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:10
- [fmpp] logtext:next:EventType: Error Source: GNU Make.
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] next:count:11
- [fmpp] logtext:next:INFO: any info match
- [fmpp] checking any more element
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] indexmap size1
- [fmpp] indexmap size1
- [fmpp] QueryModel:0
- [fmpp] datalist size1
- [fmpp] QueryModel:select * from metadata_table where component_id=0 order by priority_id
- [fmpp] query in SQLTemplateModelselect * from metadata_table where component_id=0 order by priority_id
- [fmpp] iterator constructor called
- [fmpp] checking any more element
- [fmpp] getting records
- [fmpp] sql queryselect * from metadata_table where component_id=0 order by priority_id limit 5000 offset 0;
- [fmpp] columnName:component_id
- [fmpp] columnName:priority_id
- [fmpp] columnName:logText
- [fmpp] columnName:lineNumber
- [fmpp] columnName:logname_id
- [fmpp] resultSet MetaData column Count=5
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] adding records
- [fmpp] next:count:0
- [fmpp] logtext:next:test FATAL ERROR(S):abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:1
- [fmpp] logtext:next:): Missing file:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:2
- [fmpp] logtext:next:abcd FLEXlm error:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:3
- [fmpp] logtext:next:ABLD ERROR: 1234
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:4
- [fmpp] logtext:next:BLDMAKE ERROR: 43543
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:5
- [fmpp] logtext:next:fatal error U1077 error occured
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:6
- [fmpp] logtext:next:test warning U4010
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:7
- [fmpp] logtext:next:make[10]: ***abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:8
- [fmpp] logtext:next:make[10]: abcd not remade because of errors
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:9
- [fmpp] logtext:next:ERROR: build error
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:10
- [fmpp] logtext:next:ERROR EC95940: ec error
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:11
- [fmpp] logtext:next:Errors caused tool to abort. asdfasdf
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:12
- [fmpp] logtext:next:test no rule to make target
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:13
- [fmpp] logtext:next:ERROR,.*no rule to make.*,
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:14
- [fmpp] logtext:next:ERROR testing
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:15
- [fmpp] logtext:next:"abcd , line 100: Error: 100abcd:. abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:16
- [fmpp] logtext:next:test FATAL ERROR(S):abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:17
- [fmpp] logtext:next:): Missing file:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:18
- [fmpp] logtext:next:abcd FLEXlm error:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:19
- [fmpp] logtext:next:ABLD ERROR: 1234
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:20
- [fmpp] logtext:next:BLDMAKE ERROR: 43543
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:21
- [fmpp] logtext:next:fatal error U1077 error occured
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:22
- [fmpp] logtext:next:test warning U4010
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:23
- [fmpp] logtext:next:make[10]: ***abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:24
- [fmpp] logtext:next:make[10]: abcd not remade because of errors
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:25
- [fmpp] logtext:next:ERROR: build error
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:26
- [fmpp] logtext:next:ERROR EC95940: ec error
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:27
- [fmpp] logtext:next:Errors caused tool to abort. asdfasdf
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:28
- [fmpp] logtext:next:test no rule to make target
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:29
- [fmpp] logtext:next:ERROR,.*no rule to make.*,
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:30
- [fmpp] logtext:next:ERROR testing
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:31
- [fmpp] logtext:next:"abcd , line 100: Error: 100abcd:. abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:1
- [fmpp] datalist size1
- [fmpp] next:count:32
- [fmpp] logtext:next:WARNING:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:33
- [fmpp] logtext:next:LINK : warning
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:34
- [fmpp] logtext:next::10: warning: cannot find matching deallocation function
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:35
- [fmpp] logtext:next:100) : WARNING: TEST123
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:36
- [fmpp] logtext:next:MAKEDEF WARNING: TEST
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:37
- [fmpp] logtext:next:TEST 123 \\(10) : Warning: (400)
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:38
- [fmpp] logtext:next:BLDMAKE WARNING: bldm warning
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:39
- [fmpp] logtext:next:MAKEDEF WARNING: make warning
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:40
- [fmpp] logtext:next:atest(100) : warning C aasdfa
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:41
- [fmpp] logtext:next:testas 100: warning: test123
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:42
- [fmpp] logtext:next:usage Usage Warning: warn1
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:43
- [fmpp] logtext:next:abcd mwld.exe: abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:44
- [fmpp] logtext:next:Command line warning abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:45
- [fmpp] logtext:next:anything ERROR: bad relocation: test123
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:46
- [fmpp] logtext:next:10 warning in component1
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:47
- [fmpp] logtext:next:EventType: Error Source: SweepNTabcde
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:48
- [fmpp] logtext:next:WARN test
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:49
- [fmpp] logtext:next:abcd :10: warning: cannot find matching deallocation function 100:note abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:50
- [fmpp] logtext:next:WARNING:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:51
- [fmpp] logtext:next:LINK : warning
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:52
- [fmpp] logtext:next::10: warning: cannot find matching deallocation function
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:53
- [fmpp] logtext:next:100) : WARNING: TEST123
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:54
- [fmpp] logtext:next:MAKEDEF WARNING: TEST
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:55
- [fmpp] logtext:next:TEST 123 \\(10) : Warning: (400)
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:56
- [fmpp] logtext:next:BLDMAKE WARNING: bldm warning
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:57
- [fmpp] logtext:next:MAKEDEF WARNING: make warning
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:58
- [fmpp] logtext:next:atest(100) : warning C aasdfa
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:59
- [fmpp] logtext:next:testas 100: warning: test123
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:60
- [fmpp] logtext:next:usage Usage Warning: warn1
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:61
- [fmpp] logtext:next:abcd mwld.exe: abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:62
- [fmpp] logtext:next:Command line warning abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:63
- [fmpp] logtext:next:anything ERROR: bad relocation: test123
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:64
- [fmpp] logtext:next:10 warning in component1
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:65
- [fmpp] logtext:next:EventType: Error Source: SweepNTabcde
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:66
- [fmpp] logtext:next:WARN test
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:67
- [fmpp] logtext:next:abcd :10: warning: cannot find matching deallocation function 100:note abcd
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:2
- [fmpp] datalist size1
- [fmpp] next:count:68
- [fmpp] logtext:next:mingw_make.exe: error
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:3
- [fmpp] datalist size1
- [fmpp] next:count:69
- [fmpp] logtext:next:mingw_make.exe: error
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:3
- [fmpp] datalist size1
- [fmpp] next:count:70
- [fmpp] logtext:next:REMARK:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:71
- [fmpp] logtext:next:INFO:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:72
- [fmpp] logtext:next:anything Command line warning D4025 : test
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:73
- [fmpp] logtext:next:REMARK: test remark anything
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:74
- [fmpp] logtext:next:EventType: Error Source: GNU Make.
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:75
- [fmpp] logtext:next:INFO: any info match
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:76
- [fmpp] logtext:next:REMARK:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:77
- [fmpp] logtext:next:INFO:
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:78
- [fmpp] logtext:next:anything Command line warning D4025 : test
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:79
- [fmpp] logtext:next:REMARK: test remark anything
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:80
- [fmpp] logtext:next:EventType: Error Source: GNU Make.
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] next:count:81
- [fmpp] logtext:next:INFO: any info match
- [fmpp] checking any more element
- [fmpp] indexmap size5
- [fmpp] QueryModel:4
- [fmpp] datalist size1
- [fmpp] File processed.
-
-BUILD SUCCESSFUL
-Total time: 1 second
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/output1.txt
--- a/buildframework/helium/sf/java/metadata/tests/output1.txt Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-Buildfile: functionality\test_regex.ant.xml
-
-test-readdata:
- [fmpp] args.size:6
- [fmpp] arg-list:E:\Build_E\eclipse_fasym013\helium-antlib-trunk\sf\metadata\tests\output\log_all_filterfile.db
- [fmpp] arg-list:LOG_ALL_FILTERFILE
- [fmpp] arg-list:10
- [fmpp] arg-list:-1
- [fmpp] arg-list:where priority='WARNING'
- [fmpp] arg-list:true
- [fmpp] offset-1
- [fmpp] recordLimit10
- [fmpp] Initializing the db
- [fmpp] updating queries
- [fmpp] adding table details
- [fmpp] adding record size
- [fmpp] updateQuery:-1
- [fmpp] sqlquery:SELECT COUNT(*) AS COUNT FROM LOG_ALL_FILTERFILE where priority='WARNING'
- [fmpp] record count:36
- [fmpp] recordcount:36
- [fmpp] updatequery:10
- [fmpp] maxoffset:4
- [fmpp] iterator constructor called
- [fmpp] checking any more element
- [fmpp] SQLTemplateModelIterator:offset:0
- [fmpp] adding table details
- [fmpp] adding record size
- [fmpp] updateQuery:0
- [fmpp] adding records
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 0;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:10
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 0;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:10
- [fmpp] checking any more element
- [fmpp] SQLTemplateModelIterator:offset:10
- [fmpp] adding table details
- [fmpp] adding record size
- [fmpp] updateQuery:10
- [fmpp] adding records
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 10;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:10
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 10;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:10
- [fmpp] checking any more element
- [fmpp] SQLTemplateModelIterator:offset:20
- [fmpp] adding table details
- [fmpp] adding record size
- [fmpp] updateQuery:20
- [fmpp] adding records
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 20;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:10
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 20;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:10
- [fmpp] checking any more element
- [fmpp] SQLTemplateModelIterator:offset:30
- [fmpp] adding table details
- [fmpp] adding record size
- [fmpp] updateQuery:30
- [fmpp] adding records
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 30;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:6
- [fmpp] actual query:where priority='WARNING'
- [fmpp] sql querySELECT * from LOG_ALL_FILTERFILE where priority='WARNING' limit 10 offset 30;
- [fmpp] no. of columns from query result:3
- [fmpp] record size in getRecords:6
- [fmpp] checking any more element
- [fmpp] File processed.
-
-BUILD SUCCESSFUL
-Total time: 0 seconds
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/src/com/nokia/helium/metadata/tests/TestIMakerLogMetaDataInput.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/metadata/tests/src/com/nokia/helium/metadata/tests/TestIMakerLogMetaDataInput.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,63 @@
+/*
+ * 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.tests;
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.FileSet;
+import org.junit.Test;
+
+import com.nokia.helium.jpa.entity.metadata.Metadata;
+import com.nokia.helium.metadata.ant.types.IMakerLogMetaDataInput;
+
+/**
+ * Tests the iMaker log metadata input parser.
+ */
+public class TestIMakerLogMetaDataInput {
+
+ /** The number of images in the sample log file that has errors. */
+ public static final int IMAGES_WITH_ERRORS_TOTAL = 5;
+
+ /**
+ * Read a sample log file and verify that the right number of images (components) is identified.
+ */
+ @Test
+ public void testParseIMakerLogfile() {
+ IMakerLogMetaDataInput imakerInput = new IMakerLogMetaDataInput();
+ imakerInput.setProject(new Project());
+ FileSet fileset = new FileSet();
+ fileset.setDir(new File("."));
+ fileset.setFile(new File("../sf/java/metadata/tests/data/build_roms_sample.log"));
+ imakerInput.add(fileset);
+
+ // Iterate through the entries
+ Iterator inputIterator = imakerInput.iterator();
+ int componentTotal = 0;
+ while (inputIterator.hasNext()) {
+ Metadata.LogEntry logEntry = inputIterator.next();
+ System.out.println("logentry: " + logEntry.toString());
+ componentTotal++;
+ }
+ assert (componentTotal == IMAGES_WITH_ERRORS_TOTAL);
+ }
+}
+
+
+
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/test_metadata.ant.xml
--- a/buildframework/helium/sf/java/metadata/tests/test_metadata.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-
-
-
- Helium antlib metadata tests.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- macro: ${basedir}/../src/templates
-
-
- templatedir: "${basedir}/src/templates"
- template: "components_status.xml.ftl"
- dbPath: "tests/out.sqlite"
- countOnly: "true"
- tableName: "out"
- queryString: "where priority='WARNING' or priority='error'"
- limit: "500"
- ant: antProperties()
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/metadata/tests/test_validity.ant.xml
--- a/buildframework/helium/sf/java/metadata/tests/test_validity.ant.xml Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-
-
-
- Helium Antlib diamonds unittests.
-
-
-
-
-
-
-
-
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/antlib.xml
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/antlib.xml Tue Apr 27 08:33:08 2010 +0300
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/antlib.xml Wed Jun 16 16:51:40 2010 +0300
@@ -22,11 +22,11 @@
-->
-
-
-
-
+
+
+
+
+
-
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTSummaryTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTSummaryTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,366 @@
+/*
+ * 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.quality.ant.taskdefs;
+
+import java.io.*;
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import java.io.FileReader;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+ /**
+ * This Task searches the index.html files created by CMT and looks for the summary
+ * values at the end of the file e.g. Files: 12 LOCphy: 137.
+ * and takes the info and places it in an XMl file ready to be sent to diamonds. The Xml
+ * file is placed in the diamonds folder in the output folder and these files are then
+ * sent to diamonds when the build is finished soall we have to do is create the file in the
+ * correct folder.
+ *
+ *
+ * <hlm:cmtmetadatainput
+ diamondsHeaderFileName="C:\brtaylor\1\diamonds_header.xml"
+ diamondsFooterFileName="C:\brtaylor\1\diamonds_footer.xml"
+ outptuFile="Z:\output\diamonds/cmt_summary_componentName_1.xml/"
+ inputFile="Z:\output\logs/minibuild_ido_0.0.03_test_cmt_componentName1_cmt/CMTHTML/index.html/>
+ *
+ *
+ * @ant.task name="cmtsummarytask" category="Quality"
+ */
+
+public class CMTSummaryTask extends Task {
+
+ /** the following 2 variables are indexes to the SEARCH_TERMS_ARRAY **/
+ /**index to the searched for text**/
+ private static final int INPUT_TEXT_INDEX = 0;
+ /**index to the text to write to the xml file**/
+ private static final int OUTPUT_ELEMENT_INDEX = 1;
+ /**get the system relevent line separator **/
+ private static final String NEW_LINE = System.getProperty( "line.separator" );
+
+ /** this array contains the text to be searched for in the inputFile (1st element)
+ and the text to be written to the .xml output file (2nd element)**/
+ private static final String[][] SEARCH_TERMS_ARRAY = {
+ //1st elem 2nd elem
+ {"Files:", "files"},
+ {"LOCphy:", "locphy"},
+ {"LOCbl:", "locbl"},
+ {"LOCpro:", "locpro"},
+ {"LOCcom:", "loccom"},
+ {"v(G) :", "vg"},
+ {"MI without comments :", "mi_wo_comments"},
+ {"MI comment weight :", "mi_comment_weight"},
+ {"MI:", "mi"}
+ };
+
+ /** always accesses the 1st group of the matcher**/
+ private static int matcherGroupNum; //default init is 0
+
+ /**indexes to the SEARCH_TERMS_ARRAY**/
+ private int arrayIndex;
+
+ private int sizeArray = SEARCH_TERMS_ARRAY.length;
+
+ private Logger log = Logger.getLogger(CMTSummaryTask.class);
+ /** the following variables are inputs to the class**/
+ /** the file containing the CMT summary data**/
+ private String inputFile;
+ /**name of file to write the output to**/
+ private String outputFile;
+
+ /**the following variables are used internally by the class**/
+ /** each line of the input file is read into this**/
+ private String line;
+ /**the regex for a string of digits**/
+ private Pattern digitPattern = Pattern.compile("\\d+");
+
+ /** file descriptor for the input file**/
+ private BufferedReader inputFileReader;
+
+ /**file handler used to write the summary numbers to the output file***/
+ private BufferedWriter output; //default init = null
+
+ /**tells the main method whether it should be looking for digist or text**/
+ private boolean lineStartsWithDigits; //default init = false
+
+ /**file name of the default diamonds XML file header part (1st few lines)
+ used so not writing the XML text here**/
+ private String diamondsHeaderFileName;
+ /**file name of the default diamonds XML file footer part (last line)
+ used so not writing the XML text here**/
+ private String diamondsFooterFileName;
+
+
+
+ /**
+ * @param outputFile
+ * set the output file name
+ * @ant.required
+ */
+ public void setOutputFile(String outputFile) {
+ this.outputFile = outputFile;
+ }
+
+ /**
+ * @return the outputFile
+ * the output file name
+ */
+ public String getOutputFile() {
+ return outputFile;
+ }
+
+
+ /**
+ * @return the inputFile
+ */
+ public String getinputFile() {
+ return inputFile;
+ }
+
+ /**
+ * @param inputFile
+ * the name of file to scan and extract data from
+ * @ant.required
+ */
+ public void setinputFile(String inputFile) {
+ this.inputFile = inputFile;
+ }
+
+ /**
+ * @param diamondsFooterFileName
+ * set the diamonds footer file name
+ * @ant.required
+ */
+ public void setdiamondsFooterFileName(String diamondsFooterFileName) {
+ this.diamondsFooterFileName = diamondsFooterFileName;
+ }
+
+ /**
+ * @return the diamondsFooterFileName
+ * the diamonds footer file name
+ */
+ public String getdiamondsFooterFileName() {
+ return diamondsFooterFileName;
+ }
+
+ /**
+ * @param diamondsHeaderFileName
+ * set the diamonds header file name
+ * @ant.required
+ */
+ public void setdiamondsHeaderFileName(String diamondsHeaderFileName) {
+ this.diamondsHeaderFileName = diamondsHeaderFileName;
+ }
+
+ /**
+ * @return the diamondsFooterFileName
+ * the diamonds footer file name
+ */
+ public String getdiamondsHeaderFileName() {
+ return diamondsHeaderFileName;
+ }
+
+
+ /**the main part of the code - the method that is called**/
+ public void execute() {
+ log("CMTSummaryTask execute method with input file : " + inputFile, Project.MSG_ERR);
+ boolean result;
+ String commandString;
+ boolean inputFileFound = true;
+ BufferedReader diamondsHeaderFile;
+ BufferedReader diamondsFooterFile;
+
+ Project prj = getProject();
+ log("output File is " + getOutputFile(), Project.MSG_ERR);
+
+ try {
+ //open the file with the CMT results init
+ inputFileReader = new BufferedReader(new FileReader(inputFile));
+ } catch (FileNotFoundException exc) {
+ log("FileNotFoundException while getting the input file. : " + inputFile + " " + exc.getMessage(), Project.MSG_ERR);
+ inputFileFound = false; //stops an empty output file being created.
+ }
+ if (inputFileFound) {
+ try {
+ //write the title stuff for the XML diamonds schema
+ output = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(getOutputFile()), "UTF8"));
+ } catch (FileNotFoundException exc) {
+ log("FileNotFoundException while getting the output file. : " + getOutputFile() + " " + exc.getMessage(), Project.MSG_ERR);
+ } 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) {
+ // 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 (output != null) {
+ //managed to open the output file
+ try {
+ //write the initial XML text to the file
+ String tempLine;
+ diamondsHeaderFile = null;
+ diamondsHeaderFile = new BufferedReader(new FileReader(getdiamondsHeaderFileName()));
+ while ((tempLine = diamondsHeaderFile.readLine()) != null) {
+ output.write(tempLine);
+ output.newLine();
+ }
+ diamondsHeaderFile.close();
+ output.write(" \r\n");
+
+ // CheckStyle:InnerAssignment OFF
+ //process each of the searchterms
+ while ((arrayIndex < sizeArray) && ((line = inputFileReader.readLine()) != null)) {
+ findTextAndOutput(); //read finput file and write the output
+ }
+ // CheckStyle:InnerAssignment ON
+
+ //write the end of file text
+ output.write(" ");
+ output.newLine();
+
+ diamondsFooterFile = null;
+ diamondsFooterFile = new BufferedReader(new FileReader(getdiamondsFooterFileName()));
+ while ((tempLine = diamondsFooterFile.readLine()) != null) {
+ output.write(tempLine);
+ output.newLine();
+ }
+ output.close(); //close the output file
+ diamondsFooterFile.close();
+ } catch (FileNotFoundException exc) {
+ log("FileNotFoundException while getting the diamonds header file : " + getdiamondsHeaderFileName() + " " + exc.getMessage(), Project.MSG_ERR);
+ } 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);
+ } 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);
+ }
+ } else {
+ log("Error: no output File available ", Project.MSG_ERR);
+ }
+ } else {
+ log("Error: no input File available ", Project.MSG_ERR);
+ }
+ }
+
+ /**
+ This is the function that performs the actual file searches and writes the number
+ following the searched for text to the output XML file
+ **/
+ private void findTextAndOutput()
+ {
+ final int colonSkip = 2;
+ byte[] lineBytes = null;
+ int len;
+ int buffLen;
+ int lineLen;
+ int serchTermTextLen;
+ int spacesLen;
+
+ try {
+ lineLen = line.length();
+ while ((lineLen > 0) && (arrayIndex < sizeArray)) {
+ //Process each of the groups of chars in a line
+ if (line.startsWith(SEARCH_TERMS_ARRAY[arrayIndex][INPUT_TEXT_INDEX])) {
+ //found the CMT data type we are looking for so look fo r the digits now
+ serchTermTextLen = SEARCH_TERMS_ARRAY[arrayIndex][INPUT_TEXT_INDEX].length();
+ buffLen = writeToOutput();
+ if ((buffLen > 0) && (arrayIndex < sizeArray)) {
+ //skip over the digits so can get the next searchterm near the begining of line
+ line = line.substring(line.indexOf(':') + colonSkip + buffLen);
+ spacesLen = removeAnySpaces();
+ lineLen = lineLen - (buffLen + serchTermTextLen + spacesLen); //decrease line length for the while loop
+ } else {
+ //didn't find the digits so probably at the end of the line and the digits
+ //are on the next line
+ len = line.length();
+ //convert the line to bytes so we can check for a specific Character
+ lineBytes = line.getBytes("UTF-8");
+ int sbLen = lineBytes.length;
+ //the last real char (i.e. not the EOL) should be '=' if the digits are on the next line
+ if (lineBytes[sbLen - 1] == '=') {
+ //found the '=' so read the next line in
+ lineStartsWithDigits = true;
+ lineLen = 0;
+ } else {
+ log("can't find the '=' at end of line ", Project.MSG_ERR);
+ lineLen = 0;
+ }
+ }
+ } else if (lineStartsWithDigits) { //probably got a line with digits on
+ buffLen = writeToOutput(); //definitely got a line with digits on
+ lineStartsWithDigits = false;
+ if ((buffLen > 0) && (arrayIndex < sizeArray)) { //now need to get rid of the digits and get to the next none digits char
+ line = line.substring(buffLen);
+ spacesLen = removeAnySpaces();
+ lineLen = lineLen - (buffLen + spacesLen); //decrease line length for the while loop
+ } else {
+ lineLen = 0;
+ log("can't find the digits at beg of line ", Project.MSG_ERR);
+ }
+ } else {
+ lineLen = 0;
+ }
+ }
+ } catch (IOException exc) {
+ log("IOException Error searching : " + exc.getMessage(), Project.MSG_ERR);
+ }
+ return;
+ }
+
+ private int writeToOutput() throws IOException
+ {
+ String buffer;
+ int buffLen;
+
+ Matcher componentMatch = digitPattern.matcher(line);
+ if (componentMatch.find()) {
+ //found the digits after the search term
+ buffer = componentMatch.group(matcherGroupNum);
+ //write the XML formated nn to the output file (plus the other)
+ output.write(" <" + SEARCH_TERMS_ARRAY[arrayIndex][OUTPUT_ELEMENT_INDEX] + ">");
+ output.write(buffer);
+ output.write("" + SEARCH_TERMS_ARRAY[arrayIndex++][OUTPUT_ELEMENT_INDEX] + ">");
+ output.newLine();
+ buffLen = buffer.length();
+ } else {
+ buffLen = 0;
+ log("can't find digits may be '=' at end of line ", Project.MSG_ERR);
+ }
+ return buffLen;
+ }
+
+ private int removeAnySpaces() throws UnsupportedEncodingException {
+ byte[] lineBytes;
+ int num = 0;
+ int len = line.length();
+ //convert the line to bytes so we can check for a specific Character
+ lineBytes = line.getBytes("UTF-8");
+ //while there are still spaces at the front of the line shuffle the line along to get rid of them
+ while ((lineBytes[num++] == ' ') && (len > 0)) {
+ line = line.substring(1); //remove 1 space at front of line
+ len--;
+ }
+ return num;
+ }
+}
\ No newline at end of file
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTTool.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTTool.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +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.quality.ant.taskdefs;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.ExecTask;
-import org.apache.tools.ant.taskdefs.condition.Os;
-import org.apache.tools.ant.types.FileSet;
-
-/**
- * CMTTool is the task used to execute the Complexity Measures Tool for C/C++.
- *
- *
- * Usage:
- *
- * <hlm:cmt output="${cmt.output.dir}\logs\${build.id}_${ido.name}_${componentbase}_${cmt.id}.txt>
- * <fileset id="input" dir="${test.data.src}">
- * <include name="**/*.h"/>
- * <include name="**/*.cpp"/>
- * </fileset>
- * </hlm:cmt>
- *
- * output : Name of the file to contain the results of Complexity Measures Tool.
- * fileset: Location of the source files whose complexity is to be measured.
- *
- *
- * @ant.task name="cmt" category="Quality".
- */
-public class CMTTool extends Task {
-
- private FileSet fileSet;
- private String input;
- private String output;
-
- /**
- * Set the fileset.
- *
- * @param fileSet
- * is the fileset which points to the location of source files to
- * be measured.
- * @ant.required
- */
- public void addFileset(FileSet fileSet) {
- this.fileSet = fileSet;
- }
-
- /**
- * Set the name and location of the output file to contain the result of CMT
- * tool.
- *
- * @param output
- * is the name of the result file to be generated.
- * @ant.required
- */
- public void setOutput(String output) {
- this.output = output;
- }
-
- /**
- * Run the CMT task.
- */
- public void execute() {
- if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
- getProject()
- .log("CMT supported only for windows", Project.MSG_WARN);
- return;
- }
- validate();
- input = fileSet.getDir().getPath();
- generateFileList();
- runCmtCommand();
- runCmt2HtmlCommand();
- }
-
- /**
- * Execute the cmt.exe command.
- */
- private void runCmtCommand() {
- try {
- ExecTask task = getExecTask("cmttool", "cmt.exe", new File("."));
- task.createArg().setValue("-f");
- task.createArg().setValue(
- input + System.getProperty("file.separator") + "files.lst");
- task.createArg().setValue("-o");
- task.createArg().setValue(output);
- task.setResultProperty("cmt.status");
- task.setProject(getProject());
- task.execute();
- int status = new Integer(getProject().getProperty("cmt.status"));
- getProject().log("CMT run successfully? " + (status == 0));
- } catch (BuildException ex) {
- // We are Ignoring the errors as no need to fail the build.
- getProject().log(ex.getMessage(), Project.MSG_WARN);
- }
- }
-
- /**
- * Execute the cmt2html.bat command.
- */
- private void runCmt2HtmlCommand() {
- try {
- File outputdir = new File(output.replace(".txt", "_cmt"));
- outputdir.mkdir();
- ExecTask task = getExecTask("cmt2html", "cmt2html.bat", outputdir);
- task.createArg().setValue("-i");
- task.createArg().setValue(output);
- task.createArg().setValue("-nsb");
- task.setResultProperty("cmt2html.status");
- task.setProject(getProject());
- task.execute();
- int status = new Integer(getProject()
- .getProperty("cmt2html.status"));
- getProject().log("CMT2HTML run successfully? " + (status == 0));
- } catch (BuildException ex) {
- // We are Ignoring the errors as no need to fail the build.
- getProject().log(ex.getMessage(), Project.MSG_WARN);
- }
- }
-
- /**
- * Return an execute task with the given inputs.
- *
- * @param taskName
- * is the name of the execute task.
- * @param cmd
- * is the command to be executed by the task.
- * @param outDir
- * is the working directory for the task.
- * @return an instance of execute task.
- */
- private ExecTask getExecTask(String taskName, String cmd, File outDir) {
- ExecTask task = new ExecTask();
- task.setDir(outDir);
- task.setTaskName(taskName);
- task.setExecutable(cmd);
- return task;
- }
-
- /**
- * Method validates the required parameters and elements are set.
- */
- private void validate() {
- if (fileSet == null) {
- raiseError("Nested Element 'fileset' missing for task 'cmt'.");
- }
-
- if (output == null || (output != null && output.isEmpty())) {
- raiseError("Parameter 'output' missing for task 'cmt'.");
- }
-
- }
-
- /**
- * Method is used to throw a BuildException.
- *
- * @param message
- * is the message to be thrown.
- */
- private void raiseError(String message) {
- throw new BuildException(message);
- }
-
- /**
- * Generates a file containing a list of files.
- */
- private void generateFileList() {
- if (fileSet != null) {
- DirectoryScanner ds = fileSet.getDirectoryScanner();
- ds.scan();
- String[] filelist = ds.getIncludedFiles();
- String fileSeparator = System.getProperty("file.separator");
- String lineSeparator = System.getProperty("line.separator");
- File fileList = new File(input + fileSeparator + "files.lst");
- BufferedWriter outputFile = null;
- try {
- outputFile = new BufferedWriter(new FileWriter(fileList));
- for (String file : filelist) {
- outputFile.write(input + fileSeparator + file
- + lineSeparator);
- }
- } catch (IOException e) {
- // We are Ignoring the errors as no need to fail the build.
- getProject().log(e.getMessage(), Project.MSG_WARN);
- } finally {
- try {
- if (outputFile != null)
- outputFile.close();
- } catch (IOException ex) {
- // ignore exception
- ex = null;
- }
- }
- }
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTToolTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CMTToolTask.java Wed Jun 16 16:51:40 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:
+ *
+ */
+
+package com.nokia.helium.quality.ant.taskdefs;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.ExecTask;
+import org.apache.tools.ant.taskdefs.condition.Os;
+import org.apache.tools.ant.types.FileSet;
+
+/**
+ * CMTTool is the task used to execute the Complexity Measures Tool for C/C++.
+ *
+ *
+ * Usage:
+ *
+ * <hlm:cmt output="${cmt.output.dir}\logs\${build.id}_${ido.name}_${componentbase}_${cmt.id}.txt>
+ * <fileset id="input" dir="${test.data.src}">
+ * <include name="**/*.h"/>
+ * <include name="**/*.cpp"/>
+ * </fileset>
+ * </hlm:cmt>
+ *
+ * output : Name of the file to contain the results of Complexity Measures Tool.
+ * fileset: Location of the source files whose complexity is to be measured.
+ *
+ *
+ * @ant.task name="cmt" category="Quality".
+ */
+public class CMTToolTask extends Task {
+
+ private List cmtFileSetList = new ArrayList();
+ private File input;
+ private File output;
+ private File htmlOutputDir;
+ private boolean failOnError = true;
+
+ /**
+ * Set the fileset.
+ *
+ * @param fileSet
+ * is the fileset which points to the location of source files to
+ * be measured.
+ * @ant.required
+ */
+ public void addFileset(FileSet fileSet) {
+ cmtFileSetList.add(fileSet);
+ }
+
+ /**
+ * Set the name and location of the output file to contain the result of CMT
+ * tool.
+ *
+ * @param output
+ * is the name of the result file to be generated.
+ * @ant.required
+ */
+ public void setOutput(File output) {
+ this.output = output;
+ }
+
+ /**
+ * @param failOnError the failOnError to set
+ */
+ public void setFailOnError(boolean failOnError) {
+ this.failOnError = failOnError;
+ }
+
+ /**
+ * @param htmlOutputDir the htmlOutputDir to set
+ */
+ public void setHtmlOutputDir(File htmlOutputDir) {
+ this.htmlOutputDir = htmlOutputDir;
+ }
+
+ /**
+ * Run the CMT task.
+ */
+ public void execute() {
+ if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
+ throw new BuildException("CMT supported only on windows platforms.");
+ }
+ validate();
+ try {
+ input = File.createTempFile("Files", ".list");
+ generateFileList();
+ runCmtCommand();
+ if (this.htmlOutputDir != null) {
+ runCmt2HtmlCommand();
+ }
+ } catch (IOException ioe) {
+ throw new BuildException("Not able to generate file list for 'cmt'. ", ioe);
+ } catch (BuildException be) {
+ if (failOnError) {
+ throw new BuildException("Exception occured while running 'cmt' tool. ", be);
+ }
+ log("Exception occured while running 'cmt' tool. ", Project.MSG_ERR);
+ } finally {
+ if (input != null) {
+ input.delete();
+ }
+ }
+ }
+
+ /**
+ * Execute the cmt.exe command.
+ */
+ private void runCmtCommand() {
+ String command = null;
+ if (!this.output.getParentFile().exists()) {
+ this.output.getParentFile().mkdirs();
+ }
+ ExecTask task = getExecTask("cmttool", "cmt", new File("."));
+ command = "cmt";
+ task.createArg().setValue("-f");
+ command += " " + "-f";
+ task.createArg().setValue(input.toString());
+ command += " " + input.toString();
+ task.createArg().setValue("-o");
+ command += " " + "-o";
+ task.createArg().setValue(output.toString());
+ command += " " + output;
+ task.setProject(getProject());
+ log("run command: " + command);
+ task.execute();
+ }
+
+ /**
+ * Execute the cmt2html.bat command.
+ */
+ private void runCmt2HtmlCommand() {
+ String command = null;
+ if (!this.htmlOutputDir.exists()) {
+ this.htmlOutputDir.mkdirs();
+ }
+ ExecTask task = getExecTask("cmt2html", "cmt2html.bat", this.htmlOutputDir);
+ command = "cmt2html.bat";
+ task.createArg().setValue("-i");
+ command += " " + "-i";
+ task.createArg().setValue(output.toString());
+ command += " " + output;
+ task.createArg().setValue("-nsb");
+ command += " " + "-nsb";
+ task.setProject(getProject());
+ log("run command: " + command);
+ task.execute();
+ }
+
+ /**
+ * Return an execute task with the given inputs.
+ *
+ * @param taskName
+ * is the name of the execute task.
+ * @param cmd
+ * is the command to be executed by the task.
+ * @param outDir
+ * is the working directory for the task.
+ * @return an instance of execute task.
+ */
+ private ExecTask getExecTask(String taskName, String cmd, File outDir) {
+ ExecTask task = new ExecTask();
+ task.setDir(outDir);
+ task.setTaskName(this.getTaskName());
+ task.setExecutable(cmd);
+ return task;
+ }
+
+ /**
+ * Method validates the required parameters and elements are set.
+ */
+ private void validate() {
+ if (cmtFileSetList.size() == 0) {
+ throw new BuildException("Nested Element 'fileset' missing for task 'cmt'.");
+ }
+ if (output == null) {
+ throw new BuildException("Parameter 'output' missing for task 'cmt'.");
+ }
+ }
+
+ /**
+ * Generates a file containing a list of files.
+ */
+ private void generateFileList() {
+
+ for (FileSet fileSet : cmtFileSetList) {
+ DirectoryScanner dirScanner = fileSet.getDirectoryScanner();
+ dirScanner.scan();
+ String[] filelist = dirScanner.getIncludedFiles();
+ String lineSeparator = System.getProperty("line.separator");
+ BufferedWriter outputFile = null;
+ try {
+ outputFile = new BufferedWriter(new FileWriter(input));
+ for (String file : filelist) {
+ outputFile.write(dirScanner.getBasedir().toString() + file
+ + lineSeparator);
+ }
+ } catch (IOException e) {
+ throw new BuildException("Not able to generate file list for 'cmt'. ", e);
+ } finally {
+ try {
+ if (outputFile != null)
+ outputFile.close();
+ } catch (IOException ex) {
+ // ignore exception
+ ex = null;
+ }
+ }
+ }
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CodeScanner.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CodeScanner.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +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.quality.ant.taskdefs;
-
-import java.io.*;
-import java.util.Vector;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.taskdefs.ExecTask;
-
-/**
- * This task executes codescanner - and writes the results to the output directory.
- * Codescanner parses C++ code and flags any inconsistencies or errors in output files.
- * Configuration files are used to determine what passes and fails the checking e.g. maximum length of lines,
- * whether 'C' type comments are allowed as well as C++ comments, does it adhere to the company coding
- * guidelines and much more. Every person writing any C++ code
- * should run codescanner on their code to ensure it follows the coding guidelines. The output logs
- * should have no errors and preferably no warnings before the code should be checked into SCM, e.g. synergy or SVN.
- *
- * Below is an example of how to use the target to run codescanner.
- *
- *
- * <property name="codescanner.output.dir" location="./cs" />
- * <property name="codescanner.output.type" value="html" />
- * <property name="codescanner.config" location="./codescanner_config.xml" />
- *
- * <hlm:codescanner dest="${codescanner.output.dir}"
- * format="${codescanner.output.type}"
- * failonerror="true"
- * configuration="${codescanner.config}">
- * <path refid="src.path"/>
- * </hlm:codescanner>
- * <au:assertLogContains text="Successfully executed codescanner"/>
- * <au:assertLogContains text="Output format: xml,html"/>
- * <au:assertFileExists file="${codescanner.output.dir}/problemIndex.xml"/>
- *
- *
- * @ant.task name="codescanner" category="Quality"
- */
-public class CodeScanner extends Task {
- private Vector paths = new Vector();
- private File configuration;
- private String dest;
- private String format = "xml,html";
- private boolean auto;
- private File log;
- private boolean failonerror;
-
- /**
- * This defines if the task should fails in case of error while
- * executing codescanner.
- *
- * @param failonerror
- * @ant.not-required Default is false for backward compatibility.
- */
- public void setFailonerror(boolean failonerror) {
- this.failonerror = failonerror;
- }
-
- /**
- * Add path datatype to the task.
- *
- * @param path
- */
- public void add(Path path) {
- paths.add(path);
- }
-
- /**
- * Get dest attribute.
- *
- */
- public String getDest() {
- return this.dest;
- }
-
- /**
- * Set dest attribute.
- *
- * @param dest
- * @ant.required
- */
- public void setDest(String dest) {
- this.dest = dest;
- }
-
- /**
- * Get format attribute.
- *
- */
- public String getFormat() {
- return this.format;
- }
-
- /**
- * Set format attribute.
- *
- * @param format
- * @ant.not-required Default is xml,html
- */
- public void setFormat(String format) {
- this.format = format;
- }
-
- /**
- * Get configuration attribute.
- *
- */
- public File getConfiguration() {
- return this.configuration;
- }
-
- /**
- * Set configuration attribute.
- *
- * @param configuration
- * @ant.required
- */
- public void setConfiguration(File configuration) {
- this.configuration = configuration;
- }
-
- /**
- * Set auto attribute.
- *
- * @param auto
- * @ant.not-required Default is false.
- */
- public void setAuto(boolean auto) {
- this.auto = auto;
- }
-
- /**
- * Set log attribute.
- *
- * @param log
- * @ant.not-required
- */
- public void setLog(File log) {
- this.log = log;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void execute() {
- // creating the exec subtask
- String osType = System.getProperty("os.name");
- if (!osType.toLowerCase().startsWith("win")) {
- this.log("CODESCANNER: run in windows only");
- return;
- }
- ExecTask task = new ExecTask();
- task.setProject(getProject());
- task.setTaskName(this.getTaskName());
- task.setFailonerror(failonerror);
- task.setExecutable("codescanner");
- task.setDir(new File("."));
- if (dest == null) {
- throw new BuildException("'dest' attribute must be defined");
- }
- if (configuration != null) {
- if (!configuration.exists()) {
- throw new BuildException("Could not find the file "
- + configuration);
- } else {
- task.createArg().setValue("-c");
- task.createArg().setValue(configuration.getAbsolutePath());
- }
- } else {
- throw new BuildException(
- "'configuration' attribute must be defined");
- }
- if (!format.contains("xml")) {
- setFormat("xml," + format);
- }
- this.log("Output format: " + format);
- // -t off
- task.createArg().setValue("-t");
- task.createArg().setValue(auto ? "on" : "off");
-
- // -l log
- if (log != null) {
- this.log("Output log: " + log.getAbsolutePath());
- task.createArg().setValue("-l");
- task.createArg().setValue(log.getAbsolutePath());
- }
-
- // -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();
- }
- 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));
- } else {
- task.createArg().setValue(srcs.elementAt(i));
- task.createArg().setValue(dest.toString());
- }
- }
- // output path
- this.log("Output dir " + dest);
-
- // Run codescanner
- task.execute();
- this.log("Successfully executed codescanner");
- }
-}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CodeScannerTask.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/CodeScannerTask.java Wed Jun 16 16:51:40 2010 +0300
@@ -0,0 +1,239 @@
+/*
+ * 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.quality.ant.taskdefs;
+
+import java.io.*;
+import java.util.Vector;
+
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.taskdefs.ExecTask;
+
+/**
+ * This task executes codescanner - and writes the results to the output directory.
+ * Codescanner parses C++ code and flags any inconsistencies or errors in output files.
+ * Configuration files are used to determine what passes and fails the checking e.g. maximum length of lines,
+ * whether 'C' type comments are allowed as well as C++ comments, does it adhere to the company coding
+ * guidelines and much more. Every person writing any C++ code
+ * should run codescanner on their code to ensure it follows the coding guidelines. The output logs
+ * should have no errors and preferably no warnings before the code should be checked into SCM, e.g. synergy or SVN.
+ *
+ * Below is an example of how to use the target to run codescanner.
+ *
+ *
+ * <property name="codescanner.output.dir" location="./cs" />
+ * <property name="codescanner.output.type" value="html" />
+ * <property name="codescanner.config" location="./codescanner_config.xml" />
+ *
+ * <hlm:codescanner dest="${codescanner.output.dir}"
+ * format="${codescanner.output.type}"
+ * failonerror="true"
+ * configuration="${codescanner.config}">
+ * <path refid="src.path"/>
+ * </hlm:codescanner>
+ * <au:assertLogContains text="Successfully executed codescanner"/>
+ * <au:assertLogContains text="Output format: xml,html"/>
+ * <au:assertFileExists file="${codescanner.output.dir}/problemIndex.xml"/>
+ *
+ *
+ * @ant.task name="codescanner" category="Quality"
+ */
+public class CodeScannerTask extends Task {
+ private Vector paths = new Vector();
+ private File configuration;
+ private String dest;
+ private String format = "xml,html";
+ private boolean auto;
+ private File log;
+ private boolean failonerror;
+
+ /**
+ * This defines if the task should fails in case of error while
+ * executing codescanner.
+ *
+ * @param failonerror
+ * @ant.not-required Default is false for backward compatibility.
+ */
+ public void setFailonerror(boolean failonerror) {
+ this.failonerror = failonerror;
+ }
+
+ /**
+ * Add path datatype to the task.
+ *
+ * @param path
+ */
+ public void add(Path path) {
+ paths.add(path);
+ }
+
+ /**
+ * Get dest attribute.
+ *
+ */
+ public String getDest() {
+ return this.dest;
+ }
+
+ /**
+ * Set dest attribute.
+ *
+ * @param dest
+ * @ant.required
+ */
+ public void setDest(String dest) {
+ this.dest = dest;
+ }
+
+ /**
+ * Get format attribute.
+ *
+ */
+ public String getFormat() {
+ return this.format;
+ }
+
+ /**
+ * Set format attribute.
+ *
+ * @param format
+ * @ant.not-required Default is xml,html
+ */
+ public void setFormat(String format) {
+ this.format = format;
+ }
+
+ /**
+ * Get configuration attribute.
+ *
+ */
+ public File getConfiguration() {
+ return this.configuration;
+ }
+
+ /**
+ * Set configuration attribute.
+ *
+ * @param configuration
+ * @ant.required
+ */
+ public void setConfiguration(File configuration) {
+ this.configuration = configuration;
+ }
+
+ /**
+ * Set auto attribute.
+ *
+ * @param auto
+ * @ant.not-required Default is false.
+ */
+ public void setAuto(boolean auto) {
+ this.auto = auto;
+ }
+
+ /**
+ * Set log attribute.
+ *
+ * @param log
+ * @ant.not-required
+ */
+ public void setLog(File log) {
+ this.log = log;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void execute() {
+ // creating the exec subtask
+ String osType = System.getProperty("os.name");
+ if (!osType.toLowerCase().startsWith("win")) {
+ this.log("CODESCANNER: run in windows only");
+ return;
+ }
+ ExecTask task = new ExecTask();
+ task.setProject(getProject());
+ task.setTaskName(this.getTaskName());
+ task.setFailonerror(failonerror);
+ task.setExecutable("codescanner");
+ task.setDir(new File("."));
+ if (dest == null) {
+ throw new BuildException("'dest' attribute must be defined");
+ }
+ if (configuration != null) {
+ if (!configuration.exists()) {
+ throw new BuildException("Could not find the file "
+ + configuration);
+ } else {
+ task.createArg().setValue("-c");
+ task.createArg().setValue(configuration.getAbsolutePath());
+ }
+ } else {
+ throw new BuildException(
+ "'configuration' attribute must be defined");
+ }
+ if (!format.contains("xml")) {
+ setFormat("xml," + format);
+ }
+ this.log("Output format: " + format);
+ // -t off
+ task.createArg().setValue("-t");
+ task.createArg().setValue(auto ? "on" : "off");
+
+ // -l log
+ if (log != null) {
+ this.log("Output log: " + log.getAbsolutePath());
+ task.createArg().setValue("-l");
+ task.createArg().setValue(log.getAbsolutePath());
+ }
+
+ // -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();
+ }
+ 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));
+ } else {
+ task.createArg().setValue(srcs.elementAt(i));
+ task.createArg().setValue(dest.toString());
+ }
+ }
+ // output path
+ this.log("Output dir " + dest);
+
+ // Run codescanner
+ task.execute();
+ this.log("Successfully executed codescanner");
+ }
+}
diff -r 85df38eb4012 -r c7c26511138f buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/Coverity.java
--- a/buildframework/helium/sf/java/quality/src/com/nokia/helium/quality/ant/taskdefs/Coverity.java Tue Apr 27 08:33:08 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,198 +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.quality.ant.taskdefs;
-
-import java.io.File;
-import java.util.Vector;
-import java.util.Map.Entry;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.ExecTask;
-
-import com.nokia.helium.core.ant.types.Variable;
-import com.nokia.helium.core.ant.types.VariableSet;
-
-/**
- * To run the coverity commands.
- *
- *
- *
- * <hlm:coverity command="cov-link" dir="${build.drive}/">
- <hlm:arg name="--dir" value="${coverity.output.dir}/intermidiate"/>
- <hlm:arg name="--compile-arg" value="armv5"/>
- <hlm:arg name="--output" value="${coverity.output.dir}/coveritylink/armv5.link"/>
- <hlm:arg name="${coverity.output.dir}/coveritylink/all.link" value=""/>
- </hlm:coverity >
- *
- *
- *
- * @ant.task name="coverity" category="Quality".
- *
- */
-
-
-public class Coverity extends Task {
-
- private String command;
- private boolean failOnError;
- private boolean execute = true;
- private String dir;
- private Vector coverityOptions = new Vector();
- private Vector coverityArgs = new Vector