igrigorik/heroku-buildpack-dart — pull request #6 by kohlikohl (2012-11-18 21:29:51+00:00)
Title: Supporting pub on heroku

This pull request adds support for pub in the build process of Heroku.

**Issue**
As pub installs packages into the `$HOME` directory by default and since the `$HOME` folder in the build environment differs from the one in runtime, dart apps relying on pub would not work.

**Solution**
The packages needed to be installed inside an separate folder in the cache folder and following the installation, the packages needed to be copied to the build folder, maintaining the folder structure.

Additionally, in order to include and use packages residing within the dart-sdk, the whole `dart-sdk` folder needed to be moved into the build folder and pub needed to be called from that folder structure e.g. `/app/dart-sdk/bin/pub install` to maintain a correct symlink to the packages.

**Custom build versions**
Also included in this pull request is the ability to set an environmental variable called `BUILD` which takes a revision number from http://commondatastorage.googleapis.com/dart-editor-archive-integration/latest/changelog.html

This comes in handy when using libraries that are not working with the latest sdk version.

For more information, please feel free to contact me.

I hope this makes it easier for users to use dart on Heroku.

Matt