5"""sdk/lib specific presubmit script.
7See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8for more details about the presubmit API built into gcl.
12import importlib.machinery
20 loader = importlib.machinery.SourceFileLoader(modname, filename)
21 spec = importlib.util.spec_from_file_location(modname,
24 module = importlib.util.module_from_spec(spec)
28 loader.exec_module(module)
33 hasChangedFiles =
False
34 for git_file
in input_api.AffectedTextFiles():
35 filename = git_file.AbsoluteLocalPath()
36 if filename.endswith(
'libraries.yaml')
or filename.endswith(
38 hasChangedFiles =
True
42 local_root = input_api.change.RepositoryRoot()
44 os.path.join(local_root,
'tools',
'utils.py'))
46 yaml2json = os.path.join(local_root,
'tools',
'yaml2json.dart')
47 libYaml = os.path.join(local_root,
'sdk',
'lib',
'libraries.yaml')
48 libJson = os.path.join(local_root,
'sdk',
'lib',
'libraries.json')
54 if not os.path.isfile(dart):
55 print(
'WARNING: dart not found: %s' % dart)
58 if not os.path.isfile(yaml2json):
59 print(
'WARNING: yaml2json not found: %s' % yaml2json)
63 dart, yaml2json, libYaml, libJson,
'--check',
64 '--relative=' + local_root +
'/'
66 process = subprocess.Popen(args,
67 stdout=subprocess.PIPE,
68 stdin=subprocess.PIPE)
69 outs, _ = process.communicate()
71 if process.returncode != 0:
73 output_api.PresubmitError(
'lib/sdk smoketest failure(s)',
static SkString load_source(skiatest::Reporter *r, const char *testFile, const char *permutationSuffix)
def CheckChangeOnCommit(input_api, output_api)
def CheckChangeOnUpload(input_api, output_api)
def runSmokeTest(input_api, output_api)
def print(*args, **kwargs)