original_docstring: SCons entry point for this tool.
docstring: SCons entry point for this tool.
docstring_tokens: SCons entry point for this tool .
code: def generate(env):
    # NOTE: SCons requires the use of this name, which fails gpylint.
    """SCons entry point for this tool."""
  
    env.Replace(
        LIB_DIR='$TARGET_ROOT/lib',
        # TODO: Remove legacy COMPONENT_LIBRARY_DIR, once all users have
        # transitioned to LIB_DIR
        COMPONENT_LIBRARY_DIR='$LIB_DIR',
        STAGING_DIR='$TARGET_ROOT/staging',
        TESTS_DIR='$TARGET_ROOT/tests',
        TEST_OUTPUT_DIR='$TARGET_ROOT/test_output',
        # Default command line for a test is just the name of the file.
        # TODO: Why doesn't the following work:
        # COMPONENT_TEST_CMDLINE='${SOURCE.abspath}',
        # (it generates a SCons error)
        COMPONENT_TEST_CMDLINE='${PROGRAM_NAME}',
        # Component tests are runnable by default.
        COMPONENT_TEST_RUNNABLE=True,
        # Default test size is large
        COMPONENT_TEST_SIZE='large',
        # Default timeouts for component tests
        COMPONENT_TEST_TIMEOUT={'large': 900, 'medium': 450, 'small': 180},
        # Tests are enabled by default
        COMPONENT_TEST_ENABLED=True,
        # Static linking is a sensible default
        COMPONENT_STATIC=True,
        # Don't publish libraries to the staging dir by themselves by default.
        COMPONENT_LIBRARY_PUBLISH=False,
    )
    env.Append(
        LIBPATH=['$LIB_DIR'],
        RPATH=['$LIB_DIR'],
  
        # Default alias groups for component builders
        COMPONENT_PACKAGE_GROUPS=['all_packages'],
        COMPONENT_LIBRARY_GROUPS=['all_libraries'],
        COMPONENT_PROGRAM_GROUPS=['all_programs'],
        COMPONENT_TEST_PROGRAM_GROUPS=['all_test_programs'],
        COMPONENT_TEST_OUTPUT_GROUPS=['run_all_tests'],
  
        # Additional components whose resources should be copied into program
        # directories, in addition to those from LIBS and the program itself.
        LIBS=[],
        COMPONENTS=[],
  
        # Dicts of what resources should go in each destination directory for
        # programs and test programs.
        COMPONENT_PACKAGE_RESOURCES={
            'run': '$PACKAGE_DIR',
            'debug': '$PACKAGE_DIR',
        },
        COMPONENT_PROGRAM_RESOURCES={
            'run': '$STAGING_DIR',
            'debug': '$STAGING_DIR',
        },
        COMPONENT_TEST_RESOURCES={
            'run': '$TESTS_DIR',
            'debug': '$TESTS_DIR',
            'test_input': '$TESTS_DIR',
        },
    )
  
    # Add command line option for retest
    SCons.Script.AddOption(
        '--retest',
        dest='component_test_retest',
        action='store_true',
        help='force all tests to rerun')
    SCons.Script.Help('  --retest                    '
                      'Rerun specified tests, ignoring cached results.\n')
  
    # Defer per-environment initialization, but do before building SConscripts
    env.Defer(_InitializeComponentBuilders)
    env.Defer('BuildEnvironmentSConscripts', after=_InitializeComponentBuilders)
  
    # Add our pseudo-builder methods
    env.AddMethod(_StoreComponents)
    env.AddMethod(ComponentPackage)
    env.AddMethod(ComponentObject)
    env.AddMethod(ComponentLibrary)
    env.AddMethod(ComponentProgram)
    env.AddMethod(ComponentTestProgram)
    env.AddMethod(ComponentTestOutput)
  
    # Add our target groups
    AddTargetGroup('all_libraries', 'libraries can be built')
    AddTargetGroup('all_programs', 'programs can be built')
    AddTargetGroup('all_test_programs', 'tests can be built')
    AddTargetGroup('all_packages', 'packages can be built')
    AddTargetGroup('run_all_tests', 'tests can be run')
    AddTargetGroup('run_disabled_tests', 'tests are disabled')
    AddTargetGroup('run_small_tests', 'small tests can be run')
    AddTargetGroup('run_medium_tests', 'medium tests can be run')
    AddTargetGroup('run_large_tests', 'large tests can be run')
code_tokens: def generate ( env ) : env . Replace ( LIB_DIR = '$TARGET_ROOT/lib' , COMPONENT_LIBRARY_DIR = '$LIB_DIR' , STAGING_DIR = '$TARGET_ROOT/staging' , TESTS_DIR = '$TARGET_ROOT/tests' , TEST_OUTPUT_DIR = '$TARGET_ROOT/test_output' , COMPONENT_TEST_CMDLINE = '${PROGRAM_NAME}' , COMPONENT_TEST_RUNNABLE = True , COMPONENT_TEST_SIZE = 'large' , COMPONENT_TEST_TIMEOUT = { 'large' : 900 , 'medium' : 450 , 'small' : 180 } , COMPONENT_TEST_ENABLED = True , COMPONENT_STATIC = True , COMPONENT_LIBRARY_PUBLISH = False , ) env . Append ( LIBPATH = [ '$LIB_DIR' ] , RPATH = [ '$LIB_DIR' ] , COMPONENT_PACKAGE_GROUPS = [ 'all_packages' ] , COMPONENT_LIBRARY_GROUPS = [ 'all_libraries' ] , COMPONENT_PROGRAM_GROUPS = [ 'all_programs' ] , COMPONENT_TEST_PROGRAM_GROUPS = [ 'all_test_programs' ] , COMPONENT_TEST_OUTPUT_GROUPS = [ 'run_all_tests' ] , LIBS = [ ] , COMPONENTS = [ ] , COMPONENT_PACKAGE_RESOURCES = { 'run' : '$PACKAGE_DIR' , 'debug' : '$PACKAGE_DIR' , } , COMPONENT_PROGRAM_RESOURCES = { 'run' : '$STAGING_DIR' , 'debug' : '$STAGING_DIR' , } , COMPONENT_TEST_RESOURCES = { 'run' : '$TESTS_DIR' , 'debug' : '$TESTS_DIR' , 'test_input' : '$TESTS_DIR' , } , ) SCons . Script . AddOption ( '--retest' , dest = 'component_test_retest' , action = 'store_true' , help = 'force all tests to rerun' ) SCons . Script . Help ( '  --retest                    ' 'Rerun specified tests, ignoring cached results.\n' ) env . Defer ( _InitializeComponentBuilders ) env . Defer ( 'BuildEnvironmentSConscripts' , after = _InitializeComponentBuilders ) env . AddMethod ( _StoreComponents ) env . AddMethod ( ComponentPackage ) env . AddMethod ( ComponentObject ) env . AddMethod ( ComponentLibrary ) env . AddMethod ( ComponentProgram ) env . AddMethod ( ComponentTestProgram ) env . AddMethod ( ComponentTestOutput ) AddTargetGroup ( 'all_libraries' , 'libraries can be built' ) AddTargetGroup ( 'all_programs' , 'programs can be built' ) AddTargetGroup ( 'all_test_programs' , 'tests can be built' ) AddTargetGroup ( 'all_packages' , 'packages can be built' ) AddTargetGroup ( 'run_all_tests' , 'tests can be run' ) AddTargetGroup ( 'run_disabled_tests' , 'tests are disabled' ) AddTargetGroup ( 'run_small_tests' , 'small tests can be run' ) AddTargetGroup ( 'run_medium_tests' , 'medium tests can be run' ) AddTargetGroup ( 'run_large_tests' , 'large tests can be run' )
short_docstring: SCons entry point for this tool.
short_docstring_tokens: SCons entry point for this tool .
comment: # NOTE: SCons requires the use of this name, which fails gpylint.$SEP$"""SCons entry point for this tool."""$SEP$# TODO: Remove legacy COMPONENT_LIBRARY_DIR, once all users have$SEP$# transitioned to LIB_DIR$SEP$# Default command line for a test is just the name of the file.$SEP$# TODO: Why doesn't the following work:$SEP$# COMPONENT_TEST_CMDLINE='${SOURCE.abspath}',$SEP$# (it generates a SCons error)$SEP$# Component tests are runnable by default.$SEP$# Default test size is large$SEP$# Default timeouts for component tests$SEP$# Tests are enabled by default$SEP$# Static linking is a sensible default$SEP$# Don't publish libraries to the staging dir by themselves by default.$SEP$# Default alias groups for component builders$SEP$# Additional components whose resources should be copied into program$SEP$# directories, in addition to those from LIBS and the program itself.$SEP$# Dicts of what resources should go in each destination directory for$SEP$# programs and test programs.$SEP$# Add command line option for retest$SEP$# Defer per-environment initialization, but do before building SConscripts$SEP$# Add our pseudo-builder methods$SEP$# Add our target groups