use of org.gradle.api.artifacts.Dependency in project gradle-apt-plugin by tbroyer.
the class AptPlugin method createAptConfiguration.
private void createAptConfiguration(final Project project, SourceSet sourceSet, AptSourceSetConvention convention, final Configuration annotationProcessorConfiguration) {
final Configuration aptConfiguration = project.getConfigurations().create(convention.getAptConfigurationName());
aptConfiguration.setVisible(false);
aptConfiguration.setDescription("Processor path for " + sourceSet.getName() + ". Deprecated, please use the " + annotationProcessorConfiguration.getName() + " configuration instead.");
aptConfiguration.getDependencies().whenObjectAdded(new Action<Dependency>() {
@Override
public void execute(Dependency dependency) {
DeprecationLogger.nagUserWith(project, "The " + aptConfiguration.getName() + " configuration has been deprecated. Please use the " + annotationProcessorConfiguration.getName() + " configuration instead.");
}
});
annotationProcessorConfiguration.extendsFrom(aptConfiguration);
}
use of org.gradle.api.artifacts.Dependency in project checkstyle-idea by jshiell.
the class CsaccessTestTask method getClasspath.
/**
* Overriding getClasspath() in order to set the final classpath is an unusual solution, but it was the only
* solution which included the classpath entries generated by the IntelliJ plugin creation plugin (which, in my
* humble opinion, should be considered seriously broken).
*
* @return the classpath to use to execute the tests
*/
@Override
public FileCollection getClasspath() {
final FileCollection originalClasspath = super.getClasspath();
FileCollection effectiveClasspath = null;
if (originalClasspath != null) {
final Project project = getProject();
final JavaPluginExtension jpc = project.getExtensions().getByType(JavaPluginExtension.class);
final SourceSetContainer sourceSets = jpc.getSourceSets();
final SourceSet mainSourceSet = sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME);
final SourceSet testSourceSet = sourceSets.getByName(SourceSet.TEST_SOURCE_SET_NAME);
final SourceSet csaccessSourceSet = sourceSets.getByName(CustomSourceSetCreator.CSACCESS_SOURCESET_NAME);
final SourceSet csaccessTestSrcSet = sourceSets.getByName(CustomSourceSetCreator.CSACCESSTEST_SOURCESET_NAME);
final Dependency csDep = CheckstyleVersions.createCheckstyleDependency(project, csVersion);
final ConfigurationContainer configurations = project.getConfigurations();
final Set<File> csJars = configurations.detachedConfiguration(csDep).getFiles();
effectiveClasspath = project.files(csaccessTestSrcSet.getOutput().getResourcesDir(), csaccessSourceSet.getOutput().getResourcesDir(), mainSourceSet.getOutput().getResourcesDir()).plus(csaccessTestSrcSet.getOutput().getClassesDirs()).plus(csaccessSourceSet.getOutput().getClassesDirs()).plus(mainSourceSet.getOutput().getClassesDirs()).plus(project.files(csJars)).plus(originalClasspath).minus(testSourceSet.getOutput().getClassesDirs()).minus(project.files(testSourceSet.getOutput().getResourcesDir()));
if (getLogger().isDebugEnabled()) {
getLogger().debug("--------------------------------------------------------------------------");
getLogger().debug("Effective classpath of " + getName() + ":");
for (File f : effectiveClasspath) {
getLogger().debug("\t- " + f.getAbsolutePath());
}
}
}
return effectiveClasspath;
}
use of org.gradle.api.artifacts.Dependency in project checkstyle-idea by jshiell.
the class GatherCheckstyleArtifactsTask method resolveDependencies.
private Set<File> resolveDependencies(final Project project, final String checkstyleVersion) {
final Dependency csDep = CheckstyleVersions.createCheckstyleDependency(project, checkstyleVersion);
final Configuration csConf = project.getConfigurations().detachedConfiguration(csDep);
return csConf.resolve();
}
Aggregations