Pergunta

I am using the Dart Eclipse plugin following this guide: http://blog.dartwatch.com/2013/01/integrating-dart-into-eclipse-and-your.html ( without the Maven integration )

If I use the pubspec.yaml file, my project gets spammed with these packages symlinks. ( I am using the "Package Explorer" view from Eclipse ) I would like some control over where these files get created.

I would argue the web root directory and maybe a scripts directory should be enough.

Foi útil?

Solução 2

I found the code that generates these directories in dart-sdk\util\pub\entrypoint.dart.

There is a method called: _linkSecondaryPackageDir.

If I add: if (path.basename(dir) != 'web') return;

The packages folder only gets created in the root folder and the web folder, just like I want.

I will test if this breaks anything and report back.

Outras dicas

Currently, no, there is no way to control which directories get "packages" directories and which don't. Pub will place "packages" directories in "bin", "example", "test", "tool", and "web", and any subdirectory of those.

Those are all of the directories where a package may be expected to have a Dart entrypoint. Since an entrypoint needs a "packages" directory next to it to be able to use "package:" imports, pub will place one there.

It won't place "packages" directories anywhere else.

I would argue the web root directory and maybe a scripts directory should be enough.

"tool" is pub's convention for a "scripts" directory.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top