Skip to content

Commit 46a5389

Browse files
committed
Merge branch 'enhancement/5.x-generate-documentation' into 5.x
2 parents 1d77a3c + 24811c2 commit 46a5389

File tree

6 files changed

+36
-10
lines changed

6 files changed

+36
-10
lines changed

build/scripts/Documentation.fsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,30 @@ open System
88
open Fake
99

1010
open Paths
11+
open System.IO
1112

1213
module Documentation =
1314

14-
let RunLitterateur = fun _ ->
15-
let litterateur = "src/CodeGeneration/Nest.Litterateur/bin/Release/Nest.Litterateur.exe"
15+
let Generate() =
16+
let generator = "build/output/v4.6/DocGenerator/DocGenerator.exe"
1617
ExecProcess (fun p ->
17-
p.WorkingDirectory <- "src/CodeGeneration/Nest.Litterateur/bin/Release"
18-
p.FileName <- litterateur
18+
p.WorkingDirectory <- "src/CodeGeneration/DocGenerator"
19+
p.FileName <- generator
1920
)
2021
(TimeSpan.FromMinutes (1.0)) |> ignore
2122

23+
// TODO: hook documentation validation into the process
24+
let Validate() =
25+
let elasticDocsDir = "../elasticsearch-docs"
26+
if (directoryExists elasticDocsDir = false) then
27+
let fullPath = combinePaths currentDirectory elasticDocsDir |> Path.GetFullPath
28+
traceFAKE "No elasticsearch docs repo found at %s. Cannot validate generated documentation" fullPath
29+
//else
30+
// Needs to be able to run the build_docs.pl perl script. The best options on Windows for this
31+
// are Cygwin or Linux Bash for Windows.
32+
//let docBuildScript = combinePaths elasticDocsDir "build_docs.pl"
2233

2334

35+
|> ignore
36+
2437

build/scripts/Paths.fsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module Projects =
2929

3030
type PrivateProject =
3131
| Tests
32-
32+
| DocGenerator
3333

3434

3535
type DotNetProject =
@@ -55,6 +55,7 @@ module Projects =
5555
| PrivateProject p ->
5656
match p with
5757
| Tests -> "Tests"
58+
| DocGenerator -> "DocGenerator"
5859

5960
static member TryFindName (name: string) =
6061
DotNetProject.All

build/scripts/Targets.fsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ open Versioning
1919
open Releasing
2020
open Profiling
2121
open XmlDocPatcher
22+
open Documentation
2223

2324
// Default target
2425
Target "Build" <| fun _ -> traceHeader "STARTING BUILD"
@@ -32,13 +33,17 @@ Target "Test" <| fun _ -> Tests.RunUnitTests()
3233
Target "InheritDoc" <| fun _ -> InheritDoc.patchInheritDocs()
3334

3435
Target "TestForever" <| fun _ -> Tests.RunUnitTestsForever()
35-
36+
3637
Target "Integrate" <| fun _ -> Tests.RunIntegrationTests (getBuildParamOrDefault "esversions" "") (getBuildParamOrDefault "escluster" "") (getBuildParamOrDefault "testfilter" "")
3738

3839
Target "Profile" <| fun _ -> Profiler.Run()
3940

4041
Target "Benchmark" <| fun _ -> Benchmarker.Run()
4142

43+
Target "Documentation" <| fun _ -> Documentation.Generate()
44+
45+
Target "QuickCompile" <| fun _ -> Build.QuickCompile()
46+
4247
Target "Version" <| fun _ ->
4348
Versioning.PatchAssemblyInfos()
4449
Versioning.PatchProjectJsons()
@@ -60,6 +65,7 @@ Target "Canary" <| fun _ ->
6065
==> "BuildApp"
6166
=?> ("Test", (not ((getBuildParam "skiptests") = "1")))
6267
==> "InheritDoc"
68+
==> "Documentation"
6369
==> "Build"
6470

6571
"Clean"

src/CodeGeneration/DocGenerator/DocGenerator.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<DebugSymbols>true</DebugSymbols>
2121
<DebugType>full</DebugType>
2222
<Optimize>false</Optimize>
23-
<OutputPath>..\Nest.Litterateur\bin\Net45\Debug\</OutputPath>
23+
<OutputPath>bin\Debug\</OutputPath>
2424
<DefineConstants>DEBUG;TRACE</DefineConstants>
2525
<ErrorReport>prompt</ErrorReport>
2626
<WarningLevel>4</WarningLevel>
@@ -29,7 +29,7 @@
2929
<PlatformTarget>AnyCPU</PlatformTarget>
3030
<DebugType>pdbonly</DebugType>
3131
<Optimize>true</Optimize>
32-
<OutputPath>..\Nest.Litterateur\bin\Net45\Release\</OutputPath>
32+
<OutputPath>bin\Release\</OutputPath>
3333
<DefineConstants>TRACE</DefineConstants>
3434
<ErrorReport>prompt</ErrorReport>
3535
<WarningLevel>4</WarningLevel>

src/CodeGeneration/DocGenerator/LitUp.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,15 @@ public static void Go(string[] args)
3939
file.SaveToDocumentationFolder();
4040
}
4141

42+
Console.ForegroundColor = ConsoleColor.Green;
43+
Console.WriteLine("Documentation generated.");
44+
Console.ResetColor();
45+
4246
if (Debugger.IsAttached)
47+
{
4348
Console.WriteLine("Press any key to continue...");
4449
Console.ReadKey();
50+
}
4551
}
4652
}
4753
}

src/CodeGeneration/DocGenerator/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ static Program()
1414
}
1515
else
1616
{
17-
InputDirPath = @"..\..\..\..\..\..\src\Tests";
18-
OutputDirPath = @"..\..\..\..\..\..\docs";
17+
InputDirPath = @"..\..\..\..\..\src\Tests";
18+
OutputDirPath = @"..\..\..\..\..\docs";
1919
}
2020
}
2121

0 commit comments

Comments
 (0)