Skip to content

Commit b18b8b2

Browse files
committed
It's possible to influence the CopyToOutputDirectory property for content references in project files - closes #1522
1 parent a0ae5b2 commit b18b8b2

29 files changed

Lines changed: 399 additions & 61 deletions

‎RELEASE_NOTES.md‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
#### 2.53.3 - 21.03.2016
2-
* USABILITY: Unknown package settings are now reported
3-
4-
#### 2.53.2 - 21.03.2016
1+
#### 2.54.0 - 21.03.2016
2+
* It's possible to influence the CopyToOutputDirectory property for content references in project files - http://fsprojects.github.io/Paket/nuget-dependencies.html#CopyToOutputDirectory-settings
53
* BUGFIX: Fix regression where paket skipped packages with name ending in lib - https://github.com/fsprojects/Paket/issues/1531
6-
7-
#### 2.53.1 - 19.03.2016
4+
* USABILITY: Unknown package settings are now reported
85
* USABILITY: Improve warning text on conflict - https://github.com/fsprojects/Paket/pull/1530
96

107
#### 2.53.0 - 19.03.2016

‎docs/content/dependencies-file.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,18 @@ This option disables the installation of any content files:
9191
nuget jQuery >= 0 // we don't install jQuery content files
9292
nuget UnionArgParser ~> 0.7
9393

94+
### CopyToOutputDirectory settings
95+
96+
It's possible to influence the `CopyToOutputDirectory` property for all content references in a group:
97+
98+
[lang=paket]
99+
source https://nuget.org/api/v2
100+
CopyToOutputDirectory: always
101+
102+
nuget jQuery
103+
nuget Fody
104+
nuget ServiceStack.Swagger
105+
94106
### import_targets settings
95107

96108
If you don't want to import `.targets` and `.props` files you can disable it via the `import_targets` switch:

‎docs/content/nuget-dependencies.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ It's possible to influence the `Private` property for references in project file
213213

214214
nuget Newtonsoft.Json copy_local: false
215215

216+
### CopyToOutputDirectory settings
217+
218+
It's possible to influence the `CopyToOutputDirectory` property for content references in project files:
219+
220+
[lang=paket]
221+
source https://nuget.org/api/v2
222+
223+
nuget jQuery CopyToOutputDirectory: always
224+
nuget Fody CopyToOutputDirectory: never
225+
nuget ServiceStack.Swagger CopyToOutputDirectory: preserve-newest
226+
216227
### redirects settings
217228

218229
You can instruct Paket to create assembly binding redirects for NuGet packages:

‎integrationtests/Paket.IntegrationTests/InstallSpecs.fs‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,23 @@ let ``#1427 won't install content when content:none``() =
203203
let s2 = File.ReadAllText newWeavers |> normalizeLineEndings
204204
s2 |> shouldEqual s1 // we do not touch it
205205

206+
207+
[<Test>]
208+
let ``#1522 install content and copy to output dir``() =
209+
let newLockFile = install "i001522-copy-content"
210+
let newFile = Path.Combine(scenarioTempPath "i001522-copy-content","MyClassLibrary","MyClassLibrary","MyClassLibrary.csproj")
211+
let oldFile = Path.Combine(originalScenarioPath "i001522-copy-content","MyClassLibrary","MyClassLibrary","MyClassLibrary.expected")
212+
let s1 = File.ReadAllText oldFile |> normalizeLineEndings
213+
let s2 = File.ReadAllText newFile |> normalizeLineEndings
214+
s2 |> shouldEqual s1
215+
s1.Contains "FodyWeavers.xml" |> shouldEqual true
216+
217+
let newWeavers = Path.Combine(scenarioTempPath "i001522-copy-content","MyClassLibrary","MyClassLibrary","FodyWeavers.xml")
218+
let oldWeavers = Path.Combine(originalScenarioPath "i001522-copy-content","MyClassLibrary","MyClassLibrary","FodyWeavers.xml")
219+
let s1 = File.ReadAllText oldWeavers |> normalizeLineEndings
220+
let s2 = File.ReadAllText newWeavers |> normalizeLineEndings
221+
s2 |> shouldEqual s1
222+
206223
[<Test>]
207224
let ``#1440 auto-detect framework``() =
208225
let newLockFile = install "i001440-auto-detect"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.23107.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{673951A0-5216-4FBD-BA08-7FA057D5CC0D}"
7+
ProjectSection(SolutionItems) = preProject
8+
..\paket.dependencies = ..\paket.dependencies
9+
EndProjectSection
10+
EndProject
11+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyClassLibrary", "MyClassLibrary\MyClassLibrary.csproj", "{CD678800-8DFC-4BB1-911A-7234F492EA29}"
12+
EndProject
13+
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|Any CPU = Debug|Any CPU
16+
Release|Any CPU = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{CD678800-8DFC-4BB1-911A-7234F492EA29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{CD678800-8DFC-4BB1-911A-7234F492EA29}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{CD678800-8DFC-4BB1-911A-7234F492EA29}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{CD678800-8DFC-4BB1-911A-7234F492EA29}.Release|Any CPU.Build.0 = Release|Any CPU
23+
EndGlobalSection
24+
GlobalSection(SolutionProperties) = preSolution
25+
HideSolutionNode = FALSE
26+
EndGlobalSection
27+
EndGlobal
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace MyClassLibrary
8+
{
9+
public class Class1
10+
{
11+
}
12+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Weavers>
3+
<Costura>
4+
</Costura>
5+
</Weavers>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Weavers xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
3+
<Costura xdt:Transform="Insert" />
4+
</Weavers>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Weavers xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
3+
<Costura xdt:Transform="Remove" />
4+
</Weavers>
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{CD678800-8DFC-4BB1-911A-7234F492EA29}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>MyClassLibrary</RootNamespace>
11+
<AssemblyName>MyClassLibrary</AssemblyName>
12+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="System" />
34+
<Reference Include="System.Core" />
35+
<Reference Include="System.Xml.Linq" />
36+
<Reference Include="System.Data.DataSetExtensions" />
37+
<Reference Include="Microsoft.CSharp" />
38+
<Reference Include="System.Data" />
39+
<Reference Include="System.Net.Http" />
40+
<Reference Include="System.Xml" />
41+
</ItemGroup>
42+
<ItemGroup>
43+
<Compile Include="Class1.cs" />
44+
<Compile Include="Properties\AssemblyInfo.cs" />
45+
</ItemGroup>
46+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
47+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
48+
Other similar extension points exist, see Microsoft.Common.targets.
49+
<Target Name="BeforeBuild">
50+
</Target>
51+
<Target Name="AfterBuild">
52+
</Target>
53+
-->
54+
<Choose>
55+
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
56+
<PropertyGroup>
57+
<__paket__Fody_targets>portable-net+sl+win+wpa+wp\Fody</__paket__Fody_targets>
58+
</PropertyGroup>
59+
</When>
60+
</Choose>
61+
<Import Project="..\..\packages\Fody\build\$(__paket__Fody_targets).targets" Condition="Exists('..\..\packages\Fody\build\$(__paket__Fody_targets).targets')" Label="Paket" />
62+
</Project>

0 commit comments

Comments
 (0)