Back to Monkey.jungle ... for a single device

Hi,

I've been struggling with this one as I cannot find the right syntax to be practicable.

Essentially, I want to be able to find a monkey.jungle excludeAnnotation syntax that will allow me to distinguish between low memory / limited devices and high memory / more capable devices. For example; semiround-215x180 contains four watches of which three are CIQ 1 and only one is CIQ 2 (735xt).

The brute force approach would be to have:

fr230.excludeAnnotations=ciq2plus
fr235.excludeAnnotations=ciq2plus
fr630.excludeAnnotations=ciq2plus
fr735xt.excludeAnnotations=ciq1

Which is all well and good... but... there are masses of devices. And there will be more.

There doesn't seem to be a good way to separate on the larger groups, either. The example above has four semiround-215x180 devices of which only three are what I want to filter. There are similar overlaps with other devices.

Is there some kind of precedence I can use for this?

EG: Can I say that in general semiround-215x180 is ciq 1, but override specifically for 735? EG:

# Exclude 2 plus code for three semiround-215x180
semiround-215x180.excludeAnnotations = ciq2plus
# But include it for 735xt (which is _ALSO_ semiround-215x180
semiround-215x180.excludeAnnotations = ciq1
 

Or am I stuck with either separate codebase for the older operating devices or simply a massive and ever changing list of declarations in my monkey.jungle?

  • Ouch!

    The discussion may be moot in any case; does ciq1 even support annotation?

  • Yep, ciq1 supports annotations. Excluding code based on annotations is implemented at build time, not run time.

    And yep, you need to list *all* the devices which are exceptions to your default rule.

    The only way to mitigate the pain is to set "base.excludeAnnotations" such that it covers the largest group of devices you want to support, or your "default" implementation. In your case hopefully you can set one default that covers everything past CIQ 1, so the only devices you have to list explicitly are CIQ 1 devices (that list should never change).

    You may still end up having a huge jungle file, and/or maintenance headaches whenever new devices are released.

    For example, I have a datafield app which has varying exclusions / source paths / resource paths based on several dimensions:

    - CIQ 1 vs CIQ 2+

    - "small memory" vs "medium memory" vs. "large memory"

    - screen shape / resolution

    - device font family

    My jungle file is 200 lines long.

    (I use varying source paths because I have a way of conditionally including/excluding code in a way that saves a bit more memory than barrels or annotations)

  • To address your example:

    # Exclude 2 plus code for three semiround-215x180
    semiround-215x180.excludeAnnotations = ciq2plus
    # But include it for 735xt (which is _ALSO_ semiround-215x180
    semiround-215x180.excludeAnnotations = ciq1

    You can do something like

    # Define a variable to store common excludes for ALL 215x180 watches
    
    semiround_215x180_common_excludes = example1;example2
    
    semiround-215x180.excludeAnnotations = ciq2plus;$(semiround_215x180_common_excludes)
    
    fr735xt.excludeAnnotations = ciq1;$(semiround_215x180_common_excludes)
    
    

    The way "precedence" works is that the most *specific* excludeAnnotation for your device will be used.