Collection<ExternalDependency> (@NotNull SourceSetOutput sourceSetOutput, @Nullable String scope) { Collection<ExternalDependency> result = new ArrayList<>(2); List<File> files = new ArrayList<>(sourceSetOutput.getClassesDirs().getFiles()); files.add(sourceSetOutput.getResourcesDir()); DefaultFileCollectionDependency fileCollectionDependency = new DefaultFileCollectionDependency(files); fileCollectionDependency.setScope(scope); result.add(fileCollectionDependency); if (RUNTIME_SCOPE.equals(scope)) { ExternalDependency outputDirsRuntimeFileDependency = resolveSourceSetOutputDirsRuntimeFileDependency(sourceSetOutput); if (outputDirsRuntimeFileDependency != null) { result.add(outputDirsRuntimeFileDependency); } } return result; }