Fixing schema version number, tweaking a string, and making test call pass a bool instead of a string to enable serviceable.

This commit is contained in:
Todd Moscinski 2016-06-05 11:52:41 -07:00
parent 391675c5b9
commit d3b935489f
4 changed files with 10 additions and 8 deletions

View file

@ -15,7 +15,9 @@ namespace NuGet
public const int TargetFrameworkSupportForDependencyContentsAndToolsVersion = 4;
public const int TargetFrameworkSupportForReferencesVersion = 5;
public const int XdtTransformationVersion = 6;
public const int ServiceableVersion = 8;
// Note that this version should change from 7 to 8 when the PackageType
// schema is merged into here
public const int ServiceableVersion = 7;
public static int GetManifestVersion(ManifestMetadata metadata)
{

View file

@ -29,7 +29,7 @@ namespace Microsoft.DotNet.Tools.Compiler
var buildBasePath = app.Option("-b|--build-base-path <OUTPUT_DIR>", "Directory in which to place temporary build outputs", CommandOptionType.SingleValue);
var configuration = app.Option("-c|--configuration <CONFIGURATION>", "Configuration under which to build", CommandOptionType.SingleValue);
var versionSuffix = app.Option("--version-suffix <VERSION_SUFFIX>", "Defines what `*` should be replaced with in version field in project.json", CommandOptionType.SingleValue);
var serviceable = app.Option("-s|--serviceable", "Set the serviceable flag in the output nuspec", CommandOptionType.NoValue);
var serviceable = app.Option("-s|--serviceable", "Set the serviceable flag in the package", CommandOptionType.NoValue);
var path = app.Argument("<PROJECT>", "The project to compile, defaults to the current directory. Can be a path to a project.json or a project directory");
app.OnExecute(() =>

View file

@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string _tempOutputDirectory;
private string _configuration;
private string _versionSuffix;
private string _serviceable;
private bool _serviceable;
private string OutputOption
{
@ -69,9 +69,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
{
get
{
return _serviceable == string.Empty ?
"" :
$"--serviceable";
return _serviceable ?
$"--serviceable" :
"";
}
}
@ -82,7 +82,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
string tempOutput="",
string configuration="",
string versionSuffix="",
string serviceable = "")
bool serviceable = false)
: base("dotnet")
{
_projectPath = projectPath;

View file

@ -163,7 +163,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
CopyProjectToTempDir(sourceTestLibDir, testLibDir);
var testProject = GetProjectPath(testLibDir);
var packCommand = new PackCommand(testProject, configuration: "Debug", serviceable: "true");
var packCommand = new PackCommand(testProject, configuration: "Debug", serviceable: true);
var result = packCommand.Execute();
result.Should().Pass();