Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
rydermackay authored and adamtharani committed Aug 5, 2021
1 parent 875bd1d commit 8928808
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Externals
DerivedData

example/ios/iOS UI Test/DerivedData
scripts/prebuilt.list
Expand Down
26 changes: 26 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 8928808

Please sign in to comment.