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

Unified Diff: chrome/tools/build/appid.py

Issue 178011: Parameterize the Google Update appid at build time instead of hard coding it ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« app/app.gyp ('K') | « chrome/installer/util/google_update_constants.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/build/appid.py
===================================================================
--- chrome/tools/build/appid.py (revision 0)
+++ chrome/tools/build/appid.py (revision 0)
@@ -0,0 +1,52 @@
+#!/usr/bin/env python
+# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+appid.py -- Chromium appid header file generation utility.
+"""
+
+import optparse
+import sys
+
+GENERATED_APPID_INCLUDE_FILE_CONTENTS = """
+// This file is automatically generated by appid.py.
+// It contains the Google Update Appid used for this build. Note that
+// the Appid will be empty for non Google Chrome builds.
+namespace google_update {
+const wchar_t kChromeGuid[] = L"%s";
+}
+"""
+
+def GenerateAppIdHeader(opts):
+ contents = GENERATED_APPID_INCLUDE_FILE_CONTENTS % opts.appid
+
+ output_file = open(opts.output_file, 'w')
+ try:
+ output_file.write(contents)
sgk 2009/09/03 00:25:23 ...you're writing out the .h file contents *every
+ finally:
+ output_file.close()
+
+def main():
+ parser = optparse.OptionParser()
+ parser.add_option('-a', '--appid',
+ help='The Google Update App Id of the Chrome being built.')
+ parser.add_option('-o', '--output_file',
+ help='The path to the generated output header file')
+
+ (opts, args) = parser.parse_args()
+
+ if opts.appid is None or not opts.output_file:
+ parser.print_help()
+ return 1
+
+ # Log a trace in the build output when we run.
+ print "Generating appid header... ",
+ GenerateAppIdHeader(opts)
+
+ print "Done."
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« app/app.gyp ('K') | « chrome/installer/util/google_update_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698