MISC: Supported windows package build
authordonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 26 Apr 2014 08:57:01 +0000 (17:57 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Sat, 26 Apr 2014 08:57:01 +0000 (17:57 +0900)
Change-Id: I1f5ecc5d440f2efaaefe01b8937d7aa5efdec66d
Signed-off-by: donghyuk.yang <donghyuk.yang@samsung.com>
35 files changed:
org.tizen.nativeplatform/META-INF/MANIFEST.MF
org.tizen.nativeplatform/OSGI-INF/l10n/bundle.properties
org.tizen.nativeplatform/plugin.xml
org.tizen.nativeplatform/src/org/tizen/nativeplatform/IPlatformXMLStore.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformBuildCommandLauncher.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationEnvVarSupplier.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformConfigurationManager.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformExternalBuildRunner.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/PlatformProjectDependentBuilder.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/gbs/GBSBuildResultProcessor.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/command/launcher/HostCommandLauncher.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/git/GitCommander.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/PlatformLaunchDelegate.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/launch/ui/shortcut/PlatformProjectCommonLaunchShortcut.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/manifest/PlatformManifestXMLStore.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RemoteConnectionManager.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RemoteTools.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RootstrapSyncronizer.java [new file with mode: 0644]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RsyncProcessor.java [new file with mode: 0644]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/SourceUploader.java [deleted file]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceDeltaManager.java [new file with mode: 0644]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceResourceDelta.java [new file with mode: 0644]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceSyncronizer.java [new file with mode: 0644]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rootstrap/RemoteRootstrapManager.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rootstrap/RootstrapManager.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/rootstrap/XMLPluginGenerator.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PlatformLaunchUtil.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PlatformUserInteraction.java [new file with mode: 0644]
org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/RootstrapUtil.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RemoteConnectionDialog.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapUIMessages.properties
org.tizen.nativeplatform/src/org/tizen/nativeplatform/views/ui/RootstrapView.java
org.tizen.nativeplatform/src/org/tizen/nativeplatform/wizards/TizenPlatformProjectWizard.java
package/build.linux
package/pkginfo.manifest

index 2f554c9..1b62579 100644 (file)
@@ -50,28 +50,11 @@ Import-Package: org.eclipse.cdt.debug.core,
  org.eclipse.jgit.storage.file;version="0.12.1",
  org.eclipse.jgit.transport;version="0.12.1",
  org.eclipse.jgit.util;version="0.12.1",
- org.eclipse.ptp.rdt.core.serviceproviders,
- org.eclipse.ptp.rdt.core.services,
  org.eclipse.ptp.remote.core,
  org.eclipse.ptp.remote.core.exception,
  org.eclipse.ptp.remote.remotetools.core,
- org.eclipse.ptp.remote.rse.core,
  org.eclipse.ptp.remotetools.core,
- org.eclipse.ptp.remotetools.environment.launcher.core,
  org.eclipse.ptp.remotetools.exception,
- org.eclipse.ptp.services.core,
- org.eclipse.ptp.utils.file.core,
- org.eclipse.rse.core.model,
- org.eclipse.rse.core.subsystems,
- org.eclipse.rse.services.clientserver.messages,
- org.eclipse.rse.services.files,
- org.eclipse.rse.services.shells,
- org.eclipse.rse.shells.ui,
- org.eclipse.rse.subsystems.files.core.model,
- org.eclipse.rse.subsystems.files.core.servicesubsystem,
- org.eclipse.rse.subsystems.files.core.subsystems,
- org.eclipse.rse.subsystems.shells.core.subsystems,
- org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem,
  org.eclipse.ui,
  org.eclipse.ui.dialogs,
  org.eclipse.ui.wizards.datatransfer,
index 377abb1..9c5d6b6 100644 (file)
@@ -18,6 +18,7 @@ Rootstrap.change.conffile=Change Configuration File
 Rootstrap.export=Export
 Rootstrap.remove=Remove
 Rootstrap.manage.pkgs=Manage Packages
+Rootstrap.sync.include=Sync Includes
 
 ## Context menu
 Buildpackage.label=Build Package
index 0c68a3f..0d2dc4b 100644 (file)
                <extension
          point="org.eclipse.ui.contexts">
       <context
-            id="org.tizen.common.rootstrap.setdefault.context"
+            id="org.tizen.nativeplatform.rootstrap.setdefault.context"
             name="%Rootstrap.select"
             parentId="org.eclipse.ui.contexts.window">
       </context>    
             <context
-            id="org.tizen.common.rootstrap.change.conffile.context"
+            id="org.tizen.nativeplatform.rootstrap.change.conffile.context"
             name="%Rootstrap.change.conffile"
             parentId="org.eclipse.ui.contexts.window">
       </context>
       <context
-            id="org.tizen.common.rootstrap.lauchpkgmgr.context"
+            id="org.tizen.nativeplatform.rootstrap.lauchpkgmgr.context"
             name="%Rootstrap.manage.pkgs"
             parentId="org.eclipse.ui.contexts.window">
       </context>
             <context
-            id="org.tizen.common.rootstrap.remove.context"
+            id="org.tizen.nativeplatform.rootstrap.remove.context"
             name="%Rootstrap.remove"
             parentId="org.eclipse.ui.contexts.window">
       </context>            
       <context
-            id="org.tizen.common.rootstrap.export.context"
+            id="org.tizen.nativeplatform.rootstrap.export.context"
             name="%Rootstrap.export"
             parentId="org.eclipse.ui.contexts.window">
       </context>
+            <context
+            id="org.tizen.nativeplatform.rootstrap.sync.includes"
+            name="%Rootstrap.sync.include"
+            parentId="org.eclipse.ui.contexts.window">
+      </context>
        </extension>
        
        <extension
index 96965b3..3882927 100644 (file)
@@ -14,14 +14,6 @@ public interface IPlatformXMLStore {
      */
     public void setProject(IProject project);
 
-/**
-     * This roles same as {@link IXMLStore#setProject(IProject), 
-     * except that this is for CLI because CLI cannot use IProject.
-     * 
-     * @param projectPath path of project in which xml will be stored
-     */
-    public void setProject(String projectPath);
-
     /**
      * Parses xml files and loads.
      */
index 480ff42..36fea9d 100644 (file)
@@ -31,6 +31,7 @@ import org.eclipse.cdt.core.CommandLauncher;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceDelta;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -44,10 +45,15 @@ import org.tizen.nativecommon.build.ProjectTypeManager;
 import org.tizen.nativecommon.build.SmartBuildInterface;
 import org.tizen.nativeplatform.Activator;
 import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
-import org.tizen.nativeplatform.remote.connection.SourceUploader;
+import org.tizen.nativeplatform.remote.connection.WorkspaceDeltaManager;
+import org.tizen.nativeplatform.remote.connection.WorkspaceResourceDelta;
+import org.tizen.nativeplatform.remote.connection.WorkspaceSyncronizer;
 import org.tizen.nativeplatform.rootstrap.RootstrapManager;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 
 public class PlatformBuildCommandLauncher extends CommandLauncher {
+    String commandLine = "";
+
     @Override
     public Process execute(IPath commandPath, String[] args, String[] env, IPath changeToDirectory,
             IProgressMonitor monitor) throws CoreException {
@@ -136,21 +142,19 @@ public class PlatformBuildCommandLauncher extends CommandLauncher {
         }
         String command = builder.getBuildCommand(config);
         String[] arguments = builder.getBuildArguments(config);
+        fCommandArgs = new String[arguments.length + 1];
+        fCommandArgs[0] = command;
+        int i = 1;
         for (String a : arguments) {
             command += " " + a;
+            fCommandArgs[i++] = a;
         }
         String remoteCmd = command.trim();
-        SourceUploader uploader = new SourceUploader(proj);
-        String targetpath = uploader.upload();
-        if (targetpath == null) {
-            Status status = new Status(Status.ERROR, Activator.PLUGIN_ID,
-                    "Failed to upload source", null);
-            throw new CoreException(status);
-        }
+        String targetPath = RootstrapUtil.getUserSyncWorkspacePath(proj.getName());
         try {
             IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
             IRemoteScript script = exectool.createScript();
-            String commands[] = { "cd " + targetpath, remoteCmd };
+            String commands[] = { "cd " + targetPath, remoteCmd };
             script.setScript(commands);
             script.setFetchProcessErrorStream(true);
             script.setFetchProcessInputStream(true);
index d6e1422..bbcfcb6 100644 (file)
@@ -35,6 +35,7 @@ import org.eclipse.cdt.managedbuilder.envvar.IBuildEnvironmentVariable;
 import org.eclipse.cdt.managedbuilder.envvar.IConfigurationEnvironmentVariableSupplier;
 import org.eclipse.cdt.managedbuilder.envvar.IEnvironmentVariableProvider;
 import org.eclipse.cdt.managedbuilder.internal.envvar.BuildEnvVar;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativecommon.build.SmartBuildInterface;
 
 @SuppressWarnings("restriction")
@@ -48,8 +49,12 @@ public class PlatformConfigurationEnvVarSupplier implements
         if (variableName.equals("SBI_SYSROOT")) {
             // set "SBI_SYSROOT" variable
             String basePath = PlatformConfigurationManager.getRootstrapPath(configuration);
-            String sysrootPath = sbi.getPlatformRootstrapPath(
-                    basePath);
+            String sysrootPath = "";
+            if (OSChecker.isWindows()) {
+                sysrootPath = basePath;
+            } else {
+                sysrootPath = sbi.getPlatformRootstrapPath(basePath);
+            }
             if (sysrootPath == null) {
                 sysrootPath = "";
             }
index 38547a1..d36346b 100644 (file)
@@ -40,9 +40,13 @@ import org.eclipse.cdt.managedbuilder.internal.core.MultiConfiguration;
 import org.eclipse.cdt.managedbuilder.internal.core.Tool;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativecommon.build.CommonConfigurationManager;
 import org.tizen.nativecommon.build.SmartBuildInterface;
 import org.tizen.nativecommon.build.exception.SBIException;
+import org.tizen.nativeplatform.rootstrap.RootstrapManager;
+import org.tizen.nativeplatform.util.RootstrapUtil;
+import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 
 @SuppressWarnings("restriction")
 public class PlatformConfigurationManager extends CommonConfigurationManager {
@@ -225,18 +229,28 @@ public class PlatformConfigurationManager extends CommonConfigurationManager {
     }
 
     public static String getRootstrapPath(IConfiguration config) {
-
         try {
             String targetID = getBuildTargetName(config);
             if (targetID == null) {
                 targetID = getDefaultBuildTargetName(config);
             }
             SmartBuildInterface sbi = SmartBuildInterface.getInstance();
-            String path = sbi.getRootstrapPath(targetID);
-            if (path == null) {
-                return "";
+            if (OSChecker.isWindows()) {
+                String rootstrapId = sbi.getRootstrapIDFromTargetID(targetID);
+                PlatformRootstrap rootstrap = RootstrapManager.getRootstrap(rootstrapId);
+                if (rootstrap == null) {
+                    return "";
+                }
+                String path = RootstrapUtil.getUserSyncRootstrapPath(rootstrap.getId());
+                return path;
             } else {
-                return sbi.getRootstrapPath(targetID);
+            
+                String path = sbi.getRootstrapPath(targetID);
+                if (path == null) {
+                    return "";
+                } else {
+                    return sbi.getRootstrapPath(targetID);
+                }
             }
         } catch (SBIException e) {
             e.printStackTrace();
index c8f3b13..218fbc9 100644 (file)
@@ -70,6 +70,7 @@ import org.eclipse.cdt.utils.PathUtil;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceDelta;
 import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.IWorkspaceRunnable;
 import org.eclipse.core.resources.IncrementalProjectBuilder;
@@ -86,9 +87,17 @@ import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.swt.widgets.Display;
 import org.tizen.common.util.log.UserInteraction;
 import org.tizen.common.util.log.UserLogger;
+import org.tizen.nativecommon.build.SmartBuildInterface;
+import org.tizen.nativeplatform.Activator;
 import org.tizen.nativeplatform.build.IBuildCommandProvider.BUILDTOOL;
+import org.tizen.nativeplatform.remote.connection.RootstrapSyncronizer;
+import org.tizen.nativeplatform.remote.connection.WorkspaceDeltaManager;
+import org.tizen.nativeplatform.remote.connection.WorkspaceResourceDelta;
+import org.tizen.nativeplatform.remote.connection.WorkspaceSyncronizer;
+import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.util.PackageUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 
 public class PlatformExternalBuildRunner extends ExternalBuildRunner {
 
@@ -104,6 +113,16 @@ public class PlatformExternalBuildRunner extends ExternalBuildRunner {
             final IConfiguration configuration, IBuilder builder, IConsole console,
             IMarkerGenerator markerGenerator, IncrementalProjectBuilder projectBuilder,
             IProgressMonitor monitor) throws CoreException {
+        String[] buildArgs = getTargets(kind, builder);
+        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) {
+            syncWorkspace(project, configuration, monitor);
+            readySyncRootstrap(rootstrap);
+        }
+
         UserLogger.start(UserInteraction.CATE_PLATFORM_BUILD);
         boolean isClean = invokeExternalBuild(kind, project, configuration, builder, console,
                 markerGenerator, projectBuilder, monitor);
@@ -114,9 +133,55 @@ public class PlatformExternalBuildRunner extends ExternalBuildRunner {
                 pkgUtil.cachePkgChecksum(project, configuration);
             }
         });
+        
+        if (!isCleanOption) {
+            Display.getDefault().asyncExec(new Runnable() {
+                public void run() {
+                    syncRootstrap(rootstrap);
+                }
+            });
+        }
         CCorePlugin.getIndexManager().reindex(CoreModel.getDefault().create(project));
         return isClean;
     }
+    
+    private void readySyncRootstrap(PlatformRootstrap rootstrap) {
+        RootstrapSyncronizer.cacheModificationTime(rootstrap);
+    }
+    
+    private void syncRootstrap(PlatformRootstrap rootstrap) {
+        RootstrapSyncronizer.syncronizeIfChanges(rootstrap, new NullProgressMonitor());
+    }
+    
+    private void syncWorkspace(IProject project, IConfiguration config, IProgressMonitor monitor) 
+            throws CoreException {
+        WorkspaceResourceDelta resourceDelta = WorkspaceDeltaManager.getDelta(project);
+        if (resourceDelta == null) {
+            resourceDelta = new WorkspaceResourceDelta(project);
+            WorkspaceDeltaManager.putDelta(project, resourceDelta);
+        }
+        IResourceDelta delta = resourceDelta.computeDelta();
+        boolean needSync = false;
+        if (delta == null) {
+            needSync = true;
+        } else {
+            IResourceDelta[] deltas = delta.getAffectedChildren();
+            IPath configPath = project.getFile(config.getName()).getFullPath();
+            for (IResourceDelta d : deltas) {
+                if (!d.getFullPath().equals(configPath)) {
+                    needSync = true;
+                    break;
+                }
+            }
+        }
+        if (needSync) {
+            if(!WorkspaceSyncronizer.syncronize(project, new SubProgressMonitor(monitor, 1))) {
+                Status status = new Status(Status.ERROR, Activator.PLUGIN_ID,
+                        "Failed to syncronized workspace", null);
+                throw new CoreException(status);
+            }
+        }
+    }
 
     protected boolean invokeExternalBuild(int kind, IProject project, IConfiguration configuration,
             IBuilder builder, IConsole console, IMarkerGenerator markerGenerator,
index 66ee60f..e99d616 100644 (file)
@@ -28,6 +28,7 @@
 package org.tizen.nativeplatform.build;
 
 import java.io.IOException;
+import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -41,13 +42,24 @@ import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
 import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.core.IRemoteItem;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativecommon.build.CommonProjectDependentBuilder;
 import org.tizen.nativecommon.build.SmartBuildInterface;
 import org.tizen.nativecommon.build.exception.SBIException;
 import org.tizen.nativeplatform.build.IBuildCommandProvider.BUILDTOOL;
+import org.tizen.nativeplatform.command.launcher.CommandUtil;
+import org.tizen.nativeplatform.command.launcher.HostCommandLauncher;
 import org.tizen.nativeplatform.password.SudoPasswdManager;
 import org.tizen.nativeplatform.preferences.PreferencesManager;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 
 public class PlatformProjectDependentBuilder extends CommonProjectDependentBuilder {
 
@@ -106,10 +118,70 @@ public class PlatformProjectDependentBuilder extends CommonProjectDependentBuild
     // In case of platform project, execute gdb command through sbi action.
     @Override
     public Process debug(String[] arrOption) throws IOException {
-        String targetID = getTargetID();
-        String workingDir = getWorkingDir();
-        String options = getDebugOption(arrOption);
-        return getSbi().actionNB("debug", options, targetID, workingDir);
+        if (OSChecker.isWindows()) {
+            if (!RemoteConnectionManager.connected()) {
+                return null;
+            }
+            try {
+                String targetId = getTargetID();
+                String gdb = "/usr/bin/gdb";
+                String rootId = SmartBuildInterface.getInstance().getRootstrapIDFromTargetID(targetId);
+                String rootPath = RootstrapUtil.getRemoteRootstrapScratchPath(rootId);
+                //String password = RemoteConnectionManager.getRemoteTools().getPass();
+                String passwd = SudoPasswdManager.getSudoPassword();
+                IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+                String workingDir = CommandUtil.getWorkingDir();
+                String sudoAskFile = new Path(workingDir).append("DEBUG_SH.sh").toString();
+                boolean exists = filetool.hasFile(sudoAskFile, new NullProgressMonitor());
+                if (!exists) {
+                    filetool.createFile(sudoAskFile, new NullProgressMonitor());
+                    OutputStream out = filetool.getOutputStream(sudoAskFile, IRemoteFileTools.NONE, new NullProgressMonitor());
+                    String script = String.format("#!/bin/bash\necho \"%s\"\nEOF", passwd);
+                    byte[] arr = script.getBytes();
+                    out.write(arr);
+                    out.close();
+                    IRemoteItem item = filetool.getFile(sudoAskFile, new NullProgressMonitor());                    
+                    item.setExecutable(true);
+                    item.commitAttributes(new NullProgressMonitor());
+                }
+                //String options = getDebugOption(arrOption);
+                String options = getWindowDebugOption(arrOption);
+                String command = String.format("SUDO_ASKPASS=\"%s\" sudo -A -k chroot %s sh -c \"%s %s\"", sudoAskFile, rootPath, gdb, options);
+                Process process = HostCommandLauncher.execute(command, ".", null);
+                return process;
+            } catch (RemoteOperationException e) {
+                e.printStackTrace();
+            } catch (RemoteConnectionException e) {
+                e.printStackTrace();
+            } catch (CancelException e) {
+                e.printStackTrace();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        } else {
+            String targetID = getTargetID();
+            String workingDir = getWorkingDir();
+            String options = getDebugOption(arrOption);
+            return getSbi().actionNB("debug", options, targetID, workingDir);
+        }
+        return null;
+    }
+    
+    private String getWindowDebugOption(String[] arrOption) {
+        String options = "";
+        for (int i = 0; i < arrOption.length - 1; i++) {
+            if (arrOption[i] == null) {
+                break;
+            } else if (arrOption[i].startsWith("--cd")) {
+                continue;
+            } else {
+                options = options.concat(arrOption[i] + " ");
+            }
+        }
+        String exePath = arrOption[arrOption.length-1];
+        exePath = SmartBuildInterface.getInstance().getMinGWPathFromWindowsPath(exePath, true);
+        options += exePath;
+        return options;
     }
 
     @Override
index 30957e6..932e160 100644 (file)
@@ -45,13 +45,17 @@ import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
 import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.tizen.common.util.FileUtil;
 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;
 import org.tizen.nativeplatform.build.IBuildResultProcessor;
 import org.tizen.nativeplatform.build.PlatformConfigurationManager;
 import org.tizen.nativeplatform.filefilter.RpmFileFilter;
 import org.tizen.nativeplatform.filefilter.XmlFileFilter;
 import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.remote.connection.RootstrapSyncronizer;
 import org.tizen.nativeplatform.rootstrap.RootstrapManager;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 import org.tizen.nativeplatform.util.RootstrapUtil;
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 
@@ -67,11 +71,15 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
 
     @Override
     public boolean process(String[] buildArguments) {
+        boolean result = false;
+        UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_OUTPUT);
         if (OSChecker.isWindows()) {
-            return remoteProcess(buildArguments);
+            result = remoteProcess(buildArguments);
         } else {
-            return localProcess(buildArguments);
+            result = localProcess(buildArguments);
         }
+        UserLogger.end(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_OUTPUT);
+        return result;
     }
 
     private boolean localProcess(String[] buildArguments) {
@@ -93,7 +101,6 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
         rpmfiles.clear();
         xmlfiles.clear();
         IProject project = (IProject) config.getOwner();
-        IPath projectPath = project.getLocation();
         IPath configPath = project.getLocation().append(config.getName());
         for (String rpm : rpms) {
             try {
@@ -109,7 +116,7 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
         for (String xml : xmls) {
             try {
                 String fileName = FileUtil.getFileNameFromPath(xml);
-                String targetPath = projectPath.append(fileName).toOSString();
+                String targetPath = configPath.append(fileName).toOSString();
                 FileUtil.copyTo(xml, targetPath);
                 xmlfiles.add(targetPath);
             } catch (IOException e) {
@@ -138,7 +145,6 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
         rpmfiles.clear();
         xmlfiles.clear();
         IProject project = (IProject) config.getOwner();
-        IPath projectPath = project.getLocation();
         IPath configPath = project.getLocation().append(config.getName());
         IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
         for (String rpm : rpms) {
@@ -155,12 +161,11 @@ public class GBSBuildResultProcessor implements IBuildResultProcessor {
                 e.printStackTrace();
             }
         }
-        System.out.print(true);
         List<String> xmls = getRemoteXmlFiles(rootstrap);
         for (String xml : xmls) {
             try {
                 String fileName = FileUtil.getFileNameFromPath(xml);
-                String targetPath = projectPath.append(fileName).toOSString();
+                String targetPath = configPath.append(fileName).toOSString();
                 copytool.downloadFileToFile(xml, targetPath);
                 xmlfiles.add(targetPath);
             } catch (RemoteConnectionException e) {
index 6ecd32a..e01ff07 100644 (file)
@@ -104,11 +104,73 @@ public class HostCommandLauncher {
     public static boolean execute(String command) throws InterruptedException {
         return execute(command, null, null, null);
     }
+    
+    public static boolean asyncExecute(Process proc) throws InterruptedException {
+        // wait for process finish
+        proc.waitFor();
+        // abnormal termination
+        if (proc.exitValue() != 0) {
+            return false;
+        } else {
+            return true;
+        }
+    }
 
     public static boolean execute(String command, String workingDir, String consoleViewName,
             IProgressMonitor monitor) throws InterruptedException {
         return execute(command, workingDir, null, consoleViewName, monitor);
     }
+    
+   public static synchronized boolean execute(Process proc, String consoleViewName, IProgressMonitor monitor) 
+           throws InterruptedException {
+     // handle console
+        if (consoleViewName != null) {
+            ConsoleManager cm = new ConsoleManager(consoleViewName, true);
+            cm.clear();
+            BufferedReader input = new BufferedReader(new InputStreamReader(proc.getInputStream()));
+            String line = null;
+            try {
+                while ((line = input.readLine()) != null) {
+                    cm.println(line);
+                    if (monitor != null && monitor.isCanceled()) {
+                        cm.println("Canceled command");
+                        throw new InterruptedException("Command execution is canceled!");
+                    }
+                }
+            } catch (IOException e) {
+                cm.println(e.getMessage());
+                e.printStackTrace();
+            } finally {
+                if (input != null) {
+                    tryClose(input);
+                }
+            }
+        }
+
+        // wait for process finish
+        proc.waitFor();
+
+        // wait for monitor thread finish
+        if (monitor != null) {
+            if (monitor.isCanceled()) {
+                throw new InterruptedException("Command execution is canceled!");
+            }
+        }
+
+        // abnormal termination
+        if (proc.exitValue() != 0) {
+            return false;
+        } else {
+            return true;
+        }
+    }
+   
+    public static Process execute(String command, String workingDir, Map<String, String> newEnv) 
+            throws InterruptedException {
+     // start process
+        Process proc = CommandUtil.createProcess(command, workingDir, newEnv, false);
+        return proc;
+    }
 
     public static synchronized boolean execute(String command, String workingDir,
             Map<String, String> newEnv, String consoleViewName, IProgressMonitor monitor)
index 883c919..936efb5 100644 (file)
@@ -157,7 +157,7 @@ public class GitCommander {
                 uri = new URIish(sshConn + GITPATH_DELIMITER2 + gitPath);
             }
             File workdir = new File(projectPath.toOSString());
-            int timeout = 20;
+            int timeout = 1000;
             boolean allSelected = true;
 
             final CloneOperation op = new CloneOperation(uri, allSelected, null, workdir, null,
index 3b7ccb3..b0f5ced 100644 (file)
@@ -45,6 +45,8 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
 import org.eclipse.cdt.debug.core.cdi.CDIException;
 import org.eclipse.cdt.debug.core.cdi.ICDISession;
 import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
+import org.eclipse.cdt.debug.mi.core.IGDBServerMILaunchConfigurationConstants;
+import org.eclipse.cdt.debug.mi.core.IMILaunchConfigurationConstants;
 import org.eclipse.cdt.launch.AbstractCLaunchDelegate;
 import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
 import org.eclipse.cdt.managedbuilder.core.IConfiguration;
@@ -70,6 +72,13 @@ import org.eclipse.debug.core.model.IProcess;
 import org.eclipse.jface.viewers.ILabelProvider;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.jface.window.Window;
+import org.eclipse.ptp.remotetools.core.IRemoteCopyTools;
+import org.eclipse.ptp.remotetools.core.IRemoteExecutionTools;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteExecutionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.PartInitException;
@@ -81,6 +90,7 @@ import org.tizen.common.TizenPlatformConstants;
 import org.tizen.common.sdb.command.SdbCommand;
 import org.tizen.common.util.DialogUtil;
 import org.tizen.common.util.LocalPortChecker;
+import org.tizen.common.util.OSChecker;
 import org.tizen.common.util.SWTUtil;
 import org.tizen.common.util.StringUtil;
 import org.tizen.common.util.log.UserInteraction;
@@ -104,11 +114,13 @@ import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
 import org.tizen.nativeplatform.pkg.commander.factory.PkgFilterFactory;
 import org.tizen.nativeplatform.pkg.model.IPackage;
 import org.tizen.nativeplatform.pkg.model.PkgStatus;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
 import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
 import org.tizen.nativeplatform.util.PackageUtil;
 import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 import org.tizen.sdblib.Arch;
 import org.tizen.sdblib.IDevice;
@@ -323,14 +335,24 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
         String appPath = config
                 .getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
         IPath hostPath = getHostPath(appPath, config);
+        boolean exists = false;
         if (hostPath != null) {
-            if (hostPath.toFile().exists()) {
-                return;
+            if (OSChecker.isWindows()) {
+                IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+                try {
+                    exists = filetool.hasFile(hostPath.toString(), new NullProgressMonitor());
+                } catch (RemoteOperationException e) {
+                    e.printStackTrace();
+                } catch (RemoteConnectionException e) {
+                    e.printStackTrace();
+                } catch (CancelException e) {
+                    e.printStackTrace();
+                }
             } else {
-                newCoreException(PlatformLaunchMessages.CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP,
-                        null);
+                exists = hostPath.toFile().exists();                    
             }
-        } else {
+        }
+        if (!exists) {
             newCoreException(PlatformLaunchMessages.CANNOT_FIND_EXECUTABLE_IN_A_HOST_ROOTSTRAP,
                     null);
         }
@@ -666,10 +688,64 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
 
     protected ICDISession getDebugSession(ILaunch launch, ILaunchConfiguration config,
             IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException {
-        TizenPlatformDebugger debugger = new TizenPlatformDebugger();
-        return ((ICDIDebugger2) debugger).createSession(launch, getGDBClientArgument(exeFile),
-                new SubProgressMonitor(monitor, 1));
+        TizenPlatformDebugger debugger = new TizenPlatformDebugger();        
+        if (OSChecker.isWindows()) {
+            String appPath = config
+                    .getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
+            String rootstrapId = target.getRootstrap().getId();
+            String rootstrapPath = RootstrapUtil.getRemoteRootstrapScratchPath(rootstrapId);
+            //File exec = new Path(rootstrapPath).append(appPath).toFile();
+            File exec = new Path(appPath).toFile();                    
+            return ((ICDIDebugger2) debugger).createSession(launch, exec, new SubProgressMonitor(monitor, 1));
+        } else {
+            return ((ICDIDebugger2) debugger).createSession(launch, getGDBClientArgument(exeFile),
+                    new SubProgressMonitor(monitor, 1));
+        }
+        
     }
+    /*
+    public static ILaunchConfiguration createForward(ILaunchConfiguration config, IDevice device) throws CoreException, NumberFormatException, TimeoutException, SdbCommandRejectedException, IOException {
+        int gdbPort = 0;
+        int gdbserverPort = 0;
+        ILaunchConfiguration newConfiguration = config;
+
+        gdbPort = Integer.parseInt(config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT));
+        if (!LocalPortChecker.isPortAvailable(gdbPort)) {
+            gdbPort = LaunchUtils.getDefaultDebugPort(device);
+            if (gdbPort < 0) {
+                LaunchUtils.newCoreException(TizenLaunchMessages.CANNOT_SET_DEBUG_LOCAL_PORT_TO_NEGATIVE, null);
+            }
+            String localPort = Integer.valueOf(gdbPort).toString();
+            ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+            wc.setAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, localPort);
+            newConfiguration = wc.doSave();
+            gdbPort = Integer.parseInt(localPort);
+        }
+
+        gdbserverPort = Integer.parseInt(config.getAttribute(TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT, TizenLaunchConfigurationConstants.ATTR_GDBSERVER_PORT_DEFAULT));
+        IRemoteExecutionTools exectool = RemoteConnectionManager.getRemoteTools().getExecTool();
+        try {
+            
+            //exectool.executeBashCommand("/home/sdk/tizen-sdk/tools/sdb connect 172.21.111.40");
+            String cmd = String.format("/home/sdk/tizen-sdk/tools/sdb forward tcp:%d tcp:%d", gdbPort, gdbserverPort);
+            exectool.executeWithOutput("/home/sdk/tizen-sdk/tools/sdb connect 172.21.111.40");
+            String output = exectool.executeWithOutput(cmd);
+            System.out.print(output);
+        } catch (RemoteExecutionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (RemoteConnectionException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        } catch (CancelException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        //device.createForward(gdbPort, gdbserverPort);
+
+        return newConfiguration;
+    }
+    */
 
     protected void launchApplicationWithGDBClient(ILaunch launch, ILaunchConfiguration config,
             IBinaryObject exeFile, IProgressMonitor monitor) throws CoreException {
@@ -678,6 +754,7 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
             monitor.subTask(TizenLaunchMessages.LAUNCH_APPLICATION_WITH_GDBCLIENT);
 
             LaunchUtils.createForward(config, currentDevice);
+            //createForward(config, currentDevice);
             try {
                 debugSession = getDebugSession(launch, config, exeFile, monitor);
             } catch (CoreException e) {
@@ -738,6 +815,7 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
 
     protected void setDebugConfigAttributes(ILaunchConfiguration config) throws CoreException {
         ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+        wc.setAttribute(IMILaunchConfigurationConstants.ATTR_DEBUGGER_AUTO_SOLIB, false);
         wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
                 ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN);
         wc.doSave();
@@ -814,6 +892,20 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
         String appPath = config
                 .getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
         IPath hostPath = getHostPath(appPath, config);
+        if (OSChecker.isWindows()) {
+            IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
+            String rootstrapId = target.getRootstrap().getId();
+            String syncRootstrapPath = RootstrapUtil.getUserSyncRootstrapPath(rootstrapId);
+            File localBinaryPath = new Path(syncRootstrapPath).append(appPath).toFile();
+            try {
+                copytool.downloadFileToFile(hostPath.toString(), localBinaryPath);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+            if (localBinaryPath.exists()) {
+                hostPath = new Path(localBinaryPath.getPath());
+            }
+        }
         ICProject cproject = CDebugUtils.verifyCProject(config);
         IBinaryObject binaryObject = verifyBinary(cproject, hostPath);
         return binaryObject;
@@ -830,16 +922,29 @@ public class PlatformLaunchDelegate extends AbstractCLaunchDelegate {
 
     protected IPath getHostPath(String exePath, ILaunchConfiguration config) throws CoreException {
         IPath path = target.getRootstrap().getPath();
+        String id = target.getRootstrap().getId();
         if (target.getRootstrapCommander() == null) {
             return new Path(exePath);
         }
         String canonicalPath = target.getRootstrapCommander().canonicalizePath(exePath);
-        String rootstrapPath = SmartBuildInterface.getInstance().getPlatformRootstrapPath(path);
-        if (rootstrapPath != null && !rootstrapPath.isEmpty()) {
-            if (canonicalPath != null && !canonicalPath.isEmpty()) {
-                rootstrapPath = rootstrapPath.concat(canonicalPath);
-            } else {
-                rootstrapPath = rootstrapPath.concat(exePath);
+        String rootstrapPath = "";
+        if (OSChecker.isWindows()) {
+            rootstrapPath = RootstrapUtil.getRemoteRootstrapScratchPath(id);
+            if (rootstrapPath != null && !rootstrapPath.isEmpty()) {
+                if (canonicalPath != null && !canonicalPath.isEmpty()) {
+                    rootstrapPath = rootstrapPath.concat(canonicalPath);
+                } else {
+                    rootstrapPath = rootstrapPath.concat(exePath);
+                }
+            }
+        } else {            
+            rootstrapPath = SmartBuildInterface.getInstance().getPlatformRootstrapPath(path);
+            if (rootstrapPath != null && !rootstrapPath.isEmpty()) {
+                if (canonicalPath != null && !canonicalPath.isEmpty()) {
+                    rootstrapPath = rootstrapPath.concat(canonicalPath);
+                } else {
+                    rootstrapPath = rootstrapPath.concat(exePath);
+                }
             }
         }
         return new Path(rootstrapPath);
index d2108c0..231baf8 100644 (file)
@@ -61,6 +61,7 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorPart;
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.util.DialogUtil;
+import org.tizen.common.util.OSChecker;
 import org.tizen.common.util.SWTUtil;
 import org.tizen.nativecommon.build.CommonBuildMessages;
 import org.tizen.nativecommon.build.SmartBuildInterface;
@@ -76,6 +77,7 @@ import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.util.PackageUtil;
 import org.tizen.nativeplatform.util.PlatformLaunchUtil;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 import org.tizen.sdblib.IDevice;
 import org.tizen.sdblib.util.ArrayUtil;
@@ -226,7 +228,12 @@ abstract public class PlatformProjectCommonLaunchShortcut extends CApplicationLa
             ILaunchConfigurationWorkingCopy configuration) {
         PlatformRootstrap rootstrap = target.getRootstrap();
         String basePath = rootstrap.getPath().toOSString();
-        String rootstrapPath = SmartBuildInterface.getInstance().getPlatformRootstrapPath(basePath);
+        String rootstrapPath = "";
+        if (OSChecker.isWindows()) {
+            rootstrapPath = basePath;
+        } else {
+            rootstrapPath = SmartBuildInterface.getInstance().getPlatformRootstrapPath(basePath);
+        }
         MappingSourceContainer prjMappingContainer = new MappingSourceContainer(
                 PROJECT_SOURCE_CONTAINER);
         MapEntrySourceContainer entry = new MapEntrySourceContainer();
index fe19bba..202c13c 100644 (file)
@@ -11,6 +11,9 @@ import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.eclipse.cdt.managedbuilder.core.IConfiguration;
+import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
+import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
@@ -19,6 +22,7 @@ import org.slf4j.LoggerFactory;
 import org.tizen.common.TizenProjectType;
 import org.tizen.common.util.IOUtil;
 import org.tizen.nativeplatform.IPlatformXMLStore;
+import org.tizen.nativeplatform.build.PlatformConfigurationManager;
 import org.tizen.nativeplatform.filefilter.XmlFileFilter;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -41,11 +45,6 @@ public class PlatformManifestXMLStore implements IPlatformXMLStore {
             .getLogger(PlatformManifestXMLStore.class);
 
     @Override
-    public void setProject(IProject project) {
-        setProject(project.getLocation().toFile().getAbsolutePath());
-    }
-
-    @Override
     public boolean loadXml() {
 
         if (!new File(projectPath).exists()) {
@@ -164,16 +163,18 @@ public class PlatformManifestXMLStore implements IPlatformXMLStore {
     }
 
     @Override
-    public void setProject(String projectPath) {
-        this.projectPath = projectPath;
-        File dir = new File(projectPath);
-
+    public void setProject(IProject project) {
+        this.projectPath = project.getLocation().toString();
+        IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
+        IConfiguration defaultConfig = info.getDefaultConfiguration();
+        File dir = project.getFile(defaultConfig.getName()).getLocation().toFile();
         // get ".xml" file list
         String[] files = dir.list(new XmlFileFilter());
         // return false if ".xml" file does not exist
         if (files.length != 0) {
             for (String file : files) {
-                IPath filePath = new Path(projectPath).append(file);
+                IPath filePath = project.getLocation().append(defaultConfig.getName()).append(file);
+                //IPath filePath = new Path(projectPath).append(file);
                 manifestFiles.add(filePath.toFile());
             }
         }
index e2c7ab1..dfee37e 100644 (file)
@@ -1,9 +1,16 @@
 package org.tizen.nativeplatform.remote.connection;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.ptp.remote.core.IRemoteConnection;
 import org.eclipse.ptp.remote.core.IRemoteConnectionManager;
@@ -13,19 +20,21 @@ import org.eclipse.ptp.remote.core.exception.RemoteConnectionException;
 import org.eclipse.ptp.remote.remotetools.core.RemoteToolsConnection;
 import org.eclipse.ptp.remote.remotetools.core.RemoteToolsServices;
 import org.eclipse.ptp.remotetools.core.IRemoteExecutionManager;
+import org.tizen.common.util.FileUtil;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 
 @SuppressWarnings("restriction")
 public class RemoteConnectionManager {
     public static String DEFAULT_CONNECTION_NAME = "remote_connection";
     private static Map<String, RemoteTools> connectionMap = new HashMap<String, RemoteTools>();
 
-    public static boolean createConnection(String host, String user, String pass,
-            IProgressMonitor monitor) {
-        return createConnection(host, user, pass, DEFAULT_CONNECTION_NAME, monitor);
+    public static boolean createConnection(String host, String user, String pass, String publicKey,
+            String privateKey, IProgressMonitor monitor) {
+        return createConnection(host, user, pass, publicKey, privateKey, DEFAULT_CONNECTION_NAME, monitor);
     }
 
-    public static boolean createConnection(String host, String user, String pass,
-            String connectionName, IProgressMonitor monitor) {
+    public static boolean createConnection(String host, String user, String pass, String publicKey,
+            String privateKey, String connectionName, IProgressMonitor monitor) {
         try {
             IRemoteConnection conn = getConnection(connectionName);
             if (conn == null) {
@@ -40,7 +49,10 @@ public class RemoteConnectionManager {
                 String userhome = conn.getWorkingDirectory();
                 RemoteToolsConnection toolsConn = (RemoteToolsConnection) conn;
                 IRemoteExecutionManager execMgr = toolsConn.createExecutionManager();
-                RemoteTools remoteTools = new RemoteTools(host, user, pass, userhome, execMgr);
+                RemoteTools remoteTools = new RemoteTools(host, user, pass, execMgr);
+                remoteTools.setUserhome(userhome);
+                remoteTools.setPrivateKey(privateKey);
+                remoteTools.setPublicKey(publicKey);
                 monitor.worked(1);
                 connectionMap.put(connectionName, remoteTools);
             } else {
@@ -56,7 +68,10 @@ public class RemoteConnectionManager {
                     String userhome = conn.getWorkingDirectory();
                     RemoteToolsConnection toolsConn = (RemoteToolsConnection) conn;
                     IRemoteExecutionManager execMgr = toolsConn.createExecutionManager();
-                    remoteTools = new RemoteTools(host, user, pass, userhome, execMgr);
+                    remoteTools = new RemoteTools(host, user, pass, execMgr);
+                    remoteTools.setUserhome(userhome);
+                    remoteTools.setPrivateKey(privateKey);
+                    remoteTools.setPublicKey(publicKey);
                     connectionMap.put(connectionName, remoteTools);
                 }
             }
index b4b507a..fdc930e 100644 (file)
@@ -13,13 +13,14 @@ public class RemoteTools {
     private String user = "";
     private String pass = "";
     private String userhome = "";
+    private String publicKey = "";
+    private String privateKey = "";
     private IRemoteExecutionManager execMgr = null;
     
-    public RemoteTools(String host, String user, String pass, String userhome, IRemoteExecutionManager execMgr) {
+    public RemoteTools(String host, String user, String pass, IRemoteExecutionManager execMgr) {
         this.host = host;
         this.user = user;
         this.pass = pass;
-        this.userhome = userhome;
         this.execMgr = execMgr;
     }
     
@@ -47,6 +48,22 @@ public class RemoteTools {
         return pass;
     }
 
+    public String getPublicKey() {
+        return publicKey;
+    }
+
+    public void setPublicKey(String publicKey) {
+        this.publicKey = publicKey;
+    }
+
+    public String getPrivateKey() {
+        return privateKey;
+    }
+
+    public void setPrivateKey(String privateKey) {
+        this.privateKey = privateKey;
+    }
+
     public void setPass(String pass) {
         this.pass = pass;
     }
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RootstrapSyncronizer.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RootstrapSyncronizer.java
new file mode 100644 (file)
index 0000000..7a0d859
--- /dev/null
@@ -0,0 +1,151 @@
+package org.tizen.nativeplatform.remote.connection;\r
+\r
+import java.io.File;\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\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.core.IRemoteFileTools;\r
+import org.eclipse.ptp.remotetools.core.IRemoteItem;\r
+import org.eclipse.ptp.remotetools.exception.CancelException;\r
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;\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.nativeplatform.util.PlatformUserInteraction;\r
+import org.tizen.nativeplatform.util.RootstrapUtil;\r
+import org.tizen.nativeplatform.views.model.PlatformRootstrap;\r
+\r
+public class RootstrapSyncronizer {\r
+    \r
+    private static long includeDirModificationTime = 0;\r
+    private static long debugsrcDirModificationTime = 0;\r
+    \r
+    public static void cacheModificationTime(PlatformRootstrap rootstrap) {\r
+        String remoteIncludePath = getRemoteIncludePath(rootstrap);\r
+        String remoteDebugsrcPath = getRemoteDebugsrcPath(rootstrap);\r
+        IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();\r
+        try {\r
+            boolean exists = filetool.hasDirectory(remoteIncludePath, new NullProgressMonitor());\r
+            if (exists) {\r
+                IRemoteItem item = filetool.getDirectory(remoteIncludePath, new NullProgressMonitor());\r
+                includeDirModificationTime = item.getModificationTime();\r
+            }\r
+            exists = filetool.hasDirectory(remoteDebugsrcPath, new NullProgressMonitor());\r
+            if (exists) {\r
+                IRemoteItem item = filetool.getDirectory(remoteDebugsrcPath, new NullProgressMonitor());\r
+                debugsrcDirModificationTime = item.getModificationTime();\r
+            }\r
+        } catch (RemoteOperationException e) {\r
+            e.printStackTrace();\r
+        } catch (RemoteConnectionException e) {\r
+            e.printStackTrace();\r
+        } catch (CancelException e) {\r
+            e.printStackTrace();\r
+        }\r
+    }\r
+    \r
+    public static void syncronizeIfChanges(PlatformRootstrap rootstrap, IProgressMonitor monitor) {\r
+        String remoteIncludePath = getRemoteIncludePath(rootstrap);\r
+        String remoteDebugsrcPath = getRemoteDebugsrcPath(rootstrap);\r
+        IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();\r
+        boolean syncInclude = false;\r
+        boolean syncDebugsrc = false;\r
+        try {\r
+            boolean exists = filetool.hasDirectory(remoteIncludePath, new NullProgressMonitor());\r
+            if (exists) {\r
+                IRemoteItem item = filetool.getDirectory(remoteIncludePath, new NullProgressMonitor());\r
+                long currentModificationTime = item.getModificationTime();\r
+                if (includeDirModificationTime != currentModificationTime) {\r
+                    syncInclude = true;\r
+                }\r
+            }\r
+            exists = filetool.hasDirectory(remoteDebugsrcPath, new NullProgressMonitor());\r
+            if (exists) {\r
+                IRemoteItem item = filetool.getDirectory(remoteDebugsrcPath, new NullProgressMonitor());\r
+                long currentModificationTime = item.getModificationTime();\r
+                if (debugsrcDirModificationTime != currentModificationTime) {\r
+                    syncDebugsrc = true;\r
+                }\r
+            }\r
+        } catch (RemoteOperationException e) {\r
+            e.printStackTrace();\r
+        } catch (RemoteConnectionException e) {\r
+            e.printStackTrace();\r
+        } catch (CancelException e) {\r
+            e.printStackTrace();\r
+        }\r
+        syncronize(rootstrap, syncInclude, syncDebugsrc, monitor);\r
+    }\r
+    \r
+    public static void syncronize(PlatformRootstrap rootstrap, \r
+            boolean syncIncludes, boolean syncDebugsrc, IProgressMonitor monitor) {\r
+        List<PlatformRootstrap> list = new ArrayList<PlatformRootstrap>();\r
+        list.add(rootstrap);\r
+        syncronized(list, syncIncludes, syncDebugsrc, monitor);\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
+    }\r
+\r
+    public static void syncronize(List<PlatformRootstrap> list, IProgressMonitor monitor) {\r
+        syncronized(list, true, true, monitor);\r
+    }\r
+    \r
+    private static void syncronized(List<PlatformRootstrap> list, \r
+            boolean syncIncludes, boolean syncDebugsrc, IProgressMonitor monitor) {\r
+        if (!(syncIncludes || syncDebugsrc)) {\r
+            monitor.done();\r
+            return;\r
+        }\r
+        final String host = RemoteConnectionManager.getRemoteTools().getHost();\r
+        final String user = RemoteConnectionManager.getRemoteTools().getUser();\r
+        final String sshKeyPath = RemoteConnectionManager.getRemoteTools().getPrivateKey();\r
+        monitor.beginTask("Syncronize includes...", list.size() * 2);\r
+        for (PlatformRootstrap rootstrap : list) {\r
+            final String remoteIncludePath = getRemoteIncludePath(rootstrap);\r
+            final String remoteDebugsrcPath = getRemoteDebugsrcPath(rootstrap);            \r
+            String localRootstrapPath = RootstrapUtil.getUserSyncRootstrapPath(rootstrap.getId());\r
+            final File file = new Path(localRootstrapPath).append("usr").toFile();\r
+            if (!file.exists()) {\r
+                FileUtil.createDirectory(file);\r
+            }\r
+            RsyncProcessor processor = new RsyncProcessor(host, user, sshKeyPath);\r
+            try {\r
+                UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_INCLUDES);\r
+                if (syncIncludes) {\r
+                    monitor.subTask(String.format("Syncronize includes... [%s]", rootstrap.getId()));\r
+                    processor.downloadSync(remoteIncludePath, file.toString(), monitor);\r
+                }\r
+                monitor.worked(1);\r
+                if (syncDebugsrc) {\r
+                    monitor.subTask(String.format("Syncronize debug source... [%s]", rootstrap.getId()));\r
+                    processor.downloadSync(remoteDebugsrcPath, file.toString(), monitor);\r
+                }\r
+                monitor.worked(1);\r
+                UserLogger.end(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_INCLUDES);\r
+            } catch (InterruptedException e) {\r
+                e.printStackTrace();\r
+            } finally {\r
+                monitor.done();\r
+            }\r
+        }\r
+    }\r
+\r
+    private static String getRemoteIncludePath(PlatformRootstrap rootstrap) {\r
+        String scratchPath = RootstrapUtil.getRemoteRootstrapScratchPath(rootstrap.getId());\r
+        String remotePath = new Path(scratchPath).append("usr").append("include").toString();\r
+        return remotePath;\r
+    }\r
+    \r
+    private static String getRemoteDebugsrcPath(PlatformRootstrap rootstrap) {\r
+        String scratchPath = RootstrapUtil.getRemoteRootstrapScratchPath(rootstrap.getId());\r
+        String remotePath = new Path(scratchPath).append("usr").append("src").append("debug").toString();\r
+        return remotePath;\r
+    }    \r
+}\r
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RsyncProcessor.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/RsyncProcessor.java
new file mode 100644 (file)
index 0000000..b292cc2
--- /dev/null
@@ -0,0 +1,101 @@
+package org.tizen.nativeplatform.remote.connection;\r
+\r
+import java.util.HashMap;\r
+import java.util.List;\r
+import java.util.Map;\r
+\r
+import org.eclipse.core.runtime.IProgressMonitor;\r
+import org.eclipse.core.runtime.Path;\r
+import org.tizen.nativecommon.build.SmartBuildInterface;\r
+import org.tizen.nativecommon.build.exception.SBIException;\r
+import org.tizen.nativeplatform.command.launcher.HostCommandLauncher;\r
+import org.tizen.nativeplatform.command.launcher.LocalCommandUtil;\r
+\r
+public class RsyncProcessor {\r
+    String host = "";\r
+    String user = "";\r
+    String sshKeyPath = "";\r
+\r
+    public RsyncProcessor(String host, String user, String sshKeyPath) {\r
+        this.host = host;\r
+        this.user = user;\r
+        this.sshKeyPath = sshKeyPath;\r
+    }\r
+    \r
+    public boolean downloadSync(String remotePath, String localPath, IProgressMonitor monitor) throws InterruptedException {\r
+        SmartBuildInterface sbi = SmartBuildInterface.getInstance();\r
+        String[] envs = sbi.getEnvironmentVariables();\r
+        Map<String, String> envMap = new HashMap<String, String>();\r
+        for(String env : envs) {\r
+            int index = env.indexOf("=");\r
+            if (index > 0) {\r
+                String key = env.substring(0, index);\r
+                String value = env.substring(index+1);\r
+                envMap.put(key, value);\r
+            }\r
+        }\r
+        String msysBinPath = sbi.getMsysBinPath();\r
+        StringBuffer cmd = new StringBuffer();\r
+        cmd.append(new Path(msysBinPath).append("sh.exe").toOSString());\r
+        cmd.append(" -c \"");\r
+        cmd.append("rsync -avz --delete -e");\r
+        cmd.append("'ssh -i ");\r
+        cmd.append(sshKeyPath);\r
+        cmd.append(" -o StrictHostKeyChecking=no");\r
+        cmd.append("' ");\r
+        cmd.append(user);\r
+        cmd.append("@");\r
+        cmd.append(host);\r
+        cmd.append(":");\r
+        cmd.append(remotePath);\r
+        cmd.append(" .\"");\r
+        Process proc = LocalCommandUtil.createProcess(cmd.toString(), localPath, envMap, true);\r
+        boolean result = HostCommandLauncher.execute(proc, "rsync internal", monitor);\r
+        return result;\r
+    }\r
+    \r
+    public boolean uploadSync(String localPath, String remotePath, String[] excludes, IProgressMonitor monitor) \r
+        throws InterruptedException {\r
+        SmartBuildInterface sbi = SmartBuildInterface.getInstance();\r
+        String[] envs = sbi.getEnvironmentVariables();\r
+        Map<String, String> envMap = new HashMap<String, String>();\r
+        for(String env : envs) {\r
+            int index = env.indexOf("=");\r
+            if (index > 0) {\r
+                String key = env.substring(0, index);\r
+                String value = env.substring(index+1);\r
+                envMap.put(key, value);\r
+            }\r
+        }\r
+        String excludeCmd = "";\r
+        for (String exclude : excludes) {\r
+            excludeCmd += String.format("--exclude=%s ", exclude);\r
+        }\r
+        \r
+        String msysBinPath = sbi.getMsysBinPath();\r
+        String sourceMingwPath = sbi.getMinGWPathFromWindowsPath(localPath, false);\r
+        StringBuffer cmd = new StringBuffer();\r
+        cmd.append(new Path(msysBinPath).append("sh.exe").toOSString());\r
+        cmd.append(" -c \"");\r
+        cmd.append("rsync -avz --delete -e ");\r
+        cmd.append("'ssh -i ");\r
+        cmd.append(sshKeyPath);\r
+        cmd.append(" -o StrictHostKeyChecking=no");\r
+        cmd.append("' ");\r
+        if (!excludeCmd.isEmpty()) {\r
+            cmd.append(excludeCmd);\r
+        }\r
+        cmd.append(sourceMingwPath);\r
+        cmd.append(" ");\r
+        cmd.append(user);\r
+        cmd.append("@");\r
+        cmd.append(host);\r
+        cmd.append(":");\r
+        cmd.append(remotePath);\r
+        cmd.append("\"");\r
+        Process proc = LocalCommandUtil.createProcess(cmd.toString(), localPath, envMap, true);\r
+        return HostCommandLauncher.execute(proc, "rsync internal", monitor);\r
+    }\r
+\r
+}\r
\ No newline at end of file
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/SourceUploader.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/SourceUploader.java
deleted file mode 100644 (file)
index 60bf4d3..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-package org.tizen.nativeplatform.remote.connection;\r
-\r
-import java.io.File;\r
-\r
-import org.eclipse.core.filesystem.EFS;\r
-import org.eclipse.core.filesystem.IFileInfo;\r
-import org.eclipse.core.filesystem.IFileStore;\r
-import org.eclipse.core.filesystem.IFileSystem;\r
-import org.eclipse.core.resources.IProject;\r
-import org.eclipse.core.runtime.Assert;\r
-import org.eclipse.core.runtime.CoreException;\r
-import org.eclipse.core.runtime.IPath;\r
-import org.eclipse.core.runtime.Path;\r
-import org.eclipse.ptp.remotetools.core.IRemoteCopyTools;\r
-import org.eclipse.ptp.remotetools.core.IRemoteFileTools;\r
-import org.eclipse.ptp.remotetools.core.IRemoteItem;\r
-import org.eclipse.ptp.remotetools.environment.launcher.core.LinuxPath;\r
-import org.eclipse.ptp.remotetools.exception.CancelException;\r
-import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;\r
-import org.eclipse.ptp.remotetools.exception.RemoteOperationException;\r
-import org.eclipse.ptp.utils.file.core.FileRecursiveEnumeration;\r
-import org.tizen.nativeplatform.util.RootstrapUtil;\r
-\r
-public class SourceUploader {\r
-    \r
-    private IProject project;\r
-    \r
-    private static final String UPLOAD_TARGET_PATH = RootstrapUtil.getRemoteSourcePath();\r
-    \r
-    public SourceUploader(IProject project) {\r
-        this.project = project;\r
-    }\r
-    \r
-    public String upload() {\r
-        File sourcepath = project.getLocation().toFile();\r
-        IPath targetpath = new Path(UPLOAD_TARGET_PATH).append(project.getName());\r
-        try {\r
-            uploadDirectory(sourcepath, targetpath);\r
-        } catch (Exception e) {\r
-            return null;\r
-        }\r
-        return targetpath.toString(); \r
-    }\r
-\r
-    private void doFileUpload(File localFile, IPath remotePath) throws CoreException, CancelException, RemoteConnectionException {      \r
-        if (! localFile.exists()) {         \r
-            return;\r
-        }\r
-\r
-        Assert.isTrue(localFile.isAbsolute(), "localFile.isAbsolute()"); //$NON-NLS-1$\r
-        Assert.isTrue(localFile.isFile(), "localFile.isFile()"); //$NON-NLS-1$\r
-        Assert.isTrue(remotePath.isAbsolute(), "remotePath.isAbsolute()"); //$NON-NLS-1$\r
-        \r
-        String remotePathAsString = LinuxPath.toString(remotePath);\r
-\r
-        IRemoteCopyTools copyTools = RemoteConnectionManager.getRemoteTools().getCopyTool();\r
-        IRemoteFileTools fileTools = RemoteConnectionManager.getRemoteTools().getFileTool();\r
-\r
-        /*\r
-        if (rule.getOverwritePolicy() == OverwritePolicies.SKIP) {\r
-            if (remoteFile.exists()) {\r
-                //outputWriter.println(NLS.bind(Messages.UploadRuleAction_10, remotePath));\r
-                return;\r
-            }\r
-        } else if (rule.getOverwritePolicy() == OverwritePolicies.NEWER) {\r
-            long difference = localFile.lastModified() - remoteFile.getModificationTime();\r
-            if (difference < 1000) {\r
-                //outputWriter.println(NLS.bind(Messages.UploadRuleAction_11, remotePath));\r
-                return;                 \r
-            }\r
-        }\r
-        */\r
-        \r
-        /*\r
-         * Upload the file.\r
-         */\r
-        try {\r
-            copyTools.uploadFileToFile(localFile, remotePathAsString);\r
-        } catch (RemoteOperationException e) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_12, e.getMessage()));\r
-            return;\r
-        }\r
-    \r
-        /*\r
-         * Add file to list of files to download back, if this feature was enabled.\r
-         */\r
-        /*\r
-        if (rule.isDownloadBack()) {\r
-            if (downloadBackRule == null) {\r
-                downloadBackRule = new DownloadBackRule();\r
-            }\r
-            downloadBackRule.add(localFile, remotePath);\r
-        }\r
-        */\r
-\r
-        /*\r
-         * Fetch properties of file that was just uploaded.\r
-         */\r
-        IRemoteItem remoteFile = null;\r
-        try {\r
-            remoteFile = fileTools.getFile(remotePathAsString, null);\r
-        } catch (RemoteOperationException e) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_13, e.getMessage()));\r
-            return;\r
-        }\r
-        \r
-        /*\r
-         * Set file permissions. We need help of EFS, since the File class from\r
-         * Java does not providel all information.\r
-         */\r
-        IFileSystem localFileSystem = EFS.getLocalFileSystem();\r
-        IFileStore fileStore = localFileSystem.getStore(new Path(localFile.getPath()));\r
-        IFileInfo fileInfo = fileStore.fetchInfo();\r
-\r
-        boolean read = localFile.canRead();\r
-        boolean write = localFile.canWrite();\r
-        boolean execute = fileInfo.getAttribute(EFS.ATTRIBUTE_EXECUTABLE);\r
-        \r
-        /*\r
-        if (rule.isAsReadOnly()) {\r
-            write = false;\r
-        }\r
-        if (rule.isAsExecutable()) {\r
-            execute = true;\r
-        }\r
-        */\r
-        \r
-        remoteFile.setExecutable(execute);\r
-        remoteFile.setWriteable(write);\r
-        remoteFile.setReadable(read);\r
-        \r
-        /*\r
-         * Set date/time, if required\r
-         */     \r
-        //if (rule.isPreserveTimeStamp()) {\r
-            long timestamp = localFile.lastModified();\r
-            remoteFile.setModificationTime(timestamp);\r
-        //}\r
-        \r
-\r
-        /*\r
-         * Commit changes\r
-         */\r
-        try {\r
-            remoteFile.commitAttributes(null);\r
-        } catch (RemoteOperationException e) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_14, e.getMessage()));\r
-            return;\r
-        }\r
-    }\r
-    \r
-    private void doDirectoryUpload(File localDir, IPath remotePath) throws RemoteConnectionException, CancelException {\r
-        if (! localDir.exists()) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_15, localDir.toString()));\r
-            return;\r
-        }\r
-\r
-        Assert.isTrue(localDir.isDirectory(), "localFile.isDirectory()"); //$NON-NLS-1$\r
-        Assert.isTrue(localDir.isAbsolute(), "localFile.isAbsolute()"); //$NON-NLS-1$\r
-        Assert.isTrue(remotePath.isAbsolute(), "remotePath.isAbsolute()"); //$NON-NLS-1$\r
-\r
-        IRemoteFileTools fileTools = RemoteConnectionManager.getRemoteTools().getFileTool();\r
-        \r
-        /*\r
-         * Create remote directory if not already exists.\r
-         */\r
-        try {\r
-            fileTools.assureDirectory(LinuxPath.toString(remotePath), null);\r
-        } catch (RemoteOperationException e) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_16, e.getMessage()));\r
-            return;\r
-        }\r
-    \r
-        /*\r
-         * Fetch properties of directory that was just uploaded.\r
-         */\r
-        IRemoteItem remoteDirectory = null;\r
-        try {\r
-            remoteDirectory = fileTools.getDirectory(LinuxPath.toString(remotePath), null);\r
-        } catch (RemoteOperationException e) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_17, e.getMessage()));\r
-            return;\r
-        }\r
-        \r
-        /*\r
-         * Set file permissions.\r
-         */\r
-        boolean read = localDir.canRead();\r
-        boolean write = localDir.canWrite();\r
-        boolean execute = true;\r
-        \r
-        /*\r
-        if (rule.isAsReadOnly()) {\r
-            write = false;\r
-        }\r
-        */\r
-        \r
-        remoteDirectory.setExecutable(execute);\r
-        remoteDirectory.setWriteable(write);\r
-        remoteDirectory.setReadable(read);\r
-        \r
-        /*\r
-         * Set date/time, if required\r
-         */\r
-        //if (rule.isPreserveTimeStamp()) {\r
-            long timestamp = localDir.lastModified();\r
-            remoteDirectory.setModificationTime(timestamp);\r
-        //}\r
-\r
-        /*\r
-         * Commit changes\r
-         */\r
-        try {\r
-            remoteDirectory.commitAttributes(null);\r
-        } catch (RemoteOperationException e) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_18, e.getMessage()));\r
-            return;\r
-        }       \r
-    }\r
-\r
-    public void uploadDirectory(File localDir, IPath remotePath) throws CoreException, CancelException, RemoteConnectionException {\r
-        Assert.isTrue(localDir.isAbsolute(), "localDir.isAbsolute()"); //$NON-NLS-1$\r
-        Assert.isTrue(remotePath.isAbsolute(), "remotePath.isAbsolute()"); //$NON-NLS-1$\r
-\r
-        //outputWriter.println(NLS.bind(Messages.UploadRuleAction_19, localDir.toString()));\r
-        //outputWriter.println(NLS.bind(Messages.UploadRuleAction_20, LinuxPath.toString(remotePath)));\r
-\r
-        FileRecursiveEnumeration enumeration = null;\r
-        enumeration = new FileRecursiveEnumeration(localDir);\r
-        \r
-        IPath rootPath = new Path(localDir.getAbsolutePath());\r
-        int rootPathLength = rootPath.segmentCount();\r
-        while (enumeration.hasMoreElements()) {\r
-            while (enumeration.hasMoreExceptions()) {\r
-                //errorWriter.println(NLS.bind(Messages.UploadRuleAction_21, enumeration.nextException())); \r
-            }\r
-            File file = (File) enumeration.nextElement();\r
-            IPath filePath = new Path(file.getAbsolutePath());\r
-            IPath relativePath = filePath.removeFirstSegments(rootPathLength);\r
-            IPath remoteFilePath = remotePath.append(relativePath);\r
-            if (file.isDirectory()) {\r
-                //outputWriter.println(NLS.bind(Messages.UploadRuleAction_22, LinuxPath.toString(remoteFilePath)));\r
-                doDirectoryUpload(file, remoteFilePath);\r
-            } else {\r
-                //outputWriter.println(NLS.bind(Messages.UploadRuleAction_23, LinuxPath.toString(relativePath)));\r
-                doFileUpload(file, remoteFilePath);\r
-            }\r
-        }\r
-        while (enumeration.hasMoreExceptions()) {\r
-            //errorWriter.println(NLS.bind(Messages.UploadRuleAction_24, enumeration.nextException())); \r
-        }\r
-    }\r
-}\r
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceDeltaManager.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceDeltaManager.java
new file mode 100644 (file)
index 0000000..2e008d7
--- /dev/null
@@ -0,0 +1,18 @@
+package org.tizen.nativeplatform.remote.connection;\r
+\r
+import java.util.HashMap;\r
+import java.util.Map;\r
+\r
+import org.eclipse.core.resources.IProject;\r
+\r
+public class WorkspaceDeltaManager {\r
+    private static Map<IProject, WorkspaceResourceDelta> deltaMap = new HashMap<IProject, WorkspaceResourceDelta>();\r
+    \r
+    public static void putDelta(IProject project, WorkspaceResourceDelta delta) {\r
+        deltaMap.put(project, delta);\r
+    }\r
+    \r
+    public static WorkspaceResourceDelta getDelta(IProject project) {\r
+        return deltaMap.get(project);\r
+    }\r
+}\r
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceResourceDelta.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceResourceDelta.java
new file mode 100644 (file)
index 0000000..2b2d67e
--- /dev/null
@@ -0,0 +1,34 @@
+package org.tizen.nativeplatform.remote.connection;\r
+\r
+import org.eclipse.core.internal.events.ResourceDeltaFactory;\r
+import org.eclipse.core.internal.resources.Workspace;\r
+import org.eclipse.core.internal.watson.ElementTree;\r
+import org.eclipse.core.resources.IProject;\r
+import org.eclipse.core.resources.IResourceDelta;\r
+import org.eclipse.core.runtime.IPath;\r
+\r
+@SuppressWarnings("restriction")\r
+public class WorkspaceResourceDelta {\r
+    private ElementTree oldTree = null;\r
+    private ElementTree newTree = null;\r
+    private IProject project;\r
+\r
+    public WorkspaceResourceDelta(IProject project) {\r
+        this.project = project;\r
+    }\r
+\r
+    public IResourceDelta computeDelta() {\r
+        IPath subTreePath = project.getFullPath();\r
+        newTree = ((Workspace) project.getWorkspace()).getElementTree().getSubtree(subTreePath);\r
+        if (oldTree == null) {\r
+            oldTree = newTree;\r
+        } else {\r
+            IResourceDelta result = ResourceDeltaFactory\r
+                    .computeDelta((Workspace) project.getWorkspace(), oldTree, newTree,\r
+                            project.getFullPath(), -1);\r
+            oldTree = newTree;\r
+            return result;\r
+        }\r
+        return null;\r
+    }\r
+}\r
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceSyncronizer.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/remote/connection/WorkspaceSyncronizer.java
new file mode 100644 (file)
index 0000000..510265b
--- /dev/null
@@ -0,0 +1,78 @@
+package org.tizen.nativeplatform.remote.connection;\r
+\r
+import org.eclipse.core.resources.IProject;\r
+import org.eclipse.core.runtime.IPath;\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.core.IRemoteExecutionTools;\r
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;\r
+import org.eclipse.ptp.remotetools.core.IRemoteItem;\r
+import org.eclipse.ptp.remotetools.core.IRemoteScript;\r
+import org.eclipse.ptp.remotetools.exception.CancelException;\r
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;\r
+import org.eclipse.ptp.remotetools.exception.RemoteExecutionException;\r
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;\r
+import org.tizen.common.util.log.UserLogger;\r
+import org.tizen.nativeplatform.util.PlatformUserInteraction;\r
+import org.tizen.nativeplatform.util.RootstrapUtil;\r
+\r
+public class WorkspaceSyncronizer {\r
+    \r
+    public static String[] EXCLUDES = {".git/", "Debug/", "Release/", ".cproject", ".project", ".tproject"};\r
+    \r
+    public static boolean syncronize(IProject project, IProgressMonitor monitor) {\r
+        final String host = RemoteConnectionManager.getRemoteTools().getHost();\r
+        final String user = RemoteConnectionManager.getRemoteTools().getUser();\r
+        final String sshKeyPath = RemoteConnectionManager.getRemoteTools().getPrivateKey();\r
+        String sourcePath = project.getLocation().toOSString();\r
+        String targetPath = RootstrapUtil.getUserSyncWorkspacePath(project.getName());\r
+        String workspacePath = new Path(targetPath).removeLastSegments(1).toString();\r
+        IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();\r
+        \r
+        try {\r
+            filetool.assureDirectory(workspacePath, new NullProgressMonitor());\r
+            UserLogger.start(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_WORKSPACE);\r
+            RsyncProcessor processor = new RsyncProcessor(host, user, sshKeyPath);\r
+            UserLogger.end(PlatformUserInteraction.CATE_SYNCRONIZE, PlatformUserInteraction.SYNC_WORKSPACE);\r
+            boolean result = processor.uploadSync(sourcePath, workspacePath, EXCLUDES, monitor);\r
+            if (result) {\r
+                gitInit(workspacePath, project);\r
+            }\r
+            return result;\r
+        } catch (RemoteOperationException e) {\r
+            e.printStackTrace();\r
+        } catch (RemoteConnectionException e) {\r
+            e.printStackTrace();\r
+        } catch (CancelException e) {\r
+            e.printStackTrace();\r
+        } catch (InterruptedException e) {\r
+            e.printStackTrace();\r
+        }\r
+        return false;\r
+    }\r
+    \r
+    private static void gitInit(String workspacePath, IProject project) {        \r
+        IPath projectPath = new Path(workspacePath).append(project.getName());\r
+        String gitPath = projectPath.append(".git").toString();\r
+        IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();\r
+        try {\r
+            boolean exists = filetool.hasDirectory(gitPath, new NullProgressMonitor());\r
+            if (!exists) {\r
+                IRemoteExecutionTools execTool = RemoteConnectionManager.getRemoteTools().getExecTool();\r
+                String cmds[] = {"cd " + projectPath, "git init"};\r
+                IRemoteScript script = execTool.createScript();\r
+                script.setScript(cmds);\r
+                execTool.executeScript(script);\r
+            }\r
+        } catch (RemoteExecutionException e) {\r
+            e.printStackTrace();\r
+        } catch (RemoteOperationException e) {\r
+            e.printStackTrace();\r
+        } catch (RemoteConnectionException e) {\r
+            e.printStackTrace();\r
+        } catch (CancelException e) {\r
+            e.printStackTrace();\r
+        }\r
+    }\r
+}\r
index a6baf21..d58a433 100644 (file)
@@ -27,6 +27,7 @@
 
 package org.tizen.nativeplatform.rootstrap;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -190,6 +191,9 @@ public class RemoteRootstrapManager extends LocalRootstrapManager {
                 e.printStackTrace();
                 return false;
             }
+            String path = RootstrapUtil.getUserSyncRootstrapPath(id);
+            File syncDir = new File(path);
+            FileUtil.recursiveDelete(syncDir);
             rootstraps.remove(rootstrap);
             if (userRootstraps.contains(rootstrap)) {
                 userRootstraps.remove(rootstrap);
index 20f57b6..4e1eb24 100644 (file)
 
 package org.tizen.nativeplatform.rootstrap;
 
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.tizen.common.util.OSChecker;
-import org.tizen.nativecommon.build.SmartBuildInterface;
-import org.tizen.nativecommon.build.exception.SBIException;
-import org.tizen.nativecommon.build.model.Rootstrap;
-import org.tizen.nativecommon.build.model.SBIModel;
-import org.tizen.nativeplatform.build.PlatformConfigurationManager;
-import org.tizen.nativeplatform.command.launcher.CommandUtil;
-import org.tizen.nativeplatform.command.launcher.HostCommandLauncher;
-import org.tizen.nativeplatform.repo.commander.RepoManager;
+import org.tizen.common.util.log.UserInteraction;
+import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativeplatform.repo.model.Repository;
-import org.tizen.nativeplatform.util.RootstrapUtil;
+import org.tizen.nativeplatform.util.PlatformUserInteraction;
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 
 public class RootstrapManager {
@@ -292,12 +277,16 @@ public class RootstrapManager {
     public static PlatformRootstrap generate(String name, String arch, String version,
             List<Repository> reposURLs, boolean immediateGen, IPath confFile,
             IProgressMonitor monitor) throws InterruptedException {
+        PlatformRootstrap rootstrap = null;
+        UserLogger.start(PlatformUserInteraction.GEN_ROOTSTRAP);
         if (OSChecker.isWindows()) {
-            return RemoteRootstrapManager.generate(name, arch, version, reposURLs, immediateGen,
+            rootstrap = RemoteRootstrapManager.generate(name, arch, version, reposURLs, immediateGen,
                     confFile, monitor);
         } else {
-            return LocalRootstrapManager.generate(name, arch, version, reposURLs, immediateGen,
+            rootstrap = LocalRootstrapManager.generate(name, arch, version, reposURLs, immediateGen,
                     confFile, monitor);
         }
+        UserLogger.end(PlatformUserInteraction.GEN_ROOTSTRAP);
+        return rootstrap;
     }
 }
index 33e6542..ba82334 100644 (file)
@@ -371,7 +371,7 @@ public class XMLPluginGenerator {
     }
 
     private static void remoteRemove(String id) {
-        remove(id);
+        localRemove(id);
         String path = RootstrapUtil.getRemotePluginXML(id);
         try {
             IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
index bebd7ca..9dd9fc1 100644 (file)
@@ -40,8 +40,14 @@ import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.ptp.remotetools.core.IRemoteCopyTools;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.swt.widgets.Shell;
@@ -54,6 +60,8 @@ import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.connection.ui.TizenRemoteFileDialog;
 import org.tizen.common.connection.ui.TizenRemoteFileDialog.TizenRemoteFileDialogResult;
 import org.tizen.common.util.DialogUtil;
+import org.tizen.common.util.FileUtil;
+import org.tizen.common.util.OSChecker;
 import org.tizen.nativecommon.TizenNativeException;
 import org.tizen.nativecommon.launch.LaunchUtils;
 import org.tizen.nativecommon.launch.TizenLaunchCommand;
@@ -62,7 +70,9 @@ import org.tizen.nativeplatform.IPlatformXMLStore;
 import org.tizen.nativeplatform.launch.PlatformLaunchMessages;
 import org.tizen.nativeplatform.pkg.commander.IPkgCommander;
 import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
+import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
 import org.tizen.nativeplatform.types.CmdTargetTypes;
+import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 import org.tizen.sdblib.IDevice;
 import org.tizen.sdblib.exception.SdbCommandRejectedException;
 import org.tizen.sdblib.exception.TimeoutException;
@@ -197,30 +207,64 @@ public class PlatformLaunchUtil {
     public static void readyGdbServer(PkgCommandTarget cmdTarget, IDevice device,
             TizenLaunchCommand command, IPath srcPath) throws CoreException, TimeoutException,
             SdbCommandRejectedException, IOException, Exception {
-        File gdbserver = new File(srcPath.toOSString());
-
-        if (!gdbserver.exists()) {
-            IPkgCommander commander = cmdTarget.getCommander(CmdTargetTypes.ROOTSTRAP);
-            commander.installRemotePkg("gdb-server", null);
-        }
+        String gdbserverPath = srcPath.toString();
+        File gdbserver = new File(gdbserverPath);
+        if (OSChecker.isWindows()) {
+            
+            IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+            boolean exists = filetool.hasFile(gdbserverPath, new NullProgressMonitor());
+            if (!exists) {
+                IPkgCommander commander = cmdTarget.getCommander(CmdTargetTypes.ROOTSTRAP);
+                commander.installRemotePkg("gdb-server", null);
+            }
+            exists = filetool.hasFile(gdbserverPath, new NullProgressMonitor());
+            if (!exists) {
+                LaunchUtils.newCoreException(
+                        NLS.bind(TizenLaunchMessages.GDBSERVER_NOT_INSTALLED, device.getDeviceName()),
+                        null);
+            }
+        } else {
+            if (!gdbserver.exists()) {
+                IPkgCommander commander = cmdTarget.getCommander(CmdTargetTypes.ROOTSTRAP);
+                commander.installRemotePkg("gdb-server", null);
+            }
 
-        if (!gdbserver.exists()) {
-            LaunchUtils.newCoreException(
-                    NLS.bind(TizenLaunchMessages.GDBSERVER_NOT_INSTALLED, device.getDeviceName()),
-                    null);
+            if (!gdbserver.exists()) {
+                LaunchUtils.newCoreException(
+                        NLS.bind(TizenLaunchMessages.GDBSERVER_NOT_INSTALLED, device.getDeviceName()),
+                        null);
+            }
         }
 
         if (!checkGdbServerInDevice(device, command)) {
-            copyFileToDevice(device, srcPath.toOSString(),
+            copyFileToDevice(cmdTarget.getRootstrap(), device, gdbserverPath,
                     TizenPlatformConstants.GDBSERVER_PLATFORM_CMD);
             device.executeShellCommand(String.format("chmod +x %s",
                     TizenPlatformConstants.GDBSERVER_PLATFORM_CMD));
         }
     }
 
-    public static void copyFileToDevice(IDevice device, String srcPath, String descPath)
+    public static void copyFileToDevice(PlatformRootstrap rootstrap, IDevice device, String srcPath, String descPath)
             throws CoreException, TimeoutException, SdbCommandRejectedException, IOException {
-        String path = new Path(descPath).removeLastSegments(1).toOSString();
+        if (OSChecker.isWindows()) {
+            //IRemoteFileTools filetool = RemoteConnectionManager.getRemoteTools().getFileTool();
+            IRemoteCopyTools copytool = RemoteConnectionManager.getRemoteTools().getCopyTool();
+            String syncRootstrapPath = RootstrapUtil.getUserSyncRootstrapPath(rootstrap.getId());
+            IPath localGdbPath = new Path(syncRootstrapPath).append(TizenPlatformConstants.GDBSERVER_PLATFORM_CMD);
+            IPath localGdbDir = localGdbPath.removeLastSegments(1);
+            if (!localGdbPath.toFile().exists()) {
+                try {
+                    FileUtil.createDirectory(localGdbDir.toFile());
+                    copytool.downloadFileToFile(srcPath, localGdbPath.toFile());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    LaunchUtils.newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
+                }
+            } else {
+                srcPath = localGdbPath.toString();
+            }
+        }
+        String path = new Path(descPath).removeLastSegments(1).toString();
         SyncResult syncResult = device.getSyncService().push(srcPath, device.getFileEntry(path));
         if (!syncResult.isOk()) {
             LaunchUtils.newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PlatformUserInteraction.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/util/PlatformUserInteraction.java
new file mode 100644 (file)
index 0000000..b062aaf
--- /dev/null
@@ -0,0 +1,10 @@
+package org.tizen.nativeplatform.util;\r
+\r
+public class PlatformUserInteraction {\r
+    \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
+}\r
index 42616be..77af6a2 100644 (file)
 
 package org.tizen.nativeplatform.util;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
@@ -43,7 +47,10 @@ public class RootstrapUtil {
 
     private static final String USER_ROOSTRAP_BASE_DIR_NAME = "user-rootstraps";
     private static final String REMOTE_TIZEN_SDK_DIR_NAME = "tizen-sdk-remote-data";
+    private static final String REMOTE_CONNECTION_DIR = "connection";
+    private static final String REMOTE_CONNECTION_FILE = "info";
     private static final String REMOTE_SOURCE_DIR_NAME = "source";
+    private static final String REMOTE_WORKSPACE_DIR = "workspace";
     private static final String REMOTE_ROOSTRAP_PLUGINS_DIR_NAME = "user-rootstrap-plugins";
 
     public static String getBaseArchitecture(String arch) {
@@ -53,20 +60,48 @@ public class RootstrapUtil {
             return "i386";
         }
     }
+    
+    public static String getSshConnectionInfoPath(String device) {
+        return new Path(device).append(REMOTE_TIZEN_SDK_DIR_NAME).append(REMOTE_CONNECTION_DIR).append(REMOTE_CONNECTION_FILE).toOSString();
+    }
 
     public static String getRemoteRootstrapBasePath() {
         String userhome = RemoteConnectionManager.getRemoteTools().getUserhome();
         return new Path(userhome).append(REMOTE_TIZEN_SDK_DIR_NAME).toString();
     }
-
+    /*
     public static String getRemoteSourcePath() {
         return new Path(getRemoteRootstrapBasePath()).append(REMOTE_SOURCE_DIR_NAME).toString();
     }
-
+    */
     public static String getRemoteRootstrapPluginPath() {
         return new Path(getRemoteRootstrapBasePath()).append(REMOTE_ROOSTRAP_PLUGINS_DIR_NAME)
                 .toString();
     }
+    
+    public static String getUserSyncWorkspacePath(String project) {
+        InetAddress ia = null;
+        try {
+            ia = InetAddress.getLocalHost();
+        } catch (UnknownHostException ee) {}
+        String ip = ia.getHostAddress();
+        String user = System.getProperty("user.name");
+        String workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
+        SmartBuildInterface sbi = SmartBuildInterface.getInstance();
+        String linuxWorkspace = sbi.getMinGWPathFromWindowsPath(workspace, false);
+        String dir = ip + "_" + user;
+        return new Path(getRemoteRootstrapBasePath()).append(REMOTE_WORKSPACE_DIR).append(dir).append(linuxWorkspace).append(project).toString();
+    }
+
+    public static String getUserSyncRootstrapPath(String id) {
+        if (!RemoteConnectionManager.connected()) {
+            return "";
+        }        
+        final String host = RemoteConnectionManager.getRemoteTools().getHost();
+        final String user = RemoteConnectionManager.getRemoteTools().getUser();
+        String dir = host + "_" + user;
+        return new Path(getBaseUserRootstrapPath()).append(dir).append(id).toOSString();
+    }
 
     public static String getUserRootstrapPath(String id) {
         return new Path(getBaseUserRootstrapPath()).append(id).toOSString();
index 7291e65..70d4246 100644 (file)
 
 package org.tizen.nativeplatform.views.ui;
 
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.util.ResourceBundle;
 
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.ptp.remotetools.core.IRemoteExecutionTools;
+import org.eclipse.ptp.remotetools.core.IRemoteFileTools;
+import org.eclipse.ptp.remotetools.exception.CancelException;
+import org.eclipse.ptp.remotetools.exception.RemoteConnectionException;
+import org.eclipse.ptp.remotetools.exception.RemoteExecutionException;
+import org.eclipse.ptp.remotetools.exception.RemoteOperationException;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.swt.widgets.Text;
@@ -56,11 +72,13 @@ public class RemoteConnectionDialog extends Dialog {
     private Text hostText;
     private Text userText;
     private Text passText;
-    private Text sudoText;    
+    private Text sudoText;
+    private Text sshPrivateText;
+    private Text sshPublicText;
 
     private int x = 0;
     private int y = 0;
-    private int width = 300;
+    private int width = 400;
     private int height = 250;
 
     private final String BUNDLE_NAME = RemoteConnectionDialog.class.getPackage().getName()
@@ -102,9 +120,81 @@ public class RemoteConnectionDialog extends Dialog {
         composite.setLayout(new GridLayout(1, false));
 
         createConnectionComposite(composite);
+        createSshComposite(composite);
         return null;
     }
     
+    private void createSshComposite(Composite parent) {
+        Composite composite = new Composite(parent, SWT.NONE);
+        composite.setLayout(new GridLayout(3, false));
+        GridData gridData = new GridData(GridData.FILL_BOTH);
+        composite.setLayoutData(gridData);
+
+        gridData = new GridData(GridData.FILL_HORIZONTAL);
+        gridData.minimumHeight = 0;
+        
+        Label sshPrivate = new Label(composite, SWT.NONE);
+        sshPrivate.setText("SSH Private key:");
+        sshPrivateText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
+        sshPrivateText.setLayoutData(gridData);
+        sshPrivateText.setText(getDefaultSshPrivateKey());
+        
+        Button sshPrivateButton = new Button(composite, SWT.NONE);
+        sshPrivateButton.setText("Browse");
+        sshPrivateButton.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent evt) {
+                FileDialog fd = new FileDialog(shell, SWT.OPEN | SWT.SINGLE);
+                fd.setText("Select SSH private key");
+                fd.setFilterPath(System.getProperty("user.home"));
+                String file = fd.open();
+                if (file != null) {
+                    sshPrivateText.setText(file);
+                }
+            }
+        });
+        Label sshPublic = new Label(composite, SWT.NONE);
+        sshPublic.setText("SSH public key:");
+        sshPublicText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
+        sshPublicText.setLayoutData(gridData);
+        sshPublicText.setText(getDefaultSshPublicKey());
+
+        Button sshPublicButton = new Button(composite, SWT.NONE);
+        sshPublicButton.setText("Browse");
+        sshPublicButton.addSelectionListener(new SelectionAdapter() {
+            @Override
+            public void widgetSelected(SelectionEvent evt) {
+                FileDialog fd = new FileDialog(shell, SWT.OPEN | SWT.SINGLE);
+                fd.setText("Select SSH public key");
+                fd.setFilterPath(System.getProperty("user.home"));
+                String file = fd.open();
+                if (file != null) {
+                    sshPublicText.setText(file);
+                }
+            }
+        });
+    }
+    
+    private String getDefaultSshPrivateKey() {
+        String home = System.getProperty("user.home");
+        IPath path = new Path(home).append(".ssh").append("id_rsa");
+        if (path.toFile().exists()) {
+            return path.toOSString();
+        } else {
+            return "";
+        }
+    }
+    
+    
+    private String getDefaultSshPublicKey() {
+        String home = System.getProperty("user.home");
+        IPath path = new Path(home).append(".ssh").append("id_rsa.pub");
+        if (path.toFile().exists()) {
+            return path.toOSString();
+        } else {
+            return "";
+        }
+    }
     private void createConnectionComposite(Composite parent) {
         Composite composite = new Composite(parent, SWT.NONE);
         composite.setLayout(new GridLayout(2, false));
@@ -124,12 +214,8 @@ public class RemoteConnectionDialog extends Dialog {
         userText.setLayoutData(gridData);
         Label passwordLabel = new Label(composite, SWT.NONE);
         passwordLabel.setText("Password:");
-        passText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+        passText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD);
         passText.setLayoutData(gridData);
-        Label sudoLabel = new Label(composite, SWT.NONE);
-        sudoLabel.setText("Sudo password:");
-        sudoText = new Text(composite, SWT.SINGLE | SWT.BORDER);
-        sudoText.setLayoutData(gridData);
     }
 
     @Override
@@ -137,6 +223,16 @@ public class RemoteConnectionDialog extends Dialog {
         final String host = hostText.getText();
         final String user = userText.getText();
         final String pass = passText.getText();
+        final String privateKey = sshPrivateText.getText();
+        final String publicKey = sshPublicText.getText();
+        
+        boolean isNotOk = host.isEmpty() || user.isEmpty() || pass.isEmpty() 
+                || privateKey.isEmpty() || publicKey.isEmpty(); 
+        
+        if (isNotOk) {
+            DialogUtil.openErrorDialog("Please input all connection information.");
+            return;
+        }
         
         ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
         try {
@@ -146,8 +242,44 @@ public class RemoteConnectionDialog extends Dialog {
                     InterruptedException {
                      monitor.beginTask(resources.getString("RemoteConnDlg.Progress.Creating"), 1);
                      try {
-                         if (!RemoteConnectionManager.createConnection(host, user, pass, new SubProgressMonitor(monitor, 1))) {
+                         if (!RemoteConnectionManager.createConnection(host, user, pass, publicKey, privateKey, 
+                                 new SubProgressMonitor(monitor, 1))) {
                              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();
+                            }
+                             
                          }
                      } finally {
                          monitor.done();
index 8e0b109..0e8b281 100644 (file)
@@ -14,6 +14,7 @@ View.Contextmenu.Change.ConfFile = Change Configuration File
 View.Contextmenu.Manage = Manage Packages
 View.Contextmenu.Remove = Remove
 View.Contextmenu.Export = Export
+View.Contextmenu.Sync = Sync Includes
 
 View.Desc.Arch = * Architecture: %s(%s)
 View.Desc.Status = * Status : %s
index 8523b6f..4a1efef 100644 (file)
 
 package org.tizen.nativeplatform.views.ui;
 
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.lang.reflect.InvocationTargetException;
 import java.util.HashMap;
 import java.util.List;
@@ -45,7 +50,11 @@ import org.eclipse.core.resources.IWorkspace;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IContributionItem;
 import org.eclipse.jface.action.IMenuListener;
@@ -93,6 +102,7 @@ import org.slf4j.LoggerFactory;
 import org.tizen.common.TizenHelpContextIds;
 import org.tizen.common.connection.ConnectionPlugin;
 import org.tizen.common.util.DialogUtil;
+import org.tizen.common.util.FileUtil;
 import org.tizen.common.util.ImageUtil;
 import org.tizen.common.util.OSChecker;
 import org.tizen.common.util.SWTUtil;
@@ -107,6 +117,8 @@ import org.tizen.nativeplatform.pkg.commander.PkgCommandTarget;
 import org.tizen.nativeplatform.pkgmgr.PkgMgrInitializer;
 import org.tizen.nativeplatform.pkgmgr.ui.RPMPackageDialog;
 import org.tizen.nativeplatform.remote.connection.RemoteConnectionManager;
+import org.tizen.nativeplatform.remote.connection.RootstrapSyncronizer;
+import org.tizen.nativeplatform.remote.connection.RsyncProcessor;
 import org.tizen.nativeplatform.repo.commander.LocalRepoMounter;
 import org.tizen.nativeplatform.repo.commander.RepoManager;
 import org.tizen.nativeplatform.repo.model.Repository;
@@ -116,6 +128,7 @@ import org.tizen.nativeplatform.rootstrap.RootstrapManager;
 import org.tizen.nativeplatform.types.PkgTypes;
 import org.tizen.nativeplatform.util.GBSArchitectureChecker;
 import org.tizen.nativeplatform.util.PlatformProjectUtil;
+import org.tizen.nativeplatform.util.RootstrapUtil;
 import org.tizen.nativeplatform.views.model.PlatformRootstrap;
 import org.tizen.sdblib.IDevice;
 
@@ -132,6 +145,7 @@ public class RootstrapView extends ViewPart {
     private Action actionPkgMgr;
     private Action actionRemove;
     private Action actionExport;
+    private Action actionSync;
     private MenuManager menuMgr;
 
     private PlatformRootstrap generatedRootstrap;
@@ -377,7 +391,6 @@ public class RootstrapView extends ViewPart {
     }
 
     private void createRootstrapTableComposite(Composite parent) {
-
         Composite composite = new Composite(parent, SWT.NONE);
         composite.setLayoutData(new GridData(GridData.FILL_BOTH));
         GridLayout layout = new GridLayout(1, false);
@@ -435,7 +448,7 @@ public class RootstrapView extends ViewPart {
         String archLine = String.format(resources.getString("View.Desc.Arch"),
                 getArchitectureCategory(rootstrap.getArch()), rootstrap.getArch());
         String statusLine = String.format(resources.getString("View.Desc.Status"),
-                rootstrap.isInitialized() ? "OK" : "Not Intialized");
+                rootstrap.checkInitialized() ? "OK" : "Not Intialized");
         IPath confFile = rootstrap.getConfFile();
         String confFileLine = "";
         if (confFile != null) {
@@ -508,12 +521,18 @@ public class RootstrapView extends ViewPart {
         manager.add(new Separator());
         manager.add(actionSetDefault);
         manager.add(new Separator());
-        manager.add(actionExport);
+        if (!OSChecker.isWindows()) {
+            manager.add(actionExport);
+        }
         manager.add(actionRemove);
         manager.add(new Separator());
         manager.add(actionChangeConfFile);
         manager.add(new Separator());
         manager.add(actionPkgMgr);
+        if (OSChecker.isWindows()) {
+            manager.add(new Separator());
+            manager.add(actionSync);
+        }
     }
 
     private void activateContext() {
@@ -522,8 +541,13 @@ public class RootstrapView extends ViewPart {
         contextService.activateContext("org.tizen.common.rootstrap.setdefault.context");
         contextService.activateContext("org.tizen.common.rootstrap.lauchpkgmgr.context");
         contextService.activateContext("org.tizen.common.rootstrap.remove.context");
-        contextService.activateContext("org.tizen.common.rootstrap.export.context");
+        if (!OSChecker.isWindows()) {
+            contextService.activateContext("org.tizen.common.rootstrap.export.context");
+        }
         contextService.activateContext("org.tizen.common.rootstrap.change.conffile.context");
+        if (OSChecker.isWindows()) {
+            contextService.activateContext("org.tizen.nativeplatform.rootstrap.sync.includes");
+        }
     }
 
     private void makeActions() {
@@ -558,14 +582,24 @@ public class RootstrapView extends ViewPart {
             }
         };
         actionRemove.setText(resources.getString("View.Contextmenu.Remove"));
-
-        actionExport = new Action() {
-            @Override
-            public void run() {
-                exportRootstrap();
-            }
-        };
-        actionExport.setText(resources.getString("View.Contextmenu.Export"));
+        if (!OSChecker.isWindows()) {
+            actionExport = new Action() {
+                @Override
+                public void run() {
+                    exportRootstrap();
+                }
+            };
+            actionExport.setText(resources.getString("View.Contextmenu.Export"));
+        }
+        if (OSChecker.isWindows()) {
+            actionSync = new Action() {
+                @Override
+                public void run() {
+                    syncIncludes();
+                }
+            };
+            actionSync.setText(resources.getString("View.Contextmenu.Sync"));
+        }
     }
 
     private void updateToolbarEnable() {
@@ -584,7 +618,6 @@ public class RootstrapView extends ViewPart {
     }
 
     private void showConnectDialog() {
-
         RemoteConnectionDialog dlg = new RemoteConnectionDialog(shell);
         if (dlg.open() == Dialog.OK) {
             ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
@@ -593,7 +626,7 @@ public class RootstrapView extends ViewPart {
                     @Override
                     public void run(IProgressMonitor monitor) throws InvocationTargetException,
                             InterruptedException {
-                        monitor.beginTask("Synchronizing...", 2);
+                        monitor.beginTask("Synchronizing...", 3);
                         try {
                             monitor.subTask("Synchronizing rootstraps...");
                             RootstrapManager.reinitialize(new SubProgressMonitor(monitor, 1));
@@ -618,8 +651,46 @@ public class RootstrapView extends ViewPart {
                 return;
             }
         }
+        //RootstrapSyncronizer.Syncronize(RootstrapManager.getRootstraps());
     }
+    
+    private void syncIncludes() {
+        doActionForEntry(new IActionForEntry() {
+            @Override
+            public void doAction() {
+                Table table = tableViewer.getTable();
+                TableItem[] item = table.getSelection();
+                final PlatformRootstrap selected = (PlatformRootstrap) item[0].getData();
+                ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
+                try {
+                    dialog.run(true, true, new IRunnableWithProgress() {
+                        @Override
+                        public void run(IProgressMonitor monitor)
+                                throws InvocationTargetException, InterruptedException {
+                            monitor.beginTask("Syncronize includes...", -1);
+                            try {
+                                RootstrapSyncronizer.syncronize(selected, monitor);
+                            } finally {
+                                monitor.done();
+                            }
+                        }
+                    });
+                } catch (Exception e) {
+                    logger.error("Failed to syncronize includes", e);
+                    DialogUtil.openErrorDialog(String.format("%s\n * %s",
+                            "Failed to syncronize includes",
+                            e.toString()));
+                    return;
+                }
+            }
 
+            @Override
+            public boolean doCheckEnable() {
+                return true;
+            }
+        });
+    }
     private void disconnectRemotehost() {
         ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
         try {
@@ -696,6 +767,9 @@ public class RootstrapView extends ViewPart {
                     if (generatedRootstrap == null) {
                         throw new InterruptedException();
                     }
+                    if (OSChecker.isWindows()) {
+                        RootstrapSyncronizer.syncronize(generatedRootstrap, monitor);
+                    }
                 }
             });
         } catch (Exception e) {
@@ -706,7 +780,6 @@ public class RootstrapView extends ViewPart {
         } finally {
             RootstrapManager.removeLatestTempDirForRootstrap();
         }
-
         RootstrapManager.addRootstrap(generatedRootstrap);
     }
 
@@ -838,8 +911,7 @@ public class RootstrapView extends ViewPart {
                             .getString("Action.Msg.Question.NotInit"));
                     if (ret != SWT.YES) {
                         return;
-                    }
-
+                    }                    
                     // generate base file system here if "YES"
                     ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
                     try {
@@ -870,7 +942,7 @@ public class RootstrapView extends ViewPart {
                     }
                     selected.setInitialized(true);
                 }
-
+                RootstrapSyncronizer.cacheModificationTime(selected);
                 // launch package manager
                 IDevice device = ConnectionPlugin.getDefault().getCurrentDevice();
                 final PkgCommandTarget cmdTarget = new PkgCommandTarget(
@@ -917,17 +989,21 @@ public class RootstrapView extends ViewPart {
                                 InterruptedException {
 
                             monitor.beginTask(
-                                    resources.getString("Action.Msg.Progress.Finalizing.PkgMgr"), 2);
-                            monitor.subTask(resources
-                                    .getString("Action.Msg.Progress.Umount.rootstrap"));
-                            LocalRepoMounter.clearMounted(monitor);
-                            // TODO: error handling for umountLocalRepository
-                            monitor.worked(1);
-                            monitor.subTask(resources
-                                    .getString("Action.Msg.Progress.Refresh.rootstrap"));
-                            RootstrapManager.updateRootstrap(selected);
-                            monitor.worked(2);
-                            monitor.done();
+                                    resources.getString("Action.Msg.Progress.Finalizing.PkgMgr"), 3);
+                            try {
+                                monitor.subTask(resources
+                                        .getString("Action.Msg.Progress.Umount.rootstrap"));
+                                LocalRepoMounter.clearMounted(monitor);
+                                // TODO: error handling for umountLocalRepository
+                                monitor.worked(1);
+                                monitor.subTask(resources
+                                        .getString("Action.Msg.Progress.Refresh.rootstrap"));
+                                RootstrapManager.updateRootstrap(selected);
+                                monitor.worked(2);
+                                RootstrapSyncronizer.syncronizeIfChanges(selected, new SubProgressMonitor(monitor, 1));
+                            } finally {
+                                monitor.done();
+                            }
                         }
                     });
                 } catch (InvocationTargetException e) {
@@ -1229,4 +1305,54 @@ public class RootstrapView extends ViewPart {
             return "x86";
         }
     }
+    
+    private class ProcessOutputThread extends Thread {
+        private InputStream is;
+        private StringBuffer msg;
+        public ProcessOutputThread(InputStream is, StringBuffer msg) {
+            this.is = is;
+            this.msg = msg;
+        }
+        
+        public void run() {
+            try {
+                msg.append(getStreamString(is));
+            } finally {
+                if (is != null) {
+                    try {
+                        is.close();
+                    } catch (IOException e) {                        // 
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        
+        private String getStreamString(InputStream is) {
+            BufferedReader reader = null;
+            try {
+                reader = new BufferedReader(new InputStreamReader(is));
+                StringBuffer out = new StringBuffer();
+                String line;
+                while ((line = reader.readLine()) != null) {
+                    System.out.println(line);
+                    out.append(line);
+                }
+                return out.toString().trim();
+            } catch (IOException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            } finally {
+                if (reader != null) {
+                    try {
+                        reader.close();
+                    } catch (IOException e) {
+                        // TODO Auto-generated catch block
+                        e.printStackTrace();
+                    }
+                }
+            }
+            return "";
+        }
+    }
 }
index c6a2d5b..c4d10a2 100644 (file)
@@ -46,6 +46,8 @@ import org.eclipse.jgit.storage.file.FileRepository;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.tizen.common.util.DialogUtil;
+import org.tizen.common.util.log.UserInteraction;
+import org.tizen.common.util.log.UserLogger;
 import org.tizen.nativeappcommon.wizards.Messages;
 import org.tizen.nativeappcommon.wizards.TizenProjectWizard;
 import org.tizen.nativecommon.templateengine.build.AbstractProjectGenerator;
@@ -108,7 +110,9 @@ public class TizenPlatformProjectWizard extends TizenProjectWizard {
 
     @Override
     public boolean performFinish() {
-
+        long start = 0;
+        long end = 0;
+        start = System.currentTimeMillis();
         boolean result = false;
 
         IPath projectPath = ResourcesPlugin.getWorkspace().getRoot().getLocation()
@@ -170,7 +174,8 @@ public class TizenPlatformProjectWizard extends TizenProjectWizard {
             }
             commander.ApplySharedProject(newProject, getContainer());
         }
-
+        end = System.currentTimeMillis();
+        System.out.print("time :" + (end-start)/1000.0);
         return result;
     }
 
index f685c64..014300e 100755 (executable)
@@ -16,8 +16,14 @@ __set_parameter()
        build_script_path=${ROOTDIR}/pde-build
        ide_path=${ROOTDIR}/ide
        dropin_path=${ide_path}/dropins
+       plugin_path=${ide_path}/plugins
+       feature_path=${ide_path}/features
        cp -r ${SRCDIR}/package/add-ons/dropins/PTP ${dropin_path}/
+       cp -r ${SRCDIR}/package/add-ons/dropins/PTP/plugins/* ${plugin_path}/
+       cp -r ${SRCDIR}/package/add-ons/dropins/PTP/features/* ${feature_path}/
        cp -r ${SRCDIR}/package/add-ons/dropins/RSE ${dropin_path}/
+       cp -r ${SRCDIR}/package/add-ons/dropins/RSE/plugins/* ${plugin_path}/
+       cp -r ${SRCDIR}/package/add-ons/dropins/RSE/features/* ${feature_path}/
        echo ${dropin_path}
 }
 
index 8b5ca91..a585bf2 100644 (file)
@@ -13,12 +13,12 @@ Package:nativeplatform-eplugin
 OS:ubuntu-64
 Build-host-os:ubuntu-64
 Build-dependency:base-ide-product [ubuntu-64], base-ide-product-add-ons [ubuntu-64], pde-build [ubuntu-64], common-eplugin [ubuntu-64], nativecommon-eplugin [ubuntu-64], nativeappcommon-eplugin [ubuntu-64]
-Install-dependency:base-ide-product [ubuntu-64], base-ide-product-add-ons [ubuntu-64], common-eplugin [ubuntu-64], nativecommon-eplugin [ubuntu-64], nativeappcommon-eplugin [ubuntu-32]
+Install-dependency:base-ide-product [ubuntu-64], base-ide-product-add-ons [ubuntu-64], common-eplugin [ubuntu-64], nativecommon-eplugin [ubuntu-64], nativeappcommon-eplugin [ubuntu-64]
 Description:Nativeplatform plugin
 
 Package:nativeplatform-eplugin
 OS:windows-32
-Build-host-os:windows-32
+Build-host-os:ubuntu-32
 Build-dependency:base-ide-product [windows-32], base-ide-product-add-ons [windows-32], pde-build [windows-32], common-eplugin [windows-32], nativecommon-eplugin [windows-32], nativeappcommon-eplugin [windows-32]
 Install-dependency:base-ide-product [windows-32], base-ide-product-add-ons [windows-32], common-eplugin [windows-32], nativecommon-eplugin [windows-32], nativeappcommon-eplugin [windows-32]
 Description:Nativeplatform plugin
@@ -27,7 +27,7 @@ Package:nativeplatform-eplugin
 OS:windows-64
 Build-host-os:ubuntu-64
 Build-dependency:base-ide-product [windows-64], base-ide-product-add-ons [windows-64], pde-build [windows-64], common-eplugin [windows-64], nativecommon-eplugin [windows-64], nativeappcommon-eplugin [windows-64]
-Install-dependency:base-ide-product [windows-64], base-ide-product-add-ons [windows-64], common-eplugin [windows-64], nativecommon-eplugin [windows-64], nativeappcommon-eplugin [windows-32]
+Install-dependency:base-ide-product [windows-64], base-ide-product-add-ons [windows-64], common-eplugin [windows-64], nativecommon-eplugin [windows-64], nativeappcommon-eplugin [windows-64]
 Description:Nativeplatform plugin
 
 Package:nativeplatform-eplugin-test
@@ -42,6 +42,18 @@ Build-host-os:ubuntu-64
 Install-dependency:nativeplatform-eplugin [ubuntu-64]
 Description:Platform IDE test package
 
+Package:nativeplatform-eplugin-test
+OS:windows-32
+Build-host-os:ubuntu-32
+Install-dependency:nativeplatform-eplugin [windows-32]
+Description:Platform IDE test package
+
+Package:nativeplatform-eplugin-test
+OS:windows-64
+Build-host-os:ubuntu-64
+Install-dependency:nativeplatform-eplugin [windows-64]
+Description:Platform IDE test package
+
 Package:meta-nativeplatform-eplugin-test
 Label:Platform IDE Test Tools
 Attribute:test
@@ -57,3 +69,19 @@ OS:ubuntu-64
 Build-host-os:ubuntu-64
 Install-dependency:nativeplatform-eplugin-test
 Description:Platform IDE test meta package
+
+Package:meta-nativeplatform-eplugin-test
+Label:Platform IDE Test Tools
+Attribute:test
+OS:windows-32
+Build-host-os:ubuntu-32
+Install-dependency:nativeplatform-eplugin-test
+Description:Platform IDE test meta package
+
+Package:meta-nativeplatform-eplugin-test
+Label:Platform IDE Test Tools
+Attribute:test
+OS:windows-64
+Build-host-os:ubuntu-64
+Install-dependency:nativeplatform-eplugin-test
+Description:Platform IDE test meta package