Community
Participate
Working Groups
There are three scenarios we need to consider - If the genModel.modelDirectory is "foo/src1" and the model project was already created, the generated java files will be placed in a src1 folder while the project's source folder is "src". - If the modelDirectoy is set to something like "foo/src/model", "model" becomes part of the package instead of a source folder - If the modelDirectory is 'foo/src.model' and the editDirectory is 'foo.src.edit', the genModel will not create the plugin files (manifest and so) as it should (it will create the files for the model project and then try to create the files for the edit project).
The build.properties file also has hard code assumptions about the source folder as well as about the model folder.
Created attachment 72065 [details] patch refers to Marcelo's description Hello, please look at this :) refering to bug description. AD 1. i assume that you expected the new source folder (foo/src1) to be set as another Source Folder. As a result, there may be both "src" and "src1" source folder with the same code, making compiler confused. But i think there is no way to guess that what is now in "src1" was previously in "src" In patch, javaSource (foo/src1) must be created as new source entry, not only when project is initially empty, but always, when folder didnt existed and was just created. AD 2. creating folder "foo/src/model" throws exception, because resource cannot be created recursively in one step. Instead, patch provides a way to iteratively create parent folders and finally source folder. AD 3. i guess you meant editDirectory = "/foo/src.edit", ("foo.src.edit" is not correct because is not absolute, and EMF will prompt an error). I actually couldn't reproduce the issue with not creating plugin files. I think it might have been caused by exception in AD2. But there was another problem. If modelDirectory was "foo/src1" and editDirectory "foo/src2", then "foo/src2" wasn't set to source folder. Change in GenBaseGeneratorAdapter fixes this. Finally i've checked with couple different setups: (model, edit, editor directory) -default (/foo/src, /foo.edit/src, /foo.editor/src) -setup1 (/foo/src.model, /foo/src.edit, /foo/src.editor) -setup2 (/foo/src/model, /foo/src/edit, /foo/src/editor) and looks like it's working...
Thanks for providing a possible fix! I didn't have time to analyze your changes today, but will do first thing tomorrow morning and type here my comments.
Created attachment 72232 [details] Improvements on the previous patch Awesome work. You patch is both small and precise. Thanks. I just made one modification to your code to add this support to the tests project. I also changed the templates so that "src" is not hard coded in the build.properties (as Ed mentions above). Unfortunately it is too late to commit this for 2.3. If everything goes well, we will be committing this change in probably 3 weeks, for our 2.4 release.
Marcelo, I wonder if now is better time to commit this enhancement.
Created attachment 86405 [details] Some updates I changes the GenModelImpl to avoid using IPath/Path since that will not work standalone. I also changed the generate method to always create a source entry since generating a project when one existed before but wasn't deleted from the file system produced bad results.
[contrib email="jacek.pospychala@pl.ibm.com"/]
The changes are committed to CVS for 2.4.
Fixed in I200801090807.
Move to verified as per bug 206558.