Skip to content

Commit

Permalink
Switch Android binary deps to be managed by CIPD.
Browse files Browse the repository at this point in the history
Removing b/a/update_deps/update_third_party_deps.py script.
Replacing with a simple CIPD wrapper script.

Adding ensure files for all each target_os (this is a file used to
describe the package you want to download). Initially, this is just
Android.

Adding cipd.yaml files for all deps (this file was used to
create the CIPD packages), and can be modified/used in the future
to update these deps.

CIPD gives us the advantage of having a consistent method of
downloading/managing our binary dependencies. The goal is to move
as much as possible from adhoc scripts over to CIPD. CIPD does
various nice things, such as verifying the integrity of the fetched
binary and doing smart caching. What our adhoc scripts do currently
is very inconsistent.

Bug: 
Change-Id: Iccf7defe80c8548e6929d994595e841aa4668c92
Reviewed-on: https://chromium-review.googlesource.com/544524
Commit-Queue: Michael Case <mikecase@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Reviewed-by: Grace Kloba <klobag@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494588}
  • Loading branch information
Mike Case authored and Commit Bot committed Aug 15, 2017
1 parent 6f98d62 commit a4e8c9b
Show file tree
Hide file tree
Showing 89 changed files with 360 additions and 591 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
!Android.mk
.*.sw?
.DS_Store
.cipd
.classpath
.cproject
.gdb_history
Expand Down
198 changes: 8 additions & 190 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -953,199 +953,17 @@ hooks_os = {
],
},
{
'name': 'android_system_sdk',
'name': 'Android CIPD Ensure',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'android_system_stubs',
'-l', 'third_party/android_system_sdk'
],
},
{
'name': 'intellij',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-intellij',
'-l', 'third_party/intellij'
],
},
{
'name': 'javax_inject',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-javax-inject',
'-l', 'third_party/javax_inject'
],
},
{
'name': 'hamcrest',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-hamcrest',
'-l', 'third_party/hamcrest'
],
},
{
'name': 'guava',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-guava',
'-l', 'third_party/guava'
],
},
{
'name': 'android_support_test_runner',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-android-support-test-runner',
'-l', 'third_party/android_support_test_runner'
],
},
{
'name': 'byte_buddy',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-byte-buddy',
'-l', 'third_party/byte_buddy'
],
},
{
'name': 'espresso',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-espresso',
'-l', 'third_party/espresso'
],
},
{
'name': 'robolectric_libs',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-robolectric',
'-l', 'third_party/robolectric'
],
},
{
'name': 'apache_velocity',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-apache-velocity',
'-l', 'third_party/apache_velocity'
],
},
{
'name': 'ow2_asm',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-ow2-asm',
'-l', 'third_party/ow2_asm'
],
},
{
'name': 'desugar',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-android-tools/bazel/desugar',
'-l', 'third_party/bazel/desugar'
],
},
{
'name': 'apk-patch-size-estimator',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-android-tools/apk-patch-size-estimator',
'-l', 'third_party/apk-patch-size-estimator/lib'
],
},
{
'name': 'icu4j',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-icu4j',
'-l', 'third_party/icu4j'
],
},
{
'name': 'accessibility_test_framework',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-accessibility-test-framework',
'-l', 'third_party/accessibility_test_framework'
],
},
{
'name': 'bouncycastle',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-bouncycastle',
'-l', 'third_party/bouncycastle'
],
},
{
'name': 'sqlite4java',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-sqlite4java',
'-l', 'third_party/sqlite4java'
],
},
{
'name': 'objenesis',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-objenesis',
'-l', 'third_party/objenesis'
],
},
{
'name': 'xstream',
'pattern': '.',
'action': ['python',
'src/build/android/update_deps/update_third_party_deps.py',
'download',
'-b', 'chromium-robolectric',
'-l', 'third_party/xstream'
'action': ['src/build/cipd/cipd_wrapper.py',
'--chromium-root', 'src',
'--target-os', 'android',
],
},
{
'name': 'gvr_static_shim_android_arm',
'pattern': '\\.sha1',
'action': [ 'python',
'action': [ 'python',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--platform=linux*',
Expand All @@ -1157,7 +975,7 @@ hooks_os = {
{
'name': 'gvr_static_shim_android_arm64',
'pattern': '\\.sha1',
'action': [ 'python',
'action': [ 'python',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--platform=linux*',
Expand All @@ -1169,7 +987,7 @@ hooks_os = {
{
'name': 'gvr_common_aar',
'pattern': '\\.sha1',
'action': [ 'python',
'action': [ 'python',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--platform=linux*',
Expand All @@ -1181,7 +999,7 @@ hooks_os = {
{
'name': 'vr_controller_test_api',
'pattern': '\\.sha1',
'action': [ 'python',
'action': [ 'python',
'src/third_party/depot_tools/download_from_google_storage.py',
'--no_resume',
'--platform=linux*',
Expand Down
5 changes: 5 additions & 0 deletions build/android/gyp/copy_ex.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def CopyFile(f, dest, deps):
shutil.copytree(f, os.path.join(dest, os.path.basename(f)))
deps.extend(_get_all_files(f))
else:
if os.path.exists(dest):
if os.path.isfile(dest):
os.remove(dest)
elif os.path.isfile(os.path.join(dest, os.path.basename(f))):
os.remove(os.path.join(dest, os.path.basename(f)))
shutil.copy(f, dest)
deps.append(f)

Expand Down
9 changes: 5 additions & 4 deletions build/android/gyp/jar.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def Jar(class_files, classes_dir, jar_path, manifest_file=None,

for filepath, jar_filepath in additional_files or []:
full_jar_filepath = os.path.join(jar_cwd, jar_filepath)
jar_dir = os.path.dirname(full_jar_filepath)
if not os.path.exists(jar_dir):
os.makedirs(jar_dir)
shutil.copy(filepath, full_jar_filepath)
if not os.path.exists(full_jar_filepath):
jar_dir = os.path.dirname(full_jar_filepath)
if not os.path.exists(jar_dir):
os.makedirs(jar_dir)
shutil.copy(filepath, full_jar_filepath)
jar_cmd.append(jar_filepath)

if provider_configurations:
Expand Down
Loading

0 comments on commit a4e8c9b

Please sign in to comment.