Skip to content

Commit 5d5ad31

Browse files
committed
Build: include api docs generation in FAKE build (and include docu, for now)
1 parent 2adc6ba commit 5d5ad31

26 files changed

+620
-6
lines changed

MAINTAINING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ Repository:
1111
- Update RELEASENOTES file with relevant changes, attributed by contributor (if external). Set date.
1212
- Update CONTRIBUTORS file (via `git shortlog -sn`)
1313
- Create and publish a new annotated git tag for the release, e.g. `git tag -a v2.5.0 -m "v2.5.0"`
14-
- Consider to resync the subtree in the native provider repository.
1514
- Consider to update the repository mirrors at codeplex, gitorious and google ([how to](http://christoph.ruegg.name/blog/2013/1/26/git-howto-mirror-a-github-repository-without-pull-refs.html)).
1615

1716
Publish:
1817

1918
- Generate manual release build from internal TeamCity
2019
- Update release notes in NuGet packages (using package explorer)
21-
- Create new codeplex release, attach Zip files
2220
- Upload NuGet packages to the NuGet Gallery
21+
- Create new Codeplex and GitHub release, attach Zip files
2322

2423
Misc:
2524

build.fsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
#I @"packages/FAKE/tools"
66
#r @"packages/FAKE/tools/FakeLib.dll"
77

8-
open Fake
9-
open Fake.Git
10-
open Fake.AssemblyInfoFile
11-
open Fake.ReleaseNotesHelper
8+
open Fake
9+
open Fake.DocuHelper
1210
open System
1311

1412
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
@@ -113,6 +111,20 @@ Target "DocsDev" (fun _ ->
113111
==> "DocsDev"
114112

115113

114+
// API REFERENCE
115+
116+
Target "CleanApi" (fun _ -> CleanDirs ["out" @@ "api"])
117+
118+
Target "Api" (fun _ ->
119+
!! "out/lib/Net40/MathNet.Numerics.dll"
120+
|> Docu (fun p ->
121+
{ p with
122+
ToolPath = "tools/docu/docu.exe"
123+
TemplatesPath = "tools/docu/templates/"
124+
TimeOut = TimeSpan.FromMinutes 10.
125+
OutputPath = "out/api/" }))
126+
127+
116128
// NUGET
117129

118130
Target "NuGet" (fun _ ->

tools/docu/Spark.dll

311 KB
Binary file not shown.

tools/docu/docu.exe

81.5 KB
Binary file not shown.

tools/docu/docu.exe.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0"?>
2+
<configuration>
3+
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup></configuration>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3+
<head>
4+
<title>${h(Type.PrettyName)} - ${WriteProductName(Assemblies[0])} Documentation</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
<link type="text/css" rel="stylesheet" href="../main.css" />
7+
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
8+
<script type="text/javascript" src="../js/jquery.scrollTo-min.js"></script>
9+
<script type="text/javascript" src="../js/navigation.js"></script>
10+
<script type="text/javascript" src="../js/example.js"></script>
11+
</head>
12+
<body>
13+
<namespaces />
14+
<types />
15+
<div class="header">
16+
<p class="class"><strong>Type</strong> ${h(Type.PrettyName)}</p>
17+
<p><strong>Namespace</strong> ${Namespace.Name}</p>
18+
<p if="Type.ParentType != null && Type.ParentType.PrettyName != 'object'"><strong>Parent</strong> ${Format(Type.ParentType)}</p>
19+
<p if="Type.Interfaces.Count > 0"><strong>Interfaces</strong> ${WriteInterfaces(Type.Interfaces)}</p>
20+
</div>
21+
<div class="sub-header">
22+
<if condition="(Type.Summary != null && Type.Summary.Children.Count() > 0) || (Type.Remarks != null && Type.Remarks.Children.Count() > 0)">
23+
<div id="summary">
24+
<comment content="Type.Summary" />
25+
<remarks content="Type.Remarks" />
26+
<example content="Type.Example" />
27+
</div>
28+
</if>
29+
<if condition="Type.IsObsolete">
30+
<div id="warning">
31+
<b>Obsolete:</b> ${Type.ObsoleteReason}
32+
</div>
33+
</if>
34+
35+
<if condition="Type.Methods.Where(x => x.IsConstructor).Count() > 0">
36+
<h3 class="section">Constructors</h3>
37+
<ul>
38+
<li each="var method in Type.Methods.Where(x => x.IsConstructor)">${Format(method)}</li>
39+
</ul>
40+
</if>
41+
42+
<if condition="Type.Methods.Where(x => !x.IsConstructor && x.IsStatic).Count() > 0">
43+
<h3 class="section">Static Functions</h3>
44+
<ul>
45+
<li each="var method in Type.Methods.Where(x => !x.IsConstructor && x.IsStatic)">${Format(method)}</li>
46+
</ul>
47+
</if>
48+
<if condition="!Type.IsStatic && Type.Methods.Where(x => !x.IsConstructor && !x.IsStatic).Count() > 0">
49+
<h3 class="section">Methods</h3>
50+
<ul>
51+
<li each="var method in Type.Methods.Where(x => !x.IsConstructor && !x.IsStatic)">${Format(method)}</li>
52+
</ul>
53+
</if>
54+
55+
<if condition="Type.Events.Count > 0">
56+
<h3 class="section">Events</h3>
57+
<ul>
58+
<li each="var ev in Type.Events">${Format(ev)}</li>
59+
</ul>
60+
</if>
61+
62+
<if condition="Type.Properties.Count > 0">
63+
<h3 class="section">Properties</h3>
64+
<ul>
65+
<li each="var property in Type.Properties">${Format(property)}</li>
66+
</ul>
67+
</if>
68+
69+
<if condition="Type.Fields.Count > 0">
70+
<h3 class="section">Fields</h3>
71+
<ul>
72+
<li each="var field in Type.Fields">${Format(field)}</li>
73+
</ul>
74+
</if>
75+
</div>
76+
77+
<events events="Type.Events" title="'Events'" />
78+
79+
<var publicConstructors="Type.Methods.Where(x => x.IsPublic && x.IsConstructor)" />
80+
<methods methods="publicConstructors" title="'Public Constructors'" />
81+
82+
<var publicStaticMethods="Type.Methods.Where(x => x.IsPublic && x.IsStatic)" />
83+
<methods methods="publicStaticMethods" title="'Public Static Functions'" />
84+
85+
<if condition="!Type.IsStatic">
86+
<var publicInstanceMethods="Type.Methods.Where(x => x.IsPublic && !x.IsStatic && !x.IsConstructor)" />
87+
<methods methods="publicInstanceMethods" title="'Public Methods'" />
88+
</if>
89+
90+
<properties properties="Type.Properties" title="'Public Properties'" />
91+
<fields fields="Type.Fields" title="'Public fields'" />
92+
93+
<use file="../_footer" />
94+
</body>
95+
</html>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
${Format(content)}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<if condition="events.Count() > 0">
2+
<h3 class="section">${title}</h3>
3+
4+
<div id="${ev.Name}" class="method" each="var ev in events">
5+
<h4><strong>${h(ev.Name)}</strong></h4>
6+
<div class="content">
7+
<comment content="ev.Summary" />
8+
<remarks content="ev.Remarks" />
9+
<example content="ev.Example" />
10+
</div>
11+
</div>
12+
</if>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div class="example" if="content != null && content.Children.Count() > 0">
2+
<a href="javascript:void(0)">Show Example</a>
3+
<pre>${Format(content)}</pre>
4+
</div>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<if condition="fields.Count() > 0">
2+
<h3 class="section">${title}</h3>
3+
4+
<div id="${field.Name}" class="method" each="var field in fields">
5+
<h4>${h(field.ReturnType.PrettyName)} <strong>${h(field.Name)}</strong></h4>
6+
<div class="content">
7+
<comment content="field.Summary" />
8+
<remarks content="field.Remarks" />
9+
<table>
10+
<tr>
11+
<td>
12+
<code>return ${Format(field.ReturnType)}</code>
13+
</td>
14+
</tr>
15+
</table>
16+
<example content="field.Example" />
17+
</div>
18+
</div>
19+
</if>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<if condition="methods.Count() > 0">
2+
<h3 class="section">${title}</h3>
3+
4+
<div id="${method.Name}" class="method" each="var method in methods">
5+
<h4>${Format(method.ReturnType)} <strong>${h(method.PrettyName)}</strong>(${OutputMethodParams(method)})</h4>
6+
<div class="content">
7+
<comment content="method.Summary" />
8+
<remarks content="method.Remarks" />
9+
<if condition="method.IsObsolete">
10+
<div id="warning">
11+
<b>Obsolete:</b> ${method.ObsoleteReason}
12+
</div>
13+
</if>
14+
15+
<var hasReturn="method.ReturnType != null && method.ReturnType.PrettyName != 'void'" />
16+
<var hasParams="method.Parameters.Any(x => x.HasDocumentation)" />
17+
18+
<div class="parameters" if="hasParams">
19+
<h5>Parameters</h5>
20+
21+
<for each="var param in method.Parameters">
22+
<h6><code>${Format(param.Reference)}</code> ${param.Name}</h6>
23+
<p class="comments" if="!param.Summary.IsEmpty"><comment content="param.Summary" /></p>
24+
</for>
25+
</div>
26+
27+
<div class="return" if="!method.Returns.IsEmpty">
28+
<h5>Return</h5>
29+
<h6><code>${Format(method.ReturnType)}</code></h6>
30+
<p><comment content="method.Returns" /></p>
31+
</div>
32+
33+
<value content="method.Value" />
34+
<example content="method.Example" />
35+
</div>
36+
</div>
37+
</if>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div id="namespaces">
2+
<h2 class="fixed">Namespaces</h2>
3+
<div class="scroll">
4+
<ul>
5+
<li each="var ns in Namespaces">
6+
<if condition="ns == Namespace">
7+
${Format(ns, class => "current")}
8+
<else />
9+
${Format(ns)}
10+
</if>
11+
</li>
12+
</ul>
13+
</div>
14+
</div>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<if condition="properties.Count() > 0">
2+
<h3 class="section">${title}</h3>
3+
4+
<div id="${property.Name}" class="method" each="var property in properties">
5+
<h4>${Format(property.ReturnType)} <strong>${h(property.Name)}</strong> <if condition="property.HasGet">get;</if> <if condition="property.HasSet">set;</if></h4>
6+
<div class="content">
7+
<comment content="property.Summary" />
8+
<remarks content="property.Remarks" />
9+
<if condition="property.IsObsolete">
10+
<div id="warning">
11+
<b>Obsolete:</b> ${property.ObsoleteReason}
12+
</div>
13+
</if>
14+
15+
<div class="return" if="property.ReturnType.HasDocumentation">
16+
<h5>Property type</h5>
17+
<h6><code>${Format(property.ReturnType)}</code></h6>
18+
<p><comment content="property.ReturnType.Summary" /></p>
19+
</div>
20+
<value content="property.Value" />
21+
<example content="property.Example" />
22+
</div>
23+
</div>
24+
</if>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<blockquote class="remarks" if="content != null && content.Children.Count() > 0">
2+
${Format(content)}
3+
</blockquote>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<div id="types">
2+
<h2 class="fixed">Types in ${Namespace.PrettyName}</h2>
3+
<div class="scroll">
4+
<ul>
5+
<li each="var type in Namespace.Types">
6+
<if condition="type == Type">
7+
${Format(type, class => "current")}
8+
<else />
9+
${Format(type)}
10+
</if>
11+
</li>
12+
</ul>
13+
</div>
14+
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<blockquote class="value" if="content.Children.Count() > 0">
2+
<strong>Value: </strong>${Format(content)}
3+
</blockquote>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3+
<head>
4+
<title>${Namespace.Name} - ${WriteProductName(Assemblies[0])} Documentation</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
<link type="text/css" rel="stylesheet" href="../main.css" />
7+
<script type="text/javascript" src="../js/jquery-1.3.2.min.js"></script>
8+
<script type="text/javascript" src="../js/jquery.scrollTo-min.js"></script>
9+
<script type="text/javascript" src="../js/navigation.js"></script>
10+
</head>
11+
<body>
12+
<namespaces />
13+
<types />
14+
<div class="header">
15+
<p class="class"><strong>Namespace</strong> ${Namespace.Name}</p>
16+
</div>
17+
<div class="sub-header">
18+
<if condition="Namespace.HasClasses">
19+
<h3 class="section">Classes</h3>
20+
<ul>
21+
<for each="var type in Namespace.Classes">
22+
<li>${Format(type)}</li>
23+
</for>
24+
</ul>
25+
</if>
26+
27+
<if condition="Namespace.HasInterfaces">
28+
<h3 class="section">Interfaces</h3>
29+
<ul>
30+
<for each="var type in Namespace.Interfaces">
31+
<li>${Format(type)}</li>
32+
</for>
33+
</ul>
34+
</if>
35+
<p if="!Namespace.HasTypes">This namespace is empty.</p>
36+
</div>
37+
38+
<use file="../_footer" />
39+
</body>
40+
</html>

tools/docu/templates/_footer.spark

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div id="footer">
2+
<p>Based on v${WriteVersion(Assemblies[0])} of ${WriteAssemblyTitle(Assemblies[0])}</p>
3+
<p>Generated by <a href="http://docu.jagregory.com">docu</a></p>
4+
</div>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div id="namespaces">
2+
<h2 class="fixed">Namespaces</h2>
3+
<div class="scroll">
4+
<ul>
5+
<li each="var ns in Namespaces">${Format(ns)}</li>
6+
</ul>
7+
</div>
8+
</div>

tools/docu/templates/_types.spark

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<div id="types">
2+
<h2 class="fixed">All Types</h2>
3+
<div class="scroll">
4+
<ul>
5+
<for each="var ns in Namespaces">
6+
<li each="var type in ns.Types">${Format(type)}</li>
7+
</for>
8+
</ul>
9+
</div>
10+
</div>

tools/docu/templates/index.htm.spark

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
2+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3+
<head>
4+
<title>${WriteProductName(Assemblies[0])} Documentation</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
<link type="text/css" rel="stylesheet" href="main.css" />
7+
</head>
8+
<body>
9+
<namespaces />
10+
<types />
11+
<div class="header">
12+
<p class="class">${WriteProductName(Assemblies[0])} Documentation</p>
13+
</div>
14+
15+
<use file="_footer" />
16+
</body>
17+
</html>

0 commit comments

Comments
 (0)