use of org.gradle.plugin.devel.tasks.PluginUnderTestMetadata in project gradle by gradle.
the class JavaGradlePluginPlugin method configureTestKit.
private void configureTestKit(Project project, GradlePluginDevelopmentExtension extension) {
PluginUnderTestMetadata pluginUnderTestMetadataTask = createAndConfigurePluginUnderTestMetadataTask(project, extension);
establishTestKitAndPluginClasspathDependencies(project, extension, pluginUnderTestMetadataTask);
}
use of org.gradle.plugin.devel.tasks.PluginUnderTestMetadata in project gradle by gradle.
the class JavaGradlePluginPlugin method createAndConfigurePluginUnderTestMetadataTask.
private PluginUnderTestMetadata createAndConfigurePluginUnderTestMetadataTask(final Project project, final GradlePluginDevelopmentExtension extension) {
final PluginUnderTestMetadata pluginUnderTestMetadataTask = project.getTasks().create(PLUGIN_UNDER_TEST_METADATA_TASK_NAME, PluginUnderTestMetadata.class);
pluginUnderTestMetadataTask.setGroup(PLUGIN_DEVELOPMENT_GROUP);
pluginUnderTestMetadataTask.setDescription(PLUGIN_UNDER_TEST_METADATA_TASK_DESCRIPTION);
final Configuration gradlePluginConfiguration = project.getConfigurations().detachedConfiguration(project.getDependencies().gradleApi());
ConventionMapping conventionMapping = new DslObject(pluginUnderTestMetadataTask).getConventionMapping();
conventionMapping.map("pluginClasspath", new Callable<Object>() {
public Object call() {
FileCollection gradleApi = gradlePluginConfiguration.getIncoming().getFiles();
return extension.getPluginSourceSet().getRuntimeClasspath().minus(gradleApi);
}
});
conventionMapping.map("outputDirectory", new Callable<Object>() {
public Object call() {
return new File(project.getBuildDir(), pluginUnderTestMetadataTask.getName());
}
});
return pluginUnderTestMetadataTask;
}
Aggregations