-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
727 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
out/production/resources/META-INF/services/com.liferay.damascus.cli.BaseCommand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
||
} |
Oops, something went wrong.