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

Unified Diff: remoting/webapp/build-webapp.py

Issue 11875021: Allow an AppsV2 build to be configured using GYP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reviewer comments. Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/appsv2.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/build-webapp.py
diff --git a/remoting/webapp/build-webapp.py b/remoting/webapp/build-webapp.py
index e6f5ab27a6092f56dcd5dff0174bbe1e4116312d..cb18b12dec993b806d88d9af580ac09b9babb2ae 100755
--- a/remoting/webapp/build-webapp.py
+++ b/remoting/webapp/build-webapp.py
@@ -56,7 +56,7 @@ def createZip(zip_path, directory):
def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin,
- files, locales):
+ files, locales, patches):
"""Does the main work of building the webapp directory and zipfile.
Args:
@@ -71,6 +71,9 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin,
in this webapp.
locales: An array of strings listing locales, which are copied, along
with their directory structure from the _locales directory down.
+ patches: An array of strings listing patch files to be applied to the
+ webapp directory. Paths in the patch file should be relative to
+ the parent directory, for example a/main.html.
Wez 2013/01/16 20:43:57 To the parent directory of what?
Jamie 2013/01/16 21:11:34 The parent directory of the web-app. The example i
"""
# Ensure a fresh directory.
try:
@@ -159,6 +162,15 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin,
if ((platform.system() == 'Linux') and (buildtype == 'Official')):
subprocess.call(["strip", newPluginPath])
+ # Patch the files, if necessary. Do this before updating any placeholders
+ # in case any of the diff contexts refer to the placeholders.
+ for patch in patches:
+ patchfile = os.path.join(os.getcwd(), patch)
+ if subprocess.call(['patch', '-d', destination, '-i', patchfile,
+ '-p1']) != 0:
+ print 'Patch ' + patch + ' failed to apply.'
+ return 1
+
# Set the version number in the manifest version.
findAndReplace(os.path.join(destination, 'manifest.json'),
'FULL_APP_VERSION',
@@ -202,28 +214,33 @@ def buildWebApp(buildtype, version, mimetype, destination, zip_path, plugin,
# Make the zipfile.
createZip(zip_path, destination)
+ return 0
+
def main():
if len(sys.argv) < 7:
print ('Usage: build-webapp.py '
'<build-type> <version> <mime-type> <dst> <zip-path> <plugin> '
- '<other files...> --locales <locales...>')
+ '<other files...> [--patches <patches...>] '
+ '[--locales <locales...>]')
return 1
- reading_locales = False
+ arg_type = ''
files = []
locales = []
+ patches = []
for arg in sys.argv[7:]:
- if arg == "--locales":
- reading_locales = True;
- elif reading_locales:
+ if arg == '--locales' or arg == '--patches':
+ arg_type = arg
+ elif arg_type == '--locales':
locales.append(arg)
+ elif arg_type == '--patches':
+ patches.append(arg)
else:
files.append(arg)
- buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5],
- sys.argv[6], files, locales)
- return 0
+ return buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4],
+ sys.argv[5], sys.argv[6], files, locales, patches)
if __name__ == '__main__':
« no previous file with comments | « remoting/webapp/appsv2.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698