Show error if tools package doesn't include runtimeconfig file
For test assets, don't explicitly include the runtimeconfig file, as the pack command does it automatically
This commit is contained in:
parent
0afd0b9975
commit
d471037ce3
12 changed files with 11 additions and 55 deletions
|
@ -8,10 +8,4 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -7,12 +7,6 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(DependencyModelVersion)" />
|
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(DependencyModelVersion)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -20,12 +20,6 @@
|
||||||
<Compile Include="..\..\..\src\dotnet\CommandLine\*.cs;..\..\..\src\dotnet\CommonLocalizableStrings.cs;" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
<Compile Include="..\..\..\src\dotnet\CommandLine\*.cs;..\..\..\src\dotnet\CommonLocalizableStrings.cs;" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="NuGet.Frameworks" Version="$(CLI_NuGet_Version)" />
|
<PackageReference Include="NuGet.Frameworks" Version="$(CLI_NuGet_Version)" />
|
||||||
<PackageReference Include="Microsoft.DotNet.Cli.Utils" Version="$(SdkNugetVersion)" />
|
<PackageReference Include="Microsoft.DotNet.Cli.Utils" Version="$(SdkNugetVersion)" />
|
||||||
|
|
|
@ -9,12 +9,6 @@
|
||||||
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||||
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
|
@ -7,10 +7,5 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<VersionSuffix></VersionSuffix>
|
<VersionSuffix></VersionSuffix>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -7,9 +7,4 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -14,10 +14,5 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\dotnet-portable\Program.cs" />
|
<Compile Include="..\dotnet-portable\Program.cs" />
|
||||||
|
|
||||||
<Content Include="..\dotnet-prefercliruntime\prefercliruntime">
|
|
||||||
<Pack>true</Pack>
|
|
||||||
<PackagePath>\prefercliruntime</PackagePath>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -6,12 +6,6 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\dotnet-portable\Program.cs" />
|
<Compile Include="..\dotnet-portable\Program.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -6,9 +6,4 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -8,10 +8,6 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
|
||||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
|
||||||
</BuiltProjectOutputGroupOutput>
|
|
||||||
|
|
||||||
<Content Include="prefercliruntime">
|
<Content Include="prefercliruntime">
|
||||||
<Pack>true</Pack>
|
<Pack>true</Pack>
|
||||||
<PackagePath>\prefercliruntime</PackagePath>
|
<PackagePath>\prefercliruntime</PackagePath>
|
||||||
|
|
|
@ -22,6 +22,14 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
if(PrefersCliRuntime(commandPath))
|
if(PrefersCliRuntime(commandPath))
|
||||||
{
|
{
|
||||||
var runtimeConfigFile = Path.ChangeExtension(commandPath, FileNameSuffixes.RuntimeConfigJson);
|
var runtimeConfigFile = Path.ChangeExtension(commandPath, FileNameSuffixes.RuntimeConfigJson);
|
||||||
|
|
||||||
|
if (!File.Exists(runtimeConfigFile))
|
||||||
|
{
|
||||||
|
throw new GracefulException(string.Format(LocalizableStrings.CouldNotFindToolRuntimeConfigFile,
|
||||||
|
nameof(PackagedCommandSpecFactory),
|
||||||
|
Path.GetFileName(commandPath)));
|
||||||
|
}
|
||||||
|
|
||||||
var runtimeConfig = new RuntimeConfig(runtimeConfigFile);
|
var runtimeConfig = new RuntimeConfig(runtimeConfigFile);
|
||||||
|
|
||||||
var muxer = new Muxer();
|
var muxer = new Muxer();
|
||||||
|
|
|
@ -21,6 +21,8 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
|
||||||
public const string IgnoringPreferCLIRuntimeFile = "{0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2})";
|
public const string IgnoringPreferCLIRuntimeFile = "{0}: Ignoring prefercliruntime file as the tool target framework ({1}) has a different major version than the current CLI runtime ({2})";
|
||||||
|
|
||||||
|
public const string CouldNotFindToolRuntimeConfigFile = "{0}: Could not find runtimeconfig.json file for tool {1}";
|
||||||
|
|
||||||
public const string AttemptingToResolve = "{0}: attempting to resolve {1}";
|
public const string AttemptingToResolve = "{0}: attempting to resolve {1}";
|
||||||
|
|
||||||
public const string DidNotFindAMatchingProject = "{0}: Did not find a matching project {1}.";
|
public const string DidNotFindAMatchingProject = "{0}: Did not find a matching project {1}.";
|
||||||
|
|
Loading…
Reference in a new issue