Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: samples/github/compile_mock_service.sh

Issue 2035023003: Remove service-compiler related code. (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « samples/github/bin/run_github_mock.dart ('k') | samples/github/ios/.clang-format » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE.md file.
6
7 # This file compiles the github mock data files in to a single Dart file with a
8 # hash-map of the raw file data and generates a snapshot for running the mock
9 # server with this data.
10
11 set -ue
12
13 DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
14 DARTINO_DIR="$(cd "$DIR/../.." && pwd)"
15 DATA_DIR="$DIR/lib/src/github_mock_data"
16 DATA_FILE="$DIR/lib/src/github_mock.data"
17 IDL_FILE="$DIR/lib/src/github_mock.idl"
18 MOCK_FILE="$DIR/bin/github_mock_service.dart"
19 SNAPSHOT_FILE="$DIR/github_mock_service.snapshot"
20 PKG_FILE="$DIR/.packages"
21
22 DART="$DARTINO_DIR/out/ReleaseIA32/dart"
23 DARTINO="$DARTINO_DIR/out/ReleaseIA32/dartino"
24 SERVICEC="$DARTINO x-servicec"
25
26 SERVICE_GEN_DIR="$DIR/generated/service"
27
28 cd $DARTINO_DIR
29 ninja -C out/ReleaseIA32
30
31 if [[ $# -eq 0 ]] || [[ "$1" == "data" ]]; then
32 cd $DATA_DIR
33 echo "const Map<String, List<int>> resources = const <String, List<int>> {"\
34 > $DATA_FILE
35 for f in `find . -type f -name *\\\\.data`; do
36 key=`echo $f | cut -b 3- | cut -d . -f 1`
37 echo "'$key': const <int>[" >> $DATA_FILE
38 od -A n -t d1 $f |\
39 sed 's/\([^ ]\) /\1,/g' |\
40 sed 's/\([^ ]\)$/\1,/' >> $DATA_FILE
41 echo "]," >> $DATA_FILE
42 done
43 echo "};" >> $DATA_FILE
44 fi
45
46 if [[ $# -eq 0 ]] || [[ "$1" == "service" ]]; then
47 # TODO(zerny): This must output service files *in the existing directory*.
48 # Find another way of supporting multiple services!
49 mkdir -p "$SERVICE_GEN_DIR"
50 $SERVICEC file "$IDL_FILE" out "$SERVICE_GEN_DIR"
51 fi
52
53 if [[ $# -eq 0 ]] || [[ "$1" == "snapshot" ]]; then
54 cd $DARTINO_DIR
55 $DART -c --packages=.packages \
56 -Dsnapshot="$SNAPSHOT_FILE" \
57 -Dpackages="$PKG_FILE" \
58 tests/dartino_compiler/run.dart "$MOCK_FILE"
59 fi
OLDNEW
« no previous file with comments | « samples/github/bin/run_github_mock.dart ('k') | samples/github/ios/.clang-format » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698