Skip to content

Commit

Permalink
dealing with lowercase characters in folder names and made sure folde…
Browse files Browse the repository at this point in the history
…r name and project name are now always aligned
  • Loading branch information
jurgenvinju committed May 15, 2023
1 parent f52ea52 commit 2a9ae7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/org/rascalmpl/library/util/Reflective.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,16 @@ set[str] getRascalReservedIdentifiers() = { n | /lit(n) := #RascalKeywords.defin
java str getRascalVersion();
@doc{Create a folder structure for an empty Rascal project with Maven support}
void newRascalProject(loc folder, str name="my-project", str group="org.rascalmpl", str version="0.1.0-SNAPSHOT") {
void newRascalProject(loc folder, str group="org.rascalmpl", str version="0.1.0-SNAPSHOT") {
if (exists(folder)) {
throw "<folder> exists already. Please provide an non-existing and empty folder name";
}
str name = folder.file;
if (/[^a-z0-9\-]/ := name) {
throw "Folder <name> should have only lowercase characters, digits and dashes from [a-z0-9\\-]";

This comment has been minimized.

Copy link
@DavyLandman

DavyLandman May 15, 2023

Member

I remember adding support for spaces in the project name, is that not valid?

This comment has been minimized.

Copy link
@jurgenvinju

jurgenvinju May 16, 2023

Author Member

You can have spaces in the folder name that leads up to it but never in the actual folder name. Neither eclipse, nor maven allow that. This check only checks in the actual folder name, not the rest of the path.

}
mkDirectory(pomFile(folder).parent);
writeFile(pomFile(folder), pomXml(name, group, version));
mkDirectory(metafile(folder).parent);
Expand Down

0 comments on commit 2a9ae7b

Please sign in to comment.