Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SPM and Cocoapod configuration file #1

Closed
Closed
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
44 changes: 44 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// swift-tools-version:5.9.0
import PackageDescription

let package = Package(
name: "Shared",
platforms: [
.iOS(.v15),
],
products: [
.library(name: "Shared", targets: ["SharedSDKTarget"])
],
targets: [
.binaryTarget(
name: "Shared",
path: "https://github.com/ahmadAlfhajri/kmp-minimalist-template_test_script/releases/download/1.0.0/XenditFingerprintSDK-1.0.0.zip",
checksum:"35ec66e6e0d792a5affa884f117842ac6ccfc9bf9908a07449eac7152995d23a"
),
.binaryTarget(
name: "XenditFingerprintSDK",
url: "https://cdn-xenshield.xendit.co/fingerprint-sdk/ios/1.0.1/XenditFingerprintSDK-1.0.1.zip",
checksum: "d8dbb2e00525eb7765972e10aa0cf49d990a7cc40ddff05d0f620a17b487ceb0"
),
.target(
name: "SharedSDKTarget",
dependencies: [
.target(name: "Shared"),
.target(name: "XenditFingerprintSDK"),
// .product(name: "Reachability", package: "Reachability.swift")
],
path:"SharedSDKTarget",
linkerSettings: [
// Equivalent to s.framework = 'SystemConfiguration'
.linkedFramework("SystemConfiguration"),
// Equivalent to s.ios.framework = 'CoreTelephony'
.linkedFramework("CoreTelephony", .when(platforms: [.iOS]))
]
)
]
)


//https://stackoverflow.com/questions/68663996/swift-package-manager-make-package-depend-on-remote-xcframework
//https://forums.swift.org/t/swiftpm-binary-target-with-sub-dependencies/40197/27
//https://github.com/amplitude/Amplitude-iOS/blob/main/Amplitude.podspec <- Example
17 changes: 17 additions & 0 deletions Shared.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Pod::Spec.new do |spec|
spec.name = 'Shared'
spec.version = '1.0'
spec.homepage = 'https://github.com/ahmadAlfhajri/kmp-minimalist-template_test_script'
spec.source = { :http=> 'https://github.com/ahmadAlfhajri/kmp-minimalist-template_test_script/releases/download/1.0.0/XenditFingerprintSDK-1.0.0.zip'}
spec.authors = ''
spec.license = { :type => 'MIT', :text => 'License text'}
spec.summary = 'Some description for the Shared Module'
spec.libraries = 'c++'
spec.ios.deployment_target = '15.0'
spec.dependency 'XenditFingerprintSDK', '1.0.1'





end
11 changes: 9 additions & 2 deletions iosApp/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
PODS:
- shared (1.0)
- shared (1.0):
- XenditFingerprintSDK (= 1.0.1)
- XenditFingerprintSDK (1.0.1)

DEPENDENCIES:
- shared (from `../shared`)

SPEC REPOS:
trunk:
- XenditFingerprintSDK

EXTERNAL SOURCES:
shared:
:path: "../shared"

SPEC CHECKSUMS:
shared: 96c066cfd2b0eab0963c51fee6cb6673e8cbba1a
shared: 01ed56dd75048564a1c692b222c6b63f76014d61
XenditFingerprintSDK: 29410a2dcf467fe33d6e0167f590deae47c753ee

PODFILE CHECKSUM: 78d6cc1b71b232202c48a29d4e6c34972c534c73

Expand Down
22 changes: 21 additions & 1 deletion iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -116,6 +116,7 @@
7555FF77242A565900829871 /* Sources */,
7555FF79242A565900829871 /* Resources */,
50F90884C22C0FEF776BD342 /* Frameworks */,
C4F1BC530FA19DA7D056B337 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -194,6 +195,23 @@
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;
};
C4F1BC530FA19DA7D056B337 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -336,6 +354,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = YTAZRVVYUC;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand All @@ -357,6 +376,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
DEVELOPMENT_TEAM = YTAZRVVYUC;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = iosApp/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
Expand Down
3 changes: 3 additions & 0 deletions iosApp/iosApp/iOSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ struct iOSApp: App {
WindowGroup {
NavigationView {
ContentView(appModule: appModule)
.onAppear {
appModule.testSDK(apiKey: "asdads")
}
}
}
}
Expand Down
Loading