Skip to content

Commit

Permalink
[MT-1497] Version 1.4.0 (#9)
Browse files Browse the repository at this point in the history
* [MT-1497] Version 1.4.0

Target XCode 15 and iOS 12
Add publish and build scripts
  • Loading branch information
Enricoza authored Mar 14, 2024
1 parent b546b7b commit 751abc8
Show file tree
Hide file tree
Showing 12 changed files with 219 additions and 179 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,5 @@ xcuserdata

# End of https://www.gitignore.io/api/xcode,swift,carthage,cocoapods,swiftpackagemanager

*.xcframework
*.xcframework.zip
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github "https://github.com/facebook/facebook-ios-sdk" ~> 12.2
github "https://github.com/tealium/tealium-swift" ~> 2.9
github "https://github.com/tealium/tealium-swift" ~> 2.12
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: "TealiumFacebook",
platforms: [
.iOS(.v10)
.iOS(.v12)
],
products: [
.library(name: "TealiumFacebook", targets: ["TealiumFacebook"])
],
dependencies: [
.package(url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.9.0")),
.package(url: "https://github.com/tealium/tealium-swift", .upToNextMajor(from: "2.12.0")),
.package(url: "https://github.com/facebook/facebook-ios-sdk", .upToNextMajor(from: "12.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>TealiumFacebook</string>
<key>targets</key>
<array>
<dict>
<key>sdk</key>
<string>iOS</string>
<key>project</key>
<string>TealiumFacebook.xcodeproj</string>
<key>scheme</key>
<string>TealiumFacebook</string>
</dict>
<dict>
<key>sdk</key>
<string>iOSSimulator</string>
<key>project</key>
<string>TealiumFacebook.xcodeproj</string>
<key>scheme</key>
<string>TealiumFacebook</string>
</dict>
</array>
</dict>
</array>
<key>finalActions</key>
<array>
<string>openDirectory</string>
</array>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Sources/FacebookConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import FBSDKCoreKit

/// All keys associated with Facebook remote command
enum FacebookConstants {
static let version = "1.3.0"
static let version = "1.4.0"
static let commandId = "facebook"
static let description = "Facebook Remote Command"
static let commandName = "command_name"
Expand Down
8 changes: 4 additions & 4 deletions TealiumFacebook.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 = "TealiumFacebook"
s.module_name = "TealiumFacebook"
s.version = "1.3.0"
s.version = "1.4.0"
s.summary = "Tealium Swift and Facebook integration"
s.description = <<-DESC
Tealium's integration with Facebook for iOS.
Expand All @@ -20,7 +20,7 @@ Pod::Spec.new do |s|

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

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

# ――― Dependencies ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.ios.dependency 'tealium-swift/Core', ' ~> 2.9'
s.ios.dependency 'tealium-swift/RemoteCommands', ' ~> 2.9'
s.ios.dependency 'tealium-swift/Core', ' ~> 2.12'
s.ios.dependency 'tealium-swift/RemoteCommands', ' ~> 2.12'
s.ios.dependency 'FBSDKCoreKit', ' ~> 12.2'

end
8 changes: 5 additions & 3 deletions TealiumFacebook.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 @@ -437,7 +437,7 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -469,7 +469,7 @@
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "$(SRCROOT)/Sources/Support/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -496,6 +496,7 @@
"$(PROJECT_DIR)/Carthage/Build",
);
INFOPLIST_FILE = Tests/Support/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -519,6 +520,7 @@
"$(PROJECT_DIR)/Carthage/Build",
);
INFOPLIST_FILE = Tests/Support/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
2 changes: 1 addition & 1 deletion TealiumFacebookExample/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, '9.0'
platform :ios, '12.0'

target 'TealiumFacebookExample' do
# Comment the next line if you don't want to use dynamic frameworks
Expand Down
22 changes: 11 additions & 11 deletions TealiumFacebookExample/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ PODS:
- FBAEMKit (= 12.2.1)
- FBSDKCoreKit_Basics (= 12.2.1)
- FBSDKCoreKit_Basics (12.2.1)
- tealium-swift/Core (2.9.1)
- tealium-swift/Lifecycle (2.9.1):
- tealium-swift/Core (2.12.2)
- tealium-swift/Lifecycle (2.12.2):
- tealium-swift/Core
- tealium-swift/RemoteCommands (2.9.1):
- tealium-swift/RemoteCommands (2.12.2):
- tealium-swift/Core
- tealium-swift/TagManagement (2.9.1):
- tealium-swift/TagManagement (2.12.2):
- tealium-swift/Core
- TealiumFacebook (1.3.0):
- TealiumFacebook (1.4.0):
- FBSDKCoreKit (~> 12.2)
- tealium-swift/Core (~> 2.9)
- tealium-swift/RemoteCommands (~> 2.9)
- tealium-swift/Core (~> 2.12)
- tealium-swift/RemoteCommands (~> 2.12)

DEPENDENCIES:
- tealium-swift/Lifecycle
Expand All @@ -37,9 +37,9 @@ SPEC CHECKSUMS:
FBAEMKit: 4cea610d0bc1680572f2aad7b25db7a2f2690d82
FBSDKCoreKit: 5b1992fe65802ca26be7e68bc4fac5f59fa39908
FBSDKCoreKit_Basics: a6a92ca628e05f86f458a4721574c5ddfb058ba3
tealium-swift: 137769254e97d4c9f7ed6e16e0768b40888e6452
TealiumFacebook: d9baef826faedcfc8da041619e7c36c09eb75ced
tealium-swift: 4b7e3dda42d7c1de6acb769abad9920346d17d43
TealiumFacebook: 9caa67a521c80f939924a78e449f5d177cda12cf

PODFILE CHECKSUM: 269f2a495ec27c79a71c89f3842a044306345277
PODFILE CHECKSUM: 73c4a5a6c67d9e4aec6d91b5923b0f6e296b6c79

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CFB3683A2360CF7900CAEF99"
BuildableName = "TealiumFacebookExample.app"
BlueprintName = "TealiumFacebookExample"
ReferencedContainer = "container:TealiumFacebookExample.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CFB3683A2360CF7900CAEF99"
BuildableName = "TealiumFacebookExample.app"
BlueprintName = "TealiumFacebookExample"
ReferencedContainer = "container:TealiumFacebookExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CFB3683A2360CF7900CAEF99"
BuildableName = "TealiumFacebookExample.app"
BlueprintName = "TealiumFacebookExample"
ReferencedContainer = "container:TealiumFacebookExample.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
65 changes: 65 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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/FacebookConstants.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=$(<TealiumFacebook.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 751abc8

Please sign in to comment.