Skip to main content



      Home
Home » Eclipse Projects » Oomph » Using the Git clone location to build working sets
Using the Git clone location to build working sets [message #1817061] Thu, 14 November 2019 16:35 Go to next message
Eclipse UserFriend
Hi,

The Location Import task can use the Git location URI as defined via the Root folder attribute: Example: ${git.clone.dartboard.location}

I would like to use this clone location to build working sets, e.g. everything which is in one Git repo should go into the same working set.

I tried the following but that only results in empty worksets.

<setupTask
xsi:type="setup.workingsets:WorkingSetTask"
prefix="org.eclipse.dartboard-">
<workingSet
name="${scope.project.label}">
<predicate
xsi:type="predicates:AndPredicate">
<operand
xsi:type="predicates:LocationPredicate"
pattern="${git.clone.dartboard.location}"/>
</predicate>
</workingSet>
<description>The dynamic working sets for ${scope.project.label}</description>
</setupTask>


Please advice how this can be done, or what I did wrong.

The full project setup file is attached.

Thank you.

Best regards, Lars
Re: Using the Git clone location to build working sets [message #1817071 is a reply to message #1817061] Fri, 15 November 2019 01:37 Go to previous messageGo to next message
Eclipse UserFriend
Why not just use the same repository predicate?

A location will never be a pattern. This is more commonly used like this:
<?xml version="1.0" encoding="UTF-8"?>
<predicates:LocationPredicate
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:predicates="http://www.eclipse.org/oomph/predicates/1.0"
    xsi:schemaLocation="http://www.eclipse.org/oomph/predicates/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Predicates.ecore"
    pattern=".*/features/.*"/>

You'd need to ensure that the separator is / and not \ using ${git.clone.dartboard.location|path} and you need to pattern quote it to ensure that no characters in the path are interpreted as meta characters, i.e., surround with \Q\E. That just all seems much more complex than just using same repository predicate.

Remember that you can always look at other setups and that Ctrl-F works for finding things; the setup editor you have open will generally have all setups in it. Use the toolbar button "Show all resources" to see them and then search them.
Re: Using the Git clone location to build working sets [message #1817089 is a reply to message #1817071] Fri, 15 November 2019 05:41 Go to previous messageGo to next message
Eclipse UserFriend
> Why not just use the same repository predicate?

I only see the Repository predicate (see screenshot). AFAICS this predicate requires that I configure another project from the repo as reference If I want to add several Git repos to my workspace setup that is a lot of maintenance. and as the project may change over time, time consuming to maintain.

As Project Import can use the Git repos as reference, I hope that Working Sets can use the same.

Or maybe I misunderstood you and I oversee a easy solution.

> Remember that you can always look at other setups and that Ctrl-F works for finding things;

I looked at the Platform Project Setup https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/interim/Platform.setup and it also uses the approach to specify a project.
  • Attachment: oomph.png
    (Size: 118.24KB, Downloaded 104 times)
Re: Using the Git clone location to build working sets [message #1817093 is a reply to message #1817089] Fri, 15 November 2019 07:39 Go to previous messageGo to next message
Eclipse UserFriend
Yes, a Repository predicate requires a project. I don't imagine any project disappears regularly that this is actually a high maintenance effort. And yes, I know the Platform Setup uses it---I authored it after all---but it uses that in combination with a Repository predicate and uses a simple pattern based on the folder structure within the repository, not the full location of the clone.

In any case, I did answer your question. Perhaps not explicitly enough? The value must be a pattern and that pattern must use / not \ as the separator so I expect that \Q${git.clone.dartboard.location|path}\E.* will work.

Re: Using the Git clone location to build working sets [message #1817109 is a reply to message #1817093] Fri, 15 November 2019 10:05 Go to previous message
Eclipse UserFriend
> The value must be a pattern and that pattern must use / not \ as the separator so I expect that \Q${git.clone.dartboard.location|path}\E.* will work.

Thanks, that works fine and IMHO is a nice way of setting up working sets.

Thanks again, Lars

[Updated on: Thu, 09 January 2020 09:28] by Moderator

Previous Topic:Working Set rule for all repositories
Next Topic:Using Variables in project setup files
Goto Forum:
  


Current Time: Wed Jul 23 21:11:23 EDT 2025

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

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

Back to the top