-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configuration to suppress name collision warnings.
- Loading branch information
1 parent
db900c8
commit 6933427
Showing
4 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
Submodule acceptance-tests
updated
from 649ca5 to 4aa51d
12 changes: 12 additions & 0 deletions
12
...s/src/commonMain/kotlin/co/touchlab/skie/configuration/annotations/SuppressSkieWarning.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package co.touchlab.skie.configuration.annotations | ||
|
||
@Target | ||
annotation class SuppressSkieWarning { | ||
|
||
/** | ||
* Suppresses a warning about SKIE renaming a declaration because of a name collision. | ||
*/ | ||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.CONSTRUCTOR) | ||
@Retention(AnnotationRetention.BINARY) | ||
annotation class NameCollision(val suppress: Boolean = true) | ||
} |
19 changes: 19 additions & 0 deletions
19
...n/declaration/src/commonMain/kotlin/co/touchlab/skie/configuration/SuppressSkieWarning.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package co.touchlab.skie.configuration | ||
|
||
import co.touchlab.skie.configuration.annotations.SuppressSkieWarning | ||
|
||
object SuppressSkieWarning { | ||
|
||
/** | ||
* If true, SKIE will not raise a warning that it renamed the given declaration because of a name collision. | ||
*/ | ||
object NameCollision : ConfigurationKey.Boolean { | ||
|
||
override val defaultValue: Boolean = false | ||
|
||
override val skieRuntimeValue: Boolean = false | ||
|
||
override fun getAnnotationValue(configurationTarget: ConfigurationTarget): Boolean? = | ||
configurationTarget.findAnnotation<SuppressSkieWarning.NameCollision>()?.suppress | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters