gkd-kit/gkd

[Feature] 希望增加版本代码比较功能

Opened this issue · 2 comments

新功能描述

希望能在规则中增加版本代码比较功能(因为版本代码是纯数字,感觉可以使用整型的比较功能),可以在rules中通过maxVersionCodeminVersionCode或类似的字段来创建启用该规则的区间,只存在一个字段时范围为[0,max]或[min,+∞)这样的,两个字段同时存在应该就是[min,max]这样的。

跟原有的includeVersionCodesexcludeVersionCodes的同时存在时什么字段生效或许需要进一步讨论。

以下列出两种想法:

  1. include仅在区间外属于有效字段,exclude仅在区间内属于有效字段
  2. include直接失效,exclude仅在区间内属于有效字段

这样应该能满足匹配需求了吧

  // exclude > include > minimum/maximum
  versionCode?: {
    minimum?: Integer;
    maximum?: Integer;
    include?: IArray<Integer>;
    exclude?: IArray<Integer>;
  };
  // exclude > include > pattern
  versionName?: {
    pattern?: string;
    include?: IArray<string>;
    exclude?: IArray<string>;
  };

优先级:范围越小优先级越高,排除匹配>正常匹配

看起来可以了,感谢