Skip to content

Commit

Permalink
made the script to build the nigtly build better
Browse files Browse the repository at this point in the history
  • Loading branch information
cranci1 committed Jun 18, 2024
1 parent a1ea250 commit 4580c40
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 deletions.
Binary file not shown.
44 changes: 21 additions & 23 deletions ipabuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,40 @@

set -e

cd "$(dirname "$0")"

WORKING_LOCATION="$(pwd)"
APPLICATION_NAME=AnimeGen
APPLICATION_NAME="AnimeGen"
BUILD_DIR="$WORKING_LOCATION/build"
DERIVED_DATA_DIR="$BUILD_DIR/DerivedDataApp"
DD_APP_PATH="$DERIVED_DATA_DIR/Build/Products/Release-iphoneos/$APPLICATION_NAME.app"
TARGET_APP="$BUILD_DIR/$APPLICATION_NAME.app"
PAYLOAD_DIR="$WORKING_LOCATION/Payload"

if [ ! -d "build" ]; then
mkdir build
fi
command -v xcodebuild >/dev/null 2>&1 || { echo >&2 "xcodebuild is required but it's not installed. Aborting."; exit 1; }
command -v codesign >/dev/null 2>&1 || { echo >&2 "codesign is required but it's not installed. Aborting."; exit 1; }
command -v zip >/dev/null 2>&1 || { echo >&2 "zip is required but it's not installed. Aborting."; exit 1; }

cd build
mkdir -p "$BUILD_DIR"

xcodebuild -project "$WORKING_LOCATION/$APPLICATION_NAME.xcodeproj" \
-scheme "$APPLICATION_NAME" \
-configuration Release \
-derivedDataPath "$WORKING_LOCATION/build/DerivedDataApp" \
-derivedDataPath "$DERIVED_DATA_DIR" \
-destination 'generic/platform=iOS' \
clean build \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED=NO

DD_APP_PATH="$WORKING_LOCATION/build/DerivedDataApp/Build/Products/Release-iphoneos/$APPLICATION_NAME.app"
TARGET_APP="$WORKING_LOCATION/build/$APPLICATION_NAME.app"
cp -r "$DD_APP_PATH" "$TARGET_APP"

codesign --remove "$TARGET_APP"
if [ -e "$TARGET_APP/_CodeSignature" ]; then
rm -rf "$TARGET_APP/_CodeSignature"
fi
if [ -e "$TARGET_APP/embedded.mobileprovision" ]; then
rm -rf "$TARGET_APP/embedded.mobileprovision"
fi
rm -rf "$TARGET_APP/_CodeSignature" "$TARGET_APP/embedded.mobileprovision"

mkdir -p "$PAYLOAD_DIR"
cp -r "$TARGET_APP" "$PAYLOAD_DIR/$APPLICATION_NAME.app"

strip "$PAYLOAD_DIR/$APPLICATION_NAME.app/$APPLICATION_NAME"

zip -vr "$WORKING_LOCATION/$APPLICATION_NAME.ipa" "$PAYLOAD_DIR"

mkdir Payload
cp -r AnimeGen.app Payload/AnimeGen.app
strip Payload/AnimeGen.app/AnimeGen
zip -vr AnimeGen.ipa Payload
rm -rf AnimeGen.app
rm -rf Payload
rm -rf "$TARGET_APP" "$PAYLOAD_DIR"

echo "IPA creation completed successfully: $WORKING_LOCATION/$APPLICATION_NAME.ipa"

0 comments on commit 4580c40

Please sign in to comment.