First class FAKE support

Jul 18, 2014 at 3:01 AM
Rather than complex MSBuild instructions in the fsproj file, would it be possible to provide an alternate set of commands that would allow use of a FAKE script? Now that FAKE supports FSC tasks, I would love to be able to choose to create a new fsproj from a FAKE script or using a minimal FAKE script where I could define my project structure and other tasks.

I have no understanding of what this would entail. Cameron Taggart did something roughly similar, I think, with his integration of FAKE into TFS (SourceLink). I know they are different, but could be similar effort?
Coordinator
Jul 18, 2014 at 4:27 AM
I'm sorry, we can't, we have internal build processes to support. We do still build and deploy with Visual Studio, for sure the build labs would not be familiar with fake and would be unable to diagnose or fix build issues. For that reason we can't modify our build. If I remember correctly Steffen raised this back in April, I don't think I ever responded adequately. I think we can consider using it to improve our test building process, since we have a lot more control over that. But for product build and open source product build its not really possible.

Kevin
Jul 18, 2014 at 5:21 AM
I think this proposal came across the wrong way. I wasn't speaking of building the F# tools or compiler. I meant instead providing a way for F# projects (.fsproj) to support a FAKE target similar to https://github.com/c4fsharp/FsOnTheWeb-Workshop/blob/master/WebApiLab/WebAPIComplete/Build.proj

The main difficulty, as I see it, is in providing tooling to add new files that would be added to the FAKE script rather than a typical MSBuild-based project. I'll have to think on this some more.

Would there be major blockers within the Visual Studio project system that would prevent the F# MVC 5 template, as an example, using a simplified proj format with FAKE, assuming manual editing of the FAKE script?

NOTE: I'm really unfamiliar with the project system and VS tooling around projects. I'm learning slowly, but I have a very long way to go.
Coordinator
Jul 18, 2014 at 6:28 AM
Help me understand the benefit of doing that, I'm sure you could make something work. Although I expect the Web publish would fail miserably. And would be tough to make do the right thing. The project system already has a way of adding source files to a project, I guess you would have to try it out and see how far you get. But as it stands I'm not clear on the benefits.
Jul 18, 2014 at 8:34 AM
@kevin just a clarification. I didn't propose to replace MSBuild during the compile process. I only want to put all the different MSBuild calls and nunit call into one nice script. Currently we have to use different batch files, read DEVGUIDE and testguide and learn a lot of strange things. Please take a look at FCS and other F# open source projects. It's just so much easier for new contributors.
Coordinator
Jul 18, 2014 at 3:34 PM
Probably this is one of those things where it's easier to show us rather than describe it. Why don't you put together a PR with what you have in mind and we can discuss that. Does that sound fair?
Jul 18, 2014 at 4:15 PM
Codeplex refused to post my long and maybe more balanced answer. So here is a short one which I wrote frustrated.
It will take an enormous effort to get this repo in a shape like most other F# open source projects already are. We will have to change a lot of things and probably break a lot of your internal tools. Honestly I will not have the time to create a pull request that will consider all your internal requirements and may or may not be merged. You have to decide where you want to go with this project. Things like http://www.navision-blog.de/blog/2014/07/05/microsoft-open-source-development-and-codeplex/ are directly related. The F# open source community is used to a one click build. Most builds go from parsing release notes document via compilation, unit testing, docs creation to (nuget) deploy. It's not magic anymore. We even test every pull request automatically on CI servers (AppVeyor for Windows and TravisCI for mono). If you want to attract F# more open source developers then please look at projects like FCS and FSharp.Formatting. There you can exactly see what I and most of the F# think about a good OSS workflow.

Of course I will be there to help if you consider to change the direction.
Coordinator
Jul 18, 2014 at 8:22 PM
We can continue this discussion in a more productive manner on the Powershell thread. https://visualfsharp.codeplex.com/discussions/551904
Jul 18, 2014 at 9:45 PM
Please don't close this issue due to a hijacking following a misunderstanding. This thread concerns re-imagining the F# project system, not the build scripts for the Visual F# Tools project. I would like to continue discussing how we might allow standard F# projects to leverage a FAKE script rather than MSBuild, similar to the way in which the ASP.NET vNext projects work.
Jul 18, 2014 at 9:50 PM
I'm already writing build scripts for all my projects in FAKE. I have heretofore used the MSBuild task in FAKE simply because I felt I had to have a .fsproj for anyone to even take a look at my project. I've long wanted to just define the files to compile separate from the underlying folder paths and, in some cases, specify certain files for different build targets as that would be much easier than the acrobatics necessary in MSBuild today wherein you must edit the fsproj file directly. This would also solve the problem (outside of tools) of organizing a project however you wish with an explicit order provided in the build script.
Coordinator
Jul 24, 2014 at 6:17 PM
I think what your asking for is for the F# project system to have Fake as an alternate serialization format. Is that correct?
Jul 24, 2014 at 7:10 PM
Edited Jul 24, 2014 at 7:12 PM
KevinRansom wrote:
I think what your asking for is for the F# project system to have Fake as an alternate serialization format. Is that correct?
Sort of. I don't think of FAKE as a serialization format. What I would like is to use the FSC helper in FAKE much as I would directly use the fsc.exe in a batch script and declare my build using the compiler directly rather than targets, etc.

I'd also love to be able to structure my files in any way I like and have them appear in VS, much in the same way a Web Site (not Web Application) project works in VS. (That's also how ASP.NET vNext works to my understanding.)

It's possible I would use a tool like Recalled to define my build within the FAKE script rather than using the FSC helper directly.

Does that illustrate the request a bit better? I would still need some sort of MSBuild target in the fsproj file that accepted the FAKE script as its source of project structure, etc. I really need to go look at the ASP.NET vNext repo to see how they are doing this. No time at present, unfortunately.
Sep 4, 2014 at 6:32 PM
I recently came across a post titled Hijacking the Visual Studio Build Process that seems relevant. I'll attempt this soon and respond with more thoughts on how I think this may be brought into the tooling, as I think that's ultimately a better approach than hacking XML-based project files.