Pub: Spurious warning when publishing a package with `.g.dart` files in lib

Created on 19 May 2018  路  4Comments  路  Source: dart-lang/pub

2.0.0-dev.55.0

* The name of "lib/generators/web_stagexl.g.dart", "web_stagexl.g", may only contain letters, numbers, and underscores.
  Using a valid Dart identifier makes the name usable in Dart code.
* The name of "lib/generators/console_full.g.dart", "console_full.g", may only contain letters, numbers, and underscores.
  Using a valid Dart identifier makes the name usable in Dart code.
* The name of "lib/generators/web_simple.g.dart", "web_simple.g", may only contain letters, numbers, and underscores.
  Using a valid Dart identifier makes the name usable in Dart code.
* The name of "lib/generators/web_angular.g.dart", "web_angular.g", may only contain letters, numbers, and underscores.
  Using a valid Dart identifier makes the name usable in Dart code.
* The name of "lib/generators/server_shelf.g.dart", "server_shelf.g", may only contain letters, numbers, and underscores.
  Using a valid Dart identifier makes the name usable in Dart code.
* The name of "lib/generators/package_simple.g.dart", "package_simple.g", may only contain letters, numbers, and underscores.
  Using a valid Dart identifier makes the name usable in Dart code.
* line 11, column 1 of tool/src/code_generator.dart: This package doesn't depend on glob.
  import 'package:glob/glob.dart';
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

There is no library directive. There are generated part files using the URI syntax

bug

Most helpful comment

My suggestion: put all files w/ generated code in lib/src.

If you want them available, export them from lib/my_lib.dart

All 4 comments

Never mind. These files should be in lib/src

See https://github.com/dart-lang/stagehand/issues/513

@kevmoo I just ran into this issue and I'm confused about your solution. json_serlializable colocates generated files with its source, should they be somewhere else?

My suggestion: put all files w/ generated code in lib/src.

If you want them available, export them from lib/my_lib.dart

Gotcha. Thanks for the quick reply.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimsimon picture jimsimon  路  5Comments

jonasfj picture jonasfj  路  4Comments

ditman picture ditman  路  7Comments

micrcx picture micrcx  路  4Comments

Atulin picture Atulin  路  4Comments