Skip to content

Commit 570cc4c

Browse files
authored
Fix API doc generation
1 parent 5e38ff3 commit 570cc4c

8 files changed

Lines changed: 77 additions & 23 deletions

File tree

MongoDB.EFCoreProvider.sln

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
2424
CODEOWNERS = CODEOWNERS
2525
createpr.png = createpr.png
2626
packageIcon.png = packageIcon.png
27-
global.json = global.json
2827
nuget.config = nuget.config
2928
sbom.json = sbom.json
3029
syncfork.png = syncfork.png
@@ -102,7 +101,7 @@ Global
102101
{1BFBE183-6125-402E-826B-1F7A7F86AF00}.Debug EF10|Any CPU.Build.0 = Debug EF10|Any CPU
103102
{1BFBE183-6125-402E-826B-1F7A7F86AF00}.Release EF10|Any CPU.ActiveCfg = Release EF10|Any CPU
104103
{1BFBE183-6125-402E-826B-1F7A7F86AF00}.Release EF10|Any CPU.Build.0 = Release EF10|Any CPU
105-
EndGlobalSection
104+
EndGlobalSection
106105
GlobalSection(SolutionProperties) = preSolution
107106
HideSolutionNode = FALSE
108107
EndGlobalSection

apidocs/docfx.json

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,21 @@
33
{
44
"src": [
55
{
6-
"files": ["MongoDB.EntityFrameworkCore.dll"],
7-
"src": "../src/MongoDB.EntityFrameworkCore/bin/Debug EF10/net10.0"
6+
"files": [
7+
"**/*.csproj"
8+
],
9+
"exclude": [
10+
"**/bin/**",
11+
"**/obj/**"
12+
],
13+
"src": "../src"
814
}
915
],
1016
"dest": "api",
1117
"includePrivateMembers": false,
1218
"disableGitFeatures": false,
1319
"disableDefaultFilter": false,
14-
"noRestore": false,
20+
"noRestore": true,
1521
"namespaceLayout": "flattened",
1622
"memberLayout": "separatePages",
1723
"EnumSortOrder": "declaringOrder",
@@ -21,20 +27,32 @@
2127
"build": {
2228
"content": [
2329
{
24-
"files": ["api/**.yml", "api/index.md", "api/MongoDB.md"]
30+
"files": [
31+
"api/**.yml",
32+
"api/index.md",
33+
"api/MongoDB.md"
34+
]
2535
},
2636
{
27-
"files": ["*.md"]
37+
"files": [
38+
"*.md"
39+
]
2840
}
2941
],
3042
"resource": [
3143
{
32-
"files": ["images/**"]
44+
"files": [
45+
"images/**"
46+
]
3347
}
3448
],
3549
"globalMetadataFiles": [],
3650
"fileMetadataFiles": [],
37-
"template": ["default", "modern", "mongo-apidocs"],
51+
"template": [
52+
"default",
53+
"modern",
54+
"mongo-apidocs"
55+
],
3856
"postProcessors": [],
3957
"keepFileLink": false,
4058
"disableGitFeatures": false,

evergreen/build-apidocs.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
set -o errexit # Exit the script with error if any of the commands fail
33

44
if [ -z "$PACKAGE_VERSION" ]; then
5-
PACKAGE_VERSION=$(sh ./evergreen/generate-version.sh)
65
echo Calculated PACKAGE_VERSION value: "$PACKAGE_VERSION"
76
fi
87

@@ -12,6 +11,24 @@ dotnet new tool-manifest --force
1211
echo "Installing docfx tool"
1312
dotnet tool install docfx --version "2.78.4" --local --verbosity q
1413

15-
echo "Building the api-docs"
16-
dotnet tool run docfx metadata ./apidocs/docfx.json --property ProduceReferenceAssembly=true
14+
BUILD_CONFIGURATION=""
15+
if [[ "${PACKAGE_VERSION}" == "8."* ]]; then
16+
BUILD_CONFIGURATION="Release EF8"
17+
fi
18+
if [[ "${PACKAGE_VERSION}" == "9."* ]]; then
19+
BUILD_CONFIGURATION="Release EF9"
20+
fi
21+
if [[ "${PACKAGE_VERSION}" == "10."* ]]; then
22+
BUILD_CONFIGURATION="Release EF10"
23+
fi
24+
25+
# Check if BUILD_CONFIGURATION is set
26+
if [ -z "$BUILD_CONFIGURATION" ]; then
27+
echo "Error: Unknown PACKAGE_VERSION $PACKAGE_VERSION found. Update get-build-release-config.sh to handle this version."
28+
exit 1
29+
fi
30+
31+
echo "Building the api-docs for '${PACKAGE_VERSION} using '${BUILD_CONFIGURATION}'"
32+
dotnet restore src/MongoDB.EntityFrameworkCore/MongoDB.EntityFrameworkCore.csproj -p:Configuration="${BUILD_CONFIGURATION}"
33+
dotnet tool run docfx metadata ./apidocs/docfx.json --property "Configuration=${BUILD_CONFIGURATION};ProduceReferenceAssembly=true"
1734
dotnet tool run docfx build ./apidocs/docfx.json -o:./artifacts/apidocs/"$PACKAGE_VERSION"

evergreen/pack-packages.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@ if [ -z "$PACKAGE_VERSION" ]; then
66
echo Calculated PACKAGE_VERSION value: "$PACKAGE_VERSION"
77
fi
88

9-
BUILD_CONFIGURATION="Release"
9+
BUILD_CONFIGURATION=""
10+
if [[ "${PACKAGE_VERSION}" == "8."* ]]; then
11+
BUILD_CONFIGURATION="Release EF8"
12+
fi
1013
if [[ "${PACKAGE_VERSION}" == "9."* ]]; then
1114
BUILD_CONFIGURATION="Release EF9"
1215
fi
16+
if [[ "${PACKAGE_VERSION}" == "10."* ]]; then
17+
BUILD_CONFIGURATION="Release EF10"
18+
fi
19+
20+
# Check if BUILD_CONFIGURATION is set
21+
if [ -z "$BUILD_CONFIGURATION" ]; then
22+
echo "Error: Unknown PACKAGE_VERSION $PACKAGE_VERSION found. Update get-build-release-config.sh to handle this version."
23+
exit 1
24+
fi
1325

1426
echo Creating nuget package $PACKAGE_VERSION using $BUILD_CONFIGURATION build configuration...
1527

evergreen/run-smoke-tests.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,22 @@ MONGODB_URI=${MONGODB_URI:=mongodb://localhost:27017/}
66
EFCORE_PROVIDER_PROJECT="./src/MongoDB.EntityFrameworkCore/MongoDB.EntityFrameworkCore.csproj"
77
TESTS_PROJECT="./tests/MongoDB.EntityFrameworkCore.FunctionalTests/MongoDB.EntityFrameworkCore.FunctionalTests.csproj"
88

9-
BUILD_CONFIGURATION="Debug"
9+
BUILD_CONFIGURATION=""
10+
if [[ "${PACKAGE_VERSION}" == "8."* ]]; then
11+
BUILD_CONFIGURATION="Debug EF8"
12+
fi
1013
if [[ "${PACKAGE_VERSION}" == "9."* ]]; then
1114
BUILD_CONFIGURATION="Debug EF9"
1215
fi
16+
if [[ "${PACKAGE_VERSION}" == "10."* ]]; then
17+
BUILD_CONFIGURATION="Debug EF10"
18+
fi
19+
20+
# Check if BUILD_CONFIGURATION is set
21+
if [ -z "$BUILD_CONFIGURATION" ]; then
22+
echo "Error: Unknown PACKAGE_VERSION $PACKAGE_VERSION found. Update get-build-release-config.sh to handle this version."
23+
exit 1
24+
fi
1325

1426
echo Retargeting API tests to use generated package instead of project dependency...
1527
dotnet nuget add source "./artifacts/nuget" -n local --configfile "./nuget.config"

evergreen/run-tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
set -o errexit # Exit the script with error if any of the commands fail
33

44
MONGODB_URI=${MONGODB_URI:=mongodb://localhost:27017/}
5-
BUILD_CONFIGURATION=${BUILD_CONFIGURATION:=Debug}
6-
75
EFCORE_PROVIDER_PROJECT_PATH="./src/MongoDB.EntityFrameworkCore/MongoDB.EntityFrameworkCore.csproj"
6+
87
if [ -n "$DRIVER_VERSION" ]
98
then
109
## Update Driver's package reference if specified

global.json

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

src/MongoDB.EntityFrameworkCore/MongoDB.EntityFrameworkCore.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<PackageId>MongoDB.EntityFrameworkCore</PackageId>
77
<Configurations>Debug EF8;Release EF8;Debug EF9;Release EF9;Debug EF10;Release EF10</Configurations>
88
<Platforms>AnyCPU</Platforms>
9+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
910
</PropertyGroup>
1011

1112
<Import Project="..\..\Versions.props" />
@@ -23,6 +24,7 @@
2324

2425
<PropertyGroup Condition=" '$(Configuration)' == 'Release EF8' ">
2526
<DefineConstants>TRACE;RELEASE;EF8</DefineConstants>
27+
<DocumentationFile>bin\Release EF8\MongoDB.EntityFrameworkCore.xml</DocumentationFile>
2628
<Optimize>true</Optimize>
2729
</PropertyGroup>
2830

@@ -34,6 +36,7 @@
3436

3537
<PropertyGroup Condition=" '$(Configuration)' == 'Release EF9' ">
3638
<DefineConstants>TRACE;RELEASE;EF9</DefineConstants>
39+
<DocumentationFile>bin\Release EF9\MongoDB.EntityFrameworkCore.xml</DocumentationFile>
3740
<Optimize>true</Optimize>
3841
</PropertyGroup>
3942

@@ -47,6 +50,7 @@
4750
<PropertyGroup Condition=" '$(Configuration)' == 'Release EF10' ">
4851
<TargetFramework>net10.0</TargetFramework>
4952
<DefineConstants>TRACE;RELEASE;EF10</DefineConstants>
53+
<DocumentationFile>bin\Release EF10\MongoDB.EntityFrameworkCore.xml</DocumentationFile>
5054
<Optimize>true</Optimize>
5155
</PropertyGroup>
5256

0 commit comments

Comments
 (0)