cake-bake v0.3.0

Bake Cakefile into native Crystal code 🍞

Cake-Bake

Built with Crystal Build status API Docs Releases Awesome vladfaust.com Patrons count Gitter chat

Cake-Bake [ka-ke-ba-ke] allows to bake Cakefile into native Crystal code.

Supporters

Thanks to all my patrons, I can continue working on beautiful Open Source Software! 🙏

Lauri Jutila, Alexander Maslov, Dainel Vera

You can become a patron too in exchange of prioritized support and other perks

Become Patron

About

Why? Because sometimes 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:

targets:
  cake:
    main: src/run/cake.cr

dependencies:
  cake-bake:
    github: vladfaust/cake-bake
    version: ~> 0.3.0

Usage

Given ./Cakefile:

require "./src/some_file" # These requires

task :foo
  puts "bar"
end

./src/run/cake.cr:

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 ./:

$ 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

Repository

cake-bake

Owner
Statistic
  • 5
  • 1
  • 1
  • 0
  • 0
  • over 4 years ago
  • November 28, 2017
License

MIT License

Links
Synced at

Fri, 27 Dec 2024 04:55:43 GMT

Languages