Skip to content

Commit

Permalink
Merge pull request #26 from GeReinhart/master
Browse files Browse the repository at this point in the history
Be able to override the "pub build" command 

Former-commit-id: 532705e
  • Loading branch information
sethladd committed Jan 8, 2014
2 parents 5cd51b8 + 0d90a03 commit 7f1dcb9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ The sample app's `Procfile` looks like:
web: ./dart-sdk/bin/dart bin/basic_http_server.dart
```

### Overriding the build command

By default `pub build` is launched after the `pub get`, it can be useful to use
another command: for instance `pub build --mode=debug` or
`/app/dart-sdk/bin/dart build.dart`:

```bash
$> heroku config:set DART_BUILD_CMD="/app/dart-sdk/bin/dart build.dart"
```

Learn more about

## Example
Expand Down Expand Up @@ -162,4 +172,4 @@ The MIT License - Copyright (c) 2012 Ilya Grigorik
[deploy]: https://devcenter.heroku.com/articles/git
[envcompile]: https://devcenter.heroku.com/articles/labs-user-env-compile
[buildforubuntu]: https://code.google.com/p/dart/wiki/BuildDartSDKOnUbuntu10_04
[communitybuilds]: https://github.com/selkhateeb/heroku-vagrant-dart-build/releases
[communitybuilds]: https://github.com/selkhateeb/heroku-vagrant-dart-build/releases
11 changes: 9 additions & 2 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,19 @@ for filename in `find . -name pubspec.yaml | grep -v dart-sdk | grep -v pub-cach

message "*** Running pub build"

/app/dart-sdk/bin/pub build
if [[ -z "$DART_BUILD_CMD" ]]
then
message 'Building with "pub build"'
/app/dart-sdk/bin/pub build
else
message "Building with \"$DART_BUILD_CMD\""
eval $DART_BUILD_CMD
fi

done

# I think heroku deletes all the contents of /app and replaces it with
# whatever is in $BUILD_DIR, so copy over the pub-cache. Why not put it in
# $BUILD_DIR in the first place? because we need symlinks setup correctly.
cp -R $PUB_CACHE $BUILD_DIR/pub-cache
message `ls -l $BUILD_DIR/pub-cache`

0 comments on commit 7f1dcb9

Please sign in to comment.