diff --git a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java index 30ed23b..e6014c8 100644 --- a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java +++ b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonDeserializerImpl.java @@ -1,5 +1,6 @@ package org.dominokit.cli.model; +import java.lang.Boolean; import java.lang.Class; import java.lang.Object; import java.lang.Override; @@ -9,6 +10,7 @@ import org.dominokit.jacksonapt.JsonDeserializationContext; import org.dominokit.jacksonapt.JsonDeserializer; import org.dominokit.jacksonapt.JsonDeserializerParameters; +import org.dominokit.jacksonapt.deser.BooleanJsonDeserializer; import org.dominokit.jacksonapt.deser.StringJsonDeserializer; import org.dominokit.jacksonapt.deser.bean.AbstractBeanJsonDeserializer; import org.dominokit.jacksonapt.deser.bean.BeanPropertyDeserializer; @@ -118,6 +120,28 @@ public void setValue(Project bean, String value, JsonDeserializationContext ctx) bean.setModuleShortName(value); } }); + map.put("hasParent", new BeanPropertyDeserializer() { + @Override + protected JsonDeserializer newDeserializer() { + return BooleanJsonDeserializer.getInstance(); + } + + @Override + public void setValue(Project bean, Boolean value, JsonDeserializationContext ctx) { + bean.setHasParent(value); + } + }); + map.put("parentArtifactId", new BeanPropertyDeserializer() { + @Override + protected JsonDeserializer newDeserializer() { + return StringJsonDeserializer.getInstance(); + } + + @Override + public void setValue(Project bean, String value, JsonDeserializationContext ctx) { + bean.setParentArtifactId(value); + } + }); return map; } } diff --git a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java index 048c843..b0d3c2d 100644 --- a/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java +++ b/src/main/generated/org/dominokit/cli/model/ProjectBeanJsonSerializerImpl.java @@ -1,10 +1,12 @@ package org.dominokit.cli.model; +import java.lang.Boolean; import java.lang.Class; import java.lang.Override; import java.lang.String; import org.dominokit.jacksonapt.JsonSerializationContext; import org.dominokit.jacksonapt.JsonSerializer; +import org.dominokit.jacksonapt.ser.BooleanJsonSerializer; import org.dominokit.jacksonapt.ser.StringJsonSerializer; import org.dominokit.jacksonapt.ser.bean.AbstractBeanJsonSerializer; import org.dominokit.jacksonapt.ser.bean.BeanPropertySerializer; @@ -20,7 +22,7 @@ public Class getSerializedType() { @Override protected BeanPropertySerializer[] initSerializers() { - BeanPropertySerializer[] result = new BeanPropertySerializer[6]; + BeanPropertySerializer[] result = new BeanPropertySerializer[8]; result[0] = new BeanPropertySerializer("name") { @Override protected JsonSerializer newSerializer() { @@ -87,6 +89,28 @@ public String getValue(Project bean, JsonSerializationContext ctx) { return bean.getModuleShortName(); } }; + result[6] = new BeanPropertySerializer("hasParent") { + @Override + protected JsonSerializer newSerializer() { + return BooleanJsonSerializer.getInstance(); + } + + @Override + public Boolean getValue(Project bean, JsonSerializationContext ctx) { + return bean.isHasParent(); + } + }; + result[7] = new BeanPropertySerializer("parentArtifactId") { + @Override + protected JsonSerializer newSerializer() { + return StringJsonSerializer.getInstance(); + } + + @Override + public String getValue(Project bean, JsonSerializationContext ctx) { + return bean.getParentArtifactId(); + } + }; return result; } } diff --git a/src/main/java/org/dominokit/cli/commands/CLIConfig.java b/src/main/java/org/dominokit/cli/commands/CLIConfig.java new file mode 100644 index 0000000..37b3fff --- /dev/null +++ b/src/main/java/org/dominokit/cli/commands/CLIConfig.java @@ -0,0 +1,9 @@ +package org.dominokit.cli.commands; + +import java.util.Arrays; +import java.util.List; + +public class CLIConfig { + + public static final List RESOURCE_EXTENSIONS = Arrays.asList("ico", "png", "jpg"); +} diff --git a/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java b/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java index 475a8ab..32b3741 100644 --- a/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java +++ b/src/main/java/org/dominokit/cli/commands/GenerateAppCommand.java @@ -3,7 +3,6 @@ import org.apache.commons.io.FileUtils; import org.apache.maven.model.Model; import org.dominokit.cli.PomUtil; -import org.dominokit.cli.model.Module; import org.dominokit.cli.model.Project; import org.dominokit.cli.structure.files.VelocityContentProcessor; import org.dominokit.cli.structure.folders.Folder; @@ -89,6 +88,7 @@ public void run() { } } else { project.setVersion(VERSION); + project.setGroupId(groupId); } project.setRootPackage(groupId); diff --git a/src/main/java/org/dominokit/cli/commands/TemplateConfig.java b/src/main/java/org/dominokit/cli/commands/TemplateConfig.java index ca09940..e8d8457 100644 --- a/src/main/java/org/dominokit/cli/commands/TemplateConfig.java +++ b/src/main/java/org/dominokit/cli/commands/TemplateConfig.java @@ -14,9 +14,7 @@ public class TemplateConfig { private Map conditions = new HashMap<>(); public TemplateConfig(String name, Path templateRoot) throws IOException { - Properties properties = new Properties(); - properties.load(Test.class.getClassLoader().getResourceAsStream("cli-config.properties")); - resourcesExtensions = Arrays.asList(properties.getProperty("resources.extensions").split(",")); + resourcesExtensions = CLIConfig.RESOURCE_EXTENSIONS; this.templateRoot = templateRoot; this.name = name; } diff --git a/src/main/java/org/dominokit/cli/commands/Test.java b/src/main/java/org/dominokit/cli/commands/Test.java index 89127e9..021acef 100644 --- a/src/main/java/org/dominokit/cli/commands/Test.java +++ b/src/main/java/org/dominokit/cli/commands/Test.java @@ -38,7 +38,10 @@ public static void main(String[] args) { String[] module3Args = new String[]{"gen", "module", "-n", "home", "-sp", "home.street", "-t","-d", out+"/sample"}; commandLine.execute(module3Args); - String[] module4Args = new String[]{"gen", "app", "-t", "basic", "-n", "j2cltest", "--j2cl", "-g", "com.foo","-d", out}; + String[] module4Args = new String[]{"gen", "app", "-t", "basic", "-n", "j2cltest", "--j2cl", "-g", "com.foo","-d", out+"/sample"}; commandLine.execute(module4Args); + + String[] basicGwt = new String[]{"gen", "app", "-t", "basic", "-n", "gwttest", "-g", "com.foo","-d", out+"/sample"}; + commandLine.execute(basicGwt); } } diff --git a/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java b/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java index 9afe0df..4e47fde 100644 --- a/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java +++ b/src/main/java/org/dominokit/cli/generator/MultiModuleGenerator.java @@ -56,7 +56,7 @@ private void addFrontEndDependencies(Module module, String frontEndPomString) th "\n\t\t\t${project.version}" + "\n\t\t" + "\n" + - "\n\t"); + "\t"); if(!module.isJ2cl()) { frontEndPomString = frontEndPomString @@ -68,25 +68,23 @@ private void addFrontEndDependencies(Module module, String frontEndPomString) th "\n\t\t\tsources" + "\n\t\t" + "\n" + - "\n\t"); + "\t"); } frontEndPomString = frontEndPomString .replace("", - "\n" + "\n\t\t" + "\n\t\t\t" + module.getProject().getGroupId() + "" + "\n\t\t\t" + module.getArtifactId() + "-frontend-ui" + "\n\t\t\t${project.version}" + "\n\t\t" + "\n" + - "\n\t"); + "\t"); if(!module.isJ2cl()){ frontEndPomString = frontEndPomString .replace("", - "\n" + "\n\t\t" + "\n\t\t\t" + module.getProject().getGroupId() + "" + "\n\t\t\t" + module.getArtifactId() + "-frontend-ui" + @@ -94,7 +92,7 @@ private void addFrontEndDependencies(Module module, String frontEndPomString) th "\n\t\t\tsources" + "\n\t\t" + "\n" + - "\n\t"); + "\t"); } FileUtils.write(module.getFrontendPom().getPomFile(), frontEndPomString, StandardCharsets.UTF_8);