Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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)
- Loading branch information