Skip to content

Commit

Permalink
added target folder back to the classpath for loading Java classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jurgenvinju committed Jun 17, 2024
1 parent b212c7e commit f879803
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/org/rascalmpl/library/util/Eval.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public RascalRuntime(PathConfig pcfg, InputStream input, OutputStream stderr, Ou
eval.addRascalSearchPath((ISourceLocation) path);
}

ClassLoader cl = new SourceLocationClassLoader(pcfg.getLibs(), ShellEvaluatorFactory.class.getClassLoader());
ClassLoader cl = new SourceLocationClassLoader(pcfg.getLibsAndTarget(), ShellEvaluatorFactory.class.getClassLoader());
eval.addClassLoader(cl);
}

Expand Down
4 changes: 4 additions & 0 deletions src/org/rascalmpl/library/util/PathConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ public PathConfig addIgnoreLoc(ISourceLocation dir) throws IOException {
public IList getLibs() {
return vf.list(libs.toArray(new IValue[0]));
}

public IList getLibsAndTarget() {
return getLibs().append(getBin());
}

public PathConfig addLibLoc(ISourceLocation dir) throws IOException {
List<ISourceLocation> extendedlibs = new ArrayList<ISourceLocation>(libs);
Expand Down
2 changes: 1 addition & 1 deletion src/org/rascalmpl/shell/ShellEvaluatorFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static void configureProjectEvaluator(Evaluator evaluator, ISourceLocatio
evaluator.addRascalSearchPath((ISourceLocation) path);
}

ClassLoader cl = new SourceLocationClassLoader(pcfg.getLibs(), ShellEvaluatorFactory.class.getClassLoader());
ClassLoader cl = new SourceLocationClassLoader(pcfg.getLibsAndTarget(), ShellEvaluatorFactory.class.getClassLoader());
evaluator.addClassLoader(cl);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static void configureProjectEvaluator(Evaluator evaluator, ISourceLocatio
evaluator.addRascalSearchPath((ISourceLocation) path);
}

ClassLoader cl = new SourceLocationClassLoader(pcfg.getLibs(), ShellEvaluatorFactory.class.getClassLoader());
ClassLoader cl = new SourceLocationClassLoader(pcfg.getLibsAndTarget(), ShellEvaluatorFactory.class.getClassLoader());
evaluator.addClassLoader(cl);
}
catch (AssertionError e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
*/
public class PathConfigClassLoader extends SourceLocationClassLoader {
public PathConfigClassLoader(PathConfig pcfg, ClassLoader parent) {
super(pcfg.getLibs(), parent);
super(pcfg.getLibsAndTarget(), parent);
}
}

0 comments on commit f879803

Please sign in to comment.