<commit_before>#!/bin/bash
#
# android_setup.sh: Sets environment variables used by other Android scripts.

# Parse the arguments for a DEVICE_ID.
DEVICE_ID=""
DEVICE_SERIAL=""
while (( "$#" )); do
  if [[ $(echo "$1" | grep "^-d$") != "" ]];
  then
    DEVICE_ID=$2
    shift
  elif [[ "$1" == "-s" ]];
  then
    if [[ $# -lt 2 ]];
    then
      echo "ERROR: missing serial number"
      exit 1;
    fi
    DEVICE_SERIAL="-s $2"
    shift
  else
    APP_ARGS=("${APP_ARGS[@]}" "${1}")
  fi

  shift
done

function verbose {
    if [[ -n $SKIA_ANDROID_VERBOSE_SETUP ]]; then
        echo $@
    fi
}

function exportVar {
  NAME=$1
  VALUE=$2
  verbose export $NAME=\"$VALUE\"
  export $NAME="$VALUE"
}

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# A valid Android SDK installation is required to build the sample app.
if [ -z "$ANDROID_SDK_ROOT" ]; then
  ANDROID_TOOL=$(which android 2>/dev/null)
  if [ -z "$ANDROID_TOOL" ]; then<commit_msg>Fix ninja build for Android<commit_after>#!/bin/bash
#
# android_setup.sh: Sets environment variables used by other Android scripts.

# Parse the arguments for a DEVICE_ID.
DEVICE_ID=""
DEVICE_SERIAL=""
while (( "$#" )); do
  if [[ $(echo "$1" | grep "^-d$") != "" ]];
  then
    DEVICE_ID=$2
    shift
  elif [[ "$1" == "-s" ]];
  then
    if [[ $# -lt 2 ]];
    then
      echo "ERROR: missing serial number"
      exit 1;
    fi
    DEVICE_SERIAL="-s $2"
    shift
  elif [[ $(echo "$1" | grep "^BUILDTYPE=") != "" ]];
  then
    BUILDTYPE=${1##BUILDTYPE=}
  else
    APP_ARGS=("${APP_ARGS[@]}" "${1}")
  fi

  shift
done

function verbose {
    if [[ -n $SKIA_ANDROID_VERBOSE_SETUP ]]; then
        echo $@
    fi
}

function exportVar {
  NAME=$1
  VALUE=$2
  verbose export $NAME=\"$VALUE\"
  export $NAME="$VALUE"
}

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# A valid Android SDK installation is required to build the sample app.
if [ -z "$ANDROID_SDK_ROOT" ]; then
  ANDROID_TOOL=$(which android 2>/dev/null)
  if [ -z "$ANDROID_TOOL" ]; then
{'fraction_non_alphanumeric': 0.17990196078431372, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 3.05765407554672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4928827', 'n_tokens_mistral': 789, 'n_tokens_neox': 739, 'n_words': 206}