diff --git a/Sources/SwiftJavaMacros/ImplementsJavaMacro.swift b/Sources/SwiftJavaMacros/ImplementsJavaMacro.swift index 02a784bec..e6e17b1cb 100644 --- a/Sources/SwiftJavaMacros/ImplementsJavaMacro.swift +++ b/Sources/SwiftJavaMacros/ImplementsJavaMacro.swift @@ -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) } """ diff --git a/Tests/SwiftJavaMacrosTests/JavaImplementationMacroTests.swift b/Tests/SwiftJavaMacrosTests/JavaImplementationMacroTests.swift index 2019acd67..5dcd60a07 100644 --- a/Tests/SwiftJavaMacrosTests/JavaImplementationMacroTests.swift +++ b/Tests/SwiftJavaMacrosTests/JavaImplementationMacroTests.swift @@ -45,7 +45,7 @@ class JavaImplementationMacroTests: XCTestCase { } @_cdecl("Java_org_swift_example_Hello_1World_test_1method") - func __macro_local_11test_methodfMu_(environment: UnsafeMutablePointer!, thisObj: jobject) -> Int32.JNIType { + public func __macro_local_11test_methodfMu_(environment: UnsafeMutablePointer!, thisObj: jobject) -> Int32.JNIType { let obj = HelloWorld(javaThis: thisObj, environment: environment!) return obj.test_method() .getJNILocalRefValue(in: environment) @@ -75,7 +75,7 @@ class JavaImplementationMacroTests: XCTestCase { } @_cdecl("Java_com_example_test_MyClass_simpleMethod") - func __macro_local_12simpleMethodfMu_(environment: UnsafeMutablePointer!, thisObj: jobject) -> Int32.JNIType { + public func __macro_local_12simpleMethodfMu_(environment: UnsafeMutablePointer!, thisObj: jobject) -> Int32.JNIType { let obj = MyClass(javaThis: thisObj, environment: environment!) return obj.simpleMethod() .getJNILocalRefValue(in: environment) @@ -105,7 +105,7 @@ class JavaImplementationMacroTests: XCTestCase { } @_cdecl("Java_org_example_Utils_static_1helper") - func __macro_local_13static_helperfMu_(environment: UnsafeMutablePointer!, thisClass: jclass) -> String.JNIType { + public func __macro_local_13static_helperfMu_(environment: UnsafeMutablePointer!, thisClass: jclass) -> String.JNIType { return Utils.static_helper(environment: environment) .getJNILocalRefValue(in: environment) } @@ -142,14 +142,14 @@ class JavaImplementationMacroTests: XCTestCase { } @_cdecl("Java_test_Class_1With_1Underscores_method_1one") - func __macro_local_10method_onefMu_(environment: UnsafeMutablePointer!, thisObj: jobject) -> Int32.JNIType { + public func __macro_local_10method_onefMu_(environment: UnsafeMutablePointer!, 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!, thisObj: jobject) -> Int32.JNIType { + public func __macro_local_10method_twofMu_(environment: UnsafeMutablePointer!, thisObj: jobject) -> Int32.JNIType { let obj = ClassWithUnderscores(javaThis: thisObj, environment: environment!) return obj.method_two() .getJNILocalRefValue(in: environment) @@ -187,13 +187,13 @@ class JavaImplementationMacroTests: XCTestCase { } @_cdecl("Java_org_swift_swiftkit_core_collections_SwiftDictionaryMap__00024size") - func __macro_local_5_sizefMu_(environment: UnsafeMutablePointer!, thisClass: jclass, pointer: Int64.JNIType) -> Int32.JNIType { + public func __macro_local_5_sizefMu_(environment: UnsafeMutablePointer!, 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!, thisClass: jclass, pointer: Int64.JNIType) { + public func __macro_local_8_destroyfMu_(environment: UnsafeMutablePointer!, thisClass: jclass, pointer: Int64.JNIType) { return SwiftDictionaryMapJava._destroy(environment: environment, pointer: Int64(fromJNI: pointer, in: environment!)) } """, @@ -221,7 +221,7 @@ class JavaImplementationMacroTests: XCTestCase { } @_cdecl("Java_org_example_Processor_process_1data") - func __macro_local_12process_datafMu_(environment: UnsafeMutablePointer!, thisObj: jobject) { + public func __macro_local_12process_datafMu_(environment: UnsafeMutablePointer!, thisObj: jobject) { let obj = Processor(javaThis: thisObj, environment: environment!) return obj.process_data() }