<commit_before>#!/bin/bash
set -euo pipefail

# requires jdk 11 or later

readonly SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
readonly PROJ_ROOT=$SCRIPT_DIR/../
readonly BUILD_DIR=$SCRIPT_DIR/build

readonly CMD_LINE_TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip"
readonly SDK_MANAGER=sdk-tools-linux/cmdline-tools/latest/bin/sdkmanager

set -x
mkdir -p $BUILD_DIR
cd $BUILD_DIR


readonly SDK_DIR=$BUILD_DIR/sdk-tools-linux
if [[ ! -d $SDK_DIR ]]; then
    wget --quiet ${CMD_LINE_TOOLS_URL} -O tools.zip
    unzip -qq tools.zip -d sdk-tools-linux
    mkdir sdk-tools-linux/cmdline-tools/latest
    mv sdk-tools-linux/cmdline-tools/* sdk-tools-linux/cmdline-tools/latest/  || true
    yes | ${SDK_MANAGER} --licenses > /dev/null || true
    ${SDK_MANAGER} --install ndk-bundle > /dev/null
    yes | ${SDK_MANAGER} --licenses  > /dev/null || true
fi

export ANDROID_HOME=$PWD/sdk-tools-linux
export PATH=$PATH:$PWD/sdk-tools-linux/platform-tools/

cd $PROJ_ROOT
chmod +x ./gradlew

# build
./gradlew test
./gradlew assembleDebug
<commit_msg>build.sh<commit_after>#!/bin/bash
set -euo pipefail

# requires jdk 11 or later

readonly SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
readonly PROJ_ROOT=$SCRIPT_DIR/../
readonly BUILD_DIR=$SCRIPT_DIR/build

readonly CMD_LINE_TOOLS_URL="https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip"
readonly SDK_MANAGER=sdk-tools-linux/cmdline-tools/latest/bin/sdkmanager

set -x
mkdir -p $BUILD_DIR
cd $BUILD_DIR


readonly SDK_DIR=$BUILD_DIR/sdk-tools-linux
if [[ ! -d $SDK_DIR ]]; then
    wget --quiet ${CMD_LINE_TOOLS_URL} -O tools.zip
    unzip -qq tools.zip -d sdk-tools-linux
    mkdir sdk-tools-linux/cmdline-tools/latest
    mv sdk-tools-linux/cmdline-tools/* sdk-tools-linux/cmdline-tools/latest/  || true
    yes | ${SDK_MANAGER} --licenses > /dev/null || true
    ${SDK_MANAGER} --install ndk-bundle > /dev/null
    yes | ${SDK_MANAGER} --licenses  > /dev/null || true
fi

export ANDROID_HOME=$PWD/sdk-tools-linux
unset ANDROID_SDK_ROOT
export PATH=$PATH:$PWD/sdk-tools-linux/platform-tools/

cd $PROJ_ROOT
chmod +x ./gradlew

# build
./gradlew test
./gradlew assembleDebug

{'fraction_non_alphanumeric': 0.14933920704845816, 'fraction_numerical': 0.00881057268722467, 'mean_word_length': 3.8733905579399144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '4845688', 'n_tokens_mistral': 930, 'n_tokens_neox': 848, 'n_words': 166}