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 the referencing scripts #121

Merged
merged 2 commits into from
Jan 9, 2017
Merged

Generate the referencing scripts #121

merged 2 commits into from
Jan 9, 2017

Conversation

cgravill
Copy link
Member

This allows the start of the notebook to be like this:

#load "Paket.fsx"
Paket.Package
  [ "MathNet.Numerics"
    "MathNet.Numerics.FSharp"
  ]
#load "Paket.Generated.Refs.fsx"

I used Paket.Generated.Refs.fsx avoiding overlap with fsprojects/Paket#1943 alternatively all-references.fsx could also work etc.

It's less noisy and there's less magic going on but still less explicit than getting users to reference their own dlls. Thoughts? Rather than extend the Package and Version functions, we could have a separate ReferencePackages() function.

it's encapsulated a lot of the other concerns compared to the full syntax in #106

#load "Paket.fsx"

Paket.Dependencies.Install """
frameworks: net451
source https://nuget.org/api/v2
nuget MathNet.Numerics
nuget MathNet.Numerics.FSharp
"""

Paket.LoadingScripts.ScriptGeneration.generateScriptsForRootFolder Paket.LoadingScripts.ScriptGeneration.FSharp (Paket.FrameworkIdentifier.DotNetFramework Paket.FrameworkVersion.V4_5_1)  (System.IO.DirectoryInfo __SOURCE_DIRECTORY__)

then

#load "paket-files/include-scripts/net451/include.main.group.fsx"

@cgravill cgravill requested a review from sylvanc December 19, 2016 11:29
Copy link
Collaborator

@sylvanc sylvanc left a comment

Choose a reason for hiding this comment

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

This looks good. One small nit: I think a function for the two calls to generateScriptsForRootFolder would be nice, since they are long and the same.

@sylvanc
Copy link
Collaborator

sylvanc commented Jan 4, 2017

Nice! What this doesn't address is the "conflicting notebooks" problem. That is, if some notebook needs version A of a package, some other notebook may need version B, and which version is actually there depends on the order in which the notebooks were executed.

@cgravill
Copy link
Member Author

cgravill commented Jan 9, 2017

Good idea, I've factored out the common call.

Yes, this does nothing to address the issues of conflict notebook dependencies. (more detail in #112 on that issue)

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