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

Generate include script for each group #1787

Merged

Conversation

smoothdeveloper
Copy link
Contributor

This includes #1786 (I did that to separate code review if we want to merge in two steps)

This PR add generation of a script per group, like @Krzysztof-Cieslak asked for:

paket-files/include-scripts/net45/include.main.group.fsx

the include script contains all the framework and file assemblies resolved in a single pass.

  • generate a script per group
  • write few tests
  • do not include mscorlib and FSharp.Core for .fsx files (factorize the existing code)

Now scripts are being constructed as a list of ScriptPiece (a simple DU) and then rendered into string written in the resulting file.

This is needed so I have better infrastructure to work on a later feature related to include scripts.
@matthid
Copy link
Member

matthid commented Jul 3, 2016

Oh nice, this fixes #1680 as well. Actually I could use this right now in my FAKE stuff, so perfect timing :)

@matthid
Copy link
Member

matthid commented Jul 3, 2016

Why generate "one big" script instead of loading the ones we already have?

@smoothdeveloper
Copy link
Contributor Author

@matthid few reasons:

  • I suspect the compiler / tooling to handle this better (Intellisense stops working in .fsx script (due to issue loading list of assembly references correctly?) dotnet/fsharp#1311) which is basically what prompted me to go this route (and help investigate the issue)
  • it should be faster, it won't parse dozen of files and need less deduplication to be executed
  • it is also more convenient to have a single list of all of those references when user wants to make a workaround in his own include script in case this one doesn't work out of the box (most likely due to tooling bug)
  • more user friendly when I "go to definition" on the script and can see all of it's beauty without browsing a web of small files

since the file is generated also and code to implement that is rather small, I don't think we should bother taking another route.

What do you think?

Thanks for feedback!

@matthid
Copy link
Member

matthid commented Jul 3, 2016

Yeah I don't have a strong opinion on this, just curiosity. I think generating one file is fine.

One thing I noticed (if I even saw that correctly) is that you currently don't use the ordered package list. This might lead to errors for dependencies across packages.

@smoothdeveloper
Copy link
Contributor Author

@matthid
Copy link
Member

matthid commented Jul 3, 2016

Ah I didn't noticed that you are running the function over the complete list of assemblies for the group. Yeah this should work.

@isaacabraham
Copy link
Contributor

You also don't want to load the same assemblies in twice, so a single script without duplicates might be preferable.

@forki
Copy link
Member

forki commented Jul 12, 2016

is tis ready to merge?

@smoothdeveloper
Copy link
Contributor Author

@forki the feature is working but it doesn't have specific integration/unit tests yet, and there are probably bugs that we have yet to find from usage.

I'm ok having it merged (useful feature) and to work on adding test in separate PR.

@forki
Copy link
Member

forki commented Jul 12, 2016

Looks like one of the related integration tests is broken

@forki forki merged commit 3bc9619 into fsprojects:master Jul 12, 2016
@forki
Copy link
Member

forki commented Jul 12, 2016

can you please take a look at master. I have 3 broken tests now

@smoothdeveloper
Copy link
Contributor Author

@forki, I'm on it I'll have a fix shortly.

@smoothdeveloper smoothdeveloper changed the title [WIP] Generate include script for each group Generate include script for each group Oct 6, 2016
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.

4 participants