From 5c4a3aeb387f26dd66ed12f23164f5dd9b69f5eb Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 23 Nov 2022 15:15:14 +0000 Subject: [PATCH] [build] Support '~' in disabling build targets. e.g. '~others' --- buildSrc/src/main/kotlin/HmppConfigure.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/buildSrc/src/main/kotlin/HmppConfigure.kt b/buildSrc/src/main/kotlin/HmppConfigure.kt index 77df7313c..13d268359 100644 --- a/buildSrc/src/main/kotlin/HmppConfigure.kt +++ b/buildSrc/src/main/kotlin/HmppConfigure.kt @@ -101,12 +101,16 @@ fun isTargetEnabled(name: String): Boolean { return when { name in ENABLED_TARGETS -> true // explicitly enabled "!$name" in ENABLED_TARGETS -> false // explicitly disabled + "~$name" in ENABLED_TARGETS -> false // explicitly disabled "native" in ENABLED_TARGETS && isNative -> true // native targets explicitly enabled "!native" in ENABLED_TARGETS && isNative -> false // native targets explicitly disabled + "~native" in ENABLED_TARGETS && isNative -> false // native targets explicitly disabled "!other" in ENABLED_TARGETS -> false // others disabled + "~other" in ENABLED_TARGETS -> false // others disabled "!others" in ENABLED_TARGETS -> false // others disabled + "~others" in ENABLED_TARGETS -> false // others disabled else -> true } }