Skip to content

Commit

Permalink
[jnigen] 0.2.0 (#174)
Browse files Browse the repository at this point in the history
* 0.2.0 version on pub
  • Loading branch information
HosseinYousefi authored Jan 25, 2023
1 parent 652d304 commit ff979d3
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 28 deletions.
10 changes: 8 additions & 2 deletions pkgs/jni/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 0.1.0
* Initial version: Android and Linux support, JObject API
## 0.2.0
* Added array support
* Added generic support
* `JniX` turned into `JX` for a more terse code.

## 0.1.1
* Windows support for running tests and examples on development machines.

## 0.1.0
* Initial version: Android and Linux support, JObject API

2 changes: 1 addition & 1 deletion pkgs/jni/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jni
description: Library to access JNI from dart and flutter
version: 0.1.1
version: 0.2.0
repository: https://github.com/dart-lang/jnigen/tree/main/jni

environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ final _stack = Stack<_ParsedCompound>();
Compound? parseCompoundDeclaration(
clang_types.CXCursor cursor,
CompoundType compoundType, {

/// Option to ignore declaration filter (Useful in case of extracting
/// declarations when they are passed/returned by an included function.)
bool ignoreFilter = false,
Expand Down Expand Up @@ -147,7 +146,6 @@ Compound? parseCompoundDeclaration(
void fillCompoundMembersIfNeeded(
Compound compound,
clang_types.CXCursor cursor, {

/// Option to ignore declaration filter (Useful in case of extracting
/// declarations when they are passed/returned by an included function.)
bool ignoreFilter = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ final _stack = Stack<_ParsedEnum>();
/// Parses an enum declaration.
EnumClass? parseEnumDeclaration(
clang_types.CXCursor cursor, {

/// Option to ignore declaration filter (Useful in case of extracting
/// declarations when they are passed/returned by an included function.)
bool ignoreFilter = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ final _methodStack = Stack<_ParsedObjCMethod>();

Type? parseObjCInterfaceDeclaration(
clang_types.CXCursor cursor, {

/// Option to ignore declaration filter (Useful in case of extracting
/// declarations when they are passed/returned by an included function.)
bool ignoreFilter = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const _padding = ' ';
/// Converts cxtype to a typestring code_generator can accept.
Type getCodeGenType(
clang_types.CXType cxtype, {

/// Option to ignore declaration filter (Useful in case of extracting
/// declarations when they are passed/returned by an included function.)
bool ignoreFilter = true,
Expand Down
6 changes: 4 additions & 2 deletions pkgs/jnigen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## 0.1.0
* Initial version: Basic bindings generation, maven and android utilities
## 0.2.0
* Support generating bindings for generics.

## 0.1.1
* Windows support for running tests and examples on development machines.

## 0.1.0
* Initial version: Basic bindings generation, maven and android utilities
34 changes: 17 additions & 17 deletions pkgs/jnigen/lib/src/elements/elements.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,36 +96,36 @@ class ClassDecl {
// synthesized attributes

/// Final name of this class
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late String finalName;

/// Parent's [ClassDecl] obtained from [parentName]
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
ClassDecl? parent;

/// Type parameters including the ones from its ancestors
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
List<TypeParam> allTypeParams = const [];

/// Unique name obtained by renaming conflicting names with a number.
///
/// This is used by C bindings instead of fully qualified name to reduce
/// the verbosity of generated bindings
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late String uniqueName;

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
bool isPreprocessed = false;
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
bool isIncluded = true;

/// Contains number with which certain overload of a method is renamed to,
/// so the overriding method in subclass can be renamed to same final name.
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
Map<String, int> methodNumsAfterRenaming = {};

/// Name counts map, it's a field so that it can be later used by subclasses.
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
Map<String, int> nameCounts = {..._definedSyms};

@override
Expand Down Expand Up @@ -158,7 +158,7 @@ class TypeUsage {

String shorthand;
Kind kind;
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late ReferredType type;
@JsonKey(name: "type")
Map<String, dynamic> typeJson;
Expand Down Expand Up @@ -282,14 +282,14 @@ class Method implements ClassMember {
List<Param> params;
TypeUsage returnType;

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late String finalName;
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late bool isOverridden;
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
bool isIncluded = true;

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late String javaSig = _javaSig();

String _javaSig() {
Expand Down Expand Up @@ -337,9 +337,9 @@ class Field implements ClassMember {
TypeUsage type;
Object? defaultValue;

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late String finalName;
@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
bool isIncluded = true;

factory Field.fromJson(Map<String, dynamic> json) => _$FieldFromJson(json);
Expand All @@ -351,7 +351,7 @@ class TypeParam {
String name;
List<TypeUsage> bounds;

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late String erasure;

factory TypeParam.fromJson(Map<String, dynamic> json) =>
Expand All @@ -363,7 +363,7 @@ class JavaDocComment {
JavaDocComment({String? comment}) : comment = comment ?? '';
String comment;

@JsonKey(ignore: true)
@JsonKey(includeFromJson: false)
late String dartDoc;

factory JavaDocComment.fromJson(Map<String, dynamic> json) =>
Expand Down
2 changes: 1 addition & 1 deletion pkgs/jnigen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# BSD-style license that can be found in the LICENSE file.

name: jnigen
version: 0.1.1
version: 0.2.0
description: Experimental generator for FFI+JNI bindings.
repository: https://github.com/dart-lang/jnigen/tree/main/jnigen

Expand Down

0 comments on commit ff979d3

Please sign in to comment.