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 TargetFrameworkSupportForDependencyContentsAndToolsVersion = 4;
public const int TargetFrameworkSupportForReferencesVersion = 5; public const int TargetFrameworkSupportForReferencesVersion = 5;
public const int XdtTransformationVersion = 6; 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) 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 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 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 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"); 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(() => app.OnExecute(() =>

View file

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

View file

@ -163,7 +163,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
CopyProjectToTempDir(sourceTestLibDir, testLibDir); CopyProjectToTempDir(sourceTestLibDir, testLibDir);
var testProject = GetProjectPath(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(); var result = packCommand.Execute();
result.Should().Pass(); result.Should().Pass();