OLD | NEW |
| (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 set -ue | |
8 | |
9 DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | |
10 SERVICEC_DIR=$DIR/../../../tools/servicec | |
11 JAVA_DIR=$DIR/../java | |
12 DARTINO_DIR=$DIR/../../.. | |
13 | |
14 if [[ $# -eq 1 ]] && [[ "$1" == "snapshot" ]]; then | |
15 echo "Only rebuilding the Dart snapshot." | |
16 echo "If Dartino or any IMMI files changed re-run compile.sh without argumen
ts." | |
17 else | |
18 | |
19 | |
20 # Build the native interpreter src for arm and x86. | |
21 cd $DARTINO_DIR | |
22 ninja | |
23 ninja -C out/ReleaseIA32 | |
24 # Regenerate java and jni sources. | |
25 out/ReleaseIA32/dartino x-servicec file samples/todomvc/todomvc_service.idl out
samples/todomvc/ | |
26 | |
27 ninja -C out/ReleaseXARMAndroid dartino_vm_library_generator | |
28 ninja -C out/ReleaseIA32Android dartino_vm_library_generator | |
29 mkdir -p out/ReleaseXARMAndroid/obj/src/vm/dartino_vm.gen | |
30 mkdir -p out/ReleaseIA32Android/obj/src/vm/dartino_vm.gen | |
31 out/ReleaseXARMAndroid/dartino_vm_library_generator > out/ReleaseXARMAndroid/obj
/src/vm/dartino_vm.gen/generated.S | |
32 out/ReleaseIA32Android/dartino_vm_library_generator > out/ReleaseIA32Android/obj
/src/vm/dartino_vm.gen/generated.S | |
33 | |
34 # Compile Dartino runtime and jni code into libdartino.so. | |
35 cd $JAVA_DIR | |
36 CPUCOUNT=1 | |
37 if [[ $(uname) = 'Darwin' ]]; then | |
38 CPUCOUNT=$(sysctl -n hw.logicalcpu_max) | |
39 else | |
40 CPUCOUNT=$(lscpu -p | grep -vc '^#') | |
41 fi | |
42 NDK_MODULE_PATH=. ndk-build -j$CPUCOUNT | |
43 | |
44 # Copy Java source and dartino library to the right places. | |
45 mkdir -p $DIR/TodoMVC/app/src/main/java/dartino | |
46 cp -R dartino/*.java $DIR/TodoMVC/app/src/main/java/dartino/ | |
47 mkdir -p $DIR/TodoMVC/app/src/main/jniLibs/ | |
48 cp -R libs/* $DIR/TodoMVC/app/src/main/jniLibs/ | |
49 | |
50 fi | |
51 | |
52 # Build snapshot. | |
53 cd $DARTINO_DIR | |
54 mkdir -p $DIR/TodoMVC/app/src/main/res/raw | |
55 | |
56 ./out/ReleaseIA32/dart \ | |
57 -c --packages=.packages \ | |
58 -Dsnapshot="$DIR/TodoMVC/app/src/main/res/raw/todomvc_snapshot" \ | |
59 tests/dartino_compiler/run.dart "$DIR/../todomvc.dart" | |
OLD | NEW |