Build lib/_internal/analysis_summary during SDK build.

We cannot commit this CL right now, because we will attempt to use
these summaries by default, and they are incomplete yet. But I wanted
to see how to add something to the build process, and we might do
changes to make using SDK summaries optional initiallyand then commit
this CL.

R=paulberry@google.com, whesse@google.com
BUG=

Review URL: https://codereview.chromium.org/1588093005 .
This commit is contained in:
Konstantin Shcheglov 2016-02-19 19:06:22 -08:00
parent c822c34af6
commit 427f760c91
3 changed files with 31 additions and 2 deletions

View file

@ -41,6 +41,8 @@
'<(SHARED_INTERMEDIATE_DIR)/dartfmt.dart.snapshot',
'<(SHARED_INTERMEDIATE_DIR)/analysis_server.dart.snapshot',
'<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
'<(SHARED_INTERMEDIATE_DIR)/spec.sum',
'<(SHARED_INTERMEDIATE_DIR)/strong.sum',
'tools/VERSION'
],
'outputs': [

View file

@ -44,6 +44,8 @@
# ......dart_shared.platform
# ......dart2dart.platform
# ......_internal/
#.........spec.sum
#.........strong.sum
# ......analysis_server/
# ......analyzer/
# ......async/
@ -157,7 +159,13 @@ def CopyDartdocResources(home, sdk_root):
PACKAGES_FILE = join(DARTDOC, '.packages')
packages_file = open(PACKAGES_FILE, 'w')
packages_file.write('dartdoc:.')
packages_file.close()
packages_file.close()
def CopyAnalysisSummaries(snapshots, lib):
copyfile(join(snapshots, 'spec.sum'),
join(lib, '_internal', 'spec.sum'))
copyfile(join(snapshots, 'strong.sum'),
join(lib, '_internal', 'strong.sum'))
def Main():
@ -290,10 +298,11 @@ def Main():
# Copy dart2js/pub.
CopyDartScripts(HOME, SDK_tmp)
CopySnapshots(SNAPSHOT, SDK_tmp)
CopyDartdocResources(HOME, SDK_tmp)
CopyAnalyzerSources(HOME, LIB)
CopyAnalysisSummaries(SNAPSHOT, LIB)
# Write the 'version' file
version = utils.GetVersion()

View file

@ -30,6 +30,24 @@
'../../pkg/analyzer_cli/bin/analyzer.dart',
],
},
{
'action_name': 'generate_summaries',
'inputs': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart',
'<(SHARED_INTERMEDIATE_DIR)/packages.stamp',
'<!@(["python", "../../tools/list_files.py", "\\.dart$", "../../pkg/analyzer"])',
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/spec.sum',
'<(SHARED_INTERMEDIATE_DIR)/strong.sum',
],
'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'../../pkg/analyzer/tool/summary/build_sdk_summaries.dart',
'<(SHARED_INTERMEDIATE_DIR)',
],
},
],
},
],