Fixing nuget API calls and fixing the nuget test package directory creation, so that nuget can restore using it.
This commit is contained in:
parent
4fe36fd1e5
commit
d3157de6ee
4 changed files with 20 additions and 5 deletions
|
@ -70,6 +70,8 @@
|
|||
<TestDirectory>$(RepoRoot)/test/</TestDirectory>
|
||||
<DotnetUnderTest>$(Stage2Directory)</DotnetUnderTest>
|
||||
</PropertyGroup>
|
||||
|
||||
<MakeDir Directories="$(TestPackagesDir)" Condition="!Exists('$(TestPackagesDir)')"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildTests"
|
||||
|
@ -213,9 +215,10 @@
|
|||
<DotNetPackMsbuildArgs Condition=" '$(IsDesktopAvailable)' == 'True' And '%(TestPackageProject.PackRuntime)' != '' ">/p:RuntimeIdentifier=%(TestPackageProject.PackRuntime)</DotNetPackMsbuildArgs>
|
||||
</PropertyGroup>
|
||||
|
||||
<DotNetRestore ToolPath="$(Stage2Directory)"
|
||||
<DotNetRestore ToolPath="$(Stage0Directory)"
|
||||
Source="$(TestPackagesDir)"
|
||||
WorkingDirectory="%(TestPackageProject.FullPath)" />
|
||||
ConfigFile="$(RepoRoot)\NuGet.Config"
|
||||
ProjectPath="%(TestPackageProject.ProjectPath)" />
|
||||
|
||||
<DotNetBuild Framework="%(TestPackageProject.Framework)"
|
||||
Runtime="%(TestPackageProject.Runtime)"
|
||||
|
|
|
@ -12,9 +12,11 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
protected override string Args
|
||||
{
|
||||
get { return $"{GetProjectPath()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; }
|
||||
get { return $"{GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; }
|
||||
}
|
||||
|
||||
public string ConfigFile { get; set; }
|
||||
|
||||
public string AdditionalParameters { get; set; }
|
||||
|
||||
public string ProjectPath { get; set; }
|
||||
|
@ -27,6 +29,16 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
public string Runtime { get; set; }
|
||||
|
||||
private string GetConfigFile()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ConfigFile))
|
||||
{
|
||||
return $"--configfile {ConfigFile}";
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private string GetSource()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Source))
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
public DepsJsonBuilder()
|
||||
{
|
||||
// This resolver is only used for building file names, so that base path is not required.
|
||||
_versionFolderPathResolver = new VersionFolderPathResolver(path: null);
|
||||
_versionFolderPathResolver = new VersionFolderPathResolver(rootPath: null);
|
||||
}
|
||||
|
||||
public DependencyContext Build(
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace Microsoft.DotNet.Internal.ProjectModel.Resolution
|
|||
_packagePathResolver = new FallbackPackagePathResolver(nugetPathContext);
|
||||
|
||||
// This resolver is only used for building file names, so that base path is not required.
|
||||
_versionFolderPathResolver = new VersionFolderPathResolver(path: null);
|
||||
_versionFolderPathResolver = new VersionFolderPathResolver(rootPath: null);
|
||||
}
|
||||
|
||||
_frameworkReferenceResolver = frameworkReferenceResolver;
|
||||
|
|
Loading…
Add table
Reference in a new issue