Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Sources/SwiftJavaMacros/ImplementsJavaMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ extension JavaImplementationMacro: PeerMacro {
exposedMembers.append(
"""
@_cdecl(\(literal: cName))
func \(context.makeUniqueName(swiftName))(\(raw: cParameters.map{ $0.description }.joined(separator: ", ")))\(raw: cReturnType) {
public func \(context.makeUniqueName(swiftName))(\(raw: cParameters.map{ $0.description }.joined(separator: ", ")))\(raw: cReturnType) {
\(body)
}
"""
Expand Down
16 changes: 8 additions & 8 deletions Tests/SwiftJavaMacrosTests/JavaImplementationMacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class JavaImplementationMacroTests: XCTestCase {
}

@_cdecl("Java_org_swift_example_Hello_1World_test_1method")
func __macro_local_11test_methodfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
public func __macro_local_11test_methodfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
let obj = HelloWorld(javaThis: thisObj, environment: environment!)
return obj.test_method()
.getJNILocalRefValue(in: environment)
Expand Down Expand Up @@ -75,7 +75,7 @@ class JavaImplementationMacroTests: XCTestCase {
}

@_cdecl("Java_com_example_test_MyClass_simpleMethod")
func __macro_local_12simpleMethodfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
public func __macro_local_12simpleMethodfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
let obj = MyClass(javaThis: thisObj, environment: environment!)
return obj.simpleMethod()
.getJNILocalRefValue(in: environment)
Expand Down Expand Up @@ -105,7 +105,7 @@ class JavaImplementationMacroTests: XCTestCase {
}

@_cdecl("Java_org_example_Utils_static_1helper")
func __macro_local_13static_helperfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) -> String.JNIType {
public func __macro_local_13static_helperfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass) -> String.JNIType {
return Utils.static_helper(environment: environment)
.getJNILocalRefValue(in: environment)
}
Expand Down Expand Up @@ -142,14 +142,14 @@ class JavaImplementationMacroTests: XCTestCase {
}

@_cdecl("Java_test_Class_1With_1Underscores_method_1one")
func __macro_local_10method_onefMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
public func __macro_local_10method_onefMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
let obj = ClassWithUnderscores(javaThis: thisObj, environment: environment!)
return obj.method_one()
.getJNILocalRefValue(in: environment)
}

@_cdecl("Java_test_Class_1With_1Underscores_method_1two")
func __macro_local_10method_twofMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
public func __macro_local_10method_twofMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) -> Int32.JNIType {
let obj = ClassWithUnderscores(javaThis: thisObj, environment: environment!)
return obj.method_two()
.getJNILocalRefValue(in: environment)
Expand Down Expand Up @@ -187,13 +187,13 @@ class JavaImplementationMacroTests: XCTestCase {
}

@_cdecl("Java_org_swift_swiftkit_core_collections_SwiftDictionaryMap__00024size")
func __macro_local_5_sizefMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, pointer: Int64.JNIType) -> Int32.JNIType {
public func __macro_local_5_sizefMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, pointer: Int64.JNIType) -> Int32.JNIType {
return SwiftDictionaryMapJava._size(environment: environment, pointer: Int64(fromJNI: pointer, in: environment!))
.getJNILocalRefValue(in: environment)
}

@_cdecl("Java_org_swift_swiftkit_core_collections_SwiftDictionaryMap__00024destroy")
func __macro_local_8_destroyfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, pointer: Int64.JNIType) {
public func __macro_local_8_destroyfMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, pointer: Int64.JNIType) {
return SwiftDictionaryMapJava._destroy(environment: environment, pointer: Int64(fromJNI: pointer, in: environment!))
}
""",
Expand Down Expand Up @@ -221,7 +221,7 @@ class JavaImplementationMacroTests: XCTestCase {
}

@_cdecl("Java_org_example_Processor_process_1data")
func __macro_local_12process_datafMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) {
public func __macro_local_12process_datafMu_(environment: UnsafeMutablePointer<JNIEnv?>!, thisObj: jobject) {
let obj = Processor(javaThis: thisObj, environment: environment!)
return obj.process_data()
}
Expand Down