| OLD | NEW |
| 1 #!/usr/bin/python2.4 | 1 #!/usr/bin/python2.4 |
| 2 # Copyright 2008, Google Inc. | 2 # Copyright 2008, Google Inc. |
| 3 # All rights reserved. | 3 # All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 calling environment: | 124 calling environment: |
| 125 Import('env') | 125 Import('env') |
| 126 | 126 |
| 127 Changes made to env in the called SConscript will be applied to the | 127 Changes made to env in the called SConscript will be applied to the |
| 128 environment calling ApplySConscript() - that is, env in the called SConscript | 128 environment calling ApplySConscript() - that is, env in the called SConscript |
| 129 is a reference to the calling environment. | 129 is a reference to the calling environment. |
| 130 | 130 |
| 131 If you need to export multiple variables to the called SConscript, or return | 131 If you need to export multiple variables to the called SConscript, or return |
| 132 variables from it, use the existing SConscript() function. | 132 variables from it, use the existing SConscript() function. |
| 133 """ | 133 """ |
| 134 return SCons.Script.SConscript(sconscript_file, exports={'env': self}) | 134 return self.SConscript(sconscript_file, exports={'env': self}) |
| 135 | 135 |
| 136 #------------------------------------------------------------------------------ | 136 #------------------------------------------------------------------------------ |
| 137 | 137 |
| 138 | 138 |
| 139 def BuildSConscript(self, sconscript_file): | 139 def BuildSConscript(self, sconscript_file): |
| 140 """Builds a SConscript based on the current environment. | 140 """Builds a SConscript based on the current environment. |
| 141 | 141 |
| 142 Args: | 142 Args: |
| 143 self: Environment to clone and pass to the called SConscript. | 143 self: Environment to clone and pass to the called SConscript. |
| 144 sconscript_file: Name of SConscript file to build. If this is a directory, | 144 sconscript_file: Name of SConscript file to build. If this is a directory, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 # NOTE: SCons requires the use of this name, which fails gpylint. | 275 # NOTE: SCons requires the use of this name, which fails gpylint. |
| 276 """SCons entry point for this tool.""" | 276 """SCons entry point for this tool.""" |
| 277 | 277 |
| 278 # Add methods to environment | 278 # Add methods to environment |
| 279 env.AddMethod(ApplySConscript) | 279 env.AddMethod(ApplySConscript) |
| 280 env.AddMethod(BuildSConscript) | 280 env.AddMethod(BuildSConscript) |
| 281 env.AddMethod(FilterOut) | 281 env.AddMethod(FilterOut) |
| 282 env.AddMethod(Overlap) | 282 env.AddMethod(Overlap) |
| 283 env.AddMethod(RelativePath) | 283 env.AddMethod(RelativePath) |
| 284 env.AddMethod(SubstList2) | 284 env.AddMethod(SubstList2) |
| OLD | NEW |