Sharpmake icon indicating copy to clipboard operation
Sharpmake copied to clipboard

customizing .csproj file

Open Zathyy opened this issue 10 months ago • 14 comments

when it generates the .csproj i want it to replace the Compile with AvaloniaXaml. is there any way to do this?

Image

Zathyy avatar Feb 08 '25 00:02 Zathyy

I don't know what is Avalonia but my guess is the best way to solve this would be to add support for sdk style csproj generation in sharpmake. I assume that sdk style projects are able to figure out what to do with these automatically.

jspelletier avatar Feb 10 '25 13:02 jspelletier

Avalonia is a .net ui framework and those properties needs to be avaloniaXaml but everytime sharpmake generates they all become Compile.

Zathyy avatar Feb 10 '25 16:02 Zathyy

We added Avalonia support to our local version of Sharpmake and it was pretty easy and straightforward with only minimal changes necessary. I could maybe create a PR. We've been meaning to push back our local changes to the public repo anyway.

martinecker avatar Feb 10 '25 17:02 martinecker

any updates on this?

Zathyy avatar Mar 27 '25 20:03 Zathyy

You might have to contact Martin Ecker directly.

bchampoux avatar Mar 27 '25 21:03 bchampoux

any updates on this?

@martinecker

Zathyy avatar Mar 27 '25 22:03 Zathyy

or is there a workaround to this?

Zathyy avatar Mar 27 '25 22:03 Zathyy

okay i kinda found a workaround to this

in the contructor SourceFilesExtensions.Clear();

then add EnableDefaultItems

conf.CustomProperties.Add("EnableDefaultItems", "true"); conf.CustomProperties.Add("BuiltInComInteropSupport", "true"); conf.CustomProperties.Add("AvaloniaUseCompiledBindingsByDefault", "true");

Zathyy avatar Mar 31 '25 14:03 Zathyy

got any ideas? issue

Zathyy avatar Mar 31 '25 17:03 Zathyy

What is not working with your workaround ? Actually this looks like a way to achieve sdk style csproj.

jspelletier avatar Apr 01 '25 13:04 jspelletier

ye its working great except that its including the sharpmake project file (MySharpMakeTarget.Sharpmake.cs)

Zathyy avatar Apr 02 '25 19:04 Zathyy

Not sure if this will work but you could try from the project constructor SourceFilesExcludeRegex.Add(".sharpmake.cs$");

jspelletier avatar Apr 02 '25 19:04 jspelletier

didn't work :/

Zathyy avatar Apr 02 '25 22:04 Zathyy

Well... You will need to debug and propose a fix.

jspelletier avatar Apr 04 '25 13:04 jspelletier