Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge devel into master #13

Open
wants to merge 94 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
879ab7e
wrap with swift (SwiftPM 3.1)
rikner Jul 13, 2017
3f658dc
header with renamed types
rikner Jul 13, 2017
ba7725e
adjust code to new header wip
rikner Jul 14, 2017
4b39e70
Update for new header
ephemer Jul 14, 2017
9482fb8
jni methods
rikner Jul 17, 2017
0b07b80
add CallStaticVoidMethod, GetObjectArrayElement
rikner Jul 18, 2017
51195a5
wip on JNIMethods, public JavaParameterConvertible, javaStaticMethod,
rikner Jul 18, 2017
703f9ef
move build.sh
rikner Jul 18, 2017
fdd435e
update xcodeproj files
rikner Jul 18, 2017
9cbb896
Add a bunch of stuff for JNI method calling
ephemer Jul 18, 2017
9f4a9f6
do not import Dispatch in SwiftJNI
rikner Jul 18, 2017
c0820ab
Remove debugging prints
cshg Jul 19, 2017
d76490b
Add if os android to print code
cshg Jul 19, 2017
b377926
add CallStaticBooleanMethod
rikner Jul 19, 2017
8337f38
split and cleanup code JNIMethods code
rikner Jul 19, 2017
4fb07aa
add build script
rikner Jul 19, 2017
f804d5b
add GetStrings
rikner Jul 19, 2017
5410d77
Merge branch 'methodChanges' into devel
rikner Jul 19, 2017
9227b25
overload callStatic to call void method, make returnType parameter in…
rikner Jul 20, 2017
566be2d
Clean up
ephemer Jul 24, 2017
dcd2311
Add / correct the last header annotations in jni.h
ephemer Jul 25, 2017
499eefc
Merge branch 'devel' into methodChanges-swift4
ephemer Jul 27, 2017
64a2600
Rename to JNI
ephemer Jul 28, 2017
8996ab6
Clean up JNIMethods
ephemer Jul 28, 2017
4ed9f9b
Remove methodSignature(returnType: JavaObjectClassName)
ephemer Jul 28, 2017
5314cee
Remove JavaObjectClassName
ephemer Jul 28, 2017
fa12416
implemented generic GetStaticField method
rikner Aug 1, 2017
4b18b6c
Add more type conformances (Double, Int) to JavaParameterConvertible
ephemer Aug 2, 2017
5cabd15
Merge pull request #5 from SwiftAndroid/methodChanges-swift4
rikner Aug 3, 2017
faa9061
Merge branch 'devel' into staticField
rikner Aug 3, 2017
d4bb403
add GetByteArrayRegion and SetByteArrayRegion
rikner Aug 4, 2017
b8a4ca4
Use original GetMethodID with Class in JNIObject constructor
cshg Aug 4, 2017
25c407c
implemented generic GetStaticField method
rikner Aug 1, 2017
79eaf04
add GetByteArrayRegion and SetByteArrayRegion
rikner Aug 4, 2017
05e4d2f
implement GetField and GetObjectArrayElement
rikner Aug 10, 2017
d34ec93
add fromStaticField to Double
rikner Aug 10, 2017
7d49147
Merge branch 'byteArray' into staticField
rikner Aug 10, 2017
bf4d3e1
Merge branch 'staticField' into GetField
rikner Aug 10, 2017
572cfb2
use bitPattern to construct UInt8 from JavaByte
rikner Aug 10, 2017
ba97ba3
GetStatic<Type>Field methods throw, use JNI_TRUE
rikner Aug 11, 2017
abe8af8
replace StaticFieldError.InvalidParameters with FieldIDNotFound
rikner Aug 11, 2017
7388d54
cleanup not used error; change message of assertionFailure in JavaObj…
rikner Aug 11, 2017
01e4b7f
Merge pull request #6 from SwiftAndroid/staticField
rikner Aug 18, 2017
156fb78
Merge branch 'devel' into GetField
rikner Aug 19, 2017
1b58781
JNIObject init throws
rikner Aug 20, 2017
99c444e
Merge branch 'devel' into GetField
rikner Aug 21, 2017
e97246e
Delete local objectClass ref in GetMethodID for object
cshg Aug 22, 2017
2babba9
implement Feedback
rikner Aug 25, 2017
1acd061
correct order of parameters for fromField()
rikner Aug 25, 2017
c1f7009
correct order of parameters for fromStaticField
rikner Aug 25, 2017
1d2e782
rename jfieldID to JavaFieldID (#8)
rikner Aug 25, 2017
548d23b
FindClass throws
rikner Aug 25, 2017
60ed9cb
update comment about bitPattern constructor in GetByteArrayRegion
rikner Sep 19, 2017
955bf59
Merge pull request #7 from SwiftAndroid/GetField
rikner Sep 19, 2017
d4032fe
check for threadStatus instead of threadStatus.bigEndian
rikner Nov 8, 2017
ca6ba6f
conform JavaObject to JavaParameterConvertible
rikner Nov 24, 2017
a19b3e2
fix JavaObject.asJNIParameterString
rikner Nov 27, 2017
5112554
asJNIParameterString always as let
rikner Dec 6, 2017
882bca2
Merge pull request #9 from SwiftAndroid/javaobject-convertible
rikner Dec 6, 2017
574fe6a
Don't use deprecated Swift.String APIs
ephemer Dec 14, 2017
fb1cc56
Add JavaContext struct
ephemer Dec 21, 2017
edbba2f
Use Foundation to do string replacement
ephemer Dec 21, 2017
49b4390
Restructure splitting many methods into separate files
ephemer Jan 9, 2018
7ca8143
Update JNI String functions
ephemer Jan 15, 2018
9bc4afd
Add missing files to Xcode project
ephemer Jan 23, 2018
d92a27a
Split up conformances for JavaParameterConvertible
ephemer Mar 6, 2018
0cee578
[Breaking Change] Use the real main queue with Johnno's toolchain
ephemer May 15, 2018
25a5140
make JavaLong aka Int64 conform to JavaParameterConvertible (#11)
michaelknoch May 25, 2018
7053cb0
"Build" JNI for Mac only (testing)
ephemer Jun 13, 2018
a2b9c15
implement JavaInt conformance to JavaParameterConvertible (#12)
michaelknoch Aug 16, 2018
128c155
make GetIntArrayRegion return array of Int32
michaelknoch Oct 12, 2018
dc2d8ff
Use c calling convention
ephemer Oct 26, 2018
41ee464
workaround SwiftPM bug
michaelknoch Oct 29, 2018
83c9859
allows static method calls on `JNIObject` (#14)
michaelknoch Aug 22, 2019
1a4cf54
prevent CallObjectMethod from crashing (#15)
michaelknoch Aug 22, 2019
a765442
Swift5 (#16)
michaelknoch Jan 14, 2020
33d2997
implement JNIObject.getField(), fix threading bug (#17)
rikner Oct 15, 2020
bf6249d
API Enhancements: JNI.GetDirectBufferAddress() and JNIObject.getField…
rikner Mar 15, 2021
450e0ba
Remove dependency on Foundation / CoreFoundation
ephemer Nov 10, 2021
73895cf
Add JavaParameterConvertible conformance to JNIObject
ephemer Nov 2, 2022
b94cd31
Define isMainThread in Swift due to issues with building C in CMake
ephemer Nov 2, 2022
c11778f
Fix Mac build
ephemer Nov 2, 2022
1ac9032
Remove unused import of Dispatch and some commented-out code
ephemer Nov 4, 2022
894237c
Fix isMainThread for Darwin
ephemer Nov 23, 2022
f03a5a1
Optionally allow building as a part of a static library that defines …
ephemer Dec 6, 2022
a9e8f3e
add Int to convertible primitives
rikner Mar 17, 2023
d977baa
update macos deployment target to 10.15 (#19)
michaelknoch Apr 28, 2023
71ed24c
SetByteArrayRegion: pass Array instead BufferPointer
rikner Jan 18, 2024
7960871
Swift 6 compatibility
ephemer Oct 30, 2024
681af66
Remove custom jni.h, use original from NDK
ephemer Oct 31, 2024
fb5255e
Cleanup Package.swift and remove Xcode proj (#20)
rikner Nov 6, 2024
5dd8f6c
Align JNIObject.call[Static] with jni.call[Static] method signatures
ephemer Nov 11, 2024
ac833a7
Add public JavaBoolean.true/.false definitions. Add BooleanArray methods
ephemer Nov 11, 2024
3d0a1c6
Add Sendable conformance (WIP)
ephemer Nov 12, 2024
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ xcuserdata
# Packages/
.build/

# temporary workaround for swift pm bug
Package.resolved

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
Expand Down
47 changes: 3 additions & 44 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,45 +1,4 @@
set(sources
JNI.swift
JNIArrays.swift.gyb
JNIClassManipulation.swift
JNIExceptions.swift
JNIFields.swift.gyb
JNIMethods.swift.gyb
JNIObjects.swift
JNIRefs.swift
JNIStrings.swift
SwiftJNI.swift
)
cmake_minimum_required(VERSION 3.16)
project(SwiftJNI LANGUAGES C Swift)

set(output_dir "${SWIFTLIB_DIR}/jni")

# Set correct paths to glibc headers
set(JNI_INCLUDE_PATH "${SWIFT_SDK_ANDROID_PATH}/usr/include")
if (NOT EXISTS "${JNI_INCLUDE_PATH}/jni.h")
message(FATAL_ERROR "JNI header was not found at ${JNI_INCLUDE_PATH}.")
endif()

# Generate module.map
configure_file(module.map.in "${CMAKE_CURRENT_BINARY_DIR}/module.map" @ONLY)

add_custom_command_target(unused_var
COMMAND
"${CMAKE_COMMAND}" "-E" "make_directory" "${output_dir}"
COMMAND
"${CMAKE_COMMAND}" "-E" "copy_if_different"
"${CMAKE_CURRENT_BINARY_DIR}/module.map"
"${output_dir}/module.map"
CUSTOM_TARGET_NAME "copy_jni_module"
OUTPUT "${output_dir}/module.map" "${output_dir}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/module.map"
COMMENT "Copying JNI module to ${output_dir}")

swift_install_in_component(stdlib
FILES "${output_dir}/module.map"
DESTINATION "lib/swift/jni")

add_swift_library(swiftJNI IS_SDK_OVERLAY
${sources}
FILE_DEPENDS copy_jni_module "${output_dir}"
TARGET_SDKS ANDROID
INSTALL_IN_COMPONENT stdlib-experimental)
add_subdirectory(Sources/JNI)
67 changes: 0 additions & 67 deletions JNI.swift

This file was deleted.

106 changes: 0 additions & 106 deletions JNIArrays.swift.gyb

This file was deleted.

43 changes: 0 additions & 43 deletions JNIClassManipulation.swift

This file was deleted.

38 changes: 0 additions & 38 deletions JNIExceptions.swift

This file was deleted.

56 changes: 0 additions & 56 deletions JNIFields.swift.gyb

This file was deleted.

Loading