-
Notifications
You must be signed in to change notification settings - Fork 533
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dev/grendel/xxhash3
* main: Bump to xamarin/xamarin-android-tools/main@37d79c9 (#8752) Bump to dotnet/installer@d070660282 9.0.100-preview.3.24126.2 (#8763) Bump to xamarin/java.interop/main@14a9470 (#8766) $(AndroidPackVersionSuffix)=preview.3; net9 is 34.99.0.preview.3 (#8765) [Mono.Android] Do not dispose request content stream in AndroidMessageHandler (#8764) Bump com.android.tools:r8 from 8.2.42 to 8.2.47 (#8761) [Mono.Android] fix a set of the "easiest" trimmer warnings (#8731) Bump to dotnet/installer@0a73f814e1 9.0.100-preview.2.24122.3 (#8716) [ci] Always run the MAUI test job (#8750) Add a property required by #8478 (#8749) [xamarin-android-tools] import $(LibZipSharpVersion) value (#8738) Bump to xamarin/Java.Interop/main@c825dcad (#8701) Bump to xamarin/monodroid@cb01503327 (#8742) Bump to xamarin/Java.Interop/main@ae65609 (#8744) Bring in changes from PR #8478 (#8727) [xaprepare] Make 7zip work with "dangerous" symlinks in ZIPs (#8737) Bump NDK to r26c (#8732) Debugging MSBuild Tasks (#8730)
- Loading branch information
Showing
46 changed files
with
1,070 additions
and
345 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
xamarin/monodroid:main@848d1277b76a599d8a280d58ec06e95477b4a7e5 | ||
xamarin/monodroid:main@cb01503327f7723ec138ec4cc051610fecee1bf7 |
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
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
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
70 changes: 70 additions & 0 deletions
70
build-tools/xaprepare/xaprepare/Application/SevenZipVersionParser.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,70 @@ | ||
using System; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace Xamarin.Android.Prepare; | ||
|
||
class SevenZipVersionParser : ProgramVersionParser | ||
{ | ||
const string VersionArgument = "--help"; | ||
readonly Regex fallbackRegex; | ||
readonly Regex modernRegex; | ||
|
||
public SevenZipVersionParser (string programName, Regex fallbackRegex, Log? log = null) | ||
: base (programName, VersionArgument, 0, log) | ||
{ | ||
this.fallbackRegex = fallbackRegex; | ||
modernRegex = VersionFetchers.MakeRegex (@"^7-Zip (\(a\) ){0,1}(?<Version>[\d]+\.[\d]+)"); | ||
} | ||
|
||
protected override string ParseVersion (string programOutput) | ||
{ | ||
string output = programOutput.Trim (); | ||
if (String.IsNullOrEmpty (output)) { | ||
Log.WarningLine ($"Unable to parse version of {ProgramName} because version output was empty"); | ||
return DefaultVersionString; | ||
} | ||
|
||
string ret = String.Empty; | ||
string[] lines = programOutput.Split (RegexProgramVersionParser.LineSeparator); | ||
|
||
// First try to find the official 7zip release version | ||
foreach (string l in lines) { | ||
string line = l.Trim (); | ||
|
||
if (line.Length == 0) { | ||
continue; | ||
} | ||
|
||
if (line.StartsWith ("7-Zip", StringComparison.OrdinalIgnoreCase)) { | ||
// Strings of the form: | ||
// 7-Zip 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20 | ||
// 7-Zip (a) 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20 | ||
// 7-Zip (a) 18.01 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2018-01-28 | ||
// 7-Zip (a) 18.01 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2018-01-28 | ||
if (RegexProgramVersionParser.TryMatch (modernRegex, line, out ret)) { | ||
return ret; | ||
} | ||
} | ||
|
||
// Since we know we're dealing with `--help` option output, we can short-circuit things | ||
if (line.StartsWith ("Usage:", StringComparison.OrdinalIgnoreCase)) { | ||
break; | ||
} | ||
} | ||
|
||
// Modern version wasn't found, try again with the fallback one | ||
foreach (string l in lines) { | ||
string line = l.Trim (); | ||
|
||
if (line.Length == 0) { | ||
continue; | ||
} | ||
|
||
if (RegexProgramVersionParser.TryMatch (fallbackRegex, line, out ret)) { | ||
return ret; | ||
} | ||
} | ||
|
||
return DefaultVersionString; | ||
} | ||
} |
Oops, something went wrong.