-
Notifications
You must be signed in to change notification settings - Fork 534
/
Copy pathXamarin.Android.D8.targets
105 lines (91 loc) · 4.86 KB
/
Xamarin.Android.D8.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!--
***********************************************************************************************
Xamarin.Android.D8.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
This file contains targets specific to d8 and r8 integration.
Copyright (C) 2018 Xamarin. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Xamarin.Android.Tasks.D8" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Android.Tasks.R8" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<Target Name="_CompileToDalvik"
DependsOnTargets="$(_BeforeCompileToDalvik);$(_CompileToDalvikDependsOnTargets)"
Inputs="$(_CompileToDalvikInputs)"
Outputs="$(_AndroidStampDirectory)_CompileToDalvik.stamp">
<!-- Target-level properties to simplify conditions-->
<PropertyGroup>
<!--Flag indicating if using d8 or r8-->
<_UseR8 Condition=" ('$(AndroidLinkTool)' == 'r8' And '$(_ProguardProjectConfiguration)' != '') Or '$(AndroidEnableMultiDex)' == 'True' ">True</_UseR8>
<_UseR8 Condition=" '$(_UseR8)' == '' ">False</_UseR8>
<!--Flag indicating if r8 should have EnableShrinking-->
<_R8EnableShrinking Condition=" '$(AndroidLinkTool)' == 'r8' ">True</_R8EnableShrinking>
<_R8EnableShrinking Condition=" '$(_R8EnableShrinking)' == '' ">False</_R8EnableShrinking>
</PropertyGroup>
<Error
Condition=" !Exists('$(AndroidR8JarPath)') "
Text="r8.jar does not exist (AndroidR8JarPath property has to point to a valid file (current value: '$(AndroidR8JarPath)')."
/>
<!-- remove existing dex files that may be previous multidex outputs. -->
<ItemGroup>
<_DexesToDelete Include="$(_AndroidIntermediateDexOutputDirectory)*.dex" />
</ItemGroup>
<Delete Files="@(_DexesToDelete)" />
<MakeDir
Directories="$(IntermediateOutputPath)proguard"
Condition=" '$(AndroidLinkTool)' != '' "
/>
<R8
Condition=" '$(_UseR8)' == 'True' "
ToolPath="$(JavaToolPath)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
JarPath="$(AndroidR8JarPath)"
AndroidManifestFile="$(IntermediateOutputPath)android\AndroidManifest.xml"
OutputDirectory="$(_AndroidIntermediateDexOutputDirectory)"
Debug="$(AndroidIncludeDebugSymbols)"
JavaPlatformJarPath="$(JavaPlatformJarPath)"
ClassesZip="$(_AndroidIntermediateClassesZip)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompileForApp);@(_InstantRunJavaReference)"
JavaLibrariesToReference="@(AndroidExternalJavaLibrary)"
EnableDesugar="$(AndroidEnableDesugar)"
AndroidSdkBuildToolsPath="$(AndroidSdkBuildToolsPath)"
AcwMapFile="$(_AcwMapFile)"
ProguardCommonXamarinConfiguration="$(IntermediateOutputPath)proguard\proguard_xamarin.cfg"
ProguardGeneratedReferenceConfiguration="$(_ProguardProjectConfiguration)"
ProguardGeneratedApplicationConfiguration="$(IntermediateOutputPath)proguard\proguard_project_primary.cfg"
ProguardMappingFileOutput="$(AndroidProguardMappingFile)"
ProguardConfigurationFiles="@(_ProguardConfiguration)"
EnableShrinking="$(_R8EnableShrinking)"
EnableMultiDex="$(AndroidEnableMultiDex)"
MultiDexMainDexListFile="$(_AndroidMainDexListFile)"
CustomMainDexListFiles="@(MultiDexMainDexList)"
IgnoreWarnings="$(AndroidR8IgnoreWarnings)"
ExtraArguments="$(AndroidR8ExtraArguments)"
/>
<D8
Condition=" '$(_UseR8)' != 'True' "
ToolPath="$(JavaToolPath)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
JarPath="$(AndroidR8JarPath)"
AndroidManifestFile="$(IntermediateOutputPath)android\AndroidManifest.xml"
OutputDirectory="$(_AndroidIntermediateDexOutputDirectory)"
Debug="$(AndroidIncludeDebugSymbols)"
JavaPlatformJarPath="$(JavaPlatformJarPath)"
ClassesZip="$(_AndroidIntermediateClassesZip)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompileForApp);@(_InstantRunJavaReference)"
AlternativeJarLibrariesToEmbed="@(_AlternativeJarForAppD8)"
JavaLibrariesToReference="@(AndroidExternalJavaLibrary)"
EnableDesugar="$(AndroidEnableDesugar)"
ExtraArguments="$(AndroidD8ExtraArguments)"
/>
<Touch Files="$(_AndroidStampDirectory)_CompileToDalvik.stamp" AlwaysCreate="true" />
<ItemGroup>
<FileWrites Include="$(_AndroidIntermediateDexOutputDirectory)*.dex" />
<FileWrites Include="$(AndroidProguardMappingFile)" />
</ItemGroup>
</Target>
</Project>