Add -IncludeReferencedProjects to nuget pack command

Jonathan Mezach's Avatar

Jonathan Mezach

09 Nov, 2014 01:46 PM

Would it be possible to add the -IncludeReferencedProjects to the command line when AppVeyor runs nuget pack? This makes sure that project references show up in the dependencies of the created package when the referenced package has a .nuspec file. At the moment I have a solution with two projects where the second project depends on the first, but if I install the package created from the second project I won't get the first project's package as well because it is not listed as a dependency.

Having it available as an option would be even nicer of course ;).

  1. Support Staff 1 Posted by Feodor Fitsner on 10 Nov, 2014 04:18 AM

    Feodor Fitsner's Avatar

    Added a new issue: https://github.com/appveyor/ci/issues/50

    It won't be hard to add this option.

  2. 2 Posted by Andrew Craven on 02 Feb, 2015 11:04 AM

    Andrew Craven's Avatar

    I have exactly the same issue. I was able to workaround it by adding the following to the appveyor.yaml file:

    after_build:
    - nuget pack "src\Atlas.ServiceBus\Atlas.ServiceBus.csproj" -Version "%APPVEYOR_BUILD_VERSION%" -Properties "Configuration=Release;Platform=AnyCPU" -IncludeReferencedProjects
    - nuget pack "src\Atlas.ServiceBus.RabbitMQ\Atlas.ServiceBus.RabbitMQ.csproj" -Version "%APPVEYOR_BUILD_VERSION%" -Properties "Configuration=Release;Platform=AnyCPU" -IncludeReferencedProjects
    artifacts:
    - path: Atlas.ServiceBus*.nupkg

    Strictly speaking, I don't believe the first project needs the -IncludeReferencedProjects option.

    The complete appveyor.yaml file can be found at https://github.com/acraven/service-bus/blob/master/appveyor.yml

  3. 3 Posted by davew on 12 Feb, 2015 10:04 PM

    davew's Avatar

    Hi Feodor, any progress on this as an option?

    Thanks.

  4. Support Staff 4 Posted by Feodor Fitsner on 13 Feb, 2015 01:36 AM

    Feodor Fitsner's Avatar

    Not yet, sorry.

  5. 5 Posted by davew on 13 Feb, 2015 10:13 AM

    davew's Avatar

    To work around this I modified my vanilla ProjectName.nuspec file to explicitly add dependencies:

      <?xml version="1.0"?>
      <package>
        <metadata>
          <id>$id$</id>
          <version>$version$</version>
          <title>$title$</title>
          <authors>Your Name</authors>
          <owners>$author$</owners>
          <requireLicenseAcceptance>false</requireLicenseAcceptance>
          <description>$description$</description>
          <copyright>$author$</copyright>
    
          <!-- Dependencies added here --->
          <dependencies>
            <dependency id="ExistingPackage.NuGetId"
                        version="1.0.1"/>
            <dependency id="ReferencedProject.NuGetId"
                        version="$version$"/>
          </dependencies>
        </metadata>
      </package>
    
  6. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:54 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac