@VisibleForTesting
  static FileCollection getInputFiles(
      Project project, List<Path> extraDirectories, String configurationName) {
    List<FileCollection> dependencyFileCollections = new ArrayList<>();
    dependencyFileCollections.add(project.getConfigurations().getByName(configurationName));
    // Output directories (classes and resources) from main SourceSet are added
    // so that BuildTarTask picks up changes in these and do not skip task
    SourceSetContainer sourceSetContainer =
        project.getExtensions().getByType(SourceSetContainer.class);
    SourceSet mainSourceSet = sourceSetContainer.getByName(MAIN_SOURCE_SET_NAME);
    dependencyFileCollections.add(mainSourceSet.getOutput());

    extraDirectories.stream()
        .filter(Files::exists)
        .map(Path::toFile)
        .map(project::files)
        .forEach(dependencyFileCollections::add);

    return project.files(dependencyFileCollections);
  }
Returns the input files for a task. These files include the gradle {@link
org.gradle.api.artifacts.Configuration}, output directories (classes, resources, etc.) of the
main {@link org.gradle.api.tasks.SourceSet}, and any extraDirectories defined by the user to
include in the container.

@param project the gradle project
@param extraDirectories the image's configured extra directories
@return the input files
jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleProjectProperties.java