Skip to content

Commit

Permalink
Minor refactoring in GradleClassPathProvider.
Browse files Browse the repository at this point in the history
  • Loading branch information
kelemen committed Apr 14, 2016
1 parent 50a80a9 commit fd9494d
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -380,18 +380,22 @@ private static List<PathResourceImplementation> getBuildOutputDirsAsPathResource
return result;
}

private void loadPathResources(JavaSourceSet sourceSet, Set<File> invalid) {
private void loadCompilePathResources(JavaSourceSet sourceSet, Set<File> invalid) {
Set<File> compileCP = sourceSet.getClasspaths().getCompileClasspaths();
setClassPathResources(
new SourceSetClassPathType(sourceSet.getName(), ClassPathType.COMPILE),
getPathResources(compileCP, invalid));
}

private void loadRuntimePathResources(JavaSourceSet sourceSet, Set<File> invalid) {
Set<File> runtimeCP = sourceSet.getClasspaths().getRuntimeClasspaths();
setClassPathResources(
new SourceSetClassPathType(sourceSet.getName(), ClassPathType.RUNTIME),
getPathResources(runtimeCP, invalid),
getBuildOutputDirsAsPathResources(sourceSet));
}

private void loadSourcePathResources(JavaSourceSet sourceSet, Set<File> invalid) {
List<PathResourceImplementation> sourcePaths = new LinkedList<>();
for (JavaSourceGroup sourceGroup: sourceSet.getSourceGroups()) {
Set<File> sourceRoots = sourceGroup.getSourceRoots();
Expand All @@ -405,6 +409,12 @@ private void loadPathResources(JavaSourceSet sourceSet, Set<File> invalid) {
sourcePaths);
}

private void loadPathResources(JavaSourceSet sourceSet, Set<File> invalid) {
loadCompilePathResources(sourceSet, invalid);
loadRuntimePathResources(sourceSet, invalid);
loadSourcePathResources(sourceSet, invalid);
}

private void loadBootClassPath() {
List<PathResourceImplementation> platformResources = new LinkedList<>();
ProjectPlatform platform = getCurrentPlatform();
Expand Down

0 comments on commit fd9494d

Please sign in to comment.