-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Description of Changes #123 reverted the non-code-changes in #119. This cherrypicks them back. See the discussion at 732dd28#r146042766 for more context. Co-authored-by: Jeremie Pelletier <[email protected]>
- Loading branch information
Showing
17 changed files
with
67 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
# Notes for maintainers | ||
|
||
## `ClientApi.cs` | ||
## `SpacetimeDB.ClientApi` | ||
|
||
The file `ClientApi.cs` is generated by [ProtoBuf](https://protobuf.dev/) | ||
from [the SpacetimeDB client-api-messages proto definition](https://github.com/clockworklabs/SpacetimeDB/blob/master/crates/client-api-messages/protobuf/client_api.proto). | ||
This is not automated. | ||
Whenever the `client_api.proto` changes, you'll have to manually re-run `protoc` to re-generate the definitions. | ||
|
||
```sh | ||
cd ~/clockworklabs/SpacetimeDB/crates/client-api-messages/protobuf | ||
protoc --csharp_out=/absolute/path/to/spacetimedb-csharp-sdk/src \ | ||
./client_api.proto | ||
``` | ||
|
||
Note that `protoc` cannot understand paths that start with `~`; | ||
you must write the absolute path starting from `/`. | ||
To regenerate this namespace, run the `tools~/gen-client-api.sh` or the | ||
`tools~/gen-client-api.bat` script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
#nullable enable | ||
|
||
using System; | ||
using SpacetimeDB; | ||
|
||
namespace SpacetimeDB.ClientApi | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
#nullable enable | ||
|
||
using System; | ||
using SpacetimeDB; | ||
|
||
namespace SpacetimeDB.ClientApi | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@echo off | ||
setlocal | ||
|
||
if "%CL_HOME%"=="" ( | ||
echo "Variable CL_HOME not set" | ||
exit /b 1 | ||
) | ||
|
||
cd %CL_HOME%\SpacetimeDB\crates\client-api-messages | ||
cargo run --example get_ws_schema > %CL_HOME%/schema.json | ||
|
||
cd %CL_HOME%\SpacetimeDB\crates\cli | ||
cargo run -- generate -l csharp -n SpacetimeDB.ClientApi ^ | ||
--json-module %CL_HOME%\schema.json ^ | ||
-o %CL_HOME%\spacetimedb-csharp-sdk\src\SpacetimeDB\ClientApi | ||
|
||
cd %CL_HOME%\spacetimedb-csharp-sdk\src\SpacetimeDB\ClientApi | ||
del /q _Globals | ||
|
||
del %CL_HOME%\schema.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh -eu | ||
: $CL_HOME | ||
|
||
cd $CL_HOME/SpacetimeDB/crates/client-api-messages | ||
cargo run --example get_ws_schema > $CL_HOME/schema.json | ||
|
||
cd $CL_HOME/SpacetimeDB/crates/cli | ||
cargo run -- generate -l csharp -n SpacetimeDB.ClientApi \ | ||
--json-module $CL_HOME/schema.json \ | ||
-o $CL_HOME/spacetimedb-csharp-sdk/src/SpacetimeDB/ClientApi | ||
|
||
cd $CL_HOME/spacetimedb-csharp-sdk/src/SpacetimeDB/ClientApi | ||
rm -rf _Globals | ||
|
||
rm -f $CL_HOME/schema.json |