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

Side by Side Diff: native_client_sdk/src/build_tools/build_app.py

Issue 946423004: nacl sdk: build tools: add filesystem permissions to apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import json 7 import json
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 build_projects.UpdateHelpers(app_dir, clobber=True) 125 build_projects.UpdateHelpers(app_dir, clobber=True)
126 build_projects.UpdateProjects(app_dir, tree, clobber=False, 126 build_projects.UpdateProjects(app_dir, tree, clobber=False,
127 toolchains=toolchains, configs=[config], 127 toolchains=toolchains, configs=[config],
128 first_toolchain=True) 128 first_toolchain=True)
129 129
130 # Collect permissions from each example, and aggregate them. 130 # Collect permissions from each example, and aggregate them.
131 def MergeLists(list1, list2): 131 def MergeLists(list1, list2):
132 return list1 + [x for x in list2 if x not in list1] 132 return list1 + [x for x in list2 if x not in list1]
133 all_permissions = [] 133 all_permissions = []
134 all_socket_permissions = [] 134 all_socket_permissions = []
135 all_filesystem_permissions = []
135 for _, project in parse_dsc.GenerateProjects(tree): 136 for _, project in parse_dsc.GenerateProjects(tree):
136 permissions = project.get('PERMISSIONS', []) 137 permissions = project.get('PERMISSIONS', [])
137 all_permissions = MergeLists(all_permissions, permissions) 138 all_permissions = MergeLists(all_permissions, permissions)
138 socket_permissions = project.get('SOCKET_PERMISSIONS', []) 139 socket_permissions = project.get('SOCKET_PERMISSIONS', [])
139 all_socket_permissions = MergeLists(all_socket_permissions, 140 all_socket_permissions = MergeLists(all_socket_permissions,
140 socket_permissions) 141 socket_permissions)
142 filesystem_permissions = project.get('FILESYSTEM_PERMISSIONS', [])
143 all_filesystem_permissions = MergeLists(all_filesystem_permissions,
144 filesystem_permissions)
141 if all_socket_permissions: 145 if all_socket_permissions:
142 all_permissions.append({'socket': all_socket_permissions}) 146 all_permissions.append({'socket': all_socket_permissions})
147 if all_filesystem_permissions:
148 all_permissions.append({'fileSystem': all_filesystem_permissions})
143 pretty_permissions = json.dumps(all_permissions, sort_keys=True, indent=4) 149 pretty_permissions = json.dumps(all_permissions, sort_keys=True, indent=4)
144 150
145 for filename in ['background.js', 'icon128.png']: 151 for filename in ['background.js', 'icon128.png']:
146 buildbot_common.CopyFile(os.path.join(sdk_resources_dir, filename), 152 buildbot_common.CopyFile(os.path.join(sdk_resources_dir, filename),
147 os.path.join(app_examples_dir, filename)) 153 os.path.join(app_examples_dir, filename))
148 154
149 os.environ['NACL_SDK_ROOT'] = pepperdir 155 os.environ['NACL_SDK_ROOT'] = pepperdir
150 156
151 build_projects.BuildProjects(app_dir, tree, deps=False, clean=False, 157 build_projects.BuildProjects(app_dir, tree, deps=False, clean=False,
152 config=config) 158 config=config)
(...skipping 22 matching lines...) Expand all
175 181
176 app_zip = os.path.join(app_dir, 'examples.zip') 182 app_zip = os.path.join(app_dir, 'examples.zip')
177 os.chdir(app_examples_dir) 183 os.chdir(app_examples_dir)
178 oshelpers.Zip([app_zip, '-r', '*']) 184 oshelpers.Zip([app_zip, '-r', '*'])
179 185
180 return 0 186 return 0
181 187
182 188
183 if __name__ == '__main__': 189 if __name__ == '__main__':
184 sys.exit(main(sys.argv[1:])) 190 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698