-
-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rewrite the implementation into Kotlin (#924)
Translate codes in `src/main/groovy` into Kotlin. BREAKING CHANGE: This plugin has been rewritten in Kotlin, and it may break the binary compatibility of public API. Intentional changes are listed as follows: ### Changes for Groovy buildscripts About `effort` and `reportLevel` properties of `SpotBugsTask` and `SpotBugsExtension`, Groovy buildscripts should use use `valueOf(String)` method explicitly. This limitation is caused by a [known issue of the Groovy language](https://discuss.kotlinlang.org/t/bug-cannot-use-kotlin-enum-from-groovy/1521): ```groovy // before (v5) spotbugs { effort = 'default' reportLevel = 'default' } // after (v6) spotbugs { effort = Effort.valueOf('DEFAULT') reportLevel = Confidence.valueOf('DEFAULT') } ``` ### Changes for Kotlin buildscripts It is recommended to use Gradle 8.2 or later, then you can enjoy the [simple property assignment](https://docs.gradle.org/8.2/release-notes.html#simple-property-assignment-in-kotlin-dsl-enabled-by-default) feature by default: ```kotlin // legacy (Gradle 8.1 and older) import com.github.spotbugs.snom.Confidence import com.github.spotbugs.snom.Effort spotbugs { effort.set(Effort.DEFAULT) reportLevel.set(Confidence.DEFAULT) } // new (Gradle 8.2 and later) import com.github.spotbugs.snom.Confidence import com.github.spotbugs.snom.Effort spotbugs { effort = Effort.DEFAULT reportLevel = Confidence.DEFAULT } ``` It is also possible to use string values, however, it is not recommended due to lack of type-safety: ```kotlin // new (Gradle 8.2 and later) import com.github.spotbugs.snom.assign spotbugs { effort = "DEFAULT" reportLevel = "DEFAULT" } ```
- Loading branch information
Showing
58 changed files
with
2,040 additions
and
2,201 deletions.
There are no files selected for viewing
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.