From d53a430bc74fce2636b4a75e2426f1d71beaa78e Mon Sep 17 00:00:00 2001 From: Alexandros Koufoudakis Date: Fri, 27 Mar 2026 11:33:23 +0100 Subject: [PATCH 1/2] [ADD_RESOURCES_TO_BUILDNORMAL_PATH] - Added resolving of default maven resources path --- src/org/rascalmpl/library/util/PathConfig.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index e62238a0575..bad1dc034e9 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -92,6 +92,7 @@ public class PathConfig { private static final List defaultMessages = Collections.emptyList(); private static final ISourceLocation defaultBin = URIUtil.unknownLocation(); private static final List defaultLibs = Collections.emptyList(); + private static final String DEFAULT_RESOURCES_PATH = "src/main/resources"; public static enum RascalConfigMode { INTERPRETER, @@ -547,7 +548,7 @@ private static void translateSources(ISourceLocation manifestRoot, IListWriter s } } - private static void buildNormalProjectConfig(ISourceLocation manifestRoot, RascalConfigMode mode, List mavenClasspath, boolean isRoot, IListWriter srcs, IListWriter libs, IListWriter messages) throws IOException, URISyntaxException { + private static void buildNormalProjectConfig(ISourceLocation manifestRoot, RascalConfigMode mode, List mavenClasspath, boolean isRoot, IListWriter srcs, IListWriter libs, IListWriter messages, IListWriter resources) throws IOException, URISyntaxException { if (isRoot) { if (mode == RascalConfigMode.INTERPRETER) { srcs.append(URIUtil.rootLocation("std")); // you'll always get rascal from standard in case of interpreter mode @@ -557,10 +558,11 @@ private static void buildNormalProjectConfig(ISourceLocation manifestRoot, Rasca assert mode == RascalConfigMode.COMPILER: "should be compiler"; // untill we go pom.xml first, you'll always get the rascal jar from our runtime // not the one you requested in the pom.xml - libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntimeJar())); + libs.append(JarURIResolver.jarify(resolveCurrentRascalRuntimeJar())); } } + resources.append(URIUtil.getChildLocation(manifestRoot, DEFAULT_RESOURCES_PATH)); // This processes Rascal libraries we can find in maven dependencies, // and we add them to the srcs unless a project is open with the same name, then we defer to its srcs @@ -664,7 +666,8 @@ private static void addProjectAndItsDependencies(RascalConfigMode mode, IListWri IListWriter messages, ISourceLocation projectLoc) throws IOException, URISyntaxException { projectLoc = safeResolve(projectLoc); // for now, remove the project loc, later we can undo this and keep the project loc around var childMavenClasspath = getPomXmlCompilerClasspath(projectLoc, messages); - buildNormalProjectConfig(projectLoc, mode, childMavenClasspath, false, srcs, libs, messages); + IListWriter resourcesWriter = (IListWriter) vf.listWriter().unique(); + buildNormalProjectConfig(projectLoc, mode, childMavenClasspath, false, srcs, libs, messages, resourcesWriter); } private static void checkLSPVersionsMatch(ISourceLocation manifestRoot, IListWriter messages, ISourceLocation jarLocation, Artifact artifact) throws IOException { @@ -760,7 +763,7 @@ else if (projectName.equals("rascal-lsp")) { buildRascalLSPConfig(manifestRoot, mode, mavenClasspath, srcsWriter, libsWriter, messages); } else { - buildNormalProjectConfig(manifestRoot, mode, mavenClasspath, isRoot, srcsWriter, libsWriter, messages); + buildNormalProjectConfig(manifestRoot, mode, mavenClasspath, isRoot, srcsWriter, libsWriter, messages, resourcesWriter); } } catch (IOException | URISyntaxException e) { From b8dcca789d7f283517b381f321969aba32005187 Mon Sep 17 00:00:00 2001 From: Alexandros Koufoudakis Date: Fri, 27 Mar 2026 12:08:34 +0100 Subject: [PATCH 2/2] [ADD_RESOURCES_TO_BUILDNORMAL_PATH] - Moving the maven resources to the appropriate scope. --- src/org/rascalmpl/library/util/PathConfig.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/org/rascalmpl/library/util/PathConfig.java b/src/org/rascalmpl/library/util/PathConfig.java index bad1dc034e9..3bcf70641fa 100644 --- a/src/org/rascalmpl/library/util/PathConfig.java +++ b/src/org/rascalmpl/library/util/PathConfig.java @@ -92,7 +92,6 @@ public class PathConfig { private static final List defaultMessages = Collections.emptyList(); private static final ISourceLocation defaultBin = URIUtil.unknownLocation(); private static final List defaultLibs = Collections.emptyList(); - private static final String DEFAULT_RESOURCES_PATH = "src/main/resources"; public static enum RascalConfigMode { INTERPRETER, @@ -562,7 +561,7 @@ private static void buildNormalProjectConfig(ISourceLocation manifestRoot, Rasca } } - resources.append(URIUtil.getChildLocation(manifestRoot, DEFAULT_RESOURCES_PATH)); + resources.append(URIUtil.getChildLocation(manifestRoot, "src/main/resources")); // This processes Rascal libraries we can find in maven dependencies, // and we add them to the srcs unless a project is open with the same name, then we defer to its srcs