Skip to content

Commit 54b4959

Browse files
authored
Docs update (#48)
* Docs update * Complete refactoring of docs build. The docs are now built as a distinct project and included in the Llvm.NET.sln * removed Build-docs.ps1 and updated Appveyor build support for the docs * Buildall.ps1 now really does build all. * Customized docs template/theme to use a dark theme that more closely resembles the dark theme of the .NET APIs * added syntax highlighting for llvm-IR and rudimentary ANTLR grammar support for docs. * Fixed buildall.ps1 for appveyor builds so the BuildOutput folder exists to clone the docs repo into
1 parent 10a41c2 commit 54b4959

File tree

21 files changed

+949
-73
lines changed

21 files changed

+949
-73
lines changed

BuildAll.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ try
4545

4646
md BuildOutput\NuGet\ | Out-Null
4747

48+
if( $env:CI -and !(Test-Path ".\BuildOutput\docs\.git" -PathType Container))
49+
{
50+
Write-Information "Cloning Docs repo"
51+
pushd BuildOutput -ErrorAction Stop
52+
try
53+
{
54+
git clone https://github.com/UbiquityDotNET/Llvm.NET.git -b gh-pages docs -q
55+
}
56+
finally
57+
{
58+
popd
59+
}
60+
}
61+
4862
$BuildInfo = Get-BuildInformation $buildPaths
4963
if($env:APPVEYOR)
5064
{

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
6262
</PropertyGroup>
6363
<ItemGroup Condition="'$(NoCommonAnalyzers)'!='true' and '$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
64-
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.6.1" PrivateAssets="All" />
64+
<PackageReference Include="SourceLink.Create.CommandLine" Version="2.7.4" PrivateAssets="All" />
6565
</ItemGroup>
6666
<ItemGroup Condition="'$(NoCommonAnalyzers)'!='true'">
6767
<PackageReference Include="Microsoft.AnalyzerPowerPack" Version="1.1.0" PrivateAssets="All" />

GOVERNANCE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Users should be encouraged to participate in the life of the project and the com
7979
contributions enable the project team to ensure that they are satisfying the needs of those users. Common user
8080
activities include (but are not limited to):
8181

82-
* Evangelising about the project
82+
* Evangelizing about the project
8383
* Informing developers of project strengths and weaknesses from a new user’s perspective
8484
* Providing moral support (a ‘thank you’ goes a long way)
8585
* Providing financial support
@@ -90,7 +90,7 @@ involved. Such users may then go on to become contributors, as described above.
9090
### Support
9191

9292
All participants in the community are encouraged to provide support for new users within the project management
93-
infrastructure. This support is provided as a way of growing the community. Those seeking support should recognise that
93+
infrastructure. This support is provided as a way of growing the community. Those seeking support should recognize that
9494
all support activity within the project is voluntary and is therefore provided as and when time allows. A user requiring
9595
guaranteed response times or results should therefore seek to purchase a support contract from a vendor. (Of course,
9696
that vendor should be an active member of the community.) However, for those willing to engage with the project on its

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,34 +36,42 @@ C API with a C# adapter layer to provide the full experience .NET developers exp
3636
tedious one very little application code required changes.
3737

3838
### Platform Support
39-
Currently LLVM.NET supports Win32 and x64 buids targeting the full desktop framework v4.7 and .NET standard 2.0. Idealy other platforms are possible in the future. To keep life simpler the Llvm.NET nuget package is built for the "AnyCPU" platform and references the LibLLVM.NET package to bring in the native binary support. Llvm.NET contains code to dynamically detect the platform it is running on and load the appropriate DLL. This allows applications to build for AnyCPU without creating multiple build configurations and release vehicles for applications. (Any new platforms would need to update the dynamic loading support and include the appropriate P/Invokable binaries)
39+
Currently LLVM.NET supports Win32 and x64 builds targeting the full desktop framework v4.7 and .NET standard 2.0. Ideally
40+
other platforms are possible in the future. To keep life simpler the Llvm.NET NuGet package is built for the "AnyCPU"
41+
platform and references the LibLLVM.NET package to bring in the native binary support. Llvm.NET contains code to dynamically
42+
detect the platform it is running on and load the appropriate DLL. This allows applications to build for AnyCPU without
43+
creating multiple build configurations and release vehicles for applications. (Any new platforms would need to update the
44+
dynamic loading support and include the appropriate P/Invokable binaries)
4045

41-
### CI Build Nuget Packages
42-
The CI Builds on AppVeyor provide a [Nuget Feed](https://ci.appveyor.com/nuget/Ubiquity.Llvm.NET
43-
) of the NuGet package built from the lates source in the master branch.
46+
### CI Build NuGet Packages
47+
The CI Builds on AppVeyor provide a [NuGet Feed](https://ci.appveyor.com/NuGet/Ubiquity.Llvm.NET
48+
) of the NuGet package built from the latest source in the master branch.
4449

45-
### Building Llvm.NET
46-
#### Pre-requsites
50+
### API Documentation
51+
The full API documentation on using Llvm.NET is available on the [Llvm.NET documentation site](https://ubiquitydotnet.github.io/Llvm.NET/).
52+
53+
## Building Llvm.NET
54+
### Pre-requsites
4755
* Visual Studio 2017 (15.4+)
48-
* Llvm.Libs Nuget Package
49-
- To build the Llvm.Libs nuget package locally you can use the build support from the [Llvm.Libs ](https://github.com/UbiquityDotNET/Llvm.Libs) repository
56+
* Llvm.Libs NuGet Package
57+
- To build the Llvm.Libs NuGet package locally you can use the build support from the [Llvm.Libs ](https://github.com/UbiquityDotNET/Llvm.Libs) repository
5058

5159
#### Using Visual Studio
5260
The repository contains a Visual Studio solution files that allow building the components individually for modifying
5361
Llvm.NET and LibLLVM, as well as running the available unit tests. This is the primary mode of working with the
54-
Llvm.NET source code duing development.
62+
Llvm.NET source code during development.
5563

56-
#### Replicating the automated build
57-
The Automated build support for Llvm.NET uses BuildAll.ps1 powershell script to build all the binaries, sign them
58-
[SHA256 hash only at present], and generate a nuget package. To build the full package simply run `BuildAll.ps1`
59-
from a powershell command prompt with msbuild tools on the system search path.
64+
### Replicating the automated build
65+
The Automated build support for Llvm.NET uses BuildAll.ps1 PowerShell script to build all the binaries, sign them
66+
[SHA256 hash only at present], and generate a NuGet package. To build the full package simply run `BuildAll.ps1`
67+
from a PowerShell command prompt with MSBuild tools on the system search path.
6068

61-
#### Sample Application
69+
### Sample Application
6270
The [CodeGenWithDebugInfo](https://github.com/UbiquityDotNET/Llvm.Net/tree/master/Samples/CodeGenWithDebugInfo) sample application provides an example of using Llvm.NET to generate
6371
LLVM Bit code equivalent to what the Clang compiler generates for a [simple C language file](https://github.com/UbiquityDotNET/Llvm.Net/blob/master/Samples/CodeGenWithDebugInfo/Support%20Files/test.c).
64-
The sample applictation doesn't actually parse the source, instead it is a manually constructed and documented example of how to use Llvm.NET to accomplish the bit-code generation.
72+
The sample application doesn't actually parse the source, instead it is a manually constructed and documented example of how to use Llvm.NET to accomplish the bit-code generation.
6573

66-
#### Code of Conduct
74+
### Code of Conduct
6775
This project has adopted the code of conduct defined by the [Contributor Covenant](http://contributor-covenant.org/)
6876
to clarify expected behavior in our community. For more information, see the
6977
[.NET Foundation Code of Conduct.](http://www.dotnetfoundation.org/code-of-conduct)

Samples/Kaleidoscope/Kaleidoscope.Parser/Kaleidoscope.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ANTLR4 Grammar for the LLVM Tutorial Sample Kaleidoscope language
22
// To support a progression through the chapters the language features are
3-
// selectable and dynamicly adjust the parsing accordingly. This allows a
3+
// selectable and dynamically adjust the parsing accordingly. This allows a
44
// single parser implementation for all chapters, which allows the tutorial
55
// to focus on the actual use of Llvm.NET itself rather than on parsing.
66
//

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ nuget:
2525
build_script:
2626
- ps: .\BuildAll.ps1
2727

28+
deploy_script:
29+
- ps: .\Push-Docs.ps1
30+
2831
test_script:
2932
- ps: .\Invoke-UnitTests.ps1
3033
- ps: Set-Culture fr-FR; .\Invoke-UnitTests.ps1

docfx/Llvm.Net.Docfx.csproj

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<Project>
2+
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
3+
<PropertyGroup>
4+
<TargetFramework>net47</TargetFramework>
5+
</PropertyGroup>
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+
<ItemGroup>
19+
<None Remove="Docfx-*.log" />
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="docfx.console" Version="2.29.1" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" />
24+
<PackageReference Include="memberpage" Version="2.29.1" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" />
25+
<PackageReference Include="msdn.4.5.2" Version="0.1.0-alpha-1611021200" Condition="'$(TargetFramework)'=='net47'" PrivateAssets="All" />
26+
</ItemGroup>
27+
28+
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
29+
30+
<Target Name="GetDocfxPackagePaths" BeforeTargets="DocBuild">
31+
<ItemGroup>
32+
<docfxpkg Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='docfx.console'" />
33+
<memberpage Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='memberpage'" />
34+
<Msdn4_5_2 Include="@(PackageDefinitions)" Condition="'%(PackageDefinitions.Name)'=='msdn.4.5.2'" />
35+
<DocFxInputAssembly Include="@(ReferencePath)" Condition="'%(ReferencePath.ReferenceSourceTarget)'=='ProjectReference'" />
36+
</ItemGroup>
37+
<PropertyGroup>
38+
<DocfxConsolePath>%(docfxpkg.ResolvedPath)</DocfxConsolePath>
39+
<MemberPagePath>%(memberpage.ResolvedPath)</MemberPagePath>
40+
<MsdnXRefPath>%(msdn4_5_2.ResolvedPath)</MsdnXRefPath>
41+
<LogLevel>Warning</LogLevel>
42+
<LogFile>Docfx-$(TargetFramework).log</LogFile>
43+
<DocParameters>$(DocParameters) --disableGitFeatures</DocParameters>
44+
<DocParameters>$(DocParameters) --cleanupCacheHistory</DocParameters>
45+
<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>
48+
<DocTemplate>statictoc,$(MemberPagePath)\content,templates\Ubiquity</DocTemplate>
49+
</PropertyGroup>
50+
<Message Importance="high" Text="DocFxInputAssembly: %(DocFxInputAssembly.ReferenceAssembly)" />
51+
</Target>
52+
53+
<!-- Stub the build target as this project only builds the documentation -->
54+
<Target Name="CoreCompile" DependsOnTargets="$(CoreCompileDependsOn)">
55+
</Target>
56+
57+
<Target Name="CopyFilesToOutputDirectory">
58+
</Target>
59+
</Project>

docfx/articles/Samples/Kaleidoscope.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ When entered ( or copy/pasted) to the command line Kaleidoscope will print out t
110110
>This example uses features of the language only enabled/discussed in Chapter 6 of the tutorial.
111111
>The runtime from earlier chapters will generate errors trying to parse this code.
112112
113-
```
113+
```shell
114114
Ready>mandel(-2.3, -1.3, 0.05, 0.07);
115115
*******************************************************************************
116116
*******************************************************************************

docfx/docfx.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"src":
66
[
77
{
8-
"files": [ "src/Llvm.Net/**.cs" ],
8+
"files": [ "src/Llvm.Net/**.cs" ],
99
"src":".."
1010
}
1111
],
@@ -18,7 +18,6 @@
1818
],
1919
"build":
2020
{
21-
"xref": [ "llvm-xref.yml", "../tools/msdn.4.5.2/content/msdn.4.5.2.zip", "../tools/msdn.4.5.2/content/namespaces.4.5.2.zip"],
2221
"content":
2322
[
2423
{
@@ -60,8 +59,8 @@
6059
"_appFooter" : "Copyright (C) 2017, Dot NET Foundation",
6160
"_appLogoPath": "DragonSharp48x48.png",
6261
"_disableBreadcrumb" : true,
63-
"llvmVersion": "5.0.0"
62+
"llvmVersion": "5.0.0",
63+
"assemblies": ["Llvm.NET"],
6464
},
65-
"template": ["statictoc","../tools/memberpage/content","templates/Ubiquity"]
6665
}
6766
}

docfx/llvm-xref.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
references:
22
- uid: llvm_langref
33
name: LLVM Language reference
4-
href: http://releases.llvm.org/5.0.0/docs/LangRef.html
4+
href: http://releases.llvm.org/5.0.1/docs/LangRef.html
55
- uid: llvm_sourceleveldebugging
66
name: LLVM Source Level Debugging
7-
href: http://releases.llvm.org/5.0.0/docs/SourceLevelDebugging.html
7+
href: http://releases.llvm.org/5.0.1/docs/SourceLevelDebugging.html
88
- uid: llvm_docs_garbagecollection
99
name: LLVM Garbage Collection
10-
href: http://releases.llvm.org/5.0.0/docs/GarbageCollection.html
10+
href: http://releases.llvm.org/5.0.1/docs/GarbageCollection.html
1111
- uid: llvm_docs_passes
1212
name: LLVM Analysis and Transform Passes
13-
href: http://releases.llvm.org/5.0.0/docs/Passes.html
13+
href: http://releases.llvm.org/5.0.1/docs/Passes.html
1414
- uid: llvm_exception_handling
1515
name: LLVM Exception Handling
16-
href: http://releases.llvm.org/5.0.0/docs/ExceptionHandling.html
16+
href: http://releases.llvm.org/5.0.1/docs/ExceptionHandling.html
1717
- uid: llvm_misunderstood_gep
1818
name: LLVM The Misunderstood GEP Instruction
19-
href: http://releases.llvm.org/5.0.0/docs/GetElementPtr.html
19+
href: http://releases.llvm.org/5.0.1/docs/GetElementPtr.html
2020
- uid: llvm_sourcelevel_debugging
2121
name: LLVM Source Level Debugging
22-
href: http://releases.llvm.org/5.0.0/docs/SourceLevelDebugging.html
22+
href: http://releases.llvm.org/5.0.1/docs/SourceLevelDebugging.html

0 commit comments

Comments
 (0)