You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sg...@apache.org on 2014/11/05 23:38:50 UTC

[2/8] git commit: master.cfg: platform test steps via base class and overrides

master.cfg: platform test steps via base class and overrides


Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/d5dc8114
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/d5dc8114
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/d5dc8114

Branch: refs/heads/master
Commit: d5dc8114e13031e1f913083737360afe26e191e7
Parents: eb41b06
Author: sgrebnov <v-...@microsoft.com>
Authored: Tue Aug 5 17:59:22 2014 +0400
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Wed Oct 1 12:07:49 2014 +0400

----------------------------------------------------------------------
 master.cfg | 621 ++++++++++++++++++++++++++++++--------------------------
 1 file changed, 337 insertions(+), 284 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/d5dc8114/master.cfg
----------------------------------------------------------------------
diff --git a/master.cfg b/master.cfg
index 5ac3f94..3862406 100644
--- a/master.cfg
+++ b/master.cfg
@@ -1,3 +1,4 @@
+#!/usr/bin/python
 # -*- python -*-
 # ex: set syntax=python:
 
@@ -18,51 +19,52 @@ c = BuildmasterConfig = {}
 # Detect system we are running
 import platform
 log.msg("Platform is %s" % (platform.system(),))
-is_Windows=platform.system() == "Windows"
 
 # the 'change_source' setting tells the buildmaster how it should find out
 # about source code changes.
 from buildbot.changes.gitpoller import GitPoller
 c['change_source'] = []
 
-import logging
 import json
 with open("../config.json") as f:
-    json_config=json.load(f)
+    json_config = json.load(f)
 
 with open("../repos.json") as f:
-    json_repos=json.load(f)
-
-platform_list=json_config['app']['platforms']
-branch_release =str(json_config['app']['release'])
-
-build_android=('android' in platform_list)
-build_chrome=('chrome' in platform_list)
-build_ios=('ios' in platform_list)
-build_wp8=('wp8' in platform_list)
-build_windows8=('windows8' in platform_list)
-build_blackberry=('blackberry' in platform_list)
-if (build_wp8 or build_windows8) and not is_Windows :
-    log.err("wp8 and windows8 builds are supported on Windows platform only")
-projectbranches=['master',branch_release]
-polltime=300
-stabletime=30
-mail_to=[]
-for mt in json_config['mail']['to'] :
-   mail_to.append(str(mt))
-
-mail_from=str(json_config['mail']['from'])
-mail_pw=str(json_config['mail']['password'])
-mail_serverURL=str(json_config['mail']['serverURL'])
-
-def getBranches(tags) :
-  result=[];
-  for b in tags :
-    if(b == 'RELEASE') :
-       result.append(branch_release)
-    else :
-       result.append(str(b))
-  return result
+    json_repos = json.load(f)
+
+platform_list = json_config['app']['platforms']
+branch_release = str(json_config['app']['release'])
+build_timeout = json_config['app']['timeout']
+
+build_android = ('android' in platform_list)
+build_chrome = ('chrome' in platform_list)
+build_ios = ('ios' in platform_list)
+build_wp8 = ('wp8' in platform_list)
+build_windows8 = ('windows8' in platform_list)
+build_blackberry = ('blackberry' in platform_list)
+projectbranches = ['master', branch_release]
+polltime = 300
+stabletime = 30
+# GitPoller on Windows fails if gitbin location is not provided.
+# Set git location if running medic master on Windows
+git_bin = ""  #"c:\Program Files (x86)\Git\cmd\git.exe"
+mail_to = []
+for mt in json_config['mail']['to']:
+    mail_to.append(str(mt))
+
+mail_from = str(json_config['mail']['from'])
+mail_pw = str(json_config['mail']['password'])
+mail_serverURL = str(json_config['mail']['serverURL'])
+
+
+def getBranches(tags):
+    result = []
+    for b in tags:
+        if(b == 'RELEASE'):
+            result.append(branch_release)
+        else:
+            result.append(str(b))
+    return result
 
 
 ####### BUILDSLAVES
@@ -73,11 +75,12 @@ from buildbot.buildslave import BuildSlave
 from buildbot.changes import pb
 
 c['slaves'] = [
-    BuildSlave("ios-slave", "pass",max_builds=1),
-    BuildSlave("android-slave", "pass",max_builds=1),
-    BuildSlave("windows-slave", "pass",max_builds=2),
-    BuildSlave("blackberry-slave", "pass",max_builds=1),
-    BuildSlave("common-slave","pass",max_builds=3)
+    BuildSlave("ios-slave", "pass", max_builds=1),
+    BuildSlave("android-slave", "pass", max_builds=1),
+    BuildSlave("windows-slave", "pass", max_builds=2),
+    BuildSlave("win8-slave", "pass", max_builds=2),
+    BuildSlave("blackberry-slave", "pass", max_builds=1),
+    BuildSlave("common-slave", "pass", max_builds=3)
 ]
 
 # 'slavePortnum' defines the TCP port to listen on for connections from slaves.
@@ -85,41 +88,43 @@ c['slaves'] = [
 # --master option)
 c['slavePortnum'] = 9889
 
-repos={}
-branches={}
+repos = {}
+branches = {}
 
-for jrepo in json_repos['repos'] :
-  cat = str(jrepo['category'])
-  title = str(jrepo["title"])
-  repo_url=str(jrepo['repo'])
-  if cat == "PLUGIN" :
-    c['change_source'].append(GitPoller(repo_url, project=cat,category=cat, branches=getBranches([jrepo['release'],jrepo['current']]), pollinterval=polltime))
 
-  elif not (cat == "PLATFORM") :
-    repos[title] = repo_url
-    branches[title] = str(jrepo['current'])
-    c['change_source'].append(GitPoller(repo_url, project=cat,category=cat, branches=getBranches([jrepo['release'],jrepo['current']]), pollinterval=polltime))
+# periodically fetches from a remote git repository and processes any changes
+def listen_for_source_change(repo_url, project, category, branches):
+    if (git_bin == ""):
+        c['change_source'].append(
+            GitPoller(repo_url, project=project, category=category, branches=branches, pollinterval=polltime))
+    else:
+        c['change_source'].append(
+            GitPoller(repo_url, gitbin=git_bin, project=project, category=category, branches=branches, pollinterval=polltime))
 
-  else :
-    repos[title] = repo_url
-    branches[title] = str(jrepo['current'])
-    if(build_android and title=="ANDROID") :
-       c['change_source'].append(GitPoller(repo_url,project=title,category='PLATFORM', branches=getBranches([jrepo['release'],jrepo['current']]), pollinterval=polltime))
+for jrepo in json_repos['repos']:
+    cat = str(jrepo['category'])
+    title = str(jrepo["title"])
+    repo_url = str(jrepo['repo'])
+    if cat == "PLUGIN":
+        listen_for_source_change(repo_url, cat, cat, getBranches([jrepo['release'], jrepo['current']]))
 
-    if(build_ios and title=="IOS") :
-       c['change_source'].append(GitPoller(repo_url,project=title,category='PLATFORM', branches=getBranches([jrepo['release'],jrepo['current']]), pollinterval=polltime))
+    elif not (cat == "PLATFORM"):
+        repos[title] = repo_url
+        branches[title] = str(jrepo['current'])
+        listen_for_source_change(repo_url, cat, cat, getBranches([jrepo['release'], jrepo['current']]))
 
-    if(build_wp8 and title=="WP8") :
-       c['change_source'].append(GitPoller(repo_url,project=title,category='PLATFORM', branches=getBranches([jrepo['release'],jrepo['current']]), pollinterval=polltime))
+    else:
+        repos[title] = repo_url
+        branches[title] = str(jrepo['current'])
+        if (build_android and title == "ANDROID"
+            or build_ios and title == "IOS"
+            or build_wp8 and title == "WP8"
+            or build_windows8 and title == "WINDOWS8"
+            or build_blackberry and title == "BLACKBERRY"):
 
-    if(build_windows8 and title=="WINDOWS8") :
-       c['change_source'].append(GitPoller(repo_url,project=title,category='PLATFORM', branches=getBranches([jrepo['release'],jrepo['current']]), pollinterval=polltime))
+            listen_for_source_change(repo_url, title, 'PLATFORM', getBranches([jrepo['release'], jrepo['current']]))
 
-    if(build_blackberry and title=="BLACKBERRY") :
-       c['change_source'].append(GitPoller(repo_url,project=title,category='PLATFORM', branches=getBranches([jrepo['release'],jrepo['current']]), pollinterval=polltime))
-
-
-c['change_source'].append(pb.PBChangeSource(port=9999,user='Cordova',passwd='Cordova'))
+c['change_source'].append(pb.PBChangeSource(port=9999, user='Cordova', passwd='Cordova'))
 
 
 ####### SCHEDULERS
@@ -130,22 +135,26 @@ from buildbot.schedulers.basic import SingleBranchScheduler
 from buildbot.schedulers.forcesched import ForceScheduler
 from buildbot.changes import filter
 
-force_builders=[]
-
+builders = []
+force_builders = []
 c['schedulers'] = []
 
-for test in json_repos['tests'] :
-  if test["platform"] in platform_list :
-    c['schedulers'].append(SingleBranchScheduler(
-                            name=str(test["title"]),
-                            change_filter=filter.ChangeFilter(branch=test["branch"],project=test["categories"]),
-                            treeStableTimer=stabletime,
-                            builderNames=[str(test["builder"])]))
-    force_builders.append(str(test["builder"]))
+for test in json_repos['tests']:
+    if test["platform"] in platform_list:
+        if type(test["builder"]) == list:
+            builders = [str(b) for b in test["builder"]]
+        else:
+            builders = [str(test["builder"])]
+
+        force_builders.extend(builders)
 
-c['schedulers'].append(ForceScheduler(
-                            name="force",
-                            builderNames=force_builders))
+        c['schedulers'].append(SingleBranchScheduler(
+                               name=str(test["title"]),
+                               change_filter=filter.ChangeFilter(branch=test["branch"], project=test["categories"]),
+                               treeStableTimer=stabletime,
+                               builderNames=builders))
+
+c['schedulers'].append(ForceScheduler(name="force", builderNames=force_builders))
 
 
 ####### BUILDERS
@@ -155,212 +164,262 @@ c['schedulers'].append(ForceScheduler(
 # only take place on one slave.
 
 from buildbot.process.factory import BuildFactory
-from buildbot.steps.source.git import Git
 from buildbot.steps.shell import ShellCommand
+from buildbot.steps.transfer import FileDownload
 from buildbot.config import BuilderConfig
 
 cli_steps = [
-    ShellCommand(command=["rm","-rf","cordova-*"],workdir='build',haltOnFailure=False,description='Cordova Clean', descriptionDone='Cordova Clean'),
-    ShellCommand(command=["git","clone",repos['CLI'],"cordova-cli"],workdir='build',haltOnFailure=True,description='Get CLI',descriptionDone='Get CLI'),
-    ShellCommand(command=["mkdir","node_modules"],workdir='build/cordova-cli',haltOnFailure=True,description='prepare cordova-lib',descriptionDone='Prepare cordova-lib'),
-    ShellCommand(command=["git","clone -b",branches['CORDOVA-LIB'],repos['CORDOVA-LIB'],"cordova-lib"],workdir='build',haltOnFailure=True,description='Update Cordova-lib',descriptionDone='Update Cordova-lib'),
-    ShellCommand(command=["node", "-e", "require('fs').symlinkSync('../../cordova-lib/cordova-lib', 'cordova-lib', 'dir')"], workdir='build/cordova-cli/node_modules',haltOnFailure=False,description='Cordova-lib link', descriptionDone='Cordova-lib link'),
-    ShellCommand(command=["npm","install","--production"], workdir='build/cordova-cli/node_modules/cordova-lib',haltOnFailure=True,description='Install Cordova-lib',descriptionDone='Install Cordova-lib'),
-    ShellCommand(command=["rm","-f", "npm-shrinkwrap.json"],workdir='build/cordova-cli',haltOnFailure=False,description='Remove CLI SW',descriptionDone='Remove CLI SW'),
-    ShellCommand(command=["npm","install"],workdir='build/cordova-cli',haltOnFailure=True,description='Install CLI',descriptionDone='Install CLI'),
-    ShellCommand(command=["npm","test"], workdir='build/cordova-cli',haltOnFailure=True,description='Test CLI',descriptionDone='Test CLI'),
+    ShellCommand(command=["git", "clone", "-b", branches['CLI'], repos['CLI'], "cordova-cli"], workdir='build', haltOnFailure=True, description='Get CLI'),
+    ShellCommand(command=["mkdir", "node_modules"], workdir='build/cordova-cli', haltOnFailure=True, description='Prepare cordova-lib'),
+    ShellCommand(command=["git", "clone", "-b", branches['CORDOVA-LIB'], repos['CORDOVA-LIB'], "cordova-lib"], workdir='build', haltOnFailure=True, description='Update cordova-lib'),
+    ShellCommand(command=["node", "-e", "require('fs').symlinkSync('../../cordova-lib/cordova-lib', 'cordova-lib', 'dir')"], workdir='build/cordova-cli/node_modules', haltOnFailure=False, description='Link cordova-lib'),
+    ShellCommand(command=["npm", "install", "--production"], workdir='build/cordova-cli/node_modules/cordova-lib', haltOnFailure=True, description='Install cordova-lib'),
+    ShellCommand(command=["rm", "-f", "npm-shrinkwrap.json"], workdir='build/cordova-cli', haltOnFailure=False, description='Remove CLI SW'),
+    ShellCommand(command=["npm", "install"], workdir='build/cordova-cli', haltOnFailure=True, description='Install CLI'),
+    ShellCommand(command=["npm", "test"], workdir='build/cordova-cli', haltOnFailure=True, description='Test CLI'),
 ]
 
 plugman_steps = [
-    ShellCommand(command=["rm","-rf","cordova-*"],workdir='build',haltOnFailure=False,description='Cordova Clean', descriptionDone='Cordova Clean'),
-    ShellCommand(command=["git","clone",repos['PLUGMAN'],"cordova-plugman"],workdir='build',haltOnFailure=True,description='Get Plugman',descriptionDone='Get Plugman'),
-    ShellCommand(command=["npm","install"], workdir='build/cordova-plugman',haltOnFailure=True,description='Install Plugman',descriptionDone='Install Plugman'),
-    ShellCommand(command=["npm","test"], workdir='build/cordova-plugman',haltOnFailure=True,description='Test Plugman',descriptionDone='Test Plugman'),
+    ShellCommand(command=["rm", "-rf", "cordova-*"], workdir='build', haltOnFailure=False, description='Cordova Clean'),
+    ShellCommand(command=["git", "clone", repos['PLUGMAN'], "cordova-plugman"], workdir='build', haltOnFailure=True, description='Get Plugman'),
+    ShellCommand(command=["npm", "install"], workdir='build/cordova-plugman', haltOnFailure=True, description='Install Plugman'),
+    ShellCommand(command=["npm", "test"], workdir='build/cordova-plugman', haltOnFailure=True, description='Test Plugman'),
 ]
 
-# The steps that are required for any platform just to get tools and source in place
-common_steps_1 = [
-    ShellCommand(command=["rm","-rf","medic"],workdir='build',haltOnFailure=False,description='Medic Clean',descriptionDone='Medic Clean'),
-    ShellCommand(command=["rm","-rf","cordova-coho"],workdir='build',haltOnFailure=False,description='COHO Clean', descriptionDone='COHO Clean'),
-    ShellCommand(command=["rm","-rf","mobilespec"],workdir='build',haltOnFailure=False,description='Mobilespec Clean',descriptionDone='Mobilespec Clean'),
-    ShellCommand(command=["rm","-rf","cordova-lib"],workdir='build',haltOnFailure=False,description='Cordova-lib Clean',descriptionDone='Cordova-lib Clean'),
-    ShellCommand(command=["rm","-rf","cordova-cli/node_modules"],workdir='build',haltOnFailure=False,description='CLI node_modules Clean',descriptionDone='CLI node_modules Clean'),
-    ShellCommand(command=["git","clone","-b",branches['TESTMASTER'],repos['TESTMASTER'],"medic"],workdir='build',haltOnFailure=True, description='Get Medic', descriptionDone='Get Medic'),
-    # --production switch is used to speed up installation + fruitstrap dev dependency is not supported on Windows
-    ShellCommand(command=["npm","install","--production"], workdir='build/medic',haltOnFailure=True,description='Install Medic',descriptionDone='Install Medic'),
-    ShellCommand(command=["cp","../../../../config.json","./config.json"], workdir='build/medic',haltOnFailure=True,description='Copy Config',descriptionDone='Copy Config'),
-    ShellCommand(command=["git","clone",repos['COHO']],workdir='build',haltOnFailure=True,description='Get COHO',descriptionDone='Get COHO'),
-    ShellCommand(command=["npm","install", "--production"],workdir='build/cordova-coho',haltOnFailure=True,description='Install COHO', descriptionDone='Install COHO'),
-]
+c['builders'] = []
 
-# The steps for any platform before platform add
-common_steps_mobilespec_1 = [
-    ShellCommand(command=["mkdir","node_modules"],workdir='build/cordova-cli',haltOnFailure=True,description='prepare cordova-lib',descriptionDone='Prepare cordova-lib'),
-    ShellCommand(command=["git","clone","-b",branches['CORDOVA-LIB'],repos['CORDOVA-LIB'],"cordova-lib"],workdir='build',haltOnFailure=True,description='Update Cordova-lib',descriptionDone='Update Cordova-lib'),
-    ShellCommand(command=["node", "-e", "require('fs').symlinkSync('../../cordova-lib/cordova-lib', 'cordova-lib', 'dir')"], workdir='build/cordova-cli/node_modules',haltOnFailure=False,description='Cordova-lib link', descriptionDone='Cordova-lib link'),
-    ShellCommand(command=["npm","install","--production"], workdir='build/cordova-cli/node_modules/cordova-lib',haltOnFailure=True,description='Install Cordova-lib',descriptionDone='Install Cordova-lib'),
-    ShellCommand(command=["rm","-f", "npm-shrinkwrap.json"],workdir='build/cordova-cli',haltOnFailure=False,description='Remove CLI SW',descriptionDone='Remove CLI SW'),
-    ShellCommand(command=["sed","-e","s/cordova-lib\": \"0./cordova-lib\": \">=0./","-ibak","package.json"],workdir='build/cordova-cli',haltOnFailure=True,description='Edit json',descriptionDone='Edit json'),
-    ShellCommand(command=["npm","install","--production"],workdir='build/cordova-cli',haltOnFailure=True,description='Install CLI',descriptionDone='Install CLI'),
-    ShellCommand(command=["node", "cordova-cli/bin/cordova","create","mobilespec","org.apache.mobilespec","mobilespec"],workdir='build',haltOnFailure=True, description='CLI Create', descriptionDone='CLI Create')
-]
 
-# The steps for any platform after platform add
-common_steps_mobilespec_2 = [
-    ShellCommand(command=["node", "../cordova-cli/bin/cordova","plugin","add","../cordova-mobile-spec/dependencies-plugin","--searchpath",".." ],workdir='build/mobilespec',haltOnFailure=True,description='Plugin add',descriptionDone='Plugin add'),
-    ShellCommand(command=["node", "../cordova-cli/bin/cordova", "plugin", "add", "../medic/cordova-plugin-medic"],workdir='build/mobilespec',haltOnFailure=True,description='Medic plugin add',descriptionDone='Medic plugin add'),
-    ShellCommand(command=["rm","-rf","mobilespec/www"],workdir='build',haltOnFailure=False,description='Remove www',descriptionDone='Remove www'),
-    ShellCommand(command=["node", "-e", "require('fs').symlinkSync('../cordova-mobile-spec/www','www','dir')"], workdir='build/mobilespec',haltOnFailure=True,description='Link www', descriptionDone='Link www'),
-    ShellCommand(command=["node", "../cordova-cli/bin/cordova","prepare"],workdir='build/mobilespec',haltOnFailure=True,description='CLI Prepare',descriptionDone='CLI Prepare')
-]
+class PlatformTestBase(object):
+    def __init__(self, platform):
+        self.platform = platform
+
+    def init_workspace_steps(self):
+        return [
+            ShellCommand(command=["rm", "-rf", "~/.cordova/" + self.platform], workdir='build', haltOnFailure=False, description='Remove cache'),
+            ShellCommand(command=["node", "-e", "require('child_process').exec('rm -rf medic mobilespec/www mobilespec cordova-*')"], workdir='build', haltOnFailure=False, description='Clean workdir'),
+            ShellCommand(command=["git", "clone", "-b", branches['TESTMASTER'], repos['TESTMASTER'], "medic"], workdir='build', haltOnFailure=True, description='Get Medic'),
+            # --production switch is used to speed up installation + fruitstrap dev dependency is not supported on Windows
+            ShellCommand(command=["npm", "install", "--production"], workdir='build/medic', haltOnFailure=True, description='Install Medic'),
+            FileDownload(mastersrc="../config.json", slavedest="medic/config.json", haltOnFailure=True),
+            FileDownload(mastersrc="../repos.json", slavedest="medic/repos.json", haltOnFailure=True),
+            ShellCommand(command=["git", "clone", repos['COHO']], workdir='build', haltOnFailure=True, description='Get COHO'),
+            ShellCommand(command=["npm", "install", "--production"], workdir='build/cordova-coho', haltOnFailure=True, description='Install COHO'),
+        ]
+
+    def repos_clone_steps(self):
+        platform = self.platform
+        # required by coho tools to correctly resolve repo location
+        if platform == "blackberry10":
+            platform = "blackberry"
+        if platform == "windows8":
+            platform = "windows"
+        return [
+            ShellCommand(command=["./cordova-coho/coho", "repo-clone", "-r", "plugins", "-r", "mobile-spec", "-r", platform, "-r", "js"], workdir='build', haltOnFailure=True, description='COHO Clone'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=PLUGIN", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=False, description='Checkout Plugins'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=PLATFORM", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=False, description='Checkout Platform'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json", "--cat=JS", "--releasebranch=" + branch_release], workdir='build', haltOnFailure=False, description='Checkout JS')
+        ]
+
+    def create_app_steps(self):
+        return [
+            ShellCommand(command=["node", "cordova-cli/bin/cordova", "create", "mobilespec", "org.apache.mobilespec", "mobilespec"], workdir='build', haltOnFailure=True, description='CLI Create'),
+            ShellCommand(command=["node", "medic/writejson.js", "--branch=master"], workdir='build', haltOnFailure=True, description='Write json')
+        ]
+
+    def platform_add_steps(self):
+        return [ShellCommand(command=["../cordova-cli/bin/cordova", "platform", "add", self.platform], workdir='build/mobilespec', haltOnFailure=True, description='Platform Add')]
+
+    def build_cordovajs_steps(self):
+        return [
+            ShellCommand(command=["npm", "install"], workdir='build/cordova-js', description='Install Grunt'),
+            ShellCommand(command=["grunt"], workdir='build/cordova-js', description='Grunt')
+        ]
+
+    def prepare_mobilespec_steps(self):
+        return [
+            ShellCommand(command=["node", "../cordova-cli/bin/cordova", "plugin", "add", "../cordova-mobile-spec/dependencies-plugin", "--searchpath", ".."], workdir='build/mobilespec', haltOnFailure=True, description='Plugin add'),
+            ShellCommand(command=["node", "../cordova-cli/bin/cordova", "plugin", "add", "../medic/cordova-plugin-medic"], workdir='build/mobilespec', haltOnFailure=True, description='Medic plugin add'),
+            ShellCommand(command=["rm", "-rf", "mobilespec/www"], workdir='build', haltOnFailure=False, description='Remove www'),
+            ShellCommand(command=["node", "-e", "require('fs').symlinkSync('../cordova-mobile-spec/www','www','dir')"], workdir='build/mobilespec', haltOnFailure=True, description='Link www'),
+            # added to handle the moved config.xml (up one directory)
+            ShellCommand(command=["cp", "cordova-mobile-spec/config.xml", "mobilespec/config.xml"], workdir='build', haltOnFailure=False, description='Copy config'),
+            ShellCommand(command=["node", "medic/updateconfig.js", "--" + self.platform], workdir='build', haltOnFailure=True, description='Update config'),
+            ShellCommand(command=["node", "../cordova-cli/bin/cordova", "prepare"], workdir='build/mobilespec', haltOnFailure=True, description='CLI Prepare')
+        ]
+
+    def copy_cordovajs_steps(self):
+        return [ShellCommand(command=["cp", "-f", "cordova-js/pkg/cordova." + self.platform + ".js", "mobilespec/platforms/" + self.platform + "/platform_www/cordova.js"], workdir='build', haltOnFailure=True, description='Copy JS')]
+
+    def deploy_steps(self):
+        return [ShellCommand(command=["node", "medic/build_" + self.platform + ".js"], workdir='build', timeout=build_timeout, description='Deploy', name='Deploy')]
+
+    def build_platform_step(self):
+        return [ShellCommand(command=["../cordova-cli/bin/cordova", "build", self.platform], workdir='build/mobilespec', timeout=build_timeout, description='Build', name='Build')]
+
+    def get_all_steps(self):
+        steps = []
+        steps.extend(self.init_workspace_steps())
+        steps.extend(self.repos_clone_steps())
+        steps.extend(cli_steps)
+        steps.extend(self.create_app_steps())
+        steps.extend(self.platform_add_steps())
+        steps.extend(self.build_cordovajs_steps())
+        steps.extend(self.prepare_mobilespec_steps())
+        steps.extend(self.copy_cordovajs_steps())
+        steps.extend(self.deploy_steps())
+        return steps
+
+    def get_build_steps(self):
+        steps = []
+        steps.extend(self.init_workspace_steps())
+        steps.extend(self.repos_clone_steps())
+        steps.extend(cli_steps)
+        steps.extend(self.create_app_steps())
+        steps.extend(self.platform_add_steps())
+        steps.extend(self.build_platform_step())
+        return steps
+
+
+class PlatformTest_iOS(PlatformTestBase):
+    def __init__(self):
+        super(PlatformTest_iOS, self).__init__('ios')
+
+
+class PlatformTest_Android(PlatformTestBase):
+    def __init__(self):
+        super(PlatformTest_Android, self).__init__('android')
+
+
+class PlatformTest_WP8(PlatformTestBase):
+
+    def __init__(self):
+        super(PlatformTest_WP8, self).__init__('wp8')
+    # override cordova.js copy step since grunt builds it as cordova.windowsphone.js, not cordova.wp8.js
+
+    def copy_cordovajs_steps(self):
+        return [ShellCommand(command=["cp", "-f", "cordova-js/pkg/cordova.windowsphone.js", "mobilespec/platforms/" + self.platform + "/platform_www/cordova.js"], workdir='build', haltOnFailure=True, description='Copy JS')]
+
+    def repos_clone_steps(self):
+        steps = super(PlatformTest_WP8, self).repos_clone_steps()
+        # pach cordova-wp8 template to prevent app to lock the screen. In other case we won't be able to re-install the app next time.
+        steps.extend([ShellCommand(command=["node", "medic\src\utils\patch_wp8_template.js"], workdir='build', haltOnFailure=True, description='Patch WP8 template')])
+        return steps
+
+
+class PlatformTest_Windows8(PlatformTestBase):
+
+    def __init__(self):
+        super(PlatformTest_Windows8, self).__init__('windows8')
+
+    def copy_cordovajs_steps(self):
+        copy_cmd = "var fs=require('fs');"
+        copy_cmd += "var platform=fs.existsSync('mobilespec/platforms/windows8')?'windows8':'windows';"
+        copy_cmd += "fs.createReadStream('cordova-js/pkg/cordova.'+platform+'.js').pipe(fs.createWriteStream('mobilespec/platforms/'+platform+'/platform_www/cordova.js'));"
+        return [ShellCommand(command=["node", "-e", copy_cmd], workdir='build', haltOnFailure=False, description='Copy JS to Windows platform')]
+
+    def deploy_steps(self):
+        return [
+            ShellCommand(command=["node", "medic/build_" + self.platform + ".js", "--store80"],
+                         workdir='build', timeout=build_timeout,
+                         description='Deploy Store80 project',
+                         name='Deploy Store80 project'),
+            ShellCommand(command=["node", "medic/build_" + self.platform + ".js", "--store"],
+                         workdir='build', timeout=build_timeout,
+                         description='Deploy Store project',
+                         name='Deploy Store project'),
+            ShellCommand(command=["node", "medic/build_" + self.platform + ".js", "--phone"],
+                         workdir='build', timeout=build_timeout,
+                         description='Deploy Phone project',
+                         name='Deploy Phone project'),
+        ]
+
+
+class PlatformTest_Blackberry(PlatformTestBase):
+
+    def __init__(self):
+        super(PlatformTest_Blackberry, self).__init__('blackberry10')
+
+    def prepare_mobilespec_steps(self):
+        steps = super(PlatformTest_Blackberry, self).prepare_mobilespec_steps()
+        steps.extend([ShellCommand(command=["node", "../cordova-cli/bin/cordova", "plugin", "rm", "org.apache.cordova.core.medic"], workdir='build/mobilespec', haltOnFailure=True, description='Medic plugin rm')])
+        return steps
+
+    def deploy_steps(self):
+        steps = [ShellCommand(command=["cp", "platforms/blackberry10/www/config.xml", "./config.xml"], workdir='build/mobilespec', haltOnFailure=True, description='Plugin add')]
+        steps.extend(super(PlatformTest_Blackberry, self).deploy_steps())
+        return steps
+
+if(build_ios):
+    factory_IOS_master = BuildFactory()
+    factory_IOS_master.addSteps(PlatformTest_iOS().get_all_steps())
+    c['builders'].append(BuilderConfig(name="IOS", slavenames=["ios-slave"], factory=factory_IOS_master))
 
-# The steps to build just the js
-common_steps_js = [
-    ShellCommand(command=["npm","install"], workdir='build/cordova-js',description='Install Grunt',descriptionDone='Install Grunt'),
-    ShellCommand(command=["grunt"], workdir='build/cordova-js',description='Grunt', descriptionDone='Grunt')
-]
+if(build_android):
+    factory_Android_master = BuildFactory()
+    factory_Android_master.addSteps(PlatformTest_Android().get_all_steps())
+    c['builders'].append(BuilderConfig(name="Android", slavenames=["android-slave"], factory=factory_Android_master))
 
-c['builders'] = []
+    factory_Android_build_only = BuildFactory()
+    factory_Android_build_only.addSteps(PlatformTest_Android().get_build_steps())
+    c['builders'].append(BuilderConfig(name="AndroidWin", slavenames=["windows-slave"], factory=factory_Android_build_only))
 
-if(build_ios) :
-    factory_IOS_master = BuildFactory()
-    factory_IOS_master.addStep(ShellCommand(command=["rm","-rf","~/.cordova/lib/ios"],workdir='build',haltOnFailure=False,description='Remove cache',descriptionDone='Remove cache'))
-    factory_IOS_master.addSteps(common_steps_1)
-    factory_IOS_master.addStep(ShellCommand(command=["./cordova-coho/coho","repo-clone","-r","plugins","-r","mobile-spec","-r","ios","-r","cli","-r","js"],workdir='build',haltOnFailure=True,description='COHO Clone', descriptionDone='COHO Clone'))
-    factory_IOS_master.addStep(ShellCommand(command=["./cordova-coho/coho","repo-update","-r","plugins","-r","mobile-spec","-r","ios","-r","cli","-r","js"],workdir='build',haltOnFailure=True,description='COHO Update', descriptionDone='COHO Update'))
-    factory_IOS_master.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLUGIN","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Plugins->master',descriptionDone='Plugins->master'))
-    factory_IOS_master.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLATFORM","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Platform->master',descriptionDone='Platform->master'))
-    factory_IOS_master.addSteps(common_steps_mobilespec_1)
-    factory_IOS_master.addStep(ShellCommand(command=["node","medic/writejson.js","--branch=master"],workdir='build',haltOnFailure=True, description='Write json',descriptionDone='Write json'))
-    factory_IOS_master.addStep(ShellCommand(command=["../cordova-cli/bin/cordova","platform","add","ios"],workdir='build/mobilespec',haltOnFailure=True, description='Platform Add',descriptionDone='Platform Add'))
-    factory_IOS_master.addSteps(common_steps_js)
-    factory_IOS_master.addSteps(common_steps_mobilespec_2)
-    factory_IOS_master.addStep(ShellCommand(command=["cp","-f","cordova-js/pkg/cordova.ios.js","mobilespec/platforms/ios/platform_www/cordova.js"],workdir='build',haltOnFailure=True,description='Copy JS',descriptionDone='Copy JS'))
-    factory_IOS_master.addStep(ShellCommand(command=["node", "medic/build_ios.js"], workdir='build', timeout=600,description='Deploy IOS',descriptionDone='Deploy IOS',name='Deploy IOS'))
-    c['builders'].append(BuilderConfig(name="IOS_Master",slavenames=["ios-slave"],factory=factory_IOS_master))
-
-if(build_android) :
-    factory_Android_master = BuildFactory()
-    factory_Android_master.addStep(ShellCommand(command=["rm","-rf","~/.cordova/lib/android"],workdir='build',haltOnFailure=False,description='Remove cache',descriptionDone='Remove cache'))
-    factory_Android_master.addSteps(common_steps_1)
-    factory_Android_master.addStep(ShellCommand(command=["./cordova-coho/coho","repo-clone","-r","plugins","-r","mobile-spec","-r","android","-r","cli","-r","js"],workdir='build',haltOnFailure=True,description='COHO Clone', descriptionDone='COHO Clone'))
-    factory_Android_master.addStep(ShellCommand(command=["./cordova-coho/coho","repo-update","-r","plugins","-r","mobile-spec","-r","android","-r","cli","-r","js"],workdir='build',haltOnFailure=True,description='COHO Update', descriptionDone='COHO Update'))
-    factory_Android_master.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLUGIN","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Plugins->master',descriptionDone='Plugins->master'))
-    factory_Android_master.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLATFORM","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Platform->master',descriptionDone='Platform->master'))
-#   factory_Android_master.addStep(ShellCommand(command=[shellCmd,shellRunParam,'[ -f "package.json" ] && npm install'],workdir='build/cordova-android/bin',haltOnFailure=True,description='NPM Install', descriptionDone='NPM Install'))
-    factory_Android_master.addSteps(common_steps_mobilespec_1)
-    factory_Android_master.addStep(ShellCommand(command=["node","medic/writejson.js","--branch=master"],workdir='build',haltOnFailure=True, description='Write json',descriptionDone='Write json'))
-    factory_Android_master.addStep(ShellCommand(command=["../cordova-cli/bin/cordova","platform","add","android"],workdir='build/mobilespec',haltOnFailure=True, description='Platform Add',descriptionDone='Platform Add'))
-    factory_Android_master.addSteps(common_steps_js)
-    factory_Android_master.addSteps(common_steps_mobilespec_2)
-    factory_Android_master.addStep(ShellCommand(command=["cp","-f","cordova-js/pkg/cordova.android.js","mobilespec/platforms/android/platform_www/cordova.js"],workdir='build',haltOnFailure=True,description='Copy JS',descriptionDone='Copy JS'))
-    factory_Android_master.addStep(ShellCommand(command=["node", "medic/build_android.js"], workdir='build', timeout=600,description='Deploy Android',descriptionDone='Deploy Android',name='Deploy Android'))
-    c['builders'].append(BuilderConfig(name="Android_Master",slavenames=["android-slave"],factory=factory_Android_master))
-
-if(build_wp8) :
+if(build_wp8):
     factory_wp8 = BuildFactory()
-    factory_wp8.addStep(ShellCommand(command=["rm","-rf","%userprofile%/.cordova/lib/wp"],workdir='build',haltOnFailure=False,description='Remove cache',descriptionDone='Remove cache'))
-    factory_wp8.addSteps(common_steps_1)
-    factory_wp8.addStep(ShellCommand(command=["node","./cordova-coho/coho","repo-clone","-r","plugins","-r","mobile-spec","-r","wp8","-r","js"],workdir='build',haltOnFailure=True,description='COHO Clone', descriptionDone='COHO Clone'))
-    factory_wp8.addStep(ShellCommand(command=["node","./cordova-coho/coho","repo-update","-r","plugins","-r","mobile-spec","-r","wp8","-r","js"],workdir='build',haltOnFailure=True,description='COHO Update', descriptionDone='COHO Update'))
-    # TODO find the way to specify cli branch to clone for COHO, currently use step below
-    factory_wp8.addStep(ShellCommand(command=["git","clone","-b",branches['CLI'],repos['CLI'],"cordova-cli"],workdir='build',haltOnFailure=True, description='Get CLI', descriptionDone='Get CLI'))
-    factory_wp8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLUGIN","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Plugins->master',descriptionDone='Plugins->master'))
-    factory_wp8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLATFORM","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Platform->master',descriptionDone='Platform->master'))
-    # pach cordova-wp8 template to prevent app to lock the screen. In other case we won't be able to re-install the app next time.
-    factory_wp8.addStep(ShellCommand(command=["node","medic\src\utils\patch_wp8_template.js"],workdir='build',haltOnFailure=True, description='Patch WP8 template',descriptionDone='Patch WP8 template'))
-    factory_wp8.addSteps(common_steps_mobilespec_1)
-    factory_wp8.addStep(ShellCommand(command=["node","medic/writejson.js","--branch=master"],workdir='build',haltOnFailure=True, description='Write json',descriptionDone='Write json'))
-    factory_wp8.addStep(ShellCommand(command=["node","../cordova-cli/bin/cordova","platform","add","wp8"],workdir='build/mobilespec',haltOnFailure=True, description='Platform Add',descriptionDone='Platform Add'))
-    factory_wp8.addSteps(common_steps_js)
-    factory_wp8.addSteps(common_steps_mobilespec_2)
-    factory_wp8.addStep(ShellCommand(command=["cp","-f","cordova-js/pkg/cordova.windowsphone.js","mobilespec/platforms/wp8/platform_www/cordova.js"],workdir='build',haltOnFailure=True,description='Copy JS',descriptionDone='Copy JS'))
-    factory_wp8.addStep(ShellCommand(command=["node", "medic/build_wp8.js"], workdir='build', timeout=600,description='Deploy WP8',descriptionDone='Deploy WP8',name='Deploy WP8'))
-
-    c['builders'].append(BuilderConfig(name="WP8_Master",slavenames=["windows-slave"], factory=factory_wp8))
-
-if(build_windows8) :
+    factory_wp8.addSteps(PlatformTest_WP8().get_all_steps())
+    c['builders'].append(BuilderConfig(name="WP8", slavenames=["windows-slave"], factory=factory_wp8))
+    c['builders'].append(BuilderConfig(name="WP8_vs2012_win8", slavenames=["win8-slave"], factory=factory_wp8))
+
+if(build_windows8):
     factory_windows8 = BuildFactory()
-    factory_windows8.addStep(ShellCommand(command=["rm","-rf","%userprofile%/.cordova/lib/windows8"],workdir='build',haltOnFailure=False,description='Remove cache',descriptionDone='Remove cache'))
-    factory_windows8.addSteps(common_steps_1)
-    factory_windows8.addStep(ShellCommand(command=["node","./cordova-coho/coho","repo-clone","-r","plugins","-r","mobile-spec","-r","windows","-r","js"],workdir='build',haltOnFailure=True,description='COHO Clone', descriptionDone='COHO Clone'))
-    factory_windows8.addStep(ShellCommand(command=["node","./cordova-coho/coho","repo-update","-r","plugins","-r","mobile-spec","-r","windows","-r","js"],workdir='build',haltOnFailure=True,description='COHO Update', descriptionDone='COHO Update'))
-    # TODO find the way to specify cli branch to clone for COHO, currently use step below
-    factory_windows8.addStep(ShellCommand(command=["git","clone","-b",branches['CLI'],repos['CLI'],"cordova-cli"],workdir='build',haltOnFailure=True, description='Get CLI', descriptionDone='Get CLI'))
-    factory_windows8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLUGIN","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Plugins->master',descriptionDone='Plugins->master'))
-    factory_windows8.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLATFORM","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Platform->master',descriptionDone='Platform->master'))
-    factory_windows8.addSteps(common_steps_mobilespec_1)
-    factory_windows8.addStep(ShellCommand(command=["node","medic/writejson.js","--branch=master"],workdir='build',haltOnFailure=True, description='Write json',descriptionDone='Write json'))
-    factory_windows8.addStep(ShellCommand(command=["node","../cordova-cli/bin/cordova","platform","add","windows8"],workdir='build/mobilespec',haltOnFailure=True, description='Platform Add',descriptionDone='Platform Add'))
-    factory_windows8.addSteps(common_steps_js)
-    factory_windows8.addSteps(common_steps_mobilespec_2)
-    factory_windows8.addStep(ShellCommand(command=["cp","-f","cordova-js/pkg/cordova.windows8.js","mobilespec/platforms/windows8/platform_www/cordova.js"],workdir='build',haltOnFailure=True,description='Copy JS',descriptionDone='Copy JS'))
-    factory_windows8.addStep(ShellCommand(command=["node", "medic/build_windows8.js"], workdir='build', timeout=600,description='Deploy Windows 8',descriptionDone='Deploy Windows8',name='Deploy Windows 8'))
-
-    c['builders'].append(BuilderConfig(name="Windows8_Master",slavenames=["windows-slave"], factory=factory_windows8))
-
-if(build_blackberry) :
+    factory_windows8.addSteps(PlatformTest_Windows8().get_all_steps())
+    c['builders'].append(BuilderConfig(name="Windows8", slavenames=["windows-slave"], factory=factory_windows8))
+    c['builders'].append(BuilderConfig(name="Windows8_vs2012_win8", slavenames=["win8-slave"], factory=factory_windows8))
+
+if(build_blackberry):
     factory_BlackBerry = BuildFactory()
-    factory_BlackBerry.addStep(ShellCommand(command=["rm","-rf","~/.cordova/lib/blackberry10"],workdir='build',haltOnFailure=False,description='Remove cache',descriptionDone='Remove cache'))
-    factory_BlackBerry.addSteps(common_steps_1)
-    factory_BlackBerry.addStep(ShellCommand(command=["./cordova-coho/coho","repo-clone","-r plugins","-r","mobile-spec","-r","blackberry","-r","cli","-r","js"],workdir='build',haltOnFailure=True,description='COHO Clone', descriptionDone='COHO Clone'))
-    factory_BlackBerry.addStep(ShellCommand(command=["./cordova-coho/coho","repo-update","-r plugins","-r","mobile-spec","-r","blackberry","-r","cli","-r","js"],workdir='build',haltOnFailure=True,description='COHO Update', descriptionDone='COHO Update'))
-    factory_BlackBerry.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLUGIN","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Plugins->dev',descriptionDone='Plugins->dev'))
-    factory_BlackBerry.addStep(ShellCommand(command=["node","medic/checkout.js","--path=../../../repos.json","--cat=PLATFORM","--releasebranch="+branch_release],workdir='build',haltOnFailure=False,description='Platform->master',descriptionDone='Platform->master'))
-    factory_BlackBerry.addSteps(common_steps_mobilespec_1)
-    factory_BlackBerry.addStep(ShellCommand(command=["node","medic/writejson.js","--branch=master"],workdir='build',haltOnFailure=True, description='Write json',descriptionDone='Write json'))
-    factory_BlackBerry.addStep(ShellCommand(command=["../cordova-cli/bin/cordova","platform","add","blackberry10"],workdir='build/mobilespec',haltOnFailure=True, description='Platform Add',descriptionDone='Platform Add'))
-    factory_BlackBerry.addSteps(common_steps_js)
-    factory_BlackBerry.addSteps(common_steps_mobilespec_2)
-    factory_BlackBerry.addSteps(ShellCommand(command=["node", "../cordova-cli/bin/cordova", "plugin", "rm", "org.apache.cordova.core.medic"],workdir='build/mobilespec',haltOnFailure=True,description='Medic plugin add',descriptionDone='Medic plugin removed')),
-    factory_BlackBerry.addStep(ShellCommand(command=["cp", "-f", "cordova-js/pkg/cordova.blackberry10.js", "mobilespec/platforms/blackberry10/platform_www/cordova.js"],workdir='build',haltOnFailure=True,description='Copy JS',descriptionDone='Copy JS'))
-    factory_BlackBerry.addStep(ShellCommand(command=["cp", "platforms/blackberry10/www/config.xml", "./config.xml"],workdir='build/mobilespec',haltOnFailure=True,description='Plugin add',descriptionDone='Replace config.xml'))
-    factory_BlackBerry.addStep(ShellCommand(command=["node", "medic/build_blackberry10.js"], workdir='build', timeout=600,description='Deploy BlackBerry',descriptionDone='Deploy BlackBerry',name='Deploy BlackBerry10'))
-    c['builders'].append(BuilderConfig(name="BlackBerry_Master",slavenames=["blackberry-slave"],factory=factory_BlackBerry))
-
-
-# TODO. temporary disable separate cli and plugman tests on Windows
-if not is_Windows :
-    factory_cli = BuildFactory()
-    factory_cli.addSteps(cli_steps)
-    c['builders'].append(BuilderConfig(name="Tools_CLI",slavenames=["common-slave"],factory=factory_cli))
+    factory_BlackBerry.addSteps(PlatformTest_Blackberry().get_all_steps())
+    c['builders'].append(BuilderConfig(name="BlackBerry", slavenames=["blackberry-slave"], factory=factory_BlackBerry))
+
+# TODO switch on
+# factory_cli = BuildFactory()
+# factory_cli.addStep(ShellCommand(command=["rm","-rf","cordova-*"],workdir='build',haltOnFailure=False,description='Cordova Clean'))
+# factory_cli.addSteps(cli_steps)
+# c['builders'].append(BuilderConfig(name="Tools_CLI",slavenames=["common-slave"],factory=factory_cli))
 
 #    factory_plugman = BuildFactory()
 #    factory_plugman.addSteps(plugman_steps)
 #    c['builders'].append(BuilderConfig(name="Tools_Plugman",slavenames=["common-slave"],factory=factory_plugman))
 
-if build_chrome :
+if build_chrome:
     factory_chrome_desktop = BuildFactory()
-    factory_chrome_desktop.addStep(ShellCommand(command=["rm","-rf","medic"],workdir='build',haltOnFailure=False,description='Medic Clean',descriptionDone='Medic Clean'))
-    factory_chrome_desktop.addStep(ShellCommand(command=["git","clone","-b",branches['TESTMASTER'],repos['TESTMASTER'],"medic"],workdir='build',haltOnFailure=True, description='Get Medic', descriptionDone='Get Medic'))
+    factory_chrome_desktop.addStep(ShellCommand(command=["rm", "-rf", "medic"], workdir='build', haltOnFailure=False, description='Medic Clean', descriptionDone='Medic Clean'))
+    factory_chrome_desktop.addStep(ShellCommand(command=["git", "clone", "-b", branches['TESTMASTER'], repos['TESTMASTER'], "medic"], workdir='build', haltOnFailure=True, description='Get Medic', descriptionDone='Get Medic'))
     # --production switch is used to speed up installation + fruitstrap dev dependency is not supported on Windows
-    factory_chrome_desktop.addStep(ShellCommand(command=["npm","install","--production"], workdir='build/medic',haltOnFailure=True,description='Install Medic',descriptionDone='Install Medic'))
-    factory_chrome_desktop.addStep(ShellCommand(command=["rm","-rf","mobile-chrome-apps"],workdir='build',haltOnFailure=True, description='Clean Chromespec',descriptionDone='Clean Chromespec'))
-    factory_chrome_desktop.addStep(ShellCommand(command=["git","clone",repos['CCA']],workdir='build',haltOnFailure=True, description='Fetch Chromespec',descriptionDone='Fetch Chromespec'))
-    factory_chrome_desktop.addStep(ShellCommand(command=["npm","install"],workdir='build/medic/runner',haltOnFailure=True, description='Install Runner',descriptionDone='Install Runner'))
-    factory_chrome_desktop.addStep(ShellCommand(command=["node","medic/runner/testrunner.js","--cmd=medic/runner/runchrome.sh","--path=mobile-chrome-apps/chrome-cordova/chrome-apps-api-tests","--args=mobile-chrome-apps/chrome-cordova/chrome-apps-api-tests"],workdir='build',haltOnFailure=True, description='Run Chrome',descriptionDone='Run Chrome'))
-    c['builders'].append(BuilderConfig(name="ZChrome_Desktop",slavenames=["common-slave"], factory=factory_chrome_desktop))
+    factory_chrome_desktop.addStep(ShellCommand(command=["npm", "install", "--production"], workdir='build/medic', haltOnFailure=True, description='Install Medic', descriptionDone='Install Medic'))
+    factory_chrome_desktop.addStep(ShellCommand(command=["rm", "-rf", "mobile-chrome-apps"], workdir='build', haltOnFailure=True, description='Clean Chromespec', descriptionDone='Clean Chromespec'))
+    factory_chrome_desktop.addStep(ShellCommand(command=["git", "clone", repos['CCA']], workdir='build', haltOnFailure=True, description='Fetch Chromespec', descriptionDone='Fetch Chromespec'))
+    factory_chrome_desktop.addStep(ShellCommand(command=["npm", "install"], workdir='build/medic/runner', haltOnFailure=True, description='Install Runner', descriptionDone='Install Runner'))
+    factory_chrome_desktop.addStep(ShellCommand(command=["node", "medic/runner/testrunner.js", "--cmd=medic/runner/runchrome.sh", "--path=mobile-chrome-apps/chrome-cordova/chrome-apps-api-tests", "--args=mobile-chrome-apps/chrome-cordova/chrome-apps-api-tests"], workdir='build', haltOnFailure=True, description='Run Chrome', descriptionDone='Run Chrome'))
+    c['builders'].append(BuilderConfig(name="ZChrome_Desktop", slavenames=["common-slave"], factory=factory_chrome_desktop))
 
     factory_chrome_mobile = BuildFactory()
-    factory_chrome_mobile.addStep(ShellCommand(command=["rm","-rf","medic"],workdir='build',haltOnFailure=False,description='Medic Clean',descriptionDone='Medic Clean'))
-    factory_chrome_mobile.addStep(ShellCommand(command=["git","clone","-b",branches['TESTMASTER'],repos['TESTMASTER'],"medic"],workdir='build',haltOnFailure=True, description='Get Medic', descriptionDone='Get Medic'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["rm", "-rf", "medic"], workdir='build', haltOnFailure=False, description='Medic Clean', descriptionDone='Medic Clean'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["git", "clone", "-b", branches['TESTMASTER'], repos['TESTMASTER'], "medic"], workdir='build', haltOnFailure=True, description='Get Medic', descriptionDone='Get Medic'))
     # --production switch is used to speed up installation + fruitstrap dev dependency is not supported on Windows
-    factory_chrome_mobile.addStep(ShellCommand(command=["npm","install","--production"], workdir='build/medic',haltOnFailure=True,description='Install Medic',descriptionDone='Install Medic'))
-    factory_chrome_mobile.addStep(ShellCommand(command=["npm","install"],workdir='build/medic/runner',haltOnFailure=True, description='Install Runner',descriptionDone='Install Runner'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["npm", "install", "--production"], workdir='build/medic', haltOnFailure=True, description='Install Medic', descriptionDone='Install Medic'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["npm", "install"], workdir='build/medic/runner', haltOnFailure=True, description='Install Runner', descriptionDone='Install Runner'))
 
-    factory_chrome_mobile.addStep(ShellCommand(command=["rm","-rf","mobile-chrome-apps"],workdir='build',haltOnFailure=True, description='Clean cca',descriptionDone='Clean cca'))
-    factory_chrome_mobile.addStep(ShellCommand(command=["git","clone","--recurse-submodules",repos['CCA']],workdir='build',haltOnFailure=True, description='Fetch cca',descriptionDone='Fetch cca'))
-    factory_chrome_mobile.addStep(ShellCommand(command=["npm","install"],workdir='build/mobile-chrome-apps',haltOnFailure=True, description='Install cca',descriptionDone='Install cca'))
-    factory_chrome_mobile.addStep(ShellCommand(command=["rm","-rf","ccatest"],workdir='build',haltOnFailure=True, description='Clean ccatest',descriptionDone='Clean ccatest'))
-    factory_chrome_mobile.addStep(ShellCommand(command=["mobile-chrome-apps/src/cca.js","create","ccatest","--copy-from","mobile-chrome-apps/chrome-cordova/chrome-apps-api-tests"],workdir='build',haltOnFailure=True, description='cca create',descriptionDone='cca create'))
-
-    factory_chrome_mobile.addStep(ShellCommand(command=["node","../medic/runner/testrunner.js","--ip=192.168.1.122","--port=6800","--cmd=../medic/runner/runcca.sh","--path=www","--args=android"],workdir='build/ccatest',timeout=300,haltOnFailure=True, description='Run Mobile',descriptionDone='Run Mobile'))
-    c['builders'].append(BuilderConfig(name="ZChrome_Mobile",slavenames=["android-slave"], factory=factory_chrome_mobile))
+    factory_chrome_mobile.addStep(ShellCommand(command=["rm", "-rf", "mobile-chrome-apps"], workdir='build', haltOnFailure=True, description='Clean cca', descriptionDone='Clean cca'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["git", "clone", "--recurse-submodules", repos['CCA']], workdir='build', haltOnFailure=True, description='Fetch cca', descriptionDone='Fetch cca'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["npm", "install"], workdir='build/mobile-chrome-apps', haltOnFailure=True, description='Install cca', descriptionDone='Install cca'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["rm", "-rf", "ccatest"], workdir='build', haltOnFailure=True, description='Clean ccatest', descriptionDone='Clean ccatest'))
+    factory_chrome_mobile.addStep(ShellCommand(command=["mobile-chrome-apps/src/cca.js", "create", "ccatest", "--copy-from", "mobile-chrome-apps/chrome-cordova/chrome-apps-api-tests"], workdir='build', haltOnFailure=True, description='cca create', descriptionDone='cca create'))
 
+    factory_chrome_mobile.addStep(ShellCommand(command=["node", "../medic/runner/testrunner.js", "--ip=192.168.1.122", "--port=6800", "--cmd=../medic/runner/runcca.sh", "--path=www", "--args=android"], workdir='build/ccatest', timeout=300, haltOnFailure=True, description='Run Mobile', descriptionDone='Run Mobile'))
+    c['builders'].append(BuilderConfig(name="ZChrome_Mobile", slavenames=["android-slave"], factory=factory_chrome_mobile))
 
 
 ####### STATUS TARGETS
-
 # 'status' is a list of Status Targets. The results of each build will be
 # pushed to these targets. buildbot/status/*.py has a variety to choose from,
 # including web pages, email senders, and IRC bots.
@@ -369,37 +428,31 @@ c['status'] = []
 
 from buildbot.status import html
 from buildbot.status.web import authz, auth
-from buildbot.status import mail
-from buildbot.status.builder import Results
 from buildbot.status.mail import MailNotifier
 
-authz_cfg=authz.Authz(
-    # change any of these to True to enable; see the manual for more
-    # options
-    auth=auth.BasicAuth([("Cordova","Cordova")]),
-    gracefulShutdown = False,
-    forceBuild = True, # 'auth', # use this to test your slave once it is set up
-    forceAllBuilds = False,
-    pingBuilder = False,
-    stopBuild = False,
-    stopAllBuilds = False,
-    cancelPendingBuild = False,
-)
-c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
-
-
-mn1 = MailNotifier(
-      fromaddr=mail_from,
-      sendToInterestedUsers=False,
-      mode=('change',),
-      extraRecipients=mail_to,
-      relayhost='smtp.gmail.com',
-      smtpPort=587,
-      useTls=True,
-      smtpUser=mail_from,
-      smtpPassword=mail_pw,
-)
+# change any of these to True to enable; see the manual for more options
+authz_cfg = authz.Authz(auth=auth.BasicAuth([("Cordova", "Cordova")]),
+                        gracefulShutdown=False,
+                        forceBuild=True,  # 'auth', # use this to test your slave once it is set up
+                        forceAllBuilds=False,
+                        pingBuilder=False,
+                        stopBuild=False,
+                        stopAllBuilds=False,
+                        cancelPendingBuild=False,
+                        )
+
+mn1 = MailNotifier(fromaddr=mail_from,
+                   sendToInterestedUsers=False,
+                   mode=('change',),
+                   extraRecipients=mail_to,
+                   relayhost='smtp.gmail.com',
+                   smtpPort=587,
+                   useTls=True,
+                   smtpUser=mail_from,
+                   smtpPassword=mail_pw,
+                   )
 
+c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
 c['status'].append(mn1)
 
 ####### PROJECT IDENTITY
@@ -424,5 +477,5 @@ c['buildbotURL'] = mail_serverURL
 c['db'] = {
     # This specifies what database buildbot uses to store its state.  You can leave
     # this at its default for all but the largest installations.
-    'db_url' : "sqlite:///state.sqlite",
+    'db_url': "sqlite:///state.sqlite",
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org