Convert from Ruby to another build system.
-
Kit Goncharov
- Assigned user changed from John-David Dalton to Kit Goncharov
- State changed from new to open
- Tag set to build
- Title changed from Convert from Rails to another build system. to Convert from Ruby to another build system.
I still prefer using Ruby as a build system -- I do have several peeves with Rhino. For one, a Rhino build script wouldn't really cross-platform. JavaScriptMVC has two scripts inside it: a shell script for OS X/*NIX and a batch file for Windows. JSMVC's code also looks like it's geared more toward building an actual app (something like what Rails would do), as opposed to just a single composite file. Also, if we want to make Fuse modular (so the user can do something like
build include=Core,NWMatcher,Enumerablefrom the command line), dependency management would be a must. I haven't seen many libraries for Rhino (much less ones that are built for the aforementioned tasks), so I think we'd need to write our own library for that.I did, though, have a pretty pleasant experience writing Miniatures' build system -- it's a very simplified example of how Ruby can be used to build a customized JavaScript library while including all necessary dependencies. Basically, I have a small YAML file where I define the modules and their dependencies. Then, in my
Rakefile, I use Ruby's built-in YAML parser to load the YAML file into a Ruby hash. If the user specifies anincludeargument (i.e.,rake build include=DOMReady,NWMatcher), the build task loads the modules and their dependencies, and stores their paths in an array. If the user doesn't specify which modules to include, all of the modules are added. Then, I add the header file to the beginning of the array, and pass that array as an argument to Sprockets, which builds the final distribution file.I hope this doesn't appear trollish...I definitely think, though, that Ruby would be the way to go for building a JS library. MooTools, Prototype, and SproutCore already do this, so the build process would be fairly familiar to users of those libraries. Also, Ruby does have quite a few libraries for building JS frameworks already (like Ruby-YUI Compressor, Sprockets, and PackR), so we'd be saving ourselves quite a lot of time by not having to write our own build library for Rhino.
Again, all this is my opinion and stems from personal experience more than anything, so I guess I'm not being very objective. I'll go ahead and read up more on the ins and outs of the Rhino environment, though, and how it can be used for a build system.
-
Kit Goncharov
My Rakefile and YAML dependency list, if you're interested. :D
-
John-David Dalton
Wow. Thanks for all the info :). Could some of this be done in Python or via Ant ?
-
Kit Goncharov
I don't have any experience with Python, but I guess it could be done. I do remember reading an article about Ant though -- it's really similar to
Rakefiles, except you really don't have access to the underlying language. I'll read up more on both of them and see what I can find out. -
Kit Goncharov
Sure, that definitely sounds interesting! The only thing I'm on the fence about is the requirement of a C compiler -- I think most Linux distros come with the option to install the gcc package, but neither Windows or OS X does. I don't know about the options available for Windows (I'd guess emulation via Cygwin), but OS X requires that you install 2GB worth of dev tools just to use the compiler. If you have pre-built binaries, though, that's great.
I'll be gone for most of this week (I'm leaving in a couple of hours, and will get back Saturday), but I'll definitely be interested in seeing your *NIX shell!
-
Kit Goncharov
On a side note, I just realized that the
RakefileI uploaded previously was totally incomplete. Here's an updated version (I haven't changed the comments at the top, but the code itself should be a lot easier to understand): -
Kit Goncharov
Sorry, not sure what you mean by "it is obvious we are aiming at more build system not just replace one with another." I'm guessing you mean that we should have multiple build systems (so users can pick to build Fuse using Ruby, Rhino, shell, etc.), but please correct me if I'm wrong.
Can you recommend another C compiler for OS X besides Xcode? The last time I tried installing it, it completely trashed my system and I had to do a destructive reinstall.
Also, I apologize if my post isn't clear. I just got back from high altitude, so my head is still a little fuzzy. :)
-
Kit Goncharov
No problem! I'll go ahead and further test out your shell and start
rewriting the build system. -
Joe Gornick
- Assigned user changed from Kit Goncharov to Mark Caudill
-
Joe Gornick
- Milestone cleared.
- Milestone order changed from 0 to 0
-
Joe Gornick
- Milestone cleared.
- Assigned user changed from Mark Caudill to Joe Gornick
- Milestone order changed from 2 to 0
-
Joe Gornick
- State changed from open to new
- Assigned user changed from Joe Gornick to Kit Goncharov
-
Kit Goncharov
- State changed from new to open
-
Kit Goncharov
- State changed from open to patched
- Milestone set to Iteration 1
- Assigned user changed from Kit Goncharov to John-David Dalton
- Milestone order changed from 5 to 0
-
Joe Gornick
- Milestone changed from Iteration 1 to Iteration 2
- Milestone order changed from 10 to 0
-
Joe Gornick
- Milestone changed from Iteration 2 to Iteration 3
- Milestone order changed from 1 to 0
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
