From f8fa0d666d277994e0554446a4b01c50321f7ad0 Mon Sep 17 00:00:00 2001 From: Bill Holmes Date: Wed, 11 May 2016 13:22:59 -0400 Subject: [PATCH] Update the timestamps in the nugets to Now Workaround for https://bugzilla.xamarin.com/show_bug.cgi?id=40973 `nuget pack` is creating a package with timestamps in future. I am told that this is a know issue with mono. We will use this workaround until the mono fix makes it onto the build bots. --- common.cake | 16 ++++++++++++++++ nuget-mono-fix.sh | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 nuget-mono-fix.sh diff --git a/common.cake b/common.cake index 14fa2891..253f56f9 100644 --- a/common.cake +++ b/common.cake @@ -53,6 +53,22 @@ Task ("tmp-nuget").IsDependentOn ("libs").Does (() => PackNuGets (newList.ToArray ()); }); + +Task ("nuget").IsDependentOn ("libs").IsDependentOn ("nuget-base").Does (() => +{ + var fixer = new FilePath ("../nuget-mono-fix.sh").MakeAbsolute (Context.Environment); + + foreach (var nuget in buildSpec.NuGets) { + foreach (var file in GetFiles ("./output/" + nuget.NuSpec.GetFilenameWithoutExtension () + "*.nupkg")) { + StartProcess ("/bin/sh", + new ProcessSettings { + Arguments = string.Format ("{0} {1}", fixer, file), + } + ); + } + } +}); + Task ("component").IsDependentOn ("nuget").IsDependentOn ("tmp-nuget").IsDependentOn ("component-base"); FilePath GetCakeToolPath () diff --git a/nuget-mono-fix.sh b/nuget-mono-fix.sh new file mode 100644 index 00000000..239585fd --- /dev/null +++ b/nuget-mono-fix.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +curdir=$(pwd) + +rm -rf nuget-mono-fix +FILES=`unzip -Z1 $1` +unzip $1 -d nuget-mono-fix + +cd nuget-mono-fix + + +for filename in $FILES; do \ + touch $filename; \ + zip --delete $1 $filename; \ + zip --update $1 $filename; \ +done + +cd $curdir +rm -rf nuget-mono-fix +