Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Xml;
using System.Xml.Linq;
using Microsoft.Build.Construction;
Expand Down Expand Up @@ -157,6 +158,27 @@ public void TestTgzDownload ()
Assert.True (File.Exists (Path.Combine (unpackDir, "GoogleSymbolUtilities-1.0.3", "Libraries", "libGSDK_Overload.a")));
}

[Fact]
public void Test7ZipExtractionIsNonInteractive ()
{
var method = typeof (Xamarin.Build.Download.XamarinDownloadArchives).GetMethod (
"Build7ZipExtractionArgs",
BindingFlags.NonPublic | BindingFlags.Static);
Assert.True (method != null, "Could not find XamarinDownloadArchives.Build7ZipExtractionArgs via reflection.");
var sevenZipPath = Path.Combine (TempDir, "7z.exe");
File.WriteAllText (sevenZipPath, string.Empty);

var args = method.Invoke (null, new object [] {
"archive.tgz",
TempDir,
sevenZipPath,
false,
null,
});

Assert.Contains ("-y", args.ToString ());
}

[Fact]
public void TestUncompressedNamedDownload ()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<PackageId>Xamarin.Build.Download</PackageId>
<Title>Xamarin Build-time Download Support</Title>
<PackageVersion>0.11.4</PackageVersion>
<PackageVersion>0.11.5</PackageVersion>
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=865061</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ static ProcessArgumentBuilder Build7ZipExtractionArgs (string file, string conte
if (ignoreTarSymLinks)
args.Add ("-snl-");

// Never let 7-Zip wait for input from a non-interactive MSBuild task.
// https://7-zip.opensource.jp/chm/cmdline/switches/yes.htm
args.Add ("-y");
args.AddQuoted ("-o" + contentDir);
args.AddQuoted (file);
return args;
Expand Down