|
1 | | -<Project> |
2 | | - <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> |
| 1 | +<Project Sdk="Microsoft.NET.Sdk"> |
| 2 | + |
3 | 3 | <PropertyGroup> |
4 | 4 | <TargetFramework>net47</TargetFramework> |
5 | 5 | </PropertyGroup> |
6 | 6 |
|
7 | | - <PropertyGroup> |
8 | | - <CompileDependsOn>ResolveReferences;BeforeCompile</CompileDependsOn> |
9 | | - </PropertyGroup> |
10 | | - |
11 | | - <ItemGroup> |
12 | | - <ProjectReference Include="..\src\Llvm.NET\Llvm.NET.csproj"> |
13 | | - <PrivateAssets>All</PrivateAssets> |
14 | | - <Private>false</Private> |
15 | | - </ProjectReference> |
16 | | - </ItemGroup> |
17 | | - |
18 | 7 | <ItemGroup> |
19 | | - <None Remove="Docfx-*.log" /> |
| 8 | + <ProjectReference Include="..\src\Llvm.NET\Llvm.NET.csproj" /> |
20 | 9 | </ItemGroup> |
21 | 10 |
|
22 | 11 | <ItemGroup> |
| 12 | + <PackageReference Include="CSemVer.Build.Tasks" Version="1.0.3-beta--ci-BLD.431367438" /> |
23 | 13 | <PackageReference Include="docfx.console" Version="2.29.1" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" /> |
24 | 14 | <PackageReference Include="memberpage" Version="2.29.1" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" /> |
25 | 15 | <PackageReference Include="msdn.4.5.2" Version="0.1.0-alpha-1611021200" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" /> |
26 | 16 | </ItemGroup> |
27 | 17 |
|
28 | | - <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" /> |
29 | | - |
| 18 | + <!-- |
| 19 | + This target dynamically resolves the installed location of the NuGet Packages used and applies |
| 20 | + appropriate parameters to the docfx command to use them. Otherwise the docfx.json would need to |
| 21 | + have a hard coded path, which doesn't work with multiple users of a version controlled project. |
| 22 | + It also removes the need to workaround the hard coded path with relative paths by using a |
| 23 | + nuget.config to force package installs to a well known location. |
| 24 | + --> |
30 | 25 | <Target Name="GetDocfxPackagePaths" BeforeTargets="DocBuild"> |
31 | 26 | <ItemGroup> |
32 | 27 | <docfxpkg Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='docfx.console'" /> |
33 | 28 | <memberpage Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='memberpage'" /> |
34 | 29 | <Msdn4_5_2 Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='msdn.4.5.2'" /> |
35 | | - <DocFxInputAssembly Include="@(ReferencePath)" Condition="'%(ReferencePath.ReferenceSourceTarget)'=='ProjectReference'" /> |
36 | 30 | </ItemGroup> |
37 | 31 | <PropertyGroup> |
38 | 32 | <DocfxConsolePath>%(docfxpkg.ResolvedPath)</DocfxConsolePath> |
39 | 33 | <MemberPagePath>%(memberpage.ResolvedPath)</MemberPagePath> |
40 | 34 | <MsdnXRefPath>%(msdn4_5_2.ResolvedPath)</MsdnXRefPath> |
41 | | - <LogLevel>Warning</LogLevel> |
42 | | - <LogFile>Docfx-$(TargetFramework).log</LogFile> |
43 | | - <DocParameters>$(DocParameters) --disableGitFeatures</DocParameters> |
| 35 | + <LogLevel>Info</LogLevel> |
| 36 | + <LogFile>$(IntermediateOutputPath)Docfx-Metadata.log</LogFile> |
44 | 37 | <DocParameters>$(DocParameters) --cleanupCacheHistory</DocParameters> |
45 | 38 | <DocParameters>$(DocParameters) --lruSize=0</DocParameters> |
46 | | - <DocParameters>$(DocParameters) --intermediateFolder=$(IntermediateOutputPath)</DocParameters> |
47 | | - <DocParameters>$(DocParameters) --xref=llvm-xref.yml,$(MsdnXrefPath)\content\msdn.4.5.2.zip,$(MsdnXrefPath)\content\namespaces.4.5.2.zip</DocParameters> |
| 39 | + <DocParameters>$(DocParameters) --globalMetadata="{_buildVersion:\"$(FullBuildNumber)\"}"</DocParameters> |
| 40 | + <DocParameters>$(DocParameters) --intermediateFolder="$(IntermediateOutputPath.TrimEnd('\'))"</DocParameters> |
| 41 | + <DocParameters>$(DocParameters) --xref="llvm-xref.yml,$(MsdnXrefPath)\content\msdn.4.5.2.zip,$(MsdnXrefPath)\content\namespaces.4.5.2.zip"</DocParameters> |
48 | 42 | <DocTemplate>statictoc,$(MemberPagePath)\content,templates\Ubiquity</DocTemplate> |
49 | 43 | </PropertyGroup> |
50 | | - <Message Importance="high" Text="DocFxInputAssembly: %(DocFxInputAssembly.ReferenceAssembly)" /> |
51 | 44 | </Target> |
52 | 45 |
|
53 | 46 | <!-- Stub the build target as this project only builds the documentation --> |
|
0 commit comments