summaryrefslogtreecommitdiffstats
path: root/chromium/tools
diff options
context:
space:
mode:
authorMarcin Kosiba <mkosiba@google.com>2013-04-11 11:07:29 +0100
committerMarcin Kosiba <mkosiba@google.com>2013-04-11 19:17:39 +0100
commit9533e41b4f869b9aff2402d73fcdaa34afa7f576 (patch)
treecd26ffa50c836218e545b1a7b480e8c6ccbf4f79 /chromium/tools
parent3394999544f374769e32cb564fffd125db64cc63 (diff)
downloadandroid_frameworks_webview-9533e41b4f869b9aff2402d73fcdaa34afa7f576.tar.gz
android_frameworks_webview-9533e41b4f869b9aff2402d73fcdaa34afa7f576.tar.bz2
android_frameworks_webview-9533e41b4f869b9aff2402d73fcdaa34afa7f576.zip
Change the webview_tot script to not use the merge script.
Running the ToT bot with the merge script doesn't work because of upstream forking WebKit. To mitigate the problem the build script has been changed to simply checkout the upstream tree. This is achieved by removing the existing chromium_org projects using a local manifest and checking out a full upstream tree using the git submodules flow. Change-Id: I9405e7851716f300136e80a06f71eeb83973be09
Diffstat (limited to 'chromium/tools')
-rwxr-xr-xchromium/tools/buildbot/bb_webview_tot.sh13
-rwxr-xr-xchromium/tools/buildbot/webview_buildbot_functions.sh72
-rw-r--r--chromium/tools/generate_local_manifest.py67
-rwxr-xr-xchromium/tools/sync_chromium_repos.sh23
4 files changed, 139 insertions, 36 deletions
diff --git a/chromium/tools/buildbot/bb_webview_tot.sh b/chromium/tools/buildbot/bb_webview_tot.sh
index 1015ddd..2b3ba8c 100755
--- a/chromium/tools/buildbot/bb_webview_tot.sh
+++ b/chromium/tools/buildbot/bb_webview_tot.sh
@@ -18,11 +18,18 @@
BB_INTERNAL_DIR="$(dirname ${0})"
ANDROID_SRC_ROOT="$(cd "${BB_INTERNAL_DIR}/../../../../.."; pwd)"
-BB_DIR="${ANDROID_SRC_ROOT}/external/chromium_org/build/android/buildbot"
+if [ -e ${ANDROID_SRC_ROOT}/external/chromium_tot ]; then
+ BB_DIR="${ANDROID_SRC_ROOT}/external/chromium_tot/src/build/android/buildbot"
+else
+ BB_DIR="${ANDROID_SRC_ROOT}/external/chromium_org/build/android/buildbot"
+fi
+DEPOT_TOOLS_DIR="$(dirname $(which gclient))"
+WEBVIEW_TOOLS_DIR="${ANDROID_SRC_ROOT}/frameworks/webview/chromium/tools"
. "$BB_DIR/buildbot_functions.sh"
. "$BB_INTERNAL_DIR/webview_buildbot_functions.sh"
bb_webview_baseline_setup "${ANDROID_SRC_ROOT}"
-bb_webview_smart_sync
-bb_webview_sync_and_merge
+bb_webview_remove_chromium_org
+bb_webview_sync_upstream_chromium
+bb_webview_gyp
bb_webview_build_android
diff --git a/chromium/tools/buildbot/webview_buildbot_functions.sh b/chromium/tools/buildbot/webview_buildbot_functions.sh
index 82b632f..0c081f2 100755
--- a/chromium/tools/buildbot/webview_buildbot_functions.sh
+++ b/chromium/tools/buildbot/webview_buildbot_functions.sh
@@ -24,7 +24,7 @@ function bb_webview_set_lunch_type() {
LUNCH_TYPE=""
echo "Unable to determine lunch type from: ${BUILDBOT_BUILDERNAME}"
echo "@@@STEP_FAILURE@@@"
- exit 1
+ exit 2
;;
esac
echo "Using lunch type: $LUNCH_TYPE"
@@ -39,7 +39,9 @@ function bb_webview_build_android() {
MAKE_COMMAND="${GOMA_DIR}/goma-android-make"
fi
- bb_run_step $MAKE_COMMAND $MAKE_PARAMS showcommands
+ MAKE_TARGET="webviewchromium"
+
+ bb_run_step $MAKE_COMMAND $MAKE_PARAMS showcommands $MAKE_TARGET
if [ "$USE_GOMA" -eq 1 ]; then
bb_stop_goma_internal
@@ -100,16 +102,66 @@ function bb_webview_baseline_setup {
function bb_webview_smart_sync {
echo "@@@BUILD_STEP Smart Sync (sync -s) @@@"
bb_run_step repo sync -s -j8 -df
+
+ # We always want to roll with the latest code in this project, regardless of
+ # what smartsync thinks.
+ echo "@@@BUILD_STEP Sync frameworks/webview@@@"
+ repo sync frameworks/webview
+}
+
+function bb_webview_remove_chromium_org {
+ echo "@@@BUILD_STEP Removing chromium_org project@@@"
+ # This generates a local manifest that will exclude any projects from the
+ # external/chromium_org folder.
+ bb_run_step python ${WEBVIEW_TOOLS_DIR}/generate_local_manifest.py \
+ ${ANDROID_SRC_ROOT} external/chromium_org
+ bb_webview_smart_sync
}
-function bb_webview_sync_and_merge {
- WEBVIEW_TOOLS_DIR="${ANDROID_SRC_ROOT}/frameworks/webview/chromium/tools"
+function bb_webview_sync_upstream_chromium {
+ echo "@@@BUILD_STEP Sync upstream chromium@@@"
+ local CHROMIUM_TOT_DIR=${ANDROID_SRC_ROOT}/external/chromium_tot
+ local CHROMIUM_ORG_DIR=${ANDROID_SRC_ROOT}/external/chromium_org
+ if [ ! -e ${CHROMIUM_TOT_DIR} ]; then
+ echo "No chromium_tot checkout detected. Creating new one.."
+ mkdir -p ${CHROMIUM_TOT_DIR}
+ cd ${CHROMIUM_TOT_DIR}
+
+ if [ ! -e ${CHROMIUM_ORG_DIR} ]; then
+ echo "Symlinking chromium_org to chromium_tot/src"
+ ln -s ${CHROMIUM_TOT_DIR}/src ${CHROMIUM_ORG_DIR}
+ else
+ echo "${CHROMIUM_ORG_DIR} should have been removed by local manifest."
+ echo "@@@STEP_FAILURE@@@"
+ exit 2
+ fi
+
+ # Prevent Android make recursing into this folder since we're
+ # exposing the src folder via a symlink.
+ touch ${CHROMIUM_TOT_DIR}/Android.mk
+
+ echo "Cloning chromium_tot"
+ git clone --template=${DEPOT_TOOLS_DIR}/git-templates \
+ https://chromium.googlesource.com/chromium/src.git
+ cd ${CHROMIUM_TOT_DIR}/src
+ git config target.os android
+ fi
- echo "@@@BUILD_STEP Sync Chromium Repos@@@"
- bb_run_step ${WEBVIEW_TOOLS_DIR}/sync_chromium_repos.sh
+ cd ${CHROMIUM_TOT_DIR}/src
+ echo "Updating"
+ git crup -j8 --no-hooks
+
+ # if [ -n "${BUILDBOT_REVISION}" ]; then
+ # echo "Checking out revision ${BUILDBOT_REVISION}"
+ # git checkout ${BUILDBOT_REVISION}
+ # git crsync --no-hooks
+ # fi
+ cd ${ANDROID_SRC_ROOT}
+}
- echo "@@@BUILD_STEP Merge from Chromium@@@"
- bb_run_step python ${WEBVIEW_TOOLS_DIR}/merge_from_chromium.py \
- --unattended \
- --svn_revision=HEAD
+function bb_webview_gyp {
+ echo "@@@BUILD_STEP Run gyp_webview@@@"
+ cd ${ANDROID_SRC_ROOT}/external/chromium_org
+ bb_run_step "./android_webview/tools/gyp_webview"
+ cd ${ANDROID_SRC_ROOT}
}
diff --git a/chromium/tools/generate_local_manifest.py b/chromium/tools/generate_local_manifest.py
new file mode 100644
index 0000000..13f9a9c
--- /dev/null
+++ b/chromium/tools/generate_local_manifest.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+# Copyright (c) 2013 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.
+
+"""Generate local manifest in an Android repository.
+
+This is used to generate a local manifest in an Android repository. The purpose
+of the generated manifest is to remove the set of projects that exist under a
+certain path.
+"""
+
+import os
+import sys
+import xml.etree.ElementTree as ET
+
+def createLocalManifest(manifest_path, local_manifest_path, path_to_exclude):
+ manifest_tree = ET.parse(manifest_path)
+ local_manifest_root = ET.Element('manifest')
+ for project in manifest_tree.getroot().findall('project'):
+ project_path = project.get('path')
+ project_name = project.get('name')
+ exclude_project = ((project_path != None and
+ project_path.startswith(path_to_exclude)) or
+ (project_path == None and
+ project_name.startswith(path_to_exclude)))
+ if not exclude_project:
+ continue
+ print 'Excluding project name="%s" path="%s"' % (project_name,
+ project_path)
+ remove_project = ET.SubElement(local_manifest_root, 'remove-project')
+ remove_project.set('name', project.get('name'))
+
+ local_manifest_tree = ET.ElementTree(local_manifest_root)
+ local_manifest_dir = os.path.dirname(local_manifest_path)
+ if not os.path.exists(local_manifest_dir):
+ os.makedirs(local_manifest_dir)
+ local_manifest_tree.write(local_manifest_path,
+ xml_declaration=True,
+ encoding='UTF-8',
+ method='xml')
+
+def main():
+ if len(sys.argv) < 3:
+ print 'Too few arguments.'
+ sys.exit(-1)
+
+ android_build_top = sys.argv[1]
+ path_to_exclude = sys.argv[2]
+
+ manifest_filename = 'default.xml'
+ if len(sys.argv) >= 4:
+ manifest_filename = sys.argv[3]
+
+ manifest_path = os.path.join(android_build_top, '.repo/manifests',
+ manifest_filename)
+ local_manifest_path = os.path.join(android_build_top,
+ '.repo/local_manifests/generated.xml')
+
+
+ print 'Path to exclude: %s' % path_to_exclude
+ print 'Path to manifest file: %s' % manifest_path
+ createLocalManifest(manifest_path, local_manifest_path, path_to_exclude)
+ print 'Local manifest created in: %s' % local_manifest_path
+
+if __name__ == '__main__':
+ main()
diff --git a/chromium/tools/sync_chromium_repos.sh b/chromium/tools/sync_chromium_repos.sh
deleted file mode 100755
index 075a20e..0000000
--- a/chromium/tools/sync_chromium_repos.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash -e
-
-# Copyright (C) 2012 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-repo forall -c '
- if [[ $REPO_PROJECT =~ "external/chromium_org" ]] || [[ $REPO_PROJECT =~ "frameworks/webview" ]]
- then
- echo $REPO_PROJECT
- repo sync -df .
- exit $?
- fi'