Skip to content

Commit

Permalink
Putting .props and .targets import project on correct location in pro…
Browse files Browse the repository at this point in the history
…ject files - fixes #1219
  • Loading branch information
forki committed Nov 13, 2015
1 parent 07d68c1 commit a65a218
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 15 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.24.7 - 13.11.2015
#### 2.24.8 - 13.11.2015
* Putting .props and .targets import project on correct location in project files - https://github.com/fsprojects/Paket/issues/1219

#### 2.24.6 - 12.11.2015
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">
<ItemGroup>
Expand Down Expand Up @@ -81,5 +74,19 @@
</ItemGroup>
</When>
</Choose>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\packages\NUnit\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Import Project="..\..\packages\MultiTarget\build\MultiTarget.targets" Condition="Exists('..\..\packages\MultiTarget\build\MultiTarget.targets')" Label="Paket" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
MultiTarget
Dapper
Dapper
NUnit
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source nuget_repo

nuget MultiTarget
nuget Dapper
nuget Dapper
nuget NUnit
22 changes: 17 additions & 5 deletions src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,25 @@ type ProjectFile =
let importTargets = defaultArg installSettings.ImportTargets true

this.GenerateXml(projectModel,copyLocal,importTargets,installSettings.ReferenceCondition))
|> Seq.iter (fun (propsNodes,targetsNodes,chooseNode,propertyChooseNode, analyzersNode) ->
if chooseNode.ChildNodes.Count > 0 then
this.ProjectNode.AppendChild chooseNode |> ignore
|> Seq.iter (fun (propsNodes,targetsNodes,chooseNode,propertyChooseNode, analyzersNode) ->

if propertyChooseNode.ChildNodes.Count > 0 then
this.ProjectNode.AppendChild propertyChooseNode |> ignore
let i = ref (this.ProjectNode.ChildNodes.Count-1)
while !i >= 0 && this.ProjectNode.ChildNodes.[!i].OuterXml.ToString().ToLower().StartsWith("<import") do
decr i

if !i <= 0 then
if chooseNode.ChildNodes.Count > 0 then
this.ProjectNode.AppendChild chooseNode |> ignore

if propertyChooseNode.ChildNodes.Count > 0 then
this.ProjectNode.AppendChild propertyChooseNode |> ignore
else
if chooseNode.ChildNodes.Count > 0 then
this.ProjectNode.InsertBefore(chooseNode,this.ProjectNode.ChildNodes.[!i]) |> ignore

if propertyChooseNode.ChildNodes.Count > 0 then
this.ProjectNode.InsertBefore(propertyChooseNode,this.ProjectNode.ChildNodes.[!i]) |> ignore

let i = ref 0
while !i < this.ProjectNode.ChildNodes.Count && this.ProjectNode.ChildNodes.[!i].OuterXml.ToString().ToLower().StartsWith("<import") do
incr i
Expand Down

0 comments on commit a65a218

Please sign in to comment.