Including a Framework with Your Project

Including external code in your project is very important in saving time and headaches with Sproutcore. In this post, I’ll quickly go over how to add Sproutcore UI to a project.

sc-init MyProject && cd my_project

Now that you’ve got a generated Sproutcore, we’re going to create the frameworks folder.

mkdir frameworks && cd frameworks

Now we’re in the frameworks directory. The Abbot build tools are cool enough to know that anything in here should be included in the build process (once we add the framework to the Buildfile). First things first, let’s download the Sproutcore UI package using git:

git clone git://github.com/etgryphon/sproutcore-ui.git scui

This will create an scui folder inside of your frameworks folder that contains that latest code. Now, open Buildfile in the project’s root directory, and you’ll see

config :all, :required => :sproutcore

I like to keep my requirements explicit (ie, don’t use :all). Instead, add this line after what’s there:

config :my_project, :required => [:sproutcore, :scui]

You should now be able to use the Sproutcore UI code inside of your app.

Bonus

For those of you that don’t know this, you can actually add Sproutcore to your frameworks directory, and it will override the one that came with Abbot. This is especially handy if you want to follow the master or quilmes branches at the Sproutcore git repository, instead of using the already stale 1.0 release.

This was posted 1 year ago. It has 2 notes and 0 comments.
  1. colincodes posted this