Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Unified Diff: scripts/master/factory/webm_factory.py

Issue 5285010: Add a basic configuration (gclient sync + build) for pagespeed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/master/factory/webm_factory.py
===================================================================
--- scripts/master/factory/webm_factory.py (revision 0)
+++ scripts/master/factory/webm_factory.py (revision 0)
@@ -0,0 +1,72 @@
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Utility class to build the webm master BuildFactory's.
+
+Based on gclient_factory.py and adds webm-specific steps."""
+
+import os
+
+from master.factory import gclient_factory
+from master.factory import webm_commands
+from master.factory.build_factory import BuildFactory
+
+import config
+
+
+class WebMFactory(object):
+ """Encapsulates data and methods common to the webm master.cfg file."""
+
+ DEFAULT_TARGET_PLATFORM = config.Master.default_platform
+
+ def __init__(self, build_dir, target_platform=None):
+ self._build_dir = build_dir
+ self._target_platform = target_platform or 'win32'
+
+ def _AddTests(self, factory_cmd_obj, tests, mode=None,
+ factory_properties=None):
+ """Add the tests listed in 'tests' to the factory_cmd_obj."""
+ factory_properties = factory_properties or {}
+
+ # This function is too crowded, try to simplify it a little.
+ def R(test):
+ return gclient_factory.ShouldRunTest(tests, test)
+ f = factory_cmd_obj
+ fp = factory_properties
+
+ # ADD TESTS HERE. Example:
+ # if R('unit_tests'): f.AddUnitTests()
+
+ def WebMFactory(self, identifier, target='Release', clobber=False,
+ tests=None, mode=None, slave_type='BuilderTester',
+ options=None, compile_timeout=1200, build_url=None,
+ project=None, factory_properties=None):
+ factory_properties = factory_properties or {}
+ tests = tests or []
+
+ factory = BuildFactory()
+
+ # Get the factory command object to create new steps to the factory.
+ webm_cmd_obj = webm_commands.WebMCommands(factory,
+ identifier,
+ target,
+ self._build_dir,
+ self._target_platform)
+
+ # First kill any svn.exe tasks so we can update in peace, and
+ # afterwards use the checked-out script to kill everything else.
+ if self._target_platform == 'win32':
+ webm_cmd_obj.AddSvnKillStep()
+ webm_cmd_obj.AddUpdateScriptStep()
+ # Once the script is updated, the zombie processes left by the previous
+ # run can be killed.
+ if self._target_platform == 'win32':
+ webm_cmd_obj.AddTaskkillStep()
+
+ # ADD UPDATE AND COMPILE STEP HERE.
+
+ # Add all the tests.
+ self._AddTests(webm_cmd_obj, tests, mode, factory_properties)
+
+ return factory
« scripts/master/factory/pagespeed_factory.py ('K') | « scripts/master/factory/webm_commands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698