Skip to content

Commit 8ca82ba

Browse files
[jnigen] Include superinterface methods (#2013)
1 parent 7a74332 commit 8ca82ba

File tree

24 files changed

+2495
-980
lines changed

24 files changed

+2495
-980
lines changed

pkgs/jni/CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
instead use the default value of `build/jni_libs`.
1515
- Added `JArray.of`, which allows a `JArray` to be constructed from an
1616
`Iterable`.
17-
- Added `JObject.isA`, which checks whether a `JObject` is a instance of a
18-
java class.
17+
- Added `JObject.isA`, which checks whether a `JObject` is a instance of a java
18+
class.
1919
- Do not require JAWT when building for desktop.
20-
- Added `JByteArray.from`, which allows a `JByteArray` to be constructed
21-
from an `Iterable<int>`.
20+
- Added `JByteArray.from`, which allows a `JByteArray` to be constructed from an
21+
`Iterable<int>`.
2222

2323
## 0.13.0
2424

pkgs/jnigen/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 0.14.1-wip
2+
23
- Added support for generating matching Kotlin operators as Dart operators.
4+
- Include the methods of the superinterfaces of a class or interface in the
5+
bindings.
36

47
## 0.14.0
58

pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/Main.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ public static void main(String[] args) throws FileNotFoundException {
123123
break;
124124
case AUTO:
125125
Map<String, ClassDecl> classes = new LinkedHashMap<>();
126-
// Preferring DOCLET as the source of summary a class exists in
127-
// both ASM and DOCLET.
126+
// Prefer DOCLET as the source of summary if a class exists in both ASM and DOCLET.
128127
if (!classStreamProviders.isEmpty()) {
129128
classes.putAll(AsmSummarizer.run(classStreamProviders));
130129
}

pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/SummarizerDoclet.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,6 @@ public Void visitExecutable(ExecutableElement element, SummaryCollector collecto
157157
Log.info("Skip method: %s", element.getSimpleName());
158158
}
159159
break;
160-
case STATIC_INIT:
161-
cls.hasStaticInit = true;
162-
break;
163-
case INSTANCE_INIT:
164-
cls.hasInstanceInit = true;
165-
break;
166160
}
167161
return null;
168162
}

pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/ClassDecl.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ public class ClassDecl {
3333
public TypeUsage superclass;
3434
public String outerClassBinaryName;
3535
public List<TypeUsage> interfaces = new ArrayList<>();
36-
public boolean hasStaticInit;
37-
public boolean hasInstanceInit;
3836
public JavaDocComment javadoc;
3937
public List<JavaAnnotation> annotations = new ArrayList<>();
4038
public KotlinClass kotlinClass;

pkgs/jnigen/lib/src/bindings/descriptor.dart

Lines changed: 0 additions & 115 deletions
This file was deleted.

pkgs/jnigen/lib/src/bindings/excluder.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ extension on String {
2626
this != '<clinit>';
2727
}
2828

29-
class Excluder extends Visitor<Classes, void> {
29+
class Excluder extends Visitor<Classes, void> with TopLevelVisitor {
30+
@override
31+
final GenerationStage stage = GenerationStage.excluder;
32+
3033
final Config config;
3134

3235
const Excluder(this.config);
@@ -62,7 +65,7 @@ class _ClassExcluder extends Visitor<ClassDecl, void> {
6265
@override
6366
void visit(ClassDecl node) {
6467
node.methods = node.methods.where((method) {
65-
final isExcluded = method.isExcluded;
68+
final isExcluded = method.userDefinedIsExcluded;
6669
final isPrivate = method.isPrivate;
6770
final isAbstractCtor = method.isConstructor && node.isAbstract;
6871
final isBridgeMethod = method.isSynthetic && method.isBridge;

pkgs/jnigen/lib/src/bindings/kotlin_processor.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ String _toJavaBinaryName(String kotlinBinaryName) {
3232

3333
/// A [Visitor] that adds the the information from Kotlin's metadata to the Java
3434
/// classes and methods.
35-
class KotlinProcessor extends Visitor<Classes, void> {
35+
class KotlinProcessor extends Visitor<Classes, void> with TopLevelVisitor {
36+
@override
37+
final GenerationStage stage = GenerationStage.kotlinProcessor;
38+
3639
@override
3740
void visit(Classes node) {
3841
final classProcessor = _KotlinClassProcessor();

0 commit comments

Comments
 (0)