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

Unified Diff: tools_webrtc/android/build_aar.py

Issue 3011613002: License generation script for build_aar.py. (Closed)
Patch Set: Specify GN working directory. Created 3 years, 3 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 | « no previous file | tools_webrtc/ios/build_ios_libs.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools_webrtc/android/build_aar.py
diff --git a/tools_webrtc/android/build_aar.py b/tools_webrtc/android/build_aar.py
index 54272e979e446c25de831aa36f24624ed335976f..50f1ff4e7cd24f28a8412e82a8b49a64d1f028a1 100755
--- a/tools_webrtc/android/build_aar.py
+++ b/tools_webrtc/android/build_aar.py
@@ -34,6 +34,7 @@ import tempfile
import zipfile
+SCRIPT_DIR = os.path.dirname(os.path.realpath(sys.argv[0]))
DEFAULT_ARCHS = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64']
NEEDED_SO_FILES = ['libjingle_peerconnection_so.so']
JAR_FILE = 'lib.java/webrtc/sdk/android/libwebrtc.jar'
@@ -43,6 +44,9 @@ TARGETS = [
'webrtc/sdk/android:libjingle_peerconnection_so',
]
+sys.path.append(os.path.join(SCRIPT_DIR, '..', 'libs'))
+from generate_licenses import LicenseBuilder
+
def _ParseArgs():
parser = argparse.ArgumentParser(description='libwebrtc.aar generator.')
@@ -122,6 +126,7 @@ def Build(tmp_dir, arch, use_goma, extra_gn_args):
'target_os': 'android',
'is_debug': False,
'is_component_build': False,
+ 'rtc_include_tests': False,
'target_cpu': _GetTargetCpu(arch),
'use_goma': use_goma
}
@@ -133,7 +138,7 @@ def Build(tmp_dir, arch, use_goma, extra_gn_args):
_RunGN(['gen', output_directory, gn_args_str])
- ninja_args = TARGETS
+ ninja_args = TARGETS[:]
if use_goma:
ninja_args.extend(['-j', '200'])
_RunNinja(output_directory, ninja_args)
@@ -158,6 +163,12 @@ def Collect(aar_file, tmp_dir, arch):
os.path.join(abi_dir, so_file))
+def GenerateLicenses(output_dir, tmp_dir, archs):
+ builder = LicenseBuilder(
+ [_GetOutputDirectory(tmp_dir, arch) for arch in archs], TARGETS)
+ builder.GenerateLicenseText(output_dir)
+
+
def main():
args = _ParseArgs()
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
@@ -173,6 +184,9 @@ def main():
for arch in args.arch:
Collect(aar_file, tmp_dir, arch)
+ license_dir = os.path.dirname(os.path.realpath(args.output))
+ GenerateLicenses(license_dir, tmp_dir, args.arch)
+
shutil.rmtree(tmp_dir, True)
« no previous file with comments | « no previous file | tools_webrtc/ios/build_ios_libs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698