<commit_before>#!/bin/sh

source common.sh

function xcode_build {
	BUILD_DIRECTORY=${WORKSPACE}/build
	
	echo xcodebuild -configuration "$CONFIGURATION" -sdk "$SDK" -target "$TARGET" DSTROOT="${BUILD_DIRECTORY}" OBJROOT="${BUILD_DIRECTORY}/objects" SYMROOT="${BUILD_DIRECTORY}" SHARED_PRECOMPS_DIR="${BUILD_DIRECTORY}/shared" "$*" || fail "xcodebuild failed" 
	#xcodebuild -configuration "$CONFIGURATION" -sdk "$SDK" -target "$TARGET" DSTROOT="${BUILD_DIRECTORY}" OBJROOT="${BUILD_DIRECTORY}/objects" SYMROOT="${BUILD_DIRECTORY}" SHARED_PRECOMPS_DIR="${BUILD_DIRECTORY}/shared" OTHER_CODE_SIGN_FLAGS="--keychain /Users/groundkeeper/Library/Keychains/jenkins.keychain" "$*" || fail "xcodebuild failed" 
	xcodebuild -configuration "$CONFIGURATION" -sdk "$SDK" -target "$TARGET" DSTROOT="${BUILD_DIRECTORY}" OBJROOT="${BUILD_DIRECTORY}/objects" SYMROOT="${BUILD_DIRECTORY}" SHARED_PRECOMPS_DIR="${BUILD_DIRECTORY}/shared" "$*" || fail "xcodebuild failed" 
}

if [ -z "$CONFIGURATION" ]; then
	fail "Configration ERROR: CONFIGURATION missing"
	exit 1
fi


if [ -z "$SDK" ]; then
    fail "Configration ERROR: No SDK specified"
    exit 1
fi

if [ -z "$TARGET" ]; then
    fail "Configration ERROR: No TARGET specified"
    exit 1
fi

#echo $WORKING_DIRECTORY;

if [ $WORKING_DIRECTORY ]; then
  echo cd ${WORKING_DIRECTORY}
  cd ${WORKING_DIRECTORY}
fi


section_print "Building $CONFIGURATION using sdk $SDK"

#strange way to force backslash
if [ $PROJECT_DIRECTORY ]; then
    PROJECT_DIRECTORY=${PROJECT_DIRECTORY%/}
    PROJECT_DIRECTORY="$PROJECT_DIRECTORY/"

    section_print "Project Directory is specified and is $PROJECT_DIRECTORY"
    cd "$PROJECT_DIRECTORY" || fail "no directory $PROJECT_DIRECTORY"
    pwd
fi

if [ -z "$INFO_PLIST" ]; then
    INFO_PLIST=`ls *Info.plist | head -n1`
fi

INFO_PLIST=`cd "${PROJECT_DIRECTORY}" ; pwd`/${INFO_PLIST%.*}


#section_print "Cleaning up previous build"
#xcode_build clean
#rm -rf "${WORKSPACE}/build"


# Modify the bundle identifier (only in build configuration Debug and bundle identifier has to be set)
if [ $CONFIGURATION = "Debug" ] && [ "$BUNDLE_IDENTIFIER" ]; then
    section_print "Setting Bundle Identifer to $BUNDLE_IDENTIFIER"
    <commit_msg>debug output<commit_after>#!/bin/sh

source common.sh

function xcode_build {
	BUILD_DIRECTORY=${WORKSPACE}/build
	
	echo xcodebuild -configuration "$CONFIGURATION" -sdk "$SDK" -target "$TARGET" DSTROOT="${BUILD_DIRECTORY}" OBJROOT="${BUILD_DIRECTORY}/objects" SYMROOT="${BUILD_DIRECTORY}" SHARED_PRECOMPS_DIR="${BUILD_DIRECTORY}/shared" "$*" || fail "xcodebuild failed" 
	#xcodebuild -configuration "$CONFIGURATION" -sdk "$SDK" -target "$TARGET" DSTROOT="${BUILD_DIRECTORY}" OBJROOT="${BUILD_DIRECTORY}/objects" SYMROOT="${BUILD_DIRECTORY}" SHARED_PRECOMPS_DIR="${BUILD_DIRECTORY}/shared" OTHER_CODE_SIGN_FLAGS="--keychain /Users/groundkeeper/Library/Keychains/jenkins.keychain" "$*" || fail "xcodebuild failed" 
	xcodebuild -configuration "$CONFIGURATION" -sdk "$SDK" -target "$TARGET" DSTROOT="${BUILD_DIRECTORY}" OBJROOT="${BUILD_DIRECTORY}/objects" SYMROOT="${BUILD_DIRECTORY}" SHARED_PRECOMPS_DIR="${BUILD_DIRECTORY}/shared" "$*" || fail "xcodebuild failed" 
}

if [ -z "$CONFIGURATION" ]; then
	fail "Configration ERROR: CONFIGURATION missing"
	exit 1
fi


if [ -z "$SDK" ]; then
    fail "Configration ERROR: No SDK specified"
    exit 1
fi

if [ -z "$TARGET" ]; then
    fail "Configration ERROR: No TARGET specified"
    exit 1
fi

#echo $WORKING_DIRECTORY;

if [ $WORKING_DIRECTORY ]; then
  echo cd ${WORKING_DIRECTORY}
  cd ${WORKING_DIRECTORY}
fi


section_print "Building $CONFIGURATION using sdk $SDK"

#strange way to force backslash
if [ $PROJECT_DIRECTORY ]; then
    PROJECT_DIRECTORY=${PROJECT_DIRECTORY%/}
    PROJECT_DIRECTORY="$PROJECT_DIRECTORY/"

    section_print "Project Directory is specified and is $PROJECT_DIRECTORY"
    cd "$PROJECT_DIRECTORY" || fail "no directory $PROJECT_DIRECTORY"
    pwd
fi

if [ -z "$INFO_PLIST" ]; then
    INFO_PLIST=`ls *Info.plist | head -n1`
fi

INFO_PLIST=`cd "${PROJECT_DIRECTORY}" ; pwd`/${INFO_PLIST%.*}


#section_print "Cleaning up previous build"
#xcode_build clean
#rm -rf "${WORKSPACE}/build"


echo "infoplist path: !!! $INFO_PLIST"

# Modify the bundle identifier (only in build configuration Debug and bundle identifier has to be set)
if [ $CONFIGURATION = "Debug" ] && [ "$BUNDLE_IDENTIFIER" ]; then
    section_print "Setting Bundle Identifer to $BUNDLE_IDENTIFIER"
    
{'fraction_non_alphanumeric': 0.1367003367003367, 'fraction_numerical': 0.0017957351290684624, 'mean_word_length': 5.650746268656716, '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': '3166052', 'n_tokens_mistral': 1513, 'n_tokens_neox': 1478, 'n_words': 367}