-
Notifications
You must be signed in to change notification settings - Fork 528
/
Xamarin.Android.Bindings.Documentation.targets
102 lines (92 loc) · 4.48 KB
/
Xamarin.Android.Bindings.Documentation.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
<!--
***********************************************************************************************
Xamarin.Android.Bindings.Documentation.targets
This file contains MSBuild targets related to documentation generation/extraction for bindings.
This file is only used by binding projects. .NET 5 can eventually use it, once `mdoc.exe` is available.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Xamarin.Android.Tasks.ImportJavaDoc" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Android.Tasks.JavaDoc" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Android.Tasks.MDoc" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<UsingTask TaskName="Xamarin.Android.Tasks.Unzip" AssemblyFile="Xamarin.Android.Build.Tasks.dll" />
<PropertyGroup>
<_JavadocSupported Condition=" $(_JdkVersion.StartsWith ('1.8')) ">True</_JavadocSupported>
</PropertyGroup>
<Target Name="_ExtractJavaDocJars"
Condition=" '$(_JavadocSupported)' == 'True' "
Inputs="@(JavaDocJar)"
Outputs="@(JavaDocJar->'$(IntermediateOutputPath)javadocs\%(FileName).stamp')">
<Unzip
Sources="@(JavaDocJar)"
DestinationDirectories="@(JavaDocJar->'$(IntermediateOutputPath)javadocs\%(FileName)')"
/>
<Touch Files="@(JavaDocJar->'$(IntermediateOutputPath)javadocs\%(FileName).stamp')" />
<ItemGroup>
<JavaDocIndex Include="@(JavaDocJar->'$(IntermediateOutputPath)javadocs\%(FileName)\index.html')" />
</ItemGroup>
</Target>
<Target Name="_GenerateJavaDocFromSourceJars"
Condition=" '$(_JavadocSupported)' == 'True' "
Inputs="@(JavaSourceJar)"
Outputs="@(JavaSourceJar->'$(IntermediateOutputPath)javadocs\%(FileName).stamp')">
<Unzip
Sources="@(JavaSourceJar)"
DestinationDirectories="@(JavaSourceJar->'$(IntermediateOutputPath)javasources\%(FileName)')"
/>
<JavaDoc
ContinueOnError="true"
ToolPath="$(JavaToolPath)"
SourceDirectories="@(JavaSourceJar->'$(IntermediateOutputPath)javasources\%(FileName)')"
DestinationDirectories="@(JavaSourceJar->'$(IntermediateOutputPath)javadocs\%(FileName)')"
ReferenceJars="@(EmbeddedReferenceJar);@(ReferenceJar)"
JavaPlatformJar="$(_AndroidSdkDirectory)\platforms\android-$(_AndroidApiLevel)\android.jar"
/>
<Touch Files="@(JavaSourceJar->'$(IntermediateOutputPath)javasources\%(FileName).stamp')" AlwaysCreate="true" />
<ItemGroup>
<JavaDocIndex Include="@(JavaSourceJar->'$(IntermediateOutputPath)javadocs\%(FileName)\index.html')" />
</ItemGroup>
</Target>
<Target Name="BuildDocumentation"
Condition=" '@(JavaDocIndex)' != '' And '$(_JavadocSupported)' == 'True' "
Inputs="@(JavaDocIndex);@(IntermediateAssembly->'$(IntermediateOutputPath)%(filename).xml')"
Outputs="@(IntermediateAssembly->'$(OutputPath)%(filename).xml')">
<MDoc
References="@(ReferencePath);@(ReferenceDependencyPaths)"
TargetAssembly="@(IntermediateAssembly)"
OutputDocDirectory="$(IntermediateOutputPath)docs"
ToolPath="$(MonoAndroidToolsDirectory)"
ToolExe="$(MDocToolExe)"
/>
<ImportJavaDoc
ContinueOnError="true"
ToolPath="$(MonoAndroidToolsDirectory)"
JavaDocs="@(JavaDocIndex)"
References="@(ReferencePath);@(ReferenceDependencyPaths)"
Transforms="@(TransformFile)"
TargetAssembly="@(IntermediateAssembly)"
OutputDocDirectory="$(IntermediateOutputPath)docs"
/>
<!-- "extra" mdoc needed to "fix" formatting, reducing diff size due to XML formatting -->
<MDoc
References="@(ReferencePath);@(ReferenceDependencyPaths)"
TargetAssembly="@(IntermediateAssembly)"
OutputDocDirectory="$(IntermediateOutputPath)docs"
ToolPath="$(MonoAndroidToolsDirectory)"
ToolExe="$(MDocToolExe)"
/>
<!-- Then export .NET doc xml -->
<MDoc
RunExport="true"
TargetAssembly="@(IntermediateAssembly)"
OutputDocDirectory="$(IntermediateOutputPath)docs"
ToolPath="$(MonoAndroidToolsDirectory)"
ToolExe="$(MDocToolExe)"
/>
<Copy
SourceFiles="@(IntermediateAssembly->'$(IntermediateOutputPath)%(filename).xml')"
DestinationFiles="@(IntermediateAssembly->'$(OutputPath)%(filename).xml')"
SkipUnchangedFiles="true"
/>
</Target>
</Project>