MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / init_csharp_project

Function init_csharp_project

crates/cli/src/subcommands/init.rs:1763–1789  ·  view source on GitHub ↗
(project_path: &Path)

Source from the content-addressed store, hash-verified

1761}
1762
1763pub fn init_csharp_project(project_path: &Path) -> anyhow::Result<()> {
1764 let export_files = vec![
1765 (
1766 include_str!("../../../../templates/basic-cs/spacetimedb/StdbModule.csproj"),
1767 "StdbModule.csproj",
1768 ),
1769 (
1770 include_str!("../../../../templates/basic-cs/spacetimedb/Lib.cs"),
1771 "Lib.cs",
1772 ),
1773 (
1774 include_str!("../../../../templates/basic-cs/spacetimedb/global.json"),
1775 "global.json",
1776 ),
1777 ];
1778
1779 check_for_dotnet();
1780 check_for_git();
1781
1782 for data_file in export_files {
1783 let path = project_path.join(data_file.1);
1784 create_directory(path.parent().unwrap())?;
1785 std::fs::write(path, data_file.0)?;
1786 }
1787
1788 Ok(())
1789}
1790
1791/// Adds NativeAOT-LLVM package references to an existing C# .csproj file and creates NuGet.Config.
1792/// This is called when `--native-aot` is specified during `spacetime init`.

Callers 2

init_empty_csharp_serverFunction · 0.85
exec_init_csharpFunction · 0.85

Calls 6

check_for_dotnetFunction · 0.85
check_for_gitFunction · 0.85
create_directoryFunction · 0.85
joinMethod · 0.80
OkFunction · 0.50
unwrapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…