[seam-dev] the shackles have been removed from seam-gen (upgrade #2)

Dan Allen dan.j.allen at gmail.com
Thu Oct 9 04:15:00 EDT 2008


The seam script (which we all call seam-gen) just got another upgrade
tonight, this time focused on the build. Up to this point, the seam
script has been a couple steps behind other project generation tools,
such as Grails, because the user has been locked into having to run it
from a Seam distribution directory. You may know from using Grails
that their approach is to add grails to your PATH and set GRAILS_HOME
and use it like a system command. I have an approach that falls
somewhere in between and frankly is more intelligent.

First and foremost, i have unlocked us from having to run the seam
script from the Seam distribution directory. Now you can run it out of
any directory on the computer and it will work as it does today
(meaning your current working directory can be anywhere). Internally
it figures out your current directory and the SEAM_HOME environment
variable relative to the location of the script (there is really no
reason to make the user set this environment variable, that is just a
stupid requirement). More on the current working directory in a
second. Btw, I also put in a check that the user has JAVA_HOME
pointing to a JDK because otherwise the Ant build is going to fail
anyway.

As you may know, I have been moving build.properties into the project
as the file seam-gen.properties since last spring (really since Seam
2.0). We just haven't done anything with it...until now. Here is the
big enhancement.

If your current working directory happens to be a directory that has a
seam-gen.properties file AND and build.xml file, then the seam script
recognizes that you are in a Seam project and operates using the
seam-gen.properties file in that directory rather than the
seam-gen/build.properties from the Seam distribution. If you put the
seam script on your PATH, then you can simply enter a project and run
"seam generate". If you are too lazy to put it on your PATH, then you
have to run something like "~/projects/seam-trunk/seam generate".
Either way, it will work. Btw, I also fixed the Windows batch script
(which was really no fun at all. Windows sucks. It's like playing with
those really big legos that you give 3 year olds).

On top of that, the outputs after the generate command are aware of
whether you are running the seam script outside a project or inside a
project and thus tell you to use seam or ant respectively. For
example, if you run "seam generate" from within a project, it will
tell you to run "ant restart" (instead of "seam restart") after it is
done its work (no need to keep having to go through the seam script).

The next steps I guess are for JBossTools to use the
seam-gen.properties inside the project (if it doesn't already). As far
as JBossTools is concerned, it doesn't really care where the
properties file is because it has the advantage of being aware of the
workspace. Most of the upgrades here had to happen in the seam script.

I am going to take this message and the previous one about the
seam-gen upgrades and do a blog entry on in.relation.to in a day or
so.

Cheers,

Dan

-- 
Dan Allen
Software consultant | Author of Seam in Action

http://mojavelinux.com
http://mojavelinux.com/seaminaction

NOTE: While I make a strong effort to keep up with my email on a daily
basis, personal or other work matters can sometimes keep me away
from my email. If you contact me, but don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the spam filters.  Please don't hesitate to resend a message if
you feel that it did not reach my attention.



More information about the seam-dev mailing list