<commit_before>#!/bin/sh
set -e

# Build configurations
scheme="parent"
ipaDir="build/ipa/"
configuration="Release"


# Clean
mkdir -p ${ipaDir}
rm -rf ${ipaDir}*.ipa

# Provisioning configurations
AdHocProvisioning="com.malalaoshi.app-AppStore"
security -v unlock-keychain -p ${KEYCHAIN_PASSWORD} ${KEYCHAIN_PATH}
security set-keychain-settings -l -u -t 3600 ${KEYCHAIN_PATH}
security list-keychains -s ${KEYCHAIN_PATH}


# Unit Test
# xctool -workspace mala-ios.xcworkspace -scheme ${scheme} -configuration DevRelease -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5s,OS=8.4' test -freshInstall -freshSimulator


# Compile Project Release
buildPath="build/${scheme}.xcarchive"
xctool -workspace mala-ios.xcworkspace -scheme ${scheme} -configuration ${configuration} archive -archivePath ${buildPath} -derivedDataPath build/derivedData

python --version
python replace_info.py

# Export dev package
cfg="dev"
ipaName="${ipaDir}${scheme}_${cfg}_release.ipa"
mv build/${cfg}-Info.plist build/${scheme}.xcarchive/Info.plist
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} -exportProvisioningProfile "${AdHocProvisioning}"

# Export stage package
cfg="stage"
ipaName="${ipaDir}${scheme}_${cfg}_release.ipa"
mv build/${cfg}-Info.plist build/${scheme}.xcarchive/Info.plist
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} -exportProvisioningProfile "${AdHocProvisioning}"

# Export prd package
cfg="prd"
ipaName="${ipaDir}${scheme}_${cfg}_release.ipa"
mv build/${cfg}-Info.plist build/${scheme}.xcarchive/Info.plist
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} -exportProvisioningProfile "${AdHocProvisioning}"<commit_msg>IOS-329: Clean derived data before building.<commit_after>#!/bin/sh
set -e

# Build configurations
scheme="parent"
ipaDir="build/ipa/"
configuration="Release"
derivedDataPath="build/derivedDada"

# Clean
mkdir -p ${ipaDir}
rm -rf ${ipaDir}*.ipa
rm -rf ${derivedDataPath}

# Provisioning configurations
AdHocProvisioning="com.malalaoshi.app-AppStore"
security -v unlock-keychain -p ${KEYCHAIN_PASSWORD} ${KEYCHAIN_PATH}
security set-keychain-settings -l -u -t 3600 ${KEYCHAIN_PATH}
security list-keychains -s ${KEYCHAIN_PATH}


# Unit Test
# xctool -workspace mala-ios.xcworkspace -scheme ${scheme} -configuration DevRelease -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5s,OS=8.4' test -freshInstall -freshSimulator


# Compile Project Release
buildPath="build/${scheme}.xcarchive"
xctool -workspace mala-ios.xcworkspace -scheme ${scheme} -configuration ${configuration} archive -archivePath ${buildPath} -derivedDataPath ${derivedDataPath}

python --version
python replace_info.py

# Export dev package
cfg="dev"
ipaName="${ipaDir}${scheme}_${cfg}_release.ipa"
mv build/${cfg}-Info.plist build/${scheme}.xcarchive/Info.plist
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} -exportProvisioningProfile "${AdHocProvisioning}"

# Export stage package
cfg="stage"
ipaName="${ipaDir}${scheme}_${cfg}_release.ipa"
mv build/${cfg}-Info.plist build/${scheme}.xcarchive/Info.plist
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} -exportProvisioningProfile "${AdHocProvisioning}"

# Export prd package
cfg="prd"
ipaName="${ipaDir}${scheme}_${cfg}_release.ipa"
mv build/${cfg}-Info.plist build/${scheme}.xcarchive/Info.plist
xcodebuild -exportArchive -exportFormat IPA -archivePath ${buildPath} -exportPath ${ipaName} -exportProvisioningProfile "${AdHocProvisioning}"
{'fraction_non_alphanumeric': 0.1401151631477927, 'fraction_numerical': 0.004661365505895256, 'mean_word_length': 6.728813559322034, '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': '2433203', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1174, 'n_words': 262}