Skip to content

Conversation

@pjcollins
Copy link
Member

@pjcollins pjcollins commented Dec 15, 2020

We are hoping to sever the xamarin-android dependency from monodroid.
In order to do this we'll want to share some common MSBuild code across
our two build task assemblies, Xamarin.Android.Build.Tasks and
Xamarin.Android.Build.Debugging.Tasks.

This common code has been moved from xamarin/xamarin-android into
a new project in this repo named Microsoft.Android.Build.BaseTasks.
More utilities can be migrated here in the future if we so desire.

A new test project Microsoft.Android.Build.BaseTasks-Tests.csproj has
also been added to bring over the relevant tests from xamarin-android.

We are hoping to sever the xamarin-android dependency from monodroid.
In order to do this we'll want to share some common MSBuild code across
our two build task assemblies, `Xamarin.Android.Build.Tasks` and
`Xamarin.Android.Build.Debugging.Tasks`.

This common code has been moved into this repo as part of a new project
named `Microsoft.Android.Build.BaseTasks`.  More utilities can be
migrated here in the future if we so desire.
@dotnet dotnet deleted a comment from azure-pipelines bot Dec 15, 2020
@dotnet dotnet deleted a comment from azure-pipelines bot Dec 16, 2020

public abstract string TaskPrefix { get; }

public override bool Execute ()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be override sealed, so that it can't be further overridden?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, because under certain circumstances we still need to override execute. One example is when calling the MSBuild GetRegisterTaskObject, that needs to be done from the UI thread.


// Most ToolTask's do not override Execute and
// just expect the base to be called
public virtual bool RunTask () => base.Execute ();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand how this "works" w/o causing stack overflow if the subclass doesn't "do" anything:

class ExampleTask : AndroidToolTask {
    public override string TaskPrefix => "FOO";
}

Wouldn't AndroidToolTask.Execute() all AndroidToolTask.RunTask() call .Execute() call .RunTask() call…?

"Feels like" this should instead have RunTask() be abstract, and Execute() should be override sealed.

Copy link
Member

Choose a reason for hiding this comment

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

This is:

  • AndroidToolTask.Execute()
  • AndroidToolTask.RunTask()
  • base.Execute() or ToolTask.Execute() from MSBuild

Hopefully, should not be a stack overflow.

I don't think we can mark anything sealed as mentioned: #101 (comment)

@pjcollins pjcollins marked this pull request as ready for review January 4, 2021 19:29
@pjcollins pjcollins marked this pull request as draft January 4, 2021 21:38
pjcollins added a commit to dotnet/android that referenced this pull request Jan 5, 2021
Context: dotnet/android-tools#101
Context: xamarin/monodroid#1145

We would like to eventually remove the dependency that xamarin/monodroid
has on xamarin/xamarin-android.  As a first step towards this effort,
shared MSBuild code is being moved to xamarin/xamarin-android-tools.

Xamarin.Android.Build.Tasks has been updated to use the new shared
Microsoft.Android.Build.Tasks sources.  Our build steps have also been
updated to use the new and simplified monodroid build logic.
pjcollins added a commit to dotnet/android that referenced this pull request Jan 5, 2021
Context: dotnet/android-tools#101
Context: xamarin/monodroid#1145

We would like to eventually remove the dependency that xamarin/monodroid
has on xamarin/xamarin-android.  As a first step towards this effort,
shared MSBuild code is being moved to xamarin/xamarin-android-tools.

Xamarin.Android.Build.Tasks has been updated to use the new shared
Microsoft.Android.Build.Tasks sources.  Our build steps have also been
updated to use the new and simplified monodroid build logic.
pjcollins added a commit to dotnet/android that referenced this pull request Jan 5, 2021
Context: dotnet/android-tools#101

We would like to eventually remove the dependency that xamarin/monodroid
has on xamarin/xamarin-android.  As a first step towards this effort,
shared MSBuild code is being moved to xamarin/xamarin-android-tools.

Xamarin.Android.Build.Tasks has been updated to use the new shared
Microsoft.Android.Build.Tasks sources.

Relevant tests have been moved into xamarin/xamarin-android-tools to a
new `Microsoft.Android.Build.BaseTasks-Tests` assembly.
pjcollins added a commit to dotnet/android that referenced this pull request Jan 5, 2021
Context: dotnet/android-tools#101

We would like to eventually remove the dependency that xamarin/monodroid
has on xamarin/xamarin-android.  As a first step towards this effort,
shared MSBuild code is being moved to xamarin/xamarin-android-tools.

Xamarin.Android.Build.Tasks has been updated to use the new shared
Microsoft.Android.Build.Tasks sources.

Relevant tests have been moved into xamarin/xamarin-android-tools to a
new `Microsoft.Android.Build.BaseTasks-Tests` assembly.
@pjcollins pjcollins marked this pull request as ready for review January 5, 2021 20:51
pjcollins added a commit to dotnet/android that referenced this pull request Jan 6, 2021
Context: dotnet/android-tools#101

We would like to eventually remove the dependency that xamarin/monodroid
has on xamarin/xamarin-android.  As a first step towards this effort,
shared MSBuild code is being moved to xamarin/xamarin-android-tools.

Xamarin.Android.Build.Tasks has been updated to use the new shared
Microsoft.Android.Build.Tasks sources.

Relevant tests have been moved into xamarin/xamarin-android-tools to a
new `Microsoft.Android.Build.BaseTasks-Tests` assembly.
@pjcollins pjcollins added the do-not-merge Do not merge this PR label Jan 8, 2021
@pjcollins
Copy link
Member Author

This should be ready to go, but we're going to wait to merge this until the week of the 18th or later. There are a lot of connected pieces that should land at the same time, and we want to give d16-9 a little more time before merging all of them as all of these changes will make backporting difficult.

@pjcollins pjcollins removed the do-not-merge Do not merge this PR label Feb 1, 2021
@pjcollins pjcollins merged commit 8ea78a4 into main Feb 2, 2021
@pjcollins pjcollins deleted the mabt-shared branch February 2, 2021 16:19
pjcollins added a commit to dotnet/android that referenced this pull request Feb 5, 2021
…5464)

Context: dotnet/android-tools#101
Context: xamarin/monodroid#1145

We would like to eventually remove the dependency that xamarin/monodroid
has on xamarin/xamarin-android.  As a first step towards this effort,
shared MSBuild code is being moved to xamarin/xamarin-android-tools.

`Xamarin.Android.Build.Tasks` has been updated to use the new shared
`Microsoft.Android.Build.BaseTasks` sources.  All of the files that were
moved to xamarin/xamarin-android-tools have been deleted.

The inverted monodroid build has been replaced with the new monodroid
build system, see xamarin/monodroid#1145 for
more context.  The one build task test that was still being ran from the
xamarin/monodroid repo has been moved into `DebuggingTasksTests.cs`,
which is conditionally included in `Xamarin.Android.Build.Tests`.

Tests associated with the build task source that was moved to
xamarin/xamarin-android-tools have also been moved to a new 
`Microsoft.Android.Build.BaseTasks-Tests` assembly in that repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants