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

Unified Diff: infra/bots/flavor/chromeos_flavor.py

Issue 1703663002: Port Skia recipe to normal Python scripts, move to Skia repo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 4 years, 10 months 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
« no previous file with comments | « infra/bots/flavor/android_flavor.py ('k') | infra/bots/flavor/cmake_flavor.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: infra/bots/flavor/chromeos_flavor.py
diff --git a/infra/bots/flavor/chromeos_flavor.py b/infra/bots/flavor/chromeos_flavor.py
new file mode 100644
index 0000000000000000000000000000000000000000..8e8221489dd5aed0277dd6c288b7d41303660094
--- /dev/null
+++ b/infra/bots/flavor/chromeos_flavor.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+#
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+import default_flavor
+import os
+import ssh_flavor
+
+
+"""Utils for building for and running tests on ChromeOS."""
+
+
+class ChromeOSFlavorUtils(ssh_flavor.SSHFlavorUtils):
+ def __init__(self, bot_info):
+ super(ChromeOSFlavorUtils, self).__init__(bot_info)
+ self.board = self._bot_info.spec['device_cfg']
+ self.device_root_dir = '/usr/local/skiabot'
+ self.device_bin_dir = self.device_path_join(self.device_root_dir, 'bin')
+
+ def step(self, name, cmd, **kwargs):
+ """Wrapper for the Step API; runs a step as appropriate for this flavor."""
+ local_path = self._bot_info.out_dir.join(
+ 'config', 'chromeos-%s' % self.board,
+ self._bot_info.configuration, cmd[0])
+ remote_path = self.device_path_join(self.device_bin_dir, cmd[0])
+ self.copy_file_to_device(local_path, remote_path)
+ super(ChromeOSFlavorUtils, self).step(name=name,
+ cmd=[remote_path]+cmd[1:],
+ **kwargs)
+
+ def compile(self, target):
+ """Build the given target."""
+ cmd = [os.path.join(self._bot_info.skia_dir, 'platform_tools', 'chromeos',
+ 'bin', 'chromeos_make'),
+ '-d', self.board,
+ target]
+ self._bot_info.run(cmd)
+
+ def install(self):
+ """Run any device-specific installation steps."""
+ self.create_clean_device_dir(self.device_bin_dir)
+
+ def get_device_dirs(self):
+ """ Set the directories which will be used by the build steps."""
+ prefix = self.device_path_join(self.device_root_dir, 'skia_')
+ def join(suffix):
+ return ''.join((prefix, suffix))
+ return default_flavor.DeviceDirs(
+ dm_dir=join('dm_out'), # 'dm' conflicts with the binary
+ perf_data_dir=join('perf'),
+ resource_dir=join('resources'),
+ images_dir=join('images'),
+ skp_dir=self.device_path_join(join('skp'), 'skps'),
+ tmp_dir=join('tmp_dir'))
+
« no previous file with comments | « infra/bots/flavor/android_flavor.py ('k') | infra/bots/flavor/cmake_flavor.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698