Skip to content

Add extra build symbols and recipe #3085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions arduino-core/src/processing/app/debug/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.Date;
import java.util.GregorianCalendar;

import cc.arduino.packages.BoardPort;
import cc.arduino.packages.Uploader;
Expand Down Expand Up @@ -416,6 +418,9 @@ public boolean compile(boolean _verbose) throws RunnerException, PreferencesMapE
// 4. link it all together into the .elf file
progressListener.progress(60);
compileLink();
if (prefs.get("build.elfpatch") != null) {
runRecipe("recipe.elfpatch.pattern");
}

// 5. run objcopy to generate output files
progressListener.progress(75);
Expand Down Expand Up @@ -542,6 +547,17 @@ private PreferencesMap createBuildPreferences(String _buildPath,
p.put("build.variant.path", "");
}

// Build Time
Date d = new Date();
GregorianCalendar cal = new GregorianCalendar();
long current = d.getTime()/1000;
long timezone = cal.get(cal.ZONE_OFFSET)/1000;
long daylight = cal.get(cal.DST_OFFSET)/1000;
p.put("extra.time.utc", Long.toString(current));
p.put("extra.time.local", Long.toString(current + timezone + daylight));
p.put("extra.time.zone", Long.toString(timezone));
p.put("extra.time.dst", Long.toString(daylight));

return p;
}

Expand Down Expand Up @@ -1134,6 +1150,7 @@ void runActions(String recipeClass, PreferencesMap prefs) throws RunnerException
void runRecipe(String recipe) throws RunnerException, PreferencesMapException {
PreferencesMap dict = new PreferencesMap(prefs);
dict.put("ide_version", "" + BaseNoGui.REVISION);
dict.put("sketch_path", sketch.getFolder().getAbsolutePath());

String[] cmdArray;
String cmd = prefs.getOrExcept(recipe);
Expand Down