<commit_before>#!/bin/bash
#
# This script mavenizes all dependencies from the Android SDK required to build Robolectric.
#
# Usage:
#   install-dependencies.sh
#
# Assumptions:
#  1. You've got one or more Android SDKs installed locally.
#  2. Your ANDROID_HOME environment variable points to the Android SDK install directory.
#  3. You have installed the Android Repository and Google Repository libraries from the SDK installer.

set -e

ANDROID_REPOSITORY=${ANDROID_HOME}/extras/android/m2repository
GOOGLE_REPOSITORY=${ANDROID_HOME}/extras/google/m2repository

function install_jar() {
  groupId=$1; artifactId=$2; version=$3; archive=$4

  if [ ! -f "$archive" ]; then
      echo "${groupId}:${artifactId} not found! Make sure that the 'Android Support Library' and 'Google Repository' is up to date in the SDK Manager."
      exit 1;
  fi

  echo "Installing ${groupId}:${artifactId} from ${archive}"
  mvn -q install:install-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile="${archive}"
}

function install_aar() {
  groupId=$1; artifactId=$2; version=$3; archive=$4

  if [ ! -f "$archive" ]; then
    echo "${groupId}:${artifactId} not found! Make sure that the 'Android Support Repository' and 'Google Repository' is up to date in the SDK manager."
    exit 1
  fi

  tempdir=`mktemp -qd /tmp/robolectric-dependencies.XXXXXX`
  cd ${tempdir}; jar xvf ${archive} > /dev/null 2>&1

  echo "Installing ${groupId}:${artifactId} from ${archive}"
  mvn -q install:install-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile="${tempdir}/classes.jar"
  rm -rf ${tempdir}
}

function install_maps() {
  groupId=$1; artifactId=$2

  cd "${ANDROID_HOME}"/add-ons
  for dir in `ls -1d addon-google_apis-google-*`; do
    (
      name=`grep ^name= ${dir}/manifest.ini | cut -d= -f2`
      api=`grep ^api= ${dir}/manifest.ini | cut -d= -f2`
      version=`grep ^revision= ${dir}/manifest.ini | cut -d= -f2`

      echo "Installing ${groupId}:${artifactId} from ${ANDROID_HOME}/add-ons/${dir}/libs/maps.jar"
      mvn -q install:install-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${api}_r${version} -Dpackaging=jar -Dfile=${dir}/libs/maps.jar
    )
  done
}

if [ -z "{ANDROID_HOME}" ]; then
  echo "You must set \$ANDROID_HOME"
  exit 1<commit_msg>Fix check for ANDROID_HOME environmental variable<commit_after>#!/bin/bash
#
# This script mavenizes all dependencies from the Android SDK required to build Robolectric.
#
# Usage:
#   install-dependencies.sh
#
# Assumptions:
#  1. You've got one or more Android SDKs installed locally.
#  2. Your ANDROID_HOME environment variable points to the Android SDK install directory.
#  3. You have installed the Android Repository and Google Repository libraries from the SDK installer.

set -e

ANDROID_REPOSITORY=${ANDROID_HOME}/extras/android/m2repository
GOOGLE_REPOSITORY=${ANDROID_HOME}/extras/google/m2repository

function install_jar() {
  groupId=$1; artifactId=$2; version=$3; archive=$4

  if [ ! -f "$archive" ]; then
      echo "${groupId}:${artifactId} not found! Make sure that the 'Android Support Library' and 'Google Repository' is up to date in the SDK Manager."
      exit 1;
  fi

  echo "Installing ${groupId}:${artifactId} from ${archive}"
  mvn -q install:install-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile="${archive}"
}

function install_aar() {
  groupId=$1; artifactId=$2; version=$3; archive=$4

  if [ ! -f "$archive" ]; then
    echo "${groupId}:${artifactId} not found! Make sure that the 'Android Support Repository' and 'Google Repository' is up to date in the SDK manager."
    exit 1
  fi

  tempdir=`mktemp -qd /tmp/robolectric-dependencies.XXXXXX`
  cd ${tempdir}; jar xvf ${archive} > /dev/null 2>&1

  echo "Installing ${groupId}:${artifactId} from ${archive}"
  mvn -q install:install-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dfile="${tempdir}/classes.jar"
  rm -rf ${tempdir}
}

function install_maps() {
  groupId=$1; artifactId=$2

  cd "${ANDROID_HOME}"/add-ons
  for dir in `ls -1d addon-google_apis-google-*`; do
    (
      name=`grep ^name= ${dir}/manifest.ini | cut -d= -f2`
      api=`grep ^api= ${dir}/manifest.ini | cut -d= -f2`
      version=`grep ^revision= ${dir}/manifest.ini | cut -d= -f2`

      echo "Installing ${groupId}:${artifactId} from ${ANDROID_HOME}/add-ons/${dir}/libs/maps.jar"
      mvn -q install:install-file -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${api}_r${version} -Dpackaging=jar -Dfile=${dir}/libs/maps.jar
    )
  done
}

if [ -z "${ANDROID_HOME}" ]; then
  echo "You must set \$ANDROID_HOME"
  exit 1
{'fraction_non_alphanumeric': 0.15036803364879076, 'fraction_numerical': 0.010094637223974764, 'mean_word_length': 4.2727272727272725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2623674', 'n_tokens_mistral': 1698, 'n_tokens_neox': 1537, 'n_words': 450}