Class ImportJUnitXmlReports
- java.lang.Object
-
- org.gradle.api.internal.AbstractTask
-
- org.gradle.api.DefaultTask
-
- com.gradle.develocity.agent.gradle.test.ImportJUnitXmlReports
-
- All Implemented Interfaces:
java.lang.Comparable<Task>
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.TaskInternal
,Named
,ExtensionAware
,Task
,Configurable<Task>
public abstract class ImportJUnitXmlReports extends DefaultTask
Imports JUnit XML reports into the build's Develocity build scan.- Since:
- 3.17
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Logger
LOGGER
-
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
-
-
Constructor Summary
Constructors Constructor Description ImportJUnitXmlReports(org.gradle.internal.operations.BuildOperationListenerManager listenerManager, org.gradle.internal.scan.time.BuildScanClock clock, ObjectFactory objectFactory, Gradle gradle)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Property<JUnitXmlDialect>
getDialect()
Configures the JUnit XML dialect.@Nullable Property<Task>
getReferenceTask()
The reference task to which the tests should be attributed.abstract Property<java.lang.String>
getReferenceTaskBuildPath()
abstract Property<java.lang.String>
getReferenceTaskTaskPath()
abstract ConfigurableFileCollection
getReports()
The JUnit XML report files that should be imported.static TaskProvider<ImportJUnitXmlReports>
register(TaskContainer tasks, TaskProvider<?> testTask, JUnitXmlDialect dialect)
Helper method to lazily register and configure an import task.-
Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
-
Methods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
-
-
-
Constructor Detail
-
ImportJUnitXmlReports
@Inject public ImportJUnitXmlReports(org.gradle.internal.operations.BuildOperationListenerManager listenerManager, org.gradle.internal.scan.time.BuildScanClock clock, ObjectFactory objectFactory, Gradle gradle)
-
-
Method Detail
-
getDialect
@Input public abstract Property<JUnitXmlDialect> getDialect()
Configures the JUnit XML dialect.- See Also:
JUnitXmlDialect
-
getReports
@Internal public abstract ConfigurableFileCollection getReports()
The JUnit XML report files that should be imported.
-
getReferenceTask
@Internal @Nullable public @Nullable Property<Task> getReferenceTask()
The reference task to which the tests should be attributed.Can be omitted, in which case the tests will be attributed to the import task.
-
getReferenceTaskBuildPath
@Internal public abstract Property<java.lang.String> getReferenceTaskBuildPath()
-
getReferenceTaskTaskPath
@Internal public abstract Property<java.lang.String> getReferenceTaskTaskPath()
-
register
public static TaskProvider<ImportJUnitXmlReports> register(TaskContainer tasks, TaskProvider<?> testTask, JUnitXmlDialect dialect)
Helper method to lazily register and configure an import task.afterEvaluate { ImportJUnitXmlReports.register(tasks, tasks.named("connectedDebugAndroidTest"), com.gradle.scan.plugin.test.JUnitXmlDialect.ANDROID_CONNECTED) }
Or if the given task doesn't declare the outputs automatically, we can specify the reports explicitly, for example:
afterEvaluate { ImportJUnitXmlReports.register(tasks, tasks.named("execFlank"), com.gradle.scan.plugin.test.JUnitXmlDialect.ANDROID_FIREBASE) .configure { reports.from(file("${buildDir}/fladle/outputs/JUnitReport.xml")) } }
The resulting task uses the name of the supplied
testTask
appended with the "ImportJUnitXmlReports" suffix, will scan its output files for JUnit XML reports, and run as one of its finalizer tasks.- Parameters:
tasks
- the gradle task container, i.e.,project.tasks
testTask
- the task that produces the JUnit XML, the tests will also be attributed to this taskdialect
- the dialect of the JUnit XML, seeJUnitXmlDialect
for more information.- Returns:
- the task provider, can be used to manually set the report files for tasks that don't declare outputs.
-
-