Skip to content

Commit

Permalink
Android APK tests built from a normal WebRTC checkout.
Browse files Browse the repository at this point in the history
Restructure how the Android APK tests are compiled now
that we have a Chromium checkout available (since r6938).

This removes the need of several hacks that were needed when
building these targets from inside a Chromium checkout.
By creating a symlink to Chromium's base we can compile the required
targets. This also removes the need of the previously precompiled
binaries we keep in /deps/tools/android at Google code.

All the user needs to do is to add the target_os = ["android"]
entry to his .gclient as described at
https://code.google.com/p/chromium/wiki/AndroidBuildInstructions

Before committing this CL, the Android APK buildbots will need
to be updated.
This also solves http://crbug.com/402594 since the apply_svn_patch.py
usage will be similar to the other standalone bots.
It also solves http://crbug.com/399297

BUG=chromium:399297, chromium:402594
TESTED=Locally compiled all APK targets by running:
GYP_DEFINES="OS=android include_tests=1 enable_tracing=1" gclient runhooks
ninja -C out/Release

checkdeps

R=henrike@webrtc.org, tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/22149004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7014 4adac7df-926f-26a2-2b94-8c16560cd09d
  • Loading branch information
kjellander@webrtc.org committed Sep 1, 2014
1 parent c4870bb commit 3bd4156
Show file tree
Hide file tree
Showing 20 changed files with 243 additions and 424 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
.settings
.sw?
/Makefile
/base
/build
/buildtools
/chromium/.gclient.bot
Expand Down Expand Up @@ -94,8 +95,8 @@
/third_party/valgrind
/third_party/winsdk_samples/src
/third_party/yasm
/third_party/zlib
/tools/android
/tools/android-dummy-test
/tools/clang
/tools/find_depot_tools.py
/tools/generate_library_loader
Expand Down
13 changes: 6 additions & 7 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,14 @@ deps_os = {
"third_party/winsdk_samples/src":
(Var("googlecode_url") % "webrtc") + "/deps/third_party/winsdk_samples_v71@3145",
},

"android": {
# Precompiled tools needed for Android test execution. Needed since we can't
# compile them from source in WebRTC since they depend on Chromium's base.
"tools/android":
(Var("googlecode_url") % "webrtc") + "/deps/tools/android@6306",
},
}

include_rules = [
# Base is only used to build Android APK tests and may not be referenced by
# WebRTC production code.
"-base",
]

hooks = [
{
# Clone chromium and its deps.
Expand Down
56 changes: 56 additions & 0 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# be found in the AUTHORS file in the root of the source tree.

import re
import sys


def _CheckNoIOStreamInHeaders(input_api, output_api):
Expand Down Expand Up @@ -112,6 +113,60 @@ def _CheckGypChanges(input_api, output_api):
items=gyp_files))
return result

def _CheckUnwantedDependencies(input_api, output_api):
"""Runs checkdeps on #include statements added in this
change. Breaking - rules is an error, breaking ! rules is a
warning.
"""
# Copied from Chromium's src/PRESUBMIT.py.

# We need to wait until we have an input_api object and use this
# roundabout construct to import checkdeps because this file is
# eval-ed and thus doesn't have __file__.
original_sys_path = sys.path
try:
sys.path = sys.path + [input_api.os_path.join(
input_api.PresubmitLocalPath(), 'buildtools', 'checkdeps')]
import checkdeps
from cpp_checker import CppChecker
from rules import Rule
finally:
# Restore sys.path to what it was before.
sys.path = original_sys_path

added_includes = []
for f in input_api.AffectedFiles():
if not CppChecker.IsCppFile(f.LocalPath()):
continue

changed_lines = [line for _line_num, line in f.ChangedContents()]
added_includes.append([f.LocalPath(), changed_lines])

deps_checker = checkdeps.DepsChecker(input_api.PresubmitLocalPath())

error_descriptions = []
warning_descriptions = []
for path, rule_type, rule_description in deps_checker.CheckAddedCppIncludes(
added_includes):
description_with_path = '%s\n %s' % (path, rule_description)
if rule_type == Rule.DISALLOW:
error_descriptions.append(description_with_path)
else:
warning_descriptions.append(description_with_path)

results = []
if error_descriptions:
results.append(output_api.PresubmitError(
'You added one or more #includes that violate checkdeps rules.',
error_descriptions))
if warning_descriptions:
results.append(output_api.PresubmitPromptOrNotify(
'You added one or more #includes of files that are temporarily\n'
'allowed but being removed. Can you avoid introducing the\n'
'#include? See relevant DEPS file(s) for details and contacts.',
warning_descriptions))
return results


def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
Expand Down Expand Up @@ -160,6 +215,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckNoIOStreamInHeaders(input_api, output_api))
results.extend(_CheckNoFRIEND_TEST(input_api, output_api))
results.extend(_CheckGypChanges(input_api, output_api))
results.extend(_CheckUnwantedDependencies(input_api, output_api))
return results


Expand Down
12 changes: 10 additions & 2 deletions setup_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
'google_apis', # Needed by build/common.gypi.
'net',
'testing',
'third_party/android_testrunner',
'third_party/android_tools',
'third_party/binutils',
'third_party/boringssl',
'third_party/colorama',
Expand All @@ -62,6 +60,7 @@
'third_party/syzygy',
'third_party/usrsctp',
'third_party/yasm',
'third_party/zlib',
'tools/clang',
'tools/generate_library_loader',
'tools/gn',
Expand All @@ -74,6 +73,15 @@
'tools/win',
]

from sync_chromium import get_target_os_list
if 'android' in get_target_os_list():
DIRECTORIES += [
'base',
'third_party/android_testrunner',
'third_party/android_tools',
'tools/android',
]

FILES = {
'.gn': None,
'tools/find_depot_tools.py': None,
Expand Down
235 changes: 0 additions & 235 deletions webrtc/build/apk_tests.gyp

This file was deleted.

Loading

0 comments on commit 3bd4156

Please sign in to comment.