Skip to content
This repository was archived by the owner on Jun 15, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions GoogleMaps.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
EXCLUDED_ARCHS = arm64;
INFOPLIST_FILE = GoogleMaps/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down Expand Up @@ -1074,7 +1073,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
EXCLUDED_ARCHS = arm64;
INFOPLIST_FILE = GoogleMapsBase/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down Expand Up @@ -1104,7 +1102,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
EXCLUDED_ARCHS = arm64;
INFOPLIST_FILE = GoogleMapsCore/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down Expand Up @@ -1134,7 +1131,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
EXCLUDED_ARCHS = arm64;
INFOPLIST_FILE = GoogleMapsM4B/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down Expand Up @@ -1164,7 +1160,6 @@
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
EXCLUDED_ARCHS = arm64;
INFOPLIST_FILE = GooglePlaces/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
Expand Down
48 changes: 33 additions & 15 deletions make_xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

BUILD_DIRECTORY="Build"

function archive_project() {
function convert_frameworks_arm64_to_iphonesimulator() {
project_name=$1
framework_name=$2

xcrun vtool -arch arm64 \
-set-build-version 7 11.0 13.7 \
-replace \
-output "../Carthage/Build/iOS/$framework_name.framework/$framework_name" \
"../Carthage/Build/iOS/$framework_name.framework/$framework_name"
}

function archive_project_iphoneos() {
project_name=$1
framework_name=$2

Expand All @@ -15,6 +26,11 @@ function archive_project() {
-archivePath "$framework_name.framework-iphoneos.xcarchive"\
SKIP_INSTALL=NO\
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
}

function archive_project_iphonesimulator() {
project_name=$1
framework_name=$2

# Archive iOS Simulator project.
xcodebuild archive\
Expand All @@ -31,9 +47,6 @@ function create_xcframework() {
project_name=$1
framework_name=$2

# Archive Xcode project.
archive_project $project_name $framework_name

# Create XCFramework from the archived project.
xcodebuild -create-xcframework\
-framework "$framework_name.framework-iphoneos.xcarchive/Products/Library/Frameworks/$framework_name.framework"\
Expand All @@ -48,25 +61,30 @@ function create_xcframework() {
}

function cleanup() {
rm -r *.xcframework
# rm -r *.xcframework
rm -r *.xcarchive
}

# Install Google Maps SDK for iOS.
carthage update

# Create Build directory if not existing.
if [ ! -d "$BUILD_DIRECTORY" ]; then
mkdir $BUILD_DIRECTORY
fi

rm -rf $BUILD_DIRECTORY
mkdir $BUILD_DIRECTORY
cd $BUILD_DIRECTORY

create_xcframework "GoogleMaps" "GoogleMaps"
create_xcframework "GoogleMaps" "GoogleMapsBase"
create_xcframework "GoogleMaps" "GoogleMapsCore"
create_xcframework "GoogleMaps" "GoogleMapsM4B"
create_xcframework "GoogleMaps" "GooglePlaces"
frameworks=("GoogleMaps" "GoogleMapsBase" "GoogleMapsCore" "GoogleMapsM4B" "GooglePlaces")
for framework in "${frameworks[@]}"; do
archive_project_iphoneos "GoogleMaps" "$framework"
done
for framework in "${frameworks[@]}"; do
convert_frameworks_arm64_to_iphonesimulator "GoogleMaps" "$framework"
done
for framework in "${frameworks[@]}"; do
archive_project_iphonesimulator "GoogleMaps" "$framework"
done
for framework in "${frameworks[@]}"; do
create_xcframework "GoogleMaps" "$framework"
done

cleanup

Expand Down