Java Code Examples for org.gradle.api.tasks.incremental.InputFileDetails#getFile()

The following examples show how to use org.gradle.api.tasks.incremental.InputFileDetails#getFile() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SelectiveCompilation.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void execute(InputFileDetails inputFileDetails) {
    if (fullRebuildNeeded != null) {
        return;
    }
    File inputFile = inputFileDetails.getFile();
    String name = inputFile.getName();
    if (name.endsWith(".java")) {
        JavaSourceClass source = mapper.toJavaSourceClass(inputFile);
        compiler.addStaleClass(source);
        changedSourceOnly.include(source.getRelativePath());
        Set<String> actualDependents = dependencyInfo.getActualDependents(source.getClassName());
        if (actualDependents == null) {
            fullRebuildNeeded = "change to " + source.getClassName() + " requires full rebuild";
            return;
        }
        for (String d : actualDependents) {
            JavaSourceClass dSource = mapper.toJavaSourceClass(d);
            compiler.addStaleClass(dSource);
            changedSourceOnly.include(dSource.getRelativePath());
        }
    }
    if (name.endsWith(".jar")) {
        fullRebuildNeeded = "change to " + inputFile + " requires full rebuild";
        return;
    }
}
 
Example 2
Source File: SelectiveCompilation.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void execute(InputFileDetails inputFileDetails) {
    if (fullRebuildNeeded != null) {
        return;
    }
    File inputFile = inputFileDetails.getFile();
    String name = inputFile.getName();
    if (name.endsWith(".java")) {
        JavaSourceClass source = mapper.toJavaSourceClass(inputFile);
        compiler.addStaleClass(source);
        changedSourceOnly.include(source.getRelativePath());
        Set<String> actualDependents = dependencyInfo.getActualDependents(source.getClassName());
        if (actualDependents == null) {
            fullRebuildNeeded = "change to " + source.getClassName() + " requires full rebuild";
            return;
        }
        for (String d : actualDependents) {
            JavaSourceClass dSource = mapper.toJavaSourceClass(d);
            compiler.addStaleClass(dSource);
            changedSourceOnly.include(dSource.getRelativePath());
        }
    }
    if (name.endsWith(".jar")) {
        fullRebuildNeeded = "change to " + inputFile + " requires full rebuild";
        return;
    }
}
 
Example 3
Source File: JarChangeProcessor.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void processChange(InputFileDetails input, RecompilationSpec spec) {
    JarArchive jarArchive = new JarArchive(input.getFile(), fileOperations.zipTree(input.getFile()));
    JarChangeDependentsFinder dependentsFinder = new JarChangeDependentsFinder(jarClasspathSnapshot, previousCompilation);
    DependentsSet actualDependents = dependentsFinder.getActualDependents(input, jarArchive);
    if (actualDependents.isDependencyToAll()) {
        spec.setFullRebuildCause(actualDependents.getDescription(), input.getFile());
        return;
    }
    spec.getClassNames().addAll(actualDependents.getDependentClasses());
}
 
Example 4
Source File: JarChangeProcessor.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void processChange(InputFileDetails input, RecompilationSpec spec) {
    JarArchive jarArchive = new JarArchive(input.getFile(), fileOperations.zipTree(input.getFile()));
    JarChangeDependentsFinder dependentsFinder = new JarChangeDependentsFinder(jarClasspathSnapshot, previousCompilation);
    DependentsSet actualDependents = dependentsFinder.getActualDependents(input, jarArchive);
    if (actualDependents.isDependencyToAll()) {
        spec.setFullRebuildCause(actualDependents.getDescription(), input.getFile());
        return;
    }
    spec.getClassNames().addAll(actualDependents.getDependentClasses());
}