Lines 44-49
Link Here
|
44 |
|
44 |
|
45 |
import java.io.IOException; |
45 |
import java.io.IOException; |
46 |
import java.util.ArrayList; |
46 |
import java.util.ArrayList; |
|
|
47 |
import java.util.Collection; |
47 |
import java.util.Collections; |
48 |
import java.util.Collections; |
48 |
import java.util.HashSet; |
49 |
import java.util.HashSet; |
49 |
import java.util.List; |
50 |
import java.util.List; |
Lines 60-70
Link Here
|
60 |
import org.netbeans.modules.cnd.remote.sync.SharabilityFilter; |
61 |
import org.netbeans.modules.cnd.remote.sync.SharabilityFilter; |
61 |
import org.netbeans.modules.cnd.utils.CndPathUtilities; |
62 |
import org.netbeans.modules.cnd.utils.CndPathUtilities; |
62 |
import org.netbeans.modules.cnd.utils.FSPath; |
63 |
import org.netbeans.modules.cnd.utils.FSPath; |
|
|
64 |
import org.netbeans.modules.dlight.libs.common.PathUtilities; |
63 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
65 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
64 |
import org.netbeans.modules.remote.spi.FileSystemProvider; |
66 |
import org.netbeans.modules.remote.spi.FileSystemProvider; |
65 |
import org.openide.filesystems.FileObject; |
67 |
import org.openide.filesystems.FileObject; |
|
|
68 |
import org.openide.filesystems.FileStateInvalidException; |
66 |
import org.openide.filesystems.FileSystem; |
69 |
import org.openide.filesystems.FileSystem; |
67 |
import org.openide.filesystems.FileUtil; |
70 |
import org.openide.filesystems.FileUtil; |
|
|
71 |
import org.openide.util.Exceptions; |
68 |
import org.openide.util.Lookup; |
72 |
import org.openide.util.Lookup; |
69 |
|
73 |
|
70 |
/** |
74 |
/** |
Lines 128-140
Link Here
|
128 |
return Collections.<FSPath>emptyList(); |
132 |
return Collections.<FSPath>emptyList(); |
129 |
} |
133 |
} |
130 |
|
134 |
|
|
|
135 |
private static void readBuildResults(FileObject baseFO, String path, Collection<String> results) { |
136 |
if (baseFO != null && baseFO.isValid()) { |
137 |
FileSystem fs; |
138 |
try { |
139 |
fs = baseFO.getFileSystem(); |
140 |
} catch (FileStateInvalidException ex) { |
141 |
Exceptions.printStackTrace(ex); |
142 |
return; |
143 |
} |
144 |
FileObject buildResultsFO = baseFO.getFileObject(path); |
145 |
if (buildResultsFO != null && buildResultsFO.isValid()) { |
146 |
try { |
147 |
List<String> lines = buildResultsFO.asLines(); |
148 |
for (String l : lines) { |
149 |
l = l.trim(); |
150 |
if (!FileSystemProvider.isAbsolute(fs, l)) { |
151 |
l = baseFO.getPath() + '/' + l; |
152 |
} |
153 |
if (!l.startsWith("#")) { //NOI18N |
154 |
results.add(l); |
155 |
} |
156 |
} |
157 |
} catch (IOException ex) { |
158 |
RemoteLogger.getInstance().log(Level.FINE, "Error reading build results from " + buildResultsFO.getPath() , ex); //NOI18N |
159 |
} |
160 |
} |
161 |
} |
162 |
} |
163 |
|
131 |
public static List<FSPath> getBuildResults(MakeConfiguration conf) { |
164 |
public static List<FSPath> getBuildResults(MakeConfiguration conf) { |
|
|
165 |
List<FSPath> result = new ArrayList<>(); |
132 |
String binaryPath = (conf == null) ? null : conf.getAbsoluteOutputValue(); |
166 |
String binaryPath = (conf == null) ? null : conf.getAbsoluteOutputValue(); |
133 |
if (binaryPath != null) { |
167 |
if (binaryPath != null) { |
134 |
return Collections.singletonList(new FSPath(conf.getFileSystem(), binaryPath)); |
168 |
result.add(new FSPath(conf.getFileSystem(), binaryPath)); |
135 |
} else { |
|
|
136 |
return Collections.<FSPath>emptyList(); |
137 |
} |
169 |
} |
|
|
170 |
FileObject baseFO = conf.getBaseFSPath().getFileObject(); |
171 |
Set<String> lines = new HashSet<>(); |
172 |
readBuildResults(baseFO, "nbproject/build-results", lines); // NOI18N |
173 |
readBuildResults(baseFO, "nbproject/private/build-results", lines); // NOI18N |
174 |
for (String line : lines) { |
175 |
result.add(new FSPath(conf.getFileSystem(), line)); |
176 |
} |
177 |
return result; |
138 |
} |
178 |
} |
139 |
|
179 |
|
140 |
public static List<FSPath> getProjectSourceDirs(Lookup.Provider project, AtomicReference<String> runDir) { |
180 |
public static List<FSPath> getProjectSourceDirs(Lookup.Provider project, AtomicReference<String> runDir) { |