Skip to content

Commit 43d1a84

Browse files
fix(accounting): align protobuf file paths with make target (#2390)
* fix(accounting): align protobuf file paths with make generate-protobuf target The accounting service protobuf configuration was inconsistent with the gen_proto_dotnet function used by the make generate-protobuf target. Changes: - Update Accounting.csproj to reference protobuf files at src/protos/demo.proto instead of proto/demo.proto to match gen_proto_dotnet output location - Update Dockerfile to copy protobuf file to Accounting/src/protos/demo.proto to align with project file expectations - Update README.md local build instructions to use make generate-protobuf instead of manual file copying commands * Update README.md --------- Co-authored-by: Juliano Costa <[email protected]>
1 parent c140845 commit 43d1a84

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/accounting/Accounting.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424

2525
<ItemGroup>
2626
<!-- GrpcServices is 'none' so that we do not need to depend on the grpc nuget package, and we only need protobuf support. -->
27-
<Protobuf Include="proto\demo.proto" GrpcServices="none" />
27+
<Protobuf Include="src\protos\demo.proto" GrpcServices="none" />
2828
</ItemGroup>
2929

3030
<ItemGroup>
31-
<Folder Include="proto\" />
31+
<Folder Include="src\protos\" />
3232
</ItemGroup>
3333

3434
</Project>

src/accounting/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ARG TARGETARCH
66
ARG BUILD_CONFIGURATION=Release
77
WORKDIR /src
88
COPY ["/src/accounting/", "Accounting/"]
9-
COPY ["/pb/demo.proto", "Accounting/proto/"]
9+
COPY ["/pb/demo.proto", "Accounting/src/protos/demo.proto"]
1010
RUN dotnet restore "./Accounting/Accounting.csproj" -r linux-$TARGETARCH
1111
WORKDIR "/src/Accounting"
1212

src/accounting/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ This service consumes new orders from a Kafka topic.
44

55
## Local Build
66

7-
To build the service binary, run:
7+
To build the service binary, navigate to the root directory of the project and run:
88

99
```sh
10-
mkdir -p src/accounting/proto/ # root context
11-
cp pb/demo.proto src/accounting/proto/demo.proto # root context
12-
dotnet build # accounting service context
10+
make generate-protobuf
11+
```
12+
13+
Navigate back to `src/accounting` and execute:
14+
15+
```sh
16+
dotnet build
1317
```
1418

1519
## Docker Build

0 commit comments

Comments
 (0)