From 8928808df73ec76005e2f4ec5eb2f16f1cfa9bf6 Mon Sep 17 00:00:00 2001 From: Ryder Mackay Date: Fri, 30 Jul 2021 16:59:46 -0400 Subject: [PATCH] Add build script --- .gitignore | 1 + build.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100755 build.sh diff --git a/.gitignore b/.gitignore index e6ba39b64..d2d8529d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ Externals +DerivedData example/ios/iOS UI Test/DerivedData scripts/prebuilt.list diff --git a/build.sh b/build.sh new file mode 100755 index 000000000..9dc71d79c --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +DERIVED_DATA_DIR="DerivedData" +PRODUCTS_DIR="${DERIVED_DATA_DIR}/Build/Products" + +# carthage adds these, not sure if necessary +EXTRA_ARGS="ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=" + +# libetpan has been set up to build an xcframework for libsasl2, however xcframeworks must exist at the *start* of the build process +# I didn't have time to figure out something less awful than building libetpan first +# It'll copy sasl.xcframework to the build directory +xcodebuild -project build-mac/mailcore2.xcodeproj -scheme "libetpan ios" -configuration Release -derivedDataPath ${DERIVED_DATA_DIR} -sdk iphoneos ${EXTRA_ARGS} +xcodebuild -project build-mac/mailcore2.xcodeproj -scheme "libetpan ios" -configuration Release -derivedDataPath ${DERIVED_DATA_DIR} -sdk iphonesimulator ${EXTRA_ARGS} + +# mailcore2 references the sasl.xcframework in the build directory +xcodebuild -project build-mac/mailcore2.xcodeproj -scheme "mailcore ios" -configuration Release -derivedDataPath ${DERIVED_DATA_DIR} -sdk iphoneos ${EXTRA_ARGS} +xcodebuild -project build-mac/mailcore2.xcodeproj -scheme "mailcore ios" -configuration Release -derivedDataPath ${DERIVED_DATA_DIR} -sdk iphonesimulator ${EXTRA_ARGS} + +# glue it all together +# note -debug-symbols path has to be absolute, see https://developer.apple.com/forums/thread/655768 +xcodebuild -create-xcframework \ + -framework "${PRODUCTS_DIR}/Release-iphoneos/MailCore.framework" \ + -debug-symbols "${PWD}/${PRODUCTS_DIR}/Release-iphoneos/MailCore.framework.dSYM" \ + -framework "${PRODUCTS_DIR}/Release-iphonesimulator/MailCore.framework" \ + -debug-symbols "${PWD}/${PRODUCTS_DIR}/Release-iphonesimulator/MailCore.framework.dSYM" \ + -output "${PRODUCTS_DIR}/MailCore.xcframework"