<commit_before># Copyright © 2012, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU Lesser General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St 
# - Fifth Floor, Boston, MA 02110-1301 USA


set -ex

source ./android-env.sh

# download Android NDK and create standalone toolchain
if ! test -d android-ndk-r8c; then
  wget http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2
  tar jxf android-ndk-r8c-linux-x86.tar.bz2
  rm android-ndk-r8c-linux-x86.tar.bz2
  pushd android-ndk-r8c
  ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=../toolchain
  popd
fi

PREFIX=$PWD/jhbuild/.local

# set up patched version of jhbuild
if ! test -d jhbuild; then
  git clone git://git.gnome.org/jhbuild
  pushd jhbuild
  patch -p1 -i ../modulesets/patches/jhbuild/disable-clean-la-files.patch
  ./autogen.sh --prefix=$PREFIX
  make install
  popd
fi

mkdir -p $PREFIX/share/aclocal
cp /usr/share/aclocal/gtk-doc.m4 $PREFIX/share/aclocal/

# start the build
$PREFIX/bin/jhbuild -f jhbuildrc-android build -q mx libsoup

# download Android SDK
if ! test -d android-sdk-linux; then
  wget http://dl.google.com/android/android-sdk_r21-linux.tgz
  tar zxf android-sdk_r21-linux.tgz
  rm android-sdk_r21-linux.tgz
fi

android update sdk -u --filter platform-tool,tool
android update sdk -u --filter android-14
<commit_msg>Source the Android environment script just before starting jhbuild<commit_after># Copyright © 2012, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU Lesser General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St 
# - Fifth Floor, Boston, MA 02110-1301 USA


set -ex

# download Android NDK and create standalone toolchain
if ! test -d android-ndk-r8c; then
  wget http://dl.google.com/android/ndk/android-ndk-r8c-linux-x86.tar.bz2
  tar jxf android-ndk-r8c-linux-x86.tar.bz2
  rm android-ndk-r8c-linux-x86.tar.bz2
  pushd android-ndk-r8c
  ./build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=../toolchain
  popd
fi

JHB_PREFIX=$PWD/jhbuild/.local

# set up patched version of jhbuild
if ! test -d jhbuild; then
  git clone git://git.gnome.org/jhbuild
  pushd jhbuild
  patch -p1 -i ../modulesets/patches/jhbuild/disable-clean-la-files.patch
  ./autogen.sh --prefix=$JHB_PREFIX
  make install
  popd
fi

mkdir -p $JHB_PREFIX/share/aclocal
cp /usr/share/aclocal/gtk-doc.m4 $JHB_PREFIX/share/aclocal/

source ./android-env.sh

# start the build
$JHB_PREFIX/bin/jhbuild -f jhbuildrc-android build -q mx libsoup

# download Android SDK
if ! test -d android-sdk-linux; then
  wget http://dl.google.com/android/android-sdk_r21-linux.tgz
  tar zxf android-sdk_r21-linux.tgz
  rm android-sdk_r21-linux.tgz
fi

android update sdk -u --filter platform-tool,tool
android update sdk -u --filter android-14

{'fraction_non_alphanumeric': 0.09511366605696368, 'fraction_numerical': 0.02247191011235955, 'mean_word_length': 3.685434516523868, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3676784', 'n_tokens_mistral': 1329, 'n_tokens_neox': 1245, 'n_words': 432}