xiaoyuvax / bflata

A wrapper/buildscript generator/project flattener for BFlat, a native C# compiler, to recursively build/flatten MSBuild oriented C# projects with referenced projects, packages, dependencies & resources.
GNU Affero General Public License v3.0
39 stars 2 forks source link

Support for .NET 6 #5

Closed NinovanderMark closed 1 year ago

NinovanderMark commented 1 year ago

Currently Bflata requires .NET 7, which is not an LTS release. Is it possible to have it support .NET 6 as well?

Providing the --fx=net6.0 argument does not have the expected result.

--ARGS--------------------------------
Action          :Build
BuildMode       :Flat
DepositDep      :Off
Target          :Exe
TargetOS        :windows
Output          :<Default>
TargetFx        :net7.0
PackageRoot     :<N/A>
Home            :D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples
Args for BFlat  :--fx=net6.0

--LIB EXCLU---------------------------
--LIB CACHE---------------------------

--PARSING-----------------------------
Parsing Project:.\ConsoleRenderer.Examples.csproj ...
Warnning:Project properties are not compatible with the target:net7.0, .\ConsoleRenderer.Examples.csproj!!!
Error occurred during parsing project file(s)!!(-19)
xiaoyuvax commented 1 year ago

you can try to specify net6.0 with the -fx option, the default is net7.0, as is described in the readme file.

image

despite u can change this option, i am not sure if BFlat, the compiler is compatible this way, which comes with built-in net7.0 framework only. u may test it anyway. cos by specifying -fx:net6.0 only means BFlatA the wrapper will search net6.0 compatible dependencies, and it doesn't determine which fx the project will be compiled upon.

otherwise, since u want to compile ur project to native with bflat, u may multi-targeting both net6.0 & net7.0.

NinovanderMark commented 1 year ago

I've tried getting it to work by providing the -fx:net6.0 argument, but this results in a rather odd error on my side, perhaps I'm not providing the command-line argument correctly?

PS D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples> bflata build .\ConsoleRenderer.Examples.csproj -fx="net6.0"
BFlatA V1.5.0.6 @github.com/xiaoyuvax/bflata
Description:
  A wrapper/build script generator for BFlat, a native C# compiler, for recusively building .csproj file with:
    - Referenced projects
    - Nuget package dependencies
    - Embedded resources
  Before using BFlatA, you should get BFlat first at https://flattened.net.

--ARGS--------------------------------
Action          :Build
BuildMode       :Flat
DepositDep      :Off
Target          :Exe
TargetOS        :windows
Output          :<Default>
TargetFx        :net7.0
PackageRoot     :<N/A>
Home            :D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples
Args for BFlat  :-fx=net6.0

--LIB EXCLU---------------------------
--LIB CACHE---------------------------

--PARSING-----------------------------
Parsing Project:.\ConsoleRenderer.Examples.csproj ...
Parsing Project:D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer\ConsoleRenderer.csproj ...

--SCRIPTING---------------------------
Generating build script for:ConsoleRenderer.Examples
- Found 2 args to be passed to BFlat.
- Found 11 code files(*.cs)
Script:build.rsp written!

--BUILDING----------------------------
Building in FLAT mode:ConsoleRenderer.Examples...
- Executing build script: bflat build @build.rsp...
Error: IO_FileNotFound_FileName, D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples\-fx=net6.0
System.IO.FileNotFoundException: IO_FileNotFound_FileName, D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples\-fx=net6.0
IO_FileName_Name, D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples\-fx=net6.0

I get a similar result when using the following command: bflata build .\ConsoleRenderer.Examples.csproj --framework=net6.0

--BUILDING----------------------------
Building in FLAT mode:ConsoleRenderer.Examples...
- Executing build script: bflat build @build.rsp...
Error: IO_FileNotFound_FileName, D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples\--framework=net6.0
System.IO.FileNotFoundException: IO_FileNotFound_FileName, D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples\--framework=net6.0
IO_FileName_Name, D:\Code\GitHub\ConsoleRenderer\ConsoleRenderer.Examples\--framework=net6.0
xiaoyuvax commented 1 year ago

use "-fx:net6.0" or "-fx net6.0" instead, where "=" is not recognized valid evaluation of args. image

NinovanderMark commented 1 year ago

Ah, that was the issue! Thank you!

By providing the right target framework I was able to build the .NET 6 projects just fine, so it appears that problem was entirely between my chair and my keyboard.

Thanks for the help, and for this great project!