Skip to content
Merged
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 @@ -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; }
Expand Down Expand Up @@ -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);
}
Comment on lines +51 to +55

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. 👍

We can probably just merge this together, but need to check the CI results if the new manifestmerger is OK.


Log.LogMessage (MessageImportance.Low, $" [Output] {nameof (Branch)}: {Branch}");

return !Log.HasLoggedErrors;
Expand Down
2 changes: 1 addition & 1 deletion src/manifestmerger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down