Commit Graph

5 Commits

Author SHA1 Message Date
Aaron Riekenberg 417821fdd7
Only generate @kotlin.ExperimentalUnsigned annotation on create*Vector methods having an unsigned array type parameter. (#7881)
Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-04-28 17:10:01 +00:00
Anton Bobukh b50b6be60a
[Kotlin] Control the generation of reflection with --reflect-names (#7775)
* [Kotlin] Control the generation of reflection with --reflect-names.
Tested:
```
$ cmake -G "Unix Makefiles" && make && ./tests/flatc/main.py
...
KotlinTests.EnumValAttributes
 [PASSED]
KotlinTests.EnumValAttributes_ReflectNames
 [PASSED]
KotlinTests: 2 of 2 passsed
...

35 of 35 tests passed
```

* [Kotlin] Fix SampleBinary by converting Byte to UByte for ubyte fields.

* [Kotlin] Annotate all generated classes with kotlin.ExperimentalUnsignedTypes.
2023-01-10 10:03:39 -08:00
Anton Bobukh 07d9485146
Expand wildcard imports in the generated Kotlin files. (#7757)
Tested:

```
$ cmake -G "Unix Makefiles" && make && ./flattests
...
[ 99%] Linking CXX executable flatsamplebinary
[100%] Built target flatsamplebinary
ALL TESTS PASSED
```

Co-authored-by: Derek Bailey <derekbailey@google.com>
2023-01-05 14:34:44 -08:00
Aaron Riekenberg 15df50eb7f
Remove @ExperimentalUnsignedTypes annotation from kotlin code generator. (#7092) 2022-02-13 20:29:36 -08:00
Paulo Pinheiro de9aa0cdee Add basic Kotlin support (#5409)
* [Kotlin] Add kotlin generate code for tests and add
kotlin test to TestAll.sh

* [Kotlin] Add Kotlin generator

This change adds support for generating Kotlin classes.

The approach of this generator is to keep it as close
as possible to the java generator for now, in order
to keep the change simple.

It uses the already implemented java runtime,
so we don't support cross-platform nor js Kotlin yet.

Kotlin tests are just a copy of the java tests.

* Add optional ident support for CodeWriter

Identation is important for some languages and
different projects have different ways of ident
code, e.g. tabs vs spaces, so we are adding optional
support on CodeWriter for identation.

* [Kotlin] Add Documentation for Kotlin

* [Kotlin] Modify generated code to use experimental Unsigned types.
2019-07-22 16:05:15 -07:00