Skip to content

Commit

Permalink
Include non-test classpath elements in the canary classpath in Shrink…
Browse files Browse the repository at this point in the history
…Wrap scenarios
  • Loading branch information
holly-cummins committed Jan 21, 2025
1 parent 11093fb commit 2a5ed60
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,13 @@ private DiscoveryResult discoverTestClasses() {
FacadeClassLoader facadeClassLoader = FacadeClassLoader.instance(parent); // TODO ideally it would be in a different module, but that is hard CollaboratingClassLoader.construct(parent);

facadeClassLoader.setAuxiliaryApplication(true);
// TODO clumsy hack, consolidate logic properly
// TODO clumsy hack, consolidate logic properly; this path is nicer if we can do it, because it has the moduleinfo
facadeClassLoader.setProfiles(profiles);
facadeClassLoader.setClassPath(moduleInfo.getTest()
.get()
.getClassesPath());
facadeClassLoader.setClassPath(moduleInfo.getMain()
.getClassesPath(),
moduleInfo.getTest()
.get()
.getClassesPath());

// TODO this is annoyingly necessary because in dev mode getAnnotations() on the class returns an empty array
facadeClassLoader.setQuarkusTestClasses(quarkusTestClasses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,9 @@ public void setProfiles(Map<String, String> profiles) {
this.profiles = profiles;
}

public void setClassPath(String classesPath) {
this.classesPath = classesPath;
public void setClassPath(String... classPaths) {

this.classesPath = String.join(File.pathSeparator, classPaths);
System.out.println("HOLLY setting other classpath to " + classesPath);
URL[] urls = Arrays.stream(classesPath.split(File.pathSeparator))
.map(spec -> {
Expand Down

0 comments on commit 2a5ed60

Please sign in to comment.