mirror of
https://github.com/arduino/Arduino.git
synced 2025-04-06 21:57:57 +02:00
Add build symbols for compile time and sketch path
This commit is contained in:
parent
5490b96f2e
commit
c1002e247f
@ -34,6 +34,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.SortedSet;
|
import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
|
|
||||||
import cc.arduino.MyStreamPumper;
|
import cc.arduino.MyStreamPumper;
|
||||||
import cc.arduino.packages.BoardPort;
|
import cc.arduino.packages.BoardPort;
|
||||||
@ -554,6 +556,17 @@ public class Compiler implements MessageConsumer {
|
|||||||
p.put("build.variant.path", "");
|
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;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1124,6 +1137,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
void runRecipe(String recipe) throws RunnerException, PreferencesMapException {
|
void runRecipe(String recipe) throws RunnerException, PreferencesMapException {
|
||||||
PreferencesMap dict = new PreferencesMap(prefs);
|
PreferencesMap dict = new PreferencesMap(prefs);
|
||||||
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
dict.put("ide_version", "" + BaseNoGui.REVISION);
|
||||||
|
dict.put("sketch_path", sketch.getFolder().getAbsolutePath());
|
||||||
|
|
||||||
String[] cmdArray;
|
String[] cmdArray;
|
||||||
String cmd = prefs.getOrExcept(recipe);
|
String cmd = prefs.getOrExcept(recipe);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user