[mono-runtimes] Rebuild mono when mono changes. (#36)

The `mono-runtimes` project isn't resilient to mono changes, in large
part because of the `_Autogen` target: `_Autogen` only executes if
`$(_MonoPath)\autogen.sh` is newer than `$(_MonoPath)\configure`, and
if the `_Autogen` target *doesn't* run, *no other targets* are
re-executed either.

Meaning if mono is bumped, e.g. as in commit cebaba20, the "newly
updated" mono isn't necessarily rebuilt, because as far as the
`_Autogen` target is concerned, nothing has changed (unless there is a
commit which just happened to touch `autogen.sh`...which is a fairly
infrequent occurrence).

Add a new `_SetAutogenShTimeToLastCommitTimestamp` target which
*always* touch(1)es `autogen.sh` to contain the timestamp of the most
recent commit. That way, if (when) mono is updated, the timestamp of
`autogen.sh` will be updated to match, allowing mono to be properly
rebuilt. If mono *isn't* updated, the timestamp will be set to what
it previously was, and no rebuild will occur.

Note: `git log --date=format-local:...` must be used so that the
resulting timestamp is in the *local* timezone. Otherwise, it's
possible that if the current commit was done "in the future" relative
to the current local timezone, `autogen.sh` will *always* have a more
recent timestamp...until "tomorrow", anyway, and nobody wants to wait
for "tomorrow".
This commit is contained in:
Jonathan Pryor 2016-05-11 20:08:11 -04:00 коммит произвёл Ankit Jain
Родитель 452d405e32
Коммит 70e4042598
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -9,7 +9,14 @@
<Import Project="$(_SourceTopDir)\Configuration.props" />
<Import Project="mono-runtimes.props" />
<Import Project="mono-runtimes.projitems" />
<Target Name="_SetAutogenShTimeToLastCommitTimestamp">
<Exec
Command="touch -m -t `git log -1 --format=%25cd --date=format-local:%25Y%25m%25d%25H%25M.%25S` autogen.sh"
WorkingDirectory="$(_MonoPath)"
/>
</Target>
<Target Name="_Autogen"
DependsOnTargets="_SetAutogenShTimeToLastCommitTimestamp"
Inputs="$(_MonoPath)\autogen.sh"
Outputs="$(_MonoPath)\configure">
<Exec