Go ant-like tool

884 views
Skip to first unread message

Luke Mauldin

unread,
Dec 19, 2013, 9:22:33 AM12/19/13
to golan...@googlegroups.com
All,

I am looking to see if there is any tool/package written in Go that simulates the functionality of Ant of SCons.  I have looked at the go-wiki list of projects but I didn't find anything.  I don't need this tool to build Go programs (go build works exceptionally well) but I need to script a set of build tasks for a whole system/environment and I definitely don't want to use bash.  I think that Ant might be my best alternative but it requires Java and I was hoping there would be a Go tool already built for the purpose which could read a configuration file and perform a set of tasks.

Luke

Henrik Johansson

unread,
Dec 19, 2013, 10:11:37 AM12/19/13
to Luke Mauldin, golang-nuts


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Konstantin Khomoutov

unread,
Dec 19, 2013, 10:11:43 AM12/19/13
to Luke Mauldin, golan...@googlegroups.com
Why not just perform these tasks using a Go program?
Go is a better Python and Python is a better bash.
Note that you can do `go run program.go` to do a one-off execution.

Dobrosław Żybort

unread,
Dec 19, 2013, 10:16:51 AM12/19/13
to golan...@googlegroups.com, Luke Mauldin
Maybe also check gotask[1] ("Idiomatic build tool in Go"), more info[2]

[1] https://github.com/jingweno/gotask
[2] http://owenou.com/2013/11/27/writing-build-tasks-in-go-with-gotask.html

wkharold

unread,
Dec 19, 2013, 12:53:16 PM12/19/13
to golan...@googlegroups.com
If all else fails, there's always `make`

Kevin Gillette

unread,
Dec 19, 2013, 5:44:43 PM12/19/13
to golan...@googlegroups.com, Luke Mauldin
On Thursday, December 19, 2013 8:11:43 AM UTC-7, Konstantin Khomoutov wrote:
Go is a better Python and Python is a better bash.

"Gophers are better snakes and snakes are better turtles." Your phrasing is about is presumptuous and usually-not-true as mine. 

Python (and Go) make for pretty terrible shell script replacements unless you're doing non-shell-style programming in Bash. Proper leveraging of Python's dynamic nature does make it quicker to write programs that don't require a high degree of safety, such as throwaway tools. A rapid, iterative write-test-repeat workflow in Python can make up for trivial coding errors in small and medium sized programs, often resulting in a quicker, if not hackier, time-to-completion than Go. It's more about that Python is a worse Go than it is about Go trying to be a better Python: large or long running programs are problematic in Python, because the comparatively unstructured style disfavors ease of automated test integration, and will often leave type errors lingering in rarely visited code paths, such that a Python service can fail after months on a simple error that a statically typed language would've caught at compile time. None of that means that Go is a better Python -- it just means that the situations which gave rise to that opinion were those in which Python was being employed in a capacity for which Go is much better suited.

Jacek Furmankiewicz

unread,
Dec 20, 2013, 1:38:32 PM12/20/13
to golan...@googlegroups.com
Please, don't even use Ant. It's a dead product, everyone in the Java world has been abandoning it in droves either for Maven, or better for Gradle.

If you can't find any Go-specific tool that does exactly what you want, then just use Ruby rake, of all the build tools I've used, I think I liked it the most

http://martinfowler.com/articles/rake.html

It looks like someone has started working on rake tasks for Go programs:

https://github.com/tvw/gotasks

Luke Mauldin

unread,
Dec 20, 2013, 1:48:26 PM12/20/13
to golan...@googlegroups.com
The tool Ruby rake seems to be the closest to what I am looking for.  Gotask looks promising but it requires the build logic to be maintained in Go and I would like for that build logic to be maintained in an external DSL so it can be tweaked by programmers who don't know Go.  I actually wrote an Ant build.xml file that does what I am looking for but I ran into all sorts of limitations with the tool, most of which were due to file permissions not being correctly maintained.

Luke

Henrik Johansson

unread,
Dec 20, 2013, 2:02:43 PM12/20/13
to Luke Mauldin, golang-nuts

If they are not required to know Go how can they make any reasonable changes to the build? Sure, pack this and copy that but that is trivial.

Save yourself a lot of pain and use a better tool if at all.

--
Reply all
Reply to author
Forward
0 new messages