# HG changeset patch # User Vladimir Kvashin # Date 1453050260 -10800 # Branch release81 # Node ID cc96f8e85355b6a5c6a8324ec30bc49b36266f36 # Parent 8a432db1bb6801ab29ce7ee67a9eaeed8ec8e9d1 fixing #257285 - Need an easy way to retrieve *multiple* build results from remote host diff -r 8a432db1bb68 -r cc96f8e85355 cnd.remote/src/org/netbeans/modules/cnd/remote/support/RemoteProjectSupport.java --- a/cnd.remote/src/org/netbeans/modules/cnd/remote/support/RemoteProjectSupport.java Sun Jan 17 17:32:21 2016 +0300 +++ b/cnd.remote/src/org/netbeans/modules/cnd/remote/support/RemoteProjectSupport.java Sun Jan 17 20:04:20 2016 +0300 @@ -52,7 +52,9 @@ import java.util.logging.Level; import org.netbeans.api.project.Project; import org.netbeans.modules.cnd.api.remote.RemoteProject; +import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider; import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationSupport; +import org.netbeans.modules.cnd.makeproject.api.configurations.Folder; import org.netbeans.modules.cnd.makeproject.api.configurations.Item; import org.netbeans.modules.cnd.makeproject.api.configurations.LibraryItem.ProjectItem; import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration; @@ -129,14 +131,44 @@ } public static List getBuildResults(MakeConfiguration conf) { - String binaryPath = (conf == null) ? null : conf.getAbsoluteOutputValue(); - if (binaryPath != null) { - return Collections.singletonList(new FSPath(conf.getFileSystem(), binaryPath)); - } else { - return Collections.emptyList(); + if (conf != null) { + String binaryPath = conf.getAbsoluteOutputValue(); + if (binaryPath != null) { + return Collections.singletonList(new FSPath(conf.getFileSystem(), binaryPath)); + } + } + return Collections.emptyList(); + } + + public static List getBuildResultsAndInterestingFiles(Project project, MakeConfiguration conf) { + List result = new ArrayList<>(); + if (conf != null) { + String binaryPath = conf.getAbsoluteOutputValue(); + if (binaryPath != null) { + result.add(new FSPath(conf.getFileSystem(), binaryPath)); + } + } + if (project != null) { + ConfigurationDescriptorProvider cdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class); + if (cdp != null) { + MakeConfigurationDescriptor cd = cdp.getConfigurationDescriptor(); + if (cd != null) { + collectPlainFiles(cd.getExternalFileItems(), result); + } + } + } + return result; + } + + private static void collectPlainFiles(Folder folder, List result) { + for (Item item : folder.getItemsAsArray()) { + result.add(item.getFSPath()); + } + for (Folder child : folder.getFolders()) { + collectPlainFiles(child, result); } } - + public static List getProjectSourceDirs(Lookup.Provider project, AtomicReference runDir) { MakeConfiguration conf = ConfigurationSupport.getProjectActiveConfiguration(project); RemoteProject rp = project.getLookup().lookup(RemoteProject.class); diff -r 8a432db1bb68 -r cc96f8e85355 cnd.remote/src/org/netbeans/modules/cnd/remote/sync/RemoteBuildProjectActionHandler.java --- a/cnd.remote/src/org/netbeans/modules/cnd/remote/sync/RemoteBuildProjectActionHandler.java Sun Jan 17 17:32:21 2016 +0300 +++ b/cnd.remote/src/org/netbeans/modules/cnd/remote/sync/RemoteBuildProjectActionHandler.java Sun Jan 17 20:04:20 2016 +0300 @@ -168,7 +168,7 @@ RemoteSyncFactory syncFactory = conf.getRemoteSyncFactory(); final RemoteSyncWorker worker = (syncFactory == null) ? null : syncFactory.createNew(execEnv, out, err, privProjectStorage, runDir.get(), sourceDirs, - RemoteProjectSupport.getBuildResults(conf)); + RemoteProjectSupport.getBuildResultsAndInterestingFiles(pae.getProject(), conf)); CndUtils.assertTrue(worker != null, "RemoteSyncWorker shouldn't be null"); //NOI18N if (worker == null) { delegate.execute(io);