(project_path: &Path)
| 1761 | } |
| 1762 | |
| 1763 | pub 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`. |
no test coverage detected
searching dependent graphs…