Skip to content

Commit cb312ce

Browse files
author
jantje
committed
#1316 put it in the plugin.xml :-D
1 parent 175ef2c commit cb312ce

File tree

2 files changed

+56
-11
lines changed

2 files changed

+56
-11
lines changed

io.sloeber.core/plugin.xml

+48
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,54 @@
408408
</outputType>
409409
</tool>
410410
</toolChain>
411+
<folderInfo
412+
exclude="true"
413+
resourcePath="libraries/?*/**/?xamples/**">
414+
<toolChain
415+
id="io.sloeber.core.toolChain1"
416+
isAbstract="false">
417+
</toolChain>
418+
</folderInfo>
419+
<folderInfo
420+
exclude="true"
421+
resourcePath="libraries/?*/**/?xtras/**">
422+
<toolChain
423+
id="io.sloeber.core.toolChain2"
424+
isAbstract="false">
425+
</toolChain>
426+
</folderInfo>
427+
<folderInfo
428+
exclude="true"
429+
resourcePath="libraries/?*/**/test*/**">
430+
<toolChain
431+
id="io.sloeber.core.toolChain3"
432+
isAbstract="false">
433+
</toolChain>
434+
</folderInfo>
435+
<folderInfo
436+
exclude="true"
437+
resourcePath="libraries/?*/**/third-party/**">
438+
<toolChain
439+
id="io.sloeber.core.toolChain4"
440+
isAbstract="false">
441+
</toolChain>
442+
</folderInfo>
443+
<folderInfo
444+
exclude="true"
445+
resourcePath="libraries/**/._*">
446+
<toolChain
447+
id="io.sloeber.core.toolChain5"
448+
isAbstract="false">
449+
</toolChain>
450+
</folderInfo>
451+
<folderInfo
452+
exclude="true"
453+
resourcePath="libraries/?*/utility/*/*">
454+
<toolChain
455+
id="io.sloeber.core.toolChain6"
456+
isAbstract="false">
457+
</toolChain>
458+
</folderInfo>
411459
</configuration>
412460
</projectType>
413461

io.sloeber.core/src/io/sloeber/core/tools/Libraries.java

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.sloeber.core.tools;
22

33
import static io.sloeber.core.Messages.*;
4+
import static io.sloeber.core.common.Const.*;
45

56
import java.io.File;
67
import java.io.FilenameFilter;
@@ -23,7 +24,6 @@
2324
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
2425
import org.eclipse.cdt.core.settings.model.ICProjectDescription;
2526
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
26-
import org.eclipse.cdt.core.settings.model.ICResourceDescription;
2727
import org.eclipse.cdt.core.settings.model.ICSourceEntry;
2828
import org.eclipse.cdt.core.settings.model.util.CDataUtil;
2929
import org.eclipse.core.resources.IFolder;
@@ -43,7 +43,6 @@
4343
import io.sloeber.core.api.SloeberProject;
4444
import io.sloeber.core.common.Common;
4545
import io.sloeber.core.common.ConfigurationPreferences;
46-
import io.sloeber.core.common.Const;
4746
import io.sloeber.core.common.InstancePreferences;
4847
import io.sloeber.core.managers.Library;
4948

@@ -157,8 +156,8 @@ public static Map<String, IPath> findAllArduinoManagerLibraries() {
157156
if (versions != null) {
158157
switch (versions.length) {
159158
case 0:// A empty lib folder is hanging around
160-
Common.log(new Status(IStatus.WARNING, Const.CORE_PLUGIN_ID,
161-
EmptyLibFolder.replace(LIB, curLib)));
159+
Common.log(
160+
new Status(IStatus.WARNING, CORE_PLUGIN_ID, EmptyLibFolder.replace(LIB, curLib)));
162161
Lib_root.toFile().delete();
163162
break;
164163
case 1:// There should only be 1
@@ -170,7 +169,7 @@ public static Map<String, IPath> findAllArduinoManagerLibraries() {
170169
// latest
171170
int highestVersion = Version.getHighestVersion(versions);
172171
ret.put(curLib, Lib_root.append(versions[highestVersion]));
173-
Common.log(new Status(IStatus.WARNING, Const.CORE_PLUGIN_ID,
172+
Common.log(new Status(IStatus.WARNING, CORE_PLUGIN_ID,
174173
MultipleVersionsOfLib.replace(LIB, curLib)));
175174

176175
}
@@ -199,8 +198,7 @@ public static boolean removeLibrariesFromProject(IProject project, ICConfigurati
199198
final IFolder folderHandle = project.getFolder(WORKSPACE_LIB_FOLDER + CurItem);
200199
folderHandle.delete(true, null);
201200
} catch (CoreException e) {
202-
Common.log(
203-
new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, failed_to_remove_lib.replace(LIB, CurItem), e));
201+
Common.log(new Status(IStatus.ERROR, CORE_PLUGIN_ID, failed_to_remove_lib.replace(LIB, CurItem), e));
204202
}
205203
}
206204
return Helpers.removeInvalidIncludeFolders(confdesc);
@@ -421,7 +419,7 @@ public static void checkLibraries(IProject affectedProject) {
421419
installedLibs.keySet().retainAll(UnresolvedIncludedHeaders);
422420
if (!installedLibs.isEmpty()) {
423421
// there are possible libraries to add
424-
Common.log(new Status(IStatus.INFO, Const.CORE_PLUGIN_ID, "list of libraries to add to project " //$NON-NLS-1$
422+
Common.log(new Status(IStatus.INFO, CORE_PLUGIN_ID, "list of libraries to add to project " //$NON-NLS-1$
425423
+ affectedProject.getName() + ": " //$NON-NLS-1$
426424
+ installedLibs.keySet().toString()));
427425
Map<String, List<IPath>> foldersToChange = addLibrariesToProject(affectedProject,
@@ -450,8 +448,7 @@ public static boolean adjustProjectDescription(ICConfigurationDescription confde
450448
boolean descriptionMustBeSet = Helpers.addIncludeFolder(confdesc, foldersToAddToInclude, true);
451449
List<IPath> foldersToRemoveFromBuildPath = foldersToInclude.get(REMOVE);
452450
if ((foldersToRemoveFromBuildPath != null) && (!foldersToRemoveFromBuildPath.isEmpty())) {
453-
ICResourceDescription cfgd = confdesc.getResourceDescription(new Path(new String()), true);
454-
ICSourceEntry[] sourceEntries = cfgd.getConfiguration().getSourceEntries();
451+
ICSourceEntry[] sourceEntries = confdesc.getSourceEntries();
455452
for (IPath curFile : foldersToRemoveFromBuildPath) {
456453
try {
457454
if (!CDataUtil.isExcluded(curFile, sourceEntries)) {
@@ -464,7 +461,7 @@ public static boolean adjustProjectDescription(ICConfigurationDescription confde
464461
}
465462
}
466463
try {
467-
cfgd.getConfiguration().setSourceEntries(sourceEntries);
464+
confdesc.setSourceEntries(sourceEntries);
468465
} catch (Exception e) {
469466
// ignore
470467
}

0 commit comments

Comments
 (0)