Releases: cross-language-cpp/djinni-generator
Latest development build
v1.4.1
v1.4.0
What's New
Deprecation annotation in IDL files:
- feat(deprecated): generate language specific deprecation markup by @eakoli in #156
- Documentation for PR #156, the new deprecation feature by @a4z in #158
It is now possible to deprecate attributes, functions or entities in an IDL file and the generator will generate according deprecation attributes in C++, Java and Objective-C.
What's Changed
Improvements for the JSON serialization:
Fix potential integer overflow:
Toolchain update:
- Maintenance toolchain update 2023 by @a4z in #159
This change updates sbt, updates sbt plugins, sets the Scala version to the latest of 2.12, removes all warnings, and uses explicit typing to improve code readability.
Infrastructure
A stale bot has been added, which deactivated itself after having no actions going on in this repo for 60 days 🤡
We might turn the bot on again in the future.
Full changelog
Full Changelog: v1.3.2...v1.4.0
v1.3.2
What's Changed
-
Use simplified method for converting types to/from json by @mutagene in #131
Implements the basic recommended method for converting to/from json as described in the documentation. -
Fix an issue with nested generic types by @eakoli in #132
This fixes an issue where if a generic external type is used as a template type its generic information would not be generated properly for objc. -
Make NSObject based protocols optional by @a4z in #134
This enables or disables to be generated Objective-C protocols based onNSObject. The default of --objc-strict-protocols is true since this is current behaviour. For more information about that toggle and the reason why it was added, please see #133 .
Full Changelog: v1.3.1...v1.3.2
v1.3.1
Maintenance Release
Includes a few fixes that have been introduced in the last months.
Thanks to @FanglinIfolor and @delaitre-manfrotto for contributing to this release!
Fixed
--cpp-nn-headerparameter values are now quoted by default, as one would expect. Now this will generate valid code:--cpp-nn-header nn.hpp(1d5fbcb)- Setting a
--cpp-nn-headerdoes now work when targeting C++/CLI. (1d5fbcb) - In C++/CLI a forward declaration of any used
ref class-type is added to allow interfaces to depend on each other. (1d5fbcb) - The tests can now be executed on Windows. (1d5fbcb)
- sbt on Windows does now build a .bat file that can be directly executed without the need to manually rename it.
- JNI enum flags are now handled better in code. This does not have an effect on the generated code. (649763f)
Update Notice
If you are currently setting a nn header with quotes (like so: --cpp-nn-header "nn.hpp"), make sure to remove the quotes, otherwise the generator will produce invalid code.
v1.3.0
Thanks to @paulo-coutinho, @mutagene, @ngmeyer & @eakoli for contributing to this release!
Should be used together with djinni-support-lib v1.2.0
Added
- Generated C++ records can be serialized and deserialized with nlohmann/json, if
--cpp-json-serialization nlohmann_jsonis passed to the generator. Read more... (#99)
This feature has been ported from hiennguyenle/finn. - The generated Objective-C protocols do now conform to NSObject. (#117, #118)
- Generics are now supported for extern types in Objective-C & C++/CLI. (#113)
Ifgeneric: trueis set in the type definition YAML, the generic type information is populated to the generated interfaces. This feature already existed for Java and has now been extended to Objective-C & C++/CLI. A usage example can be found here in the integration tests.
Changed
- Under the hood some dependencies have been updated (#111):
- scala 2.13.6 (the latest scala 2.x release)
- sbt 1.5.5
- scalatest 3.2.10
- scala-parser-combinators 2.1.0
- snakeyaml 1.29
Note
Any contributions to this repository now have to be formatted with scalafmt in order to pass the PR checks. Make sure to run sbt scalafmtAll before committing your changes!
v1.2.0
Added
- In C++, records are generated with a default constructor that initializes all members by default. This can be disabled with the new option
--cpp-omit-default-record-constructor <true/false>. (#79) finalizemethods in the generated Java gluecode are annotated withSuppressWarnings("deprecation"). Usingfinalizeis inevitable until a better solution is found . (#16)
Changed
- The generated C wrapper functions do not refer to "Python" in their names any more. The long term goal is to make the C wrapper a general purpose interface that can be used for bridging to other languages as well.
Removed
- In an attempt to clean up the CLI, all
--<lang>-base-lib-include-prefixparameters have been removed, because we see no need to set a different include path than provided by the cross-language-cpp/djinni-support-lib. The default include paths did not change (djinni/<lang>). (#82)
Fixed
- The list of generated files (
--list-out-files) was missing the Objective-C Bridging Header. It is now included in the list as expected. (#54) - In C++/CLI types would not always be specified by their full namespace type name. (#78)
- The Swift bridging header would be created as a 0 byte file if
—skip-generation truewas passed. This is now fixed and no bridging header is generated if—skip-generation truewas passed. (#80) - Comments would not be copied to C++/CLI for
interfaceand to C++ forenum. Comments are now copied consistently to all languages. (#67) - Extern Djinni
flagwas not marshalled properly for JNI. (#90)
v1.1.0
Added
- New parameter
--objcpp-header-outthat allows Objective-C++ headers to be placed in a separate folder from the sources.
Fixed
- If the optional parameter
--objc-type-prefixwasn't set, the generated Objective-C code did not compile because there where name collisions between the generated Objective-C & C++ classes. This is now fixed. To avoid collisions, at least one of--cpp-namespaceor--objc-type-prefixparameters have to be defined when generating Objective-C code. (#55) - Including external interfaces with non-null references in C++ didn't work. This is now handled correctly. (#61)
v1.0.0
Added
- New
--jni-generate-mainparameter. The paramater, iftrue, generates a filedjinni_jni_main.cppthat includes thedjinni/jni/djinni_jni_main.hppheader provided by djinni-support-lib. That way by default the user automatically gets a defaultJNI_OnLoadimplementation if he builds a shared library from all generated sources.
This requires the djinni-support-lib v1.0.0, that comes with the required header file. (#49) - Modularization documentation from dropbox/djinni is now available on djinni.xlcpp.dev
Fixed
- YAML type definitions are not required to include definitions for all possible target languages any more. If the YAML misses a target language that is required for generation, it will now fail gracefully. (#48)
Why is this a major release?
The new parameter --jni-generate-main is enabled by default, which may break existing setups. If you don't want to use the new mechanism, disable it and everything should be as it was before.
v0.5.0
Added
- C# support from the iit-reacts/djinni
iitbranch:- C# support in Djinni is experimental, but ready to try out.
- The C# bridge uses C++/CLI and is only supported on Windows.
- Requires djinni-support-lib v0.1.0
- Thank you iit-reacts and @jothepro for making this happen!
Fixed
- All references to
std::experimental::nulloptwere removed from the code generated by the C wrapper (for Python).