Skip to content

Commit

Permalink
Merge branch 'release/1.0.22'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuflatland-lf committed Apr 29, 2019
2 parents 2c7c2de + f4f4c0f commit 6e35ef3
Show file tree
Hide file tree
Showing 21 changed files with 727 additions and 501 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ curl https://raw.githubusercontent.com/yasuflatland-lf/damascus/master/installer
### Getting started
Let's make a Todo app with damascus
1. Create a Liferay workspace with Blade cli or Liferay IDE / Liferay Developer Studio. For more details, please see [this document](https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-1/blade-cli).
2. After creating Liferay workspace, navigate to under ```modules``` folder and run ```damascus -init Todo -p com.liferay.sb.test -v 7.1```
2. After creating Liferay workspace, navigate to under ```modules``` folder and run ```damascus init Todo -p com.liferay.sb.test -v 7.1```
3. Navigate to ```todo``` folder. You'll see ```base.json``` file is created. For detailed configuration, please see [the official documentation](https://yasuflatland-lf.github.io/damascus-doc/). Just for demonstration now, we'll create a scaffolding as it is.
4. Type ```damascus -create``` and damascus will create a scaffolding service and portlet according to the base.json file.
4. Type ```damascus create``` and damascus will create a scaffolding service and portlet according to the base.json file.
5. Start up your Liferay server and in the ```Todo``` folder, type ```blade deploy```. Blade will run properly and service and portlet will be deployed.

### How to compile Damascus on your own?
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jar {
manifest {
attributes(
"Bundle-SymbolicName": "com.liferay.damascus.cli",
"Bundle-Version": "1.0.21",
"Bundle-Version": "1.0.22",
"Bundle-Description": "Liferay extension tool for scaffolding service builder portlet",
"Main-Class": "com.liferay.damascus.cli.Damascus",
"JPM-Command": "damascus"
Expand Down
Binary file modified latest/damascus.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
com.liferay.damascus.cli.InitCommand
com.liferay.damascus.cli.CreateCommand
com.liferay.damascus.cli.TemplateGeneratorCommand
21 changes: 21 additions & 0 deletions src/main/java/com/liferay/damascus/cli/BaseArgs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.liferay.damascus.cli;

import com.beust.jcommander.Parameter;
import com.liferay.damascus.cli.common.DamascusProps;
import com.liferay.damascus.cli.validators.VersionValidator;
import lombok.Data;

@Data
public class BaseArgs {

public boolean isHelp() {
return _help;
}

@Parameter(description = "Get help on a specific command.", help = true, names = "--help")
private boolean _help;

@Parameter(names = "-v", description = "Target Liferay Version. (e.g. 7.1)", validateWith = VersionValidator.class)
private String liferayVersion = DamascusProps.VERSION_71;

}
34 changes: 34 additions & 0 deletions src/main/java/com/liferay/damascus/cli/BaseCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.liferay.damascus.cli;

public abstract class BaseCommand<T extends BaseArgs> {
public BaseCommand() {
}

public BaseCommand(Damascus damascus, T args) {
_damascus = damascus;
_args = args;
}

public abstract void execute() throws Exception;

public T getArgs() {
return _args;
}

public abstract Class<T> getArgsClass();

public Damascus getDamascus() {
return _damascus;
}

public void setArgs(BaseArgs commandArgs) {
_args = getArgsClass().cast(commandArgs);
}

public void setDamascus(Damascus damascus) {
_damascus = damascus;
}

private T _args;
private Damascus _damascus;
}
19 changes: 19 additions & 0 deletions src/main/java/com/liferay/damascus/cli/CreateArgs.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.liferay.damascus.cli;

import com.beust.jcommander.Parameters;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

/**
* Create command arguments
*
* @author Yasuyuki Takeo
*/
@Parameters(
commandDescription = "Create service(s) according to base.json.",
commandNames = "create"
)
@Slf4j
public class CreateArgs extends BaseArgs {

}
Loading

0 comments on commit 6e35ef3

Please sign in to comment.