3

I have a nuspec file defined like so:

<?xml version="1.0"?>
<package>
  <metadata>
    <id>PSP.Build.Vcs.Svn</id>
  </metadata>
  <files>
    <file src="tools\**\**\**\PSP.Build.Vcs.Svn\Set-BuildNumber.psm1" target="tools" />
  </files>
</package>

As you can see the id is "PSP.Build.Vcs.Svn" and that same literal is repeated in the file element. In the interests of DRY, is it possible to reference the id elsewhere in the nuspec file? I'm imagining something like the following (even though this didn't actually work):

<?xml version="1.0"?>
<package>
  <metadata>
    <id>PSP.Build.Vcs.Svn</id>
  </metadata>
  <files>
    <file src="tools\**\**\**\$(id)\Set-BuildNumber.psm1" target="tools" />
  </files>
</package>

I suspect the answer is no, but just thought I'd ask.

TIA

jamiet
  • 10,501
  • 14
  • 80
  • 159

1 Answers1

0

if you have setup your build process such as that the value of $id$ is PSP.Build.Vcs.Svn then you could replace that with $id$.

See http://docs.nuget.org/Create/Nuspec-Reference#replacement-tokens

Jaguar
  • 5,929
  • 34
  • 48