OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env bash |
| 2 # Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 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. |
| 5 # |
| 6 # This script generates the following files, based on the contents of |
| 7 # spec_input.html: |
| 8 # |
| 9 # - ../../doc/api.html: The human-readable API spec. |
| 10 # |
| 11 # - ../../test/integration/protocol_matchers.dart: matchers to be used by |
| 12 # integration tests. |
| 13 # |
| 14 # - ../../test/integration/integration_test_methods.dart: convenience methods |
| 15 # to be used by integration tests. |
| 16 |
| 17 set -e |
| 18 |
| 19 function follow_links() { |
| 20 file="$1" |
| 21 while [ -h "$file" ]; do |
| 22 # On Mac OS, readlink -f doesn't work. |
| 23 file="$(readlink "$file")" |
| 24 done |
| 25 echo "$file" |
| 26 } |
| 27 |
| 28 # Unlike $0, $BASH_SOURCE points to the absolute path of this file. |
| 29 PROG_NAME="$(follow_links "$BASH_SOURCE")" |
| 30 |
| 31 SCRIPT_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)" |
| 32 |
| 33 ROOT_DIR="$(cd "${SCRIPT_DIR}/../../../.." ; pwd -P)" |
| 34 |
| 35 if [[ $1 == '--arch' && $2 == 'x64' ]]; |
| 36 then |
| 37 DART_CONFIGURATION="ReleaseX64" |
| 38 elif [ -z "$DART_CONFIGURATION" ]; |
| 39 then |
| 40 DART_CONFIGURATION="ReleaseIA32" |
| 41 fi |
| 42 |
| 43 if [[ `uname` == 'Darwin' ]]; |
| 44 then |
| 45 if [[ $GYP_GENERATORS == 'ninja' ]]; |
| 46 then |
| 47 BUILD_DIR="${ROOT_DIR}/out/$DART_CONFIGURATION" |
| 48 else |
| 49 BUILD_DIR="${ROOT_DIR}/xcodebuild/$DART_CONFIGURATION" |
| 50 fi |
| 51 fi |
| 52 |
| 53 PKG_FILE="${ROOT_DIR}/pkg/analysis_server/.packages" |
| 54 if [[ !(-e $PKG_FILE) ]]; |
| 55 then |
| 56 PKG_FILE="${ROOT_DIR}/.packages" |
| 57 fi |
| 58 |
| 59 DART="${BUILD_DIR}/dart-sdk/bin/dart" |
| 60 |
| 61 declare -a VM_OPTIONS |
| 62 VM_OPTIONS+=("--checked") |
| 63 VM_OPTIONS+=("--packages=${PKG_FILE}") |
| 64 |
| 65 echo "${SCRIPT_DIR}" |
| 66 echo "${DART}" "${VM_OPTIONS[@]}" "generate_all.dart" |
| 67 cd "${SCRIPT_DIR}" |
| 68 "${DART}" "${VM_OPTIONS[@]}" "generate_all.dart" |
OLD | NEW |