This release brings Linux and Android support, a much richer rule composition vocabulary, new recency/cooldown conditions, and finer-grained trigger throttling — plus rule introspection APIs and documentation improvements.
⚠️ Breaking changes
- Dropped support for Swift 5.9 and 5.10. RuleKit now requires Swift 6.0+ (Xcode 16+).
🐧 Linux & Android support
RuleKit was previously Apple-only. It now builds and runs on Linux and Android (#2):
- Replaced
OSLogwith swift-log — RuleKit's first dependency. - Triggers now fire on the main actor by default instead of
DispatchQueue.main(an explicit.dispatchQueue(_)option is still honored), avoiding hangs on platforms without a drained main queue. Behavior is unchanged on Apple platforms. .groupContaineris gated to Apple platforms; use.url(_)elsewhere.
✨ Rule composition
&&and||operators to compose rules, as shorthands for.allOf([...])and.anyOf([...])..not(_:)and the!prefix operator to negate a rule, completing the logic alongside.allOf/.anyOf.noneOf(_:)— fulfilled when none of the given rules are, the complement ofanyOf.atLeast(_:of:)— a k-of-n quorum rule that can't be expressed cleanly withallOf/anyOfalone..alwaysand.neverconstant rules, useful as placeholders or for conditional composition.
⏱️ Recency & cooldown rules
event(_:donatedWithin:)andevent(_:notDonatedFor:)— time-window conditions on an event's last donation (recency and cooldowns), taking aTimeIntervalin seconds.event(_:atLeast:)shorthand for the common "donated at least N times" condition.timeSinceFirst/timeSinceLastcomputed properties onEvent.Donations.Donations.firstSeenInCurrentVersion— whether an event's first donation happened in the current app version (replacing the hand-writtenappVersioncomparison from the README).
🔁 Trigger frequency
- Added
.every(_:count:)toTriggerFrequencyOption.Frequency, allowing throttle windows like "every 7 days" instead of only fixed calendar cases.
🛠️ API ergonomics & introspection
setRulenow accepts variadic options and a trailing-closure ruleset, so a single option no longer needs to be wrapped in an array (array-based overloads remain for source compatibility).registeredRuleNamesandisRuleRegistered(named:)— read-only APIs to list registered rule identifiers (in registration order) and check membership, keyed by the same name asremoveRule(named:).
📚 Documentation
- Added DocC documentation and improved the README.
Full changelog: 0.5.5...0.6.0