Skip to content

Commit

Permalink
Fix #3080 and update release notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthid committed Feb 26, 2018
1 parent fa278db commit 86625e1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 5.145.1 - 2018-02-27
* BUGFIX: generate-load-script was broken - https://github.com/fsprojects/Paket/issues/3080

#### 5.145.0 - 2018-02-26
* Added support for credential managers - https://github.com/fsprojects/Paket/pull/3069

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ let ``mscorlib excluded from f# script`` () =

Assert.False hasFilesWithMsCorlib

// Important to have the correct relative path
let expectedContent = "#load @\"Microsoft.Rest.ClientRuntime.Azure.fsx\""
let scriptPath = Path.Combine(scriptRootDir.FullName, "net46", "Microsoft.Azure.Management.ResourceManager.fsx")
let scriptContent = File.ReadAllText(scriptPath)
Assert.IsTrue(scriptContent.Contains expectedContent, sprintf "Should contain '%s' but script content was:\n%s" expectedContent scriptContent)

[<Test; Category("scriptgen")>]
let ``fsharp.core excluded from f# script`` () =
Expand Down
9 changes: 4 additions & 5 deletions src/Paket.Core/Installation/ScriptGeneration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module ScriptGeneration =

type ScriptGenInput = {
PackageName : PackageName
DependentScripts : FileInfo list
DependentScripts : string list
FrameworkReferences : string list
OrderedDllReferences : FileInfo list
}
Expand All @@ -56,7 +56,7 @@ module ScriptGeneration =
match ref with
| Assembly info -> not (String.containsIgnoreCase "FSharp.Core" info.Name)
| Framework info -> not (String.containsIgnoreCase "FSharp.Core" info)
| LoadScript info -> not (String.containsIgnoreCase "FSharp.Core" info.Name)
| LoadScript info -> not (String.containsIgnoreCase "FSharp.Core" info)
else true
)

Expand Down Expand Up @@ -116,9 +116,9 @@ module ScriptGeneration =
| Assembly file, _ ->
sprintf """#r "%s" """ (relativePath scriptFile file)
| LoadScript script, ScriptType.FSharp ->
sprintf """#load @"%s" """ (relativePath scriptFile (baseDirectory.FullName </> script |> FileInfo))
sprintf """#load @"%s" """ (relativePath scriptFile ((baseDirectory.FullName </> script) |> FileInfo))
| LoadScript script, ScriptType.CSharp ->
sprintf """#load "%s" """ (relativePath scriptFile (baseDirectory.FullName </> script |> FileInfo))
sprintf """#load "%s" """ (relativePath scriptFile ((baseDirectory.FullName </> script) |> FileInfo))
| Framework name,_ ->
sprintf """#r "%s" """ name

Expand Down Expand Up @@ -212,7 +212,6 @@ module ScriptGeneration =
package.Dependencies
|> Seq.choose (fun (x,_,_) -> knownIncludeScripts.TryFind x)
|> List.ofSeq
|> List.map FileInfo

let dllFiles =
ctx.Cache.GetOrderedPackageReferences groupName package.Name framework
Expand Down
5 changes: 3 additions & 2 deletions src/Paket.Core/PaketConfigFiles/DependencyCache.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ open ProviderImplementation.AssemblyReader.Utils.SHA1
type ReferenceType =
| Assembly of FileInfo
| Framework of string
| LoadScript of FileInfo
/// Relative path based on base-directory
| LoadScript of string
override self.ToString () = self |> function
| Assembly info -> sprintf "Assembly: '%s'" info.FullName
| Framework info -> sprintf "Framework: '%s'" info
| LoadScript info -> sprintf "LoadScript: '%s'" info.FullName
| LoadScript info -> sprintf "LoadScript: '%s'" info

type DependencyCache (lockFile:LockFile) =
let loadedGroups = HashSet<GroupName>()
Expand Down

0 comments on commit 86625e1

Please sign in to comment.