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 |
result.add(item.getFSPath()); |
166 |
} |
167 |
for (Folder child : folder.getFolders()) { |
168 |
collectPlainFiles(child, result); |
137 |
} |
169 |
} |
138 |
} |
170 |
} |
139 |
|
171 |
|
140 |
public static List<FSPath> getProjectSourceDirs(Lookup.Provider project, AtomicReference<String> runDir) { |
172 |
public static List<FSPath> getProjectSourceDirs(Lookup.Provider project, AtomicReference<String> runDir) { |
141 |
MakeConfiguration conf = ConfigurationSupport.getProjectActiveConfiguration(project); |
173 |
MakeConfiguration conf = ConfigurationSupport.getProjectActiveConfiguration(project); |
142 |
RemoteProject rp = project.getLookup().lookup(RemoteProject.class); |
174 |
RemoteProject rp = project.getLookup().lookup(RemoteProject.class); |