Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » using variables and importing projects not working
using variables and importing projects not working [message #1405150] Wed, 06 August 2014 17:59 Go to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
Ok now in the right forum Smile

I'm grokking using the targlet to specify what I want to work with instead of a project set file, and I agree that is an improvement. However, I'm still stuck on the git clone and the import project task.

We work with multiple git repositories so what I have done is set up a variable for a "common" git clone location, and all of the git clone tasks reference this variable. Oddly, the variable does NOT show up on the screen as something I can fill in when I'm running the installation. If I omit the variable from my setup file, then it will show up as an undefined variable to fill out. I have tried putting the variable at the project level in the setup file, and in the branch where my git clone commands are, to no avail.

Here is my variable definition:
<setupTask
      xsi:type="setup:VariableTask"
      id=""
      name="gitpath"
      value=""
      defaultValue="${workspace.location/piffle}"
      label="Git Path for cloning">
    <description>Path for the checkout of multiple git repositories</description>
  </setupTask>


Second problem -- nothing we seem to do supports project import. Right now we have a Projects Import task which has a number of Source Locator entries defined, and despite the fact that the source exists there, nothing is imported. We have the same source locators defined in the targlet. I have a hunch that some of the issue is around not being able to discover the top-level product project in the targlet?

Thanks so much for your help
Tamar

  <setupTask
      xsi:type="setup.targlets:TargletTask"
      id="verve.knrover.rapid.targlet">
    <targlet
        name="${scope.project.label}"
        activeRepositoryList="">
      <requirement
          id="gov.nasa.arc.verve.rcp.knrover.rapid.product"
          versionRange="1.0.0.qualifier"
          optional="true"/>
      <sourceLocator
          rootFolder="${git.clone.verve-knrover-rapid.location}"
          locateNestedProjects="true"/>
      <sourceLocator
          rootFolder="${git.clone.verve-rcp.location}"
          locateNestedProjects="true"/>
      <sourceLocator
          rootFolder="${git.clone.irg-plan.location}"
          locateNestedProjects="true"/>
      <sourceLocator
          rootFolder="${git.clone.verve-robot.location}"
          locateNestedProjects="true"/>
      <sourceLocator
          rootFolder="${git.clone.rapid.location}"
          locateNestedProjects="true"/>
      <sourceLocator
          rootFolder="${git.clone.irg-rapid.location}"
          locateNestedProjects="true"/>
      <repositoryList
          name="Dependencies">
        <repository
            url="http://download.eclipse.org/releases/luna"/>
        <repository
            url="http://download.eclipse.org/tools/orbit/downloads/drops/R20140114142710/repository"/>
        <repository
            url="https://secret/p2_third_party/"/>
        <repository
            url="https://secret/thirdparty/.meta/p2"/>
      </repositoryList>
      <repositoryList>
        <repository
            url="${git.clone.verve-knrover-rapid.location|uri}"/>
        <repository
            url="${git.clone.verve-rcp.location|uri}"/>
        <repository
            url="${git.clone.irg-plan.location|uri}"/>
        <repository
            url="${git.clone.verve-robot.location|uri}"/>
        <repository
            url="${git.clone.rapid.location|uri}"/>
        <repository
            url="${git.clone.irg-rapid.location|uri}"/>
      </repositoryList>
    </targlet>
  </setupTask>
  <setupTask
      xsi:type="projects:ProjectsImportTask">
    <sourceLocator
        rootFolder="${git.clone.verve-rcp.location}"
        locateNestedProjects="true">
      <predicate
          xsi:type="predicates:OrPredicate">
        <operand
            xsi:type="predicates:NamePredicate"
            pattern=".*knrover.*"/>
        <operand
            xsi:type="predicates:NamePredicate"
            pattern=".*mvp.*"/>
        <operand
            xsi:type="predicates:NamePredicate"
            pattern="gov.nasa.arc.verve.rcp"/>
        <operand
            xsi:type="predicates:NamePredicate"
            pattern=".*ide.*"/>
        <operand
            xsi:type="predicates:NamePredicate"
            pattern=".*common.*"/>
      </predicate>
    </sourceLocator>
    <sourceLocator
        rootFolder="${git.clone.irg-plan.location}"
        locateNestedProjects="true">
      <predicate
          xsi:type="predicates:NotPredicate">
        <operand
            xsi:type="predicates:NamePredicate"
            pattern=".*spheres.*"/>
      </predicate>
    </sourceLocator>
    <sourceLocator
        rootFolder="${git.clone.verve-robot.location}"
        locateNestedProjects="true"/>
    <sourceLocator
        rootFolder="${git.clone.rapid.location}"
        locateNestedProjects="true">
      <predicate
          xsi:type="predicates:OrPredicate">
        <operand
            xsi:type="predicates:NamePredicate"
            pattern=".*v2.*"/>
        <operand
            xsi:type="predicates:NamePredicate"
            pattern=".*idl.*"/>
        <operand
            xsi:type="predicates:NamePredicate"
            pattern="gov.nasa.rapid.util"/>
        <operand
            xsi:type="predicates:NamePredicate"
            pattern="gov.nasa.rapid.rcp.log.player"/>
      </predicate>
    </sourceLocator>
    <sourceLocator
        rootFolder="${git.clone.irg-rapid.location}"
        locateNestedProjects="true"/>
  </setupTask>
Re: using variables and importing projects not working [message #1405160 is a reply to message #1405150] Wed, 06 August 2014 18:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31049
Registered: July 2009
Senior Member
Tamar,

Comments below.

On 06/08/2014 7:59 PM, Tamar Cohen wrote:
> Ok now in the right forum :)
>
> I'm grokking using the targlet to specify what I want to work with
> instead of a project set file, and I agree that is an improvement.
Yep, but a little more work to get right the first time.
> However, I'm still stuck on the git clone and the import project task.
>
> We work with multiple git repositories so what I have done is set up a
> variable for a "common" git clone location, and all of the git clone
> tasks reference this variable.
Hmmm, there's a rule for where git clones should go. You should use
that approach. Look in the Eclipse.org catalog how all the projects
there are authored.
> Oddly, the variable does NOT show up on the screen as something I can
> fill in when I'm running the installation. If I omit the variable
> from my setup file, then it will show up as an undefined variable to
> fill out. I have tried putting the variable at the project level in
> the setup file, and in the branch where my git clone commands are, to
> no avail.
> Here is my variable definition:
> <setupTask
> xsi:type="setup:VariableTask"
> id=""
> name="gitpath"
> value=""
> defaultValue="${workspace.location/piffle}"
> label="Git Path for cloning">
> <description>Path for the checkout of multiple git
> repositories</description>
> </setupTask>
Best you not define a variable for this. Look at the git clone tasks
in the catalog. Note that each define an ID for the task, which induces
variables. I.e., if the ID of the GitClone task is x, then the variable
x.location will be available automatically and will contain the value of
the task's location.
>
>
> Second problem -- nothing we seem to do supports project import.
The targlet task will do that, assuming you've specified a source
locator that can really find source projects.
> Right now we have a Projects Import task which has a number of Source
> Locator entries defined, and despite the fact that the source exists
> there, nothing is imported. We have the same source locators defined
> in the targlet. I have a hunch that some of the issue is around not
> being able to discover the top-level product project in the targlet?
Maybe have a look at the EGit.setup; it involves two clones and it's
targlet task functions correctly. Note that you can open the
index/catalogs from the tool bar icon...
>
> Thanks so much for your help
> Tamar
>
>
> <setupTask
> xsi:type="setup.targlets:TargletTask"
> id="verve.knrover.rapid.targlet">
> <targlet
> name="${scope.project.label}"
> activeRepositoryList="">
> <requirement
> id="gov.nasa.arc.verve.rcp.knrover.rapid.product"
> versionRange="1.0.0.qualifier"
Probably best you don't specify a range like this, and if you really
wanted a range better it be [1.0.0,1.0.1)....
> optional="true"/>
> <sourceLocator
> rootFolder="${git.clone.verve-knrover-rapid.location}"
> locateNestedProjects="true"/>
> <sourceLocator
> rootFolder="${git.clone.verve-rcp.location}"
> locateNestedProjects="true"/>
> <sourceLocator
> rootFolder="${git.clone.irg-plan.location}"
> locateNestedProjects="true"/>
> <sourceLocator
> rootFolder="${git.clone.verve-robot.location}"
> locateNestedProjects="true"/>
> <sourceLocator
> rootFolder="${git.clone.rapid.location}"
> locateNestedProjects="true"/>
> <sourceLocator
> rootFolder="${git.clone.irg-rapid.location}"
> locateNestedProjects="true"/>
> <repositoryList
> name="Dependencies">
> <repository
> url="http://download.eclipse.org/releases/luna"/>
> <repository
> url="http://download.eclipse.org/tools/orbit/downloads/drops/R20140114142710/repository"/>
> <repository
> url="https://secret/p2_third_party/"/>
> <repository
> url="https://secret/thirdparty/.meta/p2"/>
> </repositoryList>
> <repositoryList>
> <repository
> url="${git.clone.verve-knrover-rapid.location|uri}"/>
No, a clone is not a p2 repo...
> <repository
> url="${git.clone.verve-rcp.location|uri}"/>
> <repository
> url="${git.clone.irg-plan.location|uri}"/>
> <repository
> url="${git.clone.verve-robot.location|uri}"/>
> <repository
> url="${git.clone.rapid.location|uri}"/>
> <repository
> url="${git.clone.irg-rapid.location|uri}"/>
> </repositoryList>
> </targlet>
> </setupTask>
> <setupTask
> xsi:type="projects:ProjectsImportTask">
You should only need this for a project that isn't a plugin or feature
(or for which you don't desire to resolve all it's dependencies in the TP).
> <sourceLocator
> rootFolder="${git.clone.verve-rcp.location}"
> locateNestedProjects="true">
> <predicate
> xsi:type="predicates:OrPredicate">
> <operand
> xsi:type="predicates:NamePredicate"
> pattern=".*knrover.*"/>
> <operand
> xsi:type="predicates:NamePredicate"
> pattern=".*mvp.*"/>
> <operand
> xsi:type="predicates:NamePredicate"
> pattern="gov.nasa.arc.verve.rcp"/>
> <operand
> xsi:type="predicates:NamePredicate"
> pattern=".*ide.*"/>
> <operand
> xsi:type="predicates:NamePredicate"
> pattern=".*common.*"/>
> </predicate>
> </sourceLocator>
> <sourceLocator
> rootFolder="${git.clone.irg-plan.location}"
> locateNestedProjects="true">
> <predicate
> xsi:type="predicates:NotPredicate">
> <operand
> xsi:type="predicates:NamePredicate"
> pattern=".*spheres.*"/>
> </predicate>
> </sourceLocator>
> <sourceLocator
> rootFolder="${git.clone.verve-robot.location}"
> locateNestedProjects="true"/>
> <sourceLocator
> rootFolder="${git.clone.rapid.location}"
> locateNestedProjects="true">
> <predicate
> xsi:type="predicates:OrPredicate">
> <operand
> xsi:type="predicates:NamePredicate"
> pattern=".*v2.*"/>
> <operand
> xsi:type="predicates:NamePredicate"
> pattern=".*idl.*"/>
> <operand
> xsi:type="predicates:NamePredicate"
> pattern="gov.nasa.rapid.util"/>
> <operand
> xsi:type="predicates:NamePredicate"
> pattern="gov.nasa.rapid.rcp.log.player"/>
> </predicate>
> </sourceLocator>
> <sourceLocator
> rootFolder="${git.clone.irg-rapid.location}"
> locateNestedProjects="true"/>
> </setupTask>
>
Re: using variables and importing projects not working [message #1405187 is a reply to message #1405160] Wed, 06 August 2014 20:02 Go to previous messageGo to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
Ok I've realized that my branch import task needed to be within the targlet; with that set up the repositories are actually cloned and visible, and project import works when the import projects task is after the targlet task within the branch import task.

Ed Merks wrote on Wed, 06 August 2014 14:20

>Hmmm, there's a rule for where git clones should go. You should use
>that approach. Look in the Eclipse.org catalog how all the projects
>there are authored.

Thanks, I'm taking a look and will revise. What I want to do is have a common root directory where all of the child git repositories will be cloned.

>Best you not define a variable for this. Look at the git clone tasks
>in the catalog. Note that each define an ID for the task, which induces
>variables. I.e., if the ID of the GitClone task is x, then the variable
>x.location will be available automatically and will contain the value of
> the task's location.

Yes, and I am already using those, and they work perfectly. It's the root path of them that I want to make easy to change.

We've removed all of the requirements since we want to explicitly import a subset of the projects in the git repositories we have cloned. Now these projects DO show up in our workspace, but they don't actually compile because the target platform is missing contents from our p2 update sites.

> <repositoryList
> name="Dependencies">
> <repository
> url="http://download.eclipse.org/releases/luna"/>
> <repository
> url="http://download.eclipse.org/tools/orbit/downloads/drops/R20140114142710/repository"/>
> <repository
> url="https://secret/p2_third_party/"/>
> <repository
> url="https://secret/thirdparty/.meta/p2"/>
> </repositoryList>
> <repositoryList>
> <repository
> url="${git.clone.verve-knrover-rapid.location|uri}"/>
No, a clone is not a p2 repo...

What I was trying to do here was to set up dependencies for our target platform to pull plugins that we have already built and are hosting at our internal p2 update sites, which was why they were listed in "dependencies". I think we need to flesh out the target platform? Or should we be replicating that in the targlet?


> <setupTask
> xsi:type="projects:ProjectsImportTask">
You should only need this for a project that isn't a plugin or feature
(or for which you don't desire to resolve all it's dependencies in the TP).

Yes, the latter is the case.


>


Thanks as always for your help!

Tamar
Re: using variables and importing projects not working [message #1405203 is a reply to message #1405187] Wed, 06 August 2014 20:48 Go to previous messageGo to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
So another thing I'm noticing is that when I include a "requirement" in my targlet, no matter what I put for the version (0.0.0, or a version range as you suggested, or 1.0.0.qualifier which is the current version), it is NOT FOUND. This should be found in two places, one in my p2 update site, and the other in the source within one of the git repositories, and I have verified that it's there.

Another issue is that when I explicitly say which projects to import, they are imported under "Other Projects" which is a bit weird. Really what I want is a subset of the projects that are in the git repositories to be imported into the workspace, and I want some plugins that are defined in our p2 update sites to be installed into the target platform.

thanks
Tamar
Re: using variables and importing projects not working [message #1405205 is a reply to message #1405203] Wed, 06 August 2014 20:52 Go to previous messageGo to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
One other thing we noticed; if we use setup.branch.dir which is what I see in egit.setup, it shows up as undefined, yet it is described in the variables as something that should be defined?
thanks
Re: using variables and importing projects not working [message #1405334 is a reply to message #1405203] Thu, 07 August 2014 05:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31049
Registered: July 2009
Senior Member
Tamar,

Comments below.

On 06/08/2014 10:48 PM, Tamar Cohen wrote:
> So another thing I'm noticing is that when I include a "requirement"
> in my targlet, no matter what I put for the version (0.0.0, or a
> version range as you suggested, or 1.0.0.qualifier which is the
> current version), it is NOT FOUND. This should be found in two
> places, one in my p2 update site, and the other in the source within
> one of the git repositories, and I have verified that it's there.
One thing to keep in mind here is that if feature's ID in the
feature.xml is x, it's IU ID is x.feature.group.
>
> Another issue is that when I explicitly say which projects to import,
> they are imported under "Other Projects" which is a bit weird. Really
> what I want is a subset of the projects that are in the git
> repositories to be imported into the workspace,
Can that subset be defined as, for example, "this feature an all its
dependencies"?
> and I want some plugins that are defined in our p2 update sites to be
> installed into the target platform.
The latest implementation of the targlet task will, for every workspace
project it resolves, also try to resolve a compatible binary version in
the TP, i.e., i.e., if IU with ID abc and version x.y.z.qualifier is
resolved into the workspace, if there is an IU with ID abc and version
matching the range [x.y.z,x.y.z+1) in some p2 repo, that will also end
up in the TP (with the idea that you could close the project
corresponding to abc in the workspace and then the version from the TP
will be used instead).
>
> thanks
> Tamar
Re: using variables and importing projects not working [message #1405337 is a reply to message #1405205] Thu, 07 August 2014 05:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31049
Registered: July 2009
Senior Member
Tamar,

That's strange. You're looking at an older version, not at
http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/interim/EGit.setup


On 06/08/2014 10:52 PM, Tamar Cohen wrote:
> One other thing we noticed; if we use setup.branch.dir which is what I
> see in egit.setup, it shows up as undefined, yet it is described in
> the variables as something that should be defined?
> thanks
Re: using variables and importing projects not working [message #1405645 is a reply to message #1405337] Thu, 07 August 2014 21:41 Go to previous messageGo to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
Thanks Ed.

I've now been referencing the latest egit.setup file which is helpful.

I have made some progress and done the following:
-updated my feature id to correctly reflect the installable unit
-remove version of that feature entirely
-removed the repository list that was duplicating the git repositories from within the targlet

I realized that our infrastructure was still building against Kepler (DOH!) so when I was trying to do a Luna install the dependencies were finding only versions on our P2 update site that were requiring versions in Kepler, not in Luna. So I did a test install with Kepler instead of Luna and had some more success.

With the above changes, it DOES actually find the main feature and its dependencies from our P2 update sites, source repositories and Kepler's p2 update sites, which is great!

It now DOES show projects in my workspace that were found in the git repositories, under the "Other Projects" folder. (if I made a working set would this be in a different organization?)

It does NOT show any git repositories as imported.

I'm also still confused as to what belongs in the P2 Director area at the top of my setup (just references to eclipse p2 update sites?) and what belongs in the RepositoryList within my targlet. Right now they both contain the same things and I can't find any documentation clarifying what should be where.

Getting closer! **THANK** you!

Tamar

[Updated on: Thu, 07 August 2014 21:52]

Report message to a moderator

Re: using variables and importing projects not working [message #1405670 is a reply to message #1405645] Thu, 07 August 2014 23:24 Go to previous messageGo to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
Another question -- since my projects are Eclipse plugin and feature projects with Maven natures, I want to have the org.sonatype.tycho.m2e.feature.feature.group installed in the base IDE (not checked out as a source project). I am not clear on where / how I specify this in my source folder; this is not an explicit dependency of the plugins.

thanks
Re: using variables and importing projects not working [message #1405686 is a reply to message #1405670] Fri, 08 August 2014 00:39 Go to previous messageGo to next message
Tamar Cohen is currently offline Tamar CohenFriend
Messages: 103
Registered: July 2009
Senior Member
So I think the tycho m2e support I need is actually a Maven plugin and not an Eclipse plugin -- so I added a Maven Import as a child but I'm not sure how to properly fill that in? Are there examples that include a Maven Import?

thanks

[Updated on: Fri, 08 August 2014 00:42]

Report message to a moderator

Re: using variables and importing projects not working [message #1405735 is a reply to message #1405645] Fri, 08 August 2014 04:19 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6487
Registered: July 2009
Senior Member
Hi Tamar,

Comments below...

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Am 07.08.2014 um 23:41 schrieb Tamar Cohen:
> Thanks Ed.
> I've now been referencing the latest egit.setup file which is helpful.
>
> I have made some progress and done the following:
> -updated my feature id to correctly reflect the installable unit
> -remove version of that feature entirely
> -removed the repository list that was duplicating the git repositories from within the targlet
>
> I realized that our infrastructure was still building against Kepler (DOH!) so when I was trying to do a Luna install
> the dependencies were finding only versions on our P2 update site that were requiring versions in Kepler, not in
> Luna. So I did a test install with Kepler instead of Luna and had some more success.
>
> With the above changes, it DOES actually find the main feature and its dependencies from our P2 update sites, source
> repositories and Kepler's p2 update sites, which is great!
> Unfortunately, it STILL does not show any projects in my workspace nor does it show any git repositories as imported.
> I can get projects in my workspace in the "Other Projects" folder if I have the explicit Projects Import but now I
> understand I should not need that at all.
>
> I'm also still confused as to what belongs in the P2 Director area at the top of my setup (just references to eclipse
> p2 update sites?)
The P2 Director tasks install (or update) tools into your *host* IDE.

> and what belongs in the RepositoryList within my targlet.
The Targlet task installs (or updates) targlets into the targlet container of your target platform. These targlets
contribute binary installable units (features and plugins) from their p2 repositories and/or source projects from their
source locators. If everything is configured correctly your source projects are compiled against your target platform
and the result can be launched as a *runtime* IDE or exported as a product.

> Right now they both contain the same things and I can't find any documentation clarifying what should be where.
That's probably less common, but I've seen people adding their tools to their target platform, so that they're available
inruntime launches, too.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: using variables and importing projects not working [message #1405737 is a reply to message #1405670] Fri, 08 August 2014 04:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6487
Registered: July 2009
Senior Member
Am 08.08.2014 um 01:24 schrieb Tamar Cohen:
> Another question -- since my projects are Eclipse plugin and feature projects with Maven natures, I want to have the
> org.sonatype.tycho.m2e.feature.feature.group installed in the base IDE (not checked out as a source project). I am
> not clear on where / how I specify this in my source folder; this is not an explicit dependency of the plugins.
You should add the M2E feature (and a p2 repository that contains it) to one of your P2 Director tasks.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: using variables and importing projects not working [message #1405740 is a reply to message #1405686] Fri, 08 August 2014 04:32 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6487
Registered: July 2009
Senior Member
Am 08.08.2014 um 02:39 schrieb Tamar Cohen:
> So I think the tycho m2e support I need is actually a Maven plugin and not an Eclipse plugin -- but when I try to add
> a new child which is a Maven Import, my Eclipse that I'm using to edit the Setup file just goes into its own Setup
> loop where it tries to install / update something, restarts, and yet still after that I cannot add a Maven Import.
I suspect you refer to our meta model discovery that applies to your setup authoring IDE. Note that when you install an
IDE with Oomph only those tasks (i.e. the code plugins) are installed that are actually in the list of needed tasks for
that installation. E.g., the Maven Import tasks is not installed if the setup models for that IDE don't contain a Maven
Import task. That's cool for normal Oomph users because their IDE isn't cluttered with unneeded functionality. But
authors of the setup models may want to add new tasks to their models. And that's where our discovery mechanism kicks
in: The New Child menu of the setup model editor offers all tasks and elements that are registered in our global index
and, when you happen to select one of those, they get installed on demand. That's the extra setup cycle you're
observing. After that cycle (which includes an automatic restart) you can actually use the task in your setup model.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:How to model update site <-> Eclipse version dependency
Next Topic:Egit dependency error when using github template.
Goto Forum:
  


Current Time: Fri Apr 10 20:33:09 GMT 2020

Powered by FUDForum. Page generated in 0.02139 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top