diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 29f204fd82dcc..e19b2ee155fad 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -402,7 +402,10 @@ action("pom_libflutter") { artifact_id = string_replace(android_app_abi, "-", "_") + "_" + flutter_runtime_mode - outputs = [ "$root_build_dir/$artifact_id.pom" ] + outputs = [ + "$root_build_dir/$artifact_id.pom", + "$root_build_dir/$artifact_id.maven-metadata.xml", + ] args = [ "--destination", @@ -421,7 +424,10 @@ action("pom_embedding") { artifact_id = "flutter_embedding_$flutter_runtime_mode" - outputs = [ "$root_build_dir/$artifact_id.pom" ] + outputs = [ + "$root_build_dir/$artifact_id.pom", + "$root_build_dir/$artifact_id.maven-metadata.xml", + ] args = [ "--destination", diff --git a/tools/androidx/generate_pom_file.py b/tools/androidx/generate_pom_file.py index 9611ee4d4f531..b2cd3deac37de 100644 --- a/tools/androidx/generate_pom_file.py +++ b/tools/androidx/generate_pom_file.py @@ -4,6 +4,7 @@ # found in the LICENSE file. import argparse +import datetime import os import sys import json @@ -34,6 +35,33 @@ ''' +MAVEN_METADATA_CONTENT =''' + + io.flutter + {0} + {1} + + + {1} + + + {2} + 0 + + + + jar + {1} + + + pom + {1} + + + + +''' + def main(): with open (os.path.join(THIS_DIR, 'files.json')) as f: dependencies = json.load(f) @@ -67,5 +95,10 @@ def main(): with open(os.path.join(args.destination, out_file_name), 'w') as f: f.write(POM_FILE_CONTENT.format(engine_artifact_id, artifact_version, pom_dependencies)) + # Write the Maven metadata file. + with open(os.path.join(args.destination, '%s.maven-metadata.xml' % engine_artifact_id), 'w') as f: + timestamp = datetime.datetime.utcnow().strftime("%Y%m%d.%H%M%S") + f.write(MAVEN_METADATA_CONTENT.format(engine_artifact_id, artifact_version, timestamp)) + if __name__ == '__main__': sys.exit(main())