This repository was archived by the owner on Jan 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +53
-1
lines changed
OctoPack.Tests/Integration Expand file tree Collapse file tree 2 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -401,7 +401,11 @@ private void UpdateVersionWithAppendValue(XContainer nuSpec)
401401
402402 var version = GetVersionElementFromNuSpec ( nuSpec ) ;
403403
404- version . Value = $ "{ PackageVersion ?? version . Value } -{ AppendToVersion . Trim ( ) } ";
404+ if ( AppendToVersion [ 0 ] != '+' )
405+ version . Value = $ "{ PackageVersion ?? version . Value } -{ AppendToVersion . Trim ( ) } ";
406+ else
407+ version . Value = $ "{ PackageVersion ?? version . Value } { AppendToVersion . Trim ( ) } ";
408+
405409 PackageVersion = version . Value ;
406410 }
407411
Original file line number Diff line number Diff line change @@ -494,6 +494,54 @@ public void ShouldAllowAppendingValueToVersionWithExplicitPackageVersion()
494494 "Web.Debug.config" ) ) ;
495495 }
496496
497+ [ Test ]
498+ public void ShouldAllowAppendingValueToVersionWithMetadataOnly ( )
499+ {
500+ MsBuild ( "Samples.sln /p:RunOctoPack=true /p:OctoPackAppendToVersion=+Foo /p:Configuration=Release /v:m" ) ;
501+
502+ AssertPackage ( @"Sample.ConsoleApp\obj\octopacked\Sample.ConsoleApp.2.1.0.1+Foo.nupkg" ,
503+ pkg => pkg . AssertContents (
504+ "Sample.ConsoleApp.exe" ,
505+ "Sample.ConsoleApp.exe.config" ,
506+ "Sample.ConsoleApp.pdb" ) ) ;
507+
508+ AssertPackage ( @"Sample.WebApp\obj\octopacked\Sample.WebApp.3.1.0-dev+Foo.nupkg" ,
509+ pkg => pkg . AssertContents (
510+ "bin\\ *.dll" ,
511+ "bin\\ *.xml" ,
512+ "bin\\ Sample.WebApp.dll" ,
513+ "bin\\ Sample.WebApp.pdb" ,
514+ "Content\\ *.css" ,
515+ "Content\\ *.png" ,
516+ "Content\\ LinkedFile.txt" ,
517+ "Scripts\\ *.js" ,
518+ "Views\\ Web.config" ,
519+ "Views\\ *.cshtml" ,
520+ "Global.asax" ,
521+ "Web.config" ,
522+ "Web.Release.config" ,
523+ "Web.Debug.config" ) ) ;
524+
525+ AssertPackage ( @"Sample.WebAppWithSpec\obj\octopacked\Sample.WebAppWithSpec.1.0.13-demo+Foo.nupkg" ,
526+ pkg => pkg . AssertContents (
527+ "bin\\ *.dll" ,
528+ "bin\\ *.xml" ,
529+ "bin\\ Sample.WebAppWithSpec.dll" ,
530+ "bin\\ Sample.WebAppWithSpec.pdb" ,
531+ "Content\\ *.css" ,
532+ "Content\\ *.png" ,
533+ "Content\\ LinkedFile.txt" ,
534+ "Scripts\\ *.js" ,
535+ "Views\\ Web.config" ,
536+ "Views\\ *.cshtml" ,
537+ "Views\\ Deploy.ps1" ,
538+ "Deploy.ps1" ,
539+ "Global.asax" ,
540+ "Web.config" ,
541+ "Web.Release.config" ,
542+ "Web.Debug.config" ) ) ;
543+ }
544+
497545 [ Test ]
498546 public void ShouldSupportRelativeOutputDirectories ( )
499547 {
You can’t perform that action at this time.
0 commit comments