-
Notifications
You must be signed in to change notification settings - Fork 63
Fix issue 439 reqiured api 31 #453
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks close, we're going to need to update this, or else the .targets files end up in monoandroid90 in the NuGet and won't be found:
Because these locations are shared among all templates in this repo, I think we'll also have to update all the templates that use .targets files (Kotlin/KotlinX) to be MonoAndroid12.0. Or else we'll be putting their .targets files in /monoandroid12.0 when they are still expecting 9.0.
templates/auto-value/Targets.cshtml
Outdated
|
|
||
| <ItemGroup> | ||
| @foreach (var art in @Model.MavenArtifacts) { | ||
| <AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anywhere you use @(AndroidJavaLibrary) make sure you check $(AndroidApplication) like we do here:
Otherwise developers' class libraries will "redistribute" this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. Working on that and not all artifacts in template sets are jars!!!! (BuildActions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here:
https://github.com/xamarin/AndroidX/blob/f97553ff428f9b6ea754f173567d220048245a16/source/AndroidXTargets.cshtml#L47-L53
*.aar wil not be redistributed? Or do libraries remove *.aars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpobst You added kotlin and kotlinx tamplate sets and they have @(AndroidJavaLibrary). Should I (can I) fix that too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@(AndroidAarLibrary) is fine because it doesn't do anything in a class library. I would fix @(AndroidJavaLibrary) to check for $(AndroidApplication) if you find it in other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpobst You added kotlin and kotlinx tamplate sets and they have @(AndroidJavaLibrary). Should I (can I) fix that too?
Yes, looks like those use <InputJar> and package a loose .jar, so they should be updated.
templates/gson/Targets.cshtml
Outdated
|
|
||
| <ItemGroup> | ||
| @foreach (var art in @Model.MavenArtifacts) { | ||
| <AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check $(AndroidApplication).
There was a problem hiding this comment.
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 why we are adding these Targets.cshtml files in the first place. My understanding is we do not need them because these packages are using <EmbeddedJar>. We are not including the loose .jar file in the NuGet, so these Includes point to a file that doesn't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kotlin - InputJar
kotlinx - InputJar also
other template sets are EmbeddedJar.
Should I make them InputJar and maybe we could share artifact and make nuget smaller?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise it would be embedded twice... Or am I wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should focus this PR on fixing #439, and if there are additional unrelated changes we want to make we can handle them in separate PRs.
|
|
||
| <ItemGroup> | ||
| @foreach (var art in @Model.MavenArtifacts) { | ||
| <AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another check for $(AndroidApplication).
templates/rxjava/Targets.cshtml
Outdated
|
|
||
| <ItemGroup> | ||
| @foreach (var art in @Model.MavenArtifacts) { | ||
| <AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another check for $(AndroidApplication).
templates/tink/Targets.cshtml
Outdated
|
|
||
| <ItemGroup> | ||
| @foreach (var art in @Model.MavenArtifacts) { | ||
| <AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenArtifactId)-@(art.MavenArtifactVersion).jar" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another check for $(AndroidApplication).
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Note: reported as removed, but available in the API: |
jpobst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still need to do this:
Looks close, we're going to need to update this, or else the .targets files end up in monoandroid90 in the NuGet and won't be found:
Because these locations are shared among all templates in this repo, I think we'll also have to update all the templates that use .targets files (Kotlin/KotlinX) to be MonoAndroid12.0. Or else we'll be putting their .targets files in /monoandroid12.0 when they are still expecting 9.0.
source/AndroidXProject.cshtml
Outdated
| <PropertyGroup> | ||
| <TargetFrameworks>MonoAndroid9.0;net6.0-android</TargetFrameworks> | ||
| <TargetFrameworks>MonoAndroid12.0;net6.0-android</TargetFrameworks> | ||
| <AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is <AndroidUseLatestPlatformSdk> needed?
Apparently it is deprecated and should not be used anymore:
https://github.com/xamarin/xamarin-forms-samples/issues/364
Does this change any of the generated binding API's?
yes. Downgraded versions to republish nuget packages.
Describe your contribution
Fix for #444