本文整理汇总了Java中org.gradle.api.reporting.ConfigurableReport类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableReport类的具体用法?Java ConfigurableReport怎么用?Java ConfigurableReport使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurableReport类属于org.gradle.api.reporting包,在下文中一共展示了ConfigurableReport类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: JacocoReportsContainerImpl
import org.gradle.api.reporting.ConfigurableReport; //导入依赖的package包/类
public JacocoReportsContainerImpl(Task task) {
super(ConfigurableReport.class, task);
add(TaskGeneratedSingleDirectoryReport.class, "html", task, "index.html");
add(TaskGeneratedSingleFileReport.class, "xml", task);
add(TaskGeneratedSingleFileReport.class, "csv", task);
}
示例2: DefaultTestTaskReports
import org.gradle.api.reporting.ConfigurableReport; //导入依赖的package包/类
public DefaultTestTaskReports(Task task) {
super(ConfigurableReport.class, task);
add(DefaultJUnitXmlReport.class, "junitXml", task);
add(TaskGeneratedSingleDirectoryReport.class, "html", task, "index.html");
}
示例3: createUnitTestTask
import org.gradle.api.reporting.ConfigurableReport; //导入依赖的package包/类
private void createUnitTestTask(@NonNull TaskFactory tasks,
@NonNull final TestVariantData variantData) {
final BaseVariantData testedVariantData =
(BaseVariantData) variantData.getTestedVariantData();
final Test runTestsTask = project.getTasks().create(
variantData.getScope().getTaskName(UNIT_TEST.getPrefix()),
Test.class);
runTestsTask.setGroup(JavaBasePlugin.VERIFICATION_GROUP);
runTestsTask.setDescription(
"Run unit tests for the " +
testedVariantData.getVariantConfiguration().getFullName() + " build.");
fixTestTaskSources(runTestsTask);
runTestsTask.dependsOn(variantData.assembleVariantTask);
final AbstractCompile testCompileTask = variantData.javacTask;
runTestsTask.setTestClassesDir(testCompileTask.getDestinationDir());
ConventionMappingHelper.map(runTestsTask, "classpath",
new Callable<ConfigurableFileCollection>() {
@Override
public ConfigurableFileCollection call() throws Exception {
Iterable<File> filteredBootClasspath = Iterables.filter(
androidBuilder.getBootClasspath(),
new Predicate<File>() {
@Override
public boolean apply(@Nullable File file) {
return file != null &&
!SdkConstants.FN_FRAMEWORK_LIBRARY
.equals(file.getName());
}
});
return project.files(
testCompileTask.getClasspath(),
testCompileTask.getOutputs().getFiles(),
variantData.processJavaResourcesTask.getOutputs(),
testedVariantData.processJavaResourcesTask.getOutputs(),
filteredBootClasspath,
// Mockable JAR is last, to make sure you can shadow the classes
// withdependencies.
createMockableJar.getOutputFile());
}
});
// Put the variant name in the report path, so that different testing tasks don't
// overwrite each other's reports.
TestTaskReports testTaskReports = runTestsTask.getReports();
for (ConfigurableReport report : new ConfigurableReport[] {
testTaskReports.getJunitXml(), testTaskReports.getHtml()}) {
report.setDestination(new File(report.getDestination(), testedVariantData.getName()));
}
tasks.named(JavaPlugin.TEST_TASK_NAME, new Action<Task>() {
@Override
public void execute(Task test) {
test.dependsOn(runTestsTask);
}
});
extension.getTestOptions().getUnitTests().applyConfiguration(runTestsTask);
}