Edit and exercise Archiver CommandBindings in the IntelliJ designer
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Create ignored local launch settings for NeitzelLib's checked-in fx-example context."""
|
||||
"""Create ignored local launch settings for a project with a checked-in Designer context."""
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
@@ -7,7 +7,7 @@ from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--library", type=Path, required=True)
|
||||
parser.add_argument("--library", "--project", type=Path, required=True)
|
||||
parser.add_argument("--target-java-home", type=Path, required=True)
|
||||
parser.add_argument("--maven", type=Path, default=ROOT / "mvnw")
|
||||
args = parser.parse_args()
|
||||
@@ -15,7 +15,11 @@ library = args.library.resolve()
|
||||
java = args.target_java_home.resolve()
|
||||
maven = args.maven.resolve()
|
||||
if not (library / "neitzel-fx-designer.json").is_file():
|
||||
parser.error("Library checkout has no designer configuration")
|
||||
parser.error("Project has no designer configuration")
|
||||
contexts = json.loads((library / "neitzel-fx-designer.json").read_text())["contexts"]
|
||||
if len(contexts) != 1:
|
||||
parser.error("Expected a single example context")
|
||||
context = next(iter(contexts))
|
||||
if not all((java / "bin" / name).is_file() for name in ("java", "javac")):
|
||||
parser.error("Supply a full application JDK installation")
|
||||
if not maven.is_file() or not os.access(maven, os.X_OK):
|
||||
@@ -50,7 +54,7 @@ def prop(value):
|
||||
|
||||
|
||||
with launch.open("x", encoding="ascii") as file:
|
||||
file.write("configuration=../neitzel-fx-designer.json\ncontext=person-desk\n"
|
||||
file.write(f"configuration=../neitzel-fx-designer.json\ncontext={context}\n"
|
||||
"settings=runtimes.json\nmaven=" + prop(maven) + "\ntools="
|
||||
+ os.pathsep.join(map(prop, tools)) + "\n")
|
||||
print(settings)
|
||||
|
||||
Reference in New Issue
Block a user