OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 20 matching lines...) Expand all Loading... |
31 import logging | 31 import logging |
32 | 32 |
33 from webkitpy.common import webkit_finder | 33 from webkitpy.common import webkit_finder |
34 | 34 |
35 | 35 |
36 _log = logging.getLogger(__name__) | 36 _log = logging.getLogger(__name__) |
37 | 37 |
38 | 38 |
39 class Config(object): | 39 class Config(object): |
40 _FLAGS_FROM_CONFIGURATIONS = { | 40 _FLAGS_FROM_CONFIGURATIONS = { |
41 "Debug": "--debug", | 41 'Debug': '--debug', |
42 "Release": "--release", | 42 'Release': '--release', |
43 } | 43 } |
44 | 44 |
45 def __init__(self, executive, filesystem, port_implementation=None): | 45 def __init__(self, executive, filesystem, port_implementation=None): |
46 self._executive = executive | 46 self._executive = executive |
47 self._filesystem = filesystem | 47 self._filesystem = filesystem |
48 self._webkit_finder = webkit_finder.WebKitFinder(self._filesystem) | 48 self._webkit_finder = webkit_finder.WebKitFinder(self._filesystem) |
49 self._default_configuration = None | 49 self._default_configuration = None |
50 self._build_directories = {} | 50 self._build_directories = {} |
51 self._port_implementation = port_implementation | 51 self._port_implementation = port_implementation |
52 | 52 |
53 def build_directory(self, configuration): | 53 def build_directory(self, configuration): |
54 """Returns the path to the build directory for the configuration.""" | 54 """Returns the path to the build directory for the configuration.""" |
55 if configuration: | 55 if configuration: |
56 flags = ["--configuration", self.flag_for_configuration(configuratio
n)] | 56 flags = ['--configuration', self.flag_for_configuration(configuratio
n)] |
57 else: | 57 else: |
58 configuration = "" | 58 configuration = '' |
59 flags = [] | 59 flags = [] |
60 | 60 |
61 if self._port_implementation: | 61 if self._port_implementation: |
62 flags.append('--' + self._port_implementation) | 62 flags.append('--' + self._port_implementation) |
63 | 63 |
64 if not self._build_directories.get(configuration): | 64 if not self._build_directories.get(configuration): |
65 self._build_directories[configuration] = self._webkit_finder.path_fr
om_webkit_base('out', configuration) | 65 self._build_directories[configuration] = self._webkit_finder.path_fr
om_webkit_base('out', configuration) |
66 | 66 |
67 return self._build_directories[configuration] | 67 return self._build_directories[configuration] |
68 | 68 |
69 def flag_for_configuration(self, configuration): | 69 def flag_for_configuration(self, configuration): |
70 return self._FLAGS_FROM_CONFIGURATIONS[configuration] | 70 return self._FLAGS_FROM_CONFIGURATIONS[configuration] |
71 | 71 |
72 def default_configuration(self): | 72 def default_configuration(self): |
73 return 'Release' | 73 return 'Release' |
OLD | NEW |