Prototype buildsystem "Drake"
Chris Molozian
chris at cmoz.me
Wed Jul 13 04:01:06 PDT 2011
I asked about build tools for D on the mailing list a while ago. I
needed a solution that allowed me to mix C++ and D builds in a
cross-platform way with minimum fuss. You can find the discussion about
it here
<http://www.digitalmars.com/d/archives/digitalmars/D/Best_build_tool_for_D_projects_136103.html>
(you were also a part of it IIRC). My biggest requirement at the time was:
* Keeping platform checks e.g. IF (MAC) {} ELSE IF(LINUX) {} ... etc.
to an absolute minimum. What's the point in a cross-platform
language if when you build projects in it you need to write a short
essay for the build system...
* Pre-built binaries available to all platforms (or as many as possible).
In the end I settled for Jam (ftjam)
<http://www.freetype.org/jam/index.html>, it works tremendously well.
It's easy to get binaries for almost any operating system (especially
with projects like homebrew <http://mxcl.github.com/homebrew/> for Mac).
I have very few gripes with it:
* The build description language is very simple (once you fully grok
it), but could have done with a lot more example-based documentation.
* It's missing a few features like recursive-directory scanning (for
source files), and the ability to pipe the output from a program
into a variable in the build script (e.g. C++FLAGS = `llvm-config
--cxxflags`).
* A convenient way to force all generated object and library files
into a dedicated build folder. It's possible but not very easy to do.
* I'm a big fan of convention over configuration, I know it's a very
subjective topic but I like the way Maven3 and Gradle assume a
project structure (that you can deviate from if you need to). This
usually requires very good supporting documentation.
The build script I put together for my project looked like this,
http://mysticpaste.com/private/TCcTE6KGxn .
Hope this helps,
Chris
On 07/13/11 02:02, Nick Sabalausky wrote:
> The recent discussions about package managers and buildsystems has prompted
> me to get off my ass (or rather, *on* my ass as per how programming is
> usually performed...) and start on the D-based rake-inspired buildtool I've
> been meaning to make for awhile now. It's not actually usable yet, but
> there's a sample drakefile demonstrating everything, and it does actually
> compile and run (but just doesn't build the dependency tree or actually run
> any of the build steps). *Should* work on Posix, but I only tested on
> Windows, so I may have fucked up the Posix version...
>
> Apologies to Jacob Carlborg for the name being so close to "dake". Didn't
> really know what else to call it ("Duck", maybe?) Like dake, it's inspired
> by Ruby's Rake. But unlike dake, the buildscript is written in D instead of
> Ruby, which was my #1 reason for making a Rake alternative.
>
> Before I go implemeting everything, I'd like to get input on it. Is it
> something that could be a major D tool?
>
> Overview of Drake and links to all the code are here:
>
> https://bitbucket.org/Abscissa256/drake/wiki/Home
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20110713/54f9d36c/attachment-0001.html>
More information about the Digitalmars-d
mailing list