Search in sources :

Example 1 with CompileClasspath

use of org.gradle.api.tasks.CompileClasspath in project gradle by gradle.

the class AbstractInputFilePropertyAnnotationHandler method visitPropertyValue.

@Override
public void visitPropertyValue(String propertyName, PropertyValue value, PropertyMetadata propertyMetadata, PropertyVisitor visitor, BeanPropertyContext context) {
    Annotation fileNormalization = propertyMetadata.getAnnotationForCategory(NORMALIZATION);
    Class<? extends FileNormalizer> fileNormalizer;
    if (fileNormalization == null) {
        fileNormalizer = null;
    } else if (fileNormalization instanceof PathSensitive) {
        PathSensitivity pathSensitivity = ((PathSensitive) fileNormalization).value();
        fileNormalizer = FileParameterUtils.determineNormalizerForPathSensitivity(pathSensitivity);
    } else if (fileNormalization instanceof Classpath) {
        fileNormalizer = ClasspathNormalizer.class;
    } else if (fileNormalization instanceof CompileClasspath) {
        fileNormalizer = CompileClasspathNormalizer.class;
    } else {
        throw new IllegalStateException("Unknown normalization annotation used: " + fileNormalization);
    }
    visitor.visitInputFileProperty(propertyName, propertyMetadata.isAnnotationPresent(Optional.class), propertyMetadata.isAnnotationPresent(SkipWhenEmpty.class), determineDirectorySensitivity(propertyMetadata), propertyMetadata.isAnnotationPresent(NormalizeLineEndings.class) ? LineEndingSensitivity.NORMALIZE_LINE_ENDINGS : LineEndingSensitivity.DEFAULT, propertyMetadata.isAnnotationPresent(Incremental.class), fileNormalizer, value, getFilePropertyType());
}
Also used : Incremental(org.gradle.work.Incremental) CompileClasspath(org.gradle.api.tasks.CompileClasspath) Optional(org.gradle.api.tasks.Optional) SkipWhenEmpty(org.gradle.api.tasks.SkipWhenEmpty) CompileClasspathNormalizer(org.gradle.api.tasks.CompileClasspathNormalizer) Classpath(org.gradle.api.tasks.Classpath) CompileClasspath(org.gradle.api.tasks.CompileClasspath) PathSensitivity(org.gradle.api.tasks.PathSensitivity) PathSensitive(org.gradle.api.tasks.PathSensitive) Annotation(java.lang.annotation.Annotation)

Aggregations

Annotation (java.lang.annotation.Annotation)1 Classpath (org.gradle.api.tasks.Classpath)1 CompileClasspath (org.gradle.api.tasks.CompileClasspath)1 CompileClasspathNormalizer (org.gradle.api.tasks.CompileClasspathNormalizer)1 Optional (org.gradle.api.tasks.Optional)1 PathSensitive (org.gradle.api.tasks.PathSensitive)1 PathSensitivity (org.gradle.api.tasks.PathSensitivity)1 SkipWhenEmpty (org.gradle.api.tasks.SkipWhenEmpty)1 Incremental (org.gradle.work.Incremental)1