Skip to content

Commit 49d62a1

Browse files
Rafal Maciagclaude
andcommitted
Use NuGet package in C# examples instead of ProjectReference
- Change BallDetection and SimpleClient to use RocketWelder.SDK NuGet package - Simplify Dockerfiles - no longer need to copy SDK source into build context - Examples now work as standalone templates for users - Version: 1.1.34-preview.616c539 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 616c539 commit 49d62a1

File tree

4 files changed

+14
-32
lines changed

4 files changed

+14
-32
lines changed

csharp/examples/BallDetection/BallDetection.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<ProjectReference Include="../../RocketWelder.SDK/RocketWelder.SDK.csproj" />
18+
<PackageReference Include="RocketWelder.SDK" Version="1.1.34-preview.616c539" />
1919
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
2020
<PackageReference Include="Emgu.CV" Version="4.11.0.5746" />
2121
<PackageReference Include="Emgu.CV.runtime.ubuntu-x64" Version="4.11.0.5746" />

csharp/examples/BallDetection/Dockerfile

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
# Multi-stage build for C# BallDetection example
22
# Sink-only example - detects ball and outputs via NNG (no frame modification)
3+
# Build context: csharp/ directory (run via build_docker_samples.sh)
34
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build
45
WORKDIR /src
56

6-
# Copy the SDK project files first
7-
COPY RocketWelder.SDK/RocketWelder.SDK.csproj RocketWelder.SDK/
7+
# Copy the project file and restore dependencies (SDK from NuGet)
8+
COPY examples/BallDetection/BallDetection.csproj .
9+
RUN dotnet restore
810

9-
# Copy the BallDetection project file
10-
COPY examples/BallDetection/BallDetection.csproj examples/BallDetection/
11-
12-
# Restore dependencies
13-
WORKDIR /src
14-
RUN dotnet restore examples/BallDetection/BallDetection.csproj
15-
16-
# Copy the source code
17-
COPY RocketWelder.SDK/ RocketWelder.SDK/
18-
COPY examples/BallDetection/ examples/BallDetection/
19-
20-
# Build and publish
21-
WORKDIR /src/examples/BallDetection
11+
# Copy the source code and build
12+
COPY examples/BallDetection/ .
2213
RUN dotnet publish -c Release -o /app/publish
2314

2415
# Runtime stage - Using Ubuntu 24.04 (Noble) for GLIBC 2.38+ compatibility

csharp/examples/SimpleClient/Dockerfile

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,15 @@
11
# Multi-stage build for C# SimpleClient
22
# Using .NET 10.0 Preview - required for SDK compatibility
3+
# Build context: csharp/ directory (run via build_docker_samples.sh)
34
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build
45
WORKDIR /src
56

6-
# Copy the SDK project files first
7-
COPY RocketWelder.SDK/RocketWelder.SDK.csproj RocketWelder.SDK/
7+
# Copy the project file and restore dependencies (SDK from NuGet)
8+
COPY examples/SimpleClient/SimpleClient.csproj .
9+
RUN dotnet restore
810

9-
# Copy the SimpleClient project file
10-
COPY examples/SimpleClient/SimpleClient.csproj examples/SimpleClient/
11-
12-
# Restore dependencies
13-
WORKDIR /src
14-
RUN dotnet restore examples/SimpleClient/SimpleClient.csproj
15-
16-
# Copy the source code
17-
COPY RocketWelder.SDK/ RocketWelder.SDK/
18-
COPY examples/SimpleClient/ examples/SimpleClient/
19-
20-
# Build and publish
21-
WORKDIR /src/examples/SimpleClient
11+
# Copy the source code and build
12+
COPY examples/SimpleClient/ .
2213
RUN dotnet publish -c Release -o /app/publish
2314

2415
# Runtime stage - Using Ubuntu 24.04 (Noble) for GLIBC 2.38+ compatibility

csharp/examples/SimpleClient/SimpleClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<ProjectReference Include="../../RocketWelder.SDK/RocketWelder.SDK.csproj" />
17+
<PackageReference Include="RocketWelder.SDK" Version="1.1.34-preview.616c539" />
1818
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
1919
<PackageReference Include="Emgu.CV" Version="4.11.0.5746" />
2020
<PackageReference Include="Emgu.CV.runtime.ubuntu-x64" Version="4.11.0.5746" />

0 commit comments

Comments
 (0)