Skip to content

Commit 4e70079

Browse files
authored
Merge pull request #1594 from Sloeber/Fix_the_build_#1593
Fix the build #1593 next step: update the version numbers and make a release
2 parents 41e6cc1 + 17f5561 commit 4e70079

File tree

52 files changed

+540
-508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+540
-508
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
/log.txt
55
workspace/*
66
/.metadata/
7-
.settings
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
line.separator=\n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=windows-1252
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
line.separator=\n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
line.separator=\n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

io.sloeber.core.nl1/META-INF/MANIFEST.MF

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: Sloeber core language pack
44
Bundle-SymbolicName: io.sloeber.core.nl1;singleton:=true
5-
Bundle-RequiredExecutionEnvironment: JavaSE-11
5+
Bundle-RequiredExecutionEnvironment: JavaSE-17
66
Bundle-Version: 4.4.1.qualifier
77
Fragment-Host: io.sloeber.core
88
Bundle-Vendor: Sloeber.io

io.sloeber.core/.classpath

+17-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" path="src"/>
4-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
54
<attributes>
6-
<attribute name="module" value="true"/>
5+
<attribute name="maven.pomderived" value="true"/>
76
</attributes>
87
</classpathentry>
9-
<classpathentry exported="true" kind="lib" path="lib/jssc-2.9.4.jar"/>
108
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
11-
<classpathentry kind="lib" path="lib/jsch-0.1.55.jar"/>
12-
<classpathentry kind="lib" path="lib/jmdns-3.5.7.jar"/>
9+
<classpathentry kind="src" output="bin" path="src">
10+
<attributes>
11+
<attribute name="optional" value="true"/>
12+
<attribute name="maven.pomderived" value="true"/>
13+
</attributes>
14+
</classpathentry>
15+
<classpathentry exported="true" kind="lib" path="lib/jsch-0.1.55.jar"/>
16+
<classpathentry exported="true" kind="lib" path="lib/jssc-2.9.4.jar"/>
17+
<classpathentry exported="true" kind="lib" path="lib/jmdns-3.5.7.jar"/>
18+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
19+
<attributes>
20+
<attribute name="maven.pomderived" value="true"/>
21+
</attributes>
22+
</classpathentry>
1323
<classpathentry kind="output" path="bin"/>
1424
</classpath>
25+

io.sloeber.core/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/bin/
2-
/target/
2+
/target/
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
eclipse.preferences.version=1
22
encoding/<project>=UTF-8
3+

io.sloeber.core/.settings/org.eclipse.jdt.core.prefs

+10
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,13 @@ org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
99
org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
1010
org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
1111
org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
12+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
13+
org.eclipse.jdt.core.compiler.compliance=17
14+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
15+
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
16+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
17+
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
18+
org.eclipse.jdt.core.compiler.release=enabled
19+
org.eclipse.jdt.core.compiler.source=17
20+
21+

io.sloeber.core/.settings/org.eclipse.jdt.ui.prefs

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ org.eclipse.jdt.ui.gettersetter.use.is=true
55
org.eclipse.jdt.ui.keywordthis=false
66
org.eclipse.jdt.ui.overrideannotation=true
77
org.eclipse.jdt.ui.text.custom_code_templates=
8+

io.sloeber.core/META-INF/MANIFEST.MF

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
33
Bundle-Name: Arduino eclipse plugin
44
Bundle-SymbolicName: io.sloeber.core;singleton:=true
55
Bundle-Version: 4.4.1.qualifier
6-
Bundle-RequiredExecutionEnvironment: JavaSE-11
6+
Bundle-RequiredExecutionEnvironment: JavaSE-17
77
Bundle-Vendor: Sloeber.io
88
Bundle-ActivationPolicy: lazy
99
Bundle-Activator: io.sloeber.core.Activator
@@ -13,17 +13,16 @@ Bundle-ClassPath: .,
1313
lib/jmdns-3.5.7.jar
1414
Require-Bundle: org.eclipse.cdt.managedbuilder.core,
1515
org.eclipse.core.filesystem,
16-
org.eclipse.cdt.core;bundle-version="7.0.0",
17-
org.apache.commons.compress,
18-
org.apache.commons.lang,
16+
org.eclipse.cdt.core,
1917
com.google.gson,
2018
org.eclipse.equinox.security,
2119
org.eclipse.core.runtime,
22-
org.apache.commons.io;bundle-version="2.0.0",
23-
org.eclipse.ui;bundle-version="3.117.0",
20+
org.eclipse.ui,
2421
org.eclipse.ui.console,
2522
org.eclipse.debug.core,
26-
org.eclipse.core.variables
23+
org.eclipse.core.variables,
24+
org.apache.commons.commons-io,
25+
org.apache.commons.compress
2726
Export-Package: cc.arduino.packages;x-internal:=true,
2827
cc.arduino.packages.discoverers;x-internal:=true,
2928
cc.arduino.packages.ssh;x-internal:=true,

io.sloeber.core/src/io/sloeber/core/Activator.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.sloeber.core;
22

3+
import static io.sloeber.core.common.Common.*;
34
import static io.sloeber.core.common.Const.*;
45
import static org.eclipse.core.resources.IResource.*;
56

@@ -10,8 +11,6 @@
1011
import java.net.MalformedURLException;
1112
import java.net.URL;
1213

13-
import org.apache.commons.io.FileUtils;
14-
import org.apache.commons.lang.SystemUtils;
1514
import org.eclipse.cdt.core.CCorePlugin;
1615
import org.eclipse.cdt.core.model.CoreModel;
1716
import org.eclipse.cdt.core.settings.model.CProjectDescriptionEvent;
@@ -402,13 +401,13 @@ private static void installOtherStuff() {
402401
String AWK_URL = "https://github.com/Sloeber/arduino-eclipse-plugin/files/7102568/awk_GNU_64_bit_V4_2_1.zip";
403402

404403
// On Windows install make and awk
405-
if (SystemUtils.IS_OS_WINDOWS) {
404+
if (isWindows) {
406405
// Install make if needed
407406
IPath localMakePath = ConfigurationPreferences.getMakePath();
408407
if (localMakePath.append(MAKE_EXE).toFile().exists()) {
409408
if (!localMakePath.append(SH_EXE).toFile().exists()) {
410409
try {
411-
FileUtils.deleteDirectory(new File(localMakePath.toString()));
410+
deleteDirectory(localMakePath);
412411
} catch (IOException e) {
413412
// should not happen
414413
e.printStackTrace();

io.sloeber.core/src/io/sloeber/core/api/CodeDescription.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
import java.util.ArrayList;
1010
import java.util.Map;
1111
import java.util.TreeMap;
12+
import java.util.stream.Collectors;
1213

1314
import org.apache.commons.io.FileUtils;
14-
import org.apache.commons.lang.StringUtils;
1515
import org.eclipse.core.resources.IProject;
1616
import org.eclipse.core.runtime.CoreException;
1717
import org.eclipse.core.runtime.IPath;
@@ -205,6 +205,7 @@ Map<String, IPath> createFiles(IProject project, IProgressMonitor monitor) throw
205205
if (myMakeLinks) {
206206
Helpers.linkDirectory(project, curPath, new Path("/")); //$NON-NLS-1$
207207
} else {
208+
// Files.copy(curPath.toPath(), project.getLocation().toPath());
208209
FileUtils.copyDirectory(curPath.toFile(), project.getLocation().toFile());
209210
FileModifiers.addPragmaOnce(curPath);
210211
}
@@ -237,7 +238,7 @@ public ArrayList<IPath> getExamples() {
237238

238239
private void saveLastUsedExamples() {
239240
if (myExamples != null) {
240-
String toStore = StringUtils.join(myExamples, "\n"); //$NON-NLS-1$
241+
String toStore = myExamples.stream().map(Object::toString).collect(Collectors.joining("\n")); //$NON-NLS-1$
241242
InstancePreferences.setGlobalValue(KEY_LAST_USED_EXAMPLES, toStore);
242243
} else {
243244
InstancePreferences.setGlobalValue(KEY_LAST_USED_EXAMPLES, new String());

io.sloeber.core/src/io/sloeber/core/api/Defaults.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package io.sloeber.core.api;
22

3+
import static io.sloeber.core.common.Common.*;
34
import static io.sloeber.core.common.Const.*;
45

5-
import org.apache.commons.lang.SystemUtils;
66
import org.eclipse.core.runtime.IPath;
77
import org.eclipse.core.runtime.Path;
88

@@ -32,15 +32,15 @@ public class Defaults {
3232
*/
3333
public static String getPrivateLibraryPath() {
3434
IPath homPath = new Path(System.getProperty("user.home"));
35-
if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) {
35+
if (isMac || isWindows) {
3636
homPath = homPath.append("Documents");
3737
}
3838
return homPath.append("Arduino").append(LIBRARY_PATH_SUFFIX).toString();
3939
}
4040

4141
public static String getPrivateHardwarePath() {
4242
IPath homPath = new Path(System.getProperty("user.home"));
43-
if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) {
43+
if (isMac || isWindows) {
4444
homPath = homPath.append("Documents");
4545
}
4646
return homPath.append("Arduino").append(ARDUINO_HARDWARE_FOLDER_NAME).toString();

io.sloeber.core/src/io/sloeber/core/api/LaunchConfiguration.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.sloeber.core.api;
22

3-
import org.apache.commons.lang.StringUtils;
43
import org.eclipse.core.resources.IProject;
54
import org.eclipse.core.resources.ResourcesPlugin;
65
import org.eclipse.core.runtime.CoreException;
@@ -82,7 +81,7 @@ private void loadSettingsFromConfiguration() {
8281
* @return the project handle if a project was found
8382
*/
8483
public static IProject findProject(String name) {
85-
if (StringUtils.isNotBlank(name) && new Path(name).isValidPath(name)) {
84+
if ((!name.isBlank()) && new Path(name).isValidPath(name)) {
8685
IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
8786
if (p.getLocation() != null)
8887
return p;

io.sloeber.core/src/io/sloeber/core/common/Common.java

+23-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
import static io.sloeber.core.common.Const.*;
44

55
import java.io.File;
6+
import java.io.IOException;
67
import java.net.URI;
78
import java.net.URISyntaxException;
89
import java.net.URL;
10+
import java.nio.file.Files;
11+
import java.nio.file.Path;
912
import java.nio.file.Paths;
13+
import java.util.Comparator;
1014

1115
import org.eclipse.cdt.core.CCorePlugin;
1216
import org.eclipse.cdt.core.envvar.IEnvironmentVariableManager;
@@ -18,7 +22,6 @@
1822
import org.eclipse.core.resources.ResourcesPlugin;
1923
import org.eclipse.core.runtime.IPath;
2024
import org.eclipse.core.runtime.IStatus;
21-
import org.eclipse.core.runtime.Path;
2225
import org.eclipse.core.runtime.Platform;
2326
import org.eclipse.core.runtime.Status;
2427
import org.eclipse.ui.statushandlers.StatusManager;
@@ -28,7 +31,7 @@
2831
public class Common {
2932

3033
public final static String sloeberHome = getSloeberHome();
31-
public final static IPath sloeberHomePath = new Path(sloeberHome);
34+
public final static IPath sloeberHomePath = new org.eclipse.core.runtime.Path(sloeberHome);
3235
public final static String sloeberHomePathToString = sloeberHomePath.toString();
3336

3437
private static String getSloeberHome() {
@@ -239,7 +242,7 @@ public static String makePathEnvironmentString(IPath path) {
239242
}
240243

241244
public static String makePathVersionString(File file) {
242-
return new Path(file.getPath()).toString().replace(sloeberHomePathToString, SLOEBER_HOME_VAR);
245+
return file.getPath().replace(sloeberHomePathToString, SLOEBER_HOME_VAR);
243246
}
244247

245248
/**
@@ -278,4 +281,21 @@ static public String getOldWayEnvVar(ICConfigurationDescription confDesc, String
278281
getBuildEnvironmentVariable(confDesc, envName.toUpperCase(), EMPTY, false), false);
279282
}
280283

284+
public static void deleteDirectory(org.eclipse.core.runtime.IPath directory) throws IOException {
285+
deleteDirectory(Path.of(directory.toOSString()));
286+
}
287+
288+
public static void deleteDirectory(Path directory) throws IOException {
289+
Files.walk(directory).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
290+
}
291+
292+
/**
293+
* this is some code to work around issue
294+
* https://github.com/eclipse-cdt/cdt/issues/539
295+
*
296+
*/
297+
public static String getFileExtension(String fileName) {
298+
int dotPosition = fileName.lastIndexOf('.');
299+
return (dotPosition == -1 || dotPosition == fileName.length() - 1) ? "" : fileName.substring(dotPosition + 1); //$NON-NLS-1$
300+
}
281301
}

io.sloeber.core/src/io/sloeber/core/common/IndexHelper.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import java.io.File;
44
import java.io.IOException;
55
import java.nio.charset.Charset;
6+
import java.nio.file.Files;
7+
import java.nio.file.Path;
68

7-
import org.apache.commons.io.FileUtils;
89
import org.eclipse.cdt.core.CCorePlugin;
910
import org.eclipse.cdt.core.dom.ast.cpp.ICPPFunction;
1011
import org.eclipse.cdt.core.index.IIndex;
@@ -35,7 +36,7 @@ private static String findParameterInFunction(IIndexName[] names, String functio
3536
String codeFileName = name.getFileLocation().getFileName();
3637
String rawCodeFileContent;
3738
try {
38-
rawCodeFileContent = FileUtils.readFileToString(new File(codeFileName), Charset.defaultCharset());
39+
rawCodeFileContent = Files.readString(Path.of(codeFileName), Charset.defaultCharset());
3940
} catch (IOException e) {
4041
return defaultValue;
4142
}

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import java.io.InputStreamReader;
3333
import java.io.Reader;
3434
import java.nio.charset.Charset;
35+
import java.nio.file.Files;
36+
import java.nio.file.StandardOpenOption;
3537
import java.util.ArrayList;
3638
import java.util.Arrays;
3739
import java.util.Collection;
@@ -46,7 +48,6 @@
4648
import java.util.Set;
4749
import java.util.Vector;
4850

49-
import org.apache.commons.io.FileUtils;
5051
import org.eclipse.cdt.core.CCorePlugin;
5152
import org.eclipse.cdt.core.model.CoreModel;
5253
import org.eclipse.cdt.core.settings.model.CSourceEntry;
@@ -923,7 +924,9 @@ public MultiStatus regenerateMakefiles() throws CoreException {
923924
awkContent += "\"}";
924925

925926
try {
926-
FileUtils.write(sizeAwkFile, awkContent, Charset.defaultCharset());
927+
Files.write(sizeAwkFile.toPath(), awkContent.getBytes(), StandardOpenOption.TRUNCATE_EXISTING,
928+
StandardOpenOption.CREATE);
929+
927930
} catch (IOException e) {
928931
// TODO Auto-generated catch block
929932
e.printStackTrace();

0 commit comments

Comments
 (0)