@@ -56,27 +56,18 @@ function build_sketches()
56
56
57
57
if [ -e $cache_dir /core/* .a ]; then
58
58
# We need to preserve the build.options.json file and replace the last .ino
59
- # with this sketch's ino file, or builder will throw everything away. This
60
- # head/tail easier than a complicated SED script to replace the 1 line we need.
61
- head -8 $build_dir /build.options.json > $build_dir /../build.options.json
62
- echo ' "sketchLocation" : " ' $sketch ' ", ' >> $build_dir /../build.options.json
63
- tail -2 $build_dir /build.options.json >> $build_dir /../build.options.json
59
+ # with this sketch's ino file, or builder will throw everything away.
60
+ sed -i " s,^.*sketchLocation.*$, \" sketchLocation \" : \" $sketch \" \,,g " $build_dir /build.options.json
61
+ # Set the time of the cached core.a file to the future so the GIT header
62
+ # we regen won't cause the builder to throw it out and rebuild from scratch.
63
+ touch -d ' now + 1 day ' $cache_dir /core/ * .a
64
64
fi
65
65
66
66
# Clear out the last built sketch, map, elf, bin files, but leave the compiled
67
67
# objects in the core and libraries available for use so we don't need to rebuild
68
68
# them each sketch.
69
69
rm -rf $build_dir /sketch $build_dir /* .bin $build_dir /* .map $build_dir /* .elf
70
70
71
- if [ -e $cache_dir /core/* .a ]; then
72
- # Restore the new build.options.json file
73
- mv $build_dir /../build.options.json $build_dir /build.options.json
74
- # Set the time of the cached core.a file to year 2037 so the GIT header
75
- # we regen won't cause the builder to throw it out and rebuild from
76
- # scratch.
77
- touch -t 203712310000 $cache_dir /core/* .a
78
- fi
79
-
80
71
local sketchdir=$( dirname $sketch )
81
72
local sketchdirname=$( basename $sketchdir )
82
73
local sketchname=$( basename $sketch )
0 commit comments