Skip to content

Commit 869482f

Browse files
authored
Merge pull request #1062 from OneSignal/feature/modular_subspecs
Use subspecs for modular cocoapods distribution
2 parents f96fa10 + 82fbaf0 commit 869482f

File tree

9 files changed

+40
-102
lines changed

9 files changed

+40
-102
lines changed

OneSignal.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Pod::Spec.new do |s|
88

99
s.source = { :git => "https://github.com/OneSignal/OneSignal-iOS-SDK.git", :tag => s.version.to_s }
1010

11-
s.platform = :ios
11+
s.platform = :ios, "9.0"
1212
s.requires_arc = true
1313

1414
s.ios.vendored_frameworks = 'iOS_SDK/OneSignalSDK/Framework/OneSignal.framework'

OneSignalCore.podspec

Lines changed: 0 additions & 16 deletions
This file was deleted.

OneSignalDynamic.podspec

Lines changed: 0 additions & 17 deletions
This file was deleted.

OneSignalExtension.podspec

Lines changed: 0 additions & 19 deletions
This file was deleted.

OneSignalOutcomes.podspec

Lines changed: 0 additions & 18 deletions
This file was deleted.

OneSignalXCFramework.podspec

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,28 @@ Pod::Spec.new do |s|
77
s.author = { "Joseph Kalash" => "[email protected]", "Josh Kasten" => "[email protected]" , "Brad Hesse" => "[email protected]"}
88

99
s.source = { :git => "https://github.com/OneSignal/OneSignal-iOS-SDK.git", :tag => s.version.to_s }
10-
s.platform = :ios
10+
s.platform = :ios, '9.0'
1111
s.requires_arc = true
12-
13-
s.dependency 'OneSignalCore'
14-
s.dependency 'OneSignalOutcomes'
15-
s.dependency 'OneSignalExtension'
1612

1713
s.ios.vendored_frameworks = 'iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework'
18-
s.preserve_paths = 'iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework'
19-
14+
#s.preserve_paths = 'iOS_SDK/OneSignalSDK/OneSignal_XCFramework/OneSignal.xcframework'
15+
16+
s.subspec 'OneSignalCore' do |ss|
17+
ss.vendored_frameworks = 'iOS_SDK/OneSignalSDK/OneSignal_Core/OneSignalCore.xcframework'
18+
#ss.preserve_paths = 'iOS_SDK/OneSignalSDK/OneSignal_Core/OneSignalCore.xcframework'
19+
end
20+
21+
s.subspec 'OneSignalOutcomes' do |ss|
22+
ss.dependency 'OneSignalXCFramework/OneSignalCore'
23+
ss.vendored_frameworks = 'iOS_SDK/OneSignalSDK/OneSignal_Outcomes/OneSignalOutcomes.xcframework'
24+
#ss.preserve_paths = 'iOS_SDK/OneSignalSDK/OneSignal_Outcomes/OneSignalOutcomes.xcframework'
25+
end
26+
27+
s.subspec 'OneSignalExtension' do |ss|
28+
ss.dependency 'OneSignalXCFramework/OneSignalCore'
29+
ss.dependency 'OneSignalXCFramework/OneSignalOutcomes'
30+
ss.vendored_frameworks = 'iOS_SDK/OneSignalSDK/OneSignal_Extension/OneSignalExtension.xcframework'
31+
#ss.preserve_paths = 'iOS_SDK/OneSignalSDK/OneSignal_Extension/OneSignalExtension.xcframework'
32+
end
2033
end
2134

iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,9 @@
949949
DE98772A2591655800DE07D5 /* NSDateFormatter+OneSignal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSDateFormatter+OneSignal.m"; sourceTree = "<group>"; };
950950
DE9A5DA925D1FD6B00FCEC21 /* OSPlayerTags.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSPlayerTags.h; sourceTree = "<group>"; };
951951
DE9A5DB225D1FD8000FCEC21 /* OSPlayerTags.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSPlayerTags.m; sourceTree = "<group>"; };
952+
DEB843A127C0245B00D7E943 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
953+
DEB843A327C0246A00D7E943 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
954+
DEB843A527C0247700D7E943 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
952955
DEF5CCF12539321A0003E9CC /* UnitTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UnitTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
953956
DEF5CCF32539321A0003E9CC /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
954957
DEF5CCF42539321A0003E9CC /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -1701,20 +1704,23 @@
17011704
DE97175A275597D100FC409E /* OneSignalCoreFramework */ = {
17021705
isa = PBXGroup;
17031706
children = (
1707+
DEB843A127C0245B00D7E943 /* Info.plist */,
17041708
);
17051709
path = OneSignalCoreFramework;
17061710
sourceTree = "<group>";
17071711
};
17081712
DE97175B275597DA00FC409E /* OneSignalOutcomesFramework */ = {
17091713
isa = PBXGroup;
17101714
children = (
1715+
DEB843A327C0246A00D7E943 /* Info.plist */,
17111716
);
17121717
path = OneSignalOutcomesFramework;
17131718
sourceTree = "<group>";
17141719
};
17151720
DE97175C275597E600FC409E /* OneSignalExtensionFramework */ = {
17161721
isa = PBXGroup;
17171722
children = (
1723+
DEB843A527C0247700D7E943 /* Info.plist */,
17181724
);
17191725
path = OneSignalExtensionFramework;
17201726
sourceTree = "<group>";
@@ -3000,7 +3006,7 @@
30003006
DYLIB_CURRENT_VERSION = 1;
30013007
DYLIB_INSTALL_NAME_BASE = "@rpath";
30023008
GCC_C_LANGUAGE_STANDARD = gnu11;
3003-
GENERATE_INFOPLIST_FILE = YES;
3009+
GENERATE_INFOPLIST_FILE = NO;
30043010
INFOPLIST_FILE = OneSignalCoreFramework/Info.plist;
30053011
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Hiptic. All rights reserved.";
30063012
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -3062,7 +3068,7 @@
30623068
"DEBUG=1",
30633069
"$(inherited)",
30643070
);
3065-
GENERATE_INFOPLIST_FILE = YES;
3071+
GENERATE_INFOPLIST_FILE = NO;
30663072
INFOPLIST_FILE = OneSignalCoreFramework/Info.plist;
30673073
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Hiptic. All rights reserved.";
30683074
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -3116,7 +3122,7 @@
31163122
DYLIB_CURRENT_VERSION = 1;
31173123
DYLIB_INSTALL_NAME_BASE = "@rpath";
31183124
GCC_C_LANGUAGE_STANDARD = gnu11;
3119-
GENERATE_INFOPLIST_FILE = YES;
3125+
GENERATE_INFOPLIST_FILE = NO;
31203126
INFOPLIST_FILE = OneSignalExtensionFramework/Info.plist;
31213127
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Hiptic. All rights reserved.";
31223128
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -3176,7 +3182,7 @@
31763182
"DEBUG=1",
31773183
"$(inherited)",
31783184
);
3179-
GENERATE_INFOPLIST_FILE = YES;
3185+
GENERATE_INFOPLIST_FILE = NO;
31803186
INFOPLIST_FILE = OneSignalExtensionFramework/Info.plist;
31813187
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Hiptic. All rights reserved.";
31823188
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -3230,7 +3236,7 @@
32303236
DYLIB_CURRENT_VERSION = 1;
32313237
DYLIB_INSTALL_NAME_BASE = "@rpath";
32323238
GCC_C_LANGUAGE_STANDARD = gnu11;
3233-
GENERATE_INFOPLIST_FILE = YES;
3239+
GENERATE_INFOPLIST_FILE = NO;
32343240
INFOPLIST_FILE = OneSignalOutcomesFramework/Info.plist;
32353241
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Hiptic. All rights reserved.";
32363242
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
@@ -3290,7 +3296,7 @@
32903296
"DEBUG=1",
32913297
"$(inherited)",
32923298
);
3293-
GENERATE_INFOPLIST_FILE = YES;
3299+
GENERATE_INFOPLIST_FILE = NO;
32943300
INFOPLIST_FILE = OneSignalOutcomesFramework/Info.plist;
32953301
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2021 Hiptic. All rights reserved.";
32963302
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";

iOS_SDK/OneSignalSDK/build_fat_framework.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,12 @@ BUILD_TYPE="staticlib"
88
BUILD_SCHEME="OneSignalFramework"
99
BUILD_PROJECT="OneSignal.xcodeproj"
1010

11-
# NOTE: Once Apple drops support for Xcode 10, we can edit this to use same xcodebuild version for all three build commands
12-
XCODEBUILD_OLDEST_SUPPORTED=/Applications/Xcode10.1.app/Contents/Developer/usr/bin/xcodebuild
13-
XCODEBUILD_11_0=/Applications/Xcode11.0.app/Contents/Developer/usr/bin/xcodebuild
11+
# NOTE: We are now supporting Xcode 11 as our oldest build target.
12+
XCODEBUILD_OLDEST_SUPPORTED=/Applications/Xcode11.0.app/Contents/Developer/usr/bin/xcodebuild
1413

15-
# For backwards compatible bitcode we need to build iphonesimulator + iphoneos with 3 versions behind the latest.
16-
# However variant=Mac Catalyst needs to be be Xcode 11.0
1714
$XCODEBUILD_OLDEST_SUPPORTED -configuration ${BUILD_CONFIG} MACH_O_TYPE=${BUILD_TYPE} -sdk "iphonesimulator" ARCHS="x86_64 i386" -project ${BUILD_PROJECT} -scheme ${BUILD_SCHEME} SYMROOT="${DERIVED_DATA_RELATIVE_DIR}/"
1815
$XCODEBUILD_OLDEST_SUPPORTED -configuration ${BUILD_CONFIG} MACH_O_TYPE=${BUILD_TYPE} -sdk "iphoneos" ARCHS="armv7 armv7s arm64 arm64e" -project ${BUILD_PROJECT} -scheme ${BUILD_SCHEME} SYMROOT="${DERIVED_DATA_RELATIVE_DIR}/"
19-
$XCODEBUILD_11_0 -configuration ${BUILD_CONFIG} ARCHS="x86_64h" VALID_ARCHS="x86_64h" -destination 'platform=macOS,variant=Mac Catalyst' MACH_O_TYPE=${BUILD_TYPE} -project ${BUILD_PROJECT} -scheme ${BUILD_SCHEME} SYMROOT="${DERIVED_DATA_RELATIVE_DIR}/"
16+
$XCODEBUILD_OLDEST_SUPPORTED -configuration ${BUILD_CONFIG} ARCHS="x86_64h" VALID_ARCHS="x86_64h" -destination 'platform=macOS,variant=Mac Catalyst' MACH_O_TYPE=${BUILD_TYPE} -project ${BUILD_PROJECT} -scheme ${BUILD_SCHEME} SYMROOT="${DERIVED_DATA_RELATIVE_DIR}/"
2017

2118
USER=$(id -un)
2219
DERIVED_DATA_ONESIGNAL_DIR="${WORKING_DIR}/${DERIVED_DATA_RELATIVE_DIR}"

iOS_SDK/OneSignalSDK/update_swift_package.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ SWIFT_PACKAGE_DIRECTORY="${WORKING_DIR}/../.."
2222

2323
SWIFT_PACKAGE_PATH="${SWIFT_PACKAGE_DIRECTORY}/Package.swift"
2424

25+
#Ask for the new release version number to be placed in the package URL
26+
echo -e "\033[1mEnter the new SDK release version number\033[0m"
27+
read VERSION_NUMBER
28+
2529
# Remove the old Zipped XCFramework and create a new Zip
2630
echo "Removing old Zipped XCFramework ${FRAMEWORK_ZIP_PATH}"
2731
rm -rf "${FRAMEWORK_ZIP_PATH}"
@@ -35,9 +39,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
3539

3640
# Use sed to remove line 62 from the Swift.package and replace it with the new checksum
3741
sed -i '' "62s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
38-
#Ask for the new release version number to be placed in the package URL
39-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
40-
read VERSION_NUMBER
4142
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignalCore.xcframework.zip\","
4243
#Use sed to remove line 61 from the Swift.package and replace it with the new URL for the new release
4344
sed -i '' "61s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"
@@ -77,9 +78,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
7778
echo ${CHECKSUM}
7879
# Use sed to remove line 57 from the Swift.package and replace it with the new checksum
7980
sed -i '' "57s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
80-
#Ask for the new release version number to be placed in the package URL
81-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
82-
read VERSION_NUMBER
8381
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignalOutcomes.xcframework.zip\","
8482
#Use sed to remove line 56 from the Swift.package and replace it with the new URL for the new release
8583
sed -i '' "56s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"
@@ -119,9 +117,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
119117
echo ${CHECKSUM}
120118
# Use sed to remove line 52 from the Swift.package and replace it with the new checksum
121119
sed -i '' "52s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
122-
#Ask for the new release version number to be placed in the package URL
123-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
124-
read VERSION_NUMBER
125120
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignalExtension.xcframework.zip\","
126121
#Use sed to remove line 51 from the Swift.package and replace it with the new URL for the new release
127122
sed -i '' "51s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"
@@ -161,9 +156,6 @@ SWIFT_PM_CHECKSUM_LINE=" checksum: \"${CHECKSUM}\""
161156
echo ${CHECKSUM}
162157
# Use sed to remove line 47 from the Swift.package and replace it with the new checksum
163158
sed -i '' "47s/.*/$SWIFT_PM_CHECKSUM_LINE/" "${SWIFT_PACKAGE_PATH}"
164-
#Ask for the new release version number to be placed in the package URL
165-
echo -e "\033[1mEnter the new SDK release version number\033[0m"
166-
read VERSION_NUMBER
167159
SWIFT_PM_URL_LINE=" url: \"https:\/\/github.com\/OneSignal\/OneSignal-iOS-SDK\/releases\/download\/${VERSION_NUMBER}\/OneSignal.xcframework.zip\","
168160
#Use sed to remove line 46 from the Swift.package and replace it with the new URL for the new release
169161
sed -i '' "46s/.*/$SWIFT_PM_URL_LINE/" "${SWIFT_PACKAGE_PATH}"

0 commit comments

Comments
 (0)