From 53018f41ebbe9baf992981c88cedea81c0331241 Mon Sep 17 00:00:00 2001 From: Nick Anthony Date: Mon, 18 Mar 2019 19:08:21 -0400 Subject: Change removal of aar to only check pom files in androidx/ Test: ./import_release_prebuilts.py 5384517 --groups activity && git status -> See that git status is empty and new activity poms have Change-Id: I9586a31d87699598599975e08e3e3f09f7f0de5f --- import_release_prebuilts.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/import_release_prebuilts.py b/import_release_prebuilts.py index 5ad88dddca..d498531ee6 100755 --- a/import_release_prebuilts.py +++ b/import_release_prebuilts.py @@ -118,20 +118,22 @@ def fetch_and_extract(target, build_id, file, artifact_path=None): return None return extract_artifact(artifact_path) -def remove_type_aar_from_pom_files(): +def remove_type_aar_from_pom_files(repo_dir): + # Only search pom files to in print("Removing aar from the pom files...", end = '') try: # Comment out aar in our pom files # This is being done as a workaround for b/118385540 # TODO: Remove this method once https://github.com/gradle/gradle/issues/7594 is fixed - subprocess.check_output("find -name *.pom | xargs sed 's|^ aar$| |' -i", shell=True) + subprocess.check_output("find " + repo_dir + " -name *.pom | xargs sed 's|^ aar$| |' -i", shell=True) except subprocess.CalledProcessError: print("failed!") print_e("FAIL: Failed to remove aar from the pom files") summary_log.append("FAILED to remove aar from the pom files") - return + return False print("Successful") summary_log.append("aar was removed from the pom files") + return True def update_new_artifacts(group_id_file_path, groupId_ver_map, artifactId_ver_map, groupId): # Finds each new library having groupId under and @@ -301,6 +303,7 @@ def update_androidx(target, build_id, local_file, update_all_prebuilts): print_e('Failed to copy and merge AndroidX repository') return False print("Copy and merge artifacts... Successful") + remove_type_aar_from_pom_files("androidx") if not args.skip_publishdocrules: if not update_publish_doc_rules(): print_e('Failed to update PublicDocRules.kt') @@ -411,6 +414,5 @@ else: if not commit_prebuilts(): sys.exit(1) commit_publish_docs_rules() -remove_type_aar_from_pom_files() print_change_summary() print("Test and check these changes before uploading to Gerrit") \ No newline at end of file -- cgit v1.2.3