mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-01-18 10:36:23 +00:00
Adds C# builds and namespaces (#100)
Co-authored-by: Max Reble <max.reble@aco.com>
This commit is contained in:
parent
81ce56a9a0
commit
837e13a586
11
api/Dockerfile-csharp
vendored
Normal file
11
api/Dockerfile-csharp
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack/api
|
||||
|
||||
RUN apt update && apt install -y make git
|
||||
RUN git clone --depth=1 --branch=master https://github.com/googleapis/googleapis.git /googleapis
|
||||
RUN mkdir -p /googleproto/google/api/
|
||||
RUN mv /googleapis/google/api/http.proto /googleproto/google/api/ && mv /googleapis/google/api/annotations.proto /googleproto/google/api/
|
||||
RUN rm -rf /googleapis
|
||||
|
||||
WORKDIR $PROJECT_PATH
|
5
api/Makefile
vendored
5
api/Makefile
vendored
@ -1,4 +1,4 @@
|
||||
.PHONY: rust grpc-web go js python md java kotlin
|
||||
.PHONY: rust grpc-web go js python md java kotlin csharp
|
||||
|
||||
all:
|
||||
docker-compose up
|
||||
@ -26,3 +26,6 @@ java:
|
||||
|
||||
kotlin:
|
||||
docker-compose run --rm chirpstack-api-kotlin
|
||||
|
||||
csharp:
|
||||
docker-compose run --rm chirpstack-csharp
|
37
api/csharp/Chirpstack.Api.csproj
vendored
Normal file
37
api/csharp/Chirpstack.Api.csproj
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Protobuf Include="../proto/common/common.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/gw/gw.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/internal.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/user.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/tenant.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/application.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/device_profile.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/device_profile_template.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/device.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/gateway.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/frame_log.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/multicast_group.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/api/request_log.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/integration/integration.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="../proto/meta/meta.proto" ProtoRoot="../proto/" OutputDir="Chirpstack/" CompileOutputs="false" AdditionalImportDirs="/googleproto" />
|
||||
<Protobuf Include="/googleproto/google/api/*.proto" ProtoRoot="/googleproto" OutputDir="Chirpstack/" CompileOutputs="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Google.Protobuf" Version="3.21.12" />
|
||||
<PackageReference Include="Grpc.Core" Version="2.46.6" />
|
||||
<PackageReference Include="Grpc.Tools" Version="2.51.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
12
api/csharp/Makefile
vendored
Normal file
12
api/csharp/Makefile
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
.PHONY: requirements
|
||||
|
||||
all: requirements install clean-after
|
||||
|
||||
requirements:
|
||||
rm -rf Chirpstack
|
||||
dotnet clean
|
||||
install:
|
||||
dotnet build -c Release -o /app/build
|
||||
clean-after:
|
||||
rm -rf obj
|
||||
rm -rf bin
|
7
api/docker-compose.yml
vendored
7
api/docker-compose.yml
vendored
@ -56,3 +56,10 @@ services:
|
||||
command: bash -c "cd kotlin && make all"
|
||||
volumes:
|
||||
- ./:/chirpstack/api
|
||||
chirpstack-csharp:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-csharp
|
||||
command: bash -c "cd csharp && make all"
|
||||
volumes:
|
||||
- ./:/chirpstack/api
|
||||
|
1
api/proto/api/application.proto
vendored
1
api/proto/api/application.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "ApplicationProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/api/device.proto
vendored
1
api/proto/api/device.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "DeviceProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "common/common.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
1
api/proto/api/device_profile.proto
vendored
1
api/proto/api/device_profile.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "DeviceProfileProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/api/device_profile_template.proto
vendored
1
api/proto/api/device_profile_template.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "DeviceProfileTemplateProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/api/frame_log.proto
vendored
1
api/proto/api/frame_log.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "FrameLogProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "common/common.proto";
|
||||
|
1
api/proto/api/gateway.proto
vendored
1
api/proto/api/gateway.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "GatewayProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/api/internal.proto
vendored
1
api/proto/api/internal.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "InternalProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/empty.proto";
|
||||
|
1
api/proto/api/multicast_group.proto
vendored
1
api/proto/api/multicast_group.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "MulticastGroupProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/api/request_log.proto
vendored
1
api/proto/api/request_log.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "RequestLogProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "common/common.proto";
|
||||
|
1
api/proto/api/tenant.proto
vendored
1
api/proto/api/tenant.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "TenantProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/api/user.proto
vendored
1
api/proto/api/user.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/api";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "UserProto";
|
||||
option csharp_namespace = "Chirpstack.Api";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/common/common.proto
vendored
1
api/proto/common/common.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/common";
|
||||
option java_package = "io.chirpstack.api";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "CommonProto";
|
||||
option csharp_namespace = "Chirpstack.Common";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
||||
|
1
api/proto/gw/gw.proto
vendored
1
api/proto/gw/gw.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/gw";
|
||||
option java_package = "io.chirpstack.api.gw";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "GatewayProto";
|
||||
option csharp_namespace = "Chirpstack.Gateway";
|
||||
|
||||
import "common/common.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
|
1
api/proto/integration/integration.proto
vendored
1
api/proto/integration/integration.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/brocaar/chirpstack/api/go/v4/integration";
|
||||
option java_package = "io.chirpstack.api.integration";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "IntegrationProto";
|
||||
option csharp_namespace = "Chirpstack.Integration";
|
||||
|
||||
import "common/common.proto";
|
||||
import "gw/gw.proto";
|
||||
|
1
api/proto/meta/meta.proto
vendored
1
api/proto/meta/meta.proto
vendored
@ -6,6 +6,7 @@ option go_package = "github.com/chirpstack/chirpstack/api/go/v4/meta";
|
||||
option java_package = "io.chirpstack.api.meta";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "MetaProto";
|
||||
option csharp_namespace = "Chirpstack.Meta";
|
||||
|
||||
import "common/common.proto";
|
||||
import "gw/gw.proto";
|
||||
|
Loading…
Reference in New Issue
Block a user