Skip to content

Commit 671c284

Browse files
authored
[c#] Support for options (#820)
* most codegen tests pass * add flag to indicate an interface is being generated * Enable runtime tests * suffix "World" to world name * split option tests so that itt can be brought up without `result` * add back some needed types * tidy, revert many-arguments changes * revert ws change * tidy and marry up namespace changes in versions test * use Direction over bool for import or export remove redundant in_interface flag * correct bool conversion * reinstate function level bool * reinstate function level bool
1 parent 523f56e commit 671c284

File tree

12 files changed

+505
-167
lines changed

12 files changed

+505
-167
lines changed

crates/csharp/src/csproj.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ impl CSProjectLLVMBuilder {
4747
pub fn generate(&self) -> Result<()> {
4848
let name = &self.name;
4949
let world = &self.world_name.replace("-", "_");
50-
let snake_world = world.to_upper_camel_case();
51-
let camel = snake_world.to_upper_camel_case();
50+
let camel = format!("{}World", world.to_upper_camel_case());
5251

5352
fs::write(
5453
self.dir.join("rd.xml"),
@@ -79,7 +78,7 @@ impl CSProjectLLVMBuilder {
7978
<AssemblyName>{name}</AssemblyName>
8079
</PropertyGroup>
8180
<ItemGroup>
82-
<NativeLibrary Include=\"{world}_component_type.o\" />
81+
<NativeLibrary Include=\"{camel}_component_type.o\" />
8382
<NativeLibrary Include=\"$(MSBuildProjectDirectory)/{camel}_cabi_realloc.o\" />
8483
8584
</ItemGroup>
@@ -182,7 +181,7 @@ impl CSProjectMonoBuilder {
182181
pub fn generate(&self) -> Result<()> {
183182
let name = &self.name;
184183
let world = &self.world_name.replace("-", "_");
185-
let snake_world = world.to_upper_camel_case();
184+
let camel = format!("{}World", world.to_upper_camel_case());
186185

187186
let aot = self.aot;
188187

@@ -228,7 +227,7 @@ impl CSProjectMonoBuilder {
228227
</PropertyGroup>
229228
230229
<ItemGroup>
231-
<NativeLibrary Include=\"{world}_component_type.o\" />
230+
<NativeLibrary Include=\"{camel}_component_type.o\" />
232231
</ItemGroup>
233232
234233
<ItemGroup>
@@ -277,7 +276,6 @@ impl CSProjectMonoBuilder {
277276
"#,
278277
);
279278

280-
let camel = snake_world.to_upper_camel_case();
281279
fs::write(self.dir.join(format!("{camel}.csproj")), csproj)?;
282280

283281
Ok(())

0 commit comments

Comments
 (0)