Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Maven dependency in files.json #10719

Merged
merged 11 commits into from
Aug 9, 2019
9 changes: 6 additions & 3 deletions tools/android_support/download_android_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def GetInstalledVersion(out_file_name):
with open(version_file) as f:
return f.read().strip()

def getFile(url, out_file_name):
def getFile(entry):
url = entry['url']
out_file_name = entry['out_file_name']

# Read latest version.
if url == GetInstalledVersion(out_file_name):
return
Expand All @@ -48,8 +51,8 @@ def main():
with open (os.path.join(THIS_DIR, 'files.json')) as f:
files = json.load(f)

for file, url in files.items():
getFile(url, file)
for entry in files:
getFile(entry)

if __name__ == '__main__':
sys.exit(main())
52 changes: 42 additions & 10 deletions tools/android_support/files.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
{
"android_arch_lifecycle_common.jar": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/common/1.1.1/common-1.1.1.jar",
"android_arch_lifecycle_common_java8.jar": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/common-java8/1.1.1/common-java8-1.1.1.jar",
"android_arch_lifecycle_runtime.jar": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/runtime/1.1.1/runtime-1.1.1.aar",
"android_arch_lifecycle_viewmodel.jar": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/viewmodel/1.1.1/viewmodel-1.1.1.aar",
"android_support_fragment.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/28.0.0/support-fragment-28.0.0.aar",
"android_support_v13.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-v13/28.0.0/support-v13-28.0.0.aar",
"android_support_annotations.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/28.0.0/support-annotations-28.0.0.jar",
"android_support_compat.jar": "https://dl.google.com/dl/android/maven2/com/android/support/support-compat/28.0.0/support-compat-28.0.0.aar"
}
[
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I think long term we wanted these moved to CIPD instead of here. I may be remembering wrong, I thought I saw an issue from @dnfield about this but couldn't find it now. Either way this is fine for this patch though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be preferable to create CIPD packages for these and avoid using this script any further.

"url": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/common/1.1.1/common-1.1.1.jar",
"out_file_name": "android_arch_lifecycle_common.jar",
"maven_dependency": "android.arch.lifecycle:common:1.1.1"
},
{
"url": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/common-java8/1.1.1/common-java8-1.1.1.jar",
"out_file_name": "android_arch_lifecycle_common_java8.jar",
"maven_dependency": "android.arch.lifecycle:common-java8:1.1.1"
},
{
"url": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/runtime/1.1.1/runtime-1.1.1.aar",
"out_file_name": "android_arch_lifecycle_runtime.jar",
"maven_dependency": "android.arch.lifecycle:runtime:1.1.1"
},
{
"url": "https://dl.google.com/dl/android/maven2/android/arch/lifecycle/viewmodel/1.1.1/viewmodel-1.1.1.aar",
"out_file_name": "android_arch_lifecycle_viewmodel.jar",
"maven_dependency": "android.arch.lifecycle:viewmodel:1.1.1"
},
{
"url": "https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/28.0.0/support-fragment-28.0.0.aar",
"out_file_name": "android_support_fragment.jar",
"maven_dependency": "com.android.support:support-fragment:28.0.0"
},
{
"url": "https://dl.google.com/dl/android/maven2/com/android/support/support-v13/28.0.0/support-v13-28.0.0.aar",
"out_file_name": "android_support_v13.jar",
"maven_dependency": "com.android.support:support-v13:28.0.0"
},
{
"url": "https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/28.0.0/support-annotations-28.0.0.jar",
"out_file_name": "android_support_annotations.jar",
"maven_dependency": "com.android.support:support-annotations:28.0.0"
},
{
"url": "https://dl.google.com/dl/android/maven2/com/android/support/support-compat/28.0.0/support-compat-28.0.0.aar",
"out_file_name": "android_support_compat.jar",
"maven_dependency": "com.android.support:support-compat:28.0.0"
}
]