Chromium Code Reviews| 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..e55c5e6bb53bf61d054b54922f214fc6cfdbcc02 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' |
| @@ -42,6 +43,8 @@ TARGETS = [ |
| 'webrtc/sdk/android:libwebrtc', |
| 'webrtc/sdk/android:libjingle_peerconnection_so', |
| ] |
| +GENERATE_LICENSES_SCRIPT = os.path.join( |
| + SCRIPT_DIR, '..', 'generate_licenses.py') |
| def _ParseArgs(): |
| @@ -158,6 +161,17 @@ def Collect(aar_file, tmp_dir, arch): |
| os.path.join(abi_dir, so_file)) |
| +def GenerateLicenses(output_dir, tmp_dir, archs): |
| + cmd = ['python', GENERATE_LICENSES_SCRIPT] |
| + for target in TARGETS: |
| + cmd.extend(['--target', target]) |
| + cmd.append(output_dir) |
| + for arch in archs: |
| + cmd.append(_GetOutputDirectory(tmp_dir, arch)) |
| + logging.debug('Running: %r', cmd) |
| + print cmd |
| + subprocess.check_call(cmd) |
|
kjellander_webrtc
2017/08/31 09:45:21
Ideally you'd load the common code as a Python mod
sakal
2017/08/31 14:26:58
Done.
|
| + |
| def main(): |
| args = _ParseArgs() |
| logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO) |
| @@ -173,6 +187,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) |