import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.swt.widgets.Display;
+import org.tizen.common.util.OSChecker;
import org.tizen.common.util.log.UserInteraction;
import org.tizen.common.util.log.UserLogger;
import org.tizen.nativecommon.build.SmartBuildInterface;
String targetId = PlatformConfigurationManager.getBuildTargetName(configuration);
String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);
final PlatformRootstrap rootstrap = RootstrapManager.getRootstrap(rootId);
- boolean isCleanOption = buildArgs[0].equals("clean");
- if (!isCleanOption) {
+ boolean needRemoteSync = OSChecker.isWindows() && buildArgs[0].equals("clean");
+ if (needRemoteSync) {
syncWorkspace(project, configuration, monitor);
readySyncRootstrap(rootstrap);
}
}
});
- if (!isCleanOption) {
+ if (needRemoteSync) {
+ /*
Display.getDefault().asyncExec(new Runnable() {
public void run() {
syncRootstrap(rootstrap);
}
});
+ */
+ } else {
+ CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(project));
}
- CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(project));
+
return isClean;
}
@Override
public boolean process(String[] buildArguments) {
+ if (buildArguments != null && buildArguments.length > 0) {
+ if (buildArguments[0].equals("clean")) {
+ return true;
+ }
+ }
boolean result = false;
UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_OUTPUT);
if (OSChecker.isWindows()) {
}
private boolean localProcess(String[] buildArguments) {
- if (buildArguments != null && buildArguments.length > 0) {
- if (buildArguments[0].equals("clean")) {
- return true;
- }
- }
String targetId = PlatformConfigurationManager.getBuildTargetName(config);
String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);
PlatformRootstrap rootstrap = RootstrapManager.getRootstrap(rootId);
import org.eclipse.swt.widgets.Shell;
import org.tizen.common.util.DialogUtil;
import org.tizen.common.util.SWTUtil;
+import org.tizen.common.util.log.UserInteraction;
+import org.tizen.common.util.log.UserLogger;
import org.tizen.nativeplatform.Activator;
import org.tizen.nativeplatform.build.PlatformConfigurationManager;
import org.tizen.nativeplatform.launch.wizards.PlatformLaunchWizard;
import org.tizen.nativeplatform.types.LaunchTypes;
import org.tizen.nativeplatform.util.PackageUtil;
import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
public class LaunchConfigurationProcessor implements ILaunchConfigurationProcessor {
private ILaunchConfiguration launchConfig;
ITizenLaunchConfigurationConstants.ATTR_APPLICATION_ID, "");
killIfRunningApplication(appId);
}
- return installPackages(configurationIsSet, monitor);
+ boolean result = installPackages(configurationIsSet, monitor);
+ UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.PRE_LAUNCH);
+ return result;
} else {
monitor.beginTask("", 2);
try {
if (!installPackages(configurationIsSet, new SubProgressMonitor(monitor, 1))) {
descMsg = "Installation seems to be failed. Check package installation log.";
}
- if (!setLaunchConfigurationForEFL(new SubProgressMonitor(monitor, 1), descMsg,
- isEflApp)) {
+ UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.PRE_LAUNCH);
+ if (!setLaunchConfigurationForEFL(new SubProgressMonitor(monitor, 1), descMsg, isEflApp)) {
return false;
}
} finally {
private boolean setLaunchConfigurationForEFL(IProgressMonitor monitor, final String descMsg,
final boolean isEflApp) throws CoreException {
+
monitor.beginTask("", 1);
final ILaunchConfigurationWorkingCopy wc = launchConfig.getWorkingCopy();
try {
} finally {
monitor.done();
}
-
+
if (isSetProgramPath(launchConfig)) {
if (applicationId != null && !applicationId.isEmpty()) {
killIfRunningApplication(applicationId);
import org.tizen.nativeplatform.util.PackageUtil;
import org.tizen.nativeplatform.util.PlatformLaunchUtil;
import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
import org.tizen.nativeplatform.util.RootstrapUtil;
import org.tizen.nativeplatform.views.model.PlatformRootstrap;
import org.tizen.sdblib.Arch;
public void launch(ILaunchConfiguration config, String mode, ILaunch launch,
IProgressMonitor monitor) throws CoreException {
UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH);
-
+ UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.PRE_LAUNCH);
isLaunchFailed = false;
shell = LaunchUIPlugin.getShell();
if (monitor == null) {
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.dialogs.MessageDialog;
import org.tizen.common.util.SWTUtil;
+import org.tizen.common.util.log.UserLogger;
import org.tizen.nativecommon.launch.LaunchUtils;
import org.tizen.nativecommon.launch.TizenLaunchConfiguration;
import org.tizen.nativecommon.launch.TizenLaunchConfigurationConstants;
import org.tizen.nativecommon.launch.TizenLaunchMessages;
import org.tizen.nativeplatform.launch.PlatformLaunchMessages;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
import org.tizen.sdblib.IDevice;
@SuppressWarnings("restriction")
import org.tizen.nativeplatform.types.PkgInstallTypes;
import org.tizen.nativeplatform.util.PlatformLaunchUtil;
import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
import org.tizen.sdblib.util.DeviceUtil;
public class RpmPackageLauncher implements IPkgLauncher {
PlatformLaunchMessages.INSTALL_PACKAGES_TO_BUILDSYSTEM, selectBsPkgs);
monitor.subTask(taskMsg);
if (selectBsPkgs != null && !selectBsPkgs.isEmpty()) {
+ UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_ROOTSTRAP);
installPkgsToRootstrap(selectBsPkgs, IPkgCommander.TOOL.ZYPPER, monitor, bsAvailableRds);
+ UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_ROOTSTRAP);
monitor.worked(1);
}
// 3. install packages to device.
selectDvPkgs);
monitor.subTask(taskMsg);
if (selectDvPkgs != null && !selectDvPkgs.isEmpty()) {
+ UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_DEVICE);
if (isEflApp) {
installPkgsToDevice(selectDvPkgs, IPkgCommander.TOOL.PKGCMD, monitor,
dvAvailableRds);
} else {
installPkgsToDevice(selectDvPkgs, IPkgCommander.TOOL.RPM, monitor, dvAvailableRds);
}
+ UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INSTALL_DEVICE);
monitor.worked(1);
}
monitor.done();
PlatformLaunchMessages.IS_NOT_INITIALIZED_ROOTSTRAP, target.getRootstrap()
.getId()));
} else {
+ UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_ROOTSTRAP_REPO);
PkgMgrInitializer initializer = new PkgMgrInitializer(target, CmdTargetTypes.ROOTSTRAP);
initializer.initRootstrapRepoInfo();
+ UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_ROOTSTRAP_REPO);
}
IPkgCommander commander = target.getCommander(CmdTargetTypes.ROOTSTRAP);
boolean installResult = false;
} else if (!PlatformLaunchUtil.checkDeviceRootOn(target.getDevice())) {
newInterruptedException(PlatformLaunchMessages.DEVICE_IS_NOT_ROOT_ON);
} else {
+ UserLogger.start(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_DEVICE_REPO);
PkgMgrInitializer initializer = new PkgMgrInitializer(target, CmdTargetTypes.DEVICE);
initializer.initDeviceRepoInfo();
+ UserLogger.end(UserInteraction.CATE_PLATFORM_LAUNCH, PlatformUserInteraction.INIT_DEVICE_REPO);
}
IPkgCommander commander = target.getCommander(CmdTargetTypes.DEVICE);
boolean installResult = false;
import java.util.ArrayList;\r
import java.util.List;\r
\r
+import org.eclipse.cdt.core.CCorePlugin;\r
+import org.eclipse.cdt.core.model.CoreModel;\r
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;\r
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;\r
+import org.eclipse.cdt.managedbuilder.core.IManagedProject;\r
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;\r
+import org.eclipse.core.resources.IProject;\r
+import org.eclipse.core.resources.IWorkspace;\r
+import org.eclipse.core.resources.ResourcesPlugin;\r
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.core.runtime.NullProgressMonitor;\r
import org.eclipse.core.runtime.Path;\r
import org.eclipse.ptp.remotetools.exception.RemoteOperationException;\r
import org.tizen.common.util.FileUtil;\r
import org.tizen.common.util.log.UserLogger;\r
+import org.tizen.nativecommon.build.SmartBuildInterface;\r
+import org.tizen.nativeplatform.build.PlatformConfigurationManager;\r
import org.tizen.nativeplatform.util.PlatformUserInteraction;\r
import org.tizen.nativeplatform.util.RootstrapUtil;\r
import org.tizen.nativeplatform.views.model.PlatformRootstrap;\r
List<PlatformRootstrap> list = new ArrayList<PlatformRootstrap>();\r
list.add(rootstrap);\r
syncronized(list, syncIncludes, syncDebugsrc, monitor);\r
+ if (syncIncludes) {\r
+ indexing(rootstrap);\r
+ }\r
}\r
\r
public static void syncronize(PlatformRootstrap rootstrap, IProgressMonitor monitor) {\r
List<PlatformRootstrap> list = new ArrayList<PlatformRootstrap>();\r
list.add(rootstrap);\r
syncronized(list, true, true, monitor);\r
+ indexing(rootstrap);\r
}\r
\r
public static void syncronize(List<PlatformRootstrap> list, IProgressMonitor monitor) {\r
}\r
}\r
}\r
+ \r
+ private static void indexing(PlatformRootstrap rootstrap) {\r
+ IWorkspace works = ResourcesPlugin.getWorkspace();\r
+ IProject[] projs = works.getRoot().getProjects();\r
+ for (IProject proj : projs) {\r
+ IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(proj);\r
+ if (info == null) {\r
+ continue;\r
+ }\r
+ IConfiguration config = info.getDefaultConfiguration();\r
+ if (config == null) {\r
+ continue;\r
+ }\r
+ IManagedProject managedProject = config.getManagedProject();\r
+ if (managedProject == null) {\r
+ continue;\r
+ }\r
+ String projectArtifactType = managedProject.getProjectType() != null ? managedProject\r
+ .getProjectType().getBuildArtefactType().getId()\r
+ : null;\r
+ if (projectArtifactType != PlatformConfigurationManager.TIZEN_PLATFORM_ARTIFACT_TYPE) {\r
+ continue;\r
+ }\r
+ \r
+ String targetId = PlatformConfigurationManager.getBuildTargetName(config);\r
+ String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);\r
+ if (rootstrap.getId().equals(rootId)) {\r
+ CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(proj));\r
+ }\r
+ }\r
+ }\r
\r
private static String getRemoteIncludePath(PlatformRootstrap rootstrap) {\r
String scratchPath = RootstrapUtil.getRemoteRootstrapScratchPath(rootstrap.getId());\r
}
public static void reinitialize(IProgressMonitor monitor) {
+ UserLogger.start(PlatformUserInteraction.INIT_ROOTSTRAP);
if (OSChecker.isWindows()) {
RemoteRootstrapManager.reinitialize(monitor);
} else {
LocalRootstrapManager.reinitialize(monitor);
}
+ UserLogger.end(PlatformUserInteraction.INIT_ROOTSTRAP);
}
public static void updateRootstrap(PlatformRootstrap rootstrap) {
package org.tizen.nativeplatform.util;\r
\r
public class PlatformUserInteraction {\r
- \r
+ public static final String CLONE_GITPROJECT = "clone.git";\r
public static final String CATE_SYNCRONIZE = "syncronize";\r
public static final String GEN_ROOTSTRAP = "gen.rootstrap";\r
public static final String SYNC_INCLUDES = "sync.includes";\r
public static final String SYNC_WORKSPACE = "sync.workspace";\r
public static final String SYNC_OUTPUT = "sync.output";\r
+ public static final String CONNECT_SSH = "conn.ssh";\r
+ public static final String INIT_ROOTSTRAP = "init.rootstrap";\r
+ public static final String PRE_LAUNCH = "pre.launch";\r
+ public static final String POST_LAUNCH = "post.launch";\r
+ public static final String INSTALL_ROOTSTRAP = "install.rootstrap";\r
+ public static final String INSTALL_DEVICE = "install.device";\r
+ public static final String INIT_DEVICE_REPO = "init.device.repo";\r
+ public static final String INIT_ROOTSTRAP_REPO = "init.rootstrap.repo";\r
}\r
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.tizen.common.util.DialogUtil;
+import org.tizen.common.util.log.UserInteraction;
+import org.tizen.common.util.log.UserLogger;
import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
public class RemoteConnectionDialog extends Dialog {
passText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
passText.setLayoutData(gridData);
}
+
+ private void registerAuthorizedKey(String publicKey) {
+ try {
+ FileReader fileReader = new FileReader(publicKey);
+ BufferedReader reader = new BufferedReader(fileReader);
+ String pubkey = reader.readLine();
+ IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
+ IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+ String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
+ String remoteAuthfile = new Path(userhome).append(".ssh").append("authorized_keys").toString();
+ boolean needSet = true;
+ if (filetool.hasFile(remoteAuthfile, new NullProgressMonitor())) {
+ String cmd = String.format("grep -rn \"%s\" %s", pubkey, remoteAuthfile);
+ String output = exectool.executeWithOutput(cmd);
+ if (!output.isEmpty()) {
+ needSet = false;
+ }
+ }
+ if (needSet) {
+ String cmd = String.format("echo \"%s\" >> %s", pubkey, remoteAuthfile);
+ exectool.executeBashCommand(cmd);
+ }
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ } catch (RemoteExecutionException e) {
+ e.printStackTrace();
+ } catch (RemoteConnectionException e) {
+ e.printStackTrace();
+ } catch (CancelException e) {
+ e.printStackTrace();
+ } catch (RemoteOperationException e) {
+ e.printStackTrace();
+ }
+ }
@Override
protected void okPressed() {
InterruptedException {
monitor.beginTask(resources.getString("RemoteConnDlg.Progress.Creating"), 1);
try {
- if (!RemoteConnectionManager.createConnection(host, user, pass, publicKey, privateKey,
- new SubProgressMonitor(monitor, 1))) {
+ UserLogger.start(PlatformUserInteraction.CONNECT_SSH);
+ boolean result = RemoteConnectionManager.createConnection(host, user, pass, publicKey, privateKey,
+ new SubProgressMonitor(monitor, 1));
+ UserLogger.end(PlatformUserInteraction.CONNECT_SSH);
+ if (!result) {
DialogUtil.openMessageDialog(getShell(), "Failed to connect");
} else {
- try {
- FileReader fileReader = new FileReader(publicKey);
- BufferedReader reader = new BufferedReader(fileReader);
- String pubkey = reader.readLine();
- IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
- IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
- String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
- String remoteAuthfile = new Path(userhome).append(".ssh").append("authorized_keys").toString();
- boolean needSet = true;
- if (filetool.hasFile(remoteAuthfile, new NullProgressMonitor())) {
- String cmd = String.format("grep -rn \"%s\" %s", pubkey, remoteAuthfile);
- String output = exectool.executeWithOutput(cmd);
- if (!output.isEmpty()) {
- needSet = false;
- }
- }
- if (needSet) {
- String cmd = String.format("echo \"%s\" >> %s", pubkey, remoteAuthfile);
- exectool.executeBashCommand(cmd);
- }
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- } catch (RemoteExecutionException e) {
- e.printStackTrace();
- } catch (RemoteConnectionException e) {
- e.printStackTrace();
- } catch (CancelException e) {
- e.printStackTrace();
- } catch (RemoteOperationException e) {
- e.printStackTrace();
- }
-
+ registerAuthorizedKey(publicKey);
}
} finally {
monitor.done();
manager.add(new Separator());
manager.add(actionChangeConfFile);
manager.add(new Separator());
- manager.add(actionPkgMgr);
if (OSChecker.isWindows()) {
- manager.add(new Separator());
manager.add(actionSync);
+ manager.add(new Separator());
}
+ manager.add(actionPkgMgr);
}
private void activateContext() {
return;
}
}
- //RootstrapSyncronizer.Syncronize(RootstrapManager.getRootstraps());
}
private void syncIncludes() {
} catch (Exception e) {
logger.error("Failed to syncronize includes", e);
DialogUtil.openErrorDialog(String.format("%s\n * %s",
- "Failed to syncronize includes",
- e.toString()));
+ "Failed to syncronize includes", e.toString()));
return;
}
}
}
selected.setInitialized(true);
}
- RootstrapSyncronizer.cacheModificationTime(selected);
+ final boolean needRemoteSync = OSChecker.isWindows();
+ if (needRemoteSync) {
+ RootstrapSyncronizer.cacheModificationTime(selected);
+ }
// launch package manager
IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
final PkgCommandTarget cmdTarget = new PkgCommandTarget(
monitor.subTask(resources
.getString("Action.Msg.Progress.Refresh.rootstrap"));
RootstrapManager.updateRootstrap(selected);
- monitor.worked(2);
- RootstrapSyncronizer.syncronizeIfChanges(selected, new SubProgressMonitor(monitor, 1));
+ monitor.worked(1);
+ if (needRemoteSync) {
+ RootstrapSyncronizer.syncronizeIfChanges(selected, new SubProgressMonitor(monitor, 1));
+ }
+ monitor.worked(1);
} finally {
monitor.done();
}
import org.tizen.nativeplatform.git.GitCommander;
import org.tizen.nativeplatform.git.model.GitDescription;
import org.tizen.nativeplatform.preferences.PreferencesManager;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
import org.tizen.nativeplatform.wizards.model.TizenPlatformTemplateModel;
public class TizenPlatformProjectWizard extends TizenProjectWizard {
@Override
public boolean performFinish() {
- long start = 0;
- long end = 0;
- start = System.currentTimeMillis();
+ UserLogger.start(PlatformUserInteraction.CLONE_GITPROJECT);
boolean result = false;
IPath projectPath = ResourcesPlugin.getWorkspace().getRoot().getLocation()
}
commander.ApplySharedProject(newProject, getContainer());
}
- end = System.currentTimeMillis();
- System.out.print("time :" + (end-start)/1000.0);
+ UserLogger.end(PlatformUserInteraction.CLONE_GITPROJECT);
return result;
}