Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: minor things #1052

Merged
merged 13 commits into from
Dec 3, 2023
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
9 changes: 5 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import io.gitlab.arturbosch.detekt.Detekt

plugins {
groovy
`java-gradle-plugin`
jacoco
signing
kotlin("jvm") version "1.9.21"
Expand All @@ -14,7 +15,7 @@ plugins {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion = JavaLanguageVersion.of(11)
}
}

Expand Down Expand Up @@ -44,7 +45,7 @@ signing {
}

tasks {
named<io.gitlab.arturbosch.detekt.Detekt>("detekt") {
named<Detekt>("detekt") {
reports {
sarif.required = true
}
Expand All @@ -61,7 +62,7 @@ tasks {
withType<Jar>().configureEach {
dependsOn(processResources)
}
named("javadoc") {
javadoc {
enabled = false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ plugins {
}

spotless {
groovy {
licenseHeaderFile(rootProject.file("gradle/HEADER.txt"))
target("**/*.groovy")
greclipse()
indentWithSpaces()
}
kotlin {
ktlint()
}
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx4g
org.gradle.parallel=true
org.gradle.caching=true
org.gradle.configuration-cache=true
12 changes: 9 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ pluginManagement {
}

plugins {
id("com.gradle.enterprise") version("3.15.1")
id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0")
id("com.gradle.enterprise") version "3.15.1"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

dependencyResolutionManagement {
repositories {
// To download the Android Gradle Plugin
google()
google {
content {
includeGroupByRegex(".*android.*")
}
}
// To download trove4j required by the Android Gradle Plugin
mavenCentral()
}
Expand All @@ -29,3 +33,5 @@ gradleEnterprise {
publishAlwaysIf(isCiBuild)
}
}

enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ class CacheabilityFunctionalTest extends BaseFunctionalTest {
*/
@IgnoreIf({
def current = System.getProperty('gradleVersion', GradleVersion.current().version)
return GradleVersion.version(current) < GradleVersion.version("8.1") })
return GradleVersion.version(current) < GradleVersion.version("8.1")
})
def 'spotbugsMain task runs with configuration cache'() {
given:
initializeBuildFile(rootDir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ public class Foo {

@IgnoreIf({
def current = System.getProperty('gradleVersion', GradleVersion.current().version)
return GradleVersion.version(current) < GradleVersion.version("8.2") })
return GradleVersion.version(current) < GradleVersion.version("8.2")
})
def "can set params to SpotBugsExtension"() {
setup:
buildFile << """
Expand Down Expand Up @@ -126,7 +127,8 @@ dependencies {

@IgnoreIf({
def current = System.getProperty('gradleVersion', GradleVersion.current().version)
return GradleVersion.version(current) < GradleVersion.version("8.2") })
return GradleVersion.version(current) < GradleVersion.version("8.2")
})
def "can generate spotbugs.html in configured outputLocation"() {
buildFile << """
tasks.spotbugsMain {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interface SpotBugsExtension {
/**
* Property to set the directory to generate report files. Default is `"$buildDir/reports/spotbugs"`.
*
* Note that each [SpotBugsTask] creates own sub-directory in this directory.
* Note that each [SpotBugsTask] creates own subdirectory in this directory.
*/
val reportsDir: DirectoryProperty

Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/com/github/spotbugs/snom/SpotBugsReport.kt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ abstract class SpotBugsReport
}
}

@Suppress("MemberVisibilityCanBePrivate")
fun configure(action: Action<in Report>): Report {
action.execute(this)
return this
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/github/spotbugs/snom/SpotBugsTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ abstract class SpotBugsTask : DefaultTask(), VerificationTask {
else -> throw InvalidUserDataException("$name is invalid as the report name")
}
}
setDescription("Run SpotBugs analysis.")
setGroup(JavaBasePlugin.VERIFICATION_GROUP)
description = "Run SpotBugs analysis."
group = JavaBasePlugin.VERIFICATION_GROUP
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import java.io.OutputStream
internal class OutputScanner(out: OutputStream) : FilterOutputStream(out) {
private val builder = ByteArrayOutputStream()
var isFailedToReport = false
get() = field

override fun write(
b: ByteArray,
Expand Down