Clean up `config.json`:
- Remove default `dependencyOnly: false` as we only change it for 6 artifacts.
- Move template details to `"default"` `TemplateSet`.
- Add comments for `dependencyOnly: true` artifacts.
- Don't look for dependency versions in the GPS `config.json`.
Break up `build.cake` functionality into smaller files instead of having one massive file. By moving the stuff we still use into separate files, we can easily remove the remaining obsolete stuff from the main file (XA Classic, AndroidSupport, etc.).
This should also fix https://github.com/xamarin/AndroidX/issues/1015, assuming those errors messages are from `cake`.
Additionally, move the `"binderate-config-verify"` task logic to `binderator`. There was an issue with existing logic causing it to miss that `androidx.wear.wear-input` had mismatching Java (`1.1.0`) and NuGet (`1.0.0.19`) versions. Fix that as well.
Update `binderator` to enforce that Java libraries with proprietary licenses are packaged using the `Xamarin.Build.Download` method.
Unfreeze `Xamarin.Google.Android.InstallReferrer` and bind newer versions that are no longer Apache licensed using `"type": "xbd"`.
Additionally, this check found 2 other libraries that are proprietary licensed and should be bound using the `Xamarin.Build.Download` method. They are updated as well.
Add support in `binderator` for finding licensing information that is specified in parent POM files. This allows us to remove all of the hardcoded `overrideLicenses` info currently in `config.json`.
We no longer use `binderator` outside of this repository. Stop building a NuGet package and running package diffs on it to help remove some noise in the diff reports.
- Add `"skipExtendedTests"` to `config.json`. When set to `true`, the "extended" tests are not run for this package. This allows us to get our test job green with the packages that currently work. This way we can go ahead and have it running for currently working packages to ensure they do not regress.
- Set up a "nightly" job that will run the "extended" test suite every night. Note that this will only run if there have been changes to `main` since the previous run, so it generally won't actually run every night.
Convert `gps` template to the unified template.
- This introduces a new `xbd` package type, which creates packages that use `Xamarin.Build.Download` to download a proprietary Java package.
- Refactors the package types (`androidlibrary`, `targets`, `xdb`, `no-bindings`) into partial Razor files to help make it clear which parts are not shared.
- Refactors all package-specific customizations that exist in the `.csproj` to a dedicated `_PackageLevelCustomizations.cshtml` partial file.
Notes:
- This changes the previous `.jar + .targets` behavior to the updated `dotnet` "`.jar/.aar` next to the `.dll`" method.
- The transforms and additions were in folders using the NuGet name, they had to be moved to the standard `groupid/artifactid` names.
Note this changes the previous `.jar + .targets` behavior to the updated `dotnet` "`.jar/.aar` next to the `.dll`" method.
As part of this we do lose the `$(XamarinGoogleGuavaOptOut)` opt-out we had previously added.
Given that this was added to help with broken Guava packages published before April 2022, this property should no longer be needed:
https://github.com/xamarin/XamarinComponents/pull/1366
"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.
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
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
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.