-
Notifications
You must be signed in to change notification settings - Fork 536
/
Copy pathXamarin.Android.Bindings.ClassParse.targets
86 lines (76 loc) · 3.58 KB
/
Xamarin.Android.Bindings.ClassParse.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
<!--
***********************************************************************************************
Xamarin.Android.Bindings.ClassParse.targets
This file contains MSBuild targets used when $(AndroidClassParser) is 'class-parse'.
This file is only used by binding projects.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Xamarin.Android.Tasks.ClassParse" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<Target Name="_ExportJarToXml"
DependsOnTargets="_ExtractJavadocsFromJavaSourceJars"
Inputs="@(EmbeddedJar);@(EmbeddedReferenceJar);@(InputJar);@(ReferenceJar);@(_AndroidMSBuildAllProjects)"
Outputs="$(ApiOutputFile)">
<ItemGroup>
<!-- TODO: add when `ClassPath` supports `<api api-source="java-source-utils">`
<_AndroidDocumentationPath Include="@(_JavaSourceJavadocXml)" />
-->
<_AndroidDocumentationPath Include="@(JavaDocIndex->'%(RootDir)\%(Directory)')" />
<_AndroidDocumentationPath Include="$(JavaDocPaths)" />
<_AndroidDocumentationPath Include="$(Java7DocPaths)" />
<_AndroidDocumentationPath Include="$(Java8DocPaths)" />
<_AndroidDocumentationPath Include="$(DroidDocPaths)" />
<_AndroidDocumentationPath Include="@(JavaDocJar->'$(IntermediateOutputPath)javadocs\%(FileName)')" />
</ItemGroup>
<ClassParse
OutputFile="$(ApiOutputFile).class-parse"
SourceJars="@(EmbeddedJar);@(InputJar)"
DocumentationPaths="@(_AndroidDocumentationPath)"
/>
<BindingsGenerator
OnlyRunXmlAdjuster="true"
XmlAdjusterOutput="$(ApiOutputFile)"
OutputDirectory="$(GeneratedOutputPath)src"
AndroidApiLevel="$(_AndroidApiLevel)"
ApiXmlInput="$(ApiOutputFile).class-parse"
ReferencedManagedLibraries="@(ReferencePath);@(ReferenceDependencyPaths)"
MonoAndroidFrameworkDirectories="$(_XATargetFrameworkDirectories)"
ToolPath="$(MonoAndroidToolsDirectory)"
ToolExe="$(BindingsGeneratorToolExe)"
Nullable="$(Nullable)"
/>
</Target>
<Target Name="_GetJavaSourceJarJavadocFiles"
Condition=" '$(_UseLegacyJavadocImport)' != 'True' And '@(JavaSourceJar->Count())' != '0' ">
<ComputeHash
CopyMetadata="True"
Source="@(JavaSourceJar)">
<Output TaskParameter="Output" ItemName="_JavaSourceJarHashes" />
</ComputeHash>
<ItemGroup>
<_JavaSourceJavadocXml Include="@(_JavaSourceJarHashes->'$(IntermediateOutputPath)javadoc-%(Filename)-%(Hash).xml')" />
</ItemGroup>
</Target>
<Target Name="_ExtractJavadocsFromJavaSourceJars"
Condition=" '$(_UseLegacyJavadocImport)' != 'True' And '@(JavaSourceJar->Count())' != '0' "
DependsOnTargets="_GetJavaSourceJarJavadocFiles"
Inputs="@(JavaSourceJar)"
Outputs="@(_JavaSourceJavadocXml)">
<JavaSourceUtils
ContinueOnError="True"
JavaSourceUtilsJar="$(AndroidJavaSourceUtilsJar)"
InputFiles="%(_JavaSourceJavadocXml.OriginalItemSpec)"
JavadocCopyrightFile="%(_JavaSourceJavadocXml.CopyrightFile)"
JavadocUrlPrefix="%(_JavaSourceJavadocXml.UrlPrefix)"
JavadocUrlStyle="%(_JavaSourceJavadocXml.UrlStyle)"
JavaMaximumHeapSize="$(JavaMaximumHeapSize)"
JavaOptions="$(JavaOptions)"
JavaSdkDirectory="$(_JavaSdkDirectory)"
OutputJavadocXml="%(_JavaSourceJavadocXml.Identity)"
References="@(JavaSourceJar)"
/>
<ItemGroup>
<FileWrites Include="@(_JavaSourceJavadocXml)" />
</ItemGroup>
</Target>
</Project>