Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
test fails
  • Loading branch information
enricosada committed May 17, 2018
commit 6d6926d8d1009b11eef3e9b5877a906f6ba201dd
37 changes: 36 additions & 1 deletion integrationtests/Paket.IntegrationTests/PackSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -564,4 +564,39 @@ let ``#3164 pack analyzer`` () =
ZipFile.ExtractToDirectory(package, outPath)
Path.Combine(outPath, "analyzers", "dotnet", "cs", "Analyzer.dll") |> checkFileExists

CleanDir rootPath
CleanDir rootPath


[<Test>]
let ``#4002 dotnet pack of a global tool shouldnt contain references``() =
let project = "tool1"
let scenario = "i004002-pack-global-tools"
prepareSdk scenario

let rootPath = scenarioTempPath scenario
let outPath = Path.Combine(rootPath, "out")

directPaket ("restore") scenario
|> ignore

directDotnet true (sprintf "pack -o \"%s\" /p:PackAsTool=true" outPath) rootPath
|> ignore

let nupkgPath = Path.Combine(outPath, project + ".1.0.0.nupkg")
if File.Exists nupkgPath |> not then Assert.Fail(sprintf "Expected '%s' to exist" nupkgPath)
let nuspec = NuGetLocal.getNuSpecFromNupgk nupkgPath

printfn "%A" nuspec

match nuspec.Dependencies.Value |> Seq.tryFind (fun (name,_,_) -> name = PackageName "FSharp.Core") with
| Some s -> Assert.Fail(sprintf "Expected package to still contain the FSharp.Core reference! %A" s)
| None -> ()

match nuspec.Dependencies.Value |> Seq.tryFind (fun (name,_,_) -> name = PackageName "Argu") with
| Some s -> Assert.Fail(sprintf "Expected package to still contain the Argu reference! %A" s)
| None -> ()

// Should we remove Microsoft.NETCore.App?
// Problably not as "packaged" console applications have this dependency by default, see https://www.nuget.org/packages/dotnet-mergenupkg
nuspec.Dependencies.Value.Length
|> shouldEqual 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;

namespace tool1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "2.1.300-rc1-008673"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source https://api.nuget.org/v3/index.json

framework: netstandard20, netcoreapp2.1

nuget Argu == 5.1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
RESTRICTION: || (== netcoreapp2.1) (== netstandard2.0)
NUGET
remote: https://api.nuget.org/v3/index.json
Argu (5.1)
FSharp.Core (>= 4.3.2)
System.Configuration.ConfigurationManager (>= 4.4)
FSharp.Core (4.3.4)
System.Configuration.ConfigurationManager (4.4.1)
System.Security.Cryptography.ProtectedData (>= 4.4)
System.Security.Cryptography.ProtectedData (4.4)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Argu
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<Import Project=".paket\Paket.Restore.targets" />
</Project>