Creating an Xcode project (OS-X)

This forum is used to discuss questions and details regarding the AVRcamVIEW PC application.

Creating an Xcode project (OS-X)

Postby Guest » Sun Jun 12, 2005 11:26 pm

Is there a step-by-step? The CD I got was linux/Win only. I don't know how to deal with rpm files and I'm not familiar with ant, although I've got a fair bit of experience with straight-Java.

Here's what I did that seemed to work pretty well:

* In XCode, create a new project, type=Java Swing App.
* Delete the sources that come with the default project (files & references)
* Add a group "avr"
* Drag all the folders in the ~/AVRcamView/src/avr/ folder to the project -- make recursive groups
* Adjust the target (Pure Java Specific) so the main class is "avr.swing.JAVRCamFrame"
* Comment out
/* //*
import org.jdom.*;
import org.jdom.input.*;
import org.jdom.output.*;
(These appear to be unused, and I didn't have them in my path, so...)

* Change all occurences of
SwingUtilities2.getFontMetrics(c, g, f);
(I'm not on tiger, yet -- don't know if the SU2 version is supported, there.)

* In JLogApplet, comment out all the code in the saveXML(File) method. I added
System.out.println ("*** saveXML(File) not implemented ***");
(Where is Element defined?! I was getting object not found, here.)

*** NOTE: There's probably a more-direct way to do the following three steps, but I don't deal much with resource files, so this is the hack I put together that works.

* Copy the resources from ~/avr/resources/avr.resource into ~/YourProject/
* In, make this change:
//* //* RES = new Resource("avr.resource.avr");
RES = new Resource ("YourProjectNamestrings"); //*
* In, make this change:
//* BUNDLE = ResourceBundle.getBundle(file);
BUNDLE = ResourceBundle.getBundle(file, Locale.getDefault());

* Now your project should build & run without errors. Everything seemed to work as advertised, once I got the project building.

Postby Bud » Tue Jun 14, 2005 7:54 pm

Hi Guest,

Since your using XCode, I guessing your running on a Mac. I realize that JDK 1.5 does not run on a Mac, that's why I have written the AVRcamVIEW software so it can be compiled with JDK 1.4. The only thing you will lose with JDK 1.4 is the new JColorMapPanel will be a set of JCheckBoxes instead of JSliders. Since I don't have a Mac, I can't test the AVRcamVIEW on a Mac. I just realized that I don't have an ANT build script for a Mac, so I will create a basic build script that will only create the jar file needed to run the AVRcamVIEW. I will place this on the download page in the next couple of days.

ANT is like a Makefile for Java files. It's written in Java so it can be run across any platform. To build the AVRcamVIEW follow the simple instructions on setting up ANT on your system, and cd to the top level directory and type "ant jar" and the AVRcamVIEW.jar file should be created. Most IDE's will support ANT build files along with XCode, see for more information about running ANT with XCode.

In order for the AVRcamVIEW to run on a Mac, the RXTX package must be installed to communicate over the Serial Port to the AVRcam. Follow the instructions in the README.txt file located at src\Java Libs\Javax COMM\MAC OSX on the AVRcam Software CD.

As far as the org.jdom stuff, the AVRcamVIEW uses these classes to generate/parse XML. The application will run fine without it but you will not be able to save the log in XML format. The JDOM.jar file (located at src\Java Libs\JDOM on the CD) can either be put in the CLASSPATH or under the <JRE_HOME>/lib/ext directory.

If you need anymore information, please let me know.
-- Bud
Posts: 9
Joined: Sun Dec 12, 2004 5:37 pm

Postby Guest » Thu Jun 16, 2005 8:59 pm

Ok...the new ANT build script for Max OSX is up at the download section. Thanks for getting this put together Bud...grab the new file here:

Let us know if there are any problems with it.

Return to AVRcamVIEW PC Application

Who is online

Users browsing this forum: No registered users and 1 guest