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

Unified Diff: buildbot/buildbot_run.py

Issue 426783004: android: Make buildbot able to use a custom manifest. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 6 years, 5 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 | « buildbot/aosp_manifest.xml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: buildbot/buildbot_run.py
diff --git a/buildbot/buildbot_run.py b/buildbot/buildbot_run.py
index b20a424de53ee49fc087666a23729b76c8391a75..a9cd6e3d2d24aee8bfb7743f9ca9d2b2b0db7542 100755
--- a/buildbot/buildbot_run.py
+++ b/buildbot/buildbot_run.py
@@ -7,6 +7,7 @@
"""Argument-less script to select what to run on the buildbots."""
+import filecmp
import os
import shutil
import subprocess
@@ -82,27 +83,48 @@ def PrepareAndroidTree():
print '@@@BUILD_STEP Clobber Android checkout@@@'
shutil.rmtree(ANDROID_DIR)
- # The release of Android we use is static, so there's no need to do anything
- # if the directory already exists.
- if os.path.isdir(ANDROID_DIR):
+ # (Re)create the directory so that the following steps will succeed.
+ if not os.path.isdir(ANDROID_DIR):
+ os.mkdir(ANDROID_DIR)
+
+ # We use a manifest from the gyp project listing pinned revisions of AOSP to
+ # use, to ensure that we test against a stable target. This needs to be
+ # updated to pick up new build system changes sometimes, so we must test if
+ # it has changed.
+ manifest_filename = 'aosp_manifest.xml'
+ gyp_manifest = os.path.join(BUILDBOT_DIR, manifest_filename)
+ android_manifest = os.path.join(ANDROID_DIR, '.repo', 'manifests',
+ manifest_filename)
+ manifest_is_current = (os.path.isfile(android_manifest) and
+ filecmp.cmp(gyp_manifest, android_manifest))
+ if not manifest_is_current:
+ # It's safe to repeat these steps, so just do them again to make sure we are
+ # in a good state.
+ print '@@@BUILD_STEP Initialize Android checkout@@@'
+ CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
+ CallSubProcess(['git', 'config', '--global',
+ 'user.email', 'chrome-bot@google.com'])
+ CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
+ CallSubProcess(
+ ['repo', 'init',
+ '-u', 'https://android.googlesource.com/platform/manifest',
+ '-b', 'master',
+ '-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
+ cwd=ANDROID_DIR)
+ shutil.copy(gyp_manifest, android_manifest)
+
+ print '@@@BUILD_STEP Sync Android@@@'
+ CallSubProcess(['repo', 'sync', '-j4', '-m', manifest_filename],
+ cwd=ANDROID_DIR)
+
+ # If we already built the system image successfully and didn't sync to a new
+ # version of the source, skip running the build again as it's expensive even
+ # when there's nothing to do.
+ system_img = os.path.join(ANDROID_DIR, 'out', 'target', 'product', 'generic',
+ 'system.img')
+ if manifest_is_current and os.path.isfile(system_img):
return
- print '@@@BUILD_STEP Initialize Android checkout@@@'
- os.mkdir(ANDROID_DIR)
- CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
- CallSubProcess(['git', 'config', '--global',
- 'user.email', 'chrome-bot@google.com'])
- CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
- CallSubProcess(
- ['repo', 'init',
- '-u', 'https://android.googlesource.com/platform/manifest',
- '-b', 'android-4.2.1_r1',
- '-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
- cwd=ANDROID_DIR)
-
- print '@@@BUILD_STEP Sync Android@@@'
- CallSubProcess(['repo', 'sync', '-j4'], cwd=ANDROID_DIR)
-
print '@@@BUILD_STEP Build Android@@@'
CallSubProcess(
['/bin/bash',
@@ -113,14 +135,13 @@ def PrepareAndroidTree():
def StartAndroidEmulator():
"""Start an android emulator from the built android tree."""
print '@@@BUILD_STEP Start Android emulator@@@'
- android_host_bin = '$ANDROID_HOST_OUT/bin'
jbudorick 2014/07/31 21:40:34 What happened here?
Torne 2014/08/01 09:57:42 The emulator is no longer built from source in cur
subprocess.Popen(
['/bin/bash', '-c',
- '%s && %s/emulator -no-window' % (_ANDROID_SETUP, android_host_bin)],
+ '%s && emulator -no-window' % _ANDROID_SETUP],
cwd=ANDROID_DIR)
CallSubProcess(
['/bin/bash', '-c',
- '%s && %s/adb wait-for-device' % (_ANDROID_SETUP, android_host_bin)],
+ '%s && adb wait-for-device' % _ANDROID_SETUP],
cwd=ANDROID_DIR)
« no previous file with comments | « buildbot/aosp_manifest.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698