summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/SConscript.main82
-rw-r--r--chrome/app/resources/SConscript8
-rw-r--r--site_scons/site_tools/component_builders.py36
3 files changed, 77 insertions, 49 deletions
diff --git a/build/SConscript.main b/build/SConscript.main
index d1c8693..b9263cd 100644
--- a/build/SConscript.main
+++ b/build/SConscript.main
@@ -48,7 +48,7 @@ root_env = Environment(
#COMPONENT_LIBRARY_ALIAS = 'lib_$LIBNAME',
# Disable running of tests thru scons for now.
- COMPONENT_TEST_CMDLINE = '',
+ COMPONENT_TEST_RUNNABLE = False,
BASE_DIR = '$OBJ_ROOT/base',
BREAKPAD_DIR = '$OBJ_ROOT/breakpad',
@@ -96,12 +96,6 @@ root_env = Environment(
)
-# Declare a bit to gate solution generation.
-# The actual generation must be at the end.
-DeclareBit('solution', 'Generate a solution file')
-root_env.SetBitFromOption('solution', False)
-
-
def ChromeProgram(env, *args, **kw):
return env.ComponentProgram(*args, **kw)
root_env.AddMethod(ChromeProgram)
@@ -201,10 +195,7 @@ if LoadComponent('net'):
if LoadComponent('rlz'):
sconscripts.append('$RLZ_DIR/SConscript')
-# TODO(bradnelson): fix solution generation for sandbox.
-# The solution generator blows up on some of the tests in sandbox.
-# For now, disable sandbox for solution generation.
-if LoadComponent('sandbox') and not root_env.Bit('solution'):
+if LoadComponent('sandbox'):
sconscripts.append('$SANDBOX_DIR/sandbox.scons')
if LoadComponent('sdch'):
@@ -675,27 +666,56 @@ BuildComponents(environment_list)
# This must occur after BuildComponents so that the dependency graph
# will be populated.
-if root_env.Bit('solution'):
- solution_env = root_env.Clone(tools = ['visual_studio_solution'])
- src_solution = solution_env.Solution(
- '$MAIN_DIR/chrome_scons_src', [windows_env],
- exclude_pattern = '.*(Program Files|platformsdk_vista_6_0|cygwin).*',
- )
+vs_env = windows_env.Clone()
+vs_env.Append(COMPONENT_VS_SOURCE_SUFFIXES = [
+ '.def',
+ '.ini',
+ '.txt',
+ '.ui',
+ '.xml',
+])
+# Source project
+p = vs_env.ComponentVSDirProject(
+ 'chrome_src',
+ [
+ # TODO(bradnelson): need to make sure we can use $CHROME_SRC_DIR here
+ '$CHROME_SRC_DIR/base',
+ '$CHROME_SRC_DIR/breakpad',
+ '$CHROME_SRC_DIR/build',
+# '$CHROME_SRC_DIR/chrome',
+ '.',
+ '$CHROME_SRC_DIR/data',
+ '$CHROME_SRC_DIR/gears',
+ '$CHROME_SRC_DIR/google_update',
+ '$CHROME_SRC_DIR/googleurl',
+ '$CHROME_SRC_DIR/net',
+ '$CHROME_SRC_DIR/rlz',
+ '$CHROME_SRC_DIR/sandbox',
+ '$CHROME_SRC_DIR/sdhc',
+ '$CHROME_SRC_DIR/site_scons',
+ '$CHROME_SRC_DIR/skia',
+ '$CHROME_SRC_DIR/testing',
+ '$CHROME_SRC_DIR/third_party',
+ '$CHROME_SRC_DIR/tools',
+ '$CHROME_SRC_DIR/v8',
+ '$CHROME_SRC_DIR/webkit',
+ ],
+ COMPONENT_VS_SOURCE_FOLDERS = [
+ (None, '$DESTINATION_ROOT'),
+ ('src', '$CHROME_SRC_DIR'),
+ ],
+)
- solution = windows_env.ComponentVSSolution('chrome_scons',
- [
- 'all_libraries',
- 'all_programs',
- 'all_test_programs',
- ],
- projects = [windows_env.File('$MAIN_DIR/chrome_scons_src.vcproj')],
- COMPONENT_VS_SOLUTION_DIR='$MAIN_DIR',
- COMPONENT_VS_PROJECT_DIR='$MAIN_DIR/projects',
- COMPONENT_VS_PROJECT_SCRIPT_PATH=(
+vs_env.ComponentVSSolution(
+ 'chrome_solution',
+ [
+ 'all_libraries',
+ 'all_languages',
+ 'all_programs',
+ 'all_test_programs',
+ ], projects = [p],
+ COMPONENT_VS_PROJECT_SCRIPT_PATH=(
'cd $$(ProjectDir)/$VS_PROJECT_TO_MAIN_DIR && hammer.bat'),
- )
-
- Default(None) # Delete all other default targets.
- Default([src_solution, solution]) # Build just the solution.
+)
# -------------------------------------------------------------------------
diff --git a/chrome/app/resources/SConscript b/chrome/app/resources/SConscript
index 519e929..cfbf1a0 100644
--- a/chrome/app/resources/SConscript
+++ b/chrome/app/resources/SConscript
@@ -4,7 +4,6 @@
Import(['env', 'env_res'])
-env = env.Clone()
env_res = env_res.Clone()
env_res.Append(
@@ -95,6 +94,10 @@ extract_lang = re.compile(r'locale_settings_(.*)\.res')
locale_dlls = []
+env_lang = env.Clone()
+AddTargetGroup('all_languages', 'resource dlls for languages can be built')
+env_lang['COMPONENT_LIBRARY_GROUPS'] = ['all_languages']
+
for locale_settings_res in resources:
s = str(locale_settings_res)
#lang = '$CHROME_DIR/locales/' + extract_lang.match(s).group(1)
@@ -102,7 +105,7 @@ for locale_settings_res in resources:
g_r_res = s.replace('locale_settings', 'generated_resources')
w_s_res = s.replace('locale_settings',
'$WEBKIT_DIR/build/localized_strings/webkit_strings')
- dll = env.ChromeSharedLibrary(
+ dll = env_lang.ChromeSharedLibrary(
lang,
[
g_r_res,
@@ -114,4 +117,3 @@ for locale_settings_res in resources:
i = env.Install('$TARGET_ROOT/locales/', locale_dlls)
env.Alias('chrome', i)
-
diff --git a/site_scons/site_tools/component_builders.py b/site_scons/site_tools/component_builders.py
index 9580d7e..1fe638c 100644
--- a/site_scons/site_tools/component_builders.py
+++ b/site_scons/site_tools/component_builders.py
@@ -317,11 +317,19 @@ def ComponentTestProgramDeferred(env):
# Add installed program and resources to the alias
env.Alias(prog_name, all_outputs)
- # Add an alias for running the test in the test directory, if there's a test
- # command line.
- if env.get('COMPONENT_TEST_CMDLINE'):
- # Test program is the first run resource we replicated.
- test_program = env.ReplicatePublished('$TESTS_DIR', prog_name, 'run')
+ # Add target properties
+ env.SetTargetProperty(
+ prog_name,
+ # The copy of the program we care about is the one in the tests dir
+ EXE='$TESTS_DIR/$PROGRAM_NAME',
+ RUN_CMDLINE='$COMPONENT_TEST_CMDLINE',
+ RUN_DIR='$TESTS_DIR',
+ TARGET_PATH='$TESTS_DIR/$PROGRAM_NAME',
+ )
+
+ # Add an alias for running the test in the test directory, if the test is
+ # runnable and has a test command line.
+ if env.get('COMPONENT_TEST_RUNNABLE') and env.get('COMPONENT_TEST_CMDLINE'):
env.Replace(
COMMAND_OUTPUT_CMDLINE=env['COMPONENT_TEST_CMDLINE'],
COMMAND_OUTPUT_RUN_DIR='$TESTS_DIR',
@@ -339,6 +347,11 @@ def ComponentTestProgramDeferred(env):
if timeout:
env['COMMAND_OUTPUT_TIMEOUT'] = timeout
+ # Test program is the first run resource we replicated. (Duplicate
+ # replicate is not harmful, and is a handy way to pick out the correct
+ # file from all those we replicated above.)
+ test_program = env.ReplicatePublished('$TESTS_DIR', prog_name, 'run')
+
# Run the test. Note that we need to refer to the file by name, so that
# SCons will recreate the file node after we've deleted it; if we used the
# env.File() we created in the if statement above, SCons would still think
@@ -350,16 +363,7 @@ def ComponentTestProgramDeferred(env):
env.ComponentTestOutput('run_' + prog_name, test_out)
# Add target properties
- env.SetTargetProperty(
- prog_name,
- # The copy of the program we care about is the one in the tests dir
- EXE='$TESTS_DIR/$PROGRAM_NAME',
- RUN_TARGET='run_' + prog_name,
- RUN_CMDLINE='$COMPONENT_TEST_CMDLINE',
- RUN_DIR='$TESTS_DIR',
- TARGET_PATH='$TESTS_DIR/$PROGRAM_NAME',
- )
-
+ env.SetTargetProperty(prog_name, RUN_TARGET='run_' + prog_name)
def ComponentTestProgram(self, prog_name, *args, **kwargs):
"""Pseudo-builder for test program to handle platform-dependent type.
@@ -534,6 +538,8 @@ def generate(env):
# 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