cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From an-s...@apache.org
Subject [3/7] cordova-medic git commit: Multiple improvements
Date Tue, 02 Dec 2014 14:58:05 GMT
Multiple improvements

* Put all config-related routines into MedicConfig class()
* Move cli_steps and plugman_steps into PlatformTestBase since they are common for all builders
* introduce get_default_factory() method for PaltformTestBase to simplify creating build factories
* replace windows8 -> windows in platform names


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

Branch: refs/heads/master
Commit: 9efe50734d77945b2432124df5bba93404c8e843
Parents: 784c884
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Authored: Mon Dec 1 18:36:04 2014 +0300
Committer: Vladimir Kotikov <v-vlkoti@microsoft.com>
Committed: Tue Dec 2 12:13:00 2014 +0300

----------------------------------------------------------------------
 config.json.sample |   2 +-
 cordova.conf       | 310 ++++++++++++++++++++++--------------------------
 2 files changed, 143 insertions(+), 169 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/9efe5073/config.json.sample
----------------------------------------------------------------------
diff --git a/config.json.sample b/config.json.sample
index 6048d55..366b506 100644
--- a/config.json.sample
+++ b/config.json.sample
@@ -15,7 +15,7 @@
             "git":"https://git-wip-us.apache.org/repos/asf/cordova-mobile-spec.git"
         },
         "entry":"autotest/pages/all.html",
-        "platforms":"android ios windows8 wp8",
+        "platforms":"android ios windows wp8",
         "release":"master",
         "timeout": 600
     },

http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/9efe5073/cordova.conf
----------------------------------------------------------------------
diff --git a/cordova.conf b/cordova.conf
index ac176fc..f92293d 100644
--- a/cordova.conf
+++ b/cordova.conf
@@ -4,105 +4,104 @@
 # NOTE: The f_cor_1 build runs on ASF slave. Newer builds and schedulers 
 # added on 26th Nov 2014 are for external slaves (currently)
 
+# set some variables
 
 import json
-with open(FP + "config.json") as f:
-    json_config = json.load(f)
+class MedicConfig(object):
+    """static class that encapsulates all configuration parameters"""
 
-with open(FP + "repos.json") as f:
-    json_repos = json.load(f)
+    def __init__(self):
+        with open(FP + "config.json") as fname:
+            self.json_config = json.load(fname)
 
+        with open(FP + "repos.json") as fname:
+            self.json_repos = json.load(fname)
 
-# set some variables
+        self.platform_list = self.json_config['app']['platforms']
+        self.branch_release = self.json_config['app']['release']
+        self.build_timeout = self.json_config['app']['timeout']
+
+        self.projectbranches = ['master', self.branch_release]
+        self.polltime = 300
+        self.stabletime = 30
+
+        # GitPoller on Windows fails if gitbin location is not provided.
+        # Set git location if running medic master on Windows
+        self.git_bin = ""  #"c:\Program Files (x86)\Git\cmd\git.exe"
+
+        self.repos = {}
+        self.branches = {}
 
-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"
-
-repos = {}
-branches = {}
-
-for jrepo in json_repos['repos']:
-    title = str(jrepo["title"])
-    repo_url = str(jrepo['repo'])
-    category = str(jrepo['category'])
-    repos[title] = repo_url
-    branches[title] = str(jrepo['current'])
+        self.fetch_repos()
+        self.fetch_branches()
+
+    def has_platform(self, platform_name):
+        """Indicates whether specific platform is need to be built"""
+        return platform_name in self.platform_list
+
+    def fetch_repos(self):
+        """Fetches repos from config.json"""
+        for repo in self.json_repos['repos']:
+            title = str(repo["title"])
+            repo_url = str(repo['repo'])
+            self.repos[title] = repo_url
+
+    def fetch_branches(self):
+        """Fetches branches for each repo from config.json"""
+        for jrepo in self.json_repos['repos']:
+            title = str(jrepo["title"])
+            self.branches[title] = str(jrepo['current'])
+
+CONFIG = MedicConfig()
 
 # schedulers
 
 from buildbot.schedulers.basic import SingleBranchScheduler
 from buildbot.schedulers.forcesched import ForceScheduler
-from buildbot.changes import filter
+from buildbot.changes.filter import ChangeFilter
 
-builders = []
 force_builders = []
+
 c['schedulers'] = []
 
-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"])]
+for test in CONFIG.json_repos['tests']:
+
+    test_platform = test["platform"]
+    test_builders = [str(b) for b in test["builder"]] if type(test["builder"]) == list else
[str(test["builder"])]
 
-        force_builders.extend(builders)
+    if CONFIG.has_platform(test_platform):
+
+        force_builders.extend(test_builders)
 
         c['schedulers'].append(SingleBranchScheduler(
                                name=str(test["title"]),
-                               change_filter=filter.ChangeFilter(branch=test["branch"], project=test["categories"]),
-                               treeStableTimer=stabletime,
-                               builderNames=builders))
+                               change_filter=ChangeFilter(branch=test["branch"], project=test["categories"]),
+                               treeStableTimer=CONFIG.stabletime,
+                               builderNames=test_builders))
 
 c['schedulers'].append(ForceScheduler(name="force", builderNames=force_builders))
 
 # new build steps
 
-cli_steps = [
-    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'),
-    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'),
-]
+from buildbot.steps.shell import ShellCommand
+from buildbot.config import BuilderConfig
+from buildbot.process.factory import BuildFactory
+from buildbot.steps.transfer import FileDownload
 
 class PlatformTestBase(object):
-    def __init__(self, platform):
+    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=["rm", "-rf", "medic", "mobilespec", "cordova-mobile-spec",
"cordova-coho", "cordova-cli", "cordova-lib"], workdir='build', haltOnFailure=False, description='Clean
workdir'),
-            ShellCommand(command=["git", "clone", "-b", branches['TESTMASTER'], repos['TESTMASTER'],
"medic"], workdir='build', haltOnFailure=True, description='Get Medic'),
+            ShellCommand(command=["rm", "-rf", "*"], workdir='build', haltOnFailure=False,
description='Clean workdir'),
+            ShellCommand(command=["git", "clone", "--depth", "1", "-b", CONFIG.branches['TESTMASTER'],
CONFIG.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=FP+"config.json", slavedest="medic/config.json", haltOnFailure=True),
             FileDownload(mastersrc=FP+"repos.json", slavedest="medic/repos.json", haltOnFailure=True),
-            ShellCommand(command=["git", "clone", repos['COHO']], workdir='build', haltOnFailure=True,
description='Get COHO'),
+            ShellCommand(command=["git", "clone", "--depth", "1", CONFIG.repos['COHO']],
workdir='build', haltOnFailure=True, description='Get COHO'),
             ShellCommand(command=["npm", "install", "--production"], workdir='build/cordova-coho',
haltOnFailure=True, description='Install COHO'),
         ]
 
@@ -111,106 +110,105 @@ class PlatformTestBase(object):
         # 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=["./cordova-coho/coho", "repo-update", "-r", "plugins",
"-r", "mobile-spec", "-r", platform, "-r", "js"], workdir='build', haltOnFailure=True, description='COHO
Update'),
-            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')
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json",
"--cat=MSPEC", "--releasebranch=" + CONFIG.branch_release], workdir='build', haltOnFailure=True,
description='Clone Mobilespec'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json",
"--cat=PLUGIN", "--releasebranch=" + CONFIG.branch_release], workdir='build', haltOnFailure=True,
description='Clone Plugins'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json",
"--cat=" + platform, "--releasebranch=" + CONFIG.branch_release], workdir='build', haltOnFailure=True,
description='Clone Platform'),
+            ShellCommand(command=["node", "medic/checkout.js", "--path=medic/repos.json",
"--cat=JS", "--releasebranch=" + CONFIG.branch_release], workdir='build', haltOnFailure=True,
description='Clone JS'),
         ]
 
-    def create_app_steps(self):
+    def cli_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')
+            ShellCommand(command=["git", "clone", "-b", CONFIG.branches['CLI'], CONFIG.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", "--depth", "1", "-b", CONFIG.branches['CORDOVA-LIB'],
CONFIG.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'),
         ]
 
-    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 plugman_steps(self):
+        return [
+            ShellCommand(command=["rm", "-rf", "cordova-*"], workdir='build', haltOnFailure=False,
description='Cordova Clean'),
+            ShellCommand(command=["git", "clone", CONFIG.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'),
+        ]
 
     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')
+            ShellCommand(command=["node", "../medic/build_js.js", self.platform], workdir='build/cordova-js',
description='Grunt')
         ]
 
     def prepare_mobilespec_steps(self):
+        platform = self.platform
+        # required by coho tools to correctly resolve repo location
+        if platform == "blackberry10":
+            platform = "blackberry"
         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=["npm", "install"], workdir='build/cordova-mobile-spec/createmobilespec',
haltOnFailure=True, description='Install createmobilespec'),
+            ShellCommand(command=["cordova-coho/coho", "npm-link"], workdir='build', haltOnFailure=True,
description='COHO npm-link'),
+            ShellCommand(command=["cordova-mobile-spec/createmobilespec/createmobilespec",
"--" + platform, "mobilespec"], workdir='build', haltOnFailure=True, description='Run createmobilespec'),
             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')
+            ShellCommand(command=["node", "medic/updateconfig.js", "--" + self.platform],
workdir='build', haltOnFailure=True, description='Update config')
         ]
 
     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')]
+        return [ShellCommand(command=["node", "medic/build_" + self.platform + ".js"], workdir='build',
timeout=CONFIG.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')]
+        return [ShellCommand(command=["../cordova-cli/bin/cordova", "build", self.platform],
workdir='build/mobilespec', timeout=CONFIG.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.cli_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
-
+    def get_default_factory(self):
+        """Creates and returns a default factory for platform"""
+        factory = BuildFactory()
+        factory.addSteps(self.get_all_steps())
+        return factory
 
-class PlatformTest_iOS(PlatformTestBase):
+class PlatformTestIOS(PlatformTestBase):
     def __init__(self):
-        super(PlatformTest_iOS, self).__init__('ios')
-
+        super(PlatformTestIOS, self).__init__('ios')
 
-class PlatformTest_Android(PlatformTestBase):
+class PlatformTestAndroid(PlatformTestBase):
     def __init__(self):
-        super(PlatformTest_Android, self).__init__('android')
-
+        super(PlatformTestAndroid, self).__init__('android')
 
-class PlatformTest_WP8(PlatformTestBase):
+class PlatformTestWP8(PlatformTestBase):
 
     def __init__(self):
-        super(PlatformTest_WP8, self).__init__('wp8')
+        super(PlatformTestWP8, 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()
+        steps = super(PlatformTestWP8, 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):
+class PlatformTestWindows(PlatformTestBase):
 
     def __init__(self):
-        super(PlatformTest_Windows8, self).__init__('windows8')
+        super(PlatformTestWindows, self).__init__('windows')
 
     def copy_cordovajs_steps(self):
         copy_cmd = "var fs=require('fs');"
@@ -221,105 +219,84 @@ class PlatformTest_Windows8(PlatformTestBase):
     def deploy_steps(self):
         return [
             ShellCommand(command=["node", "medic/build_" + self.platform + ".js", "--store80"],
-                         workdir='build', timeout=build_timeout,
+                         workdir='build', timeout=CONFIG.build_timeout,
                          description='Deploy Store80 project',
                          name='Deploy Store80 project'),
             ShellCommand(command=["node", "medic/build_" + self.platform + ".js", "--store"],
-                         workdir='build', timeout=build_timeout,
+                         workdir='build', timeout=CONFIG.build_timeout,
                          description='Deploy Store project',
                          name='Deploy Store project'),
             ShellCommand(command=["node", "medic/build_" + self.platform + ".js", "--phone"],
-                         workdir='build', timeout=build_timeout,
+                         workdir='build', timeout=CONFIG.build_timeout,
                          description='Deploy Phone project',
                          name='Deploy Phone project'),
         ]
 
-from buildbot.config import BuilderConfig
-from buildbot.process.factory import BuildFactory
-from buildbot.steps.shell import ShellCommand
-from buildbot.steps.transfer import FileDownload
-# from buildbot.config import BuilderConfig
-
-class PlatformTest_Blackberry(PlatformTestBase):
+class PlatformTestBlackberry(PlatformTestBase):
 
     def __init__(self):
-        super(PlatformTest_Blackberry, self).__init__('blackberry10')
+        super(PlatformTestBlackberry, self).__init__('blackberry10')
 
     def prepare_mobilespec_steps(self):
-        steps = super(PlatformTest_Blackberry, self).prepare_mobilespec_steps()
+        steps = super(PlatformTestBlackberry, 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())
+        steps.extend(super(PlatformTestBlackberry, self).deploy_steps())
         return steps
 
-if(build_ios):
+if CONFIG.has_platform("ios"):
     factory_IOS_master = BuildFactory()
-    factory_IOS_master.addSteps(PlatformTest_iOS().get_all_steps())
+    factory_IOS_master.addSteps(PlatformTestIOS().get_all_steps())
     c['builders'].append(BuilderConfig(name="IOS", slavenames=["cordova-ios-slave"], factory=factory_IOS_master))
 
-if(build_android):
+if CONFIG.has_platform("android"):
     factory_Android_master = BuildFactory()
-    factory_Android_master.addSteps(PlatformTest_Android().get_all_steps())
+    factory_Android_master.addSteps(PlatformTestAndroid().get_all_steps())
     c['builders'].append(BuilderConfig(name="Android", slavenames=["cordova-android-slave"],
factory=factory_Android_master))
 
     factory_Android_build_only = BuildFactory()
-    factory_Android_build_only.addSteps(PlatformTest_Android().get_build_steps())
+    factory_Android_build_only.addSteps(PlatformTestAndroid().get_all_steps())
     c['builders'].append(BuilderConfig(name="AndroidWin", slavenames=["cordova-windows-slave"],
factory=factory_Android_build_only))
 
-if(build_wp8):
+if CONFIG.has_platform("wp8"):
     factory_wp8 = BuildFactory()
-    factory_wp8.addSteps(PlatformTest_WP8().get_all_steps())
+    factory_wp8.addSteps(PlatformTestWP8().get_all_steps())
     c['builders'].append(BuilderConfig(name="WP8", slavenames=["cordova-windows-slave"],
factory=factory_wp8))
     c['builders'].append(BuilderConfig(name="WP8_vs2012_win8", slavenames=["cordova-win8-slave"],
factory=factory_wp8))
 
-if(build_windows8):
-    factory_windows8 = BuildFactory()
-    factory_windows8.addSteps(PlatformTest_Windows8().get_all_steps())
-    c['builders'].append(BuilderConfig(name="Windows", slavenames=["cordova-windows-slave"],
factory=factory_windows8))
-    c['builders'].append(BuilderConfig(name="Windows8_vs2012_win8", slavenames=["cordova-win8-slave"],
factory=factory_windows8))
+if CONFIG.has_platform("windows"):
+    c['builders'].append(BuilderConfig(name="Windows", slavenames=["cordova-windows-slave"],
factory=PlatformTestWindows().get_default_factory()))
+    c['builders'].append(BuilderConfig(name="Windows8_vs2012_win8", slavenames=["cordova-win8-slave"],
factory=PlatformTestWindows().get_default_factory()))
 
-if(build_blackberry):
+if CONFIG.has_platform("blackberry"):
     factory_BlackBerry = BuildFactory()
-    factory_BlackBerry.addSteps(PlatformTest_Blackberry().get_all_steps())
+    factory_BlackBerry.addSteps(PlatformTestBlackberry().get_all_steps())
     c['builders'].append(BuilderConfig(name="BlackBerry", slavenames=["cordova-blackberry-slave"],
factory=factory_BlackBerry))
 
-import platform
-
-# TODO. temporary disable separate cli and plugman tests on Windows
-# if not platform.system() == "Windows" :
-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=["cordova-common-slave"],factory=factory_cli))
-
-#    factory_plugman = BuildFactory()
-#    factory_plugman.addSteps(plugman_steps)
-#    c['builders'].append(BuilderConfig(name="Tools_Plugman",slavenames=["cordova-common-slave"],factory=factory_plugman))
-
-if build_chrome:
+if CONFIG.has_platform("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=["git", "clone", "-b", CONFIG.branches['TESTMASTER'],
CONFIG.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=["git", "clone", CONFIG.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=["cordova-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=["git", "clone", "-b", CONFIG.branches['TESTMASTER'],
CONFIG.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=["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=["git", "clone", "--recurse-submodules",
CONFIG.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'))
@@ -327,6 +304,15 @@ if build_chrome:
     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=["cordova-android-slave"],
factory=factory_chrome_mobile))
 
+factory_cli = BuildFactory()
+factory_cli.addStep(ShellCommand(command=["rm","-rf","cordova-*"],workdir='build',haltOnFailure=False,description='Cordova
Clean'))
+factory_cli.addSteps(PlatformTestBase().cli_steps())
+c['builders'].append(BuilderConfig(name="Tools_CLI",slavenames=["cordova-common-slave"],factory=factory_cli))
+
+# factory_plugman = BuildFactory()
+# factory_plugman.addSteps(PlatformTestBase().plugman_steps())
+# c['builders'].append(BuilderConfig(name="Tools_Plugman",slavenames=["cordova-common-slave"],factory=factory_plugman))
+
 #mail status
 
 # Store these here for now, not sure if we'll use them.
@@ -338,15 +324,3 @@ if build_chrome:
 # mail_from = str(json_config['mail']['from'])
 # mail_pw = str(json_config['mail']['password'])
 # mail_serverURL = str(json_config['mail']['serverURL'])
-
-#irc status
-
-from buildbot.status import words
-c['status'].append(words.IRC(host="irc.freenode.net", nick="cordova-bot",
-                              allowForce=True,
-                              channels=["#asftest"],
-			      notify_events={
-				'successToFailure': 1,
-				'failureToSuccess': 1,
-				},
-                              categories=["cordova-weinre"]))
\ No newline at end of file


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


Mime
View raw message