<commit_before>#!/bin/bash
################################################################################
#  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
#  Please refer to the README for information about making permanent changes.  #
################################################################################
#   Build JNI interface for Android
#   Targets Android API level 8, ARM architecture (see below)
#
#   Requires these environment variables be set, e.g.:
#
#     ANDROID_NDK_ROOT=$HOME/android-ndk-r10e
#     TOOLCHAIN_NAME=arm-linux-androideabi-4.9
#     TOOLCHAIN_HOST=arm-linux-androideabi
#     TOOLCHAIN_ARCH=arm
#     TOOLCHAIN_PATH=$ANDROID_NDK_ROOT/toolchains/$TOOLCHAIN_NAME/prebuilt/linux-x86_64/bin
#
export ANDROID_API_LEVEL=android-8
export ANDROID_SYS_ROOT=$ANDROID_NDK_ROOT/platforms/$ANDROID_API_LEVEL/arch-$TOOLCHAIN_ARCH
if [ "$1" = "-d" ]; then
    MAKE_OPTIONS=VERBOSE=1
fi

source ../../../builds/android/android_build_helper.sh
android_build_env

#   Ensure we've built dependencies for Android
echo "********  Building Android native libraries"
( cd ../../../builds/android && ./build.sh )

#   Ensure we've built JNI interface
echo "********  Building JNI interface & classes"
( cd .. && gradle build jar )

cmake -v -DCMAKE_TOOLCHAIN_FILE=android_toolchain.cmake .

#   CMake wrongly searches current directory and then toolchain path instead
#   of lib path for these files, so make them available temporarily
ln -s $ANDROID_SYS_ROOT/usr/lib/crtend_so.o
ln -s $ANDROID_SYS_ROOT/usr/lib/crtbegin_so.o

echo "********  Building JNI for Android"
make $MAKE_OPTIONS
rm crtend_so.o crtbegin_so.o

echo "********  Building czmq.jar for Android"

#   Copy class files into org/zeromq/etc.
unzip -q ../build/libs/czmq*.jar

#   Copy native libraries into lib/armeabi
mkdir -p lib/armeabi
mv libczmqjni.so lib/armeabi
cp ../../../builds/android/prefix/*/lib/*.so lib/armeabi

zip -r -m czmq-android.jar lib/ org/ META-INF/

echo "********  Complete"
<commit_msg>Problem: JNI Android build.sh out of date<commit_after>#!/bin/bash
################################################################################
#  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
#  Please refer to the README for information about making permanent changes.  #
################################################################################
#   Build JNI interface for Android
#   Targets Android API level 8, ARM architecture (see below)
#
#   Requires these environment variables be set, e.g.:
#
#     ANDROID_NDK_ROOT=$HOME/android-ndk-r10e
#     TOOLCHAIN_NAME=arm-linux-androideabi-4.9
#     TOOLCHAIN_VERSION=4.9
#     TOOLCHAIN_HOST=arm-linux-androideabi
#     TOOLCHAIN_ARCH=arm
#     TOOLCHAIN_PATH=$ANDROID_NDK_ROOT/toolchains/$TOOLCHAIN_NAME/prebuilt/linux-x86_64/bin
#
export ANDROID_API_LEVEL=android-8
export ANDROID_SYS_ROOT=$ANDROID_NDK_ROOT/platforms/$ANDROID_API_LEVEL/arch-$TOOLCHAIN_ARCH
if [ "$1" = "-d" ]; then
    MAKE_OPTIONS=VERBOSE=1
fi

source ../../../builds/android/android_build_helper.sh
android_build_env

#   Ensure we've built dependencies for Android
echo "********  Building Android native libraries"
( cd ../../../builds/android && ./build.sh )

#   Ensure we've built JNI interface
echo "********  Building JNI interface & classes"
( cd .. && gradle build jar )

rm -rf build && mkdir build && cd build
cmake -v -DCMAKE_TOOLCHAIN_FILE=../android_toolchain.cmake ..

#   CMake wrongly searches current directory and then toolchain path instead
#   of lib path for these files, so make them available temporarily
ln -s $ANDROID_SYS_ROOT/usr/lib/crtend_so.o
ln -s $ANDROID_SYS_ROOT/usr/lib/crtbegin_so.o

echo "********  Building JNI for Android"
make $MAKE_OPTIONS

echo "********  Building czmq.jar for Android"

#   Copy class files into org/zeromq/etc.
unzip -q ../../build/libs/czmq*.jar

#   Copy native libraries into lib/armeabi
mkdir -p lib/armeabi
mv libczmqjni.so lib/armeabi
cp ../../../../builds/android/prefix/*/lib/*.so lib/armeabi
cp $ANDROID_NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$TOOLCHAIN_VERSION/libs/armeabi/libgnustl_shared.so lib/armeabi

zip -r -m ../czmq-android.jar lib/ org/ META-INF/
cd ..
rm -rf build

echo "********  Complete"

{'fraction_non_alphanumeric': 0.19396350023397285, 'fraction_numerical': 0.007487131492746842, 'mean_word_length': 4.2712700369913685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6248107', 'n_tokens_mistral': 1474, 'n_tokens_neox': 1398, 'n_words': 352}