1+ import com.android.build.gradle.internal.api.BaseVariantOutputImpl
2+ import io.gitlab.arturbosch.detekt.Detekt
13import org.gradle.api.tasks.testing.logging.TestExceptionFormat
24import org.gradle.api.tasks.testing.logging.TestLogEvent
35import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
@@ -156,7 +158,7 @@ android {
156158 applicationVariants.all {
157159 val variant = this
158160 outputs
159- .map { it as com.android.build.gradle.internal.api. BaseVariantOutputImpl }
161+ .map { it as BaseVariantOutputImpl }
160162 .forEach { output ->
161163 val apkName = " bitkit-android-${defaultConfig.versionCode} -${variant.name} .apk"
162164 output.outputFileName = apkName
@@ -172,17 +174,6 @@ composeCompiler {
172174 reportsDestination = layout.buildDirectory.dir(" compose_compiler" )
173175}
174176
175- tasks.withType< io.gitlab.arturbosch.detekt.Detekt > ().configureEach {
176- ignoreFailures = true
177- reports {
178- html.required.set(true )
179- sarif.required.set(true )
180- md.required.set(false )
181- txt.required.set(false )
182- xml.required.set(false )
183- }
184- }
185-
186177dependencies {
187178 implementation(fileTree(" libs" ) { include(" *.aar" ) })
188179 implementation(libs.jna) { artifact { type = " aar" } }
@@ -284,6 +275,19 @@ room {
284275 schemaDirectory(" $projectDir /schemas" )
285276}
286277
278+ // region Tasks
279+
280+ tasks.withType<Detekt >().configureEach {
281+ ignoreFailures = true
282+ reports {
283+ html.required.set(true )
284+ sarif.required.set(true )
285+ md.required.set(false )
286+ txt.required.set(false )
287+ xml.required.set(false )
288+ }
289+ }
290+
287291tasks.withType<Test > {
288292 testLogging {
289293 events(
@@ -300,3 +304,12 @@ tasks.withType<Test> {
300304 showStackTraces = true
301305 }
302306}
307+
308+ // JDK 21+ prints warnings when ByteBuddy loads a dynamic Java agent during tests.
309+ // Our test stack triggers this automatically.
310+ // Explicitly enabling dynamic agent loading silences the warning without altering behavior.
311+ tasks.withType<Test >().configureEach {
312+ jvmArgs(" -XX:+EnableDynamicAgentLoading" )
313+ }
314+
315+ // endregion
0 commit comments