Add time printer.
Hide pkgcmd return string for RunCLICommand.java
Change-Id: I63da23926705aad92744be1ecc2eba2382d1919d
Signed-off-by: hyunsik.noh <hyunsik.noh@samsung.com>
{ "build-web", "--output -opt --optimize -euf --exclude-uifw -efum --exclude-uifw-min" },
{ "sign", "--profile" },
{ "package", "--type --sign -ref --ref-project" },
- { "install", "--target" },
- { "uninstall", "--target --pkgid" },
- { "run", "--target --pkgid"},
+ { "install", "--target -n --name" },
+ { "uninstall", "--target --pkgId" },
+ { "run", "--target --pkgId"},
{ "debug", "--target" }
};
//RUN(RUN)
public static String RUN_FAIL_CANNOT_FIND_APP_NAME;
+ public static String RUN_LAUNCHING_PACKAGE;
+ public static String RUN_SUCCESS_PACKAGE;
+ public static String RUN_FAIL_PACKAGE;
//LIST
public static String LIST_NO_DEVICE;
RUN_FAIL_CANNOT_FIND_APP_NAME = [Fail]Can not find app name.
LIST_NO_DEVICE = There is no device.
+RUN_LAUNCHING_PACKAGE = Launching the Tizen application...
+RUN_SUCCESS_PACKAGE = Tizen application is successfully launched.
+RUN_FAIL_PACKAGE = Could not launch the {0} application.
\ No newline at end of file
\r
BuildNative runCommand = command.runCommand();\r
}\r
+ \r
+ public boolean needPrintTime() {\r
+ return true;\r
+ }\r
\r
}
\ No newline at end of file
@Option(name = "--target", usage = "Target to install the package")
private String target;
+ @Option(name = "--name", aliases ="-n", usage = "The package name to install")
+ private String name;
+
@Override
public void execute() {
log.trace("Execute InstallCLI...");
InstallCLICommand command = new InstallCLICommand();
command.setWorkingDir(workingDir == null ? currentWorkspacePath : workingDir);
command.setTarget(target);
+ command.setName(name);
Install runCommand = command.runCommand();
}
+
+ public boolean needPrintTime() {
+ return true;
+ }
}
command.setWorkingDir(workingDir == null ? currentWorkspacePath : workingDir);\r
Sign sign = command.runCommand();\r
}\r
+ \r
+ public boolean needPrintTime() {\r
+ return true;\r
+ }\r
}\r
@Option(name = "--target", usage = "Target to uninstall the package")
private String target;
- @Option(name = "--pkgid", usage = "Package Id to uninstall")
+ @Option(name = "--pkgId", usage = "Package Id to uninstall")
private String pkgId;
@Override
command.setPkgId(pkgId);
Uninstall runCommand = command.runCommand();
}
+
+ public boolean needPrintTime() {
+ return true;
+ }
}
log.debug("[target]: " + (target == null ? "null" : targetSerialId));
}
+ public void setName(String name) {
+ this.name = name;
+ log.debug("[name]: " + name);
+ }
+
private boolean isValidPackage() {
log.trace("=validate package=");
boolean result = true;
*/
package org.tizen.ncli.ide.subcommands;
+import org.eclipse.osgi.util.NLS;
import org.tizen.ncli.ide.CLIConstant;
import org.tizen.ncli.ide.messages.TizenCLIMessages;
import org.tizen.ncli.ide.util.TargetUtil;
private String appTypeCommand = "/usr/bin/pkginfo --pkg %s | grep -i Type";
private String runNativeAppCommand = "launch_app %s.%s";
private String runWebAppCommand = "/usr/bin/wrt-launcher --s %s.%s --t 60000";
+ private final String SUCCESS= "result: launched";
public RunCLICommand() {
}
@Override
protected Run call() {
- progressLog.info("[Start] Run Tizen App");
if(target != null) {
appName = getAppName();
appType = getAppType();
if(appName != null && appType != null ) {
//run
- runApp();
+ if(runApp()) {
+ progressLog.info(TizenCLIMessages.RUN_SUCCESS_PACKAGE);
+ } else {
+ String appId = pkgId + "." + appName;
+ progressLog.info(NLS.bind(TizenCLIMessages.RUN_FAIL_PACKAGE, appId));
+ }
} else {
progressLog.info(TizenCLIMessages.RUN_FAIL_CANNOT_FIND_APP_NAME);
}
} else {
progressLog.info(TizenCLIMessages.FAIL_TARGET);
}
- progressLog.info("[End] Run Tizen App");
return null;
}
return appType;
}
- private String runApp() {
+ private boolean runApp() {
+ boolean result = false;
log.info("=run app=");
- String result = null;
+ progressLog.info(TizenCLIMessages.RUN_LAUNCHING_PACKAGE);
String runCommand = null;
if(CLIConstant.NATIVE_PKG_EXT.equals(appType)) {
runCommand = String.format(runNativeAppCommand, pkgId, appName);
runCommand = String.format(runWebAppCommand, pkgId, appName);
}
log.debug("[Run Command]]: " + runCommand);
- result = TargetUtil.getDefault().returnExecuteCommand(target, runCommand);
- progressLog.info(result);
+ String returnResult = TargetUtil.getDefault().returnExecuteCommand(target, runCommand);
+ String[] tokens = returnResult.split("\n");
+ for(String token : tokens) {
+ if(SUCCESS.equals(token)) {
+ result = true;
+ break;
+ }
+ }
return result;
}
}