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

Commit 1b1a98d

Browse files
committed
Unignore merge.targets
The merge.targets will get merged into the generated .targets file for a given nuget package. This was being gitignored and not properly making it in. This target helps us check the version of android tools installed and adds the —no-version-vectors flag to aapt calls.
1 parent 7cb8dbf commit 1b1a98d

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ output/
1616
*.xcuserstate
1717
*.csproj.user
1818
*/nuget/*.targets
19-
19+
!merge.targets
2020

2121
Resource.designer.cs
2222
component.yaml
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<!--
4+
*
5+
* Xamarin Android Support Vector Drawable MSBuild Tasks
6+
*
7+
-->
8+
<PropertyGroup>
9+
<VectorDrawableCheckBuildToolsVersionTaskFilename Condition=" '$(VectorDrawableCheckBuildToolsVersionTaskFilename)' == '' ">$(MSBuildThisFileDirectory)Xamarin.Android.Support.Tasks.VectorDrawable.dll</VectorDrawableCheckBuildToolsVersionTaskFilename>
10+
</PropertyGroup>
11+
12+
<!-- set some defaults -->
13+
<PropertyGroup>
14+
<VectorDrawableCheckBuildToolsVersionTaskDependsOn>
15+
_ResolveMonoAndroidSdks;$(VectorDrawableCheckBuildToolsVersionTaskDependsOn);
16+
</VectorDrawableCheckBuildToolsVersionTaskDependsOn>
17+
<VectorDrawableCheckBuildToolsVersionTaskBeforeTargets>
18+
UpdateAndroidResgen;$(VectorDrawableCheckBuildToolsVersionTaskBeforeTargets);
19+
</VectorDrawableCheckBuildToolsVersionTaskBeforeTargets>
20+
</PropertyGroup>
21+
22+
<!-- include the task assembly -->
23+
<UsingTask
24+
AssemblyFile="$(VectorDrawableCheckBuildToolsVersionTaskFilename)"
25+
TaskName="Xamarin.Android.Support.Tasks.VectorDrawableCheckBuildToolsVersionTask" />
26+
27+
<!-- the build tasks -->
28+
<Target
29+
Name="VectorDrawableCheckBuildToolsVersionTask"
30+
Condition=""
31+
BeforeTargets="$(VectorDrawableCheckBuildToolsVersionTaskBeforeTargets)">
32+
33+
<VectorDrawableCheckBuildToolsVersionTask
34+
AndroidSdkBuildToolsPath="$(AndroidSdkBuildToolsPath)">
35+
</VectorDrawableCheckBuildToolsVersionTask>
36+
</Target>
37+
38+
<Target
39+
Name="_XamarinAndroidSupportVectorDrawableArgs"
40+
BeforeTargets="_UpdateAndroidResgen">
41+
<!-- Adds an argument to the call to aapt to support vectors -->
42+
<PropertyGroup Condition="!($(AndroidResgenExtraArgs.Contains('--no-version-vectors')))">
43+
<AndroidResgenExtraArgs>$(AndroidResgenExtraArgs.Trim()) --no-version-vectors</AndroidResgenExtraArgs>
44+
</PropertyGroup>
45+
</Target>
46+
47+
</Project>

0 commit comments

Comments
 (0)