Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2015 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | if [ ! -d art ]; then |
| 18 | echo "Script needs to be run at the root of the android tree" |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
Nicolas Geoffray | 4b29f38 | 2015-10-07 09:28:52 +0100 | [diff] [blame^] | 22 | out_dir=${OUT_DIR-out} |
| 23 | java_libraries_dir=${out_dir}/target/common/obj/JAVA_LIBRARIES |
| 24 | common_targets="vogar vogar.jar ${java_libraries_dir}/core-tests_intermediates/javalib.jar apache-harmony-jdwp-tests-hostdex ${java_libraries_dir}/jsr166-tests_intermediates/javalib.jar" |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 25 | mode="target" |
| 26 | j_arg="-j$(nproc)" |
Roland Levillain | b8b9356 | 2015-08-20 17:49:56 +0100 | [diff] [blame] | 27 | showcommands= |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 28 | make_command= |
| 29 | |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 30 | while true; do |
| 31 | if [[ "$1" == "--host" ]]; then |
| 32 | mode="host" |
| 33 | shift |
| 34 | elif [[ "$1" == "--target" ]]; then |
| 35 | mode="target" |
| 36 | shift |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 37 | elif [[ "$1" == -j* ]]; then |
Nicolas Geoffray | 667b99e | 2015-05-29 12:17:06 +0100 | [diff] [blame] | 38 | j_arg=$1 |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 39 | shift |
Roland Levillain | b8b9356 | 2015-08-20 17:49:56 +0100 | [diff] [blame] | 40 | elif [[ "$1" == "--showcommands" ]]; then |
| 41 | showcommands="showcommands" |
| 42 | shift |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 43 | elif [[ "$1" == "" ]]; then |
| 44 | break |
| 45 | fi |
| 46 | done |
| 47 | |
| 48 | if [[ $mode == "host" ]]; then |
Nicolas Geoffray | 4b29f38 | 2015-10-07 09:28:52 +0100 | [diff] [blame^] | 49 | make_command="make $j_arg $showcommands build-art-host-tests $common_targets ${out_dir}/host/linux-x86/lib/libjavacoretests.so ${out_dir}/host/linux-x86/lib64/libjavacoretests.so" |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 50 | elif [[ $mode == "target" ]]; then |
Nicolas Geoffray | 4b29f38 | 2015-10-07 09:28:52 +0100 | [diff] [blame^] | 51 | make_command="make $j_arg $showcommands build-art-target-tests $common_targets libjavacrypto libjavacoretests linker toybox toolbox sh ${out_dir}/host/linux-x86/bin/adb" |
Nicolas Geoffray | fbeca75 | 2015-05-29 10:54:12 +0100 | [diff] [blame] | 52 | fi |
| 53 | |
Nicolas Geoffray | aadc986 | 2015-09-29 14:56:31 +0100 | [diff] [blame] | 54 | echo "Executing $make_command" |
| 55 | $make_command |