import org.tizen.nativecommon.build.model.Rootstrap;
import org.tizen.nativecommon.build.model.SBIModel;
import org.tizen.nativecommon.build.model.Target;
+import org.tizen.nativeplatform.build.PlatformConfigurationManager;
import org.tizen.nativeplatform.preferences.PreferencesManager;
import org.tizen.nativeplatform.util.CommandLauncher;
import org.tizen.nativeplatform.views.model.PlatformRootstrap;
public static PlatformRootstrap getDefaultRootstrap( String arch ) {
- String baseArch = RootstrapManager.getBaseArchitecture( arch );
- String defaultRootstrapID = baseArch.equals("arm") ?
- PlatformRootstrap.DEFAULT_ROOTSTRAP_ARM_ID : PlatformRootstrap.DEFAULT_ROOTSTRAP_I386_ID;
-
+ String defaultRootstrapID = null;
+ if (PlatformConfigurationManager.isEmulatorArch(arch)) {
+ defaultRootstrapID = PlatformRootstrap.DEFAULT_ROOTSTRAP_I386_ID;
+ } else if (PlatformConfigurationManager.isDeviceArch(arch)) {
+ defaultRootstrapID = PlatformRootstrap.DEFAULT_ROOTSTRAP_ARM_ID;
+ }
+
return RootstrapManager.getRootstrap( defaultRootstrapID );
}
}
CommandLauncher.executeSudo( String.format("sudo -S rm -rf %s", path), null );
- }
-
+ }
public static String getBaseArchitecture( String arch ) {
if ( arch.contains("arm") ) {
}
}
-
-
public static boolean generateSBIPluginXML( String id, String name, String arch, ArrayList<String> reposURLs) {
IPath pluginPath = new Path(SmartBuildInterface.getInstance().getPluginPath());
SelectRootDlg.Msg.LastOne = "%s [%s]" rootstrap is the last one. You can not remove it
SelectRootDlg.Label.Desc = Follow projects use "%s" rootstrap.\nYou should set other rootstraps if you want to remove "%s" rootstrap
+Action.Msg.Error.SelectRootstrap = The "%s" rootstrap can not be selected at "%s" configuration because of architecture mismatch.
Action.Msg.Error.RemoveDefault = Cannot remove basic rootstrap!
Action.Msg.Progress.Exporting = Exporting rootstrap...
Action.Msg.Error.ExportUninitialzed = Cannot export uninitialized rootstrap!
TableItem[] item = table.getSelection();
PlatformRootstrap selected = (PlatformRootstrap)item[0].getData();
if (project != null) {
+ if (!verifyActiveRootstrap( project, selected)) {
+ showErrorSelectRootstrap(project, selected);
+ return;
+ }
setActiveRootstrap( project, selected );
}
}
});
}
+ private void showErrorSelectRootstrap(IProject project, PlatformRootstrap rootstrap) {
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration config = info.getDefaultConfiguration();
+ String message = String.format(resources.getString("Action.Msg.Error.SelectRootstrap"),
+ rootstrap.getId(), config.getName());
+ DialogUtil.openErrorDialog(message);
+ }
+
private void setActiveRootstrap(IProject project, PlatformRootstrap rootstrap ) {
String rootId = rootstrap.getId();
ManagedBuildManager.saveBuildInfo( project, true );
}
+ private boolean verifyActiveRootstrap(IProject project, PlatformRootstrap rootstrap ) {
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+ IConfiguration config = info.getDefaultConfiguration();
+ String rootArch = rootstrap.getArch();
+
+ if (PlatformConfigurationManager.isEmulatorConfiguration(config)) {
+ if (!PlatformConfigurationManager.isEmulatorArch(rootArch)) {
+ return false;
+ }
+ } else if (PlatformConfigurationManager.isDeviceConfiguration(config)) {
+ if (!PlatformConfigurationManager.isDeviceArch(rootArch)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
public void selectionPkgMgr()
{