| FoxyCoder wrote: |
Perhaps an ant extension to access Eclipse configuration information would be enough. |
Probably not. Actually there must not be any info that would influence the build that is obtainable only from Eclipse, since building the full application should not depend on Eclipse being installed.
If there are, they must be reproduced for ant as files, otherwise the build process itself would depend on Eclipse, which is clearly not allowable, since maintaining information stored in Eclipse needs frequently opening Eclipse to refresh its changes. On a separate (possibly unmanned) build machine this is not usually acceptable.
There are a couple of problems to this actually:
- the location of other referenced projects are resolved by Eclipse. An other way of supplying information about the location of a specific Eclipse project must be introduced to make it possible to do many-Eclipse-project application builds (some standardized way of mapping Eclipse projects to paths in property files, which also has to be maintained by MyEclipse on an Eclipse machine and the build manager on a non-Eclipse machine).
- the information about application servers are definitely stored by Eclipse. This definitely should be acquirable from property files by the build process, and should be maintained the same way as it is described in the previous section
- I am not sure, where the deployment information of a project is stored, but the obvious place would be in metadata files in the project directory
All other necessary information is actually stored in MyEclipse-specific metadata files, like .myeclipse, and such.
An other solution may be that, implemented by Weblogic Workshop as well, that it generates Ant build.xml files for the actual state of a project and an application, which use custom tasks that read the Workshop specific metadata info. (Actually Workshop itself uses ant to build, so it may not be the best example after all.).
In the MyEclipse case, it can extend this with also writing out all the necessary information that was stored in Eclipse configuration store into property files for the tasks to be able to read it without accessing Eclipse at all, thereby making the ant tasks become independent from Eclipse.
For example, if an application project is selected, for generating ant-stuff from, then:
1. one or more property files should be generated containing
- all data about the application servers used by the application,
- all data about the deployment of the application and its module projects,
- all data about the root directory of the module projects should be stored.
2. a build.xml should be generated with the appropriate targets which is capable of carrying out application-level operations (clean, build, deploy, undeploy, ear an entire application, etc)
3. one or more property files for each module project should be generated containing
- all project-specific data which is not stored in MyEclipse-specific metadata files in the project
4. a build.xml should be generated with the appropriate targets for carrying out module-level operations (rebuild, clean, build, jar, war, optionally redeploy the module individually, if possible, etc.)
When the projects are copied to an other machine, the property files are the only things needed to be adjusted, to ensure the full operation capabilities of the build.xml files.
There may be additional problems, as Riyad outlined it, because of the version of ant they looked at lacked the control-flow capabilities or lacked some tasks or lacked the means of passing necessary information back to Eclipse they would require to be able to make all their operations ant-based.
The first two may be coded around by writing additional tasks. The third ones probably cannot without making changes to ant itself. However there may not be problems of this third type.
Just my 2 cents,
Regards,
Robert