Граф коммитов

710 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Pobst c9fd36fa1c
Alignment bump for full AndroidX+GPS packages. (#966) 2024-09-14 07:57:41 -10:00
Jonathan Pobst 8d465e83de
Move remaining GPS packages to AndroidX repository. (#955)
"Pause" migrating everything to a common template, and pivot to moving the remaining packages from the GPS repository to the AndroidX repository.  This should enable us to eliminate the circular dependencies between the two repositories which should help fix the majority of the https://github.com/xamarin/AndroidX/issues/764 issues going forward.

Bring in the GPS and Glide templates as new "templateSet", and merge in all the build infrastructure pieces that the GPS repository had to make it build correctly.
2024-09-13 07:22:56 -10:00
moljac c7b75f6cc5 nuget id fix 2024-09-07 17:35:20 +02:00
moljac 8dffcae4bc binderator green 2024-09-07 13:59:25 +02:00
Jonathan Pobst 558552190f
Move second batch of GPS package-specific templates to AndroidX default template. (#950)
Move the packages in GPS that use the following package-specific templates to this repository and switch them to using the default template:

- brotli
- chromium-cronet
- codehaus-mojo
- datatransport
- flatbuffers
- grpc
- opencensus
- perfmark
- protobuf-lite
- squareup-okhttp
- squareup-okhttp3
- squareup-picasso
- squareup-retrofit
- squareup-retrofit2
- squareup-okio
- squareup-javapoet
- tensorflow-lite
- user-messaging-platform
- zxing

One wrinkle is that AndroidX does not allow a stable package to depend on a prerelease package:

```xml
<!-- Warnings we want to error on: -->
<!-- NU5104: A stable release of a package should not have a prerelease dependency. -->
<WarningsAsErrors>$(WarningsAsErrors);NU5104</WarningsAsErrors>
```

Although we should always abide by this rule, we are bound by Google's packaging decisions and sometimes we have no choice.  The `Xamarin.TensorFlow.Lite.Support.Api` and `Xamarin.TensorFlow.Lite.Task.Vision.PlayServices.Library` packages we are moving from GPS have a prerelease dependency. (GPS repository does not enforce this rule.)

In order to keep this rule globally, but allow packages to opt out of it, add the `allowPrereleaseDependencies` artifact-level field to `config.json`:

```json
{
    "groupId": "org.tensorflow",
    "artifactId": "tensorflow-lite-task-vision-play-services",
    "version": "0.4.4",
    "nugetVersion": "0.4.4.6",
    "nugetId": "Xamarin.TensorFlow.Lite.Task.Vision.PlayServices.Library",
    "allowPrereleaseDependencies": true,
    "comments": "Depends on Xamarin.Google.Android.ODML.Image which only has a prerelease version.",
    ...
}
```

Companion PR that removes these packages from GPS: https://github.com/xamarin/GooglePlayServicesComponents/pull/906
2024-09-05 08:33:33 -10:00
Jonathan Pobst e12f2f02bd
Move first batch of GPS package-specific templates to AndroidX default template. (#947)
Move the packages in GPS that use the following package-specific templates to this repository and switch them to using the default template:

- annotations
- aopalliance
- dagger
- errorprone
- findbugs
- inject-guice
- jakarta
- javax-inject
- ow2-asm

Companion PR that removes them from GPS: https://github.com/xamarin/GooglePlayServicesComponents/pull/905
2024-09-04 07:15:13 -10:00
moljac 3d5b653004
Merge branch 'main' into mu-20240820 2024-08-30 14:16:24 +02:00
moljac 3fa14f0e8d final fix 2024-08-30 14:08:06 +02:00
moljac cb994487bf binderagtor green 2024-08-28 12:29:36 +02:00
moljac 6838af43e2 binderator green 2024-08-27 09:03:22 +02:00
Jonathan Pobst d126bba06d
Track latest versions of GPS dependencies. (#946) 2024-08-23 07:09:39 -10:00
Jonathan Pobst ac1f49730b
Remove some package-specific templates. (#943)
Remove the following package-specific templates in favor of using the default template:

- accompanist
- antmedia-rtpm-client
- auto-value
- dev-chrisbanes-snapper
- flogger
- napier
- reactive-streams
- rxjava
- tink

Additionally, the `Xamarin.Android.ReactiveX.RxJava` NuGet package was relying on a `<JavaSourceJar>` for some parameter names.  

Add the artifact-level `documentationType` field to `config.json` that can be specified if a `<JavaSourceJar>` or `<JavaDocJar>` is needed.  The default value is `none`, the values `javasource` and `javadoc` are supported.
2024-08-22 19:10:43 -10:00
Jonathan Pobst a9594744db
[binderator] Add binding type and use it to remove 'gson' template. (#941)
Some of the final pieces needed to start removing package-specific templates:

- We use the top level `mavenRepositoryType` to default all packages to Google's Maven, and then use the templates to override this to `MavenCentral`. Without templates we will need to specify this directly on the artifact, so add support for an artifact level `mavenRepositoryType`.

- We have several different "types" of packages that we create today:
  - `EmbeddedJar` - Basic use of `<EmbeddedJar>` to include the Java payload in the NuGet package next to the managed bindings `.dll`. (This is equivalent to the preferred `<AndroidLibrary>` in .NET 6+.)
  - `Targets` - Uses `<InputJar>` to create the binding `.dll` and `<None>` to add the Java payload manually into the NuGet package and uses a `.targets` file to add it to the Android application.
  - `NoBindings` - Uses `<None>` to add the Java payload manually into the NuGet package and uses a `.targets` file to add it to the Android application. Does not create managed bindings.
  - `XBD` - Uses `<InputJar>` to create the binding `.dll`. The Java payload is not included in the NuGet package. Instead a `.targets` file is used to download the payload at compile time using `Xamarin.Build.Download`.

The default package type is `targets`, which is what the current default template uses. That is, this is the one that all AndroidX packages currently use.

To specify a different package type, we add a new artifact level `type` attribute. The only currently supported value for this is `androidlibrary` which provides the `EmbeddedJar` package type behavior.

As a proof of concept, migrate `GoogleGson` from the `gson` template to the default template.

### Results
Before:
```json
{
  "groupId": "com.google.code.gson",
  "artifactId": "gson",
  "version": "2.11.0",
  "nugetVersion": "2.11.0.1",
  "nugetId": "GoogleGson",
  "dependencyOnly": false,
  "templateSet": "gson"
}
```
![image](https://github.com/user-attachments/assets/968d3251-52fc-449f-a629-f28c86b44321)

After:
```json
{
  "groupId": "com.google.code.gson",
  "artifactId": "gson",
  "version": "2.11.0",
  "nugetVersion": "2.11.0.1",
  "nugetId": "GoogleGson",
  "dependencyOnly": false,
  "type": "androidlibrary",
  "mavenRepositoryType": "MavenCentral"
}
```
![image](https://github.com/user-attachments/assets/97bed63c-10c3-4827-992c-669f153f8c12)
2024-08-22 08:36:57 -10:00
moljac 0404d81f34
Merge branch 'main' into wsu-20240806 2024-08-18 10:42:05 +02:00
Jonathan Pobst c894fc35d8
[binderator] Generate 'THIRD-PARTY-NOTICES' from POM information. (#937)
Instead of manually maintaining licensing information for packages, pull the license information from the package's POM file.  This information looks like:

```xml
<licenses>
  <license>
    <name>The Apache Software License, Version 2.0</name>
    <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    <distribution>repo</distribution>
  </license>
</licenses>
```

We need to be able to "understand" this license and properties about it, like its SPDX identifier and whether it is proprietary or not.  To do this, we match the license name to a new section in `config.json`:

```json
"licenses": [
  {
    "name": "The Apache Software License, Version 2.0",
    "file": "templates/licenses/apache-2.0.txt",
    "spdx": "Apache-2.0",
    "proprietary": false
  }, ...
]
```

Note there may be multiple entries for the "same" license, as different POM files may give it a slightly different name.

These license entries also point to a local copy of the license text that we can use to build `THIRD-PARTY-NOTICES.txt` when `binderator` runs.

Modify the project template to include the generated `THIRD-PARTY-NOTICES.txt` which contains the correct notices for each package rather than the generic repo `External-Dependency-Info.txt` which was not correct for packages not licensed under Apache-2.0.

Finally, if the package is open source and all its license(s) have valid SPDX identifiers, calculate the compound SPDX expression and apply it to the package with `<PackageLicenseExpression>`. If not, use `<PackageLicenseFile>` instead.  (SPDX doesn't allow a "proprietary" identifier.)

Note in some cases we may not be able to automatically pull license information from the POM. In these cases we can override the POM information with a new `overrideLicenses` entry on an artifact in `config.json`:

```json
"overrideLicenses": [
  "Apache 2.0|http://www.apache.org/licenses/LICENSE-2.0.txt"
],
```

The format is `{license name}|{license url}`.
2024-08-16 07:45:06 -10:00
moljac 1fcce16a40 binderator green 2024-08-13 20:17:46 +02:00
Jonathan Pobst 0b5c7f00bc
Package README tweaks. (#928)
There is some interesting content available in a Java `.pom` file that we can add to our package readme files:
- Developer(s)
- License(s)
- Description
- Project URL

Add this information, apply some formatting, and remove some less useful information that clutters the readme.  Mockup of the new layout on nuget.org:

![image](https://github.com/user-attachments/assets/336a2662-0076-4c12-87c0-20bc6d91ebed)

Other changes:
- `binderator` changes were required to pull in the new fields.  Switch to the in-tree version of `binderator` instead of publishing a new `dotnet tool` version.
- Our existing `readme.md` [doesn't work on nuget.org](https://www.nuget.org/packages/Xamarin.AndroidX.Core#readme-body-tab) because we are missing the `$(PackageReadmeFile)` property. Fix this.
- This `readme.md` is intentionally generic enough to be usable by all of our packages. Remove individual template copies.
2024-08-04 17:39:33 -10:00
moljac 141a1685c4
Merge branch 'main' into mu-20230329-androidx.media.players 2024-07-29 23:52:15 +02:00
moljac e2579e2a93 media2 added back to build 2024-07-29 23:22:39 +02:00
moljac 15832d2af3 updates 2024-07-25 11:14:13 +02:00
moljac fa9ba21e49 media2 removed 2024-07-19 14:47:39 +02:00
moljac 136d29e966
Merge branch 'main' into mu-20230329-androidx.media.players 2024-07-13 14:33:07 +02:00
moljac f07b8427b0 Update config.json 2024-07-12 16:18:44 +02:00
moljac cb998e373b
Merge branch 'main' into mu-20230329-androidx.media.players 2024-07-08 18:09:31 +02:00
moljac 742f88a8b0 Update config.json 2024-07-06 17:39:42 +02:00
moljac 393a3a859d
Merge branch 'main' into mu-20230329-androidx.media.players 2024-07-05 07:52:30 +02:00
moljac da8659912d removed problematic artifacts 2024-07-05 07:49:09 +02:00
Jonathan Pobst 0d9339b4e8
Ignore `nuget-diff` error for now. (#917)
Context: https://github.com/xamarin/AndroidX/issues/916

`api-diff` currently fails for `Xamarin.AndroidX.Car.App.App` `1.4.0` which is preventing us from updating it.  The nature of this crash is documented in https://github.com/xamarin/AndroidX/issues/916.

We have chosen not to spend the resources at this time to fix this tooling error.  Instead, we are going to go ahead and update `Xamarin.AndroidX.Car.App.App` to version `1.4.0` and are going to exclude it from running `api-diff`.
2024-07-03 14:09:53 -05:00
moljac 4daba3f53d
Merge branch 'main' into mu-20230329-androidx.media.players 2024-07-02 16:22:40 +02:00
moljac c1a00f4bd8 downgraded Xamarin.AndroidX.Car.App.App 2024-06-30 22:58:19 +02:00
moljac 7a31fc01bd
Merge branch 'main' into wsu-20240627 2024-06-30 22:18:24 +02:00
moljac f881dbdfa2 binderator green 2024-06-30 22:17:39 +02:00
moljac e9cd29d06e
Merge branch 'main' into mu-20230329-androidx.media.players 2024-06-30 22:15:12 +02:00
Jonathan Pobst 8ebc702cfc
Fix duplicate DataStore.Core.[Android|Jvm] code. (#906)
Fixes: https://github.com/xamarin/GooglePlayServicesComponents/issues/880

If you try to consume the package `Xamarin.AndroidX.DataStore.Preferences`, you get the following error:

```
JAVA0000: Error in C:\.tools\.nuget\packages\xamarin.androidx.datastore.core.jvm\1.1.1.2\buildTransitive\net8.0-android34.0\..\..\jar\androidx.datastore.datastore-core-jvm.jar:androidx/datastore/core/Actual_jvmKt.class:
JAVA0000: Type androidx.datastore.core.Actual_jvmKt is defined multiple times: 
- C:\.tools\.nuget\packages\xamarin.androidx.datastore.core.jvm\1.1.1.2\buildTransitive\net8.0-android34.0\..\..\jar\androidx.datastore.datastore-core-jvm.jar:androidx/datastore/core/Actual_jvmKt.class, 
- obj\Release\net8.0-android\lp\30\jl\classes.jar:androidx/datastore/core/Actual_jvmKt.class
```

This is because through the complex set of dependencies, you end up using these 2 packages:

- `Xamarin.AndroidX.DataStore.Core.Android`
- `Xamarin.AndroidX.DataStore.Core.Jvm`

These packages contain the same Java code, the `Android` one seems to be a superset of the `Jvm` one:

![image](https://github.com/xamarin/AndroidX/assets/179295/cf40d9e5-bc26-4811-bbb9-793b28e4d83b)

Thus we believe the solution is to redirect the `Jvm` package to the `Android` one.  That is, anytime the `Jvm` package is requested we are going to give it the `Android` one instead.

We will accomplish this via:

- Adding `Xamarin.AndroidX.DataStore.Core.Android` as a dependency of `Xamarin.AndroidX.DataStore.Core.Jvm`.  This means anytime `Jvm` is requested `Android` will also be added.
- Removing the `Jvm` Java library and its bindings from `Xamarin.AndroidX.DataStore.Core.Jvm` so that it will no longer duplicate the bindings and Java library in `Android`.

With these changes, we no longer see the conflict errors when consuming the `Xamarin.AndroidX.DataStore.Preferences*` packages in the `ExtendedTests` suite.

Additionally, bump all the `androidx.datastore` packages so that this new version will get picked up.
2024-06-28 08:46:31 -05:00
Jonathan Pobst 1bd273c70b
Add type forwards for `AndroidX.Lifecycle*` `2.8.*` changes. (#908)
Context: https://github.com/xamarin/AndroidX/pull/863
Fixes: https://github.com/dotnet/android/issues/9049
Fixes: https://github.com/xamarin/AndroidX/issues/909

In version `2.8.*`, Google moved all the types in 2 libraries into 2 new libraries:
- `Xamarin.AndroidX.Lifecycle.Common` to `Xamarin.AndroidX.Lifecycle.Common.Jvm`.  
- `Xamarin.AndroidX.Lifecycle.ViewModel` to `Xamarin.AndroidX.Lifecycle.ViewModel.Android`.  

While this is a source compatible change for users, it is not a binary compatible change for users that are relying on NuGets or assemblies that have not been recompiled.

These types may continue to work in Debug builds, but the linker and AOT compiler steps run for Release builds are unable to resolve the moved types, causing unfixable errors (other than recompiling all assemblies).

Adding `[TypeForwardedToAttribute]` attributes allows the linker and AOT to succeed without recompiling old assemblies.
2024-06-27 14:30:57 -05:00
moljac 766f085b62 downgraded Xamarin.AndroidX.Car.App.App 2024-06-21 17:34:15 +02:00
moljac 7e77ab0c46 binderator green 2024-06-21 12:36:24 +02:00
moljac bbc69a5e0e
Merge branch 'main' into mu-20230329-androidx.media.players 2024-06-21 00:15:43 +02:00
moljac 6acb9ace29 cleanup 2024-06-18 20:38:12 +02:00
moljac fabfe894ab stable version of Xamarin.AndroidX.Security.SecurityCrypto 2024-06-18 20:28:13 +02:00
moljac d3a5884f47 Xamarin.AndroidX.Car.App.App downgrade 2024-06-18 15:42:00 +02:00
moljac 701b54401b
Merge branch 'main' into mu-20240606-late-updates-catch-up 2024-06-17 23:20:56 +02:00
moljac 129b615fe5
Merge branch 'main' into mu-20230329-androidx.media.players 2024-06-17 23:20:38 +02:00
moljac 4f0a6a38f8
Merge branch 'main' into mu-20230329-androidx.media.players 2024-06-17 22:28:54 +02:00
moljac 003d65d4a1
Merge branch 'main' into mu-20231212-gps-fb-mlkit-missing-dependencies 2024-06-17 22:28:37 +02:00
moljac 5624b279f8
Merge branch 'main' into mu-20240606-late-updates-catch-up 2024-06-17 22:26:24 +02:00
moljac 7178ea8392
Merge branch 'main' into mu-20240606-late-updates-catch-up 2024-06-17 15:52:24 +02:00
moljac 90159f0d15 lifecycle updates 2024-06-14 15:20:59 +02:00
moljac 92df7b494c
Merge branch 'main' into mu-20230329-androidx.media.players 2024-06-14 12:20:46 +02:00
moljac 280531764c
Merge branch 'main' into mu-20240205-tfm-net80-material-1.11.0 2024-06-14 12:20:04 +02:00