Skip to content

Commit

Permalink
Support Apple Silicon simulators
Browse files Browse the repository at this point in the history
  • Loading branch information
dimat committed Mar 28, 2023
1 parent 36818e9 commit dadf431
Show file tree
Hide file tree
Showing 24 changed files with 217 additions and 39 deletions.
30 changes: 7 additions & 23 deletions Example/NumberSpellOutFormatter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@
6003F586195388D20070C39A /* Sources */,
6003F587195388D20070C39A /* Frameworks */,
6003F588195388D20070C39A /* Resources */,
05BD426D47AF44B8A8ABBAC5 /* [CP] Embed Pods Frameworks */,
F55BD23B4E086D0FD66A3F8D /* [CP] Copy Pods Resources */,
B1104E40C391AD59425EC7E6 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -214,24 +213,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
05BD426D47AF44B8A8ABBAC5 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-NumberSpellOutFormatter_Example/Pods-NumberSpellOutFormatter_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/NumberSpellOutFormatter/NumberSpellOutFormatter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NumberSpellOutFormatter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NumberSpellOutFormatter_Example/Pods-NumberSpellOutFormatter_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
56F448B76A31EDBB42B93EC7 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand All @@ -250,19 +231,22 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
F55BD23B4E086D0FD66A3F8D /* [CP] Copy Pods Resources */ = {
B1104E40C391AD59425EC7E6 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-NumberSpellOutFormatter_Example/Pods-NumberSpellOutFormatter_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/NumberSpellOutFormatter/NumberSpellOutFormatter.framework",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NumberSpellOutFormatter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NumberSpellOutFormatter_Example/Pods-NumberSpellOutFormatter_Example-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NumberSpellOutFormatter_Example/Pods-NumberSpellOutFormatter_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down
2 changes: 1 addition & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use_frameworks!
platform :ios, '8.0'
platform :ios, '14.0'

target 'NumberSpellOutFormatter_Example' do
pod 'NumberSpellOutFormatter', :path => '../', :testspecs => ['Tests']
Expand Down
8 changes: 4 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ DEPENDENCIES:

EXTERNAL SOURCES:
NumberSpellOutFormatter:
:path: ../
:path: "../"

SPEC CHECKSUMS:
NumberSpellOutFormatter: 24de047b4fe7c7948e677344cfdd47d1388cfc4a
NumberSpellOutFormatter: 9cca067cb39240db2f683043dda92c77684e879b

PODFILE CHECKSUM: dac37676ed9345ddfb8902ebb3c9247ebf7b4248
PODFILE CHECKSUM: 6fa02ad5bc21c4ced1791a729b5f3cc64a34e0a3

COCOAPODS: 1.4.0
COCOAPODS: 1.11.3
16 changes: 5 additions & 11 deletions NumberSpellOutFormatter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'NumberSpellOutFormatter'
s.version = '1.0.0'
s.version = '1.0.1'
s.summary = 'Spell out numbers in any language'

s.description = <<-DESC
Expand All @@ -22,8 +22,8 @@ also supports ordinal numbers with any additional modes that are applicable for
s.author = { 'Dmitry Matyukhin' => '[email protected]' }
s.source = { :git => 'https://github.com/dimat/DMNumberSpellOutFormatter.git', :tag => s.version.to_s }

s.ios.deployment_target = '8.0'
s.swift_version = '3.2'
s.ios.deployment_target = '11.0'
s.swift_version = '5.2'

s.source_files = ['NumberSpellOutFormatter/Classes/**/*']

Expand All @@ -34,7 +34,7 @@ also supports ordinal numbers with any additional modes that are applicable for
s.subspec 'precompiled' do |ss|
ss.source_files = 'icu4c-static-lib/include/**/*.h'
ss.private_header_files = 'icu4c-static-lib/include/**/*.h'
ss.vendored_libraries = 'icu4c-static-lib/lib/**/*.a'
ss.vendored_frameworks = 'icu4c-static-lib/frameworks/**/*.xcframework'

ss.header_mappings_dir = 'icu4c-static-lib/include'
ss.libraries = "c++"
Expand All @@ -43,14 +43,8 @@ also supports ordinal numbers with any additional modes that are applicable for
# of one of the libs gets to 150M while GitHub only allows maximum 100M

# This will prevent warnings about missing architectures
simulator_ldflags = '-l"c++" -l"icudata-simulator" -l"icui18n-simulator" -l"icuio-simulator" -l"icuuc-simulator"'
arm_ldflags = '-l"c++" -l"icudata-arm" -l"icui18n-arm" -l"icuio-arm" -l"icuuc-arm"'
ss.pod_target_xcconfig = {
'OTHER_LDFLAGS[arch=armv7]' => arm_ldflags,
'OTHER_LDFLAGS[arch=armv7s]' => arm_ldflags,
'OTHER_LDFLAGS[arch=arm64]' => arm_ldflags,
'OTHER_LDFLAGS[arch=i386]' => simulator_ldflags,
'OTHER_LDFLAGS[arch=x86_64]' => simulator_ldflags
'OTHER_LDFLAGS' => '-l"c++"'
}
end

Expand Down
40 changes: 40 additions & 0 deletions icu4c-static-lib/frameworks/libicudata.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libicudata.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libicudata.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
40 changes: 40 additions & 0 deletions icu4c-static-lib/frameworks/libicui18n.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libicui18n.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libicui18n.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
40 changes: 40 additions & 0 deletions icu4c-static-lib/frameworks/libicuio.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libicuio.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libicuio.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
40 changes: 40 additions & 0 deletions icu4c-static-lib/frameworks/libicule.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libicule.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>libicule.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Loading

0 comments on commit dadf431

Please sign in to comment.