forked from dotnet/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests] Replace azurestorage with a github repo. (dotnet#7524)
Our `https://xamjenkinsartifact.azureedge.net` site for some of the unit test data seems to have disappeared. So lets use a github repo to store this data instead. The unit tests can download the raw files directly from github. The repo will be public as well so there won't be any need for authorization. Update `DeleteBinObjTest` to use `7z`
- Loading branch information
1 parent
6573c37
commit ca2c629
Showing
5 changed files
with
65 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Utilities/SevenZipHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
using System.IO; | ||
using System.Diagnostics; | ||
|
||
namespace Xamarin.ProjectTools { | ||
public class SevenZipHelper : IDisposable { | ||
public string ArchivePath { get; private set; } | ||
|
||
public SevenZipHelper (string archivePath) | ||
{ | ||
ArchivePath = archivePath; | ||
} | ||
|
||
public bool ExtractAll (string destinationDir) | ||
{ | ||
using (var p = new Process ()) { | ||
p.StartInfo.FileName = Path.Combine ("7z"); | ||
p.StartInfo.Arguments = $"x {ArchivePath} -o{destinationDir}"; | ||
p.StartInfo.CreateNoWindow = true; | ||
p.StartInfo.UseShellExecute = false; | ||
p.StartInfo.RedirectStandardOutput = true; | ||
p.StartInfo.RedirectStandardError = true; | ||
p.ErrorDataReceived += (sender, e) => { | ||
if (e.Data != null) { | ||
Console.WriteLine (e.Data); | ||
} | ||
}; | ||
p.ErrorDataReceived += (sender, e) => { | ||
if (e.Data != null) { | ||
Console.WriteLine (e.Data); | ||
} | ||
}; | ||
|
||
p.Start (); | ||
p.BeginOutputReadLine (); | ||
p.BeginErrorReadLine (); | ||
bool completed = p.WaitForExit ((int) new TimeSpan (0, 15, 0).TotalMilliseconds); | ||
return completed && p.ExitCode == 0; | ||
} | ||
} | ||
|
||
public void Dispose () | ||
{ | ||
} | ||
|
||
public static SevenZipHelper Open (string path, FileMode fileMode) | ||
{ | ||
return new SevenZipHelper (path); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters