Skip to content

Commit

Permalink
Merge pull request #826 from splendo/master
Browse files Browse the repository at this point in the history
changes from master
  • Loading branch information
thoutbeckers authored Oct 23, 2024
2 parents abcc7e7 + 9aaee4a commit 61d5410
Show file tree
Hide file tree
Showing 12 changed files with 151 additions and 41 deletions.
8 changes: 4 additions & 4 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ Before doing any publishing, make sure that changes are working with the one ava
Just adding the following code inside the `local.properties` file you can test both Android and iOS example app in `kaluga/example/`.
```
kaluga.exampleEmbeddingMethod=repo
kaluga.exampleMavenRepo=https://s01.oss.sonatype.org/service/local/repositories/comsplendo-REPO_NUMBER/
kaluga.libraryVersion=LIBRARY_VERSION
kaluga.exampleMavenRepo=https://s01.oss.sonatype.org/service/local/repositories/comsplendo-REPO_NUMBER/content/
```
Where
`REPO_NUMBER` is the id of the staging repository created to do the release (normally done automatically by GitHub Actions upon a `master` commit, the number can be found on the https://s01.oss.sonatype.org console under "staging repositories")
`LIBRARY_VERSION` is the version of the library that we are publish

Don't forget to remove these when you are done.
Make sure you are on the `master` branch (which is where the HEAD commit of the release should be anyway) or the version number will include a `-SNAPSHOT` postfix.

Don't forget to remove this when you are done to go back to composite builds.

#### Publishing locally

Expand Down
10 changes: 1 addition & 9 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,14 @@ The example app can load the main components either through your (local) maven r

The advantage of using a gradle module is that you can edit the source of components and run them in the example right away, without needing to publish them to maven first.

By default Kaluga dependency is included as a composite build. You also can put the property `kaluga.exampleEmbeddingMethod=composite` in the `local.properties` file in the root of the project (this file is already generated by your IDE normally) to specify it explicitly. To enable maven use `kaluga.exampleEmbeddingMethod=maven`.
By default Kaluga dependency is included as a composite build. You also can put the property `kaluga.exampleEmbeddingMethod=composite` in the `local.properties` file in the root of the project (this file is already generated by your IDE normally) to specify it explicitly. To enable maven use `kaluga.exampleEmbeddingMethod=repo`.

You can also set the `kaluga.exampleMavenRepo` property to specify which maven repo to look in. By default this is `mavenLocal()` (this can also be used by explicitly setting the value `local`). For example to set this to the sonatype snapshot repository use:

```properties
kaluga.exampleMavenRepo=https://s01.oss.sonatype.org/content/repositories/snapshots/
```

In conjunction, you can set the `kaluga.libraryVersion` property. This will override the version of Kaluga to look for. For example:

```properties
kaluga.libraryVersion=0.2.2-SNAPSHOT
```

Please note that this also overrides the version when building Kaluga itself.

### Links
In order to make kaluga-links example work correctly, you must sign the app with a signing certificate belonging to our team or using the `debug.keystore` file we provide.

Expand Down
2 changes: 1 addition & 1 deletion example/embedding/src/main/kotlin/EmbeddingPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import java.util.Properties
abstract class BaseEmbeddingPlugin {
fun apply(container: ExtensionContainer, rootDir: File, logger: Logger) {
val props = Properties()
val file = File(rootDir, "/local.properties")
val file = File(rootDir, "/../local.properties")
if (file.exists()) {
props.load(FileInputStream(file))
}
Expand Down
10 changes: 5 additions & 5 deletions example/ios/Demo/Architecture/ArchitectureView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ struct ArchitectureView: View {
}
}
.padding(10.0)
.navigation(state: contentRoutingState, type: .push) {
switch contentRoutingState.object {
.navigation(state: contentRoutingState, type: .push) { route in
switch route.object {
case let .details(input): ArchitectureDetailsView(inputDetails: input) { result in
viewModel.nameInput.post(newValue: result.name as NSString)
viewModel.numberInput.post(newValue: NSString.init(format: "%d", result.number))
}.equatable()
.environmentObject(contentRoutingState as RoutingState)
.environmentObject(route as RoutingState)
default: EmptyView()
}
}
.navigation(state: bottomSheetRoutingState, type: .partialSheet(style: PSIphoneStyle.defaultStyle())) {
BottomSheetView().equatable().environmentObject(bottomSheetRoutingState)
.navigation(state: bottomSheetRoutingState, type: .partialSheet(style: PSIphoneStyle.defaultStyle())) { route in
BottomSheetView().equatable().environmentObject(route)
}
.navigationTitle("feature_architecture".localized())
}
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Demo/Architecture/BottomSheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ struct BottomSheetView: View, Equatable {
Text(viewModel.text)
viewModel.button.toButton(buttonFrame: .frame(maxWidth: .infinity))
}.padding(10.0)
.navigation(state: nextRoute, type: .push) {
BottomSheetSubPageView().environmentObject(BottomSheetSubPageView.RouteStack(previousRoute: nextRoute, parentRoute: previousRoute))
.navigation(state: nextRoute, type: .push) { [unowned previousRoute] route in
BottomSheetSubPageView().environmentObject(BottomSheetSubPageView.RouteStack(previousRoute: route, parentRoute: previousRoute))
}
.navigationViewStyle(.stack)
.navigationBarItems(
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Demo/Bluetooth/BluetoothListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ struct BluetoothListView: View {
id: device.identifierString,
type: .sheet,
didSelect: { },
content: {
if let route = deviceRoute.object {
switch route {
content: { route in
if let object = route.object {
switch object {
case .details(let uuid): BluetoothDeviceDetailsView(identifier: uuid).equatable()
}
}
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Demo/Resources/ResourcesListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct ResourcesListView: View {
}
}
}
.navigation(state: navigationState, type: .push) {
switch navigationState.object {
.navigation(state: navigationState, type: .push) { state in
switch state.object {
case .buttons: ButtonView().equatable() // For lifecycle subviews it is recommended to use equatable
case .labels: LabelView()
case .images: ImagesView()
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Demo/Scientific/ScientificConverterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ struct ScientificConverterView: View, Equatable {
}
}
.padding(10.0)
.navigation(state: nextRoute, type: .sheet) {
if let routeObject = nextRoute.object {
.navigation(state: nextRoute, type: .sheet) { route in
if let routeObject = route.object {
switch routeObject {
case let .leftUnit(quantity):
ScientificUnitSelectionView(quantity: quantity) { index in
viewModel.didSelectLeftUnit(unitIndex: index)
}
.equatable()
.environmentObject(nextRoute as RoutingState)
.environmentObject(route as RoutingState)
case let .rightUnit(quantity):
ScientificUnitSelectionView(quantity: quantity) { index in
viewModel.didSelectRightUnit(unitIndex: index)
}
.equatable()
.environmentObject(nextRoute as RoutingState)
.environmentObject(route as RoutingState)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions example/ios/Demo/Scientific/ScientificView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,20 @@ struct ScientificView: View {
id: converter.id,
type: .push,
didSelect: converter.button.action
) {
if let route = converterRoute.object {
switch route {
) { route in
if let object = route.object {
switch object {
case let .converter(arguments): ScientificConverterView(arguments: arguments)
.equatable()
.environmentObject(converterRoute as RoutingState)
.environmentObject(route as RoutingState)
}
}
}
}
}
}
.padding(.horizontal, 10.0)
.navigation(state: route, type: .sheet) {
.navigation(state: route, type: .sheet) { route in
if let routeObject = route.object {
switch routeObject {
case let .leftUnit(quantity):
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Kaluga-SwiftUI
Loading

0 comments on commit 61d5410

Please sign in to comment.