Skip to content

Releases: swiftlang/swift-java

0.2.0

09 Apr 01:17
0.2.0
3d52a15

Choose a tag to compare

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 @JavaClass detection 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, and set into nominal type 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.path to 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

24 Mar 07:57
0.1.2
df17fd1

Choose a tag to compare

What's Changed

Full Changelog: 0.1.0...0.1.2

0.1.1-failed

24 Mar 07:56
0.1.1
0074fbe

Choose a tag to compare

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

19 Mar 05:08
0.1.0
96e1548

Choose a tag to compare

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

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...
Read more