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

Side by Side Diff: platform_tools/android/bin/android_setup.sh

Issue 1903253003: VulkanViewer on Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: gyp Created 4 years, 8 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
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 ############################################################################### 2 ###############################################################################
3 # Copyright 2015 Google Inc. 3 # Copyright 2015 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 ############################################################################### 7 ###############################################################################
8 # 8 #
9 # android_setup.sh: Sets environment variables used by other Android scripts. 9 # android_setup.sh: Sets environment variables used by other Android scripts.
10 10
(...skipping 20 matching lines...) Expand all
31 elif [[ "$1" == "--release" ]]; then 31 elif [[ "$1" == "--release" ]]; then
32 BUILDTYPE=Release 32 BUILDTYPE=Release
33 elif [[ "$1" == "--gcc" ]]; then 33 elif [[ "$1" == "--gcc" ]]; then
34 USE_CLANG="false" 34 USE_CLANG="false"
35 elif [[ "$1" == "--clang" ]]; then 35 elif [[ "$1" == "--clang" ]]; then
36 USE_CLANG="true" 36 USE_CLANG="true"
37 elif [[ "$1" == "--logcat" ]]; then 37 elif [[ "$1" == "--logcat" ]]; then
38 LOGCAT=1 38 LOGCAT=1
39 elif [[ "$1" == "--verbose" ]]; then 39 elif [[ "$1" == "--verbose" ]]; then
40 VERBOSE="true" 40 VERBOSE="true"
41 elif [[ "$1" == "--vulkan" ]]; then
42 SKIA_VULKAN="true"
41 else 43 else
42 APP_ARGS=("${APP_ARGS[@]}" "${1}") 44 APP_ARGS=("${APP_ARGS[@]}" "${1}")
43 fi 45 fi
44 shift 46 shift
45 done 47 done
46 48
47 if [ "$USE_CLANG" == "true" ]; then 49 if [ "$USE_CLANG" == "true" ]; then
48 export GYP_DEFINES="skia_clang_build=1 $GYP_DEFINES" 50 export GYP_DEFINES="skia_clang_build=1 $GYP_DEFINES"
49 fi 51 fi
50 52
53 if [ "$SKIA_VULKAN" == "true" ]; then
54 export GYP_DEFINES="skia_vulkan=1 $GYP_DEFINES"
55 fi
56
51 function verbose { 57 function verbose {
52 if [[ -n $VERBOSE ]]; then 58 if [[ -n $VERBOSE ]]; then
53 echo $@ 59 echo $@
54 fi 60 fi
55 } 61 }
56 62
57 function exportVar { 63 function exportVar {
58 NAME=$1 64 NAME=$1
59 VALUE=$2 65 VALUE=$2
60 verbose export $NAME=\"$VALUE\" 66 verbose export $NAME=\"$VALUE\"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 esac 166 esac
161 167
162 verbose "The build is targeting the device: $TARGET_DEVICE" 168 verbose "The build is targeting the device: $TARGET_DEVICE"
163 exportVar DEVICE_ID $TARGET_DEVICE 169 exportVar DEVICE_ID $TARGET_DEVICE
164 170
165 if [ -z "$SKIP_TOOLCHAIN_SETUP" ]; then 171 if [ -z "$SKIP_TOOLCHAIN_SETUP" ]; then
166 # setup the appropriate cross compiling toolchains 172 # setup the appropriate cross compiling toolchains
167 source $SCRIPT_DIR/utils/setup_toolchain.sh 173 source $SCRIPT_DIR/utils/setup_toolchain.sh
168 fi 174 fi
169 175
170 DEFINES="${DEFINES} android_toolchain=${TOOLCHAIN_TYPE}" 176 DEFINES="${DEFINES} android_toolchain=${ANDROID_TOOLCHAIN}"
171 DEFINES="${DEFINES} android_buildtype=${BUILDTYPE}" 177 DEFINES="${DEFINES} android_buildtype=${BUILDTYPE}"
172 exportVar GYP_DEFINES "$DEFINES $GYP_DEFINES" 178 exportVar GYP_DEFINES "$DEFINES $GYP_DEFINES"
173 179
174 SKIA_SRC_DIR=$(cd "${SCRIPT_DIR}/../../.."; pwd) 180 SKIA_SRC_DIR=$(cd "${SCRIPT_DIR}/../../.."; pwd)
175 DEFAULT_SKIA_OUT="${SKIA_SRC_DIR}/out/config/android-${TARGET_DEVICE}" 181 DEFAULT_SKIA_OUT="${SKIA_SRC_DIR}/out/config/android-${TARGET_DEVICE}"
176 exportVar SKIA_OUT "${SKIA_OUT:-${DEFAULT_SKIA_OUT}}" 182 exportVar SKIA_OUT "${SKIA_OUT:-${DEFAULT_SKIA_OUT}}"
177 } 183 }
178 184
179 # adb_pull_if_needed(android_src, host_dst) 185 # adb_pull_if_needed(android_src, host_dst)
180 adb_pull_if_needed() { 186 adb_pull_if_needed() {
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")" 273 $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")"
268 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST 274 $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
269 fi 275 fi
270 fi 276 fi
271 277
272 # turn error checking back on 278 # turn error checking back on
273 set -e 279 set -e
274 } 280 }
275 281
276 setup_device "${DEVICE_ID}" 282 setup_device "${DEVICE_ID}"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698