Skip to content

Commit cd3064e

Browse files
committed
Add DocFx project
Use "dotnet msbuild" command
1 parent c8f415f commit cd3064e

File tree

3 files changed

+95
-6
lines changed

3 files changed

+95
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
## Generated files
33
###################
44

5+
api/
6+
_site/
57
gensrc/
68
[Ll]ocal.props
79
[Ll]ocal.dist

build.sh

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,23 @@
22

33
set -e
44

5-
SCRIPT=$0
6-
SCRIPT_DIR=$(cd $(dirname "$SCRIPT") && pwd)
5+
if command -v realpath >/dev/null 2>&1
6+
then
7+
readonly script_dir="$(dirname "$(realpath "$0")")"
8+
else
9+
readonly script_dir="$(cd "$(dirname "$0")" && pwd)"
10+
fi
711

812
dotnet restore ./RabbitMQDotNetClient.sln
9-
dotnet run -p $SCRIPT_DIR/projects/client/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 $SCRIPT_DIR/docs/specs/amqp0-9-1.stripped.xml $SCRIPT_DIR/gensrc/autogenerated-api-0-9-1.cs
10-
# we have to use msbuild or else multi-targeting doesn't work
11-
msbuild $SCRIPT_DIR/projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj
12-
dotnet build $SCRIPT_DIR/projects/client/Unit/Unit.csproj
13+
dotnet run -p "$script_dir/projects/client/Apigen/Apigen.csproj" --apiName:AMQP_0_9_1 \
14+
"$script_dir/docs/specs/amqp0-9-1.stripped.xml" \
15+
"$script_dir/gensrc/autogenerated-api-0-9-1.cs"
16+
17+
if command -v msbuild >/dev/null 2>&1
18+
then
19+
# we have to use msbuild or else multi-targeting doesn't work
20+
msbuild "$script_dir/projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj"
21+
else
22+
dotnet msbuild "$script_dir/projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj"
23+
fi
24+
dotnet build "$script_dir/projects/client/Unit/Unit.csproj"

docfx.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"metadata": [
3+
{
4+
"src": [
5+
{
6+
"files": [
7+
"projects/**.csproj"
8+
],
9+
"exclude": [
10+
"**/obj/**",
11+
"**/bin/**",
12+
"_site/**"
13+
]
14+
}
15+
],
16+
"dest": "api",
17+
"disableGitFeatures": false
18+
}
19+
],
20+
"build": {
21+
"content": [
22+
{
23+
"files": [
24+
"api/**.yml",
25+
"api/index.md"
26+
]
27+
},
28+
{
29+
"files": [
30+
"articles/**.md",
31+
"articles/**/toc.yml",
32+
"toc.yml",
33+
"*.md"
34+
],
35+
"exclude": [
36+
"obj/**",
37+
"_site/**"
38+
]
39+
}
40+
],
41+
"resource": [
42+
{
43+
"files": [
44+
"images/**"
45+
],
46+
"exclude": [
47+
"obj/**",
48+
"_site/**"
49+
]
50+
}
51+
],
52+
"overwrite": [
53+
{
54+
"files": [
55+
"apidoc/**.md"
56+
],
57+
"exclude": [
58+
"obj/**",
59+
"_site/**"
60+
]
61+
}
62+
],
63+
"dest": "_site",
64+
"globalMetadataFiles": [],
65+
"fileMetadataFiles": [],
66+
"template": [
67+
"default"
68+
],
69+
"postProcessors": [],
70+
"noLangKeyword": false,
71+
"keepFileLink": false,
72+
"cleanupCacheHistory": false,
73+
"disableGitFeatures": false
74+
}
75+
}

0 commit comments

Comments
 (0)