Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit 37763a7

Browse files
committed
Don’t exclude template.targets files
1 parent c0420d4 commit 37763a7

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ output/
1717
*.csproj.user
1818
*/nuget/*.targets
1919
!merge.targets
20+
!template.targets
2021

2122
Resource.designer.cs
2223
component.yaml
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<!-- Unique key for cached download -->
5+
<_XbdKey_supportannotations>androidsupport-$AarVersion$/supportannotations</_XbdKey_supportannotations>
6+
7+
<!-- Path to .jar file within the extracted contents of the cached download -->
8+
<_XbdJarFile_supportannotations>m2repository\com\android\support\support-annotations\$AarVersion$\support-annotations-$AarVersion$.jar</_XbdJarFile_supportannotations>
9+
10+
<!-- Full path to .jar file, assuming we had to download to the cache - we reset this later if it is in the sdk -->
11+
<_XbdJarFileFullPath_supportannotations>$(XamarinBuildDownloadDir)$(_XbdKey_supportannotations)\support-annotations-$AarVersion$.jar</_XbdJarFileFullPath_supportannotations>
12+
13+
<!-- Assembly name to embed .aar in -->
14+
<_XbdAssemblyName_supportannotations>Xamarin.Android.Support.Annotations</_XbdAssemblyName_supportannotations>
15+
</PropertyGroup>
16+
17+
<ItemGroup>
18+
<XamarinBuildRestoreResources Include="_XbdRestoreItems_supportannotations"/>
19+
</ItemGroup>
20+
21+
<Target Name="_XbdRestoreItems_supportannotations">
22+
<!-- Check if the aar file is in the android sdk already and change the path to use to it, if it's found -->
23+
<CreateProperty Value="$(AndroidSdkDirectory)\extras\android\$(_XbdJarFile_supportannotations)" Condition="Exists('$(AndroidSdkDirectory)\extras\android\$(_XbdJarFile_supportannotations)')">
24+
<Output PropertyName="_XbdJarFileFullPath_supportannotations" TaskParameter="Value" />
25+
</CreateProperty>
26+
27+
<ItemGroup>
28+
<XamarinBuildDownloadPartialZip Include="$(_XbdKey_supportannotations)" Condition="!Exists('$(_XbdJarFileFullPath_supportannotations)')">
29+
<Url>https://dl-ssl.google.com/android/repository/android_m2repository_r42.zip</Url>
30+
<ToFile>support-annotations-$AarVersion$.jar</ToFile>
31+
<RangeStart>$XbdRangeStart$</RangeStart>
32+
<RangeEnd>$XbdRangeEnd$</RangeEnd>
33+
<Md5>$XbdMd5$</Md5>
34+
<CustomErrorMessage>Please open the Android SDK Manager and install the latest version of 'Android Support Repository' from the 'Extras' section, and then reload your solution.</CustomErrorMessage>
35+
<CustomErrorCode>XBD404</CustomErrorCode>
36+
</XamarinBuildDownloadPartialZip>
37+
</ItemGroup>
38+
39+
<ItemGroup>
40+
<RestoreAssemblyResource Include="$(_XbdJarFileFullPath_supportannotations)">
41+
<LogicalName>support-annotations.jar</LogicalName>
42+
<AssemblyName>$(_XbdAssemblyName_supportannotations)</AssemblyName>
43+
</RestoreAssemblyResource>
44+
</ItemGroup>
45+
</Target>
46+
</Project>

0 commit comments

Comments
 (0)