<commit_before>#!/bin/bash -xe

#
# This script automates the build process described by webrtc:
# https://code.google.com/p/webrtc/source/browse/trunk/talk/app/webrtc/objc/README
#
PWD=`pwd`
ROOT=$PWD
WEBRTC_ROOT=$ROOT/trunk

if [ -z $WEBRTC_REVISION ]; then
    export SYNC_REVISION=""
else
    export SYNC_REVISION="-r $WEBRTC_REVISION"
fi

if [ -z $CONFIGURATION ]; then
    CONFIGURATION=Release
fi

function retry_cmd
{
    RETRIES=3
    RETCODE=-1
    set +e
    while [ $RETRIES -gt 0 ] && [ $RETCODE -ne 0 ]; do
        $RETRY_CMD
        RETCODE=$?
        RETRIES=`expr $RETRIES - 1`
    done
    set -e
    if [ $RETCODE -ne 0]; then
	exit $RETCODE
    fi
}

gclient config http://webrtc.googlecode.com/svn/trunk
echo "target_os = ['mac']" >> .gclient
RETRY_CMD="gclient revert"
retry_cmd
RETRY_CMD="gclient sync $SYNC_REVISION"
retry_cmd
perl -i -wpe "s/target\_os \= \[\'mac\'\]/target\_os \= \[\'ios\', \'mac\']/g" \
.gclient
#rerun seync with perl substituions                                             
retry_cmd
export OUTPUT_DIR=out_iossim
cd $WEBRTC_ROOT
export GYP_DEFINES="\
build_with_libjingle=1 \
build_with_chromium=0 \
libjingle_objc=1 \
OS=ios \
target_arch=ia32 \
enable_tracing=1"
export GYP_GENERATORS="ninja"
export GYP_GENERATOR_FLAGS="output_dir=$OUTPUT_DIR"
export GYP_CROSSCOMPILE=1
if [ -d $OUTPUT_DIR ]; then
    rm -rf $OUTPUT_DIR
fi
if [ -d out.huge ]; then
    rm -rf out.huge
fi
# hop up one level and apply patches before continuing
cd $ROOT
PATCHES=`find $PWD/patches -name *.diff`<commit_msg>MODIFY iossim build script to default lightweight builds<commit_after>#!/bin/bash -xe

#
# This script automates the build process described by webrtc:
# https://code.google.com/p/webrtc/source/browse/trunk/talk/app/webrtc/objc/README
#
PWD=`pwd`
ROOT=$PWD
WEBRTC_ROOT=$ROOT/trunk

if [ -z $WEBRTC_REVISION ]; then
    export SYNC_REVISION=""
else
    export SYNC_REVISION="-r $WEBRTC_REVISION"
fi

if [ -z $CONFIGURATION ]; then
    CONFIGURATION=Release
fi

function retry_cmd
{
    RETRIES=3
    RETCODE=-1
    set +e
    while [ $RETRIES -gt 0 ] && [ $RETCODE -ne 0 ]; do
        $RETRY_CMD
        RETCODE=$?
        RETRIES=`expr $RETRIES - 1`
    done
    set -e
    if [ $RETCODE -ne 0]; then
	exit $RETCODE
    fi
}

gclient config http://webrtc.googlecode.com/svn/trunk
echo "target_os = ['mac']" >> .gclient
RETRY_CMD="gclient revert"
retry_cmd
RETRY_CMD="gclient sync $SYNC_REVISION"
retry_cmd
perl -i -wpe "s/target\_os \= \[\'mac\'\]/target\_os \= \[\'ios\', \'mac\']/g" \
.gclient
#rerun seync with perl substituions                                             
retry_cmd
export OUTPUT_DIR=out_iossim
cd $WEBRTC_ROOT
export GYP_DEFINES="\
build_with_libjingle=1 \
build_with_chromium=0 \
libjingle_objc=1 \
OS=ios \
target_arch=ia32 \
enable_tracing=0"
if [ "1" == "$DEBUG" ]; then
    export GYP_DEFINES="$GYP_DEFINES fastbuild=0"
else
    export GYP_DEFINES="$GYP_DEFINES fastbuild=1"
fi
export GYP_GENERATORS="ninja"
export GYP_GENERATOR_FLAGS="output_dir=$OUTPUT_DIR"
export GYP_CROSSCOMPILE=1
if [ -d $OUTPUT_DIR ]; then
    rm -rf $OUTPUT_DIR
fi
if [ -d out.huge ]; then
    rm -rf out.huge
fi
# hop up one level and apply patches before continuing
cd $ROOT
PATCHES=`find $PWD/patches -name *.diff`
{'fraction_non_alphanumeric': 0.12768569674647023, 'fraction_numerical': 0.008901166359729895, 'mean_word_length': 3.27129750982962, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '2188609', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1272, 'n_words': 296}