Skip to content

Releases: google/j2objc

2.8

06 Apr 22:41
Compare
Choose a tag to compare

A new release of J2ObjC is available, 2.8. This is an update to 2.7 with bug fixes and the following changes:

iOS Support

  • J2ObjC frameworks now support Apple Silicon (macOS ARM64).

Translator

  • @Weak and @WeakOuter annotations are translated as zeroing weak references (requires -fobjc-arc or -fobjc-weak flag).
  • Retain/autoreleases parameters and local variables returned by lambdas and anonymous class methods.

Libraries

  • Flogger call site injection implemented.
  • Guava updated to 30.1, added failureaccess-1.0.1.jar dependency.
  • JUnit updated to 4.13.
  • Protobuf runtime updated to optionally support ARC.
  • Protobuf enum constants no longer inlined, to support Swift importing.

Notes

  • Starting with 2.7, the release distribution has been split into two zip files, with the frameworks directory in the j2objc-2.8-frameworks.zip file. This was necessary to work around GitHub release maximum sizes. Unzipping both zip files from the same directory creates the full distribution, and is only necessary if your iOS project uses J2ObjC frameworks.

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.7

18 Sep 18:52
Compare
Choose a tag to compare
2.7

A new release of J2ObjC is available, 2.7. This is an update to 2.6 with bug fixes and the following changes:

JRE Runtime Emulation

  • Sources updated to Android 10, full Java 8 API.
  • New packages:
    • java.nio.file
    • java.nio.file.attribute
    • java.nio.file.spi
    • javax.sql

Translator

  • New memory model annotations, to avoid dangling pointers in generated code:
    • ZeroingWeak: generates a __weak annotation with ARC, WeakReference<T> with reference-counting.
    • OnDealloc: annotates a method to be called from the dealloc Objective C method.

Other

  • The release distribution has been split into two zip files, with the frameworks directory in the j2objc-2.7-frameworks.zip file. This was necessary to work around GitHub release maximum sizes. Unzipping both zip files from the same directory creates the full distribution, and is only necessary if your iOS project uses J2ObjC frameworks.

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.6

21 Apr 21:02
Compare
Choose a tag to compare
2.6

A new release of J2ObjC is available, 2.6. This is an update to 2.5 with bug fixes and the following changes:

iOS 11.0 Support (Apple release notes)

  • Frameworks are now built as XCFramework bundles.
  • Hello and HelloSwift examples can now be built using Mac Catalyst.

Translator

Java Runtime Emulation

  • Android's nullability annotations for the JRE. This reduces optional types when transpiled code is imported into Swift.
  • Updated several packages to Android Pie.

Other

  • Updated the protocol buffers dependency to 3.11.1.
  • Added Xalan's META-INF/services resources to its framework.

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.5

15 Jul 21:25
Compare
Choose a tag to compare
2.5

A new release of J2ObjC is available, 2.5. This is an update to 2.4 with bug fixes and the following changes:

Translator

  • The flag -external-annotation-file allows to provide the most common J2ObjC annotations in a separate file. This feature is useful when you only need to add J2ObjC annotations to transpile an existing library (e.g. adding @WeakOuter to break retain cycles). We are using it to transpile our JRE: j2objc.jaif
  • The flag --reserved-names helps to extend the data already present in reserved_names.txt

Java Runtime Emulation

  • java.text.BreakIterator was added. Keep in mind that it requires the jre_icu library which will impact the size of your application.
  • ICU resources were updated to version 60b.

Other

  • Updated bundled Mockito to version 2.23.4.
  • Updated the protocol buffers dependency to 3.7.1.

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.4

15 Mar 16:23
Compare
Choose a tag to compare
2.4

A new release of J2ObjC is available, 2.4. This is an update to 2.3 with the following changes:

Translator

Experimental support of new Java language features:

  • Effectively final variables in try-with-resources.
  • Diamond Operator for Anonymous Inner Classes.
  • Private methods in interfaces.
  • Local-variable type inference.

You can test this new functionality by running the translator with Java 11.

JAVA_HOME=`/usr/libexec/java_home -v 11` path/to/j2objc path/to/java_file

If you build your own distribution and want to support these features, please check scripts/build_distribution.sh for more details.

Java Runtime Emulation

  • CompletableFuture was added.

Other

  • Updated bundled Mockito to version 1.10.19.
  • Bundled @WeakOuter can be used also as a type annotation. This allows you to apply the annotation to anonymous classes.

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.3.1

11 Jan 21:43
Compare
Choose a tag to compare

A new release of J2ObjC is available, 2.3.1 (minor update to 2.3). Main changes:

Java Runtime Emulation

  • Several libraries were updated to the Android Oreo version.

Bug fixes

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.3

27 Nov 20:53
Compare
Choose a tag to compare
2.3

A new release of J2ObjC is available, 2.3 (update to 2.2). Main changes:

Java Runtime Emulation

  • Support for java.time package.
  • Subset of android.icu to support time zones (mainly to enable java.time).
  • SSL socket client implementation (thanks to @FD- for providing a reference implementation).

Other

  • Added Android version of Guava library.
  • Removed obsolete 32-bit library architectures.
  • Added support for arm64_32 architecture in watchOS binaries (thanks to @gianlucabertani for the pull request).

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.2

10 Sep 13:50
Compare
Choose a tag to compare
2.2

A new release of J2ObjC is available, 2.2. This is an update to 2.1.1 with bug fixes and the following changes:

Translator

  • The file prefixes.properties no longer needs to be bundled with the app because reflection support for name mappings is automatically generated.
  • The flag --swift-friendly now generates class properties (instead of static accessor methods) for static variables and enum constants. If this change breaks your build, you can get the previous behavior by replacing --swift-friendly with --static-accessor-methods --nullability.
  • Making sure that --prefixes respects the definition order of package prefixes (Issue #995).
  • Support for nullability annotations declared as type annotations.

Java Runtime Emulation

  • Added fallback Xalan properties (Issue #978).

Other

  • Added IntelliJ project files.
  • Updated bundled Guava to version 25.1.
  • Added Swift sample project.

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!

2.1.1

23 Apr 22:18
Compare
Choose a tag to compare

A new release of J2ObjC is available, 2.1.1. This is an update to 2.1 with the following changes:

2.1

10 Sep 13:45
Compare
Choose a tag to compare
2.1

A new release of J2ObjC is available, 2.1. This is an update to 2.0.5 with several bug fixes and the following changes:

Translator

  • The j2objc and cycle_finder tools now run using Java 9. Note: no Java 9 API have been added, since there aren't any Android equivalents.
  • Added option to generate outputs for all specified Java sources to a single .h/.m file pair.
  • Added support for AAR files on the classpath.

Java Runtime Emulation

  • Added java.security digest stream classes.
  • New character encodings: GBK, GB18030, Big5-HK.
  • Removed okio from build, as it was no longer used.

WatchOS Libraries

There are now separate static libraries for watchOS in the distribution in lib/watchos. This avoids Xcode warnings including the equivalent architecture from the default iOS libraries, like is done for macOS (lib/macosx) and tvOS (lib/appletvos).

Example Projects

The example projects are now included in the distribution bundle. These include an iOS "hello world" app, macOS protocol buffer command-line examples, and a Contacts app.

  • The Contacts app demonstrates how to build a J2ObjC project with Bazel.

Thanks for all the bug reports, especially those with tests and/or patches -- we're a small team, and appreciate the help!