From cb893ee6346f27e7e660578c802bbe455fcf9102 Mon Sep 17 00:00:00 2001 From: mbonadei Date: Mon, 23 Jan 2017 08:49:12 -0800 Subject: [PATCH] Removing unused code from webrtc/build First step in moving the content of webrtc/build up one level. BUG=webrtc:7030 Review-Url: https://codereview.webrtc.org/2653593003 Cr-Commit-Position: refs/heads/master@{#16219} --- webrtc/build/generate_srcjar.py | 68 ------------------- webrtc/build/google_play_services_download.py | 43 ------------ webrtc/build/no_op.cc | 14 ---- 3 files changed, 125 deletions(-) delete mode 100755 webrtc/build/generate_srcjar.py delete mode 100755 webrtc/build/google_play_services_download.py delete mode 100644 webrtc/build/no_op.cc diff --git a/webrtc/build/generate_srcjar.py b/webrtc/build/generate_srcjar.py deleted file mode 100755 index 946722ad5e..0000000000 --- a/webrtc/build/generate_srcjar.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python -# -# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. - -# TODO(mbonadei): move this script into chromium (build/android/gyp) -# when approved - -import optparse -import os -import re -import sys -import zipfile - -sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, os.pardir, 'build', - 'android', 'gyp', 'util'))) -import build_utils - - -def PackageToPath(src_file): - """Returns the path of a .java file according to the package declaration. - - Example: - src_file='/home/foo/bar/org/android/TestClass.java' - With the following package definition: - package org.android; - - It will return 'org/android'. - - Args: - A string with the path of the .java source file to analyze. - - Returns: - A string with the translation of the package definition into a path. - """ - with open(src_file) as f: - file_src = f.read() - package = re.search('package (.*);', file_src).group(1) - zip_folder = package.replace('.', os.path.sep) - file_name = os.path.basename(src_file) - return os.path.join(zip_folder, file_name) - - -def DoMain(argv): - usage = 'usage: %prog [options] input_file(s)...' - parser = optparse.OptionParser(usage=usage) - parser.add_option('-s', '--srcjar', - help='The path where the .srcjar file will be generated') - - options, args = parser.parse_args(argv) - - if not args: - parser.error('Need to specify at least one input source file (.java)') - input_paths = args - - with zipfile.ZipFile(options.srcjar, 'w', zipfile.ZIP_STORED) as srcjar: - for src_path in input_paths: - zip_path = PackageToPath(src_path) - build_utils.AddToZipHermetic(srcjar, zip_path, src_path) - - -if __name__ == '__main__': - DoMain(sys.argv[1:]) diff --git a/webrtc/build/google_play_services_download.py b/webrtc/build/google_play_services_download.py deleted file mode 100755 index bdd7c70dac..0000000000 --- a/webrtc/build/google_play_services_download.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. - -"""Script to download the Google Play Services SDK without its license prompt. - -This script needs to run after Chromium has been cloned and the link to //build -has been created. -""" - -import os -import subprocess -import sys - - -ROOT_DIR = os.path.abspath(os.path.join( - os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir)) -CR_DIR = os.path.join(ROOT_DIR, 'chromium') - - -def main(): - # Workaround to avoid license prompt for Google Play Services SDK - # See https://bugs.webrtc.org/5578 for more details. - play_services_script = os.path.join(CR_DIR, 'src', 'build', 'android', - 'play_services', 'update.py') - if os.path.isfile(play_services_script): - env = os.environ.copy() - - # Fake we're a buildbot to avoid the Google Play Services license prompt. - env['CHROME_HEADLESS'] = '1' - subprocess.check_call([sys.executable, play_services_script, 'download'], - env=env) - else: - print 'Cannot find %s, skipping.' % play_services_script - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/webrtc/build/no_op.cc b/webrtc/build/no_op.cc deleted file mode 100644 index 7508b9dbb4..0000000000 --- a/webrtc/build/no_op.cc +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -// No-op main() to provide a dummy executable target. -int main() { - return 0; -}