Skip to content

Commit

Permalink
Fix bridging macro names
Browse files Browse the repository at this point in the history
  • Loading branch information
marcprux committed Oct 20, 2024
1 parent c46283a commit 956f215
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 87 deletions.
78 changes: 0 additions & 78 deletions Darwin/AppDroid.xcodeproj/xcshareddata/xcschemes/AppDroid.xcscheme

This file was deleted.

7 changes: 5 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,24 @@ let package = Package(
],
dependencies: [
.package(url: "https://source.skip.tools/skip.git", from: "1.1.10"),
.package(url: "https://source.skip.tools/skip-foundation.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-ui.git", from: "1.0.0"),
.package(url: "https://source.skip.tools/skip-bridge.git", branch: "main"),
.package(url: "https://source.skip.tools/skip-bridge.git", branch: "macros"),
.package(url: "https://github.com/apple/swift-algorithms", from: "1.2.0"),
],
targets: [
.target(name: "AppDroid", dependencies: [
"AppDroidModel",
.product(name: "SkipUI", package: "skip-ui", condition: .when(platforms: [.macOS, .iOS])),
.product(name: "SkipUI", package: "skip-ui"),
], resources: [.process("Resources")], plugins: [.plugin(name: "skipstone", package: "skip")]),
.testTarget(name: "AppDroidTests", dependencies: [
"AppDroid",
.product(name: "SkipTest", package: "skip")
], resources: [.process("Resources")], plugins: [.plugin(name: "skipstone", package: "skip")]),
.target(name: "AppDroidModel", dependencies: [
//.product(name: "SkipFoundation", package: "skip-foundation"),
.product(name: "SkipBridge", package: "skip-bridge"),
.product(name: "SkipBridgeMacros", package: "skip-bridge"),
.product(name: "Algorithms", package: "swift-algorithms"),
], resources: [.process("Resources")], plugins: [.plugin(name: "skipstone", package: "skip")]),
.testTarget(name: "AppDroidModelTests", dependencies: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/AppDroidModel/AppDroidKotlin.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// SKIP @bridgeToSwift
// SKIP @BridgeToSwift
func getJavaSystemProperty(_ name: String) -> String? {
#if SKIP
return java.lang.System.getProperty(name)
Expand Down
3 changes: 3 additions & 0 deletions Sources/AppDroidModel/Skip/skip.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Configuration file for https://skip.tools project
skip:
mode: 'kotlin'
build:
contents:
12 changes: 6 additions & 6 deletions Sources/AppDroidModel/Swift/AppDroidSwift.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

// SKIP @bridgeToKotlin
// SKIP @BridgeToKotlin
public func callingEnvironment() -> String {
#if SKIP
return "Skip"
Expand All @@ -13,18 +13,18 @@ public func callingEnvironment() -> String {
#endif
}

// SKIP @bridgeToKotlin
// SKIP @BridgeToKotlin
public func getJavaSystemPropertyViaSwift(_ name: String) -> String? {
getJavaSystemProperty(name)
}

// SKIP @bridgeToKotlin
// SKIP @BridgeToKotlin
public var bridgedString = "😀" + "🚀"

// SKIP @bridgeToKotlin
// SKIP @BridgeToKotlin
public var swiftClosure1Var: (Int) -> String = { i in "value = \(i)" }

// SKIP @bridgeToKotlin
// SKIP @BridgeToKotlin
public class SwiftClass {
public var intVar = 1
public var optionalIntVar: Int? = nil
Expand All @@ -38,7 +38,7 @@ public class SwiftClass {
}


// SKIP @bridgeToKotlin
// SKIP @BridgeToKotlin
public class ObservableFacade {
// the un-bridged Observable implementation
private let observable = ObservableClass()
Expand Down

0 comments on commit 956f215

Please sign in to comment.