-
Notifications
You must be signed in to change notification settings - Fork 46
/
Copy pathrun.py
executable file
·63 lines (53 loc) · 1.84 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /usr/bin/env python3
import argparse, build, build_utils, common, glob, os, platform, subprocess, sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--jwm-version', default=None)
parser.add_argument('--skija-version', default='0.98.0')
parser.add_argument('--skija-dir', default=None)
parser.add_argument('--types-dir', default=None)
args = parser.parse_args()
if not args.jwm_version:
build.main()
if args.skija_dir:
skija_dir = os.path.abspath(args.skija_dir)
os.chdir(common.basedir)
# compile
classpath = common.deps_compile()
if args.jwm_version:
classpath += [
build_utils.fetch_maven('io.github.humbleui.jwm', 'jwm', args.jwm_version)
]
else:
classpath += [
'target/classes',
build_utils.system + '/build'
]
if args.skija_dir:
classpath += [
skija_dir + '/platform/build',
skija_dir + '/platform/target/classes',
skija_dir + '/shared/target/classes',
]
else:
skija_native = 'skija-' + build_utils.system + (('-' + build_utils.arch) if 'macos' == build_utils.system else '')
classpath += [
build_utils.fetch_maven('io.github.humbleui', 'skija-shared', args.skija_version),
build_utils.fetch_maven('io.github.humbleui', skija_native, args.skija_version),
]
sources = build_utils.files('examples/dashboard/java/**/*.java')
build_utils.javac(sources, 'examples/dashboard/target/classes', classpath = classpath, release='16')
# run
subprocess.check_call([
'java',
'--class-path', build_utils.classpath_join(classpath + ['examples/dashboard/target/classes']),
'-Djava.awt.headless=true',
'-enableassertions',
'-enablesystemassertions',
'-Dfile.encoding=UTF-8',
'-Xcheck:jni',
'io.github.humbleui.jwm.examples.Example'
])
return 0
if __name__ == '__main__':
sys.exit(main())