2
0
Fork 0
mirror of https://github.com/ethauvin/bld.git synced 2025-04-25 08:17:11 -07:00

Implements #52 : command line enhancements for project creation

This commit is contained in:
Geert Bevin 2024-11-16 18:23:10 -05:00
parent 6c2a9acf1c
commit 66f7d180b9
21 changed files with 1421 additions and 1326 deletions

View file

@ -22,16 +22,16 @@ import static rife.bld.dependencies.Scope.test;
* @since 1.9 * @since 1.9
*/ */
public class AppProjectBlueprint extends Project { public class AppProjectBlueprint extends Project {
public AppProjectBlueprint(File work, String packageName, String projectName) { public AppProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public AppProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public AppProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Main"; mainClass = packageName + "." + baseName + "Main";
version = versionNumber; version = versionNumber;
downloadSources = true; downloadSources = true;

View file

@ -21,16 +21,16 @@ import static rife.bld.dependencies.Repository.SONATYPE_SNAPSHOTS;
* @since 1.5.20 * @since 1.5.20
*/ */
public class BaseProjectBlueprint extends Project { public class BaseProjectBlueprint extends Project {
public BaseProjectBlueprint(File work, String packageName, String projectName) { public BaseProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public BaseProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public BaseProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Main"; mainClass = packageName + "." + baseName + "Main";
version = versionNumber; version = versionNumber;
downloadSources = true; downloadSources = true;

View file

@ -22,16 +22,16 @@ import static rife.bld.dependencies.Scope.test;
* @since 1.6 * @since 1.6
*/ */
public class LibProjectBlueprint extends Project { public class LibProjectBlueprint extends Project {
public LibProjectBlueprint(File work, String packageName, String projectName) { public LibProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public LibProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public LibProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Lib"; mainClass = packageName + "." + baseName + "Lib";
version = versionNumber; version = versionNumber;
downloadSources = true; downloadSources = true;

View file

@ -23,16 +23,16 @@ import static rife.bld.dependencies.Scope.*;
* @since 1.5 * @since 1.5
*/ */
public class Rife2ProjectBlueprint extends WebProject { public class Rife2ProjectBlueprint extends WebProject {
public Rife2ProjectBlueprint(File work, String packageName, String projectName) { public Rife2ProjectBlueprint(File work, String packageName, String projectName, String baseName) {
this(work, packageName, projectName, new VersionNumber(0,0,1)); this(work, packageName, projectName, baseName, new VersionNumber(0,0,1));
} }
public Rife2ProjectBlueprint(File work, String packageName, String projectName, VersionNumber versionNumber) { public Rife2ProjectBlueprint(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
workDirectory = work; workDirectory = work;
pkg = packageName; pkg = packageName;
name = projectName; name = projectName;
mainClass = packageName + "." + StringUtils.capitalize(projectName) + "Site"; mainClass = packageName + "." + baseName + "Site";
uberJarMainClass = mainClass + "Uber"; uberJarMainClass = mainClass + "Uber";
version = versionNumber; version = versionNumber;

View file

@ -22,8 +22,9 @@ public class CreateAppHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new Java application project. Creates a new Java application project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,8 +22,9 @@ public class CreateBaseHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new Java baseline project. Creates a new Java baseline project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,9 +22,10 @@ public class CreateHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new project from multiple choice. Creates a new project from multiple choice.
Usage : ${topic} <type> <package> <name> Usage : ${topic} <type> <package> <name> <base>
type The type of project to create (app, base, lib, rife2) type The type of project to create (app, base, lib, rife2)
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,8 +22,9 @@ public class CreateLibHelp implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new Java library project. Creates a new Java library project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -22,8 +22,9 @@ public class CreateRife2Help implements CommandHelp {
return StringUtils.replace(""" return StringUtils.replace("""
Creates a new RIFE2 web application project. Creates a new RIFE2 web application project.
Usage : ${topic} <package> <name> Usage : ${topic} <package> <name> <base>
package The package of the project to create package The package of the project to create
name The name of the project to create""", "${topic}", topic); name The name of the project to create
base The base name for generated project classes""", "${topic}", topic);
} }
} }

View file

@ -26,11 +26,13 @@ import java.util.List;
* @since 1.5 * @since 1.5
*/ */
public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<T, P>, P extends Project> extends AbstractOperation<AbstractCreateOperation<T, P>> { public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<T, P>, P extends Project> extends AbstractOperation<AbstractCreateOperation<T, P>> {
private String packageName_;
private String projectName_;
private String baseName_;
final String templateBase_; final String templateBase_;
File workDirectory_ = new File(System.getProperty("user.dir")); File workDirectory_ = new File(System.getProperty("user.dir"));
String packageName_;
String projectName_;
boolean downloadDependencies_; boolean downloadDependencies_;
P project_; P project_;
@ -98,10 +100,11 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
// standard names // standard names
projectClassName_ = StringUtils.capitalize(project_.name()); projectClassName_ = StringUtils.capitalize(project_.name());
projectBuildName_ = projectBuildClassName(projectClassName_); var base_name = baseName();
projectMainName_ = projectMainClassName(projectClassName_); projectBuildName_ = projectBuildClassName(base_name);
projectMainUberName_ = projectMainUberClassName(projectClassName_); projectMainName_ = projectMainClassName(base_name);
projectTestName_ = projectTestClassName(projectClassName_); projectMainUberName_ = projectMainUberClassName(base_name);
projectTestName_ = projectTestClassName(base_name);
// create the main project structure // create the main project structure
ideaDirectory_ = new File(project_.workDirectory(), ".idea"); ideaDirectory_ = new File(project_.workDirectory(), ".idea");
@ -375,14 +378,18 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
public T fromArguments(List<String> arguments) { public T fromArguments(List<String> arguments) {
String package_name = null; String package_name = null;
String project_name = null; String project_name = null;
String base_name = null;
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
package_name = arguments.remove(0); package_name = arguments.remove(0);
} }
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
project_name = arguments.remove(0); project_name = arguments.remove(0);
} }
if ((package_name == null || project_name == null) && System.console() == null) { if (!arguments.isEmpty()) {
throw new OperationOptionException("ERROR: Expecting the package and project names as the arguments."); base_name = arguments.remove(0);
}
if ((package_name == null || project_name == null || base_name == null) && System.console() == null) {
throw new OperationOptionException("ERROR: Expecting the package, project and base names as the arguments.");
} }
if (package_name == null || package_name.isEmpty()) { if (package_name == null || package_name.isEmpty()) {
@ -391,16 +398,30 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
} else { } else {
System.out.println("Using package name: " + package_name); System.out.println("Using package name: " + package_name);
} }
if (project_name == null || project_name.isEmpty()) { if (project_name == null || project_name.isEmpty()) {
System.out.println("Please enter a project name (for instance: myapp):"); System.out.println("Please enter a project name (for instance: my-app):");
project_name = System.console().readLine(); project_name = System.console().readLine();
} else { } else {
System.out.println("Using project name: " + project_name); System.out.println("Using project name: " + project_name);
} }
if (base_name == null || base_name.isEmpty()) {
var default_base_name = generateBaseName(project_name);
System.out.println("Please enter the base name for generated project classes (default: " + default_base_name + "):");
base_name = System.console().readLine();
if (base_name == null || base_name.trim().isEmpty()) {
base_name = default_base_name;
System.out.println("Using base name: " + base_name);
}
} else {
System.out.println("Using base name: " + base_name);
}
return workDirectory(new File(System.getProperty("user.dir"))) return workDirectory(new File(System.getProperty("user.dir")))
.packageName(package_name) .packageName(package_name)
.projectName(project_name) .projectName(project_name)
.baseName(base_name)
.downloadDependencies(true); .downloadDependencies(true);
} }
@ -445,7 +466,6 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
throw new OperationOptionException("ERROR: The package name is invalid."); throw new OperationOptionException("ERROR: The package name is invalid.");
} }
packageName_ = name;
return (T) this; return (T) this;
} }
@ -462,10 +482,26 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
throw new OperationOptionException("ERROR: The project name should not be blank."); throw new OperationOptionException("ERROR: The project name should not be blank.");
} }
if (!ValidityChecks.checkJavaIdentifier(projectName_)) { return (T) this;
throw new OperationOptionException("ERROR: The project name is invalid.");
} }
projectName_ = name;
/**
* Provides the base name for the project classes to generate.
*
* @param name the base name
* @return this operation instance
* @since 2.2
*/
public T baseName(String name) {
baseName_ = StringUtils.trim(name);
if (baseName_.isEmpty()) {
throw new OperationOptionException("ERROR: The base name should not be blank.");
}
if (!ValidityChecks.checkJavaIdentifier(baseName_)) {
throw new OperationOptionException("ERROR: The base name is invalid.");
}
return (T) this; return (T) this;
} }
@ -513,6 +549,33 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
return projectName_; return projectName_;
} }
static String generateBaseName(String projectName) {
if (projectName != null) {
var base_name = projectName.trim();
base_name = StringUtils.filterAsIdentifier(base_name);
base_name = StringUtils.capitalize(base_name);
return base_name;
}
return null;
}
/**
* Retrieves the base name for the project classes to generate.
* <p>
* If no base name was provided, one will be generated from the project name.
*
* @return the base name
* @since 2.2
*/
public String baseName() {
if (baseName_ == null || baseName_.isEmpty()) {
return generateBaseName(projectName());
}
return baseName_;
}
/** /**
* Retrieves whether dependencies will be downloaded at project creation. * Retrieves whether dependencies will be downloaded at project creation.
* *

View file

@ -21,6 +21,6 @@ public class CreateAppOperation extends AbstractCreateOperation<CreateAppOperati
} }
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new AppProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new AppProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
} }
} }

View file

@ -21,6 +21,6 @@ public class CreateBaseOperation extends AbstractCreateOperation<CreateBaseOpera
} }
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new BaseProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new BaseProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
} }
} }

View file

@ -21,7 +21,7 @@ public class CreateLibOperation extends AbstractCreateOperation<CreateLibOperati
} }
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new LibProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new LibProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
} }
protected String projectMainClassName(String projectClassName) { protected String projectMainClassName(String projectClassName) {

View file

@ -33,6 +33,7 @@ public class CreateOperation {
String type = null; String type = null;
String package_name = null; String package_name = null;
String project_name = null; String project_name = null;
String base_name = null;
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
type = arguments.remove(0); type = arguments.remove(0);
} }
@ -42,8 +43,11 @@ public class CreateOperation {
if (!arguments.isEmpty()) { if (!arguments.isEmpty()) {
project_name = arguments.remove(0); project_name = arguments.remove(0);
} }
if ((type == null || package_name == null || project_name == null) && System.console() == null) { if (!arguments.isEmpty()) {
throw new OperationOptionException("ERROR: Expecting the type, package and project names as the arguments."); base_name = arguments.remove(0);
}
if ((package_name == null || project_name == null || base_name == null) && System.console() == null) {
throw new OperationOptionException("ERROR: Expecting the package, project and base names as the arguments.");
} }
if (type == null || type.isEmpty()) { if (type == null || type.isEmpty()) {
@ -87,21 +91,34 @@ public class CreateOperation {
if (project_name == null || project_name.isEmpty()) { if (project_name == null || project_name.isEmpty()) {
String name_example; String name_example;
if (LIB.equals(type)) { if (LIB.equals(type)) {
name_example = "mylib"; name_example = "my-lib";
} else if (RIFE2.equals(type)) { } else if (RIFE2.equals(type)) {
name_example = "mywebapp"; name_example = "my-webapp";
} else { } else {
name_example = "myapp"; name_example = "my-app";
} }
System.out.printf("Please enter a project name (for instance: %s):%n", name_example); System.out.println("Please enter a project name (for instance: " + name_example + ")");
project_name = System.console().readLine(); project_name = System.console().readLine();
} else { } else {
System.out.println("Using project name: " + project_name); System.out.println("Using project name: " + project_name);
} }
if (base_name == null || base_name.isEmpty()) {
var default_base_name = AbstractCreateOperation.generateBaseName(project_name);
System.out.println("Please enter the base name for generated project classes (default: " + default_base_name + "):");
base_name = System.console().readLine();
if (base_name == null || base_name.trim().isEmpty()) {
base_name = default_base_name;
System.out.println("Using base name: " + base_name);
}
} else {
System.out.println("Using base name: " + base_name);
}
return create_operation.workDirectory(new File(System.getProperty("user.dir"))) return create_operation.workDirectory(new File(System.getProperty("user.dir")))
.packageName(package_name) .packageName(package_name)
.projectName(project_name) .projectName(project_name)
.baseName(base_name)
.downloadDependencies(true); .downloadDependencies(true);
} }
} }

View file

@ -27,14 +27,14 @@ public class CreateRife2Operation extends AbstractCreateOperation<CreateRife2Ope
} }
protected Rife2ProjectBlueprint createProjectBlueprint() { protected Rife2ProjectBlueprint createProjectBlueprint() {
return new Rife2ProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName()); return new Rife2ProjectBlueprint(new File(workDirectory(), projectName()), packageName(), projectName(), baseName());
} }
@Override @Override
protected void executeConfigure() { protected void executeConfigure() {
super.executeConfigure(); super.executeConfigure();
projectMainName_ = projectClassName_ + "Site"; projectMainName_ = baseName() + "Site";
projectMainUberName_ = projectMainName_ + "Uber"; projectMainUberName_ = projectMainName_ + "Uber";
srcMainWebappCssDirectory_ = new File(project_.srcMainWebappDirectory(), "css"); srcMainWebappCssDirectory_ = new File(project_.srcMainWebappDirectory(), "css");
srcMainWebappWebInfDirectory_ = new File(project_.srcMainWebappDirectory(), "WEB-INF"); srcMainWebappWebInfDirectory_ = new File(project_.srcMainWebappDirectory(), "WEB-INF");

View file

@ -1 +1 @@
2.1.1-SNAPSHOT 2.2.0-SNAPSHOT

View file

@ -65,165 +65,166 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyAppMain\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyAppMain\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyAppMain\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()
@ -247,62 +248,63 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("org.stuff") .packageName("org.stuff")
.projectName("yourthing"); .projectName("your-thing")
.baseName("YourThing");
create_operation.execute(); create_operation.execute();
assertEquals(""" assertEquals("""
/yourthing /your-thing
/yourthing/.gitignore /your-thing/.gitignore
/yourthing/.idea /your-thing/.idea
/yourthing/.idea/app.iml /your-thing/.idea/app.iml
/yourthing/.idea/bld.iml /your-thing/.idea/bld.iml
/yourthing/.idea/libraries /your-thing/.idea/libraries
/yourthing/.idea/libraries/bld.xml /your-thing/.idea/libraries/bld.xml
/yourthing/.idea/libraries/compile.xml /your-thing/.idea/libraries/compile.xml
/yourthing/.idea/libraries/runtime.xml /your-thing/.idea/libraries/runtime.xml
/yourthing/.idea/libraries/test.xml /your-thing/.idea/libraries/test.xml
/yourthing/.idea/misc.xml /your-thing/.idea/misc.xml
/yourthing/.idea/modules.xml /your-thing/.idea/modules.xml
/yourthing/.idea/runConfigurations /your-thing/.idea/runConfigurations
/yourthing/.idea/runConfigurations/Run Main.xml /your-thing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml /your-thing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode /your-thing/.vscode
/yourthing/.vscode/launch.json /your-thing/.vscode/launch.json
/yourthing/.vscode/settings.json /your-thing/.vscode/settings.json
/yourthing/bld /your-thing/bld
/yourthing/bld.bat /your-thing/bld.bat
/yourthing/lib /your-thing/lib
/yourthing/lib/bld /your-thing/lib/bld
/yourthing/lib/bld/bld-wrapper.jar /your-thing/lib/bld/bld-wrapper.jar
/yourthing/lib/bld/bld-wrapper.properties /your-thing/lib/bld/bld-wrapper.properties
/yourthing/lib/compile /your-thing/lib/compile
/yourthing/lib/compile/modules /your-thing/lib/compile/modules
/yourthing/lib/provided /your-thing/lib/provided
/yourthing/lib/provided/modules /your-thing/lib/provided/modules
/yourthing/lib/runtime /your-thing/lib/runtime
/yourthing/lib/runtime/modules /your-thing/lib/runtime/modules
/yourthing/lib/test /your-thing/lib/test
/yourthing/lib/test/modules /your-thing/lib/test/modules
/yourthing/src /your-thing/src
/yourthing/src/bld /your-thing/src/bld
/yourthing/src/bld/java /your-thing/src/bld/java
/yourthing/src/bld/java/org /your-thing/src/bld/java/org
/yourthing/src/bld/java/org/stuff /your-thing/src/bld/java/org/stuff
/yourthing/src/bld/java/org/stuff/YourthingBuild.java /your-thing/src/bld/java/org/stuff/YourThingBuild.java
/yourthing/src/bld/resources /your-thing/src/bld/resources
/yourthing/src/main /your-thing/src/main
/yourthing/src/main/java /your-thing/src/main/java
/yourthing/src/main/java/org /your-thing/src/main/java/org
/yourthing/src/main/java/org/stuff /your-thing/src/main/java/org/stuff
/yourthing/src/main/java/org/stuff/YourthingMain.java /your-thing/src/main/java/org/stuff/YourThingMain.java
/yourthing/src/main/resources /your-thing/src/main/resources
/yourthing/src/main/resources/templates /your-thing/src/main/resources/templates
/yourthing/src/test /your-thing/src/test
/yourthing/src/test/java /your-thing/src/test/java
/yourthing/src/test/java/org /your-thing/src/test/java/org
/yourthing/src/test/java/org/stuff /your-thing/src/test/java/org/stuff
/yourthing/src/test/java/org/stuff/YourthingTest.java /your-thing/src/test/java/org/stuff/YourThingTest.java
/yourthing/src/test/resources""", /your-thing/src/test/resources""",
FileUtils.generateDirectoryListing(tmp)); FileUtils.generateDirectoryListing(tmp));
var compile_operation = new CompileOperation() { var compile_operation = new CompileOperation() {
@ -327,7 +329,8 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
@ -350,88 +353,87 @@ public class TestCreateAppOperation {
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
System.out.println(FileUtils.generateDirectoryListing(tmp));
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyAppMain\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/local /my-app/lib/local
/myapp/lib/local/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/local/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/local/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/local/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/local/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-5\\.11\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-5\\.11\\.0\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-api-5\\.11\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-api-5\\.11\\.0\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-engine-5\\.11\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-engine-5\\.11\\.0\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/local/junit-jupiter-params-5\\.11\\.0-sources\\.jar
/myapp/lib/local/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/local/junit-jupiter-params-5\\.11\\.0\\.jar
/myapp/lib/local/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/local/junit-platform-commons-1\\.11\\.0-sources\\.jar
/myapp/lib/local/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/local/junit-platform-commons-1\\.11\\.0\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/local/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar
/myapp/lib/local/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/local/junit-platform-console-standalone-1\\.11\\.0\\.jar
/myapp/lib/local/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/local/junit-platform-engine-1\\.11\\.0-sources\\.jar
/myapp/lib/local/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/local/junit-platform-engine-1\\.11\\.0\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/local/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local/opentest4j-1\\.3\\.0\\.jar /my-app/lib/local/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyAppMain\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()
@ -455,7 +457,8 @@ public class TestCreateAppOperation {
var create_operation = new CreateAppOperation() var create_operation = new CreateAppOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
@ -477,87 +480,87 @@ public class TestCreateAppOperation {
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyAppMain\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/local_compile /my-app/lib/local_compile
/myapp/lib/local_test /my-app/lib/local_test
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/local_test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/local_test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-5\\.11\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-5\\.11\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-api-5\\.11\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-api-5\\.11\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-engine-5\\.11\\.0\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-jupiter-params-5\\.11\\.0-sources\\.jar
/myapp/lib/local_test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/local_test/junit-jupiter-params-5\\.11\\.0\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-platform-commons-1\\.11\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/local_test/junit-platform-commons-1\\.11\\.0\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/local_test/junit-platform-console-standalone-1\\.11\\.0\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/local_test/junit-platform-engine-1\\.11\\.0-sources\\.jar
/myapp/lib/local_test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/local_test/junit-platform-engine-1\\.11\\.0\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/local_test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/local_test/opentest4j-1\\.3\\.0\\.jar
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyAppMain\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()

View file

@ -58,129 +58,130 @@ public class TestCreateBaseOperation {
var create_operation = new CreateBaseOperation() var create_operation = new CreateBaseOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyAppMain\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Main\\.xml /my-app/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappMain\\.class /my-app/build/main/com/example/MyAppMain\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappMain\\.java /my-app/src/main/java/com/example/MyAppMain\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new RunOperation() new RunOperation()
@ -204,129 +205,130 @@ public class TestCreateBaseOperation {
var create_operation = new CreateBaseOperation() var create_operation = new CreateBaseOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("org.stuff") .packageName("org.stuff")
.projectName("yourthing"); .projectName("your-thing")
.baseName("YourThing");
create_operation.execute(); create_operation.execute();
assertEquals(""" assertEquals("""
/yourthing /your-thing
/yourthing/.gitignore /your-thing/.gitignore
/yourthing/.idea /your-thing/.idea
/yourthing/.idea/app.iml /your-thing/.idea/app.iml
/yourthing/.idea/bld.iml /your-thing/.idea/bld.iml
/yourthing/.idea/libraries /your-thing/.idea/libraries
/yourthing/.idea/libraries/bld.xml /your-thing/.idea/libraries/bld.xml
/yourthing/.idea/libraries/compile.xml /your-thing/.idea/libraries/compile.xml
/yourthing/.idea/libraries/runtime.xml /your-thing/.idea/libraries/runtime.xml
/yourthing/.idea/libraries/test.xml /your-thing/.idea/libraries/test.xml
/yourthing/.idea/misc.xml /your-thing/.idea/misc.xml
/yourthing/.idea/modules.xml /your-thing/.idea/modules.xml
/yourthing/.idea/runConfigurations /your-thing/.idea/runConfigurations
/yourthing/.idea/runConfigurations/Run Main.xml /your-thing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml /your-thing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode /your-thing/.vscode
/yourthing/.vscode/launch.json /your-thing/.vscode/launch.json
/yourthing/.vscode/settings.json /your-thing/.vscode/settings.json
/yourthing/bld /your-thing/bld
/yourthing/bld.bat /your-thing/bld.bat
/yourthing/lib /your-thing/lib
/yourthing/lib/bld /your-thing/lib/bld
/yourthing/lib/bld/bld-wrapper.jar /your-thing/lib/bld/bld-wrapper.jar
/yourthing/lib/bld/bld-wrapper.properties /your-thing/lib/bld/bld-wrapper.properties
/yourthing/lib/compile /your-thing/lib/compile
/yourthing/lib/compile/modules /your-thing/lib/compile/modules
/yourthing/lib/provided /your-thing/lib/provided
/yourthing/lib/provided/modules /your-thing/lib/provided/modules
/yourthing/lib/runtime /your-thing/lib/runtime
/yourthing/lib/runtime/modules /your-thing/lib/runtime/modules
/yourthing/lib/test /your-thing/lib/test
/yourthing/lib/test/modules /your-thing/lib/test/modules
/yourthing/src /your-thing/src
/yourthing/src/bld /your-thing/src/bld
/yourthing/src/bld/java /your-thing/src/bld/java
/yourthing/src/bld/java/org /your-thing/src/bld/java/org
/yourthing/src/bld/java/org/stuff /your-thing/src/bld/java/org/stuff
/yourthing/src/bld/java/org/stuff/YourthingBuild.java /your-thing/src/bld/java/org/stuff/YourThingBuild.java
/yourthing/src/bld/resources /your-thing/src/bld/resources
/yourthing/src/main /your-thing/src/main
/yourthing/src/main/java /your-thing/src/main/java
/yourthing/src/main/java/org /your-thing/src/main/java/org
/yourthing/src/main/java/org/stuff /your-thing/src/main/java/org/stuff
/yourthing/src/main/java/org/stuff/YourthingMain.java /your-thing/src/main/java/org/stuff/YourThingMain.java
/yourthing/src/main/resources /your-thing/src/main/resources
/yourthing/src/main/resources/templates /your-thing/src/main/resources/templates
/yourthing/src/test /your-thing/src/test
/yourthing/src/test/java /your-thing/src/test/java
/yourthing/src/test/java/org /your-thing/src/test/java/org
/yourthing/src/test/java/org/stuff /your-thing/src/test/java/org/stuff
/yourthing/src/test/java/org/stuff/YourthingTest.java /your-thing/src/test/java/org/stuff/YourThingTest.java
/yourthing/src/test/resources""", /your-thing/src/test/resources""",
FileUtils.generateDirectoryListing(tmp)); FileUtils.generateDirectoryListing(tmp));
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertEquals(""" assertEquals("""
/yourthing /your-thing
/yourthing/.gitignore /your-thing/.gitignore
/yourthing/.idea /your-thing/.idea
/yourthing/.idea/app.iml /your-thing/.idea/app.iml
/yourthing/.idea/bld.iml /your-thing/.idea/bld.iml
/yourthing/.idea/libraries /your-thing/.idea/libraries
/yourthing/.idea/libraries/bld.xml /your-thing/.idea/libraries/bld.xml
/yourthing/.idea/libraries/compile.xml /your-thing/.idea/libraries/compile.xml
/yourthing/.idea/libraries/runtime.xml /your-thing/.idea/libraries/runtime.xml
/yourthing/.idea/libraries/test.xml /your-thing/.idea/libraries/test.xml
/yourthing/.idea/misc.xml /your-thing/.idea/misc.xml
/yourthing/.idea/modules.xml /your-thing/.idea/modules.xml
/yourthing/.idea/runConfigurations /your-thing/.idea/runConfigurations
/yourthing/.idea/runConfigurations/Run Main.xml /your-thing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml /your-thing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode /your-thing/.vscode
/yourthing/.vscode/launch.json /your-thing/.vscode/launch.json
/yourthing/.vscode/settings.json /your-thing/.vscode/settings.json
/yourthing/bld /your-thing/bld
/yourthing/bld.bat /your-thing/bld.bat
/yourthing/build /your-thing/build
/yourthing/build/main /your-thing/build/main
/yourthing/build/main/org /your-thing/build/main/org
/yourthing/build/main/org/stuff /your-thing/build/main/org/stuff
/yourthing/build/main/org/stuff/YourthingMain.class /your-thing/build/main/org/stuff/YourThingMain.class
/yourthing/build/test /your-thing/build/test
/yourthing/build/test/org /your-thing/build/test/org
/yourthing/build/test/org/stuff /your-thing/build/test/org/stuff
/yourthing/build/test/org/stuff/YourthingTest.class /your-thing/build/test/org/stuff/YourThingTest.class
/yourthing/lib /your-thing/lib
/yourthing/lib/bld /your-thing/lib/bld
/yourthing/lib/bld/bld-wrapper.jar /your-thing/lib/bld/bld-wrapper.jar
/yourthing/lib/bld/bld-wrapper.properties /your-thing/lib/bld/bld-wrapper.properties
/yourthing/lib/compile /your-thing/lib/compile
/yourthing/lib/compile/modules /your-thing/lib/compile/modules
/yourthing/lib/provided /your-thing/lib/provided
/yourthing/lib/provided/modules /your-thing/lib/provided/modules
/yourthing/lib/runtime /your-thing/lib/runtime
/yourthing/lib/runtime/modules /your-thing/lib/runtime/modules
/yourthing/lib/test /your-thing/lib/test
/yourthing/lib/test/modules /your-thing/lib/test/modules
/yourthing/src /your-thing/src
/yourthing/src/bld /your-thing/src/bld
/yourthing/src/bld/java /your-thing/src/bld/java
/yourthing/src/bld/java/org /your-thing/src/bld/java/org
/yourthing/src/bld/java/org/stuff /your-thing/src/bld/java/org/stuff
/yourthing/src/bld/java/org/stuff/YourthingBuild.java /your-thing/src/bld/java/org/stuff/YourThingBuild.java
/yourthing/src/bld/resources /your-thing/src/bld/resources
/yourthing/src/main /your-thing/src/main
/yourthing/src/main/java /your-thing/src/main/java
/yourthing/src/main/java/org /your-thing/src/main/java/org
/yourthing/src/main/java/org/stuff /your-thing/src/main/java/org/stuff
/yourthing/src/main/java/org/stuff/YourthingMain.java /your-thing/src/main/java/org/stuff/YourThingMain.java
/yourthing/src/main/resources /your-thing/src/main/resources
/yourthing/src/main/resources/templates /your-thing/src/main/resources/templates
/yourthing/src/test /your-thing/src/test
/yourthing/src/test/java /your-thing/src/test/java
/yourthing/src/test/java/org /your-thing/src/test/java/org
/yourthing/src/test/java/org/stuff /your-thing/src/test/java/org/stuff
/yourthing/src/test/java/org/stuff/YourthingTest.java /your-thing/src/test/java/org/stuff/YourThingTest.java
/yourthing/src/test/resources""", /your-thing/src/test/resources""",
FileUtils.generateDirectoryListing(tmp)); FileUtils.generateDirectoryListing(tmp));
var check_result = new StringBuilder(); var check_result = new StringBuilder();

View file

@ -58,163 +58,164 @@ public class TestCreateLibOperation {
var create_operation = new CreateLibOperation() var create_operation = new CreateLibOperation()
.workDirectory(tmp) .workDirectory(tmp)
.packageName("com.example") .packageName("com.example")
.projectName("myapp") .projectName("my-app")
.baseName("MyApp")
.downloadDependencies(true); .downloadDependencies(true);
create_operation.execute(); create_operation.execute();
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappLib\\.java /my-app/src/main/java/com/example/MyAppLib\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var compile_operation = new CompileOperation().fromProject(create_operation.project()); var compile_operation = new CompileOperation().fromProject(create_operation.project());
compile_operation.execute(); compile_operation.execute();
assertTrue(compile_operation.diagnostics().isEmpty()); assertTrue(compile_operation.diagnostics().isEmpty());
assertTrue(Pattern.compile(""" assertTrue(Pattern.compile("""
/myapp /my-app
/myapp/\\.gitignore /my-app/\\.gitignore
/myapp/\\.idea /my-app/\\.idea
/myapp/\\.idea/app\\.iml /my-app/\\.idea/app\\.iml
/myapp/\\.idea/bld\\.iml /my-app/\\.idea/bld\\.iml
/myapp/\\.idea/libraries /my-app/\\.idea/libraries
/myapp/\\.idea/libraries/bld\\.xml /my-app/\\.idea/libraries/bld\\.xml
/myapp/\\.idea/libraries/compile\\.xml /my-app/\\.idea/libraries/compile\\.xml
/myapp/\\.idea/libraries/runtime\\.xml /my-app/\\.idea/libraries/runtime\\.xml
/myapp/\\.idea/libraries/test\\.xml /my-app/\\.idea/libraries/test\\.xml
/myapp/\\.idea/misc\\.xml /my-app/\\.idea/misc\\.xml
/myapp/\\.idea/modules\\.xml /my-app/\\.idea/modules\\.xml
/myapp/\\.idea/runConfigurations /my-app/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Tests\\.xml /my-app/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode /my-app/\\.vscode
/myapp/\\.vscode/launch\\.json /my-app/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json /my-app/\\.vscode/settings\\.json
/myapp/bld /my-app/bld
/myapp/bld\\.bat /my-app/bld\\.bat
/myapp/build /my-app/build
/myapp/build/main /my-app/build/main
/myapp/build/main/com /my-app/build/main/com
/myapp/build/main/com/example /my-app/build/main/com/example
/myapp/build/main/com/example/MyappLib\\.class /my-app/build/main/com/example/MyAppLib\\.class
/myapp/build/test /my-app/build/test
/myapp/build/test/com /my-app/build/test/com
/myapp/build/test/com/example /my-app/build/test/com/example
/myapp/build/test/com/example/MyappTest\\.class /my-app/build/test/com/example/MyAppTest\\.class
/myapp/lib /my-app/lib
/myapp/lib/bld /my-app/lib/bld
/myapp/lib/bld/bld-wrapper\\.jar /my-app/lib/bld/bld-wrapper\\.jar
/myapp/lib/bld/bld-wrapper\\.properties /my-app/lib/bld/bld-wrapper\\.properties
/myapp/lib/compile /my-app/lib/compile
/myapp/lib/compile/modules /my-app/lib/compile/modules
/myapp/lib/provided /my-app/lib/provided
/myapp/lib/provided/modules /my-app/lib/provided/modules
/myapp/lib/runtime /my-app/lib/runtime
/myapp/lib/runtime/modules /my-app/lib/runtime/modules
/myapp/lib/test /my-app/lib/test
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar /my-app/lib/test/apiguardian-api-1\\.1\\.2\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-api-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-engine-5\\.11\\.0\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar /my-app/lib/test/junit-jupiter-params-5\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-commons-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-commons-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-console-standalone-1\\.11\\.0\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0-sources\\.jar
/myapp/lib/test/junit-platform-engine-1\\.11\\.0\\.jar /my-app/lib/test/junit-platform-engine-1\\.11\\.0\\.jar
/myapp/lib/test/modules /my-app/lib/test/modules
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar /my-app/lib/test/opentest4j-1\\.3\\.0\\.jar
/myapp/src /my-app/src
/myapp/src/bld /my-app/src/bld
/myapp/src/bld/java /my-app/src/bld/java
/myapp/src/bld/java/com /my-app/src/bld/java/com
/myapp/src/bld/java/com/example /my-app/src/bld/java/com/example
/myapp/src/bld/java/com/example/MyappBuild\\.java /my-app/src/bld/java/com/example/MyAppBuild\\.java
/myapp/src/bld/resources /my-app/src/bld/resources
/myapp/src/main /my-app/src/main
/myapp/src/main/java /my-app/src/main/java
/myapp/src/main/java/com /my-app/src/main/java/com
/myapp/src/main/java/com/example /my-app/src/main/java/com/example
/myapp/src/main/java/com/example/MyappLib\\.java /my-app/src/main/java/com/example/MyAppLib\\.java
/myapp/src/main/resources /my-app/src/main/resources
/myapp/src/main/resources/templates /my-app/src/main/resources/templates
/myapp/src/test /my-app/src/test
/myapp/src/test/java /my-app/src/test/java
/myapp/src/test/java/com /my-app/src/test/java/com
/myapp/src/test/java/com/example /my-app/src/test/java/com/example
/myapp/src/test/java/com/example/MyappTest\\.java /my-app/src/test/java/com/example/MyAppTest\\.java
/myapp/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches()); /my-app/src/test/resources""").matcher(FileUtils.generateDirectoryListing(tmp)).matches());
var check_result = new StringBuilder(); var check_result = new StringBuilder();
new JUnitOperation() new JUnitOperation()

File diff suppressed because it is too large Load diff

View file

@ -51,8 +51,8 @@ public class TestPublishOperation {
} }
static class PublishProject extends AppProjectBlueprint { static class PublishProject extends AppProjectBlueprint {
public PublishProject(File work, String packageName, String projectName, VersionNumber versionNumber) { public PublishProject(File work, String packageName, String projectName, String baseName, VersionNumber versionNumber) {
super(work, packageName, projectName, versionNumber); super(work, packageName, projectName, baseName, versionNumber);
javaRelease = 17; javaRelease = 17;
} }
} }
@ -209,7 +209,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 0, 0)); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 0, 0));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)
@ -342,7 +342,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 0, 0)); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 0, 0));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)
@ -419,7 +419,7 @@ public class TestPublishOperation {
// create a first publication // create a first publication
var create_operation1 = new CreateAppOperation() { var create_operation1 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp1) .workDirectory(tmp1)
@ -496,7 +496,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)
@ -589,7 +589,7 @@ public class TestPublishOperation {
// create a first publication // create a first publication
var create_operation1 = new CreateAppOperation() { var create_operation1 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp1) .workDirectory(tmp1)
@ -645,7 +645,7 @@ public class TestPublishOperation {
// created an updated publication // created an updated publication
var create_operation2 = new CreateAppOperation() { var create_operation2 = new CreateAppOperation() {
protected Project createProjectBlueprint() { protected Project createProjectBlueprint() {
return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), new VersionNumber(1, 2, 3, "SNAPSHOT")); return new PublishProject(new File(workDirectory(), projectName()), packageName(), projectName(), baseName(), new VersionNumber(1, 2, 3, "SNAPSHOT"));
} }
} }
.workDirectory(tmp2) .workDirectory(tmp2)