-
Notifications
You must be signed in to change notification settings - Fork 534
/
Copy pathXamarin.Android.DX.targets
107 lines (92 loc) · 5.04 KB
/
Xamarin.Android.DX.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
106
107
<!--
***********************************************************************************************
Xamarin.Android.DX.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 DX and ProGuard integration.
Copyright (C) 2018 Xamarin. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Xamarin.Android.Tasks.CompileToDalvik" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Android.Tasks.CreateMultiDexMainDexClassList" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Android.Tasks.Proguard" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<Target Name="_CompileToDalvik"
DependsOnTargets="$(_BeforeCompileToDalvik);$(_CompileToDalvikDependsOnTargets)"
Inputs="$(_CompileToDalvikInputs)"
Outputs="$(_AndroidStampDirectory)_CompileToDalvik.stamp">
<ItemGroup>
<_JarsToProguard Include="@(_JavaLibrariesToCompile)" />
</ItemGroup>
<MakeDir Directories="$(IntermediateOutputPath)proguard" />
<Proguard
Condition=" '$(AndroidLinkTool)' == 'proguard' And '$(_ProguardProjectConfiguration)' != '' "
ProguardJarPath="$(ProguardJarPath)"
JavaToolPath="$(JavaToolPath)"
ProguardToolPath="$(ProguardToolPath)"
ToolExe="$(ProguardToolExe)"
UseProguard="$(UseProguard)"
JavaPlatformJarPath="$(JavaPlatformJarPath)"
ClassesOutputDirectory="$(_AndroidIntermediateJavaClassDirectory)"
AcwMapFile="$(_AcwMapFile)"
ProguardCommonXamarinConfiguration="$(IntermediateOutputPath)proguard\proguard_xamarin.cfg"
ProguardGeneratedReferenceConfiguration="$(_ProguardProjectConfiguration)"
ProguardGeneratedApplicationConfiguration="$(IntermediateOutputPath)proguard\proguard_project_primary.cfg"
ProguardMappingFileOutput="$(AndroidProguardMappingFile)"
ProguardConfigurationFiles="@(_ProguardConfiguration)"
JavaLibrariesToEmbed="@(_JarsToProguard);@(_InstantRunJavaReference)"
JavaLibrariesToReference="@(AndroidExternalJavaLibrary)"
ProguardJarOutput="$(IntermediateOutputPath)proguard\__proguard_output__.jar"
EnableLogging="$(ProguardEnableLogging)"
DumpOutput="$(IntermediateOutputPath)proguard\dump.txt"
PrintSeedsOutput="$(IntermediateOutputPath)proguard\seeds.txt"
PrintUsageOutput="$(IntermediateOutputPath)proguard\usage.txt"
PrintMappingOutput="$(IntermediateOutputPath)proguard\mapping.txt"
ProguardInputJarFilter="$(_AndroidProguardInputJarFilter)"
/>
<ItemGroup Condition=" '$(AndroidLinkTool)' == 'proguard' And '$(_ProguardProjectConfiguration)' != '' ">
<_AlternativeJarForAppDx Include="$(IntermediateOutputPath)proguard\__proguard_output__.jar" />
</ItemGroup>
<CreateMultiDexMainDexClassList
Condition="'$(AndroidEnableMultiDex)' == 'True' And '$(AndroidCustomMainDexListFile)' == ''"
ToolPath="$(JavaToolPath)"
ToolExe="$(JavaToolExe)"
ProguardJarPath="$(ProguardJarPath)"
AndroidSdkBuildToolsPath="$(AndroidSdkBuildToolsPath)"
ClassesOutputDirectory="$(_AndroidIntermediateJavaClassDirectory)"
JavaLibraries="@(_JarsToProguard)"
MultiDexMainDexListFile="$(_AndroidMainDexListFile)"
CustomMainDexListFiles="@(MultiDexMainDexList)"
ProguardInputJarFilter="$(_AndroidProguardInputJarFilter)"
ExtraArgs="$(AndroidMultiDexClassListExtraArgs)"
/>
<!-- remove existing dex files that may be previous multidex outputs. -->
<ItemGroup>
<_DexesToDelete Include="$(_AndroidIntermediateDexOutputDirectory)*.dex" />
</ItemGroup>
<Delete Files="@(_DexesToDelete)" />
<!-- Compile java code to dalvik -->
<CompileToDalvik
DxJarPath="$(DxJarPath)"
DxExtraArguments="$(DxExtraArguments)"
JavaToolPath="$(JavaToolPath)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
ClassesOutputDirectory="$(_AndroidIntermediateDexOutputDirectory)"
ClassesZip="$(_AndroidIntermediateClassesZip)"
ToolPath="$(DxToolPath)"
ToolExe="$(DxToolExe)"
UseDx="$(UseDx)"
MultiDexEnabled="$(AndroidEnableMultiDex)"
MultiDexMainDexListFile="$(_AndroidMainDexListFile)"
JavaLibrariesToCompile="@(_JavaLibrariesToCompileForApp);@(_InstantRunJavaReference)"
AlternativeJarFiles="@(_AlternativeJarForAppDx)"
/>
<Touch Files="$(_AndroidStampDirectory)_CompileToDalvik.stamp" AlwaysCreate="true" />
<ItemGroup>
<FileWrites Include="$(_AndroidIntermediateDexOutputDirectory)*.dex" />
<FileWrites Include="$(AndroidProguardMappingFile)" />
</ItemGroup>
</Target>
</Project>