Skip to content

Commit 18a4b18

Browse files
committed
update arduino-builder to 1.3.25
Also add build.cache_core preference
1 parent 40e7b1d commit 18a4b18

14 files changed

+41
-8
lines changed

app/src/cc/arduino/view/preferences/Preferences.java

+9
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ private void initComponents() {
128128
enableCodeFoldingBox = new javax.swing.JCheckBox();
129129
verifyUploadBox = new javax.swing.JCheckBox();
130130
externalEditorBox = new javax.swing.JCheckBox();
131+
cacheCompiledCore = new javax.swing.JCheckBox();
131132
checkUpdatesBox = new javax.swing.JCheckBox();
132133
updateExtensionBox = new javax.swing.JCheckBox();
133134
saveVerifyUploadBox = new javax.swing.JCheckBox();
@@ -244,6 +245,9 @@ public void mouseEntered(java.awt.event.MouseEvent evt) {
244245
externalEditorBox.setText(tr("Use external editor"));
245246
checkboxesContainer.add(externalEditorBox);
246247

248+
cacheCompiledCore.setText(tr("Aggressively cache compiled core"));
249+
checkboxesContainer.add(cacheCompiledCore);
250+
247251
checkUpdatesBox.setText(tr("Check for updates on startup"));
248252
checkboxesContainer.add(checkUpdatesBox);
249253

@@ -678,6 +682,7 @@ private void autoScaleCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//
678682
private javax.swing.JCheckBox enableCodeFoldingBox;
679683
private javax.swing.JButton extendedAdditionalUrlFieldWindow;
680684
private javax.swing.JCheckBox externalEditorBox;
685+
private javax.swing.JCheckBox cacheCompiledCore;
681686
private javax.swing.JTextField fontSizeField;
682687
private javax.swing.JLabel fontSizeLabel;
683688
private javax.swing.JLabel jLabel1;
@@ -772,6 +777,8 @@ private void savePreferencesData() {
772777

773778
PreferencesData.setBoolean("editor.external", externalEditorBox.isSelected());
774779

780+
PreferencesData.setBoolean("compiler.cache_core", cacheCompiledCore.isSelected());
781+
775782
PreferencesData.setBoolean("update.check", checkUpdatesBox.isSelected());
776783

777784
PreferencesData.setBoolean("editor.update_extension", updateExtensionBox.isSelected());
@@ -832,6 +839,8 @@ private void showPrerefencesData() {
832839

833840
externalEditorBox.setSelected(PreferencesData.getBoolean("editor.external"));
834841

842+
cacheCompiledCore.setSelected(PreferencesData.get("compiler.cache_core") == null || PreferencesData.getBoolean("compiler.cache_core"));
843+
835844
checkUpdatesBox.setSelected(PreferencesData.getBoolean("update.check"));
836845

837846
updateExtensionBox.setSelected(PreferencesData.get("editor.update_extension") == null || PreferencesData.getBoolean("editor.update_extension"));

arduino-core/src/cc/arduino/Compiler.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ enum BuilderAction {
138138
private final File pathToSketch;
139139
private final Sketch sketch;
140140
private String buildPath;
141+
private String buildCache;
141142
private final boolean verbose;
142143
private RunnerException exception;
143144

@@ -156,9 +157,10 @@ public String build(CompilerProgressListener progListener, boolean exportHex) th
156157
listeners.add(progListener);
157158
return this.build(listeners, exportHex);
158159
}
159-
160+
160161
public String build(ArrayList<CompilerProgressListener> progListeners, boolean exportHex) throws RunnerException, PreferencesMapException, IOException {
161162
this.buildPath = sketch.getBuildPath().getAbsolutePath();
163+
this.buildCache = BaseNoGui.getCachePath().getAbsolutePath();
162164

163165
TargetBoard board = BaseNoGui.getTargetBoard();
164166
if (board == null) {
@@ -258,6 +260,11 @@ private void callArduinoBuilder(TargetBoard board, TargetPlatform platform, Targ
258260
cmd.add(buildPath);
259261
cmd.add("-warnings=" + PreferencesData.get("compiler.warning_level"));
260262

263+
if (PreferencesData.getBoolean("compiler.cache_core") == true) {
264+
cmd.add("-build-cache");
265+
cmd.add(buildCache);
266+
}
267+
261268
PreferencesData.getMap()
262269
.subTree("runtime.build_properties_custom")
263270
.entrySet()

arduino-core/src/processing/app/BaseNoGui.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
import processing.app.packages.LibraryList;
2222
import processing.app.packages.UserLibrary;
2323

24+
import cc.arduino.files.DeleteFilesOnShutdown;
25+
import processing.app.helpers.FileUtils;
26+
2427
import java.beans.PropertyChangeListener;
2528
import java.beans.PropertyChangeSupport;
2629
import java.io.File;
@@ -100,6 +103,8 @@ public class BaseNoGui {
100103

101104
private static String boardManagerLink = "";
102105

106+
private static File buildCache;
107+
103108
// Returns a File object for the given pathname. If the pathname
104109
// is not absolute, it is interpreted relative to the current
105110
// directory when starting the IDE (which is not the same as the
@@ -131,7 +136,7 @@ static public PreferencesMap getBoardPreferences() {
131136
if (board == null)
132137
return null;
133138
String boardId = board.getId();
134-
139+
135140
PreferencesMap prefs = new PreferencesMap(board.getPreferences());
136141

137142
String extendedName = prefs.get("name");
@@ -256,6 +261,18 @@ static public String getPortableSketchbookFolder() {
256261
return portableSketchbookFolder;
257262
}
258263

264+
static public File getCachePath() {
265+
if (buildCache == null) {
266+
try {
267+
buildCache = FileUtils.createTempFolder("arduino_cache_");
268+
DeleteFilesOnShutdown.add(buildCache);
269+
} catch (IOException e) {
270+
return null;
271+
}
272+
}
273+
return buildCache;
274+
}
275+
259276
/**
260277
* Convenience method to get a File object for the specified filename inside
261278
* the settings folder.

build/arduino-builder-linux32-1.3.24.tar.bz2.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ffcef834b478c1ca05d14460cf6bb3b3427e4e6e

build/arduino-builder-linux64-1.3.24.tar.bz2.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
09ee430cb6cc5b934433c7077cfc60126db07fa7

build/arduino-builder-linuxarm-1.3.24.tar.bz2.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7b4ee3c503084879a8c53c04f3de7f28db4a6ece

build/arduino-builder-macosx-1.3.24.tar.bz2.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
33b2636990a82321bb1e267be82d444c56f6f714

build/arduino-builder-windows-1.3.24.zip.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
797c652fa6e7ff157836536ca20b04bb59bddb22

build/build.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585

8686
<property name="portable" value="false" />
8787

88-
<property name="ARDUINO-BUILDER-VERSION" value="1.3.24" />
88+
<property name="ARDUINO-BUILDER-VERSION" value="1.3.25" />
8989
<property name="LIBLISTSERIAL-VERSION" value="1.4.0" />
9090
<property name="AVRGCC-VERSION" value="4.9.2-atmel3.5.4-arduino2" />
9191
<property name="AVRDUDE-VERSION" value="6.3.0-arduino9" />

0 commit comments

Comments
 (0)