Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tasks] Use UTC in ResolveLibraryProjectImports (
Browse files Browse the repository at this point in the history
…#768)

We were not using UTC for allot of the date time comparisons in
the `<ResolveLibraryProjectImports/>` task. We really should be
since it means we should not hit any issues with LocalTimes.
  • Loading branch information
dellis1972 authored and jonpryor committed Aug 23, 2017
1 parent e13fd6c commit 9204506
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void Extract (

// Skip already-extracted resources.
var stamp = new FileInfo (Path.Combine (outdir.FullName, assemblyIdentName + ".stamp"));
if (stamp.Exists && stamp.LastWriteTime > new FileInfo (assemblyPath).LastWriteTime) {
if (stamp.Exists && stamp.LastWriteTimeUtc > new FileInfo (assemblyPath).LastWriteTimeUtc) {
Log.LogDebugMessage ("Skipped resource lookup for {0}: extracted files are up to date", assemblyPath);
#if SEPARATE_CRUNCH
// FIXME: review these binResDir/binAssemblyDir thing and enable this. Eclipse does this.
Expand All @@ -211,7 +211,7 @@ void Extract (
Directory.CreateDirectory (importsDir);

var assembly = res.GetAssembly (assemblyPath);
var assemblyLastWrite = new FileInfo (assemblyPath).LastWriteTime;
var assemblyLastWrite = new FileInfo (assemblyPath).LastWriteTimeUtc;
bool updated = false;

foreach (var mod in assembly.Modules) {
Expand All @@ -223,7 +223,7 @@ void Extract (
if (!Directory.Exists (outDirForDll))
Directory.CreateDirectory (outDirForDll);
var finfo = new FileInfo (Path.Combine (outDirForDll, envtxt.Name));
if (!finfo.Exists || finfo.LastWriteTime > assemblyLastWrite) {
if (!finfo.Exists || finfo.LastWriteTimeUtc > assemblyLastWrite) {
using (var fs = finfo.Create ()) {
var data = envtxt.GetResourceData ();
fs.Write (data, 0, data.Length);
Expand All @@ -240,7 +240,7 @@ void Extract (
foreach (var resjar in resjars) {
var outjarFile = Path.Combine (importsDir, resjar.Name);
var fi = new FileInfo (outjarFile);
if (!fi.Exists || fi.LastWriteTime > assemblyLastWrite) {
if (!fi.Exists || fi.LastWriteTimeUtc > assemblyLastWrite) {
var data = resjar.GetResourceData ();
using (var outfs = File.Create (outjarFile))
outfs.Write (data, 0, data.Length);
Expand Down

0 comments on commit 9204506

Please sign in to comment.