Skip to content

Commit

Permalink
Merge branch 'release/2.0.0-RC5'
Browse files Browse the repository at this point in the history
  • Loading branch information
vegegoku committed May 10, 2024
2 parents b215fe1 + 3eb15a3 commit b42b165
Show file tree
Hide file tree
Showing 53 changed files with 1,752 additions and 52 deletions.
82 changes: 46 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,54 @@ to generate a module without sub-modules use the `-s` option
#### Detailed instructions

```
Usage: dominokit [COMMAND]
Executes dominokit commands
Usage: domino [-hV] [COMMAND]
Executes domino commands
Use this command to generate basic template project or an MVP project.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Commands:
help Displays help information about the specified command
help Display help information about the specified command.
generate, gen Generates a domino template project/module
```

```
Usage: domino generate [COMMAND]
Generates a domino template project/module
Commands:
help Displays help information about the specified command
help Display help information about the specified command.
app Use with generate command to generate a domino-mvp template project
module Use with generate command to generate a domino-mvp module template
```

```
Usage: domino generate app [-api] [-c=<compiler>] [-d=<workingDire>]
[-g=<groupId>] -n=<name> [-t=<type>] [COMMAND]
[-g=<groupId>] -n=<name> [-t=<type>] [-v=<version>]
[COMMAND]
Use with generate command to generate a domino-mvp template project
-api, --generate-api If true will generate an api module for REST
endpoints implementation, current implementation
is Quarkus with jax-rs.
-c, --compiler=<compiler> The Java to JavaScript compiler to be used
possible values [gwt, j2cl] default is [gwt]
-d, --dir=<workingDire> absolute path to the directory where the project
should be generated.
-g, --groupId=<groupId> The project group ID, this will be used also for
root package name
-n, --name=<name> The project name, also will be use as the artifact
ID
-api, --generate-api If true will generate an api module for REST endpoints implementation,
current implementation is Quarkus with jax-rs. - not supported by Brix app -.
-c, --compiler=<compiler> The Java to JavaScript compiler to be used possible values [gwt, j2cl] default is [gwt].
-d, --dir=<workingDire> absolute path to the directory where the project should be generated.
-g, --groupId=<groupId> The project group ID, this will be used also for root package name.
-n, --name=<name> The project name, also will be use as the artifact ID.
-t, --type=<type> The type of the project :
-[basic] : will generate a simple project with
(client, shared, server)
-[mvp] : will generate a domino-mvp project
-[basic] : will generate a simple project with (client, shared, server)
-[mvp] : will generate a domino-mvp project template.
-[brix] : will generate a domino-brix project template.
-v, --version=<version> DominoKit tools version
-[v1] : Will generate a project using DominoKi tools version 1.x.x. - not supported by brix -
-[v2] : Will generate a project using DominoKi tools version 2.x.x.
-[dev] : Will generate a project using DominoKit tools HEAD-SNAPSHOT versions.
Commands:
help Displays help information about the specified command
help Display help information about the specified command.
```

Expand All @@ -83,23 +93,23 @@ Usage: domino generate module [-bst] [-c=<compiler>] [-d=<workingDire>]
-n=<name> [-p=<prefix>] [-sp=<subPackage>]
[COMMAND]
Use with generate command to generate a domino-mvp module template
-b, --backend if true will generate a domino-mvp backend module,
default implementation is vertx.
-c, --compiler=<compiler> The Java to JavaScript compiler to be used possible
values [gwt, j2cl] default is [gwt]
-d, --dir=<workingDire> absolute path to the module where the project
should be generated.
-n, --name=<name> The module name, also will be use as the artifact ID
-b, --backend if true will generate a domino-mvp backend module, default implementation is vertx.
-c, --compiler=<compiler> The Java to JavaScript compiler to be used possible values [gwt, j2cl] default is [gwt].
-d, --dir=<workingDire> absolute path to the module where the project should be generated.
-n, --name=<name> The module name, also will be use as the artifact ID.
-p, --prefix=<prefix> The module prefix to be used in the generated
classes name, if not present module name will be
used instead
-s, --single If true it will merge client an shared as one
module, a backend module will not be generated
-sp, --subpackage=<subPackage>
the module sub package, this will be appended to
the application rootPackage
-t, --tests if true will generate tests for a multi submodules
module.
classes name, if not present module name will be used instead.
-s, --single If true it will merge client an shared as one module, a backend module will not be generated.
-sp, --subpackage=<subPackage>
the module sub package, this will be appended to the application rootPackage.
-t, --tests if true will generate tests for a multi submodules module.
Commands:
help Displays help information about the specified command
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.dominokit</groupId>
<artifactId>domino-cli</artifactId>
<version>2.0.0-RC4</version>
<version>2.0.0-RC5</version>
<properties>
<snapshot.version>HEAD-SNAPSHOT</snapshot.version>
<next.release.version>2.0.0-RC4</next.release.version>
<next.release.version>2.0.0-RC5</next.release.version>
<release.version>0.0.0-HEAD-SNAPSHOT</release.version>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<maven.compiler.release>17</maven.compiler.release>
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/org/dominokit/cli/VersionProfile.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,22 @@ private static VersionProfile get(String version) {
ToolVersion.of("domino_mvp_version", "1.0.0"),
ToolVersion.of("domino_rest_version", "1.0.1"),
ToolVersion.of("domino_jackson_version", "1.0.4"),
ToolVersion.of("domino_auto_version", "1.0.2"),
ToolVersion.of("domino_brix_version", "HEAD-SNAPSHOT"),
ToolVersion.of("quarkus_version", "2.16.7.Final"),
ToolVersion.of("vertx_version", "3.9.4"),
ToolVersion.of("gwt_version", "2.10.0"),
ToolVersion.of("j2cl_maven_plugin_version", "0.21.0")
);
case "v2":
return new VersionProfile(version, version,
ToolVersion.of("domino_ui_version", "2.0.0"),
ToolVersion.of("domino_ui_version", "2.0.1"),
ToolVersion.of("domino_history_version", "1.0.3"),
ToolVersion.of("domino_mvp_version", "2.0.0-RC2"),
ToolVersion.of("domino_rest_version", "2.0.0-RC1"),
ToolVersion.of("domino_jackson_version", "1.0.4"),
ToolVersion.of("domino_auto_version", "1.0.2"),
ToolVersion.of("domino_brix_version", "HEAD-SNAPSHOT"),
ToolVersion.of("quarkus_version", "3.6.5"),
ToolVersion.of("vertx_version", "3.9.4"),
ToolVersion.of("gwt_version", "2.11.0"),
Expand All @@ -71,6 +75,8 @@ private static VersionProfile get(String version) {
ToolVersion.of("domino_mvp_version", "HEAD-SNAPSHOT"),
ToolVersion.of("domino_rest_version", "HEAD-SNAPSHOT"),
ToolVersion.of("domino_jackson_version", "HEAD-SNAPSHOT"),
ToolVersion.of("domino_auto_version", "1.0.2"),
ToolVersion.of("domino_brix_version", "HEAD-SNAPSHOT"),
ToolVersion.of("quarkus_version", "3.6.5"),
ToolVersion.of("vertx_version", "3.9.4"),
ToolVersion.of("gwt_version", "2.11.0"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ public class GenerateAppCommand implements Runnable {
names = {"-t", "--type"},
description = "The type of the project :" +
"\n\t\t -[basic] : will generate a simple project with (client, shared, server)" +
"\n\t\t -[mvp] : will generate a domino-mvp project",
defaultValue = "mvp"
"\n\t\t -[mvp] : will generate a domino-mvp project template"+
"\n\t\t -[brix] : will generate a domino-brix project template",
defaultValue = "brix"
)
private String type;

Expand All @@ -70,7 +71,7 @@ public class GenerateAppCommand implements Runnable {
names = {"-api", "--generate-api"},
fallbackValue = "true",
defaultValue = "true",
description = "If true will generate an api module for REST endpoints implementation, current implementation is Quarkus with jax-rs."
description = "If true will generate an api module for REST endpoints implementation, current implementation is Quarkus with jax-rs. - not supported by Brix app -"
)
private boolean generateApi;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.dominokit.cli.commands;

import org.dominokit.cli.PomUtil;
import org.dominokit.cli.VersionProfile;
import org.dominokit.cli.generator.module.Module;
import org.dominokit.cli.generator.module.ModuleCreatorFactory;
Expand Down Expand Up @@ -50,14 +51,22 @@ public class GenerateModuleCommand implements Runnable {
)
private boolean generateTests = false;


@Option(
names = {"-c", "--compiler"},
fallbackValue = "gwt",
defaultValue = "gwt",
description = "The Java to JavaScript compiler to be used possible values [gwt, j2cl] default is [gwt]"
)
private String compiler;
@Option(
names = {"-f", "--framework"},
fallbackValue = "mvp",
defaultValue = "mvp",
description = "The target framework " +
"\n\t\t -[mvp] : [Default] Will generate domino-mvp module." +
"\n\t\t -[brix] : Will generate domino-brix module"
)
private String framework;

@Option(
names = {"-sp", "--subpackage"},
Expand All @@ -81,7 +90,7 @@ public class GenerateModuleCommand implements Runnable {
names = {"-b", "--backend"},
fallbackValue = "false",
defaultValue = "false",
description = "if true will generate a domino-mvp backend module, default implementation is vertx."
description = "if true will generate a domino-mvp backend module, default implementation is vertx. - not supported by brix -"
)
private boolean backend = false;

Expand Down Expand Up @@ -109,7 +118,7 @@ public void run() {
}
module.setSubPackage(subPackage);

ModuleCreatorFactory.get(compiler, single).create(module.init());
ModuleCreatorFactory.get(framework, compiler, single).create(module.init());
System.out.println("The following module have been created");
System.out.println(module);
} catch (Exception e) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/org/dominokit/cli/generator/module/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public String getName() {
public String getModuleName(){
return NameUtil.capitalizedName(name);
}
public String getModulePackage(){
return name.toLowerCase();
}

public Project getProject() {
return project;
Expand Down Expand Up @@ -166,6 +169,7 @@ public Map<String, Object> context() {
context.put("generateTests", generateTests);
context.put("compiler", compiler);
context.put("generateBackend", generateBackend);
context.put("modulePackage", getModulePackage());

return context;
}
Expand All @@ -184,6 +188,7 @@ public String toString() {
"\n\t generateTests=" + generateTests +
"\n\t compiler='" + compiler + '\'' +
"\n\t generateBackend=" + generateBackend +
"\n\t modulePackage=" + getModulePackage() +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

public class ModuleCreatorFactory {

public static ModuleCreator get(String compiler, boolean single){
public static ModuleCreator get(String projectType, String compiler, boolean single){

switch (compiler.toLowerCase()){
case "gwt": return GWTModuleFactory.get(single);
case "gwt": return GWTModuleFactory.get(projectType, single);
case "j2cl": return J2CLModuleFactory.get(single);
default:throw new InvalidCompilerTypeException("Invalid compiler type : ["+compiler+"]");
}
Expand Down
Loading

0 comments on commit b42b165

Please sign in to comment.