https://github.com/vladfaust/cake-bake
Bake Cakefile into native Crystal code 🍞
https://github.com/vladfaust/cake-bake
cake crystal docker
Last synced: 9 months ago
JSON representation
Bake Cakefile into native Crystal code 🍞
- Host: GitHub
- URL: https://github.com/vladfaust/cake-bake
- Owner: vladfaust
- License: mit
- Created: 2017-11-28T00:07:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-07T16:39:46.000Z (over 5 years ago)
- Last Synced: 2025-02-26T15:54:10.897Z (9 months ago)
- Topics: cake, crystal, docker
- Language: Crystal
- Homepage: https://github.vladfaust.com/cake-bake.cr
- Size: 27.3 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cake-Bake
[](https://crystal-lang.org/)
[](https://travis-ci.com/vladfaust/cake-bake)
[](https://github.vladfaust.com/cake-bake)
[](https://github.com/vladfaust/cake-bake/releases)
[](https://github.com/veelenga/awesome-crystal)
[](https://vladfaust.com)
[](https://www.patreon.com/vladfaust)
[](https://gitter.im/vladfaust/Lobby)
Cake-Bake *[ka-ke-ba-ke]* allows to bake [Cakefile](https://github.com/axvm/cake) into native Crystal code.
## Supporters
Thanks to all my patrons, I can continue working on beautiful Open Source Software! 🙏
[Lauri Jutila](https://github.com/ljuti), [Alexander Maslov](https://seendex.ru), Dainel Vera
*You can become a patron too in exchange of prioritized support and other perks*
[](https://www.patreon.com/vladfaust)
## About
Why? Because sometimes [cake]((https://github.com/axvm/cake)) tasks are wanted to be run as binaries.
For example, to run from a Docker container with an already built application: `docker run my-crystal-app bin/cake db:migrate`.
## Installation
Add this to your application's `shard.yml`:
```yaml
targets:
cake:
main: src/run/cake.cr
dependencies:
cake-bake:
github: vladfaust/cake-bake
version: ~> 0.3.0
```
## Usage
Given `./Cakefile`:
```crystal
require "./src/some_file" # These requires
task :foo
puts "bar"
end
```
`./src/run/cake.cr`:
```crystal
require "cake-bake"
Cake.bake("../../Cakefile") # Full path to Cakefile needed to properly resolve requires (see above)
# The Cakefile code will be put here, yay
```
Then execute from `./`:
```shell
$ crystal src/run/cake -- foo
bar
$ crystal build src/run/cake
$ ./cake foo
bar
$ shards build
$ ./bin/cake foo
bar
```
## Contributing
1. Fork it ( https://github.com/vladfaust/cake-bake/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request
## Contributors
- [@vladfaust](https://github.com/vladfaust) Vlad Faust - creator, maintainer