Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1808: Convert DotNet API to "module based" #1812

Merged

Conversation

MangelMaxime
Copy link
Contributor

Because I added a new indentation level, the diff isn't really helpful sorry 😞 I simply remove the Dotnet prefix from the command and associated commands.

I also rename the DotNet function as Raw (from user point of view DotNet.Raw).

One of the conversion I not sure is for DotNetOptions type.

Also, I followed the name convention used on most of the FAKE 5 api: DotNet.Build but if we follow the F# convention we should write DotNet.build no ? Because build is a function.

@MangelMaxime
Copy link
Contributor Author

I will check and fix the CI tomorrow..

@MangelMaxime
Copy link
Contributor Author

I don't understand where testbuild.fsx is.

When running the test on my machine, I don't find the file and so the build process is failing. Could you please help me to fix the CI ?

@matthid
Copy link
Member

matthid commented Mar 7, 2018

Testbuild.fsx is a temporary copy of build.fsx to test if the new code bootstraps. In order to do breaking changes you can use #if BOOTSTRAP in build.fsx and update to use the new API...

@matthid
Copy link
Member

matthid commented Mar 7, 2018

This is a good way to detect breaking changes and to do the work of updating build.fsx before even releasing ;)

@MangelMaxime
Copy link
Contributor Author

@matthid So I need to send a PR with the #if BOOTSTRAP condition and then we will remove it when the API is released and we update the dependencies ?

@matthid
Copy link
Member

matthid commented Mar 7, 2018

Yes the idea is to send the changes with this pr. and I will remove the #if after review and update.

exactly

@MangelMaxime
Copy link
Contributor Author

Ok, I pass the first BootstrapTest target.

Now I fail on BootstrapTestDotNetCore, I think I understand the reason. It doesn't use the new version of the packages.

I think, I could make the CI green by using #if BOOTSTRAP && !DOTNETCORE instead of #if BOOTSTRAP, is it the way to go or am I missing something again ?

@matthid
Copy link
Member

matthid commented Mar 7, 2018

Hm yes it could be that this only works if the release notes contains the new version. This currently could be considered as bug in the build system as I'd like it to always use the new packages...
For now just try to edit the Release-Notes.md and add a new version and entry for your change (sorry but this never has happened for me because I always edit it...)

Copy link
Member

@matthid matthid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think all that is left is to try to get rid of open Fake.DotNet.Cli and to fix CI.

build.fsx Outdated

Target.Create "DotNetCoreUnitTests" (fun _ ->
// dotnet run -p src/test/Fake.Core.UnitTests/Fake.Core.UnitTests.fsproj
#if BOOTSTRAP
let processResult =
DotNet.Raw (withWorkDir root) "src/test/Fake.Core.UnitTests/bin/Release/netcoreapp2.0/Fake.Core.UnitTests.dll" "--summary"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or DotNet.Exec (but only a suggestion, it is as good as Raw, I just think we used Exec already on some places).
On the other side we also used Run on other places. This is indeed not a very consistent naming at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find Exec a good name.

Indeed using Run seems most natural but their is a run command in dotnet so it's can be confusing.

@@ -5,905 +5,908 @@
/// .NET Core + CLI tools helpers
module Fake.DotNet.Cli
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the Cli here? The idea is that people only need to open Fake.Dotnet and have all the relevant modules in scope (otherwise we have a lot of namespace/module open at each fake script.

But I think this is what doesn't work :/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it doesn't work we might consider using [<AutoOpen>] here. Normally we don't use AutoOpen anymore but in this scenario it might be a viable workaround (as long as we make sure only sub-modules are contained and no variables/functions).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try to update the module path and see the result.

I am not sure to understand where you want to place [<AutoOpen>] if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically first try to remove ‘.Cli’ from the commented line. Only if that doesn’t work we can put autoopen above the commented line. The effect should be the same for both solutions...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But don’t worry, I can do this after merging if needed

@MangelMaxime
Copy link
Contributor Author

@matthid Ok, now CI is green and I think I made all the requested change.

Thanks for helping me understand how build.fsxworks :)

@matthid matthid changed the base branch from master to beta_024 March 9, 2018 16:30
@matthid matthid merged commit 105fc9b into fsprojects:beta_024 Mar 9, 2018
@matthid
Copy link
Member

matthid commented Mar 9, 2018

Thanks a lot!

@matthid matthid mentioned this pull request Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants