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

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

Issue 23919004: [NaCl SDK] Create a resources/ directory and move files to it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move httpd.cmd too Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/build_paths.py » ('j') | 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 json 6 import json
7 import optparse 7 import optparse
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
11 11
12 if sys.version_info < (2, 6, 0): 12 if sys.version_info < (2, 6, 0):
13 sys.stderr.write("python 2.6 or later is required run this script\n") 13 sys.stderr.write("python 2.6 or later is required run this script\n")
14 sys.exit(1) 14 sys.exit(1)
15 15
16 import buildbot_common 16 import buildbot_common
17 import build_projects 17 import build_projects
18 import build_version 18 import build_version
19 import easy_template 19 import easy_template
20 import parse_dsc 20 import parse_dsc
21 21
22 from build_paths import SDK_SRC_DIR, OUT_DIR, SDK_EXAMPLE_DIR 22 from build_paths import SDK_SRC_DIR, OUT_DIR, SDK_RESOURCE_DIR
23 23
24 sys.path.append(os.path.join(SDK_SRC_DIR, 'tools')) 24 sys.path.append(os.path.join(SDK_SRC_DIR, 'tools'))
25 import getos 25 import getos
26 import oshelpers 26 import oshelpers
27 27
28 28
29 def RemoveBuildCruft(outdir): 29 def RemoveBuildCruft(outdir):
30 for root, _, files in os.walk(outdir): 30 for root, _, files in os.walk(outdir):
31 for f in files: 31 for f in files:
32 path = os.path.join(root, f) 32 path = os.path.join(root, f)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 def main(args): 74 def main(args):
75 parser = optparse.OptionParser() 75 parser = optparse.OptionParser()
76 _, args = parser.parse_args(args[1:]) 76 _, args = parser.parse_args(args[1:])
77 77
78 toolchains = ['newlib', 'glibc'] 78 toolchains = ['newlib', 'glibc']
79 79
80 pepper_ver = str(int(build_version.ChromeMajorVersion())) 80 pepper_ver = str(int(build_version.ChromeMajorVersion()))
81 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver) 81 pepperdir = os.path.join(OUT_DIR, 'pepper_' + pepper_ver)
82 app_dir = os.path.join(OUT_DIR, 'naclsdk_app') 82 app_dir = os.path.join(OUT_DIR, 'naclsdk_app')
83 app_examples_dir = os.path.join(app_dir, 'examples') 83 app_examples_dir = os.path.join(app_dir, 'examples')
84 sdk_resources_dir = os.path.join(SDK_EXAMPLE_DIR, 'resources') 84 sdk_resources_dir = SDK_RESOURCE_DIR
85 platform = getos.GetPlatform() 85 platform = getos.GetPlatform()
86 86
87 buildbot_common.RemoveDir(app_dir) 87 buildbot_common.RemoveDir(app_dir)
88 buildbot_common.MakeDir(app_dir) 88 buildbot_common.MakeDir(app_dir)
89 89
90 # Add some dummy directories so build_projects doesn't complain... 90 # Add some dummy directories so build_projects doesn't complain...
91 buildbot_common.MakeDir(os.path.join(app_dir, 'tools')) 91 buildbot_common.MakeDir(os.path.join(app_dir, 'tools'))
92 buildbot_common.MakeDir(os.path.join(app_dir, 'toolchain')) 92 buildbot_common.MakeDir(os.path.join(app_dir, 'toolchain'))
93 93
94 config = 'Release' 94 config = 'Release'
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 easy_template.RunTemplateFile( 131 easy_template.RunTemplateFile(
132 os.path.join(sdk_resources_dir, 'manifest.json.template'), 132 os.path.join(sdk_resources_dir, 'manifest.json.template'),
133 os.path.join(app_examples_dir, 'manifest.json'), 133 os.path.join(app_examples_dir, 'manifest.json'),
134 template_dict) 134 template_dict)
135 for filename in ['background.js', 'icon128.png']: 135 for filename in ['background.js', 'icon128.png']:
136 buildbot_common.CopyFile(os.path.join(sdk_resources_dir, filename), 136 buildbot_common.CopyFile(os.path.join(sdk_resources_dir, filename),
137 os.path.join(app_examples_dir, filename)) 137 os.path.join(app_examples_dir, filename))
138 138
139 os.environ['NACL_SDK_ROOT'] = pepperdir 139 os.environ['NACL_SDK_ROOT'] = pepperdir
140 140
141 build_projects.BuildProjects(app_dir, tree, deps=True, clean=False, 141 build_projects.BuildProjects(app_dir, tree, deps=False, clean=False,
142 config=config) 142 config=config)
143 143
144 RemoveBuildCruft(app_dir) 144 RemoveBuildCruft(app_dir)
145 StripNexes(app_dir, platform, pepperdir) 145 StripNexes(app_dir, platform, pepperdir)
146 146
147 app_zip = os.path.join(app_dir, 'examples.zip') 147 app_zip = os.path.join(app_dir, 'examples.zip')
148 os.chdir(app_examples_dir) 148 os.chdir(app_examples_dir)
149 oshelpers.Zip([app_zip, '-r', '*']) 149 oshelpers.Zip([app_zip, '-r', '*'])
150 150
151 return 0 151 return 0
152 152
153 153
154 if __name__ == '__main__': 154 if __name__ == '__main__':
155 sys.exit(main(sys.argv)) 155 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/build_paths.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698