Skip to content

Generate an _all.dart #739

Closed
Closed
@mahesh-hegde

Description

@mahesh-hegde

Should we generate a src/third_party/_all.dart from jnigen?

That way we don't have to deal with manually adding extra exports here when we add classes.

Originally posted by @dcharkes in dart-archive/jnigen#87 .


Some thoughts

current design maps the package names to file names using logic similar to

filename = "${packagename.split('.').join('/') }.dart"

So in a hierarchy

com
|____ a.dart
|____ a
    |____ b.dart
    |____ c.dart
    |____ _all.dart

If outer a is not an empty package and has some classes, a.dart is also created.

Ideally we want com/a/_all.dart to export recursively all of com.a, and not just b.dart and c.dart.

It can write

export '../a.dart';
export 'b.dart';
export 'c.dart';

But I am not convinced about this is the neatest solution possible.

Is it a better solution to map 1 class -> 1 dart file vs 1 package -> 1 dart file?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions