I have the following task, which is never up-to-date:
@CacheableTask
public abstract class VerifyDependenciesTask extends DefaultTask {
private final Property<Configuration> runtimeDependencies;
...
@Inject
public VerifyDependenciesTask(ExtensionDescriptor config) {
final JavaPluginExtension javaPluginExtension = getProject().getExtensions().getByType( JavaPluginExtension.class );
final SourceSetContainer sourceSets = javaPluginExtension.getSourceSets();
final SourceSet mainSourceSet = sourceSets.getByName( SourceSet.MAIN_SOURCE_SET_NAME );
final ConfigurationContainer configurations = getProject().getConfigurations();
runtimeDependencies = getProject().getObjects().property( Configuration.class );
runtimeDependencies.set( configurations.getByName( mainSourceSet.getRuntimeClasspathConfigurationName() ) );
}
@Classpath
public Provider<Configuration> getRuntimeDependencies() {
return runtimeDependencies;
}
...
}
Am I using @Classpath
incorrectly?