From 8cf3a854be47d1b37f6d73d486473b7bd6805f99 Mon Sep 17 00:00:00 2001 From: Harald Date: Sun, 10 Jul 2022 20:45:57 +0200 Subject: [PATCH] Make NSObject based protocols optional (#134) This PR does fix #133 for now. * Add new bool toggle --objc-strict-protocols * Enables / disables the tag after generated protocol definition * Default of --objc-strict-protocols is true since this is current behaviour Test have been done manual. --- docs/cli-usage.md | 265 +++++++++++----------- src/main/scala/djinni/Main.scala | 8 + src/main/scala/djinni/ObjcGenerator.scala | 11 +- src/main/scala/djinni/generator.scala | 1 + 4 files changed, 151 insertions(+), 134 deletions(-) diff --git a/docs/cli-usage.md b/docs/cli-usage.md index ef5e9dba..b05d5bbf 100644 --- a/docs/cli-usage.md +++ b/docs/cli-usage.md @@ -38,128 +38,129 @@ djinni \ ### General -| Argument | Description | -| -------- | ----------- | -| `--help` | Print help | -| `--version` | Print version | -| `--idl ` | The IDL file with the type definitions, typically with extension `.djinni`. | +| Argument | Description | +|---------------------------------|------------------------------------------------------------------------------------------------------| +| `--help` | Print help | +| `--version` | Print version | +| `--idl ` | The IDL file with the type definitions, typically with extension `.djinni`. | | `--idl-include-path ...` | An include path to search for Djinni `@import` and `@extern` directives. Can specify multiple paths. | ### Java -| Argument | Description | -| -------- | ----------- | -| `--java-out ` | The output for the Java files (Generator disabled if unspecified). | -| `--java-package ...` | The package name to use for generated Java classes. | -| `--java-class-access-modifier ` | The access modifier to use for generated Java classes (default: `public`). | -| `--java-cpp-exception ` | The type for translated C++ exceptions in Java (default: `java.lang.RuntimeException` that is not checked) | -| `--java-annotation ` | Java annotation (`@Foo`) to place on all generated Java classes | -| `--java-generate-interfaces ` | Whether Java interfaces should be used instead of abstract classes where possible (default: `false`). | -| `--java-nullable-annotation ` | Java annotation (`@Nullable`) to place on all fields and return values that are optional | -| `--java-nonnull-annotation ` | Java annotation (`@Nonnull`) to place on all fields and return values that are not optional | -| `--java-implement-android-os-parcelable ` | all generated java classes will implement the interface `android.os.Parcelable` | -| `--java-use-final-for-record ` | Whether generated Java classes for records should be marked `final` (default: `true`). | +| Argument | Description | +|----------------------------------------------------------|------------------------------------------------------------------------------------------------------------| +| `--java-out ` | The output for the Java files (Generator disabled if unspecified). | +| `--java-package ...` | The package name to use for generated Java classes. | +| `--java-class-access-modifier ` | The access modifier to use for generated Java classes (default: `public`). | +| `--java-cpp-exception ` | The type for translated C++ exceptions in Java (default: `java.lang.RuntimeException` that is not checked) | +| `--java-annotation ` | Java annotation (`@Foo`) to place on all generated Java classes | +| `--java-generate-interfaces ` | Whether Java interfaces should be used instead of abstract classes where possible (default: `false`). | +| `--java-nullable-annotation ` | Java annotation (`@Nullable`) to place on all fields and return values that are optional | +| `--java-nonnull-annotation ` | Java annotation (`@Nonnull`) to place on all fields and return values that are not optional | +| `--java-implement-android-os-parcelable ` | all generated java classes will implement the interface `android.os.Parcelable` | +| `--java-use-final-for-record ` | Whether generated Java classes for records should be marked `final` (default: `true`). | ### C++ -| Argument | Description | -| -------- | ----------- | -| `--cpp-out ` | The output folder for C++ files (Generator disabled if unspecified). | -| `--cpp-header-out ` | The output folder for C++ header files (default: the same as `--cpp-out`). | -| `--cpp-include-prefix ` | The prefix for `#includes` of header files from C++ files. | -| `--cpp-namespace ...` | The namespace name to use for generated C++ classes. | -| `--cpp-ext ` | The filename extension for C++ files (default: `cpp`). | -| `--hpp-ext ` | The filename extension for C++ header files (default: `hpp`). | -| `--cpp-optional-template