Skip to content

[WIP] Add proper versioning of MonoAndroid framework. - #2427

Merged
forki merged 6 commits into
fsprojects:masterfrom
dmunch:dmunch-monoandroid-versioning
Jun 19, 2017
Merged

forki merged 6 commits into
fsprojects:masterfrom
dmunch:dmunch-monoandroid-versioning

Conversation

@dmunch

@dmunch dmunch commented Jun 16, 2017

Copy link
Copy Markdown
Contributor

So far no versioning for the MonoAndroid framework has been handled. However, I've been running into the case of different version constraints on transitive dependencies depending on the MonoAndroid framework version. As an example (and actually the concrete case I'm running into) take the nuspec of Xamarin.Forms.

      <group targetFramework="MonoAndroid1.0">
        <dependency id="Xamarin.Android.Support.v4" version="[23.3.0]" />
        <dependency id="Xamarin.Android.Support.Design" version="[23.3.0]" />
        <dependency id="Xamarin.Android.Support.v7.AppCompat" version="[23.3.0]" />
        <dependency id="Xamarin.Android.Support.v7.CardView" version="[23.3.0]" />
        <dependency id="Xamarin.Android.Support.v7.MediaRouter" version="[23.3.0]" />
      </group>
      <group targetFramework="MonoAndroid7.0">
        <dependency id="Xamarin.Android.Support.v4" version="23.3.0" />
        <dependency id="Xamarin.Android.Support.Design" version="23.3.0" />
        <dependency id="Xamarin.Android.Support.v7.AppCompat" version="23.3.0" />
        <dependency id="Xamarin.Android.Support.v7.CardView" version="23.3.0" />
        <dependency id="Xamarin.Android.Support.v7.MediaRouter" version="23.3.0" />
      </group>

In my case I'd like to update the Xamarin.Android.* packages to a higher version. As a first step, and what worked pretty good and straight forward so far, I implemented proper versioning of the MonoAndroid framework. This is what this PR currently contains.

However, even with the proper MonoAndroid framework version handling paket still is not able to resolve the following paket.dependencies file.

framework: monoandroid70

source https://nuget.org/api/v2

nuget Xamarin.Forms == 2.3.4.247

nuget Xamarin.Android.Support.v4 == 25.3.1
nuget Xamarin.Android.Support.v7.RecyclerView == 25.3.1
nuget Xamarin.Android.Support.Design == 25.3.1
nuget Xamarin.Android.Support.v7.CardView == 25.3.1

From what I understood by reading the latest pull requests is that this involves framework restriction handling and has been refactored quite a lot in the last months.

I'm currently wondering if this kind of behavior is actually possible, and if so, at which part of the code I'd have to look to be able to understand its mechanism and maybe come up with a possible solution. Any hint and help is much appreciated!

Thanks a lot in advance, also for all the past work on paket which really is a joy to use!

@dmunch
dmunch force-pushed the dmunch-monoandroid-versioning branch from f486669 to df0e468 Compare June 16, 2017 09:00
@matthid

matthid commented Jun 16, 2017

Copy link
Copy Markdown
Member

Let me take a look :)

@dmunch

dmunch commented Jun 16, 2017

Copy link
Copy Markdown
Contributor Author

Wait a second, I might have forgotten to bump NuGetPackageCache.CurrentCacheVersion at some point. I just retried with the rebased version on 5.0.0-rc011 and the mentioned example is resolved fine now.

@matthid

matthid commented Jun 16, 2017

Copy link
Copy Markdown
Member

sounds good. btw there is a switch in the test suite to update all tests. so you don't have to update manually. can't link right now as i'm on mobile... just keep an eye on the diff if the changes are sane

@matthid

matthid commented Jun 16, 2017

Copy link
Copy Markdown
Member

@dmunch

dmunch commented Jun 16, 2017

Copy link
Copy Markdown
Contributor Author

Thanks for the hint! I wont be able to touch this during the week-end, but I should have updated test-cases and final modifications ready during next week. I've aleady been using paket with those modifications in our solution with the desired results, so I think I'm on the right way here.

@dmunch
dmunch force-pushed the dmunch-monoandroid-versioning branch from df0e468 to 9ee9837 Compare June 19, 2017 12:52
@dmunch

dmunch commented Jun 19, 2017

Copy link
Copy Markdown
Contributor Author

Ok so from my side this is considered done, not sure why the Travis pipeline fails, is there some flakyness on mono?

@matthid matthid left a comment

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.

Looks very good! If the 4.03 is not a bug (because the mabuild condition should be correct) then it lgtm

match this with
| MonoAndroidVersion.V1 -> ""
| MonoAndroidVersion.V22 -> "2.2"
| MonoAndroidVersion.V23 -> "2.3"

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.

really? not 4.0.3?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, considering the offical list of Xamarin.Android releases it's certainly 4.0.3 and my Xamarin Studio also gives this in the list of available target frameworks. Will fix that.

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Compared to the XS screenshot there's also some Versions still missing. Not sure if we should add them, or just keep waiting until people complain or need them. The thing is I just took the versions paket already recognized which where based on real-world versions I found during my usage of paket on Xamarin projects. Any thoughts?

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.

please add them if you already see these

| MonoAndroid MonoAndroidVersion.V5 -> [ MonoAndroid MonoAndroidVersion.V44 ]
| MonoAndroid MonoAndroidVersion.V6 -> [ MonoAndroid MonoAndroidVersion.V5 ]
| MonoAndroid MonoAndroidVersion.V7-> [ MonoAndroid MonoAndroidVersion.V6; DotNetStandard DotNetStandardVersion.V1_6 ]
| MonoAndroid MonoAndroidVersion.V71-> [ MonoAndroid MonoAndroidVersion.V7 ]

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.

some whitespace (not important)

</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v2.2' Or $(TargetFrameworkVersion) == 'v2.3' Or $(TargetFrameworkVersion) == 'v4.03' Or $(TargetFrameworkVersion) == 'v4.1' Or $(TargetFrameworkVersion) == 'v4.3' Or $(TargetFrameworkVersion) == 'v4.4' Or $(TargetFrameworkVersion) == 'v5.0' Or $(TargetFrameworkVersion) == 'v6.0' Or $(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">

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.

again the 4.03 makes ma bit nervous here

@matthid

matthid commented Jun 19, 2017

Copy link
Copy Markdown
Member

Travis looks like another failure i've not seen jet...

@forki
forki merged commit dbcb318 into fsprojects:master Jun 19, 2017
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.

3 participants