Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid syntax in packages config #3253

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/Paket.Core/PaketConfigFiles/PackagesConfigFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ let Serialize (packages: NugetPackage seq) =
packages
|> Seq.choose (fun p ->
match p.VersionRequirement.Range with
| VersionRange.Specific v ->
let framework =
match p.TargetFramework with
| Some tf -> sprintf "targetFramework=\"%s\" " (tf.Replace(">= ",""))
| _ -> ""

Some (sprintf """ <package id="%s" version="[%O]" %s/>""" p.Id v framework)
| VersionRange.Specific v
| VersionRange.Minimum v ->
let framework =
match p.TargetFramework with
Expand Down
1 change: 0 additions & 1 deletion tests/Paket.Tests.preview3/Paket.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<TestAsset Include="NuGetLocal\case2\package.name.1.2.0.0.nupkg" />
<TestAsset Include="NuGetLocal\case3\netstedFolder\package.in.nested.folder.1.0.0.nupkg" />
<TestAsset Include="PackagesConfig\xunit.visualstudio.packages.config" />
<TestAsset Include="PackagesConfig\xunit.visualstudio.packages2.config" />
<TestAsset Include="PackagesConfig\asp.net.packages.config" />
<Compile Include="$(PaketTestsSourcesDir)\PackagesConfig\ReadConfig.fs" />
<Compile Include="$(PaketTestsSourcesDir)\PackagesConfig\WriteConfig.fs" />
Expand Down
8 changes: 0 additions & 8 deletions tests/Paket.Tests/PackagesConfig/ReadConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,3 @@ let ``can read xunit.visualstudio.packages.config``() =
config.Id |> shouldEqual "xunit.runner.visualstudio"
config.TargetFramework |> shouldEqual None
config.VersionRequirement.Range |> shouldEqual (VersionRange.Minimum (SemVer.Parse "2.0.1"))

[<Test>]
let ``can read xunit.visualstudio.packages2.config``() =
let config = Read("PackagesConfig/xunit.visualstudio.packages2.config") |> List.head

config.Id |> shouldEqual "xunit.runner.visualstudio"
config.TargetFramework |> shouldEqual None
config.VersionRequirement.Range |> shouldEqual (VersionRange.Specific (SemVer.Parse "2.0.1"))
7 changes: 0 additions & 7 deletions tests/Paket.Tests/PackagesConfig/WriteConfig.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ let ``can write xunit.visualstudio.packages.config``() =
let expected = File.ReadAllText fileName |> normalizeLineEndings
Serialize config |> normalizeLineEndings |> shouldEqual expected

[<Test>]
let ``can write xunit.visualstudio.package2s.config``() =
let fileName = "PackagesConfig/xunit.visualstudio.packages2.config"
let config = Read fileName
let expected = File.ReadAllText fileName |> normalizeLineEndings
Serialize config |> normalizeLineEndings |> shouldEqual expected

[<Test>]
let ``can write asp.net.packages.config``() =
let fileName = "PackagesConfig/asp.net.packages.config"
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions tests/Paket.Tests/Paket.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@
<Content Include="PackagesConfig\xunit.visualstudio.packages.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="PackagesConfig\xunit.visualstudio.packages2.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="PackagesConfig\asp.net.packages.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down