Class ImportJUnitXmlReports
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.gradle.develocity.agent.gradle.test.ImportJUnitXmlReports
- All Implemented Interfaces:
Comparable<Task>
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.TaskInternal
,Named
,ExtensionAware
,Task
,Configurable<Task>
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
FieldsFields 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
ConstructorsConstructorDescriptionImportJUnitXmlReports
(org.gradle.internal.operations.BuildOperationListenerManager listenerManager, org.gradle.internal.scan.time.BuildScanClock clock, ObjectFactory objectFactory, Gradle gradle) -
Method Summary
Modifier and TypeMethodDescriptionabstract Property
<JUnitXmlDialect> Configures the JUnit XML dialect.The reference task to which the tests should be attributed.abstract ConfigurableFileCollection
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
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
ImportJUnitXmlReports
@Inject public ImportJUnitXmlReports(org.gradle.internal.operations.BuildOperationListenerManager listenerManager, org.gradle.internal.scan.time.BuildScanClock clock, ObjectFactory objectFactory, Gradle gradle)
-
-
Method Details
-
getDialect
Configures the JUnit XML dialect.- See Also:
-
getReports
The JUnit XML report files that should be imported. -
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
-
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.
-