-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary1.fs
More file actions
41 lines (31 loc) · 1.2 KB
/
Library1.fs
File metadata and controls
41 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
namespace ScriptCs.Paket
open System
open ScriptCs
open ScriptCs.Hosting
open ScriptCs.Contracts
open Paket
type PaketInstallationProvider(fileSystem : IFileSystem) =
let fs = fileSystem
let dep = Dependencies.Locate(fs.CurrentDirectory)
interface IInstallationProvider with
member x.GetRepositorySources(path) =
[fs.GetWorkingDirectory(path)] |> Seq.ofList
member x.Initialize() =
()
member x.InstallPackage(packageId, allowPreRelease) =
dep.Add(packageId.PackageId, packageId.Version.ToString())
dep.Install(false, false)
member x.IsInstalled(packageId, allowPreRelease) =
dep.FindReferencesFor(packageId.PackageId) |> Seq.exists (fun n -> n = packageId.PackageId)
type PaketAssemblyResolver =
interface IAssemblyResolver with
member x.GetAssemblyPaths(path, binariesOnly) =
Seq.empty
[<Module("paket")>]
type FSharpModule () =
interface IModule with
member x.Initialize(builder) =
builder.
InstallationProvider<PaketInstallationProvider>().
AssemblyResolver<PaketAssemblyResolver>()
|> ignore