• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python
2#
3# Copyright 2020 Google LLC
4#
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7
8import os
9import subprocess
10import sys
11
12skslc = sys.argv[1]
13targetDir = sys.argv[2]
14includes = sys.argv[3:]
15
16for inc in includes:
17    try:
18        noExt, _ = os.path.splitext(inc)
19        head, tail = os.path.split(noExt)
20        if not os.path.isdir(targetDir):
21            os.mkdir(targetDir)
22        target = os.path.join(targetDir, tail)
23        subprocess.check_output([skslc, inc, target + ".dehydrated.sksl"])
24    except subprocess.CalledProcessError as err:
25        print("### Error compiling " + inc + ":")
26        print(err.output)
27        exit(1)
28