Skip to content

Commit

Permalink
Create installer demo - references #1251
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Nov 23, 2015
1 parent 221d14d commit 74d86aa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### 2.27.8 - 23.11.2015
#### 2.27.9 - 23.11.2015
* Create installer demo - https://github.com/fsprojects/Paket/issues/1251

#### 2.27.7 - 23.11.2015
Expand Down
3 changes: 2 additions & 1 deletion integrationtests/Paket.IntegrationTests/PaketCoreSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ open Paket.Domain

[<Test>]
let ``#1251 full installer demoe``() =
prepare "i001251-installer-demo"
let deps = """source https://nuget.org/api/v2
nuget FAKE
nuget FSharp.Formatting"""

let dependenciesFile = DependenciesFile.FromCode deps
let dependenciesFile = DependenciesFile.FromCode(scenarioTempPath "i001251-installer-demo",deps)
let force = false
let packagesToInstall =
// get from references file
Expand Down
7 changes: 6 additions & 1 deletion integrationtests/Paket.IntegrationTests/TestHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let integrationTestPath = FullName(__SOURCE_DIRECTORY__ + "../../../integrationt
let scenarioTempPath scenario = Path.Combine(integrationTestPath,scenario,"temp")
let originalScenarioPath scenario = Path.Combine(integrationTestPath,scenario,"before")

let paket command scenario =
let prepare scenario =
let originalScenarioPath = originalScenarioPath scenario
let scenarioPath = scenarioTempPath scenario
CleanDir scenarioPath
Expand All @@ -26,6 +26,11 @@ let paket command scenario =
Directory.GetFiles(scenarioPath, "*.templatetemplate", SearchOption.AllDirectories)
|> Seq.iter (fun f -> File.Move(f, Path.ChangeExtension(f, "template")))

let paket command scenario =
let originalScenarioPath = originalScenarioPath scenario
let scenarioPath = scenarioTempPath scenario
prepare scenario

let result =
ExecProcessAndReturnMessages (fun info ->
info.FileName <- paketToolPath
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NUGET
remote: https://nuget.org/api/v2
specs:
FAKE (>= 4.9.3)
3 changes: 3 additions & 0 deletions src/Paket.Core/DependenciesFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,9 @@ type DependenciesFile(fileName,groups:Map<GroupName,DependenciesGroup>, textRepr
File.WriteAllText(fileName, this.ToString())
tracefn "Dependencies files saved to %s" fileName

static member FromCode(rootPath,code:string) : DependenciesFile =
DependenciesFile(DependenciesFileParser.parseDependenciesFile (Path.Combine(rootPath,Constants.DependenciesFileName)) <| code.Replace("\r\n","\n").Replace("\r","\n").Split('\n'))

static member FromCode(code:string) : DependenciesFile =
DependenciesFile(DependenciesFileParser.parseDependenciesFile "" <| code.Replace("\r\n","\n").Replace("\r","\n").Split('\n'))

Expand Down

0 comments on commit 74d86aa

Please sign in to comment.