Files
NeitzelFXDesigner/scripts/check-view-generation.py

30 lines
1.4 KiB
Python

#!/usr/bin/env python3
"""Exercise reviewed View generation against a real module-path application."""
import argparse
import os
from pathlib import Path
import subprocess
import sys
import tempfile
ROOT = Path(__file__).resolve().parent.parent
p = argparse.ArgumentParser(description=__doc__)
p.add_argument('--java-home', type=Path, required=True)
p.add_argument('--target-java-home', type=Path, required=True)
args = p.parse_args()
classpath = os.pathsep.join([
str(ROOT / 'designer-standalone/target/test-classes'),
str(ROOT / 'designer-standalone/target/classes'),
(ROOT / 'designer-standalone/target/smoke-classpath.txt').read_text().strip()])
with tempfile.TemporaryDirectory(prefix='designer-view-generation-') as tmp:
fixture = Path(tmp) / 'project'
subprocess.run([sys.executable, ROOT / 'scripts/prepare-fixture-host.py',
'--destination', fixture, '--mode', 'modulepath',
'--target-java-home', args.target_java_home], check=True)
subprocess.run([args.java_home / 'bin/java', '--enable-native-access=ALL-UNNAMED',
'-Ddesigner.check.generationOnly=true', '-cp', classpath,
'de.neitzel.fxdesigner.standalone.KitWorkflowSmoke',
fixture / '.neitzel-fx-designer/host.properties',
fixture / 'app/src/main/resources/fixture/components/Person.fxml',
Path(tmp) / 'unused.png'], check=True, timeout=180, cwd=ROOT)