Attemping to build nupkgs for projects with other project references and want to include the references as a nuget dependency (not package the binary files). So that the referenced projects themselves can also be packaged as their own nupkg's. I believe the documentation states that all project references with paket.templates should be included as dependencies in the generated nuspec, but I can't seem to get it to work. I am assuming there is something I am missing in the setup or parameter usage. Unless this just isn't possible with paket.
Repro steps
I have compiled a simple set of shell commands to create the two project setup: Domain.csproj and Domain.Models.csproj. Domain depends on Domain.Models. I have also included the standard dotnet pack version, which references the other project correctly as a dependency in the resulting nuspec.
I could create a github repo of the sample if necessary as well.
# create sln and csprojs
mkdir sampleSln sampleSln/nupkgs
cd sampleSln
dotnet new sln
dotnet new classlib -n Domain
dotnet new classlib -n Domain.Models
dotnet sln add Domain
dotnet sln add Domain.Models
# add reference
dotnet add Domain/Domain.csproj reference Domain.Models/Domain.Models.csproj
# basic paket templates
tee Domain/Domain.csproj.paket.template <<< "type project"
tee Domain.Models/Domain.Models.csproj.paket.template <<< "type project"
# install paket
dotnet new tool-manifest
dotnet tool install paket
dotnet paket init
# give simple dependencies to each project
dotnet paket add -p Domain/Domain.csproj NLog
dotnet paket add -p Domain.Models/Domain.Models.csproj Newtonsoft.Json
# run paket basics
dotnet paket install
dotnet paket restore
# build Domain project
cd Domain
dotnet build -c Release
# attempt packaging
dotnet paket pack --version 1.0.0.1 ../nupkgs/paket/
dotnet pack -c Release -o ../nupkgs/dotnet/ -p:PackageVersion=1.0.0.1 Domain.csproj
Expected behavior
Expecting something close to the dotnet pack generated nuspec:
We have the ProjectReference for Domain.Models as a dependency. Also this nupkg is only packaging Domain.dll in lib/. NOTE: its obviously missing the NLog dependency as it doesn't know anything about paket files, this isn't the issue here and correctly handled in paket's nuspec.
Description
Attemping to build nupkgs for projects with other project references and want to include the references as a nuget dependency (not package the binary files). So that the referenced projects themselves can also be packaged as their own nupkg's. I believe the documentation states that all project references with paket.templates should be included as dependencies in the generated nuspec, but I can't seem to get it to work. I am assuming there is something I am missing in the setup or parameter usage. Unless this just isn't possible with paket.
Repro steps
I have compiled a simple set of shell commands to create the two project setup: Domain.csproj and Domain.Models.csproj. Domain depends on Domain.Models. I have also included the standard
dotnet pack
version, which references the other project correctly as a dependency in the resulting nuspec.I could create a github repo of the sample if necessary as well.
Expected behavior
Expecting something close to the
dotnet pack
generated nuspec:We have the ProjectReference for Domain.Models as a dependency. Also this nupkg is only packaging Domain.dll in
lib/
. NOTE: its obviously missing the NLog dependency as it doesn't know anything about paket files, this isn't the issue here and correctly handled in paket's nuspec.Actual behavior
But what we are getting from paket is:
We have no dependency to Domain.Models here, and the nupkg is packaging both Domain.dll and Domain.Models.dll in
lib/
.Using
Is there something else which needs to be added to the paket.templates? Or an additional parameter when running
dotnet paket pack
?