From: Ken R. <ke...@cs...> - 2009-03-28 11:25:03
|
Dear Laurent, On 28/03/2009, at 01:35 AM, Laurent Voisin wrote: > Dear Ken, > > Le 27 mars 09 à 15:19, Ken Robinson a écrit : > >> On 28/03/2009, at 00:51 AM, Thai Son Hoang wrote: >> >>> Ken Robinson wrote: >>>> This is more of an Eclipse question than a Rodin question, but >>>> someone >>>> on the list might know a solution. >>>> >>>> I would like to be able to generate a set of projects from >>>> something >>>> like a script rather than manually using the Rodin interactive >>>> interface. >>>> >>>> Does anyone know how to do this? >>>> >>> >>> I guess you need to create a plug-in for Rodin which do what you >>> want. >>> To programmatically creat a Rodin project, you can check out this >>> link >>> in the wiki. >>> http://wiki.event-b.org/index.php/How_to_create_Rodin_projects_programmatically >>> >>>> Why do I want to do it? >>>> >>>> I have a set of student assignments and I need a project for each >>>> student. >>>> >>> >>> I am not so sure this is what you want, since you would like to >>> prefer >>> a shell script to do that. >> >> Thanks for the pointer, and I'll have a look at that, but yes I was >> after something more like a shell script. I would like to be able to >> read a list of project names and create the projects. >> >> I have tried simply creating a directory that contains the >> appropriate .project xml file, but that doesn't seem to work. >> >> It would be nice to be able to alert Rodin to the fact that there >> is a >> project that it needs to recognise. >> >> You can do that sort of thing with project components. You can >> simply >> copy the files into the project and then do a refresh. Suddenly all >> the contexts and machines appear. >> >> I can't see anything that will cause it to notice projects. > > To create project without writing any Java code, you can use the > Eclipse Importer: > > - click File > Import... > > - select "General > Existing Projects into Workspace" > > - then select a root directory > > All children directories of the selected root that contain > a .project file are candidate projects for importation. > > Please notice the little checkbox labelled "Copy projects into > workspace" on the bottom left and don't forget to tick it, then > click "Finish". > > This can also work with an archive containing all the files (which > might be more convenient for distribution to students). Thank you very much for clarifying something that I never understood. I have been using that strategy for a long time for importing projects, but in the cases I have dealt with the directory containing the .project file was the same name as the project. I hadn't realised that the name of the directory itself is actually irrelevant. Of course, when you think about it that makes a lot of sense, otherwise the .project file would be redundant. The submitted projects that I have to import have project names that relate to the model the students are building. I want to import them under the student identifiers. All I have to do is to write a script to change the .project files to the project names I want and then using the strategy you describe I can import all the submitted projects in a single import. Very, very nice. Cheers, Ken That's exactly the sort of thing I wanted to do. |