Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
| 2 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 # | 5 # |
| 6 # This script executes code generation tools found in the analyzer | 6 # This script executes code generation tools found in the analyzer |
| 7 # "tool" directory. | 7 # "tool" directory. |
| 8 | 8 |
| 9 set -e | 9 set -e |
| 10 | 10 |
| 11 function follow_links() { | 11 function follow_links() { |
| 12 file="$1" | 12 file="$1" |
| 13 while [ -h "$file" ]; do | 13 while [ -h "$file" ]; do |
| 14 # On Mac OS, readlink -f doesn't work. | 14 # On Mac OS, readlink -f doesn't work. |
| 15 file="$(readlink "$file")" | 15 file="$(readlink "$file")" |
| 16 done | 16 done |
| 17 echo "$file" | 17 echo "$file" |
| 18 } | 18 } |
| 19 | 19 |
| 20 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. | 20 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. |
| 21 PROG_NAME="$(follow_links "$BASH_SOURCE")" | 21 PROG_NAME="$(follow_links "$BASH_SOURCE")" |
| 22 | 22 |
| 23 SCRIPT_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" | 23 SCRIPT_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" |
| 24 | 24 |
| 25 ROOT_DIR="$(cd "${SCRIPT_DIR}/../../.." ; pwd -P)" | 25 ROOT_DIR="$(cd "${SCRIPT_DIR}/../../.." ; pwd -P)" |
| 26 | 26 |
| 27 BIN_DIR="${ROOT_DIR}/sdk/bin" | |
| 28 | |
| 29 if [ -z "$DART_CONFIGURATION" ]; | 27 if [ -z "$DART_CONFIGURATION" ]; |
| 30 then | 28 then |
| 31 DART_CONFIGURATION="ReleaseIA32" | 29 DART_CONFIGURATION="ReleaseX64" |
| 32 fi | 30 fi |
| 33 | 31 |
| 34 if [[ `uname` == 'Darwin' ]]; | 32 if [[ `uname` == 'Darwin' ]]; |
| 35 then | 33 then |
| 36 BUILD_DIR="${ROOT_DIR}/xcodebuild/$DART_CONFIGURATION" | 34 BIN_DIR="${ROOT_DIR}/xcodebuild/$DART_CONFIGURATION/dart-sdk/bin" |
|
Kevin Millikin (Google)
2017/08/10 12:06:01
Note that this requires one to build the target cr
| |
| 37 else | 35 else |
| 38 BUILD_DIR="${ROOT_DIR}/out/$DART_CONFIGURATION" | 36 BIN_DIR="${ROOT_DIR}/out/$DART_CONFIGURATION/dart-sdk/bin" |
| 39 fi | 37 fi |
| 40 | 38 |
| 41 PKG_DIR="${BUILD_DIR}/packages" | |
| 42 | |
| 43 DART="${BIN_DIR}/dart" | 39 DART="${BIN_DIR}/dart" |
| 44 | 40 |
| 45 declare -a VM_OPTIONS | 41 declare -a VM_OPTIONS |
| 46 VM_OPTIONS+=("--checked") | 42 VM_OPTIONS+=("--checked") |
| 47 VM_OPTIONS+=("--package-root=${PKG_DIR}") | 43 VM_OPTIONS+=("--packages=${ROOT_DIR}/.packages") |
| 48 | 44 |
| 49 cd "${SCRIPT_DIR}" | 45 cd "${SCRIPT_DIR}" |
| 50 "${DART}" "${VM_OPTIONS[@]}" "task_dependency_graph/generate.dart" | 46 "${DART}" "${VM_OPTIONS[@]}" "task_dependency_graph/generate.dart" |
| 51 "${DART}" "${VM_OPTIONS[@]}" "summary/generate.dart" | 47 "${DART}" "${VM_OPTIONS[@]}" "summary/generate.dart" |
| OLD | NEW |