void (Map<File, Integer> compileClasspathOrder, Map<File, Integer> runtimeClasspathOrder, ExternalDependency dependency) { String scope = dependency.getScope(); Map<File, Integer> classpathOrderMap = scope.equals(CompileDependenciesProvider.SCOPE) || scope.equals(PROVIDED_SCOPE) ? compileClasspathOrder : scope.equals(RuntimeDependenciesProvider.SCOPE) ? runtimeClasspathOrder : null; final Collection<File> depFiles = getFiles(dependency); int order = getOrder(classpathOrderMap, depFiles); if (dependency instanceof AbstractExternalDependency) { ((AbstractExternalDependency)dependency).setClasspathOrder(order); } }