Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Conversation

@moljac
Copy link
Contributor

@moljac moljac commented Jul 11, 2022

Does this change any of the generated binding API's?

Should not.

Describe your contribution

Fixes #652

by changing MsBuild BuildAction from LibraryProjectZip to AndroidLibrary.

@moljac
Copy link
Contributor Author

moljac commented Jul 13, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@moljac moljac requested a review from jpobst July 13, 2022 13:39
Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

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

Looking at the NuGets generated by this PR, it does not seem like the libraries have been added:

image

My guess is that this repo is using too old of a .NET 6 Android workload (Preview 9).

We will likely need to port over these two PRs from AndroidX:

Additionally we should probably update to the RTM workloads. We'll need to talk to @jonathanpeppers to see what the "correct" way to do this is.

I think we also probably do not want to use <AndroidLibrary> for GooglePlayServicesProject.cshtml or any other template that uses XBD, as the .aar should not be included in those NuGets.

In fact, looking at a random GPS package on NuGet, it is embedding the .aar into the classic XA binding, which we probably need to fix:

image

@moljac
Copy link
Contributor Author

moljac commented Jul 13, 2022

We will likely need to port over these two PRs from AndroidX:

OK. I will start porting those.

@moljac
Copy link
Contributor Author

moljac commented Jul 13, 2022

Additionally we should probably update to the RTM workloads. We'll need to talk to @jonathanpeppers to see what the "correct" way to do this is.

I think we also probably do not want to use <AndroidLibrary> for GooglePlayServicesProject.cshtml or any other template that uses XBD, as the .aar should not be included in those NuGets.

Couldn't we make both AX and GPS-FB-MLKit repo work the same?

Using Inputjar for MCWs and single *.jar/*.aar payload in nuget or XBD for payload.

Namely we have heterogenous repos with respect to licenses. AndroidX was almost pure Apache v2.0 and it is not anymore, while GPS-FB-MLKit has Apache v.2.0 for Firebase and some dependencies.

@jonathanpeppers
Copy link
Member

If the goal here is to fix #652, can we just add Pack="true" for now? And not change LibraryProjectZip to AndroidLibrary?

I'm not sure how well AndroidLibrary works in classic Xamarin.Android.

@jpobst
Copy link
Contributor

jpobst commented Jul 14, 2022

can we just add Pack="true" for now?

That seems fine, though we do have <AndroidLibrary> documented for Classic. 😁

https://docs.microsoft.com/en-us/xamarin/android/deploy-test/building-apps/build-items#androidlibrary

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

I was going to review the .nupkg files, but the PR build is gone:

image

@jonathanpeppers
Copy link
Member

Wait I see it now, must have looked at the wrong status.

@jonathanpeppers
Copy link
Member

As in @jpobst 's comment above: #655 (review)

Is there supposed to be an .aar file inside:

image

@moljac
Copy link
Contributor Author

moljac commented Jul 28, 2022

I thought this would resolve that w/o explicit Pack="true"

https://github.com/xamarin/GooglePlayServicesComponents/blob/fix-i652-20220711-androidlibrary-instead-of-libraryprojectzip/azure-pipelines.yaml#L11-L22

  AndroidBinderatorVersion: 0.5.4
  AndroidXMigrationVersion: 1.0.10
  BootsVersion: 1.1.0.712-preview2
  DotNetVersion: 6.0.300
  XcodeVersion: 13.3.1
  DotNet6Source: https://aka.ms/dotnet6/nuget/index.json
  NuGetOrgSource: https://api.nuget.org/v3/index.json
  XamarinDotNetWorkloadSource: workloads.json   # or url (check for recent versions - redth)
                                                # https://aka.ms/dotnet/maui/6.0.400.json
  # matching builds
  LegacyXamarinAndroidPkg:  https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/6454390/6.0.4xx/0b8d593a61bb49120fdf817e8dfdbc4b33937772/xamarin.android-12.3.99.117.pkg
  LegacyXamarinAndroidVsix: https://dl.internalx.com/vsts-devdiv/Xamarin.Android/public/6454390/6.0.4xx/0b8d593a61bb49120fdf817e8dfdbc4b33937772/Xamarin.Android.Sdk-12.3.99.117.vsix

@moljac
Copy link
Contributor Author

moljac commented Jul 28, 2022

csproj

<Project Sdk="Xamarin.Legacy.Sdk">
  <PropertyGroup>
    <TargetFrameworks>MonoAndroid12.0;net6.0-android31</TargetFrameworks>
    <IsBindingProject>true</IsBindingProject>
    <!--
      No warnings for:
       - CS0618: 'member' is obsolete: 'text'
       - CS0109: The member 'member' does not hide an inherited member. The new keyword is not required
       - CS0114: 'function1' hides inherited member 'function2'. To make the current method override that implementation, add the override keyword. Otherwise add the new keyword.
       - CS0628: 'member' : new protected member declared in sealed class
       - CS0108: 'member1' hides inherited member 'member2'. Use the new keyword if hiding was intended.
       - CS0809: Obsolete member 'member' overrides non-obsolete member 'member'
    -->
    <NoWarn>0618;0109;0114;0628;0108;0809</NoWarn>
  </PropertyGroup>

  <PropertyGroup>
    <AndroidClassParser>class-parse</AndroidClassParser>
    <AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
  </PropertyGroup>

  <PropertyGroup>
    <Authors>Microsoft</Authors>
    <Owners>Microsoft</Owners>
    <Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
    <PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=865435</PackageProjectUrl>
    <RepositoryUrl>https://go.microsoft.com/fwlink/?linkid=865435</RepositoryUrl>
    <RequireLicenceAcceptance>true</RequireLicenceAcceptance>
    <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
    <PackageLicenseExpression>MIT AND Apache-2.0</PackageLicenseExpression>

      <PackageId>Xamarin.Google.Android.DataTransport.TransportApi</PackageId>
      <RootNamespace>Xamarin.Google.Android.DataTransport.TransportApi</RootNamespace>
      <AssemblyName>Xamarin.Google.Android.DataTransport.TransportApi</AssemblyName>
      <Title>Xamarin.Google.Android.DataTransport.TransportApi</Title>
            <Title>Xamarin.Google.Android.DataTransport.TransportApi</Title>
            <PackageDescription>Bindings for Xamarin Google.Android.DataTransport.TransportApi package</PackageDescription>
            <Summary>Bindings for Xamarin Google.Android.DataTransport.TransportApi package</Summary>
            <RequireLicenceAcceptance>true</RequireLicenceAcceptance>
            <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
            <PackageTags>xamarin, android, bindings, google, datatransport, transport, api </PackageTags>
      <PackageVersion>3.0.0.5</PackageVersion>
  </PropertyGroup>

  <ItemGroup>
    <TransformFile Include="..\..\source\com.google.android.datatransport\transport-api\Transforms\*.xml" Link="Transforms\%(Filename)%(Extension)" />
  </ItemGroup>

  <ItemGroup>
    <Compile Include="..\..\source\com.google.android.datatransport\transport-api\Additions\*.cs" Link="Additions\%(Filename)%(Extension)" />
  </ItemGroup>

  <ItemGroup>
    <AndroidLibrary Include="..\..\externals\com.google.android.datatransport\transport-api.aar" />
    <!--
    <JavaDocJar Include="..\..\externals\com.google.android.datatransport\transport-api-javadoc.jar"/>
    -->
  </ItemGroup>
  
  <ItemGroup>
    <PackageReference Include="Xamarin.AndroidX.Annotation" Version="1.3.0.3" />
  </ItemGroup>

  <ItemGroup>
    <None Include="..\..\templates\datatransport\LICENSE.md" Pack="true" PackagePath="LICENSE.md" />
    <None Include="..\..\templates\datatransport\External-Dependency-Info.txt" Pack="true" PackagePath="THIRD-PARTY-NOTICES.txt" />
  </ItemGroup>

</Project>

@moljac
Copy link
Contributor Author

moljac commented Aug 1, 2022

nugets with different sizes:



[283K]  output/Square.Picasso.2.8.0.5.nupkg
[177K]  output/Square.Picasso.2.8.0.4.nupkg

[ 36K]  output/Xamarin.Google.Android.DataTransport.TransportApi.3.0.0.5.nupkg
[ 31K]  output/Xamarin.Google.Android.DataTransport.TransportApi.3.0.0.4.nupkg

[122K]  output/Xamarin.Google.Android.DataTransport.TransportBackendCct.3.1.4.2.nupkg
[ 88K]  output/Xamarin.Google.Android.DataTransport.TransportBackendCct.3.1.4.1.nupkg

[378K]  output/Xamarin.Google.Android.DataTransport.TransportRuntime.3.1.4.2.nupkg
[269K]  output/Xamarin.Google.Android.DataTransport.TransportRuntime.3.1.4.1.nupkg

[222K]  output/Xamarin.Google.UserMessagingPlatform.2.0.0.2.nupkg
[131K]  output/Xamarin.Google.UserMessagingPlatform.2.0.0.1.nupkg

[ 10M]  output/Xamarin.TensorFlow.Lite.2.6.0.2.nupkg
[5.1M]  output/Xamarin.TensorFlow.Lite.2.6.0.1.nupkg

[9.1M]  output/Xamarin.TensorFlow.Lite.Gpu.2.6.0.2.nupkg
[4.5M]  output/Xamarin.TensorFlow.Lite.Gpu.2.6.0.1.nupkg

@moljac
Copy link
Contributor Author

moljac commented Aug 1, 2022

Archive:  output/Square.Picasso.2.8.0.4.nupkg
Zip file size: 181619 bytes, number of entries: 10
?---------  2.0 unx      504 b- defN 22-Aug-01 07:26 _rels/.rels
?---------  2.0 unx     2386 b- defN 22-Aug-01 07:26 Square.Picasso.nuspec
?---------  2.0 unx   226816 b- defN 22-Aug-01 04:59 lib/monoandroid12.0/Square.Picasso.dll
?---------  2.0 unx      131 b- defN 22-Aug-01 04:59 lib/monoandroid12.0/Square.Picasso.xml
?---------  2.0 unx   117760 b- defN 22-Aug-01 05:02 lib/net6.0-android31.0/Square.Picasso.dll
?---------  2.0 unx      131 b- defN 22-Aug-01 05:02 lib/net6.0-android31.0/Square.Picasso.xml
?---------  2.0 unx     1523 b- defN 21-Dec-14 12:32 LICENSE.md
?---------  2.0 unx    11885 b- defN 21-Dec-14 12:32 THIRD-PARTY-NOTICES.txt
?---------  2.0 unx      644 b- defN 22-Aug-01 07:26 [Content_Types].xml
?---------  2.0 unx      696 b- defN 22-Aug-01 07:26 package/services/metadata/core-properties/0726afee6f644cedbba7e1c274ebbd36.psmdcp
10 files, 362476 bytes uncompressed, 180191 bytes compressed:  50.3%
Archive:  output/Square.Picasso.2.8.0.5.nupkg
Zip file size: 290163 bytes, number of entries: 11
?---------  2.0 unx      504 b- defN 22-Aug-01 14:07 _rels/.rels
?---------  2.0 unx     2386 b- defN 22-Aug-01 14:07 Square.Picasso.nuspec
?---------  2.0 unx   227328 b- defN 22-Aug-01 12:00 lib/monoandroid12.0/Square.Picasso.dll
?---------  2.0 unx      131 b- defN 22-Aug-01 12:00 lib/monoandroid12.0/Square.Picasso.xml
?---------  2.0 unx   117760 b- defN 22-Aug-01 11:59 lib/net6.0-android31.0/Square.Picasso.dll
?---------  2.0 unx      131 b- defN 22-Aug-01 11:59 lib/net6.0-android31.0/Square.Picasso.xml
?---------  2.0 unx   108339 b- defN 22-Aug-01 11:53 lib/net6.0-android31.0/picasso.aar
?---------  2.0 unx     1523 b- defN 21-Dec-14 12:32 LICENSE.md
?---------  2.0 unx    11885 b- defN 21-Dec-14 12:32 THIRD-PARTY-NOTICES.txt
?---------  2.0 unx      706 b- defN 22-Aug-01 14:07 [Content_Types].xml
?---------  2.0 unx      696 b- defN 22-Aug-01 14:07 package/services/metadata/core-properties/48bb54b1edbe4c1fbbd750fa18ed7f34.psmdcp
11 files, 471389 bytes uncompressed, 288591 bytes compressed:  38.8%

@moljac moljac merged commit 9705a01 into main Aug 3, 2022
@moljac moljac deleted the fix-i652-20220711-androidlibrary-instead-of-libraryprojectzip branch August 3, 2022 14:02
@moljac
Copy link
Contributor Author

moljac commented Aug 10, 2022

zipinfo $HOME/Downloads/Square.Picasso.2.8.0.5.nupkg 
Archive:  /Users/moljac/Downloads/Square.Picasso.2.8.0.5.nupkg
Zip file size: 313638 bytes, number of entries: 12
-rw----     2.0 fat      508 b- defN 22-Aug-10 10:09 _rels/.rels
-rw----     2.0 fat     2540 b- defN 22-Aug-10 10:09 Square.Picasso.nuspec
-rw----     2.0 fat   108339 b- defN 22-Aug-10 07:55 lib/net6.0-android31.0/picasso.aar
-rw----     2.0 fat   127912 b- defN 22-Aug-10 10:06 lib/net6.0-android31.0/Square.Picasso.dll
-rw----     2.0 fat      131 b- defN 22-Aug-10 08:25 lib/net6.0-android31.0/Square.Picasso.xml
-rw----     2.0 fat     1523 b- defN 22-Aug-10 07:48 LICENSE.md
-rw----     2.0 fat    11885 b- defN 22-Aug-10 07:48 THIRD-PARTY-NOTICES.txt
-rw----     2.0 fat   236976 b- defN 22-Aug-10 10:06 lib/monoandroid12.0/Square.Picasso.dll
-rw----     2.0 fat      131 b- defN 22-Aug-10 08:08 lib/monoandroid12.0/Square.Picasso.xml
-rw----     2.0 fat      716 b- defN 22-Aug-10 10:09 [Content_Types].xml
-rw----     2.0 fat      741 b- defN 22-Aug-10 10:09 package/services/metadata/core-properties/f4b37ad214c6438386c4cfdec69ff01a.psmdcp
-rw----     2.0 fat     9354 b- stor 22-Aug-10 03:12 .signature.p7s
12 files, 500756 bytes uncompressed, 311962 bytes compressed:  37.7%
zipinfo $HOME/Downloads/Xamarin.Google.Android.DataTransport.TransportApi.3.0.0.5.nupkg 
Archive:  /Users/moljac/Downloads/Xamarin.Google.Android.DataTransport.TransportApi.3.0.0.5.nupkg
Zip file size: 60683 bytes, number of entries: 12
-rw----     2.0 fat      543 b- defN 22-Aug-10 10:10 _rels/.rels
-rw----     2.0 fat     2262 b- defN 22-Aug-10 10:10 Xamarin.Google.Android.DataTransport.TransportApi.nuspec
-rw----     2.0 fat     1606 b- defN 22-Aug-10 07:48 LICENSE.md
-rw----     2.0 fat    12092 b- defN 22-Aug-10 07:48 THIRD-PARTY-NOTICES.txt
-rw----     2.0 fat    47024 b- defN 22-Aug-10 10:06 lib/monoandroid12.0/Xamarin.Google.Android.DataTransport.TransportApi.dll
-rw----     2.0 fat      166 b- defN 22-Aug-10 08:03 lib/monoandroid12.0/Xamarin.Google.Android.DataTransport.TransportApi.xml
-rw----     2.0 fat     4898 b- defN 22-Aug-10 07:54 lib/net6.0-android31.0/transport-api.aar
-rw----     2.0 fat    40360 b- defN 22-Aug-10 10:06 lib/net6.0-android31.0/Xamarin.Google.Android.DataTransport.TransportApi.dll
-rw----     2.0 fat      166 b- defN 22-Aug-10 07:59 lib/net6.0-android31.0/Xamarin.Google.Android.DataTransport.TransportApi.xml
-rw----     2.0 fat      716 b- defN 22-Aug-10 10:10 [Content_Types].xml
-rw----     2.0 fat      810 b- defN 22-Aug-10 10:10 package/services/metadata/core-properties/13a9f77d9ccf44a4b5cc68908f3b3c1a.psmdcp
-rw----     2.0 fat     9355 b- stor 22-Aug-10 03:12 .signature.p7s
12 files, 119998 bytes uncompressed, 58645 bytes compressed:  51.1%
zipinfo $HOME/Downloads/Xamarin.Google.ErrorProne.Annotations.2.10.0.2.nupkg 
Archive:  /Users/moljac/Downloads/Xamarin.Google.ErrorProne.Annotations.2.10.0.2.nupkg
Zip file size: 93519 bytes, number of entries: 12
-rw----     2.0 fat      531 b- defN 22-Aug-10 10:10 _rels/.rels
-rw----     2.0 fat     2055 b- defN 22-Aug-10 10:10 Xamarin.Google.ErrorProne.Annotations.nuspec
-rw----     2.0 fat    12106 b- defN 22-Aug-10 07:48 THIRD-PARTY-NOTICES.txt
-rw----     2.0 fat    99760 b- defN 22-Aug-10 10:06 lib/monoandroid12.0/Xamarin.Google.ErrorProne.Annotations.dll
-rw----     2.0 fat      154 b- defN 22-Aug-10 08:01 lib/monoandroid12.0/Xamarin.Google.ErrorProne.Annotations.xml
-rw----     2.0 fat    10803 b- defN 22-Aug-10 08:08 lib/net6.0-android31.0/Xamarin.Google.ErrorProne.Annotations.aar
-rw----     2.0 fat    83872 b- defN 22-Aug-10 10:06 lib/net6.0-android31.0/Xamarin.Google.ErrorProne.Annotations.dll
-rw----     2.0 fat      154 b- defN 22-Aug-10 08:08 lib/net6.0-android31.0/Xamarin.Google.ErrorProne.Annotations.xml
-rw----     2.0 fat     1089 b- defN 22-Aug-10 07:48 LICENSE.md
-rw----     2.0 fat      716 b- defN 22-Aug-10 10:10 [Content_Types].xml
-rw----     2.0 fat      845 b- defN 22-Aug-10 10:10 package/services/metadata/core-properties/9970ef88f2954a6dadbe341d386c666a.psmdcp
-rw----     2.0 fat     9355 b- stor 22-Aug-10 03:12 .signature.p7s
12 files, 221440 bytes uncompressed, 91553 bytes compressed:  58.7%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix templates that use <LibraryProjectZip>

4 participants