Edit form controls and render localized application previews in the IntelliJ designer
This commit is contained in:
@@ -19,7 +19,10 @@ p.add_argument("--idea-home", type=Path)
|
||||
p.add_argument("--check", action="store_true", help="Install the disposable IDE qualification companion")
|
||||
p.add_argument("--mode", choices=["classpath","modulepath"], default="classpath")
|
||||
p.add_argument("--archiver", type=Path, help="Use a disposable copy of the Archiver project")
|
||||
p.add_argument("--connection-form", action="store_true", help="Open and qualify the Archiver connection form")
|
||||
args = p.parse_args()
|
||||
if args.connection_form and not args.archiver:
|
||||
p.error("--connection-form requires --archiver")
|
||||
base = Path(tempfile.mkdtemp(prefix="neitzel-designer-host-")).resolve()
|
||||
project = base / "project"
|
||||
if args.archiver:
|
||||
@@ -28,7 +31,8 @@ if args.archiver:
|
||||
shutil.copytree(args.archiver, project, ignore=shutil.ignore_patterns(".git", ".idea", "target", ".neitzel-fx-designer"))
|
||||
subprocess.run([sys.executable, ROOT / "scripts/configure-library-example.py", "--project", project,
|
||||
"--target-java-home", args.target_java_home], check=True)
|
||||
file = project / "src/main/resources/de/neitzel/archiver/ui/ArchiveWindow.fxml"
|
||||
view = "ConnectionForm" if args.connection_form else "ArchiveWindow"
|
||||
file = project / f"src/main/resources/de/neitzel/archiver/ui/{view}.fxml"
|
||||
else:
|
||||
subprocess.run([sys.executable, ROOT / "scripts/prepare-fixture-host.py", "--destination", project,
|
||||
"--target-java-home", args.target_java_home, "--mode", args.mode], check=True)
|
||||
@@ -55,16 +59,19 @@ else:
|
||||
jars = [*(args.idea_home / "lib").glob("*.jar"), *(base / "plugins").rglob("*.jar"), *(args.idea_home / "plugins/platform-problemView-plugin").rglob("*.jar")]
|
||||
sources = ROOT / "integration-tests/idea"
|
||||
probe = "ArchiveWorkflowProbe" if args.archiver else "WorkflowProbe"
|
||||
if args.connection_form:
|
||||
probe = "ConnectionWorkflowProbe"
|
||||
files = [sources / "WorkflowProbe.java"]
|
||||
if args.archiver:
|
||||
files.append(sources / "ArchiveWorkflowProbe.java")
|
||||
files.append(sources / f"{probe}.java")
|
||||
target_probe = "ConnectionTargetProbe" if args.connection_form else "ArchiveTargetProbe"
|
||||
agent_classes = base / "agent-classes"
|
||||
agent_classes.mkdir()
|
||||
subprocess.run([args.java_home / "bin/javac", "-cp", os.pathsep.join(map(str,jars)), "-d", agent_classes,
|
||||
sources / "ArchiveTargetProbe.java"], check=True)
|
||||
sources / f"{target_probe}.java"], check=True)
|
||||
agent = base / "archiver-ui-check.jar"
|
||||
with zipfile.ZipFile(agent, "w") as archive:
|
||||
archive.writestr("META-INF/MANIFEST.MF", "Manifest-Version: 1.0\nPremain-Class: qualification.ArchiveTargetProbe\n\n")
|
||||
archive.writestr("META-INF/MANIFEST.MF", f"Manifest-Version: 1.0\nPremain-Class: qualification.{target_probe}\n\n")
|
||||
for item in agent_classes.rglob("*.class"):
|
||||
archive.write(item, item.relative_to(agent_classes))
|
||||
env["JAVA_TOOL_OPTIONS"] = env.get("JAVA_TOOL_OPTIONS", "") + f' "-javaagent:{agent}={base}"'
|
||||
|
||||
Reference in New Issue
Block a user