Skip to content

Commit

Permalink
Clean up SPM integration
Browse files Browse the repository at this point in the history
  • Loading branch information
pablichjenkov committed May 29, 2024
1 parent bde6701 commit 220beb9
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,5 @@ fun createPlatformBridge(

// val accountPlugin = SupabaseAccountPlugin()

return IosBridge(
accountPlugin = accountPlugin
)
return IosBridge(accountPlugin = accountPlugin)
}
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ androidCompileSdk = "34"
androidTargetSdk = "34"
androidMinSdk = "26"
macaoAmadeusApi = "0.3.4"
macaoComponentToolkit = "0.6.10-rc02"
macaoComponentToolkit = "0.6.10"
macaoAuthFirebase = "0.0.1-dev"
koinCore = "3.6.0-wasm-alpha2"
kotlin = "1.9.24-spm"
agp = "8.1.4"
composeAndroidCompiler = "1.6.7"
composePlugin = "1.6.10-rc03"
composePlugin = "1.6.10"
androidxActivityCompose = "1.9.0"
kamelImage = "0.9.4"
kotlinxCoroutines = "1.8.0"
kotlinxCoroutines = "1.8.1"
ktor = "2.3.10"
composeIcons = "1.1.0"
kotlinxSerialization = "1.6.3"
Expand Down
30 changes: 30 additions & 0 deletions iOSDemoApp/iOSDemoApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
9401746D2A777BE500BA34D2 /* iOSDemoAppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9401746C2A777BE500BA34D2 /* iOSDemoAppUITests.swift */; };
9401746F2A777BE500BA34D2 /* iOSDemoAppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9401746E2A777BE500BA34D2 /* iOSDemoAppUITestsLaunchTests.swift */; };
948FD8CF2B4D0A3600A9B754 /* iOSDemoAppPackage in Frameworks */ = {isa = PBXBuildFile; platformFilter = ios; productRef = 948FD8CE2B4D0A3600A9B754 /* iOSDemoAppPackage */; };
94D867142C006A4F00CA8E7F /* FirebaseAuthKmp in Frameworks */ = {isa = PBXBuildFile; productRef = 94D867132C006A4F00CA8E7F /* FirebaseAuthKmp */; };
94D9FB7B2B32A74C004396A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 94D9FB7A2B32A74C004396A2 /* GoogleService-Info.plist */; };
94D9FB7C2B32A74C004396A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 94D9FB7A2B32A74C004396A2 /* GoogleService-Info.plist */; };
94D9FB7D2B32A74C004396A2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 94D9FB7A2B32A74C004396A2 /* GoogleService-Info.plist */; };
Expand Down Expand Up @@ -59,6 +60,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
94D867142C006A4F00CA8E7F /* FirebaseAuthKmp in Frameworks */,
948FD8CF2B4D0A3600A9B754 /* iOSDemoAppPackage in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -155,6 +157,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 940174722A777BE500BA34D2 /* Build configuration list for PBXNativeTarget "iOSDemoApp" */;
buildPhases = (
94477A4E2C0703C300EF5670 /* Compile Kotlin Framework */,
940174492A777BE400BA34D2 /* Sources */,
9401744A2A777BE400BA34D2 /* Frameworks */,
9401744B2A777BE400BA34D2 /* Resources */,
Expand All @@ -166,6 +169,7 @@
name = iOSDemoApp;
packageProductDependencies = (
948FD8CE2B4D0A3600A9B754 /* iOSDemoAppPackage */,
94D867132C006A4F00CA8E7F /* FirebaseAuthKmp */,
);
productName = iOSDemoApp;
productReference = 9401744D2A777BE400BA34D2 /* iOSDemoApp.app */;
Expand Down Expand Up @@ -283,6 +287,27 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
94477A4E2C0703C300EF5670 /* Compile Kotlin Framework */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Compile Kotlin Framework";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"YES\" = \"$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED\" ]; then\n echo \"Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \\\"YES\\\"\"\n exit 0\nfi\ncd \"$SRCROOT/..\"\n./gradlew :composeApp:embedAndSignAppleFrameworkForXcode\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
940174492A777BE400BA34D2 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down Expand Up @@ -675,6 +700,11 @@
package = 948FD8CD2B4D090E00A9B754 /* XCLocalSwiftPackageReference "iOSDemoAppPackage" */;
productName = iOSDemoAppPackage;
};
94D867132C006A4F00CA8E7F /* FirebaseAuthKmp */ = {
isa = XCSwiftPackageProductDependency;
package = 942F83682B52357400A0CD1A /* XCLocalSwiftPackageReference "../../firebase-kmp" */;
productName = FirebaseAuthKmp;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 940174452A777BE400BA34D2 /* Project object */;
Expand Down
53 changes: 17 additions & 36 deletions iOSDemoApp/iOSDemoApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,41 @@ import UIKit
import ComposeApp

struct ComposeView : UIViewControllerRepresentable {

var iosBridge: IosBridge

func makeUIViewController(context: Context) -> UIViewController {
// let amadeusDemoRootComponent = BindingsKt.getSduiRootComponent()

/*
let mainViewController = BindingsKt.buildDemoViewController(
rootComponent: amadeusDemoRootComponent,
iosBridge: iosBridge,
onBackPress: {
exit(0)
}
)
*/


let mainViewController = BindingsKt.buildDemoMacaoApplication(
iosBridge: iosBridge
)

return mainViewController
}

func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}

struct ContentView: View {

var iosBridge: IosBridge

var body: some View {
ComposeView(iosBridge: iosBridge)
.ignoresSafeArea(.keyboard) // Compose has own keyboard handler
//.ignoresSafeArea(.all, edges: .bottom) // If prefered to handle this in compose land

}
}
/*
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
.padding()
//.ignoresSafeArea(.keyboard) // Compose has own keyboard handler
.ignoresSafeArea(.all, edges: .all) // If prefered to handle this in compose land

}
}

struct ContentView_Previews: PreviewProvider {

static var previews: some View {
ContentView()

let accountPlugin = MacaoAccountPluginEmpty()

let iosBridge = BindingsKt.createPlatformBridge(accountPlugin: accountPlugin)

ContentView(iosBridge: iosBridge)
}
}
*/
3 changes: 1 addition & 2 deletions iOSDemoApp/iOSDemoApp/MacaoDemoApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ struct MacaoDemoApp: App {
let iob = IosBridge(
accountPlugin: FirebaseAccountPlugin(
firebaseAuthKmpWrapper: FirebaseAuthKmpWrapperImpl()
),
name2: Int32(0)
)
)

// register app delegate for Firebase setup
Expand Down
18 changes: 6 additions & 12 deletions iOSDemoApp/iOSDemoAppPackage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,21 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/firebase/firebase-ios-sdk.git", from: "10.19.0"),
// Bellow consumes firebase-kmp package from github instead of our local.
.package(url: "https://github.com/pablichjenkov/firebase-kmp.git", branch: "composeApp"),
// Bellow consumes firebase-kmp package from github instead of our local package. For development use local, to build in the pipeline use the remote pacakge.
//.package(url: "https://github.com/pablichjenkov/firebase-kmp.git", branch: "main"),
],
targets: [
// It wont be needed after JetBrains releases SPM BuildPhase task integration
// .binaryTarget(
// name: "composeApp",
// path: "../../composeApp/build/XCFrameworks/debug/composeApp.xcframework"
// ),
.target(
name: "iOSDemoAppPackage",
dependencies: [
//.byName(name: "composeApp"), // It wont be needed after JetBrains releases SPM BuildPhase task integration
.product(
name: "FirebaseAuth",
package: "firebase-ios-sdk"
),
.product(
name: "FirebaseAuthKmp",
package: "firebase-kmp"
),
// .product(
// name: "FirebaseAuthKmp",
// package: "firebase-kmp"
// ),
]
),
.testTarget(
Expand Down

0 comments on commit 220beb9

Please sign in to comment.