Skip to content

Commit 21f59cc

Browse files
committed
2 parents ddbe36f + 96d5114 commit 21f59cc

File tree

12 files changed

+398
-352
lines changed

12 files changed

+398
-352
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP=true
2-
org.eclipse.ui.workbench/RUN_IN_BACKGROUND=false
2+
org.eclipse.ui.workbench/RUN_IN_BACKGROUND=false
3+
org.eclipse.cdt.core/indexer/indexAllFiles=false
4+
org.eclipse.cdt.core/indexer/indexAllHeaderVersions=false

io.sloeber.core/src/io/sloeber/core/listeners/ConfigurationChangeListener.java

+2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ public void run() {
108108

109109
if (oldBoardDescriptor.equals(newBoardDescriptor)) {
110110
if (event.getProject().getName().equals(oldBoardDescriptor.getProjectName())) {
111+
if(oldprojDesc.getActiveConfiguration().getName().equals(projDesc.getActiveConfiguration().getName())) {
111112
// only act when there is change
112113
return;
114+
}
113115
}
114116
}
115117
Helpers.setTheEnvironmentVariables(activeProject, activeConf, newBoardDescriptor);

io.sloeber.core/src/io/sloeber/core/toolchain/ArduinoLanguageProvider.java

-15
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
import org.eclipse.cdt.core.settings.model.ICSettingEntry;
1414
import org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin;
1515
import org.eclipse.cdt.managedbuilder.language.settings.providers.ToolchainBuiltinSpecsDetector;
16-
import org.eclipse.core.resources.IFolder;
1716
import org.eclipse.core.runtime.CoreException;
18-
import org.eclipse.core.runtime.IStatus;
19-
import org.eclipse.core.runtime.Status;
2017

2118
import io.sloeber.core.api.CompileOptions;
2219
import io.sloeber.core.common.Common;
@@ -145,18 +142,6 @@ protected String getCompilerCommand(String languageId) {
145142
IEnvironmentVariableManager envManager = CCorePlugin.getDefault().getBuildEnvironmentManager();
146143
ICConfigurationDescription confDesc = prjDesc.getActiveConfiguration();
147144

148-
// Bug fix for CDT 8.1 fixed in 8.2
149-
IFolder buildFolder = this.currentProject.getFolder(confDesc.getName());
150-
if (!buildFolder.exists()) {
151-
try {
152-
buildFolder.create(true, true, null);
153-
} catch (CoreException e) {
154-
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID,
155-
"failed to create folder " + confDesc.getName(), e));
156-
}
157-
}
158-
// End of Bug fix for CDT 8.1 fixed in 8.2
159-
160145
String recipeKey = new String();
161146
String extraOptions = new String();
162147
CompileOptions compileOptions = new CompileOptions(confDesc);

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

+9-6
Original file line numberDiff line numberDiff line change
@@ -236,18 +236,20 @@ public static void addCodeFolder(IProject project, IPath toLinkFolder, String Li
236236

237237
// Now the folder has been created we need to make sure the special
238238
// folders are added to the path
239-
addIncludeFolder(configurationDescription, link.getFullPath());
240239

241240
String possibleIncludeFolder = "utility";
242241
File file = toLinkFolder.append(possibleIncludeFolder).toFile();
243242
if (file.exists()) {
244243
addIncludeFolder(configurationDescription, link.getFullPath().append(possibleIncludeFolder));
245244
}
246245

246+
// add src or root give priority to src
247247
possibleIncludeFolder = Library.LIBRARY_SOURCE_FODER;
248248
file = toLinkFolder.append(possibleIncludeFolder).toFile();
249249
if (file.exists()) {
250250
addIncludeFolder(configurationDescription, link.getFullPath().append(possibleIncludeFolder));
251+
} else {
252+
addIncludeFolder(configurationDescription, link.getFullPath());
251253
}
252254

253255
possibleIncludeFolder = "arch";
@@ -328,9 +330,9 @@ public static void addTheNatures(IProjectDescription description) throws CoreExc
328330
* A monitor to show progress
329331
* @throws CoreException
330332
*/
331-
public static void addFileToProject(IContainer container, Path path, InputStream contentStream,
333+
public static IFile addFileToProject(IContainer container, Path path, InputStream contentStream,
332334
IProgressMonitor monitor, boolean overwrite) throws CoreException {
333-
final IFile file = container.getFile(path);
335+
IFile file = container.getFile(path);
334336
file.refreshLocal(IResource.DEPTH_INFINITE, monitor);
335337
if (overwrite && file.exists()) {
336338
file.delete(true, null);
@@ -340,6 +342,7 @@ public static void addFileToProject(IContainer container, Path path, InputStream
340342
if (!file.exists() && (contentStream != null)) {
341343
file.create(contentStream, true, monitor);
342344
}
345+
return file;
343346
}
344347

345348
public static MessageConsole findConsole(String name) {
@@ -657,7 +660,7 @@ private static void setTheEnvironmentVariablesAddThePlatformInfo(BoardDescriptor
657660
File referencedPlatformFile = boardDescriptor.getreferencedPlatformFile();
658661
String architecture = boardDescriptor.getArchitecture();
659662
for (ArduinoPlatform curPlatform : Manager.getInstalledPlatforms()) {
660-
addPlatformFileTools(curPlatform, contribEnv, confDesc, false);
663+
addPlatformFileTools(curPlatform, contribEnv, confDesc, false);
661664
}
662665
ArduinoPlatform LatestArduinoPlatform = null;
663666
for (ArduinoPlatform curPlatform : Manager.getLatestInstalledPlatforms()) {
@@ -729,6 +732,8 @@ public static void setTheEnvironmentVariables(IProject project, ICConfigurationD
729732

730733
// Now we have all info we can start processing
731734

735+
//set the output folder as derive
736+
732737
// first remove all Arduino Variables so there is no memory effect
733738
removeAllEraseEnvironmentVariables(contribEnv, confDesc);
734739

@@ -1082,8 +1087,6 @@ private static String makeEnvironmentVar(String variableName) {
10821087
return "${" + variableName + '}';
10831088
}
10841089

1085-
1086-
10871090
/**
10881091
* creates links to the root files and folders of the source location
10891092
*

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,11 @@ private static void writeTheGeneratedFile(IProject iProject, String content) thr
141141
}
142142

143143
if (!newFileContent.equals(currentFileContent)) {
144-
Helpers.addFileToProject(iProject, new Path(generatedFile),
144+
IFile file = Helpers.addFileToProject(iProject, new Path(generatedFile),
145145
new ByteArrayInputStream(newFileContent.getBytes()), null, true);
146-
// } else {
147-
// System.out.println(".ino.cpp has not changed");
146+
if (file != null) {
147+
file.setDerived(true, null);
148+
}
148149
}
149150

150151
}

io.sloeber.feature/feature.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ If you do not agree with this policy, please do not install this software.
3838

3939
<requires>
4040
<import feature="org.eclipse.cdt" version="8.0.0" match="greaterOrEqual"/>
41-
<import feature="ilg.gnuarmeclipse.debug.gdbjtag.openocd" version="4.1.4.201704251808"/>
41+
<import plugin="ilg.gnumcueclipse.debug.gdbjtag.openocd"/>
4242
</requires>
4343

4444
<plugin

io.sloeber.parent/pom.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
<version>${tycho.version}</version>
172172
<configuration>
173173
<!-- configure the p2 target environments for multi-platform build -->
174-
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
174+
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
175175
spec -->
176176
<environments>
177177
<environment>
@@ -216,7 +216,7 @@
216216
<version>${tycho.version}</version>
217217
<configuration>
218218
<!-- configure the p2 target environments for multi-platform build -->
219-
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
219+
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
220220
spec -->
221221
<environments>
222222
<environment>
@@ -240,7 +240,7 @@
240240
<version>${tycho.version}</version>
241241
<configuration>
242242
<!-- configure the p2 target environments for multi-platform build -->
243-
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
243+
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
244244
spec -->
245245
<environments>
246246
<environment>
@@ -266,7 +266,7 @@
266266
<version>${tycho.version}</version>
267267
<configuration>
268268
<!-- configure the p2 target environments for multi-platform build -->
269-
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
269+
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
270270
spec -->
271271
<environments>
272272
<environment>
@@ -291,7 +291,7 @@
291291
<version>${tycho.version}</version>
292292
<configuration>
293293
<!-- configure the p2 target environments for multi-platform build -->
294-
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
294+
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
295295
spec -->
296296
<environments>
297297
<environment>
@@ -316,7 +316,7 @@
316316
<version>${tycho.version}</version>
317317
<configuration>
318318
<!-- configure the p2 target environments for multi-platform build -->
319-
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
319+
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
320320
spec -->
321321
<environments>
322322
<!-- Mac -->
@@ -342,7 +342,7 @@
342342
<version>${tycho.version}</version>
343343
<configuration>
344344
<!-- configure the p2 target environments for multi-platform build -->
345-
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
345+
<!-- The strings ("linux", "gtk", "x86"...) are defined by the OSGi
346346
spec -->
347347
<environments>
348348
<!-- Mac -->
@@ -494,14 +494,14 @@
494494
<repository>
495495
<id>cdt</id>
496496
<layout>p2</layout>
497-
<url>http://download.eclipse.org/tools/cdt/releases/9.3</url>
497+
<url>http://download.eclipse.org/tools/cdt/releases/9.4</url>
498498
</repository>
499499

500500

501501
<repository>
502-
<id>gnuarm</id>
502+
<id>gnumcu</id>
503503
<layout>p2</layout>
504-
<url>http://gnuarmeclipse.sourceforge.net/updates</url>
504+
<url>http://gnu-mcu-eclipse.netlify.com/v4-neon-updates/</url>
505505
</repository>
506506
</repositories>
507507

0 commit comments

Comments
 (0)