-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Refael Ackermann (רפאל פלחי) <refack@gmail.com> Co-authored-by: Ujjwal Sharma <usharma1998@gmail.com> Backport-PR-URL: #28955 PR-URL: #28016 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
- Loading branch information
Showing
7 changed files
with
208 additions
and
1,723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Copyright (c) 2019 Refael Ackeramnn<refack@gmail.com>. All rights reserved. | ||
# Use of this source code is governed by an MIT-style license. | ||
import re | ||
import os | ||
|
||
PLAIN_SOURCE_RE = re.compile('\s*"([^/$].+)"\s*') | ||
def DoMain(args): | ||
gn_filename, pattern = args | ||
src_root = os.path.dirname(gn_filename) | ||
with open(gn_filename, 'r') as gn_file: | ||
gn_content = gn_file.read().encode('utf-8') | ||
|
||
scraper_re = re.compile(pattern + r'\[([^\]]+)', re.DOTALL) | ||
matches = scraper_re.search(gn_content) | ||
match = matches.group(1) | ||
files = [] | ||
for l in match.splitlines(): | ||
m2 = PLAIN_SOURCE_RE.match(l) | ||
if not m2: | ||
continue | ||
files.append(m2.group(1)) | ||
# always use `/` since GYP will process paths further downstream | ||
rel_files = ['"%s/%s"' % (src_root, f) for f in files] | ||
return ' '.join(rel_files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.