Skip to content

Commit 9048eef

Browse files
committed
Bump to xamarin/xamarin-android-tools/main@a5194e93
Context: https://developer.android.com/studio/releases/platform-tools Changes: http://github.com/xamarin/xamarin-android-tools/compare/9b658b29bd41157151f5515619d0d90dc062563d...a5194e93498e7f12225d87e2811415a45f742116 * dotnet/android-tools@a5194e9: [Xamarin.Android.Tools.AndroidSdk] Downgrade build-tools to API-30 * dotnet/android-tools@440e6be: [Xamarin.Android.Tools.AndroidSdk] Update SDK component for API-31 (#134) One of the (undocumented) changes between Android SDK Platform-tools package r30.0.4 and r31.0.3 is that `platform-tools/api/annotations.zip` was *removed*. This removal would cause the `_GenerateBinding` target in `Mono.Android.targets` to fail, as it's used by `generator.exe --annotations`: mono --debug=casts "/Users/builder/azdo/_work/2/s/xamarin-android/bin/Release/lib/xamarin.android/xbuild/Xamarin/Android/generator.exe" \ --annotations="/Users/builder/Library/Android/sdk/platform-tools/api/annotations.zip" \ … … error BG0000: System.IO.DirectoryNotFoundException: Could not find a part of the path "/Users/builder/Library/Android/sdk/platform-tools/api/annotations.zip". at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) at System.IO.File.OpenRead (System.String path) at Xamarin.AndroidTools.AnnotationSupport.AndroidAnnotationsSupport.ParseArchive (System.String file) at Xamarin.AndroidTools.AnnotationSupport.AndroidAnnotationsSupport.Load (System.String annotationsZipFile) at Xamarin.Android.Binder.CodeGenerator.GenerateAnnotationAttributes (System.Collections.Generic.List`1[T] gens, System.Collections.Generic.IEnumerable`1[T] zips) at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options, Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver) at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options) at Xamarin.Android.Binder.CodeGenerator.Main (System.String[] args) `annotations.zip` has apparently moved into the platform package, and has been there since API-26: % ls -1tr ~/android-toolchain/sdk/platforms/*/data/annotations.zip $HOME/android-toolchain/sdk/platforms/android-26/data/annotations.zip $HOME/android-toolchain/sdk/platforms/android-27/data/annotations.zip $HOME/android-toolchain/sdk/platforms/android-28/data/annotations.zip $HOME/android-toolchain/sdk/platforms/android-29/data/annotations.zip $HOME/android-toolchain/sdk/platforms/android-30/data/annotations.zip $HOME/android-toolchain/sdk/platforms/android-31/data/annotations.zip Update the `_GenerateBinding` target so that the "new" platform copy of `annotations.zip` is used, if present.
1 parent c09f505 commit 9048eef

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

Configuration.props

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@
113113
<AllSupported64BitTargetAndroidAbis>arm64-v8a;x86_64</AllSupported64BitTargetAndroidAbis>
114114
<AllSupportedTargetAndroidAbis>$(AllSupported32BitTargetAndroidAbis);$(AllSupported64BitTargetAndroidAbis)</AllSupportedTargetAndroidAbis>
115115
<!--
116-
For some reason, the URL for platform-tools/build-tools 30.0.2 is prefixed with what appears to be a GIT commit hash or some other checksum...
116+
For some reason, the URL for platform-tools/build-tools 30.0.3 is prefixed with what appears to be a GIT commit hash or some other checksum...
117117
Linux packages don't have any prefix, but this forces us to have *some* mechanism to handle this...
118118
-->
119-
<XABuildToolsPackagePrefixMacOS>5a6ceea22103d8dec989aefcef309949c0c42f1d.</XABuildToolsPackagePrefixMacOS>
120-
<XABuildToolsPackagePrefixWindows>efbaa277338195608aa4e3dbd43927e97f60218c.</XABuildToolsPackagePrefixWindows>
119+
<XABuildToolsPackagePrefixMacOS>f6d24b187cc6bd534c6c37604205171784ac5621.</XABuildToolsPackagePrefixMacOS>
120+
<XABuildToolsPackagePrefixWindows>91936d4ee3ccc839f0addd53c9ebf087b1e39251.</XABuildToolsPackagePrefixWindows>
121121
<XABuildToolsPackagePrefixLinux></XABuildToolsPackagePrefixLinux>
122122
<XABuildToolsPackagePrefix Condition=" '$(HostOS)' == 'Darwin' ">$(XABuildToolsPackagePrefixMacOS)</XABuildToolsPackagePrefix>
123123
<XABuildToolsPackagePrefix Condition=" '$(HostOS)' == 'Windows' ">$(XABuildToolsPackagePrefixWindows)</XABuildToolsPackagePrefix>
124-
<XABuildToolsVersion>30.0.2</XABuildToolsVersion>
125-
<XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">30.0.2</XABuildToolsFolder>
126-
<XAPlatformToolsPackagePrefix Condition=" '$(HostOS)' == 'Darwin' ">b2be9c80582174e645d3736daa0d44d8610b38a8.</XAPlatformToolsPackagePrefix>
127-
<XAPlatformToolsVersion>30.0.2</XAPlatformToolsVersion>
124+
<XABuildToolsVersion>30.0.3</XABuildToolsVersion>
125+
<XABuildToolsFolder Condition="'$(XABuildToolsFolder)' == ''">30.0.3</XABuildToolsFolder>
126+
<XAPlatformToolsPackagePrefix Condition=" '$(HostOS)' == 'Darwin' ">e8b2b4cbe47c728c1e54c5f524440b52d4e1a33c.</XAPlatformToolsPackagePrefix>
127+
<XAPlatformToolsVersion>31.0.3</XAPlatformToolsVersion>
128128
<XAIncludeProprietaryBits Condition="'$(XAIncludeProprietaryBits)' == ''">False</XAIncludeProprietaryBits>
129129
<XABundleToolVersion Condition="'$(XABundleToolVersion)' == ''">1.4.0</XABundleToolVersion>
130130
<XAPackagesDir Condition=" '$(XAPackagesDir)' == '' And '$(HostOS)' == 'Windows'">$(userprofile)\.nuget\packages</XAPackagesDir>

external/xamarin-android-tools

src/Mono.Android/Mono.Android.targets

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
</Target>
128128
<Target Name="_GenerateBinding"
129129
BeforeTargets="CoreCompile"
130-
Inputs="metadata;enumflags;map.csv;methodmap.csv;$(IntermediateOutputPath)mcw\api.xml"
130+
Inputs="$(MSBuildThisFileFullPath);metadata;enumflags;map.csv;methodmap.csv;$(IntermediateOutputPath)mcw\api.xml"
131131
Outputs="$(IntermediateOutputPath)mcw\Mono.Android.projitems">
132132
<MakeDir Directories="$(IntermediateOutputPath)mcw" />
133133
<PropertyGroup>
@@ -143,6 +143,16 @@
143143
Include="$(_PlatformIdVersions)"
144144
/>
145145
</ItemGroup>
146+
<ItemGroup>
147+
<_Annotation
148+
Condition=" Exists('$(AndroidSdkDirectory)\platform-tools\api\annotations.zip') "
149+
Include="$(AndroidSdkDirectory)\platform-tools\api\annotations.zip"
150+
/>
151+
<_Annotation
152+
Condition=" Exists('$(AndroidSdkDirectory)\platforms\android-$(AndroidPlatformId)\data\annotations.zip') "
153+
Include="$(AndroidSdkDirectory)\platforms\android-$(AndroidPlatformId)\data\annotations.zip"
154+
/>
155+
</ItemGroup>
146156
<PropertyGroup>
147157
<Generator>"$(XAInstallPrefix)xbuild\Xamarin\Android\generator.exe"</Generator>
148158
<_GenFlags>--public --product-version=7</_GenFlags>
@@ -152,7 +162,7 @@
152162
<_Fixup>--fixup=metadata</_Fixup>
153163
<_Enums1>--preserve-enums --enumflags=enumflags --enumfields=map.csv --enummethods=methodmap.csv</_Enums1>
154164
<_Enums2>--enummetadata=$(IntermediateOutputPath)mcw\enummetadata</_Enums2>
155-
<_Annotations>--annotations="$(AndroidSdkDirectory)\platform-tools\api\annotations.zip"</_Annotations>
165+
<_Annotations>@(_Annotation->'"--annotations=%(Identity)"', ' ')</_Annotations>
156166
<_Assembly>--assembly="Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"</_Assembly>
157167
<_TypeMap>--type-map-report=$(IntermediateOutputPath)mcw\type-mapping.txt</_TypeMap>
158168
<_Api>$(IntermediateOutputPath)mcw\api.xml</_Api>

0 commit comments

Comments
 (0)