diff --git a/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBranch.cs b/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBranch.cs index 74f96f475b7..73f386038df 100644 --- a/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBranch.cs +++ b/build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBranch.cs @@ -15,7 +15,7 @@ namespace Xamarin.Android.BuildTools.PrepTasks public sealed class GitBranch : Git { [Output] - public string Branch { get; set; } + public string Branch { get; set; } = string.Empty; protected override bool LogTaskMessages { get { return false; } @@ -48,6 +48,12 @@ public override bool Execute () base.Execute (); } + // Trim generated dependabot branch names that are too long to produce useful package names + var lastSlashIndex = Branch.LastIndexOf ('/'); + if (Branch.StartsWith ("dependabot") && lastSlashIndex != -1 && Branch.Length > 60) { + Branch = Branch.Substring (lastSlashIndex + 1); + } + Log.LogMessage (MessageImportance.Low, $" [Output] {nameof (Branch)}: {Branch}"); return !Log.HasLoggedErrors; diff --git a/src/manifestmerger/build.gradle b/src/manifestmerger/build.gradle index d0c426d2601..44d750fe175 100644 --- a/src/manifestmerger/build.gradle +++ b/src/manifestmerger/build.gradle @@ -19,7 +19,7 @@ repositories { dependencies { // https://mvnrepository.com/artifact/com.android.tools.build/manifest-merger - implementation 'com.android.tools.build:manifest-merger:31.7.3' + implementation 'com.android.tools.build:manifest-merger:31.8.0' } sourceSets {