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>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -7,12 +7,6 @@
|
|||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(DependencyModelVersion)" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -20,12 +20,6 @@
|
|||
<Compile Include="..\..\..\src\dotnet\CommandLine\*.cs;..\..\..\src\dotnet\CommonLocalizableStrings.cs;" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NuGet.Frameworks" Version="$(CLI_NuGet_Version)" />
|
||||
<PackageReference Include="Microsoft.DotNet.Cli.Utils" Version="$(SdkNugetVersion)" />
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -8,9 +8,4 @@
|
|||
<VersionSuffix></VersionSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -7,9 +7,4 @@
|
|||
<OutputType>Exe</OutputType>
|
||||
<RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -14,10 +14,5 @@
|
|||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\dotnet-portable\Program.cs" />
|
||||
|
||||
<Content Include="..\dotnet-prefercliruntime\prefercliruntime">
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>\prefercliruntime</PackagePath>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -6,12 +6,6 @@
|
|||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\dotnet-portable\Program.cs" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -6,9 +6,4 @@
|
|||
<OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -8,10 +8,6 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<BuiltProjectOutputGroupOutput Include="$(ProjectRuntimeConfigFilePath)">
|
||||
<FinalOutputPath>$(ProjectRuntimeConfigFilePath)</FinalOutputPath>
|
||||
</BuiltProjectOutputGroupOutput>
|
||||
|
||||
<Content Include="prefercliruntime">
|
||||
<Pack>true</Pack>
|
||||
<PackagePath>\prefercliruntime</PackagePath>
|
||||
|
|
|
@ -22,6 +22,14 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
if(PrefersCliRuntime(commandPath))
|
||||
{
|
||||
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 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 CouldNotFindToolRuntimeConfigFile = "{0}: Could not find runtimeconfig.json file for tool {1}";
|
||||
|
||||
public const string AttemptingToResolve = "{0}: attempting to resolve {1}";
|
||||
|
||||
public const string DidNotFindAMatchingProject = "{0}: Did not find a matching project {1}.";
|
||||
|
|
Loading…
Reference in a new issue