-
Notifications
You must be signed in to change notification settings - Fork 525
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
Some improvements #3090
Some improvements #3090
Changes from all commits
507fad4
0d20f47
30c9182
b2524e3
e08672c
7d04f8e
d76cbe8
99f0a99
5a5d176
6f8647d
5488e42
bb66a89
b63178e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# paket restriction | ||
|
||
Determine how a restriction formula is interpreted by paket. | ||
|
||
```sh | ||
paket restriction <restriction formula> | ||
|
||
RESTRICTION: | ||
|
||
<restriction formula> A paket formula representing a restriction | ||
|
||
OPTIONS: | ||
|
||
--silent, -s suppress console output | ||
--verbose, -v print detailed information to the console | ||
--log-file <path> print output to a file | ||
--from-bootstrapper call coming from the '--run' feature of the bootstrapper | ||
--help display this list of options. | ||
``` | ||
|
||
> Note if your formula contains spaces (which it will most likely) you need to escape with quotes | ||
|
||
## Example | ||
|
||
``` | ||
$ ./paket.exe restriction "|| (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0))" | ||
Paket version 5.145.1 | ||
Restriction: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0)) | ||
Simplified: || (== netcoreapp2.0) (&& (== netstandard2.0) (>= netcoreapp2.0)) | ||
Frameworks: [ | ||
netcoreapp2.0 | ||
] | ||
Performance: | ||
- Runtime: 763 milliseconds | ||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,13 +160,7 @@ let GetAuthenticationForUrl = | |
getSourceNodes credentialsNode source "credential" @ getSourceNodes credentialsNode source "token" | ||
|
||
match sourceNodes with | ||
| sourceNode :: _ -> | ||
let auth = getAuthFromNode sourceNode | ||
if checkCredentials (url, Some auth) then | ||
Some auth | ||
else | ||
failwithf "Credentials from authentication store for %s are invalid" source | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this still fails, but a bit later and with one request less |
||
None | ||
| sourceNode :: _ -> Some (getAuthFromNode sourceNode) | ||
| _ -> None) | ||
|
||
/// Get the authentication from the authentication store for a specific source | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -569,6 +569,8 @@ let findPackages silent (results : ParseResults<_>) = | |
|
||
#nowarn "44" // because FixNuspecs is deprecated and we have warnaserror | ||
|
||
open Paket.Requirements | ||
|
||
let fixNuspecs silent (results : ParseResults<_>) = | ||
let nuspecFiles = | ||
results.GetResult <@ FixNuspecsArgs.Files @> | ||
|
@@ -741,6 +743,22 @@ let why (results: ParseResults<WhyArgs>) = | |
|
||
Why.ohWhy(packageName, directDeps, lockFile, groupName, results.Parser.PrintUsage(), options) | ||
|
||
let restriction (results: ParseResults<RestrictionArgs>) = | ||
let restrictionRaw = results.GetResult <@ RestrictionArgs.Restriction @> | ||
let restriction, parseProblems = Requirements.parseRestrictions restrictionRaw | ||
|
||
for problem in parseProblems |> Seq.map (fun x -> x.AsMessage) do | ||
Logging.traceWarnfn "Problem: %s" problem | ||
|
||
Logging.tracefn "Restriction: %s" restrictionRaw | ||
Logging.tracefn "Simplified: %s" (restriction.ToString()) | ||
Logging.tracefn "Frameworks: [ " | ||
for framework in restriction.RepresentedFrameworks do | ||
Logging.tracefn " %s" framework.CompareString | ||
Logging.tracefn "]" | ||
|
||
|
||
|
||
let waitForDebugger () = | ||
while not(System.Diagnostics.Debugger.IsAttached) do | ||
System.Threading.Thread.Sleep(100) | ||
|
@@ -776,6 +794,7 @@ let handleCommand silent command = | |
| GenerateLoadScripts r -> processCommand silent generateLoadScripts r | ||
| GenerateNuspec r -> processCommand silent generateNuspec r | ||
| Why r -> processCommand silent why r | ||
| Restriction r -> processCommand silent restriction r | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @forki I can remove that from the PR if you don't like it, the rest are bug-fixes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no it's fine, but needs docs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the question, I saw it more like a debug helper for us, but we can make it a feature (honestly I doubt if the regular user can do something with the output) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll add some lines :) |
||
| Info r -> processCommand silent info r | ||
// global options; list here in order to maintain compiler warnings | ||
// in case of new subcommands added | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this PR has to do with this change. but it looks correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes guess so