import java.io.DataOutputStream;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
+import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
private static void init() {
- try {
- if (LOG_TO_FILE) {
- StringBuffer logPath = new StringBuffer();
- logPath.append(InstallPathConfig.getUserDataPath())
- .append(File.separatorChar).append("dynamic-analyzer")
- .append(File.separatorChar).append("logs");
-
- File logs = new File(logPath.toString());
- if (!logs.exists()) {
- logs.mkdir();
- }
-
- SimpleDateFormat format = new SimpleDateFormat(
- "yyyy_MM_dd_HH-mm-ss", //$NON-NLS-1$
- Locale.KOREA);
- Date date = new Date();
- String logFileName = "da_ide_log_" + format.format(date);
-
- logPath.append(File.separatorChar).append(logFileName);
-
- file = new File(logPath.toString());
- file.getParentFile().mkdirs();
+
+ if (LOG_TO_FILE) {
+ StringBuffer logPath = new StringBuffer();
+ logPath.append(InstallPathConfig.getUserDataPath())
+ .append(File.separatorChar).append("dynamic-analyzer")//$NON-NLS-1$
+ .append(File.separatorChar).append("logs");//$NON-NLS-1$
+
+ File logs = new File(logPath.toString());
+ if (!logs.exists()) {
+ logs.mkdir();
+ }
+
+ SimpleDateFormat format = new SimpleDateFormat(
+ "yyyy_MM_dd_HH-mm-ss", //$NON-NLS-1$
+ Locale.KOREA);
+ Date date = new Date();
+ String logFileName = "da_ide_log_" + format.format(date);//$NON-NLS-1$
+
+ logPath.append(File.separatorChar).append(logFileName);
+
+ file = new File(logPath.toString());
+ file.getParentFile().mkdirs();
+ try {
fos = new FileOutputStream(file);
- dos = new DataOutputStream(fos);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
}
- } catch (Exception e) {
- e.printStackTrace();
+ dos = new DataOutputStream(fos);
}
}
- public static void printLog( final String logMsg ) {
- try {
- if (LOG_TO_FILE) {
- if (setInit == false) {
- setInit = true;
- init();
- }
- dos.writeBytes( logMsg );
- dos.writeChars("\n");
+ public static void printLog(final String logMsg) {
+
+ if (LOG_TO_FILE) {
+ if (setInit == false) {
+ setInit = true;
+ init();
+ }
+ try {
+ dos.writeBytes(logMsg);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try {
+ dos.writeChars("\n");//$NON-NLS-1$
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try {
dos.flush();
- } else {
- System.out.println(logMsg);
+ } catch (IOException e) {
+ e.printStackTrace();
}
- } catch (Exception e) {
- e.printStackTrace();
+ } else {
+ System.out.println(logMsg);
}
+
}
- public static void printLog( Exception errMsg ) {
- try {
- if (LOG_TO_FILE) {
- if (setInit == false) {
- setInit = true;
- init();
- }
- dos.writeBytes( printStackTraceToString(errMsg) );
- dos.writeChars("\n");
+ public static void printLog(Exception errMsg) {
+
+ if (LOG_TO_FILE) {
+ if (setInit == false) {
+ setInit = true;
+ init();
+ }
+ try {
+ dos.writeBytes(printStackTraceToString(errMsg));
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try {
+ dos.writeChars("\n");//$NON-NLS-1$
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ try {
dos.flush();
- } else {
- errMsg.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
}
- } catch (Exception e) {
- e.printStackTrace();
+ } else {
+ errMsg.printStackTrace();
}
+
}
- private static String printStackTraceToString( Throwable e ) {
+ private static String printStackTraceToString(Throwable e) {
StringBuilder sb = new StringBuilder();
- try {
- sb.append(e.toString());
- sb.append("\n");
- StackTraceElement element[] = e.getStackTrace();
- for (int idx = 0; idx < element.length; idx++) {
- sb.append("\tat ");
- sb.append(element[idx].toString());
- sb.append("\n");
- }
- } catch (Exception ex) {
- return e.toString();
+ String returnString = null;
+ sb.append(e.toString());
+ sb.append("\n");//$NON-NLS-1$
+ StackTraceElement element[] = e.getStackTrace();
+ for (int idx = 0; idx < element.length; idx++) {
+ sb.append("\tat ");//$NON-NLS-1$
+ sb.append(element[idx].toString());
+ sb.append("\n");//$NON-NLS-1$
}
- return sb.toString();
+ returnString = sb.toString();
+ return returnString;
}
public static void dlgErrorMessage( final String title, final String message ) {
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
+import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
TizenNativeApplicationProfileDelegate.project = project;
IConfiguration config = ManagedBuildManager.getBuildInfo(project).getDefaultConfiguration();
IProjectLaunchCommand manifest = ProjectUtil.getProjectManifest(project);
- String launchArchitecture = manifest.getArchitecture(config);
- List<IDevice> connectedDeviceList = Arrays.asList(SmartDevelopmentBridge.getBridge().getDevices());
- List<IDevice> matchedDeviceList = new ArrayList<IDevice>();
- if(LaunchUtils.isX86(launchArchitecture)){
- for(IDevice device : connectedDeviceList) {
- if(device.getArch().equals(Arch.X86)) {
- matchedDeviceList.add(device);
- }
- }
- } else {
- for(IDevice device : connectedDeviceList) {
- if(device.getArch().equals(Arch.ARM)) {
- matchedDeviceList.add(device);
- }
- }
- }
-
+ String launchArchitecture = manifest.getArchitecture(config);
+ List<IDevice> connectedDeviceList = Arrays.asList(SmartDevelopmentBridge.getBridge().getDevices());
+ List<IDevice> matchedDeviceList = new ArrayList<IDevice>();
+ if(LaunchUtils.isX86(launchArchitecture)) {
+ for(IDevice device : connectedDeviceList){
+ if(device.getArch().equals(Arch.X86)) {
+ matchedDeviceList.add(device);
+ }
+ }
+ }
+ else {
+ for(IDevice device : connectedDeviceList){
+ if(device.getArch().equals(Arch.ARM)) {
+ matchedDeviceList.add(device);
+ }
+ }
+ }
+
if(matchedDeviceList.size() > 1) {
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- TizenLaunchDeviceSelectionDialog devicediDialog = new TizenLaunchDeviceSelectionDialog(shell, matchedDeviceList);
- if(devicediDialog.open() == Window.OK) {
- currentDevice = devicediDialog.getSelectedDevice();
- } else {
- currentDevice = null;
- }
- } else if(matchedDeviceList.size() == 1) {
+ TizenLaunchDeviceSelectionDialog deviceDialog = new TizenLaunchDeviceSelectionDialog(shell, matchedDeviceList);
+ if(deviceDialog.open() == Window.OK)
+ {
+ currentDevice = deviceDialog.getSelectedDevice();
+ }
+ else
+ {
+ currentDevice = null;
+ }
+ } else if(matchedDeviceList.size() == 1){
currentDevice = matchedDeviceList.get(0);
} else {
currentDevice = null;
}
-
if (currentDevice == null) {
DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_CONNECT_TO_DEVICE);
} else {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
- DALog.printLog(e);
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileManager - InterruptedException");
}
bWaitReceiveDataCount--;
}
DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_LAUNCH_PROJECT);
}
}
-
}
private static boolean copyDAProbeFile() {
- CommonProjectDependentBuilder builder = ProjectTypeManager.getProjectBuilderInstance(project);
+ CommonProjectDependentBuilder builder = ProjectTypeManager
+ .getProjectBuilderInstance(project);
strProjectDAProvePath = new StringBuffer();
- strProjectDAProvePath.append(builder.getProjectPath()).append(File.separatorChar)
+ strProjectDAProvePath.append(builder.getProjectPath())
+ .append(File.separatorChar)
.append("lib").append(File.separatorChar).append(LIBDAPROBE_SO); //$NON-NLS-1$
strSDKDAProbePath = new StringBuffer();
- strSDKDAProbePath.append(InstallPathConfig.getSDKPath()).append(File.separatorChar)
+ strSDKDAProbePath
+ .append(InstallPathConfig.getSDKPath())
+ .append(File.separatorChar)
.append("library").append(File.separatorChar).append("da").append(File.separatorChar);//$NON-NLS-1$ $NON-NLS-2$
if (currentDevice.getArch().equals(Arch.X86)) {
}
strSDKDAProbePath.append(LIBDAPROBE_SO);//$NON-NLS-1$
+ File inFile = new File(strSDKDAProbePath.toString());
+ FileInputStream inputStream;
try {
- File inFile = new File(strSDKDAProbePath.toString());
- FileInputStream inputStream = new FileInputStream(inFile);
-
+ inputStream = new FileInputStream(inFile);
File outFile = new File(strProjectDAProvePath.toString());
FileOutputStream outputStream = new FileOutputStream(outFile);
FileChannel fcout = outputStream.getChannel();
long size = fcin.size();
+
fcin.transferTo(0, size, fcout);
fcout.close();
outputStream.close();
inputStream.close();
return true;
-
- } catch (Exception e) {
- DALog.printLog(e);
- return false;
+ } catch (FileNotFoundException e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - copyDAProbeFile - FileNotFoundException");
+ } catch (IOException e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - copyDAProbeFile - IOException");
}
+
+ return false;
}
private static boolean deleteDAProbeFile() {
- try {
- File deleteFile = new File(strProjectDAProvePath.toString());
- deleteFile.delete();
- return true;
- } catch (Exception e) {
- DALog.printLog(e);
- return false;
- }
+ File deleteFile = new File(strProjectDAProvePath.toString());
+ deleteFile.delete();
+ return true;
}
private static void profileWithDABuild() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ProgressMonitorDialog dialog = new ProgressMonitorDialog(window.getShell());
- try {
- dialog.run(true, true, new IRunnableWithProgress() {
- @SuppressWarnings("deprecation")
- @Override
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- monitor.beginTask(Labels.MESSAGE_PREPARING_PROFILE, 1);
- if (verifyDeviceReachability(currentDevice, project)) {
- monitor.done();
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
- bSuccessBuild = false;
- return;
- }
-
- IProjectLaunchCommand manifest = null;
-
- //
- // package build
- //
- final String configName;
- IStatus status = null;
- if (currentDevice.getArch().equals(Arch.X86)) {
- configName = CONFIG_NAME_EMULATOR;
- } else {
- configName = CONFIG_NAME_DEVICE;
- }
- prevBuildConfiguration = ManagedBuildManager.getBuildInfo(project).getConfigurationName();
- ManagedBuildManager.getBuildInfo(project).setDefaultConfiguration(configName);
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- ConfigurationActionManager.notifyConfigurationSelectionChangedListener(configName);
+ try {
+ dialog.run(true, true, new IRunnableWithProgress() {
+ @SuppressWarnings("deprecation")
+ @Override
+ public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+ try {
+ monitor.beginTask(Labels.MESSAGE_PREPARING_PROFILE, 1);
+ if (verifyDeviceReachability(currentDevice, project)) {
+ monitor.done();
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
+ bSuccessBuild = false;
+ return;
}
- });
-
- CommonProjectDependentPackager packager = ProjectTypeManager.getProjectPackagerInstance(project);
- // CheckCancelJob cancelJob = new
- // CheckCancelJob(monitor, project,
- // packager.getSbi(),
- // false);
- try {
- project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
- monitor.beginTask(Labels.MESSAGE_PREPARING_PROFILE, 3);
- monitor.subTask(Labels.MESSAGE_BUILDING_PACKAGE);
-
- IMarker[] markers = project.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
- for (int i = 0; i < markers.length; i++) {
- IMarker marker = markers[i];
- int priority = marker.getAttribute(IMarker.SEVERITY, -1);
- if (priority == IMarker.SEVERITY_ERROR) {
- monitor.done();
- bSuccessBuild = false;
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
- return;
+ IProjectLaunchCommand manifest = null;
+
+ //
+ // package build
+ //
+ final String configName;
+ IStatus status = null;
+ if (currentDevice.getArch().equals(Arch.X86)) {
+ configName = CONFIG_NAME_EMULATOR;
+ } else {
+ configName = CONFIG_NAME_DEVICE;
+ }
+ prevBuildConfiguration = ManagedBuildManager.getBuildInfo(project).getConfigurationName();
+ ManagedBuildManager.getBuildInfo(project).setDefaultConfiguration(configName);
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ ConfigurationActionManager.notifyConfigurationSelectionChangedListener(configName);
}
+ });
+
+ CommonProjectDependentPackager packager = ProjectTypeManager.getProjectPackagerInstance(project);
+ // CheckCancelJob cancelJob = new
+ // CheckCancelJob(monitor, project,
+ // packager.getSbi(),
+ // false);
+
+ try {
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+ monitor.beginTask(Labels.MESSAGE_PREPARING_PROFILE, 3);
+ monitor.subTask(Labels.MESSAGE_BUILDING_PACKAGE);
+
+ IMarker[] markers = project.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
+ for (int i = 0; i < markers.length; i++) {
+ IMarker marker = markers[i];
+ int priority = marker.getAttribute(IMarker.SEVERITY, -1);
+ if (priority == IMarker.SEVERITY_ERROR) {
+ monitor.done();
+ bSuccessBuild = false;
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
+ return;
+ }
+ }
+ manifest = ProjectUtil.getProjectManifest(project);
+ manifest.doMultiAppPreProcess(packager, monitor);
+ // Thread checkCancelThread = new
+ // Thread(cancelJob);
+ // checkCancelThread.start();
+
+ IPreferenceStore store = SigningProfileUtil.getPreferenceStore();
+ packager.buildPackage(pkgType, store.getBoolean(SigningPreferencePage.testCertKey));
+
+ // cancelJob.setFinishFlag(true);
+ } catch (SBIException e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - SBIException");
+ status = new Status(Status.ERROR, Activator.PLUGIN_ID, CommonBuildMessages.FAIL_TO_BUILD_PACKAGE);
+ monitor.done();
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
+ bSuccessBuild = false;
+ } catch (CoreException e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - CoreException");
+ status = new Status(Status.ERROR, Activator.PLUGIN_ID, e.getMessage());
+ monitor.done();
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
+ bSuccessBuild = false;
}
- manifest = ProjectUtil.getProjectManifest(project);
- manifest.doMultiAppPreProcess(packager, monitor);
- // Thread checkCancelThread = new
- // Thread(cancelJob);
- // checkCancelThread.start();
-
- IPreferenceStore store = SigningProfileUtil.getPreferenceStore();
- packager.buildPackage(pkgType, store.getBoolean(SigningPreferencePage.testCertKey));
-
- // cancelJob.setFinishFlag(true);
- } catch (SBIException e) {
- DALog.printLog(e);
- status = new Status(Status.ERROR, Activator.PLUGIN_ID, CommonBuildMessages.FAIL_TO_BUILD_PACKAGE);
- // cancelJob.setFinishFlag(true);
- monitor.done();
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
- bSuccessBuild = false;
- return;
- } catch (CoreException e) {
- DALog.printLog(e);
- status = new Status(Status.ERROR, Activator.PLUGIN_ID, e.getMessage());
- // cancelJob.setFinishFlag(true);
- monitor.done();
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
- bSuccessBuild = false;
- return;
- }
- if (packager.checkPackageFile(pkgType)) {
- status = new Status(Status.OK, Activator.PLUGIN_ID, CommonBuildMessages.SUCCESS_TO_BUILD_PACKAGE);
- } else {
- monitor.done();
- status = new Status(Status.ERROR, Activator.PLUGIN_ID, CommonBuildMessages.FAIL_TO_BUILD_PACKAGE);
- DALog.dlgErrorMessage(CommonBuildMessages.BUILD_RESULT, status.getMessage());
- bSuccessBuild = false;
- return;
- }
- //
- // app upload
- //
- File packageFile = null;
- try {
- monitor.worked(2);
- monitor.subTask(TizenLaunchMessages.TRANSFER_PACKAGE);
-
- String packageDirectory = File.separatorChar + configName + File.separatorChar;
- IPath packagePath = new Path(project.getLocation().toString() + packageDirectory);
- packageFile = findPackageFile(packagePath.toFile(), "." + pkgType.toLowerCase(), project);//$NON-NLS-1$
- if (packageFile == null) {
- newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
+ if (bSuccessBuild == false){
+ return;
+ }
+
+ if (packager.checkPackageFile(pkgType)) {
+ status = new Status(Status.OK, Activator.PLUGIN_ID, CommonBuildMessages.SUCCESS_TO_BUILD_PACKAGE);
+ } else {
+ monitor.done();
+ status = new Status(Status.ERROR, Activator.PLUGIN_ID, CommonBuildMessages.FAIL_TO_BUILD_PACKAGE);
+ DALog.dlgErrorMessage(CommonBuildMessages.BUILD_RESULT, status.getMessage());
+ bSuccessBuild = false;
+ return;
}
+
+ //
+ // app upload
+ //
+ File packageFile = null;
+ try {
+ monitor.worked(2);
+ monitor.subTask(TizenLaunchMessages.TRANSFER_PACKAGE);
+
+ String packageDirectory = File.separatorChar + configName + File.separatorChar;
+ IPath packagePath = new Path(project.getLocation().toString() + packageDirectory);
+ packageFile = findPackageFile(packagePath.toFile(), "." + pkgType.toLowerCase(), project);//$NON-NLS-1$
+ if (packageFile == null) {
+ newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
+ }
- String destDirectoryPath = TizenPlatformConstants.TEMPORARY_PKG_PATH;
+ String destDirectoryPath = TizenPlatformConstants.TEMPORARY_PKG_PATH;
- String srcFilePath = packageFile.getAbsoluteFile().getCanonicalPath();
- String destFilePath = destDirectoryPath + packageFile.getAbsoluteFile().getName();
+ String srcFilePath = packageFile.getAbsoluteFile().getCanonicalPath();
+ String destFilePath = destDirectoryPath + packageFile.getAbsoluteFile().getName();
- SyncResult syncSuccess = currentDevice.getSyncService().pushFile(srcFilePath, destFilePath,
- SyncService.getNullProgressMonitor());
+ SyncResult syncSuccess = currentDevice.getSyncService().pushFile(srcFilePath, destFilePath,
+ SyncService.getNullProgressMonitor());
- if (syncSuccess.getCode() != SyncService.RESULT_OK) {
- newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
+ if (syncSuccess.getCode() != SyncService.RESULT_OK) {
+ newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
+ }
+ } catch (CoreException e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - CoreException");
+ monitor.done();
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_TRANSFER_FILE);
+ bSuccessBuild = false;
+ } catch (IOException e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - IOException");
+ monitor.done();
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_TRANSFER_FILE);
+ bSuccessBuild = false;
+ }
+ if (bSuccessBuild == false){
+ return;
}
- } catch (CoreException e) {
- monitor.done();
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_TRANSFER_FILE);
- bSuccessBuild = false;
- return;
- } catch (Exception e) {
- monitor.done();
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_TRANSFER_FILE);
- bSuccessBuild = false;
- return;
- }
- //
- // app install
- //
- try {
- monitor.worked(1);
- monitor.subTask(TizenLaunchMessages.INSTALL_PACKAGE);
-
- // check old application
- String packageName = manifest.getPackageName();
- String listCmd = manifest.getListCommand();
- String listCmdRet = manifest.getListCommandResult();
- TizenLaunchCommand launcher = new TizenLaunchCommand(currentDevice);
- launcher.run(listCmd);
-
- String endLine = launcher.getEndLine();
- if (endLine != null && endLine.contains(listCmdRet)) {
- // remove old application
- String removeCmd = manifest.getRemoveCommand(packageName);
-
- try {
- launcher.run(removeCmd);
- } catch (TizenNativeException e) {
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_INSTALL);
- bSuccessBuild = false;
+ //
+ // app install
+ //
+ try {
+ monitor.worked(1);
+ monitor.subTask(TizenLaunchMessages.INSTALL_PACKAGE);
+
+ // check old application
+ String packageName = manifest.getPackageName();
+ String listCmd = manifest.getListCommand();
+ String listCmdRet = manifest.getListCommandResult();
+ TizenLaunchCommand launcher = new TizenLaunchCommand(currentDevice);
+ launcher.run(listCmd);
+
+ String endLine = launcher.getEndLine();
+ if (endLine != null && endLine.contains(listCmdRet)) {
+ // remove old application
+ String removeCmd = manifest.getRemoveCommand(packageName);
+
+ try {
+ launcher.run(removeCmd);
+ } catch (TizenNativeException e) {
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_INSTALL);
+ bSuccessBuild = false;
+ }
}
- }
- String installCmd = manifest.getInstallCommand(packageFile, pkgType.toLowerCase());
- launcher.run(installCmd);
- } catch (CoreException e) {
- monitor.done();
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_INSTALL);
- bSuccessBuild = false;
- return;
- } catch (Exception e) {
+ String installCmd = manifest.getInstallCommand(packageFile, pkgType.toLowerCase());
+ launcher.run(installCmd);
+ } catch (CoreException e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - app install -CoreException");
+ monitor.done();
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_INSTALL);
+ bSuccessBuild = false;
+ } catch (Exception e) {
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - app install -CoreException");
+ monitor.done();
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_INSTALL);
+ bSuccessBuild = false;
+ }
+ if (bSuccessBuild == false){
+ return;
+ }
+ } finally {
monitor.done();
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, TizenLaunchMessages.CANNOT_INSTALL);
- bSuccessBuild = false;
- return;
}
-
- monitor.done();
-
- } finally {
-
}
- }
- });
- } catch (Exception e) {
- DALog.printLog(e);
- DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
- bSuccessBuild = false;
- }
+ });
+ } catch (InvocationTargetException e) {
+ DALog.printLog(e);
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
+ bSuccessBuild = false;
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - InvocationTargetException");
+ } catch (InterruptedException e) {
+ DALog.printLog(e);
+ DALog.dlgErrorMessage(Labels.MESSAGE_ERROR, Labels.MESSAGE_FAIL_TO_BUILD_PROJECT);
+ bSuccessBuild = false;
+ DALog.printLog("TizenNativeApplicationProfileDelegate - profileWithDABuild - InterruptedException");
+ }
}
});
}
String[] fullCommand = new String[] { "cmd", "/c", command };//$NON-NLS-1$ //$NON-NLS-2$
- int i = 0;
- try {
- proc = runtime.exec(fullCommand);
- Thread.sleep(1000);
- } catch (Exception e) {
- DALog.printLog(e);
- return false;
- } finally {
- if (proc != null)
+ boolean bSuccuss = true;
+
+ try {
+ proc = runtime.exec(fullCommand);
+ Thread.sleep(1000);
+ } catch (IOException e) {
+ bSuccuss = false;
+ DALog.printLog("TizenNativeApplicationProfileDelegate - executeWindowsCommand - IOException");
+ }catch (InterruptedException e) {
+ bSuccuss = false;
+ DALog.printLog("TizenNativeApplicationProfileDelegate - executeWindowsCommand - InterruptedException");
+ }finally {
+ if (proc != null){
proc.destroy();
+ }
}
+
- return i == 0;
+ return bSuccuss;
}
private static boolean verifyDeviceReachability(IDevice currentDevice, IProject project) {