Skip to content

Commit

Permalink
Make new utilities not completely bypass capabilities (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish authored Aug 12, 2024
1 parent 47be513 commit 714f31d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,9 @@ public void on(SourceSet sourceSet) {
final SourceSetInheritanceExtension sourceSetInheritanceExtension = target.getExtensions().getByType(SourceSetInheritanceExtension.class);
sourceSetInheritanceExtension.from(sourceSet);

target.setCompileClasspath(
target.getCompileClasspath().plus(
sourceSet.getOutput()
)
);
target.setRuntimeClasspath(
target.getRuntimeClasspath().plus(
sourceSet.getOutput()
)
project.getDependencies().add(
target.getImplementationConfigurationName(),
sourceSet.getOutput()
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ public void from(SourceSet sourceSet) {
);
}

target.setCompileClasspath(
target.getCompileClasspath().plus(
sourceSet.getCompileClasspath()
)
project.getConfigurations().getByName(target.getCompileClasspathConfigurationName()).extendsFrom(
project.getConfigurations().getByName(sourceSet.getCompileClasspathConfigurationName())
);
target.setRuntimeClasspath(
target.getRuntimeClasspath().plus(
sourceSet.getRuntimeClasspath()
)
project.getConfigurations().getByName(target.getRuntimeClasspathConfigurationName()).extendsFrom(
project.getConfigurations().getByName(sourceSet.getRuntimeClasspathConfigurationName())
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class SourceSetTests extends BuilderBasedTestSpecification {

then:
run.getOutput().contains("com.google.code.gson/gson/2.11.0") || run.getOutput().contains("com.google.code.gson\\gson\\2.11.0")
run.getOutput().contains("inheriting_sourcesets_runtime/build/classes/java/main") || run.getOutput().contains("inheriting_sourcesets_runtime\\build\\classes\\java\\main")
}

def "depending on a sourceset adds the compile dependencies"() {
Expand Down

0 comments on commit 714f31d

Please sign in to comment.