uno.extensions icon indicating copy to clipboard operation
uno.extensions copied to clipboard

[MVUX] Code generator should use RootNamespace msbuild property instead of assemblyname

Open nickrandolph opened this issue 1 year ago • 0 comments

If application is created with a space and uses MVUX, code generator fails because the generated namespace has a space in it. The rootnamespace will not contain a space.

Current behavior

2>C:\temp\extdev\zzzasd 2g dd 23\zzzasd 2g dd 23\Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.FeedsGenerator\zzzasd 2g dd 23.ReactiveViewModelMappings.g.cs(9,19,9,20): error CS0246: The type or namespace name 'g' could not be found (are you missing a using directive or an assembly reference?)
2>C:\temp\extdev\zzzasd 2g dd 23\zzzasd 2g dd 23\Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.HotReloadModuleInitializerGenerator\zzzasd 2g dd 23.ReactiveHotReloadModuleInitializer.g.cs(9,19,9,20): error CS0246: The type or namespace name 'g' could not be found (are you missing a using directive or an assembly reference?)
2>C:\temp\extdev\zzzasd 2g dd 23\zzzasd 2g dd 23\Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.UIModuleInitializerGenerator\zzzasd 2g dd 23.ReactiveUIModuleInitializer.g.cs(9,19,9,20): error CS0246: The type or namespace name 'g' could not be found (are you missing a using directive or an assembly reference?)
2>C:\temp\extdev\zzzasd 2g dd 23\zzzasd 2g dd 23\Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.HotReloadModuleInitializerGenerator\zzzasd 2g dd 23.ReactiveHotReloadModuleInitializer.g.cs(9,21,9,23): error CS0102: The type '<invalid-global-code>' already contains a definition for 'dd'
2>C:\temp\extdev\zzzasd 2g dd 23\zzzasd 2g dd 23\Uno.Extensions.Reactive.Generator\Uno.Extensions.Reactive.Generator.UIModuleInitializerGenerator\zzzasd 2g dd 23.ReactiveUIModuleInitializer.g.cs(9,21,9,23): error CS0102: The type '<invalid-global-code>' already contains a definition for 'dd'
2>C:\temp\extdev\zzzasd 2g dd 23\zzzasd 2g dd 23\zzzasd 2g dd 23.csproj : XamlCompiler error WMC1006: Cannot resolve Assembly or Windows Metadata file 'C:\temp\extdev\zzzasd 2g dd 23\zzzasd 2g dd 23.DataContracts\bin\Debug\net8.0-windows10.0.19041\zzzasd 2g dd 23.DataContracts.dll'

Expected behavior

Generated namespace should not have spaces

Anything else we need to know?

By default code generators don't have access to the RootNamespace (see common properties). However this can be included by using the CompilerVisibleProperty in a props file (eg https://github.com/unoplatform/uno.csharpmarkup/blob/main/src/Uno.Extensions.Markup/buildTransitive/Package.props)

nickrandolph avatar Jan 24 '24 12:01 nickrandolph