Installing Field for Developers

First, some prerequisites for developing (with) Field:

  • Make sure you're running at least 10.5.1, the latest, publicly available OS X.
  • Make sure you have the developer tools for OS X installed (if you haven't, it's quite possible you aren't the intended audience for this project).
  • Install Mercurial, version 0.9.5 — binary pacakges for OS X are available here: http://mercurial.berkwood.com/ (and, if you haven't used it before, take a moment to familiarize yourself with what it is and does - it's not just used for getting Field, it's used as part of Field as well).
  • Make sure that you know that Marc's email address is marc at openendedgroup dot com.
  • Make sure that you know that there are forums on this website — discussion.
  • Make sure you have a favorite Java development environment installed. If you don't have a favorite Java development environment installed, again, you might not be the target audience for Field. Marc's an Eclipse man, but not religious about it — just don't expect him to know anything about building Field in NetBeans, IntelliJ or anything else.
  • Eclipse has a "Trac Connector" for its Mylyn plugin that you can use to connect to this website's ticket tracking system. If you have access to this bug database (which you'll no doubt get if you ask) then you might be interested in installing these as well. Install Mylyn (if it isn't part of your Eclipse distribution) and the Trac Connector by adding the update site to Eclipse: http://download.eclipse.org/tools/mylyn/update/eX.Y (where X.Y is your eclipse version, say 3.4) (you can always find the latest site from: http://www.eclipse.org/mylyn/downloads/) Add a trac repository http://www.openendedgroup.com:8000/field, with your username and password, access type XML-RPC

Getting Field

To get field, clone the fieldwork repository and the shared workspace repository on openendedgroup.com. How you do this depends on whether or not you have write access to the repository. To just get the version of Field as it currently stands, with read-only access:

hg clone http://openendedgroup.com:8001 field
hg clone http://openendedgroup.com:8002 workspace

If, on the other hand, you are a "committer" then, for now, something like:

hg clone ssh://public@openendedgroup.com/fieldwork/field field
hg clone ssh://public@openendedgroup.com/fieldwork/workspace workspace

ought to do it. It should take around 5-10 mins to download the field repository and no time at all to clone the workspace repository.

Building Field

Field comes without .class files in the repository, so you'll have to build it. (But it does ship with .jnilib's already built and in the correct spot). If you are using Eclipse, this is straightforward: import the projects that the repository contains into your workspace (specifically Import->Existing Projects into Workspace->browse->[field directory]). You'll end up with two projects — "fielddevelopment" and "extras". Building them might take Eclipse a while, but both projects should build without error.

You should note that the recent, pre-release builds of Eclipse have been known to hang at this point. You might have to force quit, and open Eclipse again: everything will be ok.

If you are not using Eclipse then you'll need all of the field.app/Contents/Resources/Java in your (compilation) classpath, and writeMethodAPT.jar on your apt factory path and no doubt something else as well.

Making sure it's all working

From the top level of your field development directory type:

distribution/application/field.app/Contents/MacOS/JavaApplicationStub

If you are on a Mac with an NVidia card, you can always add -needsFSAA 0 to that command line: it will improve your framerate considerably.

Integrating it with your own code-base

Take a look at the distribution/application/extensions directory, and its documentation. Specifically, it's likely that you'll want to add an entry that points Field towards your own java class-files and sources. You should also take a look at RunningField and StartupOptions to familiarize yourself a little with what's actually happening when you run Field, and decide exactly how you want to run it (Marc recommends the command line). Of particular interest is the -field.scratch option which changes which workspace file you are loading on startup (such files are created on demand), and the -main.class option that just uses Field's Launcher to run the class you pass into it. You can open the Field UI in your own code later, or if needs be load and execute sheets without instantiating any UI at all.

The three things you'll want to know

The top three early answers to questions:

  • You right click on the canvas and select "make new visual element" — this gets you a "box" to type python code in.
  • You'll need to from my.java.codebase import * or from still.more.java.code import Wonder to access your codebase. In this case, typing Won and hitting Command-I might help.
  • Field saves when you exit (Command-Q, Ctrl-C from the command line, a crash, or your code calling System.exit). If you don't want to save on exit, kill -9 the application from the command line. How come I've managed to work with this tool for years without adding an "exit without saving" button? Well, remember, you can always roll back workspace files using hg — the workspace directory is a separately versioned hg repository. Personally I'd rather keep the history of my mistakes as well, but I realize this is a little silly, hence ticket #9 is a request to add some UI for this.

Take a look, next, at the StandardLibrary or the tutorial for Processing

Wiki Navigation