Skip to content

Commit

Permalink
[MT-1497] Version 3.2.0 (#18)
Browse files Browse the repository at this point in the history
Update to target XCode 15 and iOS 12
Add publish and build scripts
  • Loading branch information
Enricoza authored Mar 8, 2024
1 parent 89c49a8 commit 770620c
Show file tree
Hide file tree
Showing 11 changed files with 145 additions and 183 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,7 @@ Pods/
Carthage/

## Tealium Example App
TealiumBraze/TealiumBrazeExample/Pods/
TealiumBraze/TealiumBrazeExample/Pods/

tealium-xcframeworks/
tealium.xcframework.zip
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "tealium/tealium-swift" ~> 2.8
github "tealium/tealium-swift" ~> 2.12
binary "https://raw.githubusercontent.com/Tealium/tealium-ios-braze-remote-command/main/braze.json" ~> 7.2
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import PackageDescription
let package = Package(
name: "TealiumBraze",
platforms: [
.iOS(.v10)
.iOS(.v12)
],
products: [
.library(name: "TealiumBraze", targets: ["TealiumBraze"])
],
dependencies: [
.package(url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.8.0")),
.package(url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.12.0")),
.package(url: "https://github.com/braze-inc/braze-swift-sdk", .upToNextMajor(from: "7.2.0"))
],
targets: [
Expand Down
38 changes: 38 additions & 0 deletions SM/Surfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?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>output_path</key>
<string>tealium-xcframeworks</string>
<key>frameworks</key>
<array>
<dict>
<key>name</key>
<string>TealiumBraze</string>
<key>targets</key>
<array>
<dict>
<key>sdk</key>
<string>iOS</string>
<key>project</key>
<string>TealiumBraze.xcodeproj</string>
<key>scheme</key>
<string>TealiumBraze</string>
</dict>
<dict>
<key>sdk</key>
<string>iOSSimulator</string>
<key>project</key>
<string>TealiumBraze.xcodeproj</string>
<key>scheme</key>
<string>TealiumBraze</string>
</dict>
</array>
</dict>
</array>
<key>finalActions</key>
<array>
<string>openDirectory</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Sources/BrazeConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum BrazeConstants {
static let separator: Character = ","
static let commandId = "braze"
static let description = "Braze Remote Command"
static let version = "3.1.1"
static let version = "3.2.0"

enum Commands: String {
case initialize = "initialize"
Expand Down
9 changes: 4 additions & 5 deletions TealiumBraze.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "TealiumBraze"
s.module_name = "TealiumBraze"
s.version = "3.1.1"
s.version = "3.2.0"
s.summary = "Tealium Swift and Braze integration"
s.description = <<-DESC
Tealium's integration with Braze for iOS.
Expand All @@ -21,8 +21,7 @@ Pod::Spec.new do |s|

# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.swift_version = "5.0"
s.platform = :ios, "11.0"
s.ios.deployment_target = "11.0"
s.platform = :ios, "12.0"

# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.source = { :git => "https://github.com/Tealium/tealium-ios-braze-remote-command.git", :tag => "#{s.version}" }
Expand All @@ -31,8 +30,8 @@ Pod::Spec.new do |s|
s.ios.source_files = "Sources/*.{swift}"

# ――― Dependencies ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.ios.dependency 'tealium-swift/Core', '~> 2.8'
s.ios.dependency 'tealium-swift/RemoteCommands', '~> 2.8'
s.ios.dependency 'tealium-swift/Core', '~> 2.12'
s.ios.dependency 'tealium-swift/RemoteCommands', '~> 2.12'
s.ios.dependency 'BrazeKit', '~> 7.2'
s.static_framework = true

Expand Down
6 changes: 3 additions & 3 deletions TealiumBraze.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 52;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -443,7 +443,7 @@
);
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -477,7 +477,7 @@
);
INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
2 changes: 1 addition & 1 deletion TealiumBrazeExample/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'
platform :ios, '12.0'

target 'TealiumBrazeExample' do
# Comment the next line if you don't want to use dynamic frameworks
Expand Down
22 changes: 11 additions & 11 deletions TealiumBrazeExample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ PODS:
- BrazeKit (7.2.0)
- BrazeLocation (7.2.0):
- BrazeKit (= 7.2.0)
- tealium-swift/Core (2.10.1)
- tealium-swift/Lifecycle (2.10.1):
- tealium-swift/Core (2.12.2)
- tealium-swift/Lifecycle (2.12.2):
- tealium-swift/Core
- tealium-swift/RemoteCommands (2.10.1):
- tealium-swift/RemoteCommands (2.12.2):
- tealium-swift/Core
- tealium-swift/TagManagement (2.10.1):
- tealium-swift/TagManagement (2.12.2):
- tealium-swift/Core
- TealiumBraze (3.0.0):
- TealiumBraze (3.2.0):
- BrazeKit (~> 7.2)
- tealium-swift/Core (~> 2.8)
- tealium-swift/RemoteCommands (~> 2.8)
- tealium-swift/Core (~> 2.12)
- tealium-swift/RemoteCommands (~> 2.12)

DEPENDENCIES:
- BrazeLocation
Expand All @@ -33,9 +33,9 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
BrazeKit: 3c77dfdf4e96e4ad8636523415e93669b89e26e0
BrazeLocation: 188b5a4210cdac88b5f19f455a1317ed7b809040
tealium-swift: 9ec83baf5419d0bb1e95b184288231e27385015b
TealiumBraze: ff3cadbc6f8351a40467c63a32b97ea93438c479
tealium-swift: 4b7e3dda42d7c1de6acb769abad9920346d17d43
TealiumBraze: 9de0067b72a00c7d3b0ad67bee501a34518b4e06

PODFILE CHECKSUM: 882a9d422c74901cbba8507cb6a543b4c7999cb4
PODFILE CHECKSUM: bd36620a6237490c846dcfc61142c9bc2791390d

COCOAPODS: 1.14.2
COCOAPODS: 1.15.2
67 changes: 67 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# A script to verify that the repo is up to date and the versions are correct and then runs the pod trunk push command

constants=$(<Sources/BrazeConstants.swift)
regex="^.*static let version \= \"([0-9\.]*)\""

if [[ $constants =~ $regex ]]
then
versionConstant=${BASH_REMATCH[1]}
else
echo "Couldn't match the library version, exiting"
exit 1
fi
echo Version Constant $versionConstant

podspecFile=$(<TealiumBraze.podspec)
podspecRegex="^.*s.version[[:space:]]*\= \"([0-9\.]*)\""

if [[ $podspecFile =~ $podspecRegex ]]
then
podspecVersion=${BASH_REMATCH[1]}
else
echo "Couldn't match the podspec version, exiting"
exit 1
fi
echo Podspec Version $podspecVersion

if [ $podspecVersion != $versionConstant ]
then
echo "The podspec version \"${podspecVersion}\" is different from the version constant \"${versionConstant}\".\nDid you forget to update one of the two?"
exit 1
fi

branch_name="$(git rev-parse --abbrev-ref HEAD)"
echo Current branch $branch_name
if [ $branch_name != "main" ]
then
echo "Check out to main branch before trying to publish. Current branch: ${branch_name}"
exit 1
fi

git fetch --tags
if ! git diff --quiet remotes/origin/main
then
echo "Make sure you are up to date with the remote before publishing"
exit 1
fi

latestTag=$(git describe --tags --abbrev=0)

echo Latest tag $latestTag
if [ $latestTag != $versionConstant ]
then
echo "The latest published tag \"${latestTag}\" is different from the version constant \"${versionConstant}\".\nDid you forget to add the tag to the release or did you forget to update the Constant?"
exit 1
fi



echo "All checks are passed, ready to release to CocoaPods"

echo "Do you wish to publish to CocoaPods?"
select yn in "Yes" "No"; do
case $yn in
Yes ) echo "Ok, running \"pod trunk push\" now."; pod trunk push; break;;
No ) echo "Ok, skip the release for now."; exit;;
esac
done
Loading

0 comments on commit 770620c

Please sign in to comment.