Skip to content

Commit

Permalink
Allow to override install settings in paket.dependencies - references #…
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed May 26, 2015
1 parent 0cb13c8 commit 9def86d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 30 deletions.
10 changes: 1 addition & 9 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
#### 1.5.6 - 25.05.2015
#### 1.6.0 - 26.05.2015
* Paket init - init dependencies file with default NuGet source

#### 1.5.5 - 25.05.2015
* Allow to init paket in given directory

#### 1.5.4 - 25.05.2015
* Automatically query all package feeds in "Find packages"

#### 1.5.3 - 23.05.2015
* BUGFIX: `paket install` fails if package version doesn't match .nupkg file - https://github.com/fsprojects/Paket/issues/834

#### 1.5.2 - 23.05.2015
* Allow to override install settings in 'paket.dependencies' with values from 'paket.references' - https://github.com/fsprojects/Paket/issues/836

#### 1.5.0 - 21.05.2015
Expand Down
74 changes: 55 additions & 19 deletions src/Paket.Core/InstallProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -161,36 +161,72 @@ let InstallIntoProjects(sources,force, hard, withBindingRedirects, lockFile:Lock
lockFile.GetPackageHull(referenceFile)
|> Seq.map (fun u ->
let package = packages.[NormalizedPackageName u.Key]
let referenceFileSettings =
referenceFile.NugetPackages
|> List.tryFind (fun x -> NormalizedPackageName x.Name = NormalizedPackageName u.Key)
let copyLocal =
match referenceFileSettings with
| Some s -> s.Settings.CopyLocal
| None -> None
let omitContent =
match referenceFileSettings with
| Some s -> s.Settings.OmitContent
| None -> None
let importTargets =
match referenceFileSettings with
| Some s -> s.Settings.ImportTargets
| None -> None
let restriktions =
match referenceFileSettings with
| Some s -> s.Settings.FrameworkRestrictions
| None -> []


u.Key,
{ u.Value with
Settings =
{ u.Value.Settings with
FrameworkRestrictions = u.Value.Settings.FrameworkRestrictions @ lockFile.Options.Settings.FrameworkRestrictions @ package.Settings.FrameworkRestrictions // TODO: This should filter
FrameworkRestrictions =
// TODO: This should filter
restriktions @
u.Value.Settings.FrameworkRestrictions @
lockFile.Options.Settings.FrameworkRestrictions @
package.Settings.FrameworkRestrictions

ImportTargets =
match package.Settings.ImportTargets with
match importTargets with
| Some x -> Some x
| _ -> match lockFile.Options.Settings.ImportTargets with
| Some x -> Some x
| None -> match u.Value.Settings.ImportTargets with
| Some x -> Some x
| _ -> None
| None ->
match package.Settings.ImportTargets with
| Some x -> Some x
| _ -> match lockFile.Options.Settings.ImportTargets with
| Some x -> Some x
| None -> match u.Value.Settings.ImportTargets with
| Some x -> Some x
| _ -> None
CopyLocal =
match package.Settings.CopyLocal with
match copyLocal with
| Some x -> Some x
| _ -> match lockFile.Options.Settings.CopyLocal with
| Some x -> Some x
| None -> match u.Value.Settings.CopyLocal with
| Some x -> Some x
| _ -> None
| None ->
match package.Settings.CopyLocal with
| Some x -> Some x
| _ -> match lockFile.Options.Settings.CopyLocal with
| Some x -> Some x
| None -> match u.Value.Settings.CopyLocal with
| Some x -> Some x
| _ -> None

OmitContent =
match package.Settings.OmitContent with
match omitContent with
| Some x -> Some x
| _ -> match lockFile.Options.Settings.OmitContent with
| Some x -> Some x
| None -> match u.Value.Settings.OmitContent with
| Some x -> Some x
| _ -> None }})
| None ->
match package.Settings.OmitContent with
| Some x -> Some x
| _ -> match lockFile.Options.Settings.OmitContent with
| Some x -> Some x
| None -> match u.Value.Settings.OmitContent with
| Some x -> Some x
| _ -> None }})
|> Map.ofSeq

let usedPackageSettings =
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>D:\code\Pakettest</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paketkopie</StartWorkingDirectory>
<StartArguments>find-packages</StartArguments>
<StartArguments>install</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>d:\code\paket</StartWorkingDirectory>
<StartWorkingDirectory>d:\code\pakettest</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit 9def86d

Please sign in to comment.