Revert "Use checked-in .package file for building and testing"

This reverts commit 5d3e356ca7.

BUG=
R=eernst@google.com

Review URL: https://codereview.chromium.org/2340813004 .
This commit is contained in:
William Hesse 2016-09-15 15:46:49 +02:00
parent 5d3e356ca7
commit 6d238ba197
26 changed files with 225 additions and 181 deletions

1
.gitignore vendored
View file

@ -50,6 +50,7 @@ client/tests/drt
# Pub generated "packages" directories and files # Pub generated "packages" directories and files
packages packages
pubspec.lock pubspec.lock
.packages
# Local pub storage # Local pub storage
.pub .pub

103
.packages
View file

@ -1,103 +0,0 @@
# Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
#
# .package file containing links to all packages in /pkg, and checked out
# by DEPS into /third_party/pkg and /third_party/pkg_tested.
# Please update this file if you add a package to DEPS or /pkg
#
analysis_server:pkg/analysis_server/lib
analyzer:pkg/analyzer/lib
analyzer_cli:pkg/analyzer_cli/lib
args:third_party/pkg/args/lib
async:third_party/pkg/async/lib
async_helper:pkg/async_helper/lib
barback:third_party/pkg/barback/lib
bazel_worker:third_party/pkg/bazel_worker/lib
boolean_selector:third_party/pkg/boolean_selector/lib
browser:pkg/browser/lib
charcode:third_party/pkg/charcode/lib
charted:third_party/observatory_pub_packages/packages/charted/lib
cli_util:third_party/pkg/cli_util/lib
code_transformers:third_party/pkg/code_transformers/lib
collection:third_party/pkg/collection/lib
compiler:pkg/compiler/lib
# Compiler is imported as compiler_unsupported so it can work outside the SDK.
compiler_unsupported:pkg/compiler/lib
convert:third_party/pkg/convert/lib
crypto:third_party/pkg/crypto/lib
csslib:third_party/pkg/csslib/lib
dart2js_incremental:pkg/dart2js_incremental/lib
dart2js_info:third_party/pkg/dart2js_info/lib
dart_messages:pkg/dart_messages/lib
dart_style:third_party/pkg_tested/dart_style/lib
dartdoc:third_party/pkg/dartdoc/lib
dev_compiler:pkg/dev_compiler/lib
expect:pkg/expect/lib
fixnum:third_party/pkg/fixnum/lib
func:third_party/pkg/func/lib
glob:third_party/pkg/glob/lib
html:third_party/pkg/html/lib
http:third_party/pkg/http/lib
http_multi_server:third_party/pkg/http_multi_server/lib
http_parser:third_party/pkg/http_parser/lib
http_throttle:third_party/pkg/http_throttle/lib
initialize:third_party/pkg/initialize/lib
intl:third_party/pkg/intl/lib
isolate:third_party/pkg/isolate/lib
js:pkg/js/lib
js_ast:pkg/js_ast/lib
js_runtime:sdk/lib/_internal/js_runtime/lib
json_rpc_2:third_party/pkg/json_rpc_2/lib
kernel:third_party/pkg/kernel/lib
linter:third_party/pkg/linter/lib
logging:third_party/pkg/logging/lib
lookup_map:pkg/lookup_map/lib
markdown:third_party/pkg/markdown/lib
matcher:third_party/pkg/matcher/lib
meta:pkg/meta/lib
metatest:third_party/pkg/metatest/lib
microlytics:pkg/microlytics/lib
mime:third_party/pkg/mime/lib
mustache4dart:third_party/pkg/mustache4dart/lib
oauth2:third_party/pkg/oauth2/lib
observatory:runtime/observatory/lib
observe:third_party/pkg/observe/lib
package_config:third_party/pkg_tested/package_config/lib
package_resolver:third_party/pkg_tested/package_resolver/lib
path:third_party/pkg/path/lib
petitparser:third_party/pkg/petitparser/lib
plugin:third_party/pkg/plugin/lib
pool:third_party/pkg/pool/lib
protobuf:third_party/pkg/protobuf/lib
pub:third_party/pkg/pub/lib
pub_cache:third_party/pkg/pub_cache/lib
pub_semver:third_party/pkg/pub_semver/lib
quiver:third_party/pkg/quiver/lib
resource:third_party/pkg/resource/lib
scheduled_test:third_party/pkg/scheduled_test/lib
sdk_library_metadata:sdk/lib/_internal/sdk_library_metadata/lib
shelf:third_party/pkg/shelf/lib
shelf_packages_handler:third_party/pkg/shelf_packages_handler/lib
shelf_static:third_party/pkg/shelf_static/lib
shelf_web_socket:third_party/pkg/shelf_web_socket/lib
smoke:third_party/pkg/smoke/lib
source_map_stack_trace:third_party/pkg/source_map_stack_trace/lib
source_maps:third_party/pkg/source_maps/lib
source_span:third_party/pkg/source_span/lib
stack_trace:third_party/pkg/stack_trace/lib
stream_channel:third_party/pkg/stream_channel/lib
string_scanner:third_party/pkg/string_scanner/lib
test:third_party/pkg/test/lib
test_reflective_loader:third_party/pkg/test_reflective_loader/lib
typed_data:third_party/pkg/typed_data/lib
typed_mock:pkg/typed_mock/lib
unittest:third_party/pkg/unittest/lib
usage:third_party/pkg/usage/lib
utf:third_party/pkg/utf/lib
watcher:third_party/pkg/watcher/lib
web_components:third_party/pkg/web_components/lib
web_socket_channel:third_party/pkg/web_socket_channel/lib
when:third_party/pkg/when/lib
which:third_party/pkg/which/lib
yaml:third_party/pkg/yaml/lib

View file

@ -26,13 +26,11 @@
], ],
'outputs': [ 'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/packages.stamp', '<(SHARED_INTERMEDIATE_DIR)/packages.stamp',
'<(PRODUCT_DIR)/.packages',
], ],
'action': [ 'action': [
'python', '../tools/make_links.py', '--create-links', 'python', '../tools/make_links.py',
'--create-package-file',
'--timestamp_file=<(SHARED_INTERMEDIATE_DIR)/packages.stamp', '--timestamp_file=<(SHARED_INTERMEDIATE_DIR)/packages.stamp',
'<(PRODUCT_DIR)', '<(PRODUCT_DIR)/packages',
'<@(_inputs)', '<@(_inputs)',
# Pub imports dart2js as compiler_unsupported so it can work outside # Pub imports dart2js as compiler_unsupported so it can work outside
# the SDK. Map that to the compiler package. # the SDK. Map that to the compiler package.

View file

@ -186,6 +186,7 @@
'target_name': 'runtime_all', 'target_name': 'runtime_all',
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../pkg/pkg.gyp:pkg_packages',
'sample_extension', 'sample_extension',
], ],
}, },

View file

@ -12,6 +12,8 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'dart_bootstrap#host', 'dart_bootstrap#host',
# We use packages for building
'../pkg/pkg.gyp:pkg_packages#target',
], ],
'toolsets': ['host'], 'toolsets': ['host'],
'actions': [ 'actions': [

View file

@ -52,4 +52,41 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
DART2JS="$DART_ROOT/pkg/compiler/lib/src/dart2js.dart" DART2JS="$DART_ROOT/pkg/compiler/lib/src/dart2js.dart"
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@" if [[ `uname` == 'Darwin' ]]; then
OUT_DIR="$DART_ROOT/xcodebuild/"
else
OUT_DIR="$DART_ROOT/out/"
fi
if [ -z "$DART_CONFIGURATION" ];
then
DIRS=$( ls "$OUT_DIR" )
# list of possible configurations in decreasing desirability
CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
"ReleaseARM" "ReleaseARM64" "ReleaseARMV5TE" "ReleaseMIPS"
"DebugARM" "DebugARM64" "DebugARMV5TE" "DebugMIPS")
DART_CONFIGURATION="None"
for CONFIG in ${CONFIGS[*]}
do
for DIR in $DIRS;
do
if [ "$CONFIG" = "$DIR" ];
then
# choose most desirable configuration that is available and break
DART_CONFIGURATION="$DIR"
break 2
fi
done
done
if [ "$DART_CONFIGURATION" = "None" ]
then
echo "No valid dart configuration found in $OUT_DIR"
exit 1
fi
fi
BUILD_DIR="$OUT_DIR$DART_CONFIGURATION"
PACKAGE_ROOT="$BUILD_DIR/packages/"
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$DART2JS" "${EXTRA_OPTIONS[@]}" "$@"

View file

@ -39,7 +39,14 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set DART2JS=%DART_ROOT%\pkg\compiler\lib\src\dart2js.dart set DART2JS=%DART_ROOT%\pkg\compiler\lib\src\dart2js.dart
"%DART%" %EXTRA_VM_OPTIONS% "%DART2JS%" %EXTRA_OPTIONS% %* rem DART_CONFIGURATION defaults to ReleaseX64
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64
set BUILD_DIR=%DART_ROOT%\out\%DART_CONFIGURATION%
set PACKAGE_ROOT=%BUILD_DIR%\packages
"%DART%" %EXTRA_VM_OPTIONS% "--package-root=%PACKAGE_ROOT%" "%DART2JS%" %EXTRA_OPTIONS% %*
endlocal endlocal

View file

@ -45,4 +45,42 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
ANALYZER="$DART_ROOT/pkg/analyzer_cli/bin/analyzer.dart" ANALYZER="$DART_ROOT/pkg/analyzer_cli/bin/analyzer.dart"
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$ANALYZER" "$SDK_ARG" "$@" if [[ `uname` == 'Darwin' ]];
then
OUT_DIR="$DART_ROOT/xcodebuild/"
else
OUT_DIR="$DART_ROOT/out/"
fi
if [ -z "$DART_CONFIGURATION" ];
then
DIRS=$( ls "$OUT_DIR" )
# list of possible configurations in decreasing desirability
CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
"ReleaseARM" "ReleaseARM64" "ReleaseARMV5TE" "ReleaseMIPS"
"DebugARM" "DebugARM64" "DebugARMV5TE" "DebugMIPS")
DART_CONFIGURATION="None"
for CONFIG in ${CONFIGS[*]}
do
for DIR in $DIRS;
do
if [ "$CONFIG" = "$DIR" ];
then
# choose most desirable configuration that is available and break
DART_CONFIGURATION="$DIR"
break 2
fi
done
done
if [ "$DART_CONFIGURATION" = "None" ]
then
echo "No valid dart configuration found in $OUT_DIR"
exit 1
fi
fi
BUILD_DIR="$OUT_DIR$DART_CONFIGURATION"
PACKAGE_ROOT="$BUILD_DIR/packages/"
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$ANALYZER" "$SDK_ARG" "$@"

View file

@ -40,7 +40,14 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set ANALYZER=%DART_ROOT%\pkg\analyzer_cli\bin\analyzer.dart set ANALYZER=%DART_ROOT%\pkg\analyzer_cli\bin\analyzer.dart
"%DART%" %EXTRA_VM_OPTIONS% "%ANALYZER%" "%SDK_ARG%" %* rem DART_CONFIGURATION defaults to ReleaseX64
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64
set BUILD_DIR=%DART_ROOT%\out\%DART_CONFIGURATION%
set PACKAGE_ROOT=%BUILD_DIR%\packages
"%DART%" %EXTRA_VM_OPTIONS% "--package-root=%PACKAGE_ROOT%" "%ANALYZER%" "%SDK_ARG%" %*
endlocal endlocal

View file

@ -45,4 +45,42 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
DEV_COMPILER="$DART_ROOT/pkg/dev_compiler/bin/dartdevc.dart" DEV_COMPILER="$DART_ROOT/pkg/dev_compiler/bin/dartdevc.dart"
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "$DEV_COMPILER" "$SDK_ARG" "$@" if [[ `uname` == 'Darwin' ]];
then
OUT_DIR="$DART_ROOT/xcodebuild/"
else
OUT_DIR="$DART_ROOT/out/"
fi
if [ -z "$DART_CONFIGURATION" ];
then
DIRS=$( ls "$OUT_DIR" )
# list of possible configurations in decreasing desirability
CONFIGS=("ReleaseX64" "ReleaseIA32" "DebugX64" "DebugIA32"
"ReleaseARM" "ReleaseARM64" "ReleaseARMV5TE" "ReleaseMIPS"
"DebugARM" "DebugARM64" "DebugARMV5TE" "DebugMIPS")
DART_CONFIGURATION="None"
for CONFIG in ${CONFIGS[*]}
do
for DIR in $DIRS;
do
if [ "$CONFIG" = "$DIR" ];
then
# choose most desirable configuration that is available and break
DART_CONFIGURATION="$DIR"
break 2
fi
done
done
if [ "$DART_CONFIGURATION" = "None" ]
then
echo "No valid dart configuration found in $OUT_DIR"
exit 1
fi
fi
BUILD_DIR="$OUT_DIR$DART_CONFIGURATION"
PACKAGE_ROOT="$BUILD_DIR/packages/"
exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$DEV_COMPILER" "$SDK_ARG" "$@"

View file

@ -36,7 +36,14 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set DEV_COMPILER=%DART_ROOT%\third_party\pkg\dev_compiler\bin\dartdevc.dart set DEV_COMPILER=%DART_ROOT%\third_party\pkg\dev_compiler\bin\dartdevc.dart
"%DART%" %EXTRA_VM_OPTIONS% "DEV_COMPILER%" "%SDK_ARG%" %* rem DART_CONFIGURATION defaults to ReleaseX64
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64
set BUILD_DIR=%DART_ROOT%\out\%DART_CONFIGURATION%
set PACKAGE_ROOT=%BUILD_DIR%\packages
"%DART%" %EXTRA_VM_OPTIONS% "--package-root=%PACKAGE_ROOT%" "DEV_COMPILER%" "%SDK_ARG%" %*
endlocal endlocal

View file

@ -28,4 +28,17 @@ DART_ROOT="$(cd "${SDK_DIR}/.." ; pwd -P)"
DARTFMT="$DART_ROOT/third_party/pkg_tested/dart_style/bin/format.dart" DARTFMT="$DART_ROOT/third_party/pkg_tested/dart_style/bin/format.dart"
exec "$DART" "$DARTFMT" "$@" if [ -z "$DART_CONFIGURATION" ];
then
DART_CONFIGURATION="ReleaseX64"
fi
if [[ `uname` == 'Darwin' ]]; then
BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION"
else
BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION"
fi
PACKAGE_ROOT="$BUILD_DIR/packages/"
exec "$DART" "--package-root=$PACKAGE_ROOT" "$DARTFMT" "$@"

View file

@ -27,7 +27,14 @@ if %DART_ROOT:~-1%==\ set DART_ROOT=%DART_ROOT:~0,-1%
set DARTFMT=%DART_ROOT%\third_party\pkg_tested\dart_style\bin\format.dart set DARTFMT=%DART_ROOT%\third_party\pkg_tested\dart_style\bin\format.dart
"%DART%" "%DARTFMT%" %* rem DART_CONFIGURATION defaults to ReleaseX64
if "%DART_CONFIGURATION%"=="" set DART_CONFIGURATION=ReleaseX64
set BUILD_DIR=%DART_ROOT%\out\%DART_CONFIGURATION%
set PACKAGE_ROOT=%BUILD_DIR%\packages
"%DART%" "--package-root=%PACKAGE_ROOT%" "%DARTFMT%" %*
endlocal endlocal

View file

@ -79,7 +79,8 @@ fi
# Use the Dart binary in the built SDK so pub can find the version file next # Use the Dart binary in the built SDK so pub can find the version file next
# to it. # to it.
DART="$BUILD_DIR/dart-sdk/bin/dart" DART="$BUILD_DIR/dart-sdk/bin/dart"
PACKAGES_DIR="$BUILD_DIR/packages/"
# Run pub. # Run pub.
PUB="$SDK_DIR/../third_party/pkg/pub/bin/pub.dart" PUB="$SDK_DIR/../third_party/pkg/pub/bin/pub.dart"
exec "$DART" "${VM_OPTIONS[@]}" "$PUB" "$@" exec "$DART" "${VM_OPTIONS[@]}" "--package-root=$PACKAGES_DIR" "$PUB" "$@"

View file

@ -31,11 +31,12 @@ if not "_%DART_VM_OPTIONS%_" == "__" (
rem Use the Dart binary in the built SDK so pub can find the version file next rem Use the Dart binary in the built SDK so pub can find the version file next
rem to it. rem to it.
set BUILD_DIR=%SDK_DIR%\..\out\ReleaseX64 set BUILD_DIR=%SDK_DIR%\..\out\ReleaseX64
set PACKAGES_DIR=%BUILD_DIR%\packages
set DART=%BUILD_DIR%\dart-sdk\bin\dart set DART=%BUILD_DIR%\dart-sdk\bin\dart
rem Run pub. rem Run pub.
set PUB="%SDK_DIR%\..\third_party\pkg\pub\bin\pub.dart" set PUB="%SDK_DIR%\..\third_party\pkg\pub\bin\pub.dart"
"%DART%" %VM_OPTIONS% "%PUB%" %* "%DART%" %VM_OPTIONS% --package-root="%PACKAGES_DIR%" "%PUB%" %*
endlocal endlocal

View file

@ -11,22 +11,12 @@ import "package:async_helper/async_helper.dart";
// //
// The main script spawns a server and a subprocess which does a connection back // The main script spawns a server and a subprocess which does a connection back
// to it. // to it.
// The subprocess is expected to shut down its idle sockets after // The subprocess is expected to shut down it's idle sockets after
// [HttpClient.idleTimeout] and the main script will assert that this happens // [HttpClient.idleTimeout] and the main script will assert that this happens
// within +/- 2 <= seconds. // within +/- 2 <= seconds.
const SECONDS = 4; const SECONDS = 4;
List<String> packageOptions() {
if (Platform.packageRoot != null) {
return <String>['--package-root=${Platform.packageRoot}'];
} else if (Platform.packageConfig != null) {
return <String>['--packages=${Platform.packageConfig}'];
} else {
return <String>[];
}
}
void runServerProcess() { void runServerProcess() {
asyncStart(); asyncStart();
HttpServer.bind('127.0.0.1', 0).then((server) { HttpServer.bind('127.0.0.1', 0).then((server) {
@ -39,7 +29,9 @@ void runServerProcess() {
}); });
var sw = new Stopwatch()..start(); var sw = new Stopwatch()..start();
var arguments = packageOptions()..add(Platform.script.toString())..add(url); var arguments = ['--package-root=${Platform.packageRoot}',
'${Platform.script}',
url];
Process.run(Platform.executable, arguments).then((res) { Process.run(Platform.executable, arguments).then((res) {
subscription.cancel(); subscription.cancel();
if (res.exitCode != 0) { if (res.exitCode != 0) {

View file

@ -26,8 +26,6 @@ import os
import shutil import shutil
import subprocess import subprocess
import sys import sys
import urllib
import urlparse
import utils import utils
# Useful messages when we find orphaned checkouts. # Useful messages when we find orphaned checkouts.
@ -45,15 +43,6 @@ def get_options():
action="store_true", action="store_true",
dest="quiet", dest="quiet",
default=False) default=False)
result.add_option("--create-links",
help='Create links to the package lib directories in "packages/".',
action='store_false',
default=True)
result.add_option("--create-package-file",
help='Create a ".packages" file pointing to the packages.',
action='store_false',
default=True)
return result.parse_args() return result.parse_args()
def make_link(quiet, source, target, orig_source): def make_link(quiet, source, target, orig_source):
@ -92,12 +81,12 @@ def create_timestamp_file(options):
os.mkdir(dir_name) os.mkdir(dir_name)
open(options.timestamp_file, 'w').close() open(options.timestamp_file, 'w').close()
def main(argv): def main(argv):
(options, args) = get_options() (options, args) = get_options()
target_dir = os.path.relpath(args[0]) target = os.path.relpath(args[0])
target = os.path.join(target_dir, 'packages')
if os.path.exists(target): if os.path.exists(target):
# If the packages directory already exists, delete the current links in # If the packages directory already exists, delete the current links inside
# it. This is necessary, otherwise we can end up having links in there # it. This is necessary, otherwise we can end up having links in there
# pointing to directories which no longer exist (on incremental builds). # pointing to directories which no longer exist (on incremental builds).
for link in os.listdir(target): for link in os.listdir(target):
@ -110,12 +99,7 @@ def main(argv):
os.remove(full_link) os.remove(full_link)
else: else:
os.makedirs(target) os.makedirs(target)
target = os.path.join(target_dir, '.packages')
if os.path.exists(target):
os.remove(target)
linked_names = {}; linked_names = {};
package_file_contents = '# .package file created by tools/make_links.py\n'
for source in args[1:]: for source in args[1:]:
# Assume the source directory is named ".../NAME/lib". # Assume the source directory is named ".../NAME/lib".
split = source.split(':') split = source.split(':')
@ -138,21 +122,14 @@ def main(argv):
return 1 return 1
linked_names[name] = path linked_names[name] = path
orig_source = source orig_source = source
if options.create_links: if utils.GuessOS() == 'win32':
if utils.GuessOS() == 'win32': source = os.path.relpath(source)
source = os.path.relpath(source) else:
else: source = os.path.relpath(source, start=target)
source = os.path.relpath(source, start=target) exit_code = make_link(
exit_code = make_link(options.quiet, options.quiet, source, os.path.join(target, name), orig_source)
source, os.path.join(target, name), orig_source) if exit_code != 0:
if exit_code != 0: return exit_code
return exit_code
abs_source = os.path.abspath(orig_source)
source_url = urlparse.urljoin('file:', urllib.pathname2url(abs_source))
package_file_contents += '%s:%s\n' % (name, source_url)
if options.create_package_file:
with open(os.path.join(target_dir, '.packages'), 'w') as package_file:
package_file.write(package_file_contents)
create_timestamp_file(options) create_timestamp_file(options)
return 0 return 0

View file

@ -956,7 +956,6 @@ class StandardTestSuite extends TestSuite {
// pubspec.yaml file and if so, create a custom package root for it. // pubspec.yaml file and if so, create a custom package root for it.
List<Command> baseCommands = <Command>[]; List<Command> baseCommands = <Command>[];
Path packageRoot; Path packageRoot;
Path packages;
if (configuration['use_repository_packages'] || if (configuration['use_repository_packages'] ||
configuration['use_public_packages']) { configuration['use_public_packages']) {
Path pubspecYamlFile = _findPubspecYamlFile(filePath); Path pubspecYamlFile = _findPubspecYamlFile(filePath);
@ -996,11 +995,11 @@ class StandardTestSuite extends TestSuite {
multiHtmlTestExpectations[fullTestName] = multiHtmlTestExpectations[fullTestName] =
testExpectations.expectations(fullTestName); testExpectations.expectations(fullTestName);
} }
enqueueBrowserTest(baseCommands, packageRoot, packages, info, testName, enqueueBrowserTest(baseCommands, packageRoot, info, testName,
multiHtmlTestExpectations); multiHtmlTestExpectations);
} else { } else {
enqueueBrowserTest( enqueueBrowserTest(
baseCommands, packageRoot, packages, info, testName, expectations); baseCommands, packageRoot, info, testName, expectations);
} }
} else { } else {
enqueueStandardTest(baseCommands, info, testName, expectations); enqueueStandardTest(baseCommands, info, testName, expectations);
@ -1201,7 +1200,7 @@ class StandardTestSuite extends TestSuite {
* compilation and many browser runs). * compilation and many browser runs).
*/ */
void enqueueBrowserTest(List<Command> baseCommands, Path packageRoot, void enqueueBrowserTest(List<Command> baseCommands, Path packageRoot,
Path packages, TestInformation info, String testName, expectations) { TestInformation info, String testName, expectations) {
RegExp badChars = new RegExp('[-=/]'); RegExp badChars = new RegExp('[-=/]');
List VmOptionsList = getVmOptions(info.optionsFromFile); List VmOptionsList = getVmOptions(info.optionsFromFile);
bool multipleOptions = VmOptionsList.length > 1; bool multipleOptions = VmOptionsList.length > 1;
@ -1209,15 +1208,14 @@ class StandardTestSuite extends TestSuite {
String optionsName = String optionsName =
multipleOptions ? vmOptions.join('-').replaceAll(badChars, '') : ''; multipleOptions ? vmOptions.join('-').replaceAll(badChars, '') : '';
String tempDir = createOutputDirectory(info.filePath, optionsName); String tempDir = createOutputDirectory(info.filePath, optionsName);
enqueueBrowserTestWithOptions(baseCommands, packageRoot, packages, enqueueBrowserTestWithOptions(baseCommands, packageRoot, info, testName,
info, testName, expectations, vmOptions, tempDir); expectations, vmOptions, tempDir);
} }
} }
void enqueueBrowserTestWithOptions( void enqueueBrowserTestWithOptions(
List<Command> baseCommands, List<Command> baseCommands,
Path packageRoot, Path packageRoot,
Path packages,
TestInformation info, TestInformation info,
String testName, String testName,
expectations, expectations,
@ -1587,11 +1585,12 @@ class StandardTestSuite extends TestSuite {
String packagesFromFile) { String packagesFromFile) {
if (packagesFromFile != null) { if (packagesFromFile != null) {
return "--packages=$packagesFromFile"; return "--packages=$packagesFromFile";
} else if (packageRootFromFile != null) {
return "--package-root=$packageRootFromFile";
} else {
return null;
} }
if (packageRootFromFile == "none") {
return null;
}
packageRootFromFile ??= "$buildDir/packages/";
return "--package-root=$packageRootFromFile";
} }
/** /**
@ -1844,7 +1843,7 @@ class PKGTestSuite extends StandardTestSuite {
recursive: true); recursive: true);
void enqueueBrowserTest(List<Command> baseCommands, Path packageRoot, void enqueueBrowserTest(List<Command> baseCommands, Path packageRoot,
packages, TestInformation info, String testName, expectations) { TestInformation info, String testName, expectations) {
String runtime = configuration['runtime']; String runtime = configuration['runtime'];
Path filePath = info.filePath; Path filePath = info.filePath;
Path dir = filePath.directoryPath; Path dir = filePath.directoryPath;
@ -1853,7 +1852,7 @@ class PKGTestSuite extends StandardTestSuite {
File customHtml = new File(customHtmlPath.toNativePath()); File customHtml = new File(customHtmlPath.toNativePath());
if (!customHtml.existsSync()) { if (!customHtml.existsSync()) {
super.enqueueBrowserTest( super.enqueueBrowserTest(
baseCommands, packageRoot, packages, info, testName, expectations); baseCommands, packageRoot, info, testName, expectations);
} else { } else {
Path relativeHtml = customHtmlPath.relativeTo(TestUtils.dartDir); Path relativeHtml = customHtmlPath.relativeTo(TestUtils.dartDir);
List<Command> commands = []..addAll(baseCommands); List<Command> commands = []..addAll(baseCommands);

View file

@ -9,6 +9,7 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../../runtime/dart-runtime.gyp:dart', '../../runtime/dart-runtime.gyp:dart',
'../../pkg/pkg.gyp:pkg_packages',
'../../pkg/pkg_files.gyp:pkg_files_stamp' '../../pkg/pkg_files.gyp:pkg_files_stamp'
], ],
'actions': [ 'actions': [
@ -26,6 +27,7 @@
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--snapshot=<(SHARED_INTERMEDIATE_DIR)/analysis_server.dart.snapshot', '--snapshot=<(SHARED_INTERMEDIATE_DIR)/analysis_server.dart.snapshot',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../pkg/analysis_server/bin/server.dart', '../../pkg/analysis_server/bin/server.dart',
], ],
}, },

View file

@ -12,6 +12,7 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../../runtime/dart-runtime.gyp:dart', '../../runtime/dart-runtime.gyp:dart',
'../../pkg/pkg.gyp:pkg_packages',
'dart2js_files_stamp', 'dart2js_files_stamp',
], ],
'actions': [ 'actions': [
@ -35,6 +36,7 @@
'create_snapshot.dart', 'create_snapshot.dart',
'--output_dir=<(SHARED_INTERMEDIATE_DIR)', '--output_dir=<(SHARED_INTERMEDIATE_DIR)',
'--dart2js_main=pkg/compiler/lib/src/dart2js.dart', '--dart2js_main=pkg/compiler/lib/src/dart2js.dart',
'--package_root=<(PRODUCT_DIR)/packages/',
], ],
}, },
], ],

View file

@ -61,9 +61,10 @@ void writeSnapshotFile(var path, var content) {
writer.close(); writer.close();
} }
Future createSnapshot(var dart_file) { Future createSnapshot(var dart_file, var packageRoot) {
return Process.run(Platform.executable, return Process.run(Platform.executable,
["--snapshot=$dart_file.snapshot", ["--package-root=$packageRoot",
"--snapshot=$dart_file.snapshot",
dart_file]) dart_file])
.then((result) { .then((result) {
if (result.exitCode != 0) { if (result.exitCode != 0) {
@ -79,9 +80,11 @@ Future createSnapshot(var dart_file) {
* Takes the following arguments: * Takes the following arguments:
* --output_dir=val The full path to the output_dir. * --output_dir=val The full path to the output_dir.
* --dart2js_main=val The path to the dart2js main script relative to root. * --dart2js_main=val The path to the dart2js main script relative to root.
* --package-root=val The package-root used to find packages for the snapshot.
*/ */
void main(List<String> arguments) { void main(List<String> arguments) {
var validArguments = ["--output_dir", "--dart2js_main"]; var validArguments = ["--output_dir", "--dart2js_main",
"--package_root"];
var args = {}; var args = {};
for (var argument in arguments) { for (var argument in arguments) {
var argumentSplit = argument.split("="); var argumentSplit = argument.split("=");
@ -93,6 +96,7 @@ void main(List<String> arguments) {
} }
if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main"; if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main";
if (!args.containsKey("output_dir")) throw "Please specify output_dir"; if (!args.containsKey("output_dir")) throw "Please specify output_dir";
if (!args.containsKey("package_root")) throw "Please specify package_root";
var scriptFile = Uri.base.resolveUri(Platform.script); var scriptFile = Uri.base.resolveUri(Platform.script);
var path = scriptFile.resolve("."); var path = scriptFile.resolve(".");
@ -100,13 +104,13 @@ void main(List<String> arguments) {
getSnapshotGenerationFile(args, rootPath).then((result) { getSnapshotGenerationFile(args, rootPath).then((result) {
var wrapper = "${args['output_dir']}/utils_wrapper.dart"; var wrapper = "${args['output_dir']}/utils_wrapper.dart";
writeSnapshotFile(wrapper, result); writeSnapshotFile(wrapper, result);
createSnapshot(wrapper); createSnapshot(wrapper, args["package_root"]);
}); });
getDart2jsSnapshotGenerationFile(args, rootPath).then((result) { getDart2jsSnapshotGenerationFile(args, rootPath).then((result) {
var wrapper = "${args['output_dir']}/dart2js.dart"; var wrapper = "${args['output_dir']}/dart2js.dart";
writeSnapshotFile(wrapper, result); writeSnapshotFile(wrapper, result);
createSnapshot(wrapper); createSnapshot(wrapper, args["package_root"]);
}); });
} }

View file

@ -9,6 +9,7 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../../runtime/dart-runtime.gyp:dart', '../../runtime/dart-runtime.gyp:dart',
'../../pkg/pkg.gyp:pkg_packages',
], ],
'actions': [ 'actions': [
{ {
@ -26,6 +27,7 @@
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot', '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartanalyzer.dart.snapshot',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../pkg/analyzer_cli/bin/analyzer.dart', '../../pkg/analyzer_cli/bin/analyzer.dart',
], ],
}, },
@ -42,6 +44,7 @@
], ],
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../pkg/analyzer/tool/summary/build_sdk_summaries.dart', '../../pkg/analyzer/tool/summary/build_sdk_summaries.dart',
'single-output', 'single-output',
'<(SHARED_INTERMEDIATE_DIR)/sdk_summary_bundle.bin', '<(SHARED_INTERMEDIATE_DIR)/sdk_summary_bundle.bin',
@ -57,6 +60,7 @@
], ],
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../pkg/analyzer/tool/summary/build_sdk_summaries.dart', '../../pkg/analyzer/tool/summary/build_sdk_summaries.dart',
'extract-spec-sum', 'extract-spec-sum',
'<(SHARED_INTERMEDIATE_DIR)/sdk_summary_bundle.bin', '<(SHARED_INTERMEDIATE_DIR)/sdk_summary_bundle.bin',
@ -73,6 +77,7 @@
], ],
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../pkg/analyzer/tool/summary/build_sdk_summaries.dart', '../../pkg/analyzer/tool/summary/build_sdk_summaries.dart',
'extract-strong-sum', 'extract-strong-sum',
'<(SHARED_INTERMEDIATE_DIR)/sdk_summary_bundle.bin', '<(SHARED_INTERMEDIATE_DIR)/sdk_summary_bundle.bin',

View file

@ -9,6 +9,7 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../../runtime/dart-runtime.gyp:dart', '../../runtime/dart-runtime.gyp:dart',
'../../pkg/pkg.gyp:pkg_packages',
], ],
'actions': [ 'actions': [
{ {
@ -26,6 +27,7 @@
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartdevc.dart.snapshot', '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartdevc.dart.snapshot',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../pkg/dev_compiler/bin/dartdevc.dart' '../../pkg/dev_compiler/bin/dartdevc.dart'
], ],
}, },

View file

@ -9,6 +9,7 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../../runtime/dart-runtime.gyp:dart', '../../runtime/dart-runtime.gyp:dart',
'../../pkg/pkg.gyp:pkg_packages',
], ],
'actions': [ 'actions': [
{ {
@ -25,6 +26,7 @@
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot', '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartdoc.dart.snapshot',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../third_party/pkg/dartdoc/bin/dartdoc.dart', '../../third_party/pkg/dartdoc/bin/dartdoc.dart',
], ],
}, },

View file

@ -9,6 +9,7 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../../runtime/dart-runtime.gyp:dart', '../../runtime/dart-runtime.gyp:dart',
'../../pkg/pkg.gyp:pkg_packages',
], ],
'actions': [ 'actions': [
{ {
@ -25,6 +26,7 @@
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartfmt.dart.snapshot', '--snapshot=<(SHARED_INTERMEDIATE_DIR)/dartfmt.dart.snapshot',
'--package-root=<(PRODUCT_DIR)/packages/',
'../../third_party/pkg_tested/dart_style/bin/format.dart', '../../third_party/pkg_tested/dart_style/bin/format.dart',
], ],
}, },

View file

@ -9,6 +9,7 @@
'type': 'none', 'type': 'none',
'dependencies': [ 'dependencies': [
'../../runtime/dart-runtime.gyp:dart', '../../runtime/dart-runtime.gyp:dart',
'../../pkg/pkg.gyp:pkg_packages',
'../../pkg/pkg_files.gyp:pkg_files_stamp', '../../pkg/pkg_files.gyp:pkg_files_stamp',
'../../utils/compiler/compiler.gyp:dart2js_files_stamp' '../../utils/compiler/compiler.gyp:dart2js_files_stamp'
], ],
@ -27,6 +28,7 @@
], ],
'action': [ 'action': [
'<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)', '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
'--package-root=<(PRODUCT_DIR)/packages/',
'--snapshot=<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot', '--snapshot=<(SHARED_INTERMEDIATE_DIR)/pub.dart.snapshot',
'../../third_party/pkg/pub/bin/pub.dart', '../../third_party/pkg/pub/bin/pub.dart',
] ]