Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » How to exclude folders on project import
How to exclude folders on project import [message #1737924] Thu, 14 July 2016 08:32 Go to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 209
Registered: July 2009
Location: Graz, Austria
Senior Member
I was trying to setup a project import task where some subfolders should not be imported.

  <setupTask
      xsi:type="projects:ProjectsImportTask">
    <sourceLocator
        rootFolder="${ease.git.clone.core.location}">
      <excludedPath>${ease.git.clone.core.location/developers}</excludedPath>
    </sourceLocator>
  </setupTask>


I was also trying regexp as exclude pattern ".*developers.*, but whatever I enter, projects from those folders still get imported. While I could setup import tasks on subfolder level I would love to use the more general approach with exclude patterns. Could you explain how this works?

thanks
Christian
Re: How to exclude folders on project import [message #1737939 is a reply to message #1737924] Thu, 14 July 2016 09:20 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6498
Registered: July 2009
Senior Member
Hi Christian,

IIRC. the excludedPath must not be patterns, but rather paths *relative* to the rootFolder.

Cheers
/Eike

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



Am 14.07.2016 um 11:32 schrieb Christian Pontesegger:
> I was trying to setup a project import task where some subfolders should not be imported.
>
>
> <setupTask
> xsi:type="projects:ProjectsImportTask">
> <sourceLocator
> rootFolder="${ease.git.clone.core.location}">
> <excludedPath>${ease.git.clone.core.location/developers}</excludedPath>
> </sourceLocator>
> </setupTask>
>
>
> I was also trying regexp as exclude pattern ".*developers.*, but whatever I enter, projects from those folders still
> get imported. While I could setup import tasks on subfolder level I would love to use the more general approach with
> exclude patterns. Could you explain how this works?
>
> thanks
> Christian


Re: How to exclude folders on project import [message #1774787 is a reply to message #1737939] Thu, 19 October 2017 15:20 Go to previous messageGo to next message
Kurt Smolderen is currently offline Kurt SmolderenFriend
Messages: 3
Registered: October 2016
Junior Member
Stumbled upon this thread when looking for a solution as I can't get this to work.My maven import task looks like:
<setupTask
    xsi:type="maven:MavenImportTask"
    projectNameTemplate="">
  <sourceLocator
      rootFolder="${git.clone.projects.location}"
      locateNestedProjects="true">
    <excludedPath>project1-ignore</excludedPath>
    <excludedPath>project2-ignore</excludedPath>
  </sourceLocator>
</setupTask>


but both projects are imported while being a direct subdirectory of the git.clone.projects.location. What would be the correct format?

Regards
Kurt
Re: How to exclude folders on project import [message #1774790 is a reply to message #1774787] Thu, 19 October 2017 15:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31163
Registered: July 2009
Senior Member
It looks okay. It's used by org.eclipse.oomph.resources.impl.ProjectFactoryImpl.isExcludedPath(BackendContainer, BackendContainer) It looks like this one from Equinox.setup:
<?xml version="1.0" encoding="UTF-8"?>
<resources:SourceLocator
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:resources="http://www.eclipse.org/oomph/resources/1.0"
    xsi:schemaLocation="http://www.eclipse.org/oomph/resources/1.0 http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/models/Resources.ecore"
    rootFolder="${git.clone.equinox.p2.location}">
  <excludedPath>org.eclipse.equinox.p2.releng.buckminster</excludedPath>
  <excludedPath>bundles/org.eclipse.equinox.p2.testserver</excludedPath>
</resources:SourceLocator>

Failing that, you could instead create predicates (such as one that matches any project that doesn't have ignore in the name)...
Re: How to exclude folders on project import [message #1823854 is a reply to message #1774790] Fri, 03 April 2020 05:08 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 340
Registered: December 2015
Senior Member
I highjack this, because I have a very similar issue. I want to exclude everything from a given subfolder and its children. None of the available filters are useful for that:

* Excluded Paths have to list individual projects
* NamePredicate has no path information
* LocationPredicate gives me headaches: It checks against the full filesystem path of the project, converting \ to / on windows. To match the full path, I need to use ${git.clone.project.location}, but that still contains \ characters. I dont know if there's a filter, so that I can replace \ by / in ${git.clone.project.location}. Otherwise I won't ever match anything.

Maybe there is still a way to do this?
Thanks,
Felix



Re: How to exclude folders on project import [message #1823855 is a reply to message #1823854] Fri, 03 April 2020 06:30 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31163
Registered: July 2009
Senior Member
This filter isn't particularly well described:
    registerFilter(new DocumentedStringFilter()
    {
      public String getName()
      {
        return "path";
      }

      @Override
      public String getDescription()
      {
        return "Extracts the path segments from a URI.";
      }

      public String filter(String value)
      {
        return value.replaceAll("\\\\", "/");
      }
    });
But it's clear that it just replaces \ with / in whatever the string happens to be, and given that a URI will generally not contain \, and that this is typically used with a file system path not a URI, the description is poor at best and arguably misleading.

So I fixed that via https://bugs.eclipse.org/bugs/show_bug.cgi?id=561720 and updated the wiki.
Re: How to exclude folders on project import [message #1823857 is a reply to message #1823855] Fri, 03 April 2020 07:08 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 340
Registered: December 2015
Senior Member
Okay thank you, this might work.
Re: How to exclude folders on project import [message #1823864 is a reply to message #1823857] Fri, 03 April 2020 08:35 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31163
Registered: July 2009
Senior Member
Have you tried the Excluded Paths on the Source Locator? This can specify a relative path (using /) that should be excluded.
Re: How to exclude folders on project import [message #1824054 is a reply to message #1823864] Tue, 07 April 2020 07:06 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 340
Registered: December 2015
Senior Member
I cannot use a pattern on excludedPaths, only full project paths. It would be good if excluded paths would be a pattern match instead.
Re: How to exclude folders on project import [message #1824061 is a reply to message #1824054] Tue, 07 April 2020 08:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31163
Registered: July 2009
Senior Member
I thought maybe they would all be under one folder in the repo so you could exclude that folder and everything under it. But given I don't know anything about your structure, I can't actually offer advice on the simplest approach to filter certain projects. Your question seems to imply there is some pattern to be recognized via the folder structure...
Re: How to exclude folders on project import [message #1824084 is a reply to message #1824061] Tue, 07 April 2020 15:50 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 340
Registered: December 2015
Senior Member
Well that is exactly the case. I have a folder, and I want to exclude everything under it. Turns out.. I used my/external/folder/. You suggest that this must work so I tried without the trailing / and yes, that works. I was sort of biased, since 2 others in this thread said: it doesnt work, and the paths in your example above with the equinox.setup look like project paths, not some subfolders, so yes.. look at that fool. Wouldnt "some/path" and "some/path/" be equivalent here? What I mean is, that maybe trailing segments could be removed when the check is performed, so that both cases would work and do the expected?



Re: How to exclude folders on project import [message #1824103 is a reply to message #1824084] Wed, 08 April 2020 04:11 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31163
Registered: July 2009
Senior Member
I think you are suggesting that in https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.resources/src/org/eclipse/oomph/resources/impl/SourceLocatorImpl.java#n567 it should strip a trailing / just as it currently strips a leading / so that this methods works properly in either case and does not currently work properly (at all) when there is a trailing /:

https://git.eclipse.org/c/oomph/org.eclipse.oomph.git/tree/plugins/org.eclipse.oomph.resources/src/org/eclipse/oomph/resources/impl/SourceLocatorImpl.java#n622

Is that correct?
Re: How to exclude folders on project import [message #1824117 is a reply to message #1824103] Wed, 08 April 2020 08:17 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 340
Registered: December 2015
Senior Member
That is exactly what I am suggesting, yes.
Re: How to exclude folders on project import [message #1824120 is a reply to message #1824117] Wed, 08 April 2020 09:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31163
Registered: July 2009
Senior Member
Please open a Bugzilla. You could even fix it yourself:

https://www.eclipse.org/setups/installer/?url=http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/configurations/OomphConfiguration.setup&show=true
Previous Topic:Lock git repo url via configuration
Next Topic:Follow references in P2 task
Goto Forum:
  


Current Time: Fri Jun 05 20:32:02 GMT 2020

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

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

Back to the top