Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "third_party/gopher-orch"]
path = third_party/gopher-orch
url = https://github.com/GopherSecurity/gopher-orch.git
branch = br_release
31 changes: 26 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${SCRIPT_DIR}/native" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_EXAMPLES=OFF \
-DBUILD_TESTS=OFF

# Build
echo -e "${YELLOW} Compiling...${NC}"
Expand Down Expand Up @@ -163,12 +165,30 @@ dotnet build -c Release
echo -e "${GREEN}✓ C# SDK built successfully${NC}"
echo ""

# Step 5: Run tests
echo -e "${YELLOW}Step 5: Running tests...${NC}"
dotnet test -c Release --no-build 2>/dev/null && echo -e "${GREEN}✓ Tests passed${NC}" || echo -e "${YELLOW}⚠ Some tests may have failed (native library required)${NC}"
# Step 5: Build Auth Example
echo -e "${YELLOW}Step 5: Building Auth MCP Server example...${NC}"
AUTH_EXAMPLE_DIR="${SCRIPT_DIR}/examples/auth"
if [ -d "${AUTH_EXAMPLE_DIR}" ]; then
dotnet build "${AUTH_EXAMPLE_DIR}/AuthMcpServer/AuthMcpServer.csproj" -c Release
dotnet build "${AUTH_EXAMPLE_DIR}/AuthMcpServer.Tests/AuthMcpServer.Tests.csproj" -c Release
echo -e "${GREEN}✓ Auth example built successfully${NC}"
else
echo -e "${YELLOW}⚠ Auth example not found at ${AUTH_EXAMPLE_DIR}${NC}"
fi
echo ""

# Step 6: Run tests
echo -e "${YELLOW}Step 6: Running tests...${NC}"
dotnet test -c Release --no-build 2>/dev/null && echo -e "${GREEN}✓ SDK tests passed${NC}" || echo -e "${YELLOW}⚠ Some SDK tests may have failed (native library required)${NC}"

# Run auth example tests
if [ -d "${AUTH_EXAMPLE_DIR}" ]; then
echo -e "${YELLOW} Running Auth example tests...${NC}"
dotnet test "${AUTH_EXAMPLE_DIR}/AuthMcpServer.Tests/AuthMcpServer.Tests.csproj" -c Release --no-build && echo -e "${GREEN}✓ Auth example tests passed${NC}" || echo -e "${YELLOW}⚠ Some Auth example tests failed${NC}"
fi

# Package NuGet
echo -e "${YELLOW}Step 6: Packaging NuGet...${NC}"
echo -e "${YELLOW}Step 7: Packaging NuGet...${NC}"
dotnet pack -c Release --no-build -o "${SCRIPT_DIR}/packages"
echo -e "${GREEN}✓ NuGet package created${NC}"

Expand All @@ -181,3 +201,4 @@ echo -e "Native libraries: ${YELLOW}${NATIVE_LIB_DIR}${NC}"
echo -e "Native headers: ${YELLOW}${NATIVE_INCLUDE_DIR}${NC}"
echo -e "Run tests: ${YELLOW}dotnet test${NC}"
echo -e "Package NuGet: ${YELLOW}dotnet pack${NC}"
echo -e "Run Auth example: ${YELLOW}cd examples/auth && ./run_example.sh${NC}"
66 changes: 66 additions & 0 deletions examples/auth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Visual Studio
.vs/
*.user
*.userosscache
*.sln.docstates
*.suo
*.cache

# Visual Studio Code
.vscode/

# JetBrains Rider
.idea/
*.sln.iml

# NuGet
*.nupkg
*.snupkg
**/[Pp]ackages/*
!**/[Pp]ackages/build/
*.nuget.props
*.nuget.targets

# Project files
*.csproj.user
project.lock.json
project.fragment.lock.json

# ASP.NET Scaffolding
ScaffoldingReadMe.txt

# StyleCop
StyleCopReport.xml

# Test Results
[Tt]est[Rr]esult*/
*.trx
*.coverage
*.coveragexml
[Cc]overage/
coverage*.json
coverage*.xml
*.coverlet.json

# Publish
publish/

# OS files
.DS_Store
Thumbs.db
29 changes: 29 additions & 0 deletions examples/auth/AuthMcpServer.Tests/AuthMcpServer.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="FluentAssertions" Version="8.9.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AuthMcpServer\AuthMcpServer.csproj" />
</ItemGroup>

</Project>
Loading