io.opentelemetry.javaagent.muzzle.MuzzleExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-plugins Show documentation
Show all versions of gradle-plugins Show documentation
Gradle plugins to assist developing OpenTelemetry instrumentation
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.javaagent.muzzle
import org.gradle.api.Action
import org.gradle.api.model.ObjectFactory
import org.gradle.api.provider.ListProperty
import javax.inject.Inject
abstract class MuzzleExtension @Inject constructor(private val objectFactory: ObjectFactory) {
internal abstract val directives: ListProperty
fun pass(action: Action) {
val pass = objectFactory.newInstance(MuzzleDirective::class.java)
action.execute(pass)
pass.assertPass.set(true)
directives.add(pass)
}
fun fail(action: Action) {
val fail = objectFactory.newInstance(MuzzleDirective::class.java)
action.execute(fail)
fail.assertPass.set(false)
directives.add(fail)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy