Skip to content

Commit

Permalink
Don't serialize individual settings that match group settings in lock…
Browse files Browse the repository at this point in the history
… file - fixes #3257
  • Loading branch information
forki committed Jun 20, 2018
1 parent 7ae69a0 commit 0446b5d
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 41 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.173.0 - 2018-06-20
* BUGFIX: Don't serialize individual settings that match group settings in lock file - https://github.com/fsprojects/Paket/issues/3257

#### 5.172.4 - 2018-06-18
* BUGFIX: Fixed invalid syntax in packages config - https://github.com/fsprojects/Paket/pull/3253

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
</When>
</Choose>
<Choose>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v2.2' Or $(TargetFrameworkVersion) == 'v2.3' Or $(TargetFrameworkVersion) == 'v4.0.3' Or $(TargetFrameworkVersion) == 'v4.1' Or $(TargetFrameworkVersion) == 'v4.2' Or $(TargetFrameworkVersion) == 'v4.3' Or $(TargetFrameworkVersion) == 'v4.4' Or $(TargetFrameworkVersion) == 'v5.0' Or $(TargetFrameworkVersion) == 'v5.1' Or $(TargetFrameworkVersion) == 'v6.0' Or $(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1' Or $(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(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' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v2.1')) Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkProfile) == 'Profile24') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile47') Or ($(TargetFrameworkProfile) == 'Profile78') Or ($(TargetFrameworkProfile) == 'Profile259') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS')">
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v2.2' Or $(TargetFrameworkVersion) == 'v2.3' Or $(TargetFrameworkVersion) == 'v4.0.3' Or $(TargetFrameworkVersion) == 'v4.1' Or $(TargetFrameworkVersion) == 'v4.2' Or $(TargetFrameworkVersion) == 'v4.3' Or $(TargetFrameworkVersion) == 'v4.4' Or $(TargetFrameworkVersion) == 'v5.0' Or $(TargetFrameworkVersion) == 'v5.1' Or $(TargetFrameworkVersion) == 'v6.0' Or $(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1' Or $(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(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' Or $(TargetFrameworkVersion) == 'v4.6.2' Or $(TargetFrameworkVersion) == 'v4.6.3' Or $(TargetFrameworkVersion) == 'v4.7' Or $(TargetFrameworkVersion) == 'v4.7.1' Or $(TargetFrameworkVersion) == 'v4.7.2')) Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v2.0' Or $(TargetFrameworkVersion) == 'v2.1')) Or ($(TargetFrameworkIdentifier) == '.NETStandard' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v1.1' Or $(TargetFrameworkVersion) == 'v1.2' Or $(TargetFrameworkVersion) == 'v1.3' Or $(TargetFrameworkVersion) == 'v1.4' Or $(TargetFrameworkVersion) == 'v1.5' Or $(TargetFrameworkVersion) == 'v1.6' Or $(TargetFrameworkVersion) == 'v2.0')) Or ($(TargetFrameworkProfile) == 'Profile24') Or ($(TargetFrameworkProfile) == 'Profile47') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile78') Or ($(TargetFrameworkProfile) == 'Profile259') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile44') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS')">
<ItemGroup>
<Reference Include="Zlib.Portable">
<HintPath>..\packages\Zlib.Portable\lib\portable-net4+sl5+wp8+win8+wpa81+MonoTouch+MonoAndroid\Zlib.Portable.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v2.2' Or $(TargetFrameworkVersion) == 'v2.3' Or $(TargetFrameworkVersion) == 'v4.0.3' Or $(TargetFrameworkVersion) == 'v4.1' Or $(TargetFrameworkVersion) == 'v4.2' Or $(TargetFrameworkVersion) == 'v4.3' Or $(TargetFrameworkVersion) == 'v4.4' Or $(TargetFrameworkVersion) == 'v5.0' Or $(TargetFrameworkVersion) == 'v5.1' Or $(TargetFrameworkVersion) == 'v6.0' Or $(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1' Or $(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkProfile) == 'Profile14') Or ($(TargetFrameworkProfile) == 'Profile5') Or ($(TargetFrameworkProfile) == 'Profile37') Or ($(TargetFrameworkProfile) == 'Profile136') Or ($(TargetFrameworkProfile) == 'Profile328') Or ($(TargetFrameworkProfile) == 'Profile92') Or ($(TargetFrameworkProfile) == 'Profile225') Or ($(TargetFrameworkProfile) == 'Profile19') Or ($(TargetFrameworkProfile) == 'Profile6') Or ($(TargetFrameworkProfile) == 'Profile42') Or ($(TargetFrameworkProfile) == 'Profile147') Or ($(TargetFrameworkProfile) == 'Profile336') Or ($(TargetFrameworkProfile) == 'Profile102') Or ($(TargetFrameworkProfile) == 'Profile240') Or ($(TargetFrameworkProfile) == 'Profile24') Or ($(TargetFrameworkProfile) == 'Profile47') Or ($(TargetFrameworkProfile) == 'Profile158') Or ($(TargetFrameworkProfile) == 'Profile344') Or ($(TargetFrameworkProfile) == 'Profile255') Or ($(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == '.NETCore' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v5.0')) Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And $(TargetFrameworkVersion) == 'v8.0') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS')">
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid' And ($(TargetFrameworkVersion) == 'v1.0' Or $(TargetFrameworkVersion) == 'v2.2' Or $(TargetFrameworkVersion) == 'v2.3' Or $(TargetFrameworkVersion) == 'v4.0.3' Or $(TargetFrameworkVersion) == 'v4.1' Or $(TargetFrameworkVersion) == 'v4.2' Or $(TargetFrameworkVersion) == 'v4.3' Or $(TargetFrameworkVersion) == 'v4.4' Or $(TargetFrameworkVersion) == 'v5.0' Or $(TargetFrameworkVersion) == 'v5.1' Or $(TargetFrameworkVersion) == 'v6.0' Or $(TargetFrameworkVersion) == 'v7.0' Or $(TargetFrameworkVersion) == 'v7.1' Or $(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkProfile) == 'Profile14') Or ($(TargetFrameworkProfile) == 'Profile37') Or ($(TargetFrameworkProfile) == 'Profile136') Or ($(TargetFrameworkProfile) == 'Profile328') Or ($(TargetFrameworkProfile) == 'Profile225') Or ($(TargetFrameworkProfile) == 'Profile5') Or ($(TargetFrameworkProfile) == 'Profile92') Or ($(TargetFrameworkProfile) == 'Profile19') Or ($(TargetFrameworkProfile) == 'Profile42') Or ($(TargetFrameworkProfile) == 'Profile147') Or ($(TargetFrameworkProfile) == 'Profile336') Or ($(TargetFrameworkProfile) == 'Profile240') Or ($(TargetFrameworkProfile) == 'Profile6') Or ($(TargetFrameworkProfile) == 'Profile102') Or ($(TargetFrameworkProfile) == 'Profile24') Or ($(TargetFrameworkProfile) == 'Profile47') Or ($(TargetFrameworkProfile) == 'Profile158') Or ($(TargetFrameworkProfile) == 'Profile344') Or ($(TargetFrameworkProfile) == 'Profile255') Or ($(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkIdentifier) == '.NETCore' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v5.0')) Or ($(TargetFrameworkIdentifier) == 'WindowsPhone' And $(TargetFrameworkVersion) == 'v8.0') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkIdentifier) == 'Xamarin.tvOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.watchOS')">
<ItemGroup>
<Reference Include="Newtonsoft.Json">
<HintPath>..\..\packages\Newtonsoft.Json\lib\portable-net40+sl5+wp80+win8+wpa81\Newtonsoft.Json.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion src/Paket.Core/PaketConfigFiles/LockFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module LockFileSerializer =

let s =
// add "clitool"
match package.Kind, settings.ToString().ToLower() with
match package.Kind, settings.ToString(options.Settings,false).ToLower() with
| ResolvedPackageKind.DotnetCliTool, "" -> "clitool: true"
| ResolvedPackageKind.DotnetCliTool, s -> s + ", clitool: true"
| ResolvedPackageKind.Package, s -> s
Expand Down
73 changes: 37 additions & 36 deletions src/Paket.Core/Versioning/Requirements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -897,60 +897,61 @@ type InstallSettings =
OmitContent = None
GenerateLoadScripts = None }

member this.ToString(asLines) =
member this.ToString(groupSettings:InstallSettings,asLines) =
let options =
[ match this.CopyLocal with
| Some x -> yield "copy_local: " + x.ToString().ToLower()
| None -> ()
| Some x when groupSettings.CopyLocal <> this.CopyLocal -> yield "copy_local: " + x.ToString().ToLower()
| _ -> ()
match this.SpecificVersion with
| Some x -> yield "specific_version: " + x.ToString().ToLower()
| None -> ()
| Some x when groupSettings.SpecificVersion <> this.SpecificVersion -> yield "specific_version: " + x.ToString().ToLower()
| _ -> ()
match this.StorageConfig with
| Some (PackagesFolderGroupConfig.NoPackagesFolder) -> yield "storage: none"
| Some (PackagesFolderGroupConfig.SymbolicLink) -> yield "storage: symlink"
| Some (PackagesFolderGroupConfig.GivenPackagesFolder s) -> failwithf "Not implemented yet."
| Some (PackagesFolderGroupConfig.DefaultPackagesFolder) -> yield "storage: packages"
| None -> ()
| Some (PackagesFolderGroupConfig.NoPackagesFolder) when groupSettings.StorageConfig <> this.StorageConfig -> yield "storage: none"
| Some (PackagesFolderGroupConfig.SymbolicLink) when groupSettings.StorageConfig <> this.StorageConfig -> yield "storage: symlink"
| Some (PackagesFolderGroupConfig.GivenPackagesFolder s) when groupSettings.StorageConfig <> this.StorageConfig -> failwithf "Not implemented yet."
| Some (PackagesFolderGroupConfig.DefaultPackagesFolder) when groupSettings.StorageConfig <> this.StorageConfig -> yield "storage: packages"
| _ -> ()
match this.CopyContentToOutputDirectory with
| Some CopyToOutputDirectorySettings.Never -> yield "copy_content_to_output_dir: never"
| Some CopyToOutputDirectorySettings.Always -> yield "copy_content_to_output_dir: always"
| Some CopyToOutputDirectorySettings.PreserveNewest -> yield "copy_content_to_output_dir: preserve_newest"
| None -> ()
| Some CopyToOutputDirectorySettings.Never when groupSettings.CopyContentToOutputDirectory <> this.CopyContentToOutputDirectory -> yield "copy_content_to_output_dir: never"
| Some CopyToOutputDirectorySettings.Always when groupSettings.CopyContentToOutputDirectory <> this.CopyContentToOutputDirectory -> yield "copy_content_to_output_dir: always"
| Some CopyToOutputDirectorySettings.PreserveNewest when groupSettings.CopyContentToOutputDirectory <> this.CopyContentToOutputDirectory -> yield "copy_content_to_output_dir: preserve_newest"
| _ -> ()
match this.ImportTargets with
| Some x -> yield "import_targets: " + x.ToString().ToLower()
| None -> ()
| Some x when groupSettings.ImportTargets <> this.ImportTargets -> yield "import_targets: " + x.ToString().ToLower()
| _ -> ()
match this.OmitContent with
| Some ContentCopySettings.Omit -> yield "content: none"
| Some ContentCopySettings.Overwrite -> yield "content: true"
| Some ContentCopySettings.OmitIfExisting -> yield "content: once"
| None -> ()
| Some ContentCopySettings.Omit when groupSettings.OmitContent <> this.OmitContent -> yield "content: none"
| Some ContentCopySettings.Overwrite when groupSettings.OmitContent <> this.OmitContent -> yield "content: true"
| Some ContentCopySettings.OmitIfExisting when groupSettings.OmitContent <> this.OmitContent -> yield "content: once"
| _ -> ()
match this.IncludeVersionInPath with
| Some x -> yield "version_in_path: " + x.ToString().ToLower()
| None -> ()
| Some x when groupSettings.IncludeVersionInPath <> this.IncludeVersionInPath -> yield "version_in_path: " + x.ToString().ToLower()
| _ -> ()
match this.LicenseDownload with
| Some x -> yield "license_download: " + x.ToString().ToLower()
| None -> ()
| Some x when groupSettings.LicenseDownload <> this.LicenseDownload -> yield "license_download: " + x.ToString().ToLower()
| _ -> ()
match this.ReferenceCondition with
| Some x -> yield "condition: " + x.ToUpper()
| None -> ()
| Some x when groupSettings.ReferenceCondition <> this.ReferenceCondition -> yield "condition: " + x.ToUpper()
| _ -> ()
match this.CreateBindingRedirects with
| Some BindingRedirectsSettings.On -> yield "redirects: on"
| Some BindingRedirectsSettings.Off -> yield "redirects: off"
| Some BindingRedirectsSettings.Force -> yield "redirects: force"
| None -> ()
| Some BindingRedirectsSettings.On when groupSettings.CreateBindingRedirects <> this.CreateBindingRedirects -> yield "redirects: on"
| Some BindingRedirectsSettings.Off when groupSettings.CreateBindingRedirects <> this.CreateBindingRedirects -> yield "redirects: off"
| Some BindingRedirectsSettings.Force when groupSettings.CreateBindingRedirects <> this.CreateBindingRedirects -> yield "redirects: force"
| _ -> ()
match this.FrameworkRestrictions with
| ExplicitRestriction FrameworkRestriction.HasNoRestriction -> ()
| ExplicitRestriction FrameworkRestriction.HasNoRestriction when groupSettings.FrameworkRestrictions <> this.FrameworkRestrictions -> ()
| AutoDetectFramework -> ()
| ExplicitRestriction fr -> yield "restriction: " + (fr.ToString())
| ExplicitRestriction fr when groupSettings.FrameworkRestrictions <> this.FrameworkRestrictions -> yield "restriction: " + (fr.ToString())
| _ -> ()
match this.GenerateLoadScripts with
| Some true -> yield "generate_load_scripts: true"
| Some false -> yield "generate_load_scripts: false"
| None -> () ]
| Some true when groupSettings.GenerateLoadScripts <> this.GenerateLoadScripts -> yield "generate_load_scripts: true"
| Some false when groupSettings.GenerateLoadScripts <> this.GenerateLoadScripts -> yield "generate_load_scripts: false"
| _ -> () ]

let separator = if asLines then Environment.NewLine else ", "
String.Join(separator,options)

override this.ToString() = this.ToString(false)
override this.ToString() = this.ToString(InstallSettings.Default,false)

static member (+)(self, other : InstallSettings) =
{
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
<StartArguments>install</StartArguments>
<StartWorkingDirectory>C:\temp\Gu.Reactive</StartWorkingDirectory>
<StartArguments>update</StartArguments>
<StartArguments>restore</StartArguments>
<StartArguments>update --keep-patch</StartArguments>
<StartWorkingDirectory>C:\proj\Paket</StartWorkingDirectory>
<StartWorkingDirectory>D:\temp\PaketTargetFrameworkRepro\</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\bookstore</StartWorkingDirectory>
<StartWorkingDirectory>C:\temp\paket-conflict\paket.conflict.app</StartWorkingDirectory>
<StartWorkingDirectory>D:\temp\i3032</StartWorkingDirectory>
<StartWorkingDirectory>C:\code\Paket\integrationtests\scenarios\i003062-external-lock\before</StartWorkingDirectory>
<StartWorkingDirectory>C:\code\logary</StartWorkingDirectory>
<StartWorkingDirectory>C:\temp\flip</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
Expand Down

0 comments on commit 0446b5d

Please sign in to comment.