-
Notifications
You must be signed in to change notification settings - Fork 564
Adding api-versions.xml based on the AndroidApiLevel #4186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -142,44 +142,41 @@ void ValidateApiCompat (string contractPath, bool validateAgainstReference) | |
| File.Copy (implementationAssembly, Path.Combine (targetImplementationPathDirectory, assemblyToValidate), true); | ||
| } | ||
|
|
||
| using (var genApiProcess = new Process ()) { | ||
| for (int i = 0; i < 3; i++) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR #4174 added support to re-execute
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to created a new Process object to re-try instead of using the one already created. For some reason I was getting some odd behavior when re-running the process from the same Process object after the crash. When I was reading online, the recommendation was to dispose the object and use a new one. |
||
| using (var genApiProcess = new Process ()) { | ||
|
|
||
| genApiProcess.StartInfo.FileName = apiCompat; | ||
| genApiProcess.StartInfo.Arguments = $"\"{contractPathDirectory}\" -i \"{targetImplementationPathDirectory}\" "; | ||
| genApiProcess.StartInfo.FileName = apiCompat; | ||
| genApiProcess.StartInfo.Arguments = $"\"{contractPathDirectory}\" -i \"{targetImplementationPathDirectory}\" "; | ||
|
|
||
| // Verify if there is an exclusion list | ||
| var excludeAttributes = Path.Combine (ApiCompatibilityPath, $"api-compat-exclude-attributes.txt"); | ||
| if (File.Exists (excludeAttributes)) { | ||
| genApiProcess.StartInfo.Arguments += $"--exclude-attributes {excludeAttributes} "; | ||
| } | ||
| // Verify if there is an exclusion list | ||
| var excludeAttributes = Path.Combine (ApiCompatibilityPath, $"api-compat-exclude-attributes.txt"); | ||
| if (File.Exists (excludeAttributes)) { | ||
| genApiProcess.StartInfo.Arguments += $"--exclude-attributes {excludeAttributes} "; | ||
| } | ||
|
|
||
| genApiProcess.StartInfo.UseShellExecute = false; | ||
| genApiProcess.StartInfo.CreateNoWindow = true; | ||
| genApiProcess.StartInfo.RedirectStandardOutput = true; | ||
| genApiProcess.StartInfo.RedirectStandardError = true; | ||
| genApiProcess.EnableRaisingEvents = true; | ||
|
|
||
| var lines = new List<string> (); | ||
| var processHasCrashed = false; | ||
| void dataReceived (object sender, DataReceivedEventArgs args) | ||
| { | ||
| if (!string.IsNullOrWhiteSpace (args.Data)) { | ||
| lines.Add (args.Data.Trim ()); | ||
|
|
||
| if (args.Data.IndexOf ("Native Crash Reporting") != -1) { | ||
| processHasCrashed = true; | ||
| genApiProcess.StartInfo.UseShellExecute = false; | ||
| genApiProcess.StartInfo.CreateNoWindow = true; | ||
| genApiProcess.StartInfo.RedirectStandardOutput = true; | ||
| genApiProcess.StartInfo.RedirectStandardError = true; | ||
| genApiProcess.EnableRaisingEvents = true; | ||
|
|
||
| var lines = new List<string> (); | ||
| var processHasCrashed = false; | ||
| void dataReceived (object sender, DataReceivedEventArgs args) | ||
| { | ||
| if (!string.IsNullOrWhiteSpace (args.Data)) { | ||
| lines.Add (args.Data.Trim ()); | ||
|
|
||
| if (args.Data.IndexOf ("Native Crash Reporting") != -1) { | ||
| processHasCrashed = true; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| genApiProcess.OutputDataReceived += dataReceived; | ||
| genApiProcess.ErrorDataReceived += dataReceived; | ||
|
|
||
| // Get api definition for previous Api | ||
| for (int i = 0; i < 3; i++) { | ||
| lines.Clear (); | ||
| processHasCrashed = false; | ||
| genApiProcess.OutputDataReceived += dataReceived; | ||
| genApiProcess.ErrorDataReceived += dataReceived; | ||
|
|
||
| // Get api definition for previous Api | ||
| compatApiCommand = $"CompatApi command: {genApiProcess.StartInfo.FileName} {genApiProcess.StartInfo.Arguments}"; | ||
| Log.LogMessage (MessageImportance.High, compatApiCommand); | ||
|
|
||
|
|
@@ -198,7 +195,8 @@ void dataReceived (object sender, DataReceivedEventArgs args) | |
|
|
||
| if (processHasCrashed) { | ||
| if (i + 1 < 3) { | ||
| Log.LogWarning ($"Process has crashed.'{Environment.NewLine}Crash report:{Environment.NewLine}{String.Join (Environment.NewLine, lines)}"); | ||
| Log.LogWarning ($"Process has crashed."); | ||
| Log.LogMessage (MessageImportance.High, String.Join (Environment.NewLine, lines)); | ||
| Log.LogWarning ($"We will retry."); | ||
| continue; | ||
| } else { | ||
|
|
@@ -328,13 +326,15 @@ Dictionary<string, HashSet<string>> LoadIssues (IEnumerable<string> content) | |
| return issues; | ||
| } | ||
|
|
||
| void LogError(string errorMessage) | ||
| void LogError (string errorMessage) | ||
| { | ||
| var message = string.Empty; | ||
| if (!string.IsNullOrWhiteSpace (compatApiCommand)) { | ||
| Log.LogError ($"{compatApiCommand}{Environment.NewLine}{errorMessage}"); | ||
| } else { | ||
| Log.LogError (errorMessage); | ||
| errorMessage = $"{compatApiCommand}{Environment.NewLine}{errorMessage}"; | ||
| } | ||
|
|
||
| Log.LogMessage (MessageImportance.High, errorMessage); | ||
| Log.LogError (errorMessage); | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason why to bump the version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I talked to Santi the person responsible and he said they are making some perf improvements, so I decide to bump the version.