Skip to content

Commit 047a1fa

Browse files
author
jantje
committed
#661 installl awk in windows
1 parent 385106b commit 047a1fa

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

io.sloeber.core/config/pre_processing_platform_default.txt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
#this file contains default/fallback/resque values
1+
#this file contains default/fallback/rescue values
22
software=ARDUINO
33
recipe.objcopy.hex.pattern=${recipe.objcopy.bin.pattern}
44
archive_file=arduino.ar
55
archive_file_path=${build.path}/${archive_file}
6-
sloeber.size_command.avr="${compiler.path}${compiler.size.cmd}" --format=avr --mcu=${build.mcu} "${build.path}/${build.project_name}.elf"
7-
sloeber.size_command.awk=${recipe.size.pattern} | C:\test\awk\awk -f size.awk
86
runtime.ide.version=10812
97
build.system.path=${referenced.core.path}${DirectoryDelimiter}system
108
serial.port=${com_port}
119
build.project_name=${ProjName}
10+
11+
#size stuff
12+
sloeber.size_command.avr="${compiler.path}${compiler.size.cmd}" --format=avr --mcu=${build.mcu} "${build.path}/${build.project_name}.elf"
13+
sloeber.size_command.awk=${recipe.size.pattern} | "${sloeber.awk.path}awk" -f size.awk
14+
15+
1216
#make sure we have default compiling warning commands
1317
compiler.warning_flags.none=-w
1418
compiler.warning_flags.more=-Wall
1519
compiler.warning_flags.all=-Wall -Wextra
16-
20+
compiler.warning_flags=-w
1721

1822

1923
#quick fix for issue #810
@@ -33,12 +37,7 @@ tools.avrdude_remote.upload.verbose=-v
3337
#for due
3438
serial.port.file=${serial.port}
3539

36-
#to turn warnings on/off
37-
compiler.warning_flags=-w
38-
compiler.warning_flags.all=-Wall -Wextra
39-
4040
#for stm
41-
4241
upload.altID=no_altID
4342
upload.usbID=no_altID
4443

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
import io.sloeber.core.listeners.IndexerListener;
5151
import io.sloeber.core.listeners.resourceChangeListener;
5252

53-
5453
/**
5554
* generated code
5655
*
@@ -398,8 +397,14 @@ private static void installOtherStuff() {
398397
String SH_EXE = "sh.exe";
399398
String MAKE_ZIP = "make1.zip";
400399
String MAKE_URL = "https://github.com/Sloeber/arduino-eclipse-plugin/files/2695478/make.zip";
401-
// On Windows install make
400+
401+
String AWK_EXE = "awk.exe";
402+
String AWK_ZIP = "awk_GNU_64_bit_V4_2_1.zip";
403+
String AWK_URL = "https://github.com/Sloeber/arduino-eclipse-plugin/files/7102568/awk_GNU_64_bit_V4_2_1.zip";
404+
405+
// On Windows install make and awk
402406
if (SystemUtils.IS_OS_WINDOWS) {
407+
// Install make if needed
403408
IPath localMakePath = ConfigurationPreferences.getMakePath();
404409
if (localMakePath.append(MAKE_EXE).toFile().exists()) {
405410
if (!localMakePath.append(SH_EXE).toFile().exists()) {
@@ -415,6 +420,13 @@ private static void installOtherStuff() {
415420
IProgressMonitor monitor = new NullProgressMonitor();
416421
Common.log(downloadAndInstall(MAKE_URL, MAKE_ZIP, localMakePath, false, monitor));
417422
}
423+
424+
// Install awk if needed
425+
IPath localAwkPath = ConfigurationPreferences.getAwkPath();
426+
if (!localAwkPath.append(AWK_EXE).toFile().exists()) {
427+
IProgressMonitor monitor = new NullProgressMonitor();
428+
Common.log(downloadAndInstall(AWK_URL, AWK_ZIP, localAwkPath, false, monitor));
429+
}
418430
}
419431
}
420432

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*/
2727
public class ConfigurationPreferences {
2828

29-
3029
private static final String EXAMPLE_FOLDER_NAME = "examples"; //$NON-NLS-1$
3130
private static final String DOWNLOADS_FOLDER = "downloads"; //$NON-NLS-1$
3231
private static final String PRE_PROCESSING_PLATFORM_TXT = "pre_processing_platform.txt"; //$NON-NLS-1$
@@ -36,7 +35,6 @@ public class ConfigurationPreferences {
3635

3736
private static final String KEY_UPDATE_JASONS = "Update jsons files"; //$NON-NLS-1$
3837

39-
4038
// preference nodes
4139
private static final String PACKAGES_FOLDER_NAME = "packages"; //$NON-NLS-1$
4240

@@ -151,14 +149,15 @@ public static File getPostProcessingBoardsFile() {
151149
return getInstallationPath().append(POST_PROCESSING_BOARDS_TXT).toFile();
152150
}
153151

154-
155-
156-
157152
public static Path getMakePath() {
158153
return new Path(getInstallationPath().append("tools/make").toString()); //$NON-NLS-1$
159154

160155
}
161156

157+
public static IPath getAwkPath() {
158+
return new Path(getInstallationPath().append("tools/awk").toString()); //$NON-NLS-1$
159+
}
160+
162161
public static boolean getUpdateJasonFilesFlag() {
163162
return getBoolean(KEY_UPDATE_JASONS, Defaults.updateJsonFiles);
164163
}

0 commit comments

Comments
 (0)