[FYI] Change in default set of package directories to ignore: .pub -> .dart_tool/pub

85 views
Skip to first unread message

Kevin Moore

unread,
Feb 27, 2018, 5:37:52 PM2/27/18
to Dart Misc
If you care about what's in .gitignore files for Dart/Flutter projects – or if you create documents or tools that deal with such things, keep reading...

tl;dr: docs/templates that deal with .gitignore should start include .dart_tool 

Details:
  • The pub tool often creates a '.pub' directory in a Dart package to cache snapshots for package binaries.
  • We have other tools – like package:build – that also needs to cache artifacts.
  • We've decided to standardize on `.dart_tool` as the place all tools should put their package-level caches
    • Instead of inventing a new "dot" directory for every tool – and then having to educate folks to ignore it.
  • Convention: .dart_tool/name_of_package
  • pub will start using .dart_tool/pub soon
  • build tools have used .dart_tool/build for a while now
We already document .dart_tool on our site: https://www.dartlang.org/guides/libraries/private-files

Kevin Moore

unread,
Feb 27, 2018, 7:03:26 PM2/27/18
to Dart Misc
Just landed in the Dart SDK https://github.com/dart-lang/sdk/commit/699f7bc1b187557b55a285f7d950ea051de3c2d9

Plan on this in 2.0.0-dev.32+

Kevin Moore

unread,
Mar 2, 2018, 12:36:09 PM3/2/18
to Dart Misc
Dart 2.0.0-dev.32 was just published with this change.

The pub client will delete the .pub directory for you.
Don't forget to update your .gitignore files!

Reply all
Reply to author
Forward
0 new messages