-
1. Re: Enhancing seam-gen to support multiple projects
atao Aug 18, 2007 3:22 AM (in response to modoc)An other way would be:
- when you create a new project, copy the build.properties inside it
- add in the build.xml of the project targets "generate-entity" ... linked
to the associated targets in seam-gen/build.xml
You can call these targets from the project under Eclipse.
Then each project is fully independent. -
2. Re: Enhancing seam-gen to support multiple projects
modoc Aug 18, 2007 12:53 PM (in response to modoc)Yes, that would work as well. You'd have to modify the seam-gen templates a bit to make that work, but it should be doable.
Either approach: is this something that would make a good feature as part of seam-gen? If so, how do we submit the changes? -
3. Re: Enhancing seam-gen to support multiple projects
atao Aug 18, 2007 6:44 PM (in response to modoc)You'd have to modify the seam-gen templates
seam-gen/build-scripts/build.xml and seam-gen/build.xml.
Other? -
4. Re: Enhancing seam-gen to support multiple projects
matt.drees Aug 19, 2007 2:06 PM (in response to modoc)I agree, something like this would be handy. I think I like atao's approach a little more.
I've copy/pasted the copy-lib target into my project to update the lib dir when cvs changes, and this has worked well. If the target came built-in, that'd be great. -
5. Re: Enhancing seam-gen to support multiple projects
modoc Aug 19, 2007 3:07 PM (in response to modoc)I'm going to play with atao's approach now. If I get something working, I'll post it up for everyone.
Devon -
6. Re: Enhancing seam-gen to support multiple projects
atao Aug 19, 2007 4:30 PM (in response to modoc)Here is a try i did some time ago with "generate-entities".
The idea is to avoid to duplicate the same code in seam-gen/build.xml and in {project_home}/build.xml.
It should work for any other target.
In the seam-gen/build-scripts/build.xml, add:<target name="generate-entities" description="Reverse engineer entities from the database"> <ant dir="${seam.home}/seam-gen" target="generate-entities" inheritall="false"> <property name="project.name" value="${project.name}"/> <property file="${basedir}/build.properties"/> <property file="${basedir}/seam-gen.properties"/> </ant> </target>
the variable seam.home must be defined in {project_home}/build.properties
in seam-gen/build-scripts/build.properties, add:seam.home = @seamHome@
and in seam-gen/build.xml, in filterset "project", add:<filter token="seamHome" value="${basedir}/.." />
the seam-gen/build.properties is copied in {project_home}/seam-gen.properties
in seam-gen/build.xml, in target "file-copy", add:<copy tofile="${project.home}/seam-gen.properties" file="${basedir}/build.properties"> <filterset refid="project"/> </copy>
-
7. Re: Enhancing seam-gen to support multiple projects
modoc Aug 19, 2007 4:33 PM (in response to modoc)atao: haha, I was just drafting my reply when you posted your comment:) Well, my solution is almost identical to yours:) It works very well, thank you very much for the idea!
I have the full write-up and modified files here:
http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/seam-gen-and-multiple-projects-part-two.html
If anyone is interested.
I'd love to see this get rolled into the main seam product.
Devon -
8. Re: Enhancing seam-gen to support multiple projects
modoc Aug 19, 2007 4:33 PM (in response to modoc)http://www.digitalsanctuary.com/tech-blog/java/jboss/seam/seam-gen-and-multiple-projects-part-two.html
Sorry, I wish I could edit previous comments. -
9. Re: Enhancing seam-gen to support multiple projects
atao Aug 20, 2007 4:58 AM (in response to modoc)Modoc,
Will you create a new Jira entry? -
10. Re: Enhancing seam-gen to support multiple projects
modoc Aug 20, 2007 11:31 AM (in response to modoc)Sure will!