Skip to content

Commit 757067b

Browse files
committed
updated build script xmldoc patch to save in the same xml file
Implemented fake task that patches xml docs to support <inheritdoc /> for interface implementations, removed snadcastle which is way tooo slow to be useful :( fixed failing unit test post-refactor fixed failing builds due to internalvisibleto being removed nest & elasticsearch.net sign from the csproj file now, remove need for internalsvisibleto, fixed broken yaml test generator
1 parent df2bfc9 commit 757067b

File tree

161 files changed

+1725
-1169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1725
-1169
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,14 @@ build/*
4141
build/tools/*
4242
!build/tools/sn
4343
!build/tools/ilmerge
44+
!build/*.fsx
45+
!build/*.fsx
46+
!build/*.ps1
47+
4448
/dep/Newtonsoft.Json.4.0.2
4549
!new_docs/build
4650
new_docs/node_modules
51+
doc/Help
4752

4853
/src/Nest.Tests.Unit/*.ncrunchproject
4954
*.ncrunchproject

build/InheritDoc.fsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#r "System.Xml.Linq.dll"
2+
open System.Xml
3+
open System.Xml.XPath
4+
open System.Linq
5+
open System.Xml.Linq
6+
open System.Text.RegularExpressions
7+
8+
let PatchXmlDoc = fun (file: string) ->
9+
let xml = XDocument.Load file
10+
let nodes = xml.XPathSelectElements("//inheritdoc")
11+
|> Seq.map (fun n ->
12+
let methodName = n.Parent.Attribute(XName.Get("name")).Value
13+
let interfaceName = Regex.Replace(methodName, @"\.([^.]+\.[^.]+\()", ".I$1")
14+
let interfaceNode = xml.XPathSelectElement (sprintf "//member[@name='%s']" interfaceName)
15+
(n.Parent, interfaceNode)
16+
)
17+
|> Seq.filter (fun (implementationElement, interfaceElement) ->
18+
interfaceElement <> null && implementationElement.HasElements && interfaceElement.HasElements
19+
)
20+
let nodesReplace = nodes
21+
|> Seq.iter (fun (implementationElement, interfaceElement) ->
22+
implementationElement.Add (interfaceElement.Descendants().ToList())
23+
)
24+
25+
xml.Save file

build/build.fsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// include Fake lib
22
#r @"tools/FAKE/tools/FakeLib.dll"
3+
#load @"InheritDoc.fsx"
34
open Fake
45
open System
6+
open InheritDoc
7+
58

69
// Properties
710
let buildDir = "build/output/"
@@ -19,6 +22,10 @@ Target "BuildApp" (fun _ ->
1922
!! "src/**/*.csproj"
2023
|> Seq.map(fun f -> (f, buildDir + directoryInfo(f).Name.Replace(".csproj", "")))
2124
|> Seq.iter(fun (f,d) -> MSBuildRelease d "Build" (seq { yield f }) |> ignore)
25+
26+
//Scan for xml docs and patch them to replace <inheritdoc /> with the documentation
27+
//from their interfaces
28+
!! "build/output/Nest/Nest.xml" |> Seq.iter(fun f -> PatchXmlDoc f)
2229
)
2330

2431
Target "Test" (fun _ ->
@@ -69,7 +76,7 @@ let nugetPack = fun name ->
6976
CreateDir nugetOutDir
7077

7178
let dir = sprintf "%s/%s/" buildDir name
72-
let version = "1.0.0-c2"
79+
let version = "1.0.0-c4"
7380
NuGetPack (fun p ->
7481
{p with
7582
Version = version
@@ -95,9 +102,9 @@ Target "Version" (fun _ ->
95102
let assemblyVersion = sprintf "%i.%i.0.0" version.Major version.Minor
96103

97104
trace (sprintf "%s %s" v assemblyVersion)
98-
99105
)
100106

107+
101108
Target "Release" (fun _ ->
102109
if not <| fileExists keyFile
103110
then failwithf "{0} does not exist to sign the assemblies" keyFile

doc/Help/Documentation.chm

-10.6 MB
Binary file not shown.

doc/documentation.shfbproj

Lines changed: 0 additions & 58 deletions
This file was deleted.

doc/ghostdoc.gdc

-122 KB
Binary file not shown.

src/CodeGeneration/CodeGeneration.LowLevelClient/Views/Enums.Generated.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace Elasticsearch.Net
3838
</text>
3939
}
4040

41-
internal static class KnownEnums
41+
public static class KnownEnums
4242
{
4343
public static string Resolve(Enum e)
4444
{

src/CodeGeneration/CodeGeneration.LowLevelClient/Views/RequestParameters.Generated.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace Elasticsearch.Net
4646
public @method.QueryStringParamName @(mm.ToPascalCase())(@kv.Value.CsharpType(mm) @mm)
4747
{
4848
this._@(mm) = @Raw(setter);
49-
this.Add("@mm", this._@mm);
49+
this.AddQueryString("@mm", this._@mm);
5050
return this;
5151
}
5252
</text>

src/CodeGeneration/CodeGeneration.LowLevelClient/Views/RequestParametersExtensions.Generated.cshtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ namespace Nest
5050
@Raw("IEnumerable<Expression<Func<T, object>>> ") @mm)
5151
where T : class
5252
{
53-
qs._@(mm) = @mm@Raw(".Select(e=>(PropertyPathMarker)e)");
54-
qs.Add("@mm", qs._@mm);
53+
var _@(mm) = @mm@Raw(".Select(e=>(PropertyPathMarker)e)");
54+
qs.AddQueryString("@mm", _@mm);
5555
return qs;
5656
}
5757
</text>
@@ -66,8 +66,8 @@ namespace Nest
6666
where T : class
6767
{
6868
var p = (PropertyPathMarker)@mm;
69-
qs._@(mm) = p;
70-
qs.Add("@mm", qs._@mm);
69+
var _@(mm) = p;
70+
qs.AddQueryString("@mm", _@mm);
7171
return qs;
7272
}
7373
</text>

src/CodeGeneration/CodeGeneration.YamlTestsRunner/Domain/DoStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private string GenerateCall(string call)
120120
{
121121
var nv = "nv=>nv\r\n";
122122
nv += queryStringKeys.Aggregate("",
123-
(current, k) => current + string.Format("\t\t\t\t\t.Add(\"{0}\", {1})\r\n", k, this.GetQueryStringValue(k)));
123+
(current, k) => current + string.Format("\t\t\t\t\t.AddQueryString(\"{0}\", {1})\r\n", k, this.GetQueryStringValue(k)));
124124
nv += "\t\t\t\t";
125125
args.Add(nv);
126126
}

0 commit comments

Comments
 (0)