Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Side by Side Diff: infra/bots/recipe_modules/skia/pdfium_flavor.py

Issue 2198173002: Re-organize Skia recipes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix missing dependency Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import re
6
7 import default_flavor
8
9
10 """PDFium flavor utils, used for building PDFium with Skia."""
11
12
13 class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
14
15 def compile(self, target):
16 """Build PDFium with Skia."""
17 pdfium_dir = self._skia_api.checkout_root.join('pdfium')
18
19 # Runhook to generate the gn binary in buildtools.
20 self._skia_api.run(
21 self._skia_api.m.step,
22 'runhook',
23 cmd=['gclient', 'runhook', 'gn_linux64'],
24 cwd=pdfium_dir)
25
26 # Setup gn args.
27 gn_args = ['pdf_use_skia=true', 'pdf_is_standalone=true',
28 'clang_use_chrome_plugins=false']
29 self._skia_api.run(
30 self._skia_api.m.step,
31 'gn_gen',
32 cmd=['gn', 'gen', 'out/skia', '--args=%s' % ' '.join(gn_args)],
33 cwd=pdfium_dir,
34 env={'CHROMIUM_BUILDTOOLS_PATH': str(pdfium_dir.join('buildtools'))})
35
36 # Modify DEPS file to contain the current Skia revision.
37 skia_revision = self._skia_api.got_revision
38 deps_file = pdfium_dir.join('DEPS')
39 test_data = "'skia_revision': 'abc'"
40
41 original_contents = self._skia_api.m.file.read(
42 'read PDFium DEPS', deps_file, test_data=test_data, infra_step=True)
43
44 deps_skia_regexp = re.compile(
45 r'(?<=["\']skia_revision["\']: ["\'])([a-fA-F0-9]+)(?=["\'])',
46 re.MULTILINE)
47 patched_contents = re.sub(deps_skia_regexp, str(skia_revision),
48 original_contents)
49 self._skia_api.m.file.write('write PDFium DEPs', deps_file,
50 patched_contents, infra_step=True)
51
52 # gclient sync after updating DEPS.
53 self._skia_api.run(
54 self._skia_api.m.step,
55 'sync_pdfium',
56 cmd=['gclient', 'sync'],
57 cwd=pdfium_dir)
58
59 # Build PDFium.
60 self._skia_api.run(
61 self._skia_api.m.step,
62 'build_pdfium',
63 cmd=['ninja', '-C', 'out/skia', '-j100'],
64 cwd=pdfium_dir)
OLDNEW
« no previous file with comments | « infra/bots/recipe_modules/skia/ios_flavor.py ('k') | infra/bots/recipe_modules/skia/resources/binary_size_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698