Skip to content

Commit e1a00d5

Browse files
committed
when generating polyglot app with -m standalone polyglot_app:
- pass also graalpy version to archetype call - do not check if output dir exists, mvn does so anyway
1 parent fffa889 commit e1a00d5

File tree

1 file changed

+6
-12
lines changed
  • graalpython/lib-graalpython/modules/standalone

1 file changed

+6
-12
lines changed

graalpython/lib-graalpython/modules/standalone/__main__.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,12 @@ def create_polyglot_app(parsed_args):
116116
)
117117
exit(1)
118118

119-
if os.path.exists(os.path.abspath(parsed_args.output_directory)):
120-
print(
121-
"Output directory already exists.",
122-
sep="\n",
123-
)
124-
exit(1)
125-
126119
target_dir = parsed_args.output_directory if parsed_args.output_directory else os.getcwd()
127120
if parsed_args.verbose:
128121
print(f"Creating polyglot java python application in directory {target_dir}")
129122

130-
cmd = ["mvn", "archetype:generate", "-DarchetypeGroupId=org.graalvm.python", "-DarchetypeArtifactId=graalpy-archetype-polyglot-app"]
123+
cmd = ["mvn", "archetype:generate", "-B", "-DarchetypeGroupId=org.graalvm.python", "-DarchetypeArtifactId=graalpy-archetype-polyglot-app"]
124+
cmd += [f"-DarchetypeVersion={MVN_GRAALPY_VERSION}"]
131125
cmd += [f"-DgroupId={parsed_args.group_id}"]
132126
cmd += [f"-DartifactId={parsed_args.artifact_id}"]
133127
cmd += ["-Dversion=1.0-SNAPSHOT" if parsed_args.version else f"-Dversion={parsed_args.version}"]
@@ -476,27 +470,27 @@ def main(args):
476470
CMD_JAVA_PYTHON_APP,
477471
help="Create a polyglot Java-Python maven project skeleton preconfigured to build native binaries.",
478472
)
479-
473+
480474
parser_app.add_argument(
481475
"-g",
482476
"--group-id",
483477
help="The created maven project group id.",
484478
required=True,
485479
)
486-
480+
487481
parser_app.add_argument(
488482
"-a",
489483
"--artifact-id",
490484
help="The created maven project artifact id.",
491485
required=True,
492486
)
493-
487+
494488
parser_app.add_argument(
495489
"-v",
496490
"--version",
497491
help="The created maven project version.",
498492
)
499-
493+
500494
parser_app.add_argument(
501495
"-o",
502496
"--output-directory",

0 commit comments

Comments
 (0)