Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/remogatto/makengo
A build program in Go inspired to Ruby Rake DSL
https://github.com/remogatto/makengo
Last synced: 2 months ago
JSON representation
A build program in Go inspired to Ruby Rake DSL
- Host: GitHub
- URL: https://github.com/remogatto/makengo
- Owner: remogatto
- Created: 2010-02-19T14:42:58.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-07-15T07:56:00.000Z (over 14 years ago)
- Last Synced: 2023-04-10T12:07:54.612Z (almost 2 years ago)
- Language: Go
- Homepage:
- Size: 108 KB
- Stars: 37
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Makengo (make'n'go) is a build program written in go
and inspired to ruby rake.# Preamble
When I switched from ruby to go there was a thing I
particularly missed: a build program à la rake. So, I decided
to make an attempt trying to roughly reproduce rake's DSL in
go and I ended up with what follows.Please note that this software is in an early alpha stage of
development. If you find it interesting feel free to send me feedbacks
or better to fork it and send me patches ;)# Quick start
$ git clone http://github.com/remogatto/makengo
$ cd makengo
$ make install# The DSL
## Define a simple task without dependencies
Task("Hello", func() { fmt.Println("Hello!") })
## Define two dependent tasks (order of definition doesn't matter)
Task("Joe", func() { fmt.Println("Joe") })
Task("Hello", func() { fmt.Println("Hello ") }).DependsOn("Joe")## Add descriptions to tasks
Desc("Print hello.")
Task("Hello", func() { fmt.Println("Hello!") })## Define a default task among a set of defined tasks
Task("Hello", func() { fmt.Println("Hello!") })
Default("Hello")# Makengo file
Tasks are defined inside a file named Makengo and embraced by a init()
function.## Makengo file example
package main
import (
"fmt"
. "makengo"
)func init() {
Desc("Print hello.")
Task("Hello", func() { fmt.Println("Hello!") })
}# Tasks execution and command-line
Tasks are invoked using makengo executable:
$ makengo # Run the default task if any
$ makengo Hello # Run "Hello" task
$ makengo Hello Joe # Run "Hello" and "Joe" tasks
$ makengo -T # Show task descriptions
$ makengo -h # Show usage information# Concurrency
In makengo, Go concurrency is exploited following these rules:
1. Independent tasks run concurrently.
2. If task1 depends on (task2, task3) and (task2, task3) are independent
tasks then (task2, task3) run concurrently and task1 waits for (task2,
task3) to finish their job.# CREDITS
Special thanks to
* Nicolas Sebrecht for bug reports, feedback and a lesson about git-am ;)
* The Go mailing list for an useful
[discussion](http://tinyurl.com/38crfo9) about Go and DSLs# LICENSE
Copyright (c) 2010 Andrea Fazzi
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.