| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return SCons.Node.FS.LinkFunc([env.Entry(target)], [env.Entry(source)], env) | 64 return SCons.Node.FS.LinkFunc([env.Entry(target)], [env.Entry(source)], env) |
| 65 | 65 |
| 66 | 66 |
| 67 def PreEvaluateVariables(env): | 67 def PreEvaluateVariables(env): |
| 68 """Deferred function to pre-evaluate SCons varables for each build mode. | 68 """Deferred function to pre-evaluate SCons varables for each build mode. |
| 69 | 69 |
| 70 Args: | 70 Args: |
| 71 env: Environment for the current build mode. | 71 env: Environment for the current build mode. |
| 72 """ | 72 """ |
| 73 # Convert directory variables to strings | 73 # Convert directory variables to strings |
| 74 for var in env.SubstList2('PRE_EVALUATE_DIRS'): | 74 for var in env.SubstList2('$PRE_EVALUATE_DIRS'): |
| 75 env[var] = str(env.Dir('$' + var)) | 75 env[var] = str(env.Dir('$' + var)) |
| 76 | 76 |
| 77 | 77 |
| 78 #------------------------------------------------------------------------------ | 78 #------------------------------------------------------------------------------ |
| 79 | 79 |
| 80 | 80 |
| 81 def generate(env): | 81 def generate(env): |
| 82 # NOTE: SCons requires the use of this name, which fails gpylint. | 82 # NOTE: SCons requires the use of this name, which fails gpylint. |
| 83 """SCons entry point for this tool.""" | 83 """SCons entry point for this tool.""" |
| 84 | 84 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 # have a common location for tools outside of the current clientspec. Need | 219 # have a common location for tools outside of the current clientspec. Need |
| 220 # to check if it's defined already, so it can be set prior to this tool | 220 # to check if it's defined already, so it can be set prior to this tool |
| 221 # being included. | 221 # being included. |
| 222 tool_root = env.get('TOOL_ROOT', '$SOURCE_ROOT') | 222 tool_root = env.get('TOOL_ROOT', '$SOURCE_ROOT') |
| 223 env['TOOL_ROOT'] = env.Dir(tool_root).abspath | 223 env['TOOL_ROOT'] = env.Dir(tool_root).abspath |
| 224 | 224 |
| 225 # Defer pre-evaluating some environment variables, but do before building | 225 # Defer pre-evaluating some environment variables, but do before building |
| 226 # SConscripts. | 226 # SConscripts. |
| 227 env.Defer(PreEvaluateVariables) | 227 env.Defer(PreEvaluateVariables) |
| 228 env.Defer('BuildEnvironmentSConscripts', after=PreEvaluateVariables) | 228 env.Defer('BuildEnvironmentSConscripts', after=PreEvaluateVariables) |
| OLD | NEW |