Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Convert from Ruby to another build system.

#33

JavaScript MVC uses Rhino for a 100% pure JavaScript build system.
I am very interested in this.
http://javascriptmvc.com/

Reported by John-David Dalton · July 4th, 2009 @ 09:40 AM

State: patched
Milestone: Iteration 3
Assigned to: John-David Dalton John-David Dalton

Activity

  1. Kit Goncharov
    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,Enumerable from 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 an include argument (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.

    August 2nd, 2009 @ 12:18 PM

  2. Kit Goncharov
    Kit Goncharov

    My Rakefile and YAML dependency list, if you're interested. :D

    August 2nd, 2009 @ 12:30 PM

  3. John-David Dalton
    John-David Dalton

    Wow. Thanks for all the info :). Could some of this be done in Python or via Ant ?

    August 2nd, 2009 @ 12:44 PM

  4. Kit Goncharov
    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.

    August 2nd, 2009 @ 02:52 PM

  5. Kit Goncharov
    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!

    August 3rd, 2009 @ 01:45 PM

  6. Kit Goncharov
    Kit Goncharov

    On a side note, I just realized that the Rakefile I 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):

    August 3rd, 2009 @ 01:50 PM

  7. Kit Goncharov
    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. :)

    August 7th, 2009 @ 08:07 PM

  8. Kit Goncharov
    Kit Goncharov

    No problem! I'll go ahead and further test out your shell and start
    rewriting the build system.

    August 11th, 2009 @ 11:00 AM

  9. Joe Gornick
    Joe Gornick
    • Assigned user changed from Kit Goncharov to Mark Caudill

    October 7th, 2009 @ 01:38 AM

  10. Joe Gornick
    Joe Gornick
    • Milestone cleared.
    • Milestone order changed from 0 to 0

    September 19th, 2010 @ 05:47 PM

  11. Joe Gornick
    Joe Gornick
    • Milestone cleared.
    • Assigned user changed from Mark Caudill to Joe Gornick
    • Milestone order changed from 2 to 0

    September 29th, 2010 @ 09:45 AM

  12. Joe Gornick
    Joe Gornick
    • State changed from open to new
    • Assigned user changed from Joe Gornick to Kit Goncharov

    February 21st, 2011 @ 05:09 PM

  13. Kit Goncharov
    Kit Goncharov
    • State changed from new to open

    February 28th, 2011 @ 10:20 PM

  14. Kit Goncharov
    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

    March 5th, 2011 @ 09:56 PM

  15. Joe Gornick
    Joe Gornick
    • Milestone changed from Iteration 1 to Iteration 2
    • Milestone order changed from 10 to 0

    March 9th, 2011 @ 11:16 AM

  16. Joe Gornick
    Joe Gornick
    • Milestone changed from Iteration 2 to Iteration 3
    • Milestone order changed from 1 to 0

    March 22nd, 2011 @ 09:41 PM

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.