I’ve been looking a little closer at Sprouts, and think I have a bit better handle on what it is and what it does. After reading through all the links and associated comments in my previous post, and particularly the Sprouts RDocs helped.
As with many things that seem more complex than they are, part of the difficulty lies in naming. Sprouts is an application, but it does several different things. So conceptually, it’s difficult to describe it by what it does. I feel a similarity to describing Java. What is it — a programming language, a compiler, an execution environment — all of the above.
Similarly sprouts is a build tool, a project generator, a dependency resolver/ package manager, and a download, installation, and configuration tool. It helps me to think of it in terms of analogies with other tools, but I’m sure that fails. But learning by analogy is as good a method as any, and maybe I’ll get some corrections.
One thing Sprouts does is set up a Flex/ActionScript development environment. At the core, Sprouts is a series of tasks, and one tedious and error prone task is downloading, installing, and configuring your
development environment. The idea is that installing Ruby (and Rubygems) is easier than finding all your tools separately. A variety of tools have been built that do this: RPM/apt/yum, CPAN, easy_install, gem. Maven can do this too, but most likely because of the complexity of the Java ecosystem, it tends to get ugly.
I’m a bit worried about Sprouts falling into this trap. And the trap is in the download. There’s no easy way to ensure compatibility other than eternal vigilance. CPAN and RPM have bitten me before as well. Yum and Apt alleviate this problem by just not asking. So does gem, which is what the Sprouts installer users. Most of the time this works — as long as you’re staying bleeding edge. I don’t like that the LibraryTask installs for you. Maybe there’s a flag to disable it. Hopefully there’s at least a prompt. (I haven’t actually used Sprouts yet.) I don’t (always) want my build tool to download a library off the internet (or fail to do so), I’d rather it fail and say “libary X isn’t available. I really like the way the Ruby Enterprise/Phusion Passenger installer does this.
But I’m getting ahead of myself. The next thing Sprouts does is Build your application. It does this by wrapping the Flex SDK commands like ‘mxmlc’ into Rake tasks. I don’t know if it calls the ant tasks
or goes to the command line.
Back to the environment setup. Sprout can download, install, and configure the Flex SDK, the Flash debug player (can this run headless, e.g., without a GUI, on my build server?), set up trace logging (which apparently can be painful) and other configuration issues with the flash player, download other tools (and libraries) like a trace log viewer, and a unit test framework (ASUnit or FlexUnit).
Sprouts then gets into other magic like creating a test harness (I’m not sure what that means, possibly inspecting your code for classes and generating associated test and test suite scaffolding?) and setting up a project environment. I’m envisoning Rails Generators, and in fact, it looks like the same thing with script/generate.rb MyFlexProject. It uses Rubigen, which was extracted from Rails.
It mentions IDE integration and continuous integration, which I’m guessing mean setting up libraries in the IDE, and creating ant or rake tasks to build/deploy/test. Cruisecontrol and (especially Cruisecontrol.rb) are mentioned.
Here are some typical tasks:
ZipTask, SFTPTask, LibraryTask, MXMLCTask, CompcTask, AsUnitTask, AsDocTask.
The Sprouts model looks like this:
“Tools, Libraries and Bundles are distributed as RubyGems”
Sprout is the application, including the CLI (is there a GUI or web interface?)
A task is a Rake task. So I’m assuming I can make my own custom tasks.
I also assume I can make my own generators, all I need is to learn to use Rubigen.
Gem, Rake, and Rubigen seem to be the core components.
As I said, Sprouts is task oriented. There are ToolTasks and LibraryTasks. I’m a little confused, but I would break tasks down into specific categories like download, install, configure, build, package, deploy, test, etc. While sftp and zip could get double duty for download/deploy and install/package, I’d want to keep distinct, even if they call the same underlying tasks. I’d like to be aware of what its doing, and not implicitly step outside the scope of it’s activity. For example, if you’re building, don’t jump out of the build scope into the install or configure scope unless explicitly granted permission, which I’d think you’d only want in a bootstrap phase.
Anyway, sprouts looks like an exciting tool and I can’t wait to delve deeper into it, and actually use it.