Releases: swiftlang/swift-java
0.2.0
This is a really great release, thank you for all the work to all contributors.
Highlights
- Improvements in generic handling, especially around Tuples #657 and even labelled tuples #670
- Specialization support -- you can now "specialize" types in swift-java.config or using a
typealias SomethingCool = Something<Cool>in code #664 - support for
#if ...blocks! #678 - returning strings and throwing funcs in jextract/FFM #651
- Better support for Dead Code Elimination, especially important for Android #652
And a number of performance and correctness fixes all around jextract and wrap-java.
The complete changelist follows next:
What's Changed
- update the releasing script with some nuances by @ktoso in #641
- No dots in messages by @ktoso in #643
- Add more JNI local frames to method calls by @madsodgaard in #645
- jextract plugin: prefer gradlew over global gradle by @ktoso in #644
- Prepare next development cycle after 0.1.2 release by @ktoso in #642
- Fix compiler warnings by @sidepelican in #646
- Better
@JavaClassdetection for JExtract by @madsodgaard in #647 - jextract-jni: Add type parameters to generated java types by @sidepelican in #648
- jextract/ffm: Support returning Strings by @ktoso in #651
- [Android] Add support for emitting symbol list for better DCE, also add docs about binary sizes by @madsodgaard in #652
- Fix JNI symbols not exposed in release mode by @gmondada in #650
- Lower minimum macOS version to v13 by @llsc12 in #654
- jextract: [SwiftType]
optional,array,dictionary, andsetintonominaltype by @sidepelican in #649 - jextract/wrap-java(!): add filter-include/exclude same as wrap-java has by @ktoso in #655
- jextract: introduce importedModuleStubs config by @ktoso in #656
- jextract/ffm: Support throwing funcs in FFM mode by @ktoso in #658
- jextract: Add single-type mode for jextract by @ktoso in #659
- Remove from the doc the use of unsafeFlags by @gmondada in #660
- remove swift-format multiline trailing comma by @ktoso in #662
- jextract/jni: Support generic types within Optional and Tuple by @sidepelican in #657
- jextract/jni: Specialization and constrained extension support by @ktoso in #664
- Fix linker version script output by @madsodgaard in #665
- Small cleanups by @ktoso in #666
- jextract/jni: handle UnsafeRawBufferPointer params by @ktoso in #668
- jextract/jni: support generic params : DataProtocol by @ktoso in #669
- jextract: LabeledTuple support! by @ktoso in #670
- Add type name to macro-generated function names by @sidepelican in #674
- Add Swift 6.3 CI by @ktoso in #672
- Narrow down
java.library.pathto prevent loading stale dylibs by @sidepelican in #673 - jextract: Evaluate IfConfigDecl and add --static-build-config option by @sidepelican in #671
- Revert "jextract: Evaluate IfConfigDecl and add --static-build-config option" by @ktoso in #677
- make the jni throwing runtime test actually throw by @ktoso in #675
- jextract: Evaluate IfConfigDecl and add --static-build-config option 2 by @sidepelican in #678
- Disable nightly-main for now, until things are more stable by @ktoso in #680
- Allow configuring the library name to be loaded in swift-java.config by @ktoso in #682
- jextract: handle nested arrays, e.g. [[UInt8]] by @ktoso in #679
- jextract/jni: handle tuples with array elements by @ktoso in #685
- jextract/jni: Make single-type mode available by @sidepelican in #686
- Preparing release 0.2.0 by @ktoso in #688
New Contributors
Full Changelog: 0.1.2...0.2.0
0.1.2
0.1.1-failed
This tag is not usable due to a main branch dependency on swift-java-jni-core, please use 0.1.2 instead.
0.1.0
This is the first tagged release of swift-java! π
We'd like to thank everyone who supported the project so far, be it with issues, pull requests or just discussions on the forums and community calls, thank you!
This initial release marks a significant milestone for the project, and although we're not yet promising source stability, you should be able to get large amounts of work done and can rely on the tag explicitly (pin your dependency to a specific tag if you want), to start adopting swift-java in real projects -- as some companies and individuals have already.
Pre-stable release
As the version number indicates, this release does not guarantee source stability. We will continue to work towards this goal, however currently we do reserve the right to make changes in the source generation and/or libraries to break source compatibility.
You may depend on this package using upToNextMinor or stick to a specific release using exact: in your Package.swift. We encourage using up to next minor or even main branch dependency as a secondary build in your CI systems in order to provide feedback about the projects status and impact on your codebases. Thank you for your support!
Documentation on Swift Package Index
We'd also like to thank the good folks at the Swift Package Index which made changes to enable swift-java to be built and documented SPI: https://swiftpackageindex.com/swiftlang/swift-java
Initial Android support
Earlier last year, thank to the Summer of Code work on jextract/jni, we started working on Android support for jextract, and today we continue that work. We'd like to extend thanks to @madsodgaard who kicked off the effort in his GSoC work, and has continued to work on it afterwards, as well as the Android workgroup for their support in pursuing this important platform support.
What's Changed
Pull requests are categorized by the feature area of swift-java they primarily support.
jextract/ffm
- Prepare accessor function descriptors for properties: get set by @ktoso in #41
- Model Swift's type metadata and value witness table for memory layout information by @DougGregor in #42
- SwiftArena and invoking destroy on objects as arena is destroyed by @ktoso in #67
- implement () -> () as Runnable downcalls and upcalls by @ktoso in #100
- SwiftArena.ofAuto() which uses GC to manage swift instances (and destroy them) by @ktoso in #133
- Update Class Layout to use Runtime Metadata by @jrosen081 in #190
- JMH Benchmark and passing java String to JExtracted Swift by @ktoso in #203
- Simple step towards importing structs, add initializeWithCopy funcs by @ktoso in #206
- Revert "Prefer VarHandle to raw offset APIs" by @ktoso in #208
- Indirect returns and more value type support by @ktoso in #211
- Move layout constants from generated code to SwiftKit by @madsodgaard in #233
- Import any C compatible closures by @rintaro in #253
- Prohibit 'throws' in FFM generator by @rintaro in #280
- Bridge UnsafeRawBufferPointer by @rintaro in #279
- Bridge closures with UnsafeRawBufferPointer parameter by @rintaro in #282
- Translate 'some DataProtocol' parameters to 'Data' by @rintaro in #303
- Bridge Optional parameters by @rintaro in #320
- Support [UInt8] parameters by @ktoso in #477
- Implement Java-side integer overflow checks for FFM (#517) by @DPrakashhh in #549
jextract/jni
- Generate code for free functions with primitive types in JNI mode by @madsodgaard in #269
- Add support for strings in JNI by @madsodgaard in #273
- Add support for throwing functions in JNI mode by @madsodgaard in #277
- Add JNI sample app by @madsodgaard in #295
- Generate JNI code for classes (static methods and initializers) by @madsodgaard in #298
- Generate JNI code for memory management with SwiftKitCore by @madsodgaard in #302
- Add support for JNI member methods by @madsodgaard in #305
- Add support for variables by @madsodgaard in #306
- Omit unsupported types instead of crashing by @madsodgaard in #313
- Add tests for structs by @madsodgaard in #316
- Move 'selfPointer' to 'JNISwiftInstance' & downcall trace logs by @ktoso in #322
- Fix boolean naming for variables already called isX by @madsodgaard in #325
- Add support for classes/structs as parameters and return values by @madsodgaard in #326
- Add support for primitive non-escaping closures by @madsodgaard in #327
- Support JavaKit wrapped types as function parameters by @madsodgaard in #330
- Fix JNI + unsigned modes checking by @ktoso in #342
- Support optionals in JNI mode by @madsodgaard in #340
- Add auto arena to SwiftKitCore and add memory management options by @madsodgaard in #353
- Add support for protocols as parameter types by @madsodgaard in #376
- Add support for async Swift methods by @madsodgaard in #413
- Remove withVaList from generated code by @madsodgaard in #416
- Update docs about throwing and optional init and add tests by @madsodgaard in #426
- Fix support for objects in async by @madsodgaard in #428
- Add support for importing nested types by @madsodgaard in #429
- Use deferEnvironment instead of environment interface by @ktoso in #437
- Add support for implementing Swift protocols in Java by @madsodgaard in #449
- Support UInt handling in JNI mode by @pelekon in #460
- Fix JNI caching for native threads by @madsodgaard in #464
- Use thread environment instead for JNI methods by @madsodgaard in #465
- Fix allowGlobalAutomatic mode for interfaces by @madsodgaard in #466
- Extract CustomStringConvertible as toString() and fix extensions by @madsodgaard in #473
- Add tests for @unsigned in methods in JNI mode by @ktoso in #475
- Fix protocols that return java classes by @madsodgaard in #479
- Add array and throwing functions support to java callbacks by @madsodgaard in #481
- Fix unused result warnings for CallBooleanMethodA in generated JNI code by @0xZaph in #482
- Fix protocol threading by @madsodgaard in #483
- Pass arena from Swift instead of default interface for callbacks by @madsodgaard in #489
- Add support for escaping closures by @gevartosky in #491
- Fix wrong order, or redundant try/await in generated code which caused warnings by @amanthatdoescares in #503
- Extract Foundation.Date by @madsodgaard in #506
- Fix glue functions as public in JNI mode by @sidepelican in #520
- Fix compile error in generated thunks for throwing functions returning String by @sidepelican in #527
- Import DataProtocol's decl along with Data by @sidepelican in #548
- Skip static requirements in protocols by @sidepelican in #553
- Bridge UUID by @madsodgaard in #554
- Skip InterfaceWrapper generation for protocols with static requirements by @sidepelican in #555
- Add initial Foundation.Data support by @ktoso in #557
- Suppress warning for "inferred to have type '()'," by @sidepelican in #559
- Always return (U)Int as long by @madsodgaard in #564
- Add support for optional Date and Date by @madsodgaard in #568
- Fix support for optional strings in protocols by @madsodgaard in #569
- Add basic support for generic types by @sidepelican in #572
- Skip discriminator generation if enum has no cases by @sidepelican in #573
- Escape generated JNI for @JavaImplementation methods by @colemancda in #575
- Unify common methods using generic implementations by @sidepelican in #582
- Basic accept/return support for Swift tuples by @ktoso in #602
- SwiftDictionaryMap - a native backed Map implementation by @ktoso in #614
- Cleanup how we handle local references in JNI interactions by @madsodgaard in #616
- Native Swift Set support by @ktoso in #622
jextract/shared
- Replace ImportedFunc.swiftDemangledMangledName with a Swift full name by @DougGregor in #3
- Start implementing nominal type resolution by @DougGregor in #4
- Finish the migration from ImportedTypeName over to TranslatedType by @DougGregor in #8
- Expose Java-friendly instance methods and constructors for Swift types by @DougGregor in #9
- Extract mangled names from .swiftinterface rather than using nm by @DougGregor in #27
- Redesign jextract-swift: plugins and avoid custom swift features by @ktoso in #170
- Initial implementation of a new lowering from a Swift func to @_cdecl func by @DougGregor in #210
- Implement function bodies for lowered @_cdecl thunks by @DougGregor in #212
- Introduce staged lowering of Swift to @_cdecl Swift to C by @DougGregor in #214
- CodePrinter indentation improvements by @rintaro in #221
- Prepare all inputs before analyze() by @rintaro in #222
- Misc improvements by @rintaro in #223
- Rework translation by @rintaro in #236
- Remove NominalTypeResolution by @rintaro in #237
- Improve Cdecl lowering by @rintaro in #238
- Update for review feedback by @rintaro in #239
- Unify mechanisms between value types and reference types by @rintaro in #240
- Fix methods returning imported type by @rintaro in #244
- Import initializers as static methods by @rintaro in #245
- Static 'call' method in binding descriptor classes by @rintaro in #246
- Introduce protocol-based structure for generating code by @madsodgaard in #249
- Santize trivia for declartion signature string by @rintaro in #250
- Move 'apiKind' property to 'ImportedFunc' by @rintaro in #251
- Lazy Cdecl lowering and Java translation by @rintaro in #252
- Introduce SwiftKnownTypes by @rintaro in #271
- Stop using SyntaxVisitor for Swift2JavaVisitor by @rintaro in #290
- Import Foundation.Data if used by @rintaro in #301
- Handling unsigned numbers better by @ktoso in #333
- Translate generic parameters by @rintaro in #336
- Mark Sendable types as @threadsafe by @ktoso in #341
- Allow importing internal decls by @ktoso in #343
- Fix importing extensions by @rintaro in #351
- Hide memory location wrapping constructor, give it proper name by @ktoso in #360
- Avoid jextracting +SwiftJava files by @ktoso in #378
- Generate one output swift file per input file b...