Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 21:35 Go to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

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 06:37 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
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.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using the Git clone location to build working sets [message #1817089 is a reply to message #1817071] Fri, 15 November 2019 10:41 Go to previous messageGo to next message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

> 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 78 times)
Re: Using the Git clone location to build working sets [message #1817093 is a reply to message #1817089] Fri, 15 November 2019 12:39 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
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.



Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using the Git clone location to build working sets [message #1817109 is a reply to message #1817093] Fri, 15 November 2019 15:05 Go to previous message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

> 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 14:28]

Report message to a moderator

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


Current Time: Thu Apr 25 02:31:33 GMT 2024

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

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

Back to the top