We are going to prepare our first project setup with Oomph.
Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.
For a list of all Oomph related tutorials see my Oomph Tutorials Overview.
Step 1: A basic setup file
Of course Oomph setups can be created within eclipse. So start with a new General/Project named com.codeandme.oomph. Now create a new Oomph / Setup Project Model. The wizard will setup all kinds of default tasks for us, but we want to start from scratch to understand all the tasks involved.
So select a Simple Project, provide a Label "Code and me" and Finish the wizard.
The setup file created simply contains a root node for the project and a default stream named Master.
Not much of a setup yet, but we can already add it to our eclipse installer.
Step 2: Adding the setup to the installer
Launch the eclipse installer from our first tutorial, select an eclipse product and advance to page 2 of the wizard. There hit the + icon on the toolbar, select Browse File System and select the setup file we just created. The setup will be added to the <User> node. Not much sense installing our empty setup yet, but now the installer references our setup file and we can test it for each step we add. On each start of the installer the setup file gets reloaded, so you do not have to add the file each time you want to test it.
Step 3: Adding a simple ini file action
One of the simplest actions to add is an ini file adjustment. As you might guess this adds entries to the eclipse.ini file provided with your product installation. Select the Code and me node in your setup, then use the context menu to add a New Child / Eclipse ini task. Now we are going to adjust the task using the Properties view.
To change the initial heap size of your Java VM set Option to -Xms, Value to 1024m and VM to true. The last parameter is needed for all Java VM properties. Set it to false when changing any eclipse.ini properties like -showsplash or similar.
Make sure to provide a unique ID and a usable Description. The IDs are important when we want to refer to a node later in our setup.
Step 4: Add folders to structure your settings
When we start adding multiple ini tasks we should cluster them. Therefore add a new Compound item to your root node and D&D your ini settings in there. Compounds add more structure to your setup, but have no effect on the installation process.
Optional: Investigate common tasks
The scheme for adding new tasks is the same for all kinds of things. Add a node, adapt its properties, save and run your setup to test it. Good sources for tasks are the existing eclipse project setups. You may browse them by opening the catalog from the toolbar or from the main menu: Navigate / Open Setup / Parent Models / Catalog Index. We will have a closer look at dedicated tasks in the following tutorials.
Hi Christian,
ReplyDeleteYour tutorial looks very promising. I'm keen on seeing how it goes on ;-)
Here some remarks:
- Setup task IDs have two effects. They make references to their task (typically in the predecessors and successors of other tasks) tolerant against positional moves. And they make that for each attribute of their task a variable is induced during an installation process. The names of the variables have the form . and they can be used in other tasks' attributes by inserting ${}.
- Compounds are indeed often just a visual grouping of tasks, but during an installation process they also propagate the effect of the "disabled", "restrictions", and "filter" properties down to all their contained tasks.
Cheers
/Eike
plan is to lead users step by step to the important features. Would be great if you could follow this series and add comments when I misinterpret things.
DeleteGrr, some unwanted tags were removed from my first remark. It should have been:
DeleteThe names of the variables have the form <task-id>.<attribute-name> and they can be used in other tasks' attributes by inserting ${<variable-name>}.