Skip to content

Commit

Permalink
[binderator] Add check to ensure we use Xamarin.Build.Download for pr…
Browse files Browse the repository at this point in the history
…oprietary licensed artifacts. (#1007)

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.
  • Loading branch information
jpobst authored Oct 17, 2024
1 parent 3ab495b commit 32ce401
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
9 changes: 4 additions & 5 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2360,9 +2360,7 @@
"nugetVersion": "1.1.2.6",
"nugetId": "Xamarin.Google.Android.InstallReferrer",
"dependencyOnly": false,
"frozen": true,
"type": "androidlibrary",
"comments": "Changed from Apache to Android SDK License"
"type": "xbd"
},
{
"groupId": "com.android.volley",
Expand Down Expand Up @@ -3569,7 +3567,7 @@
"nugetVersion": "3.0.0.1",
"nugetId": "Xamarin.Google.UserMessagingPlatform",
"dependencyOnly": false,
"type": "androidlibrary"
"type": "xbd"
},
{
"groupId": "com.google.assistant.appactions",
Expand All @@ -3585,7 +3583,8 @@
"version": "0.0.1",
"nugetVersion": "0.0.1.16",
"nugetId": "Xamarin.Google.Assistant.AppActions.Widgets",
"dependencyOnly": false
"dependencyOnly": false,
"type": "xbd"
},
{
"groupId": "com.google.auto.value",
Expand Down
11 changes: 11 additions & 0 deletions source/_PackageLevelCustomizations.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,14 @@
<EmbeddedJar Include="..\..\externals\com.xamarin.google.android.play.feature.delivery.extensions\extensions.jar" />
</ItemGroup>
}

@if (Model.Type == AndroidBinderator.BindingType.XamarinBuildDownload
&& Model.NuGetPackageId != "Xamarin.Google.Android.InstallReferrer"
&& Model.NuGetPackageId != "Xamarin.Google.UserMessagingPlatform"
&& Model.NuGetPackageId != "Xamarin.Google.Assistant.AppActions.Widgets"
) {
<ItemGroup>
<!-- GPS doesn't currently use <AndroidNamespaceReplacement> -->
<AndroidNamespaceReplacement Remove="@@(AndroidNamespaceReplacement)" />
</ItemGroup>
}
4 changes: 0 additions & 4 deletions source/_XBDProjectType.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
var targets_path = "@" + @"(AndroidXNuGetTargetFolders->'%(Identity)\" + Model.NuGetPackageId + ".targets')";
}

@* Long-term, GPS != XBD, but for now this is ok. (Long-term we also migrate to namespace replacements.) *@
<ItemGroup>
<!-- GPS doesn't currently use <AndroidNamespaceReplacement> -->
<AndroidNamespaceReplacement Remove="@@(AndroidNamespaceReplacement)" />

<_AndroidDocumentationPath Include="..\..\externals\paramnames.txt" Condition="Exists('..\..\externals\paramnames.txt')" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ private static void ConvertLicenses (BindingConfig config, MavenArtifactConfig m
license.Text = File.ReadAllText (license_file);
}

// Ensure we use Xamarin.Build.Download for any proprietary licenses
if (projectModel.Type != BindingType.XamarinBuildDownload)
foreach (var l in projectModel.Licenses)
if (l.LicenseConfig.Proprietary)
exceptions.Add (new Exception ($"Artifact '{mavenArtifact.GroupAndArtifactId}' has proprietary license '{l.Name}' and must use the `xbd` artifact type."));
}

static Collection<License> FindLicenses (BindingConfig config, MavenArtifactConfig mavenArtifact, Project mavenProject)
Expand Down

0 comments on commit 32ce401

Please sign in to comment.