72 with open(os.path.join(THIS_DIR,
'files.json'))
as f:
73 dependencies = json.load(f)
75 parser = argparse.ArgumentParser(description=
'Generate the POM file for the engine artifacts')
77 '--engine-artifact-id',
80 help=
'The artifact id. e.g. android_arm_release'
82 parser.add_argument(
'--engine-version', type=utf8, required=
True, help=
'The engine commit hash')
84 '--destination', type=utf8, required=
True, help=
'The destination directory absolute path'
87 '--include-embedding-dependencies',
89 help=
'Include the dependencies for the embedding'
92 args = parser.parse_args()
93 engine_artifact_id = args.engine_artifact_id
94 engine_version = args.engine_version
95 artifact_version =
'1.0.0-' + engine_version
96 out_file_name =
'%s.pom' % engine_artifact_id
99 if args.include_embedding_dependencies:
100 for dependency
in dependencies:
101 if not dependency[
'provides']:
104 group_id, artifact_id, version = dependency[
'maven_dependency'].split(
':')
105 pom_dependencies += POM_DEPENDENCY.format(group_id, artifact_id, version)
108 with open(os.path.join(args.destination, out_file_name),
'w')
as f:
109 f.write(POM_FILE_CONTENT.format(engine_artifact_id, artifact_version, pom_dependencies))
112 with open(os.path.join(args.destination,
'%s.maven-metadata.xml' % engine_artifact_id),
'w')
as f:
113 timestamp = datetime.datetime.utcnow().strftime(
"%Y%m%d.%H%M%S")
114 f.write(MAVEN_METADATA_CONTENT.format(engine_artifact_id, artifact_version, timestamp))