Re: Eclipse - Cocoa/Java Hint
Re: Eclipse - Cocoa/Java Hint
- Subject: Re: Eclipse - Cocoa/Java Hint
- From: "Brad O'Hearne" <email@hidden>
- Date: Thu, 3 Jun 2004 04:16:18 -0400
Steve,
Here's a rather generic ant Java build that I put together a while back
to help me with any new project. Just drop build.properties and
build.xml in your project root directory and off you go. I've tweaked
it myself some since I originally did this, but it should suffice. You
can still use Eclipse to run this, or use it from the command line. I'm
just learning XCode myself, so I don't know if it has any quirky
requirements for ant builds, but I would guess it probably can be used
there too.
[demime 0.98b removed an attachment of type application/octet-stream which had a name of build.properties]
[demime 0.98b removed an attachment of type application/octet-stream which had a name of build.xml]
Copyright @2004, NeuroFire and Brad O'Hearne
NeuroFire Free Product License
While the general need for licensing protection on products is understood,
there is no
need for lengthy legal diatribes, which typically both threaten and confuse
the consumer/user.
What a license breaks down to is protection of the rights of the creator, and
granted rights to
the consumer/user.
So with that in mind, this license can be adequately defined in a few
short points:
Rights of the Creator (NeuroFire, Brad O'Hearne)
1. The creator owns the copyright to the entire created work.
2. The creator has the right to be credited with the created work.
Rights of the Consumer/User (You)
1. You have the right to obtain both the source and compiled versions of the
created work at no cost.
2. You have the right to modify both the source and compiled versions of the
created work at no cost, provided that credit be given to the creator in some
noticable form with the derivative work.
3. You have the right to distribute both the source and compiled versions of
the
created work at no cost, royalty-free, provided that credit be given to the
creator
in some noticable form with the distributed work.
What this effectively boils down to is to give credit where credit is due.
This free
product is being given freely for the benefit of all. Don't plagiarize without
attribution: it is theft.
FAQ
Question: Why don't you use the GPL, LGPL, [insert public license here], etc.,
instead of this license?
Answer: There are two reasons. First, my main goal is seeing people use the
created work, not
interpreting legal documents. Respect for other's property breaks down to very
simple
principles, which can be communicated clearly without the need for a lawyer
(on either
end -- creator or consumer/user). Second, I do not wish to be bound by a
license dictated
by others. Should it change, be re-interpreted, etc., I do not wish to be
subject to or
subject anyone else to the resulting consequences.
Question: What to you mean by giving credit in "noticable form"?
Answer: Give credit in some form that it can be noticed. Surprise me... :-).
Ant Build Files
The ant build.xml and build.properties files are designed to make creating
a simple Java project structure and project build an effortless process. It is
expected
that many, if not most, may need to customize the build file for specific
uses. However,
these files do provide a starting point, if not a sufficient project structure
and build
system for common needs in Java projects.
Pre-requisites
1. Ant 1.5.x or later.
2. ANT_HOME must be defined in the environment settings.
3. Java 1.4.x or later.
4. JAVA_HOME must be defined in the environment settings.
This document assumes understanding of both Ant and Java.
Installation
1. Create a directory for the new Java project
2. Copy the build.xml and build.properties files into the root of the
directory created
in 1.
3. Run the command:
ant proj
If the command runs and completes without errors, the project directory
structure
should now be created.
4. Change the build.properties file to reflect the appropriate property
values.
User Guide
Project Structure
The project directories created by the "proj" target in the Ant build and an
explanation of what types of files belong in each directory follows:
src - Java source files
bin - script and binary files
lib - 3rd party libraries and jars
doc - documentation
conf - configuration files
Any Ant target that generates artifacts will result in a "gen" directory being
created.
All build-generated artifacts will fall under this directory.
Ant Targets
Important Ant targets and a description of their function follows:
outputenv - outputs environment information to the console. This is the
default target.
proj - creates the project structure in the immediate directory.
init - creates the gen directory and all associated subdirectories
for build artifacts.
clean - cleans build artifacts, i.e. deletes the gen directory.
compile.debug - compiles source files with debug info.
compile.nodebug - compiles source files with no debug info.
compile - compiles two sets of classes, one with debug info, one
without.
jar.debug - builds a debug jar (classes with debug info).
jar.prod.src - builds a production jar containing source files.
jar.prod.nosrc - builds a production jar containing no source files.
jar - builds all aforementioned jars.
javadoc - generates javadoc.
dist - builds debug, production with source, and production without
source
product distributions.
run.debug - runs the debug jar (assumes a Main class exists).
run.prod - runs the production (with source) jar (assumes a Main class
exists).
Ant Build Artifacts
Any new files generated by the build will be stored underneath the "gen"
directory.
Important subdirectories and a description of their contents follows:
classes - compiled java classes, both with debug info and without
jar - built jars (not 3rd party jars)
doc - generated documentation (Javadoc).
dist - distributions.
Distributions are notable in that they are the result of jars built from
compiled classes,
generated Javadoc, documentation from the root "doc" directory, 3rd party
libraries and
jars from the root "lib" directory, and scripts and binaries from the the root
"bin"
directory. All files residing in the root "doc", "bin", and "lib" directories
are by
default copied into the generated product distributions.
Hope that helps.
BradO
On Jun 3, 2004, at 12:04 AM, Steve Franks wrote:
>
Hi,
>
>
I wanted to use Eclipse to write Cocoa-Java programs, and discovered
>
its really quite simple to develop Cocoa-Java programs in Eclipse.
>
>
In /System/Library/Java/com/apple/.... directory tree are all the
>
Java "stubs" for Cocoa-Java bindings.
>
>
I simply did a jar cvf Cocoa.jar /System/Library/Java/com
>
and added Cocoa.jar as an external JAR into Eclipse (3.0M9 but I doubt
>
it matters).
>
>
I could then do refactoring, organizing imports, code completion, all
>
the other perks of Eclipse.
>
>
The eclipse "build" will find all the Java errors, but as of now I
>
still need to make a XCode project to create an actual application.
>
I vaguely remember some people were working on a Ant task to create
>
Java apps, not sure about Cocoa-Java apps though.
>
>
>
Anyway, thought this may be of some use to people even as is, using
>
Eclipse as an smart editor and building with XCode.
>
>
Anybody know of information regarding Cocoa-Java Ant build tasks
>
(besides calling an xcode project build from command line)?
>
>
>
Steve Franks
>
adenzo software - http://www.adenzo.com/
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.