bflattened / bflat

C# as you know it but with Go-inspired tooling (small, selfcontained, and native executables)
GNU Affero General Public License v3.0
3.64k stars 103 forks source link

Use `.csproj` as input #13

Closed lithiumtoast closed 3 years ago

lithiumtoast commented 3 years ago

Would it be possible to use a .csproj as input instead of listing all the .cs files?

andreakarasho commented 3 years ago

You can avoid to specify all .cs files. Just do a cd <your proj path> and then bflat build. It will take the whole source code

MichalStrehovsky commented 3 years ago

I don't have plans to add csproj/MSBuild/NuGet support - I'm not trying to replicate dotnet.

Like @andreakarasho wrote above - bflat build will build all *.cs source files in the directory, recursively.

If you need more control than that, you're better off using dotnet with the NativeAOT NuGet package: https://github.com/dotnet/runtimelab/tree/feature/NativeAOT/samples/HelloWorld

You can configure NativeAOT through this mechanism to get pretty close to bflat: https://github.com/dotnet/runtimelab/blob/feature/NativeAOT/docs/using-nativeaot/optimizing.md

At that point the only difference is:

lithiumtoast commented 3 years ago

If you need more control than that, you're better off using dotnet with the NativeAOT NuGet package

I went this path.

bflat can produce a bit smaller executables

With all the options turned on to get a small as possible binary using the nAOT NuGet package, the difference in my testing was only a few hundred kilobytes (~400).