12sksl_minify = sys.argv[1]
13targetDir = sys.argv[2]
18 'sksl_compute': [
'sksl_gpu',
'sksl_shared'],
19 'sksl_gpu': [
'sksl_shared'],
20 'sksl_frag': [
'sksl_gpu',
'sksl_shared'],
21 'sksl_vert': [
'sksl_gpu',
'sksl_shared'],
22 'sksl_graphite_frag': [
'sksl_frag',
'sksl_gpu',
'sksl_shared'],
23 'sksl_graphite_frag_es2': [
'sksl_frag',
'sksl_gpu',
'sksl_shared'],
24 'sksl_graphite_vert': [
'sksl_vert',
'sksl_gpu',
'sksl_shared'],
25 'sksl_graphite_vert_es2': [
'sksl_vert',
'sksl_gpu',
'sksl_shared'],
26 'sksl_public': [
'sksl_shared'],
27 'sksl_rt_shader': [
'sksl_public',
'sksl_shared'],
33 moduleDir, moduleName = os.path.split(os.path.splitext(module)[0])
34 if not os.path.isdir(targetDir):
36 target = os.path.join(targetDir, moduleName)
39 if "_compute" in module:
40 programKind =
"--compute"
41 elif "_vert" in module:
42 programKind =
"--vert"
44 programKind =
"--frag"
49 if moduleName
not in dependencies:
50 print(
"### Error compiling " + moduleName +
": dependency list must be specified")
52 for dependent
in dependencies[moduleName]:
53 moduleList.append(os.path.join(moduleDir, dependent) +
".sksl")
56 destPath = target +
".minified.sksl"
57 args = [sksl_minify, programKind,
"--stringify", destPath] + moduleList
58 subprocess.check_output(args).
decode(
'utf-8')
61 destPath = target +
".unoptimized.sksl"
62 args = [sksl_minify, programKind,
"--unoptimized",
"--stringify", destPath] + moduleList
63 subprocess.check_output(args).
decode(
'utf-8')
65 except subprocess.CalledProcessError
as err:
66 print(
"### Error compiling " + module +
":")
def print(*args, **kwargs)
static DecodeResult decode(std::string path)