π The 3.0 release of Java to C# is here! π
This is perhaps the largest release since this project was created over 10 years ago in October 2013. A lot of dust has been brushed off, a whole bunch of new platforms are now supported, several newer Java language features have been added, a new integration test runner helps protect against regressions, and dark mode is here!
The v3.0.0 release includes:
- Cross-platform GUI support via Avalonia! This means you can now run the GUI utility on macOS and Linux, in addition to Windows. The GUI is a helpful tool for confirming the conversion and giving a convenient button to copy the output to your clipboard. It previously was written in WPF, so Avalonia was a natural fit. Additionally, this enabled...
- Dark mode support! You can now toggle between light and dark mode in the UI.
- The app now runs on .NET 6 LTS. This will be upgraded to .NET 8 LTS in the near future.
- IKVM has been upgraded to 8.7, which enables support for new platforms like arm64
- Because of the .NET 6, Avalonia, and IKVM 8.7 support above, we should now support the following platforms for both the GUI and CLI:
- Windows x64 and arm64
- macOS x64 and arm64
- Linux x64 and arm64
- JavaParser has been upgraded to add support for multiple new Java language features. Additionally, the .jar is now handled by IKVM at build time instead of being included as a .dll.
- Enabled by the JavaParser upgrade, the following Java features are now supported for translation (and are covered by integration tests):
- Default and private interface methods are now converted to the C# 8 equivalents (#60)
- GitHub Actions now automatically builds the app and runs unit tests for all PRs and commits to master
- A new integration test runner converts test resource Java files to C#, compiles them, and asserts the output matches what is expected. These are automatically run as part of the GitHub Actions pipeline as well. Please try to add a test when adding a Java feature or fixing a bug!
- Converting the unsigned right shift (
>>>
) binary operator is now supported. - The CLI now uses System.CommandLine for better argument handling, and most converter options are now available as command-line flags (#58)
- The CLI now uses Microsoft.Extensions.Logging instead of Console.WriteLine.
- An option has been added to turn off comment translation (#21)
- Octal int/long literals are now translated correctly (#45)
- Several common types are now converted automatically for convenience:
- Set: HashSet
- Map: Dictionary
- IAutoCloseable: IDisposable
- Iterator: IEnumerator
- Various common exception types are now renamed to their .NET equivalents
System.out
can now be converted to commonConsole
equivalents (#18)- Interface
extends
are now translated - Fixes an issue where extra escaping backslashes were added to strings (#20)
- Fixes an issue with array creation expressions (#38)
- Miscellaneous smaller bug fixes and improvements
Special thanks to the following contributors to this release: @maximilien-noal @VahidN @OJacot-Descombes @Niewiarowski
Huge thanks to @wasabii for the IKVM 8.7 release that helped enable this cross-platform/cross-architecture support!