Script for publishing WebRTC AAR on Bintray.

Bintray is a service for hosting repositories. It is widely used to
serve precompiled Android binaries because of the integration with
JCenter. This script uploads a precompiled WebRTC Android library to
a Bintray repository.

Bug: webrtc:8182
Change-Id: I7be04cea59827e28470acd934f6e09fc3abe2a72
Reviewed-on: https://webrtc-review.googlesource.com/4441
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20168}
This commit is contained in:
Sami Kalliomäki
2017-10-05 16:15:02 +02:00
committed by Commit Bot
parent e2d6a06fa8
commit dbb15a7ce2
4 changed files with 201 additions and 16 deletions

View File

@ -171,26 +171,33 @@ def GenerateLicenses(output_dir, build_dir, archs):
builder.GenerateLicenseText(output_dir)
def BuildAar(archs, output_file, use_goma=False, extra_gn_args=None,
ext_build_dir=None):
extra_gn_args = extra_gn_args or []
build_dir = ext_build_dir if ext_build_dir else tempfile.mkdtemp()
for arch in archs:
Build(build_dir, arch, use_goma, extra_gn_args)
with zipfile.ZipFile(output_file, 'w') as aar_file:
# Architecture doesn't matter here, arbitrarily using the first one.
CollectCommon(aar_file, build_dir, archs[0])
for arch in archs:
Collect(aar_file, build_dir, arch)
license_dir = os.path.dirname(os.path.realpath(output_file))
GenerateLicenses(license_dir, build_dir, archs)
if not ext_build_dir:
shutil.rmtree(build_dir, True)
def main():
args = _ParseArgs()
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
build_dir = args.build_dir if args.build_dir else tempfile.mkdtemp()
for arch in args.arch:
Build(build_dir, arch, args.use_goma, args.extra_gn_args)
with zipfile.ZipFile(args.output, 'w') as aar_file:
# Architecture doesn't matter here, arbitrarily using the first one.
CollectCommon(aar_file, build_dir, args.arch[0])
for arch in args.arch:
Collect(aar_file, build_dir, arch)
license_dir = os.path.dirname(os.path.realpath(args.output))
GenerateLicenses(license_dir, build_dir, args.arch)
if not args.build_dir:
shutil.rmtree(build_dir, True)
BuildAar(args.arch, args.output, args.use_goma, args.extra_gn_args,
args.build_dir)
if __name__ == '__main__':