// $OUTPUT_FILE
sbFile.delete(0, sbFile.length());
sbFile.append("\"");//$NON-NLS-1$
- sbFile.append(csFile.getParentFile().getCanonicalPath());
+ if(csFile.getParentFile().exists()){
+ sbFile.append(csFile.getParentFile().getCanonicalPath());
+ }
sbFile.append(File.separator);
sbFile.append("copy_");//$NON-NLS-1$
sbFile.append(csFile.getName());
protected static final int defaultTimeOut = 60000;
protected Shell shell;
protected IProject project;
- private boolean result;
- private String programPath;
protected boolean isLaunchFailed = false;
protected boolean isCoredump = false;
protected TizenLaunchCommand tizenCommand = null;
// extracting file system
rootstrapPath = result.getPath();
File baseDirDir = new File(rootstrapPath).getParentFile();
- if (!baseDirDir.exists()) {
+ if (null != baseDirDir && !baseDirDir.exists()) {
if (!baseDirDir.mkdirs()) {
throw new InterruptedException(String.format("Failed to make directory: %s",
baseDirDir.toString()));
public class CommonRootstrapManager {
public static List<PlatformRootstrap> getRootstraps() {
- return RootstrapInstances.getRootstrapManager().getRootstraps();
+ return RootstrapInstances.getRootstrapManager() != null ? RootstrapInstances.getRootstrapManager().getRootstraps() : null;
}
public static PlatformRootstrap getRootstrap(String id) {
.getFirstElement();
// disable remove action if connection is root connection
- if (conn.getDepth() == 0) {
+ if (null != conn && conn.getDepth() == 0) {
removeAction.setEnabled(false);
} else {
removeAction.setEnabled(true);
ISelection sel = connectionTree.getSelection();
TreeSelection selection = (TreeSelection) sel;
ConnectionConfiguration conn = (ConnectionConfiguration) selection.getFirstElement();
- if (conn.getType().equals(ConnectionConfiguration.Type.Remote)) {
+ if (null != conn && conn.getType().equals(ConnectionConfiguration.Type.Remote)) {
currentConnection = new ConnectionConfiguration();
currentConnection.setName(getTempConnectionName());
currentConnection.setDepth(1);
ISelection sel = connectionTree.getSelection();
TreeSelection selection = (TreeSelection) sel;
ConnectionConfiguration conn = (ConnectionConfiguration) selection.getFirstElement();
-
- // return if connection is root connection
- if (conn.getDepth() == 0) {
- return;
- }
- if (conn.getType().equals(ConnectionConfiguration.Type.Remote)) {
- if (MessageDialog.openConfirm(shell, resources.getString("ConnDlg.dlg.title.removeConnection"),
- resources.getString("ConnDlg.dlg.desc.removeConnection"))) {
- ConnectionHistory.removeConnectionFromList(conn);
- connectionTree.setInput(getTreeInput());
- connectionTree.expandAll();
-
- // set isApplied to write a new connection to file.
- isApplied = true;
+ if (null != conn) {
+ // return if connection is root connection
+ if (conn.getDepth() == 0) {
+ return;
}
- } else if (conn.getType().equals(ConnectionConfiguration.Type.Local)) {
- DialogUtil.openMessageDialog(resources.getString("ConnDlg.info.notSupported"));
+ if (conn.getType().equals(ConnectionConfiguration.Type.Remote)) {
+ if (MessageDialog.openConfirm(shell, resources.getString("ConnDlg.dlg.title.removeConnection"),
+ resources.getString("ConnDlg.dlg.desc.removeConnection"))) {
+ ConnectionHistory.removeConnectionFromList(conn);
+ connectionTree.setInput(getTreeInput());
+ connectionTree.expandAll();
+
+ // set isApplied to write a new connection to file.
+ isApplied = true;
+ }
+ } else if (conn.getType().equals(ConnectionConfiguration.Type.Local)) {
+ DialogUtil.openMessageDialog(resources.getString("ConnDlg.info.notSupported"));
+ }
+ } else {
+ return;
}
}
}
List<Rootstrap> cloneRootstrapList = new ArrayList<Rootstrap>(pm.getRootstrapList());
for (Rootstrap r : cloneRootstrapList) {
String type = r.getSupportToolchainType();
- if (!type.equals(PlatformRootstrap.SUPPORTED_TOOLCHAIN_TYPE)) {
+ if (null != type && !type.equals(PlatformRootstrap.SUPPORTED_TOOLCHAIN_TYPE)) {
continue;
}
if (!remotelists.contains(r.getId())) {
String version = rs.getProfileVersion().toLowerCase();
String supportType = rs.getSupportToolchainType();
- if (platformName == null) {
- if (supportType.endsWith(toolChainType) && containValue(archs, rs.getArchitecture())) {
- return rs.getId();
- }
- } else {
- if (supportType.endsWith(toolChainType) && containValue(archs, rs.getArchitecture())
- && platformName.toLowerCase().startsWith(profile)
- && platformName.toLowerCase().endsWith(version)) {
- return rs.getId();
+ if (null != supportType && "" != supportType) {
+ if (platformName == null) {
+ if (supportType.endsWith(toolChainType) && containValue(archs, rs.getArchitecture())) {
+ return rs.getId();
+ }
+ } else {
+ if (supportType.endsWith(toolChainType) && containValue(archs, rs.getArchitecture())
+ && platformName.toLowerCase().startsWith(profile)
+ && platformName.toLowerCase().endsWith(version)) {
+ return rs.getId();
+ }
}
}
}
}
public static IBuildCommandUtil getBuildCommandUtil(IConfiguration config) {
- return getPlatformUtility().getBuildCommandUtil(config);
+ return getPlatformUtility() != null ? getPlatformUtility().getBuildCommandUtil(config) : null;
}
public static IBuildCommandUtil getBuildCommandUtil() {
- return getPlatformUtility().getBuildCommandUtil();
+ return getPlatformUtility() != null ? getPlatformUtility().getBuildCommandUtil() : null;
}
public static IPackageUtil getPackageUtil() {
- return getPlatformUtility().getPackageUtil();
+ return getPlatformUtility() != null ? getPlatformUtility().getPackageUtil() : null;
}
public static ILaunchCommandUtil getLaunchCommandUtil() {
- return getPlatformUtility().getLaunchCommandUtil();
+ return getPlatformUtility() != null ? getPlatformUtility().getLaunchCommandUtil() : null;
}
public static IScriptProvider getScriptProvider() {
- return getPlatformUtility().getScriptProvider();
+ return getPlatformUtility() != null ? getPlatformUtility().getScriptProvider() : null;
}
}
IFolder folder = project.getFolder("packaging");
File dir = new File(folder.getLocation().toOSString());
File specfile = null;
- if (dir.exists()) {
+ if (dir.exists() && dir.listFiles().length > 1) {
for (File f : dir.listFiles()) {
if (f.isFile() && f.getName().endsWith(".spec")) {
specfile = f;