This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 257285
Collapse All | Expand All

(-)a/cnd.remote/src/org/netbeans/modules/cnd/remote/support/RemoteProjectSupport.java (-6 / +50 lines)
Lines 52-58 Link Here
52
import java.util.logging.Level;
52
import java.util.logging.Level;
53
import org.netbeans.api.project.Project;
53
import org.netbeans.api.project.Project;
54
import org.netbeans.modules.cnd.api.remote.RemoteProject;
54
import org.netbeans.modules.cnd.api.remote.RemoteProject;
55
import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationDescriptorProvider;
55
import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationSupport;
56
import org.netbeans.modules.cnd.makeproject.api.configurations.ConfigurationSupport;
57
import org.netbeans.modules.cnd.makeproject.api.configurations.Folder;
56
import org.netbeans.modules.cnd.makeproject.api.configurations.Item;
58
import org.netbeans.modules.cnd.makeproject.api.configurations.Item;
57
import org.netbeans.modules.cnd.makeproject.api.configurations.LibraryItem.ProjectItem;
59
import org.netbeans.modules.cnd.makeproject.api.configurations.LibraryItem.ProjectItem;
58
import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
60
import org.netbeans.modules.cnd.makeproject.api.configurations.MakeConfiguration;
Lines 129-142 Link Here
129
    }
131
    }
130
132
131
    public static List<FSPath> getBuildResults(MakeConfiguration conf) {
133
    public static List<FSPath> getBuildResults(MakeConfiguration conf) {
132
        String binaryPath = (conf == null) ? null : conf.getAbsoluteOutputValue();
134
        if (conf != null) {
133
        if (binaryPath != null) {
135
            String binaryPath = conf.getAbsoluteOutputValue();
134
            return Collections.singletonList(new FSPath(conf.getFileSystem(), binaryPath));
136
            if (binaryPath != null) {
135
        } else {
137
                return Collections.singletonList(new FSPath(conf.getFileSystem(), binaryPath));
136
            return Collections.<FSPath>emptyList();
138
            }
139
        }
140
        return Collections.<FSPath>emptyList();
141
    }
142
143
    public static List<FSPath> getBuildResultsAndInterestingFiles(Project project, MakeConfiguration conf) {
144
        List<FSPath> result = new ArrayList<>();
145
        if (conf != null) {
146
            String binaryPath = conf.getAbsoluteOutputValue();
147
            if (binaryPath != null) {
148
                result.add(new FSPath(conf.getFileSystem(), binaryPath));
149
            }
150
        }
151
        if (project != null) {
152
            ConfigurationDescriptorProvider cdp = project.getLookup().lookup(ConfigurationDescriptorProvider.class);
153
            if (cdp != null) {
154
                MakeConfigurationDescriptor cd = cdp.getConfigurationDescriptor();
155
                if (cd != null) {
156
                    collectPlainFiles(cd.getExternalFileItems(), result);
157
                }
158
            }
159
        }
160
        return result;
161
    }
162
163
    private static void collectPlainFiles(Folder folder, List<FSPath> result) {
164
        for (Item item : folder.getItemsAsArray()) {
165
            collectPlainFiles(item.getFileObject(), result);
166
        }
167
        for (Folder child : folder.getFolders()) {
168
            collectPlainFiles(child, result);
137
        }
169
        }
138
    }
170
    }
139
    
171
172
    private static void collectPlainFiles(FileObject fo, List<FSPath> result) {
173
        if (fo != null && fo.isValid()) {
174
            if (fo.isData()) {
175
                result.add(FSPath.toFSPath(fo));
176
            } else if (fo.isFolder()) {
177
                for (FileObject child : fo.getChildren()) {
178
                    collectPlainFiles(child, result);
179
                }
180
            }
181
        }
182
    }
183
140
    public static List<FSPath> getProjectSourceDirs(Lookup.Provider project, AtomicReference<String> runDir) {
184
    public static List<FSPath> getProjectSourceDirs(Lookup.Provider project, AtomicReference<String> runDir) {
141
        MakeConfiguration conf = ConfigurationSupport.getProjectActiveConfiguration(project);
185
        MakeConfiguration conf = ConfigurationSupport.getProjectActiveConfiguration(project);
142
        RemoteProject rp = project.getLookup().lookup(RemoteProject.class);
186
        RemoteProject rp = project.getLookup().lookup(RemoteProject.class);
(-)a/cnd.remote/src/org/netbeans/modules/cnd/remote/sync/RemoteBuildProjectActionHandler.java (-1 / +1 lines)
Lines 164-170 Link Here
164
        RemoteSyncFactory syncFactory = conf.getRemoteSyncFactory();
164
        RemoteSyncFactory syncFactory = conf.getRemoteSyncFactory();
165
        final RemoteSyncWorker worker = (syncFactory == null) ? null :
165
        final RemoteSyncWorker worker = (syncFactory == null) ? null :
166
                syncFactory.createNew(execEnv, out, err, privProjectStorage, runDir.get(), sourceDirs,
166
                syncFactory.createNew(execEnv, out, err, privProjectStorage, runDir.get(), sourceDirs,
167
                        RemoteProjectSupport.getBuildResults(conf));
167
                        RemoteProjectSupport.getBuildResultsAndInterestingFiles(pae.getProject(), conf));
168
        CndUtils.assertTrue(worker != null, "RemoteSyncWorker shouldn't be null"); //NOI18N
168
        CndUtils.assertTrue(worker != null, "RemoteSyncWorker shouldn't be null"); //NOI18N
169
        if (worker == null) {
169
        if (worker == null) {
170
            delegate.execute(io);
170
            delegate.execute(io);

Return to bug 257285