-
Notifications
You must be signed in to change notification settings - Fork 27
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
Consolidate mappings for all known Android versions, code names, and API levels #140
Comments
The reason it's in xamarin-android-tools is because androidtools also needs the data, plus various other dependencies. We thus want xamarin-android to be the "source of truth", but don't want it to provide the API for the source of truth. (Which is kinda how it works now: xamarin-android creates the But wait, it gets different/worse! Part of the intent behind the use of As originally conceived, there would be one The problem is that in our forthcoming .NET 6+ world order, there is only "one" We thus need a "re-conception" of how this should work, ideally in a manner which preserves the current system's "dynamism" (which we're gonna need in ~4-6 months once API-32 previews are available…). A |
The changes to only ship one (or one stable, one preview) I think it would be preferable not to continue to have to update both of these files whenever a new version comes along? |
Is it preferable? Paraphrasing, I believe your argument is that it is "bad" to have two different "sources of truth":
I disagree that this is "bad". "Not ideal", perhaps, but explicitly not "bad". The scenario is one of "what needs to be done for the IDE to know about a new version?" Prior to aad97f1, the effective answer was "update xamarin/androidtools and then bump 'everything' which depends on that data." It made for a miserable experience. Now we're "file based"; updating the IDE "simply" requires ensuring that the appropriate So now we have a concern of historical data. However, current data is "historical" data. To my mind, it has the same concerns. Thus, I think "duplication" is preferable to the previous machinations. It's useful for Which is the problem with Thus, the question: do we actually want "consolidation"? I'm not currently convinced that we do. What we want, and kinda have, is an API which merges information from multiple sources. The If we need "historical data", then we need to determine what we need regarding historical data, which is not Do we need access to "CodeName"? partial class AndroidVersions {
public string? GetCodeNameFromId (string id);
} |
The duplication that I think is "bad" and would like to try to avoid is the duplication between what's in the Second to that is the historical data question, and what information callers need access to. I think we need to be able to reason about Android Version information for the versions that XA does not ship, and for all of those versions we need to be able to compare / convert between all of the version "representations" (e.g API Level <-> OS Version <-> Code Name). |
What is the harm in the duplication? The benefit is that when we need to add support for API-T next spring, we won't need a xamarin-android-tools bump in xamarin-android in order to provision the API-T files. (Not needing a submodule bump for PR builds of preview features is a benefit!) Quasi-related, I'm not sure why We should expect there to be occasional differences between the table in xamarin-android and |
The harm I see is that historically we forget to update |
I opened dotnet/android#6419 and #141 for now. I think we can keep this open to try to track effort to make KnownVersions private again. |
Might also be handy if the consolidated version info also could contain the highest supported NDK version. |
Xamarin.Android is currently responsible for generating and installing
AndroidApiInfo.xml
files alongsideMono.Android.dll
to help provide a full mapping of Android version information. For reference, these files look like this:While these files are great at providing context around the Android versions that a current installation of Xamarin.Android supports, they do not provide a full story with respect to all known Android versions. As a fall back, we have this hardcoded mapping:
https://github.com/xamarin/xamarin-android-tools/blob/f2af06f2a2c1966011b6b04a113560de37041cbc/src/Xamarin.Android.Tools.AndroidSdk/AndroidVersions.cs#L142
However we often forget to update this list, and it is duplicated in:
https://github.com/xamarin/xamarin-android/blob/f361d997807504a69c29163811f362da701410b6/build-tools/xaprepare/xaprepare/ConfigAndData/BuildAndroidPlatforms.cs#L11
I can see a couple of options to improve this:
Xamarin.Android.Tools.AndroidVersions.KnownVersions
.The text was updated successfully, but these errors were encountered: