Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of multiple conditions #1536

Closed
Vince1171 opened this issue Nov 13, 2020 · 3 comments · Fixed by #1576
Closed

Support of multiple conditions #1536

Vince1171 opened this issue Nov 13, 2020 · 3 comments · Fixed by #1576
Assignees
Labels
enhancement a new feature or an improvement of existing functionality

Comments

@Vince1171
Copy link
Member

It'd be wonderful to be able to have multiple conditions in an array
something like that

{
    "type": "adb:sideload",
    "condition": [
       {"var": "gapps", "value": true},
       {"var": "LineageVersion", "value": "16"}
    ],
    "file": "open_gapps-arm64-9.0-nano-20200615.zip",
    "group": "OpenGApps"
},
{
   "type": "adb:sideload",
   "condition": [
      {"var": "gapps", "value": true},
      {"var": "LineageVersion", "value": "17"}
   ],
    "file": "open_gapps-arm64-10.0-nano-20200615.zip",
    "group": "OpenGApps"
}
@NeoTheThird NeoTheThird added the enhancement a new feature or an improvement of existing functionality label Nov 13, 2020
@NeoTheThird
Copy link
Member

I've thought about this a little already, the problem is that to be really flexible enough, you would need to be able to include both and and or operators and maybe even nested expressions. We might be able to steal some ideas from OPEN-CUTS' combination filtering language and support all boolean expressions:

image

some tweaks will be needed, since we don't need a first-order logic but just boolean algebra, but it should be doable.

@NeoTheThird
Copy link
Member

NeoTheThird commented Nov 24, 2020

How about the following structure for v2?

AND:
  - var: "a"
    value: true
  - OR:
      - var: "b"
        value: 1
      - var: "b"
        value: 2
  - NOT:
      var: "c"
      value: 1337

This would be equivalent to
image

This allows all of algebra expression. We can add more syntax sugar down the road for convenience.

@Vince1171
Copy link
Member Author

LGTM :D
It's an "easy to use, but powerful" syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a new feature or an improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants