| Index: sdk/bin/pub
|
| diff --git a/sdk/bin/pub b/sdk/bin/pub
|
| index 7e4cfbd91a923f4d12afecec724699583daf0db9..156b7c93f5c65773d128928625d1778c3caa6ba2 100755
|
| --- a/sdk/bin/pub
|
| +++ b/sdk/bin/pub
|
| @@ -3,8 +3,9 @@
|
| # 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.
|
|
|
| -# Run pub.dart on the Dart VM. This script assumes the Dart SDK's directory
|
| -# structure.
|
| +# Run pub.dart on the Dart VM. This script is only used when running pub from
|
| +# within the Dart source repo. The shipped SDK instead uses "pub_sdk", which is
|
| +# renamed to "pub" when the SDK is built.
|
|
|
| function follow_links() {
|
| file="$1"
|
| @@ -38,30 +39,28 @@ if [[ $DART_VM_OPTIONS ]]; then
|
| VM_OPTIONS+=("${OPTIONS[@]}")
|
| fi
|
|
|
| -if test -f "$SNAPSHOT"; then
|
| - # We are running the snapshot in the built SDK.
|
| - DART="$BIN_DIR/dart"
|
| - exec "$DART" "${VM_OPTIONS[@]}" "$SNAPSHOT" "$@"
|
| -else
|
| - # We are running pub from source in the development repo.
|
| - if [ -z "$DART_CONFIGURATION" ];
|
| - then
|
| - DART_CONFIGURATION="ReleaseIA32"
|
| - fi
|
| +if [ -z "$DART_CONFIGURATION" ];
|
| +then
|
| + DART_CONFIGURATION="ReleaseIA32"
|
| +fi
|
|
|
| - if [[ `uname` == 'Darwin' ]];
|
| - then
|
| - BUILD_DIR="$SDK_DIR/../xcodebuild/$DART_CONFIGURATION"
|
| - else
|
| - BUILD_DIR="$SDK_DIR/../out/$DART_CONFIGURATION"
|
| - fi
|
| +if [[ `uname` == 'Darwin' ]];
|
| +then
|
| + BUILD_DIR="$SDK_DIR/../xcodebuild/$DART_CONFIGURATION"
|
| +else
|
| + BUILD_DIR="$SDK_DIR/../out/$DART_CONFIGURATION"
|
| +fi
|
|
|
| - # Use the Dart binary in the built SDK so pub can find the version file next
|
| - # to it.
|
| - DART="$BUILD_DIR/dart-sdk/bin/dart"
|
| - PACKAGES_DIR="$BUILD_DIR/pub_packages/"
|
| +# Use the Dart binary in the built SDK so pub can find the version file next
|
| +# to it.
|
| +DART="$BUILD_DIR/dart-sdk/bin/dart"
|
| +PACKAGES_DIR="$BUILD_DIR/pub_packages/"
|
|
|
| - PUB="$SDK_DIR/lib/_internal/pub/bin/pub.dart"
|
| +# Compile async/await down to vanilla Dart.
|
| +# TODO(rnystrom): Remove this when #104 is fixed.
|
| +ASYNC_COMPILER="$SDK_DIR/lib/_internal/pub/bin/async_compile.dart"
|
| +"$DART" "--package-root=$PACKAGES_DIR" "$ASYNC_COMPILER" "$BUILD_DIR" --silent
|
|
|
| - exec "$DART" "${VM_OPTIONS[@]}" "--package-root=$PACKAGES_DIR" "$PUB" "$@"
|
| -fi
|
| +# Run the async/await compiled pub.
|
| +PUB="$BUILD_DIR/pub_async/bin/pub.dart"
|
| +exec "$DART" "${VM_OPTIONS[@]}" "--package-root=$PACKAGES_DIR" "$PUB" "$@"
|
|
|