Skip to content

Commit

Permalink
No file links were created when using File: references in .NET Core p…
Browse files Browse the repository at this point in the history
…rojects - fixes #2622

# Conflicts:
#	RELEASE_NOTES.md
  • Loading branch information
forki committed Aug 18, 2017
1 parent 4cfbe49 commit 7020fc8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 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.85.8 - 18.08.2017
* BUGFIX: No file links were created when using File: references in .NET Core projects - https://github.com/fsprojects/Paket/issues/2622

#### 5.85.7 - 17.08.2017
* BUGFIX: Small fixes in PCL detection - https://github.com/fsprojects/Paket/pull/2609

Expand Down
30 changes: 19 additions & 11 deletions src/Paket.Core/PaketConfigFiles/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -514,14 +514,22 @@ module ProjectFile =

let updateFileItems (fileItems:FileItem list) (project:ProjectFile) =
let newItemGroups =
let firstItemGroup = project.ProjectNode |> getNodes "ItemGroup" |> List.filter (fun n -> List.isEmpty (getNodes "Reference" n)) |> List.tryHead
let firstItemGroup =
project.ProjectNode
|> getNodes "ItemGroup"
|> List.filter (fun n -> List.isEmpty (getNodes "Reference" n))
|> List.tryHead

match firstItemGroup with
| None ->
[ BuildAction.Content, createNode "ItemGroup" project
BuildAction.Compile, createNode "ItemGroup" project
BuildAction.Reference, createNode "ItemGroup" project
BuildAction.Resource, createNode "ItemGroup" project
BuildAction.Page, createNode "ItemGroup" project
let node = createNode "ItemGroup" project
if List.isEmpty fileItems |> not then
project.ProjectNode.AppendChild node |> ignore
[ BuildAction.Content, node
BuildAction.Compile, node
BuildAction.Reference, node
BuildAction.Resource, node
BuildAction.Page, node
]
| Some node ->
[ BuildAction.Content, node :?> XmlElement
Expand Down Expand Up @@ -997,7 +1005,6 @@ module ProjectFile =
let getTargetFramework (project:ProjectFile) = getProperty "TargetFramework" project
let getTargetFrameworks (project:ProjectFile) = getProperty "TargetFrameworks" project


let getTargetProfile (project:ProjectFile) =
let fallback () =
let prefix =
Expand Down Expand Up @@ -1037,11 +1044,10 @@ module ProjectFile =
rootPath
(completeModel: Map<GroupName*PackageName,_*InstallModel>)
(directPackages : Map<GroupName*PackageName,_*InstallSettings>)
(usedPackages : Map<GroupName*PackageName,_*InstallSettings>)
(usedPackages : Map<GroupName*PackageName,_*InstallSettings>)
(project:ProjectFile) =
removePaketNodes project



let findInsertSpot() =
// nuget inserts properties directly at the top, and targets directly at the end.
// our inserts depend on $(TargetFrameworkVersion), which may be set either from another import, or directly in the project file.
Expand Down Expand Up @@ -1095,7 +1101,9 @@ module ProjectFile =
|> Seq.map (fun kv ->
deleteCustomModelNodes (snd kv.Value) project
let installSettings = snd usedPackages.[kv.Key]
let restrictionList = installSettings.FrameworkRestrictions |> getExplicitRestriction
let restrictionList =
installSettings.FrameworkRestrictions
|> getExplicitRestriction

let projectModel =
(snd kv.Value)
Expand Down
2 changes: 1 addition & 1 deletion src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<StartProgram>paket.exe</StartProgram>
<StartAction>Project</StartAction>
<StartArguments>update</StartArguments>
<StartWorkingDirectory>C:\temp\TestProject</StartWorkingDirectory>
<StartWorkingDirectory>C:\temp\Library2</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
Expand Down

0 comments on commit 7020fc8

Please sign in to comment.