File tree Expand file tree Collapse file tree 4 files changed +8
-0
lines changed
Samples/SwiftKitSampleApp/src/main/java/com/example/swift Expand file tree Collapse file tree 4 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ static void examples() {
8686 try (var arena = SwiftArena .ofConfined ()) {
8787 var origBytes = arena .allocateFrom ("foobar" );
8888 var origDat = Data .init (origBytes , origBytes .byteSize (), arena );
89+ SwiftKit .trace ("origDat.count = " + origDat .getCount ());
8990
9091 // var origBytes = arena.allocate(ValueLayout.JAVA_INT, arry.length);
9192 // origBytes.copyFrom(MemorySegment.ofArray(arry));
Original file line number Diff line number Diff line change @@ -63,6 +63,9 @@ package class FFMSwift2JavaGenerator: Swift2JavaGenerator {
6363 return String ( filePathPart. replacing ( " .swift " , with: " +SwiftJava.swift " ) )
6464 } )
6565 self . expectedOutputSwiftFiles. insert ( " \( translator. swiftModuleName) Module+SwiftJava.swift " )
66+
67+ // FIXME: Can we avoid this?
68+ self . expectedOutputSwiftFiles. insert ( " Data+SwiftJava.swift " )
6669 } else {
6770 self . expectedOutputSwiftFiles = [ ]
6871 }
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ package class JNISwift2JavaGenerator: Swift2JavaGenerator {
5858 return String ( filePathPart. replacing ( " .swift " , with: " +SwiftJava.swift " ) )
5959 } )
6060 self . expectedOutputSwiftFiles. insert ( " \( translator. swiftModuleName) Module+SwiftJava.swift " )
61+
62+ // FIXME: Can we avoid this?
63+ self . expectedOutputSwiftFiles. insert ( " Data+SwiftJava.swift " )
6164 } else {
6265 self . expectedOutputSwiftFiles = [ ]
6366 }
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ private let swiftSourceFile: SourceFileSyntax = """
8888private let foundationSourceFile : SourceFileSyntax = """
8989 public struct Data {
9090 public init(bytes: UnsafeRawPointer, count: Int)
91+ public var count: Int { get }
9192 public func withUnsafeBytes(_ body: (UnsafeRawBufferPointer) -> Void)
9293 }
9394 """
You can’t perform that action at this time.
0 commit comments