How to exclude files and folders with Jungles?

Hello!
With Jungles, it's very clear how we can exclude annotations, but is it possible to exclude files and folders ?

According to the developer documentation, Build Exclusions & Jungles are compatible, but : "Build exclusions provide a lot of the same capabilities as Jungle files, and will eventually be removed in a future Connect IQ release. If used in combination with a Jungle file, build exclusions will continue to work, but a warning will be generated indicating that they have been deprecated."

I'm excluding files and folders using Build Exclusions and all is working fine (and I receive the proper warning :) ), but is there any "excludeFile" or "excludeDir" options for Jungles?

Thank you! :cool:
  • Hi Markus
    Have you an example of jungle file, because i can implemente in my developement.
    an example with f5.Ann....=oldversion ....

    Thank's

    Didier
  • Hi riedid74, excuse me, do you need an example of my current .jungle file and a part of the code ?

    My goal is to move a build exclusion file like the next one to a jungle file:

    <build>
    <exclude file="filename.mc"/>
    <exclude dir="source-excluded" />
    <exclude annotation="roundImpl"/>
    </build>


    It's ok for "exclude annotiation" to "[model].excludeAnnotations", but I don't know if it's possible to move the "exclude dir" part ... (I imagine that is still not possible ...).
  • in build i don't have problem in implement the exclude annotation but i can't make it in a jungle file. If you have an example in jungle format of a build file convertion. Thank's Didier
  • you can't exclude files and folders, jungles use an inclusive pattern for files and folders

    eg:
    fr735xt.sourcePath=$(fr735xt.sourcePath);sourcefolder1\source1.mc;sourcefolder1\source2.mc;sourcefolder2\*.mc


    I also had to twist my brains as it takes some time adjusting to including from excluding, but the inclusive pattern actually makes more sense (to me) now.

    to exclude annotations use this:
    fr735xt.excludeAnnotations=roundImpl
  • Thank you peterdedecker to show me the direction!!!! :):)

    I just post the solution I used for my monkey.jungle because it can help others.

    In my project, I have many folders on the top level, and this is why I want all my parts of code under the "source" folder, with some parts distributed in subfolders.
    I have a "trash" folder which contains some code that I don't want to be compiled.

    It's just for classes that I only need for testing purposes and when I need one of them, I move it to the "source" folder.

    Regarding the default.jungle file (included with the sdk), I adapted the monkey.jungle file in my project and now I can exclude the folder "source/trash" for all the devices this way:

    # Exclude "trash" folder

    base.sourcePath = source/*.mc; source/class/*.mc

  • I don't get it. I created folder on the same level as "source" dir, copied here class and immediately got error about duplicate classes. So from my testing I assuming that in base.sourcePath are all available *mc files in the project. So what is benefit of your first example with sourcefolder1? 

    I get the usage of resoucePath, where you can override resources definitions by specific order. But you can't do it with sourcePath definition - so why to use it? 

  • The problem is by default it looks for .mc files in general, so it's not just looking under source.

    Here's a part of a jungles file where I have source, with the common stuff, and two other dirs at the same level - one for breadcrumbs, one for the mapping api.

    srcBase=source
    resBase=resources
    
    base.sourcePath=$(srcBase);source-nomaps
    base.resourcePath=$(resBase)
    
    fenix5x.sourcePath = $(srcBase);source-maps
    fenix5x.resourcePath = $(resBase);resources-maps

    So, for the f5x, I use source-maps instead of souce-nomaps, and also use the resources for maps  (really only the markers I use) in addition to the base resources

  • Thank you Jim for your example. This usage has much more sense. I was previously worried to override base.sourcePath, but hey, I should know best what code should be used in my project. Slight smile

  • So, with this, everything but the f5x uses the breadcrumb code, and to add maps to other devices, I replicate the two lines for the f5x and change fenix5x to fenix5plus or whatever.