Status: Assigned
Owner: [email protected]
CC: [email protected],  [email protected]
Labels: Type-Task Pri-2 OS-All Area-Infrastructure Size-Small WebKitAPI

New issue 16439 by [email protected]: Generate  
src/third_party/WebKit/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp with  
a python script.
http://code.google.com/p/chromium/issues/detail?id=16439

This script needs to be executed as an action in webkit.gyp. I know I'm  
lazy.


#!/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.
"""usage: gen_all_in_one.py INPUT_DIR OUTFILE

Include all the .cpp files in INPUT_DIR into OUTFILE."""

import os
import sys
import StringIO


def ReadFile(filename):
   file = open(filename, 'r')
   content = file.read()
   file.close()
   return content


def WriteFile(filename, content):
   out = open(filename, 'w')
   out.write(content)
   out.close()


def main(args):
   assert(len(args) == 3)
   cpp_dir = args[1]
   out_filename = args[2]
   content = StringIO.StringIO()
   content.write("This file is AUTOMATICALLY GENERATED. DO NOT MODIFY.\n\n")
   for item in filter(lambda x: x.endswith('.cpp'), os.listdir(cpp_dir)):
     content.write('#include "bindings\%"\n' % item)
   # We need to read the content to determine if they are equal.
   if content.getvalue() != ReadFile(out_filename):
     WriteFile(out_filename, content.getvalue())
   return 0


if __name__ == '__main__':
   sys.exit(main(sys.argv))


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to