Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[binderator] Add check to ensure we use Xamarin.Build.Download for proprietary licensed artifacts. #1007

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3559,7 +3557,7 @@
"nugetVersion": "3.0.0.1",
"nugetId": "Xamarin.Google.UserMessagingPlatform",
"dependencyOnly": false,
"type": "androidlibrary"
"type": "xbd"
},
{
"groupId": "com.google.assistant.appactions",
Expand All @@ -3575,7 +3573,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