skia2/gn/dehydrate_sksl.py
Eric Boren 7bc4c9a8d1 [python3] Reland recipes -> python3 changes
This was enabled by moving the iPhones off of the old RPI2 hosts.

This reverts commit 04cd6fba97.
This reverts commit a726978ae7.

Bug: chromium:1256037
Change-Id: I35069089aa39baf62a18235c8d0514923f327c53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477987
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
2021-12-01 13:04:03 +00:00

29 lines
744 B
Python

#!/usr/bin/env python
#
# Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
skslc = sys.argv[1]
targetDir = sys.argv[2]
includes = sys.argv[3:]
for inc in includes:
try:
noExt, _ = os.path.splitext(inc)
head, tail = os.path.split(noExt)
if not os.path.isdir(targetDir):
os.mkdir(targetDir)
target = os.path.join(targetDir, tail)
subprocess.check_output([
skslc, inc, target + ".dehydrated.sksl"]).decode('utf-8')
except subprocess.CalledProcessError as err:
print("### Error compiling " + inc + ":")
print(err.output)
exit(1)