Initial commit
This commit is contained in:
56
tools/package-ida.sh
Executable file
56
tools/package-ida.sh
Executable file
@ -0,0 +1,56 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
#
|
||||
# package-ipa.sh
|
||||
#
|
||||
# Bundles an iOS app correctly, using the same directory structure that Xcode does when using the export functionality.
|
||||
#
|
||||
|
||||
xcarchive="$1"
|
||||
output_ipa="$2"
|
||||
build_dir=$(mktemp -d '/tmp/package-ipa.XXXXXX')
|
||||
echo "build_dir: $build_dir"
|
||||
|
||||
if [ ! -d "${xcarchive}" ]; then
|
||||
echo "Usage: package-ipa.sh /path/to/app.xcarchive /path/to/ouput.ipa"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Packaging ${xcarchive} into ${output_ipa}"
|
||||
|
||||
if [ -f "${output_ipa}" ]; then
|
||||
rm "${output_ipa}"
|
||||
fi
|
||||
|
||||
# if [ -d "${build_dir}" ]; then
|
||||
# rm -rf "${build_dir}"
|
||||
# fi
|
||||
|
||||
echo "Preparing folder tree for IPA"
|
||||
mkdir -p "${build_dir}/Payload"
|
||||
|
||||
# Copy .app into Payload dir
|
||||
pushd "${xcarchive}/Products/Applications" > /dev/null
|
||||
ls -l
|
||||
cp -Rp ./*.app "${build_dir}/Payload"
|
||||
popd > /dev/null
|
||||
|
||||
# Check for and copy swift libraries
|
||||
#if [ -d "${xcarchive}/SwiftSupport" ]; then
|
||||
# echo "Adding Swift support dylibs"
|
||||
# cp -Rp "${xcarchive}/SwiftSupport" "${build_dir}/"
|
||||
#fi
|
||||
|
||||
# Check for and copy WatchKit file
|
||||
#if [ -d "${xcarchive}/WatchKitSupport" ]; then
|
||||
# echo "Adding WatchKit support file"
|
||||
# cp -Rp "${xcarchive}/WatchKitSupport" "${build_dir}/"
|
||||
#fi
|
||||
|
||||
echo "Zipping"
|
||||
pushd "${build_dir}" > /dev/null
|
||||
zip --symlinks --verbose --recurse-paths "${output_ipa}" .
|
||||
popd > /dev/null
|
||||
|
||||
rm -rf "${build_dir}"
|
||||
echo "Created ${output_ipa}"
|
55
tools/prepare_new_release_version.sh
Executable file
55
tools/prepare_new_release_version.sh
Executable file
@ -0,0 +1,55 @@
|
||||
#! /bin/bash
|
||||
|
||||
_HOME2_=$(dirname $0)
|
||||
export _HOME2_
|
||||
_HOME_=$(cd $_HOME2_;pwd)
|
||||
export _HOME_
|
||||
|
||||
basedir="$_HOME_""/../"
|
||||
f1="Antidote.xcodeproj/project.pbxproj"
|
||||
f2="pushextension/Info.plist"
|
||||
|
||||
cd "$basedir"
|
||||
|
||||
if [[ $(git status --porcelain --untracked-files=no) ]]; then
|
||||
echo "ERROR: git repo has changes."
|
||||
echo "please commit or cleanup the git repo."
|
||||
exit 1
|
||||
else
|
||||
echo "git repo clean."
|
||||
fi
|
||||
|
||||
cur_p_version=$(cat "$f1" | grep 'CURRENT_PROJECT_VERSION' | head -1 | \
|
||||
sed -e 's#^.*CURRENT_PROJECT_VERSION = ##' | \
|
||||
sed -e 's#;.*$##')
|
||||
cur_m_version=$(cat "$f1" | grep 'MARKETING_VERSION' | head -1 | \
|
||||
sed -e 's#^.*MARKETING_VERSION = ##' | \
|
||||
sed -e 's#;.*$##')
|
||||
|
||||
|
||||
# cur_p_version=149900
|
||||
# cur_m_version=1.4.99
|
||||
# cur_p_version=150000
|
||||
# cur_m_version=1.5.00
|
||||
|
||||
next_p_version=$[ $cur_p_version + 100 ]
|
||||
# thanks to: https://stackoverflow.com/a/8653732
|
||||
next_m_version=$(echo "$cur_m_version"|awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{if(length($NF+1)>length($NF))$(NF-1)++; $NF=sprintf("%0*d", length($NF), ($NF+1)%(10^length($NF))); print}')
|
||||
|
||||
echo $cur_p_version
|
||||
echo $next_p_version
|
||||
|
||||
echo $cur_m_version
|
||||
echo $next_m_version
|
||||
|
||||
sed -i -e 's#CURRENT_PROJECT_VERSION = .*;#CURRENT_PROJECT_VERSION = '"$next_p_version"';#g' "$f1"
|
||||
sed -i -e 's#MARKETING_VERSION = .*;#MARKETING_VERSION = '"$next_m_version"';#g' "$f1"
|
||||
|
||||
sed -i -e 's#'"$cur_m_version"'#'"$next_m_version"'#g' "$f2"
|
||||
sed -i -e 's#'"$cur_p_version"'#'"$next_p_version"'#g' "$f2"
|
||||
|
||||
commit_message="v""$next_m_version"
|
||||
tag_name="$next_m_version"
|
||||
|
||||
git commit -m "$commit_message" "$f1" "$f2"
|
||||
git tag -a "v$next_m_version" -m "v$next_m_version"
|
Reference in New Issue
Block a user