Files

24 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""Replay a real Kit corner gesture through the standalone document adapter, without a build/worker."""
import argparse
import os
from pathlib import Path
import subprocess
import sys
import tempfile
ROOT = Path(__file__).resolve().parent.parent
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--target-java-home', required=True)
args = parser.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-corner-') as temporary:
project = Path(temporary) / 'project'
subprocess.run([sys.executable, ROOT / 'scripts/prepare-fixture-host.py', '--destination', project,
'--target-java-home', args.target_java_home], cwd=ROOT, check=True, stdout=subprocess.DEVNULL)
subprocess.run([Path(os.environ['JAVA_HOME']) / 'bin/java', '--enable-native-access=ALL-UNNAMED',
'-cp', classpath, 'de.neitzel.fxdesigner.standalone.CornerResizeSmoke',
project / '.neitzel-fx-designer/host.properties'], cwd=ROOT, check=True, timeout=30)