Skip to content

Commit

Permalink
Flush.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpobst committed Jan 25, 2024
1 parent f3e42e5 commit 49bf4a5
Show file tree
Hide file tree
Showing 18 changed files with 778 additions and 603 deletions.
3 changes: 2 additions & 1 deletion Documentation/guides/AndroidMavenLibrary.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ Note: This feature is only available in .NET 9+.
</ItemGroup>
```

This will do two things at build time:
This will do several things at build time:
- Download the Java [artifact](https://central.sonatype.com/artifact/com.squareup.okhttp3/okhttp/4.9.3) with group id `com.squareup.okhttp3`, artifact id `okhttp`, and version `4.9.3` from [Maven Central](https://central.sonatype.com/) to a local cache (if not already cached).
- Add the cached package to the .NET Android bindings build as an [`<AndroidLibrary>`](https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/building-apps/build-items.md#androidlibrary).
- Download the Java artifact's POM file (and any needed parent/imported POM files) to enable [Java Dependency Verification](JavaDependencyVerification.md). To opt out of this feature, add `VerifyDependencies="false"` to the `<AndroidMavenLibrary>` item.

Note that only the requested Java artifact is added to the .NET Android bindings build. Any artifact dependencies are not added. If the requested artifact has dependencies, they must be fulfilled individually.

Expand Down
5 changes: 3 additions & 2 deletions build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)HtmlAgilityPack.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)HtmlAgilityPack.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Irony.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Java.Interop.Tools.Maven.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Java.Interop.Tools.Maven.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)java-interop.jar" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)java-source-utils.jar" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)LayoutBinding.cs" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libZipSharp.dll" />
<_MSBuildFiles Include="@(_LocalizationLanguages->'$(MicrosoftAndroidSdkOutDir)%(Identity)\libZipSharp.resources.dll')" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)libZipSharp.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)MavenNet.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)MavenNet.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Mono.Unix.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Mono.Unix.pdb" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Microsoft.Android.Build.BaseTasks.dll" />
Expand All @@ -138,6 +138,7 @@
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Application.targets" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Bindings.ClassParse.targets" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Bindings.Core.targets" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Bindings.JavaDependencyVerification.targets" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Bindings.Maven.targets" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Build.Tasks.dll" />
<_MSBuildFiles Include="$(MicrosoftAndroidSdkOutDir)Xamarin.Android.Build.Tasks.pdb" />
Expand Down
40 changes: 0 additions & 40 deletions build-tools/xaprepare/xaprepare/ThirdPartyNotices/MavenNet.cs

This file was deleted.

2 changes: 1 addition & 1 deletion external/Java.Interop
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ that Java binding dependencies are satisfied.
<UsingTask TaskName="Xamarin.Android.Tasks.GetMicrosoftNuGetPackagesMap" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Android.Tasks.JavaDependencyVerification" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />

<Target Name="VerifyJavaDependencies"
<Target Name="_VerifyJavaDependencies"
Condition=" '@(AndroidLibrary->Count())' != '0' "
BeforeTargets="_CategorizeAndroidLibraries"
DependsOnTargets="MavenRestore">
DependsOnTargets="_MavenRestore">

<!-- Find the microsoft-package.json file for NuGet package hints. -->
<GetMicrosoftNuGetPackagesMap MavenCacheDirectory="$(MavenCacheDirectory)">
Expand All @@ -29,7 +29,7 @@ that Java binding dependencies are satisfied.
AdditionalManifests="@(AndroidAdditionalJavaManifest)"
PackageReferences="@(PackageReference)"
ProjectReferences="@(ProjectReference)"
IgnoredDependencies="@(AndroidIgnoredDependency)"
IgnoredDependencies="@(AndroidIgnoredJavaDependency)"
MicrosoftPackagesFile="$(_ResolvedPackageMap)"
ProjectAssetsLockFile="$(ProjectAssetsFile)" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@ This file contains MSBuild targets used to enable @(AndroidMavenLibrary) support
<MavenCacheDirectory>$([MSBuild]::EnsureTrailingSlash('$(MavenCacheDirectory)'))</MavenCacheDirectory>
</PropertyGroup>

<Target Name="MavenRestore"
<Target Name="_MavenRestore"
Condition=" '@(AndroidMavenLibrary->Count())' != '0' "
BeforeTargets="_CategorizeAndroidLibraries"
DependsOnTargets="ResolvePackageAssets">

<!-- Download artifacts and POMs from Maven to a local cache. -->
<MavenDownload MavenCacheDirectory="$(MavenCacheDirectory)" AndroidMavenLibraries="@(AndroidMavenLibrary)">
<Output TaskParameter="ResolvedAndroidMavenLibraries" ItemName="_ResolvedAndroidMavenLibraries" />
<Output TaskParameter="AndroidAdditionalJavaManifest" ItemName="_AndroidAdditionalJavaManifest" />
</MavenDownload>

<!-- Add @(AndroidMavenLibrary)'s to @(AndroidLibrary)'s. -->
<ItemGroup>
<AndroidLibrary Include="@(_ResolvedAndroidMavenLibraries)" />
<AndroidAdditionalJavaManifest Include="@(_AndroidAdditionalJavaManifest)" />
</ItemGroup>

</Target>
Expand Down
Loading

0 comments on commit 49bf4a5

Please sign in to comment.