28 api.vars.setup()
29
30
31 bot_update = True
32 checkout_root = api.checkout.default_checkout_root
33 skip_patch = False
34 revision = api.properties['revision']
35
36 if 'NoDEPS' in api.properties['buildername']:
37 bot_update = False
38 checkout_root = api.path.start_dir
39 if 'NoPatch' in api.vars.builder_name:
40 skip_patch = True
41 checkout_root = api.path.start_dir
42
43
44
45
46
47 if not api.vars.is_trybot:
48
49
50
51
52 response, _ = api.gitiles.log(
53 url = api.properties['repository'],
54 ref = api.properties['revision'],
55 limit = 1)
56
57
58
59
60
61 revision = response[0]['parents'][0]
62
63 if bot_update:
64 api.checkout.bot_update(
65 checkout_root=checkout_root,
66 skip_patch=skip_patch,
67 override_revision=revision)
68
69 if 'NoPatch' in api.vars.builder_name:
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87 src = api.path.start_dir.join('k', 'skia')
88 dst = api.path.start_dir.join('skia')
89 script = api.infra.resource('copytree.py')
90 api.step(
91 name='copy Skia repository checkout from %s to %s' % (src, dst),
92 cmd=['python3', script, src, dst])
93 api.file.rmtree('remove %s' % src, src)
94
95 else:
96 api.checkout.git(checkout_root=checkout_root)
97
98 api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir)
99
100 out_dir = checkout_root.join(
101 'skia', 'out', api.vars.builder_name, api.vars.configuration)
102 if 'NoPatch' in api.vars.builder_name:
103
104
105 out_dir = api.vars.cache_dir.join(
106 'work', 'skia', 'out', api.vars.builder_name, api.vars.configuration)
107
108 try:
109 api.build(checkout_root=checkout_root, out_dir=out_dir)
110
111
112 dst = api.vars.swarming_out_dir
113 api.build.copy_build_products(out_dir=out_dir, dst=dst)
114 finally:
115 if 'Win' in api.vars.builder_cfg.get('os', ''):
116 script = api.build.resource('cleanup_win_processes.py')
117 api.step(
118 name='cleanup',
119 cmd=['vpython3', script],
120 infra_step=True)
121
122 api.run.check_failure()
123
124