Skip to content

Commit

Permalink
Add build symbols for compile time and sketch path
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen authored and Federico Fissore committed May 28, 2015
1 parent 5490b96 commit c1002e2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 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.MyStreamPumper;
import cc.arduino.packages.BoardPort;
Expand Down Expand Up @@ -554,6 +556,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 @@ -1124,6 +1137,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

0 comments on commit c1002e2

Please sign in to comment.