2

I'm trying to use Oomph to setup an Eclipse dev environment, and import some (source) projects from the disk, from a given root folder. For this I'd like to use a variable to mark where this root folder is (prompt the user for it), and from there let Oomph discover the required projects inside that folder. Since I haven't found any docs on this, here is what I tried:

<?xml version="1.0" encoding="UTF-8"?>
<setup:Product
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:projects="http://www.eclipse.org/oomph/setup/projects/1.0"
    xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
    xmlns:setup.p2="http://www.eclipse.org/oomph/setup/p2/1.0"
    xsi:schemaLocation="http://www.eclipse.org/oomph/setup/projects/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Projects.ecore"
    name="my.product"
    label="My Product">
    <setupTask
        xsi:type="setup:InstallationTask"
        id="installation"/>
    <version name="neon"
        label="Neon"
        requiredJavaVersion="1.7">
        <setupTask
            xsi:type="setup.p2:P2Task"
            label="foo">

            <!-- Requirements and repositories for the dev env to work -->

            <!-- Here is a project that I'd like to import -->
            <requirement name="com.mycompany.myproject"/>

        </setupTask>

        <!-- This task should locate the project to import -->
        <setupTask
            xsi:type="projects:ProjectsImportTask">
            <sourceLocator
                rootFolder="${my.sourceroot}/eclipse-plugins/"
                locateNestedProjects="true"/>
        </setupTask>

        <!-- The variable to mark the root folder -->
        <setupTask
            xsi:type="setup:VariableTask"
            id="my.sourceroot"
            type="FOLDER"
            name="root folder"
            label="root folder">
        </setupTask>

        <description>My Product for Neon.</description>
    </version>
    <description>My Product provides cool stuff.</description>
</setup:Product>

When trying to setup the IDE using the Oomph app it doesn't ask for the root folder, and obviously errors not finding the project I'd like to import.

Question: What's the right way to do this? Any docs or tutorials (for dummies) would be also greatly appreciated on this.

dur
  • 15,689
  • 25
  • 79
  • 125
Balázs Édes
  • 13,452
  • 6
  • 54
  • 89
  • Did you try to change the order of the `setupTask`s? First the `VariableTask`and then the `ProjectsImportTask`? – dur Jan 25 '17 at 10:10
  • A colleague of mine managed to figure it out. Not sure what did he change, but at this point I don't really care. Will post a working version once I have the time. – Balázs Édes Jan 25 '17 at 10:21

0 Answers0