Merge pull request #5751 from piotrpMSFT/piotrpMSFT/merge/rel1.0.0
merge rel/1.0.0 into master
This commit is contained in:
commit
c85047cfb3
55 changed files with 486 additions and 156 deletions
12
README.md
12
README.md
|
@ -4,17 +4,17 @@
|
|||
|
||||
This repo contains the source code for cross-platform [.NET Core](http://github.com/dotnet/core) command line toolchain. It contains the implementation of each command, the native packages for various supported platforms as well as documentation.
|
||||
|
||||
Preview 4 release - MSBuild based tools
|
||||
RC 4 release - MSBuild based tools
|
||||
---------------------------------------
|
||||
As was outlined in the ["Changes to project.json" blog post](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/), we have started work to move away from project.json to csproj and MSBuild. All the new `latest` releases from this repo (from `rel/1.0.0` branch) are MSBuild-enabled tools.
|
||||
As was outlined in the ["Changes to project.json" blog post](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/), we have started work to move away from project.json to csproj and MSBuild. All the new `latest` releases from this repo (from `rel/1.0.0` branch) are MSBuild-enabled tools.
|
||||
|
||||
The current official release of the csproj-enabled CLI tools is **CLI Preview 4**.
|
||||
The current official release of the csproj-enabled CLI tools is **CLI RC 4**.
|
||||
|
||||
There are a couple of things to keep in mind:
|
||||
|
||||
* Preview 4 CLI bits are still **in development** so some rough edges are to be expected.
|
||||
* Preview 4 bits **do not support** project.json so you will have to either keep Preview 2 tools around or migrate your project or add a global.json file to your project to target preview2. You can find more information on this using the [project.json to csproj instructions](https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/ProjectJsonToCSProj.md).
|
||||
* Preview 4 refers to the **CLI tools only** and does not cover Visual Studio, VS Code or Visual Studio for Mac.
|
||||
* RC 4 CLI bits are still **in development** so some rough edges are to be expected.
|
||||
* RC 4 bits **do not support** project.json so you will have to either keep Preview 2 tools around or migrate your project or add a global.json file to your project to target preview2. You can find more information on this using the [project.json to csproj instructions](https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/ProjectJsonToCSProj.md).
|
||||
* RC 4 refers to the **CLI tools only** and does not cover Visual Studio, VS Code or Visual Studio for Mac.
|
||||
* We welcome any and all issues that relate to MSBuild-based tools, so feel free to try them out and leave comments and file any bugs/problems.
|
||||
|
||||
### Download links
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.3</Version>
|
||||
<Version>1.0.4</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.3</Version>
|
||||
<Version>1.0.4</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyModel">
|
||||
<Version>1.0.1-beta-000933</Version>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<AssemblyName>dotnet-dependency-tool-invoker</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);portable-net45+win8;dnxcore50</PackageTargetFallback>
|
||||
<VersionSuffix></VersionSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -23,7 +24,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.3</Version>
|
||||
<Version>1.0.4</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NuGet.Frameworks">
|
||||
<Version>$(CLI_NuGet_Version)</Version>
|
||||
|
|
|
@ -15,16 +15,10 @@
|
|||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.3</Version>
|
||||
<Version>1.0.4</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!--The below package ref is added as a workaround to issue : https://github.com/NuGet/Home/issues/4416
|
||||
This should be removed when the issue is fixed-->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewtonSoft.Json" Version="9.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
<AssemblyName>dotnet-portable</AssemblyName>
|
||||
<OutputType>Exe</OutputType>
|
||||
<VersionSuffix></VersionSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -13,7 +16,7 @@
|
|||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.0.3</Version>
|
||||
<Version>1.0.4</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<VersionSuffix></VersionSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
<DotNetCliToolReference Include="dotnet-portable">
|
||||
<Version>1.0.0</Version>
|
||||
</DotNetCliToolReference>
|
||||
<DotNetCliToolReference Include="dotnet-PreferCliRuntime">
|
||||
<Version>1.0.0</Version>
|
||||
</DotNetCliToolReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
|
||||
|
|
|
@ -18,11 +18,6 @@
|
|||
<Version>1.0.0-*</Version>
|
||||
</DotNetCliToolReference>
|
||||
</ItemGroup>
|
||||
<!--The below package ref is added as a workaround to issue : https://github.com/NuGet/Home/issues/4416
|
||||
This should be removed when the issue is fixed-->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewtonSoft.Json" Version="9.0.1" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<DefineConstants>$(DefineConstants);RELEASE;TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26006.2
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "src\App\App.csproj", "{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Src", "Src", "{72BFCA87-B033-4721-8712-4D12166B4A39}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x64.Build.0 = Debug|x64
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Debug|x86.Build.0 = Debug|x86
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.ActiveCfg = Release|x64
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x64.Build.0 = Release|x64
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.ActiveCfg = Release|x86
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{DDF3765C-59FB-4AA6-BE83-779ED13AA64A} = {72BFCA87-B033-4721-8712-4D12166B4A39}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,15 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\src\Lib\Lib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,10 @@
|
|||
using System;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello from the main app");
|
||||
Console.WriteLine(Lib.Library.GetMessage());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard1.4</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace Lib
|
||||
{
|
||||
public class Library
|
||||
{
|
||||
public static string GetMessage()
|
||||
{
|
||||
return "Message from Lib";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26006.2
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lib", "Lib\\Lib.csproj", "{B38B1FA5-B4C9-456A-8B71-8FCD62ACF400}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86
|
||||
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,19 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Lib\Lib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,10 @@
|
|||
using System;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello from the main app");
|
||||
Console.WriteLine(Lib.Library.GetMessage());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard1.4</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
|
||||
namespace Lib
|
||||
{
|
||||
public class Library
|
||||
{
|
||||
public static string GetMessage()
|
||||
{
|
||||
return "Message from Lib";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -63,36 +63,6 @@
|
|||
VersionSuffix="$(CommitCount)"
|
||||
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
|
||||
|
||||
<!-- Corehostify Binaries -->
|
||||
<ItemGroup Condition=" '$(OSName)' != 'win' ">
|
||||
<SdkOutputChmodTargets Remove="*" />
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.exe;
|
||||
$(SdkOutputDirectory)/**/*.dll" >
|
||||
<!-- Managed assemblies do not need execute -->
|
||||
<Mode>u=rw,g=r,o=r</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.dylib;
|
||||
$(SdkOutputDirectory)/**/*.so" >
|
||||
<!-- Generally, dylibs and sos have 'x' -->
|
||||
<Mode>u=rwx,g=rx,o=rx</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*"
|
||||
Exclude="$(SdkOutputDirectory)/**/*.*" >
|
||||
<!-- Executables need x -->
|
||||
<Mode>u=rwx,g=rx,o=rx</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
</ItemGroup>
|
||||
|
||||
<Chmod Condition=" '$(OSName)' != 'win' "
|
||||
File="%(SdkOutputChModTargets.FullPath)"
|
||||
Mode="%(SdkOutputChModTargets.Mode)" />
|
||||
|
||||
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/redist.deps.json"
|
||||
SectionName="runtimeTargets"
|
||||
AssetPath="$(BinaryToCorehostifyRelDir)/%(RuntimeTargetsAssetsToRemoveFromDeps.Identity).exe" />
|
||||
|
||||
<RemoveAssetFromDepsPackages DepsFile="$(SdkOutputDirectory)/redist.deps.json"
|
||||
SectionName="runtime"
|
||||
AssetPath="%(RuntimeAssetsToRemoveFromDeps.Identity).dll" />
|
||||
|
@ -178,6 +148,32 @@
|
|||
@(CompileStageSdkDirectories);
|
||||
$(SharedFrameworkNameVersionPath)" />
|
||||
|
||||
<!-- Corehostify Binaries -->
|
||||
<ItemGroup Condition=" '$(OSName)' != 'win' ">
|
||||
<SdkOutputChmodTargets Remove="*" />
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.exe;
|
||||
$(SdkOutputDirectory)/**/*.dll" >
|
||||
<!-- Managed assemblies do not need execute -->
|
||||
<Mode>u=rw,g=r,o=r</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*.dylib;
|
||||
$(SdkOutputDirectory)/**/*.so" >
|
||||
<!-- Generally, dylibs and sos have 'x' -->
|
||||
<Mode>u=rwx,g=rx,o=rx</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
|
||||
<SdkOutputChmodTargets Include="$(SdkOutputDirectory)/**/*"
|
||||
Exclude="$(SdkOutputDirectory)/**/*.*" >
|
||||
<!-- Executables need x -->
|
||||
<Mode>u=rwx,g=rx,o=rx</Mode>
|
||||
</SdkOutputChmodTargets>
|
||||
</ItemGroup>
|
||||
|
||||
<Chmod Condition=" '$(OSName)' != 'win' "
|
||||
File="%(SdkOutputChModTargets.FullPath)"
|
||||
Mode="%(SdkOutputChModTargets.Mode)" />
|
||||
|
||||
<!-- Move the "1.0" assemblies back -->
|
||||
<Move SourceFiles="@(NETCore10Assemblies->'$(SdkOutputDirectory)/%(Filename)%(Extension).bak')"
|
||||
DestinationFiles="@(NETCore10Assemblies)" />
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<!-- Additional Shared Framework to be installed -->
|
||||
<PropertyGroup Condition=" '$(IncludeAdditionalSharedFrameworks)' == 'true' ">
|
||||
<AdditionalCoreSetupChannel>preview</AdditionalCoreSetupChannel>
|
||||
<AdditionalSharedFrameworkVersion>1.0.3</AdditionalSharedFrameworkVersion>
|
||||
<AdditionalSharedFrameworkVersion>1.0.4</AdditionalSharedFrameworkVersion>
|
||||
<AdditionalSharedHostVersion>1.0.1</AdditionalSharedHostVersion>
|
||||
<AdditionalHostFxrVersion>1.0.1</AdditionalHostFxrVersion>
|
||||
|
||||
|
|
|
@ -43,11 +43,12 @@
|
|||
<ItemGroup>
|
||||
<ForPublishing Include="@(GeneratedInstallers)" />
|
||||
<ForPublishing Include="%(GenerateArchivesInputsOutputs.Outputs)" />
|
||||
<ForPublishing Include="$(PackagesDirectory)/Microsoft*.nupkg" Condition=" '$(PUBLISH_NUPKG_TO_AZURE_BLOB)' != '' " />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ForPublishing>
|
||||
<RelativeBlobPath>$(Product)/$(NugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
|
||||
<RelativeBlobPath>$(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
|
||||
</ForPublishing>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
@ -62,7 +63,7 @@
|
|||
<SdkInstallerFileItemGroup Include="$(SdkInstallerFile)" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(NugetVersion)/%(SdkInstallerFileItemGroup.Filename)%(SdkInstallerFileItemGroup.Extension)</SdkDebianUploadUrl>
|
||||
<SdkDebianUploadUrl>$(DotnetBlobRootUrl)/$(Product)/$(FullNugetVersion)/%(SdkInstallerFileItemGroup.Filename)%(SdkInstallerFileItemGroup.Extension)</SdkDebianUploadUrl>
|
||||
<DebianUploadJsonFile>$(SdkDebianIntermediateDirectory)/package_upload.json</DebianUploadJsonFile>
|
||||
<DebianRevisionNumber>1</DebianRevisionNumber>
|
||||
|
||||
|
@ -89,7 +90,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<CliVersionBadgeToUpload>
|
||||
<RelativeBlobPath>$(Product)/$(NugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
|
||||
<RelativeBlobPath>$(Product)/$(FullNugetVersion)/$([System.String]::Copy('%(Filename)%(Extension)').Replace('\' ,'/'))</RelativeBlobPath>
|
||||
</CliVersionBadgeToUpload>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@
|
|||
DependsOnTargets="Init;
|
||||
SetupTestProjectData">
|
||||
<PropertyGroup>
|
||||
<TestPackageBuildVersionSuffix>$(CommitCount)</TestPackageBuildVersionSuffix>
|
||||
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
|
||||
<TestPackagesBuildDir>$(TestOutputDir)/packagesBuild/</TestPackagesBuildDir>
|
||||
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
|
||||
|
|
|
@ -6,11 +6,17 @@
|
|||
<ReleaseSuffix>alpha</ReleaseSuffix>
|
||||
|
||||
<CliVersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix)</CliVersionPrefix>
|
||||
<SimpleVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount)</SimpleVersion>
|
||||
<VersionSuffix>$(ReleaseSuffix)-$(CommitCount)</VersionSuffix>
|
||||
<NugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-$(VersionSuffix)</NugetVersion>
|
||||
|
||||
<SimpleVersion Condition=" '$(DropSuffix)' == '' ">$(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount)</SimpleVersion>
|
||||
<SimpleVersion Condition=" '$(SimpleVersion)' == '' ">$(VersionMajor).$(VersionMinor).$(VersionPatch)</SimpleVersion>
|
||||
|
||||
<VersionSuffix Condition=" '$(DropSuffix)' == '' ">$(ReleaseSuffix)-$(CommitCount)</VersionSuffix>
|
||||
|
||||
<FullNugetVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix)-$(CommitCount)</FullNugetVersion>
|
||||
|
||||
<NugetVersion Condition=" '$(DropSuffix)' == '' ">$(FullNugetVersion)</NugetVersion>
|
||||
<NugetVersion Condition=" '$(NugetVersion)' == '' ">$(VersionMajor).$(VersionMinor).$(VersionPatch)</NugetVersion>
|
||||
|
||||
<SdkVersion>$(NugetVersion)</SdkVersion>
|
||||
<SdkNugetVersion>$(SdkVersion)</SdkNugetVersion>
|
||||
<SdkNugetVersion>$(NugetVersion)</SdkNugetVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -23,9 +23,15 @@
|
|||
<SdkInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionSdk)$(InstallerExtension)</SdkInstallerFile>
|
||||
<CombinedFrameworkSdkHostInstallerFile>$(InstallerOutputDirectory)/$(ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk)$(BundleExtension)</CombinedFrameworkSdkHostInstallerFile>
|
||||
<SdkInstallerNuspecFile>$(RepoRoot)/packaging/windows/clisdk/VS.Redist.Common.Net.Core.SDK.$(Architecture).nuspec</SdkInstallerNuspecFile>
|
||||
<SdkInstallerNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(NugetVersion).nupkg</SdkInstallerNupkgFile>
|
||||
<SdkInstallerNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(FullNugetVersion).nupkg</SdkInstallerNupkgFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Generate SDK MSI Inputs -->
|
||||
<ItemGroup>
|
||||
<GenerateSdkMsiInputs Include="$(SdkLayoutOutputDirectory)/**/*;
|
||||
$(SdkGenerateMsiPowershellScript)" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Consumed By Publish -->
|
||||
<ItemGroup>
|
||||
<GeneratedInstallers Include="$(SdkInstallerFile);$(CombinedFrameworkSdkHostInstallerFile)" />
|
||||
|
@ -82,7 +88,9 @@
|
|||
|
||||
<Target Name="GenerateSdkMsi"
|
||||
DependsOnTargets="Init;Layout;AcquireWix;MsiTargetsSetupInputOutputs"
|
||||
Condition=" '$(OS)' == 'Windows_NT'">
|
||||
Condition=" '$(OS)' == 'Windows_NT'"
|
||||
Inputs="@(GenerateSdkMsiInputs)"
|
||||
Outputs="$(SdkInstallerFile)">
|
||||
|
||||
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateMsiPowershellScript)
|
||||
'$(SdkLayoutOutputDirectory)'
|
||||
|
@ -134,7 +142,7 @@
|
|||
|
||||
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateNupkgPowershellScript)
|
||||
'$(CombinedFrameworkSdkHostInstallerFile)'
|
||||
'$(NugetVersion)'
|
||||
'$(FullNugetVersion)'
|
||||
'$(SdkInstallerNuspecFile)'
|
||||
'$(SdkInstallerNupkgFile)'" />
|
||||
</Target>
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
<Target Name="SetupProjectsToPack"
|
||||
DependsOnTargets="Init">
|
||||
<PropertyGroup>
|
||||
<NupkgVersionSuffix>$(CommitCount)</NupkgVersionSuffix>
|
||||
<ProjectsSrcDirectory>$(RepoRoot)/src</ProjectsSrcDirectory>
|
||||
<PackagingBuildBasePath>$(Stage2CompilationDirectory)/forPackaging</PackagingBuildBasePath>
|
||||
<NupkgOutputDirectory>$(PackagesDirectory)</NupkgOutputDirectory>
|
||||
|
@ -26,7 +25,7 @@
|
|||
Output="$(NupkgOutputDirectory)"
|
||||
ProjectPath="%(ProjectsToPack.Identity)/%(ProjectsToPack.ProjectName).csproj"
|
||||
ToolPath="$(Stage0Directory)"
|
||||
VersionSuffix="$(ReleaseSuffix)-$(NupkgVersionSuffix)"
|
||||
VersionSuffix="$(VersionSuffix)"
|
||||
Configuration="$(Configuration)" />
|
||||
</Target>
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<CheckIfAllBuildsHavePublished AccountKey="$(ArtifactCloudDropAccessToken)"
|
||||
AccountName="$(ArtifactCloudDropAccountName)"
|
||||
ContainerName="$(ArtifactContainerName)"
|
||||
NugetVersion="$(NugetVersion)">
|
||||
NugetVersion="$(FullNugetVersion)">
|
||||
<Output TaskParameter="HaveAllBuildsPublished" PropertyName="HaveAllBuildsPublished" />
|
||||
</CheckIfAllBuildsHavePublished>
|
||||
</Target>
|
||||
|
@ -18,14 +18,14 @@
|
|||
<CopyBlobsToLatest AccountName="$(ArtifactCloudDropAccountName)"
|
||||
AccountKey="$(ArtifactCloudDropAccessToken)"
|
||||
ContainerName="$(ArtifactContainerName)"
|
||||
NugetVersion="$(NugetVersion)"
|
||||
NugetVersion="$(FullNugetVersion)"
|
||||
Channel="$(Channel)"
|
||||
CommitHash="$(CommitHash)" />
|
||||
|
||||
<CopyBlobsToLatest AccountName="$(ChecksumCloudDropAccountName)"
|
||||
AccountKey="$(ChecksumCloudDropAccessToken)"
|
||||
ContainerName="$(ChecksumContainerName)"
|
||||
NugetVersion="$(NugetVersion)"
|
||||
NugetVersion="$(FullNugetVersion)"
|
||||
Channel="$(Channel)"
|
||||
CommitHash="$(CommitHash)" />
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
<ProjectName>Microsoft.DotNet.Cli.Utils.csproj</ProjectName>
|
||||
<IsTool>True</IsTool>
|
||||
<IsApplicable>True</IsApplicable>
|
||||
<VersionPrefix>$(CliVersionPrefix)-</VersionPrefix>
|
||||
<VersionSuffix>rc4-$(TestPackageBuildVersionSuffix)</VersionSuffix>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Clean>False</Clean>
|
||||
</BaseTestPackageProject>
|
||||
<BaseTestPackageProject Include="src/Microsoft.DotNet.Cli.Utils"
|
||||
|
@ -32,8 +32,8 @@
|
|||
<ProjectName>Microsoft.DotNet.Cli.Utils.csproj</ProjectName>
|
||||
<IsTool>True</IsTool>
|
||||
<IsApplicable>True</IsApplicable>
|
||||
<VersionPrefix>$(CliVersionPrefix)-</VersionPrefix>
|
||||
<VersionSuffix>$(ReleaseSuffix)-$(TestPackageBuildVersionSuffix)</VersionSuffix>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Clean>False</Clean>
|
||||
<MsbuildArgs>/p:TargetFramework=netstandard1.5</MsbuildArgs>
|
||||
</BaseTestPackageProject>
|
||||
|
@ -42,8 +42,8 @@
|
|||
<ProjectName>Microsoft.DotNet.InternalAbstractions.csproj</ProjectName>
|
||||
<IsTool>True</IsTool>
|
||||
<IsApplicable>True</IsApplicable>
|
||||
<VersionPrefix>2.0.0-beta-</VersionPrefix>
|
||||
<VersionSuffix>beta-$(TestPackageBuildVersionSuffix)</VersionSuffix>
|
||||
<VersionPrefix>2.0.0</VersionPrefix>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Clean>False</Clean>
|
||||
</BaseTestPackageProject>
|
||||
<BaseTestPackageProject Include="TestAssets/TestPackages/PackageWithFakeNativeDep"
|
||||
|
@ -62,8 +62,8 @@
|
|||
<ProjectName>dotnet-dependency-context-test.csproj</ProjectName>
|
||||
<IsTool>True</IsTool>
|
||||
<IsApplicable>True</IsApplicable>
|
||||
<VersionPrefix>1.0.0-rc-</VersionPrefix>
|
||||
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Clean>True</Clean>
|
||||
</BaseTestPackageProject>
|
||||
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-dependency-tool-invoker">
|
||||
|
@ -71,8 +71,8 @@
|
|||
<ProjectName>dotnet-dependency-tool-invoker.csproj</ProjectName>
|
||||
<IsTool>True</IsTool>
|
||||
<IsApplicable>True</IsApplicable>
|
||||
<VersionPrefix>1.0.0-rc-</VersionPrefix>
|
||||
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Clean>True</Clean>
|
||||
</BaseTestPackageProject>
|
||||
<BaseTestPackageProject Include="TestAssets/TestPackages/dotnet-desktop-and-portable"
|
||||
|
@ -81,8 +81,8 @@
|
|||
<ProjectName>dotnet-desktop-and-portable.csproj</ProjectName>
|
||||
<IsTool>True</IsTool>
|
||||
<IsApplicable>True</IsApplicable>
|
||||
<VersionPrefix>1.0.0-rc-</VersionPrefix>
|
||||
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Clean>True</Clean>
|
||||
<MsbuildArgs>/p:RuntimeIdentifier=$(CoreCLRRid)</MsbuildArgs>
|
||||
</BaseTestPackageProject>
|
||||
|
@ -93,8 +93,8 @@
|
|||
<IsTool>True</IsTool>
|
||||
<IsMsbuild>True</IsMsbuild>
|
||||
<IsApplicable>$(DesktopAvailable)</IsApplicable>
|
||||
<VersionPrefix>1.0.0-rc-</VersionPrefix>
|
||||
<VersionSuffix>rc-$(TestPackageBuildVersionSuffix)</VersionSuffix>
|
||||
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>
|
||||
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
|
||||
<Clean>True</Clean>
|
||||
<MsbuildArgs>/p:RuntimeIdentifier=$(CoreCLRRid)</MsbuildArgs>
|
||||
</BaseTestPackageProject>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public abstract class Version
|
||||
public class Version
|
||||
{
|
||||
public virtual int Major { get; set; }
|
||||
public virtual int Minor { get; set; }
|
||||
|
|
|
@ -133,6 +133,8 @@ docker run $INTERACTIVE -t --rm --sig-proxy=true \
|
|||
-e CHECKSUM_STORAGE_ACCOUNT \
|
||||
-e CHECKSUM_STORAGE_CONTAINER \
|
||||
-e CLIBUILD_SKIP_TESTS \
|
||||
-e CommitCount \
|
||||
-e COMMITCOUNT \
|
||||
-e DROPSUFFIX \
|
||||
-e RELEASESUFFIX \
|
||||
$DOTNET_BUILD_CONTAINER_TAG \
|
||||
$BUILD_COMMAND "$@"
|
||||
|
|
|
@ -274,7 +274,8 @@ namespace Microsoft.DotNet.Cli.Sln.Internal
|
|||
}
|
||||
set
|
||||
{
|
||||
_filePath = PathUtility.GetPathWithDirectorySeparator(value);
|
||||
_filePath = PathUtility.RemoveExtraPathSeparators(
|
||||
PathUtility.GetPathWithDirectorySeparator(value));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -150,10 +150,9 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
toolLockFile.Path));
|
||||
|
||||
var toolLibrary = toolLockFile.Targets
|
||||
.FirstOrDefault(
|
||||
t => t.TargetFramework.GetShortFolderName().Equals(s_toolPackageFramework.GetShortFolderName()))
|
||||
?.Libraries.FirstOrDefault(l => l.Name == toolLibraryRange.Name);
|
||||
|
||||
.FirstOrDefault(t => s_toolPackageFramework == t.TargetFramework)
|
||||
?.Libraries.FirstOrDefault(
|
||||
l => StringComparer.OrdinalIgnoreCase.Equals(l.Name, toolLibraryRange.Name));
|
||||
if (toolLibrary == null)
|
||||
{
|
||||
Reporter.Verbose.WriteLine(string.Format(
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<Version>1.0.1-beta-000933</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NuGet.Versioning">
|
||||
<Version>$(CLI_NuGet_Version)</Version>
|
||||
|
|
|
@ -261,6 +261,32 @@ namespace Microsoft.DotNet.Tools.Common
|
|||
}
|
||||
}
|
||||
|
||||
public static string RemoveExtraPathSeparators(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
var components = path.Split(Path.DirectorySeparatorChar);
|
||||
var result = string.Empty;
|
||||
|
||||
foreach (var component in components)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(component))
|
||||
{
|
||||
result = Path.Combine(result, component);
|
||||
}
|
||||
}
|
||||
|
||||
if (path[path.Length-1] == Path.DirectorySeparatorChar)
|
||||
{
|
||||
result += Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static bool HasExtension(string filePath, string extension)
|
||||
{
|
||||
var comparison = StringComparison.Ordinal;
|
||||
|
|
|
@ -5,8 +5,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
|||
{
|
||||
internal class ConstantPackageVersions
|
||||
{
|
||||
public const string AspNetToolsVersion = "1.0.0-msbuild3-final";
|
||||
public const string AspNet110ToolsVersion = "1.1.0-msbuild3-final";
|
||||
public const string AspNetToolsVersion = "1.0.0";
|
||||
public const string AspNet110ToolsVersion = "1.1.0";
|
||||
public const string AspNetLTSPackagesVersion = "1.0.2";
|
||||
public const string EntityFrameworkLTSPackagesVersion = "1.0.2";
|
||||
public const string TestSdkPackageVersion = "15.0.0-preview-20170106-08";
|
||||
|
@ -15,6 +15,5 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
|||
public const string MstestTestAdapterVersion = "1.1.8-rc";
|
||||
public const string MstestTestFrameworkVersion = "1.0.8-rc";
|
||||
public const string BundleMinifierToolVersion = "2.2.301";
|
||||
public const string WebSdkPackageVersion = "1.0.0-alpha-20161205-1-154" ;
|
||||
}
|
||||
}
|
|
@ -591,25 +591,10 @@ namespace Microsoft.DotNet.Internal.ProjectModel
|
|||
var rawOptions = rawObject.Value<JToken>("buildOptions") as JObject;
|
||||
if (rawOptions == null)
|
||||
{
|
||||
rawOptions = rawObject.Value<JToken>("compilationOptions") as JObject;
|
||||
if (rawOptions == null)
|
||||
return new CommonCompilerOptions
|
||||
{
|
||||
return new CommonCompilerOptions
|
||||
{
|
||||
CompilerName = compilerName ?? "csc"
|
||||
};
|
||||
}
|
||||
|
||||
var lineInfo = (IJsonLineInfo)rawOptions;
|
||||
|
||||
project.Diagnostics.Add(
|
||||
new DiagnosticMessage(
|
||||
ErrorCodes.DOTNET1015,
|
||||
$"The 'compilationOptions' option is deprecated. Use 'buildOptions' instead.",
|
||||
project.ProjectFilePath,
|
||||
DiagnosticMessageSeverity.Warning,
|
||||
lineInfo.LineNumber,
|
||||
lineInfo.LinePosition));
|
||||
CompilerName = compilerName ?? "csc"
|
||||
};
|
||||
}
|
||||
|
||||
var analyzerOptionsJson = rawOptions.Value<JToken>("analyzerOptions") as JObject;
|
||||
|
@ -814,6 +799,9 @@ namespace Microsoft.DotNet.Internal.ProjectModel
|
|||
|
||||
private static void AddProjectFilesDeprecationDiagnostics(JObject rawProject, Project project)
|
||||
{
|
||||
var compilationOptionsWarning = "'buildOptions'";
|
||||
AddDeprecatedDiagnosticMessage(rawProject, project, "compilationOptions", compilationOptionsWarning);
|
||||
|
||||
var compileWarning = "'compile' in 'buildOptions'";
|
||||
AddDeprecatedDiagnosticMessage(rawProject, project, "compile", compileWarning);
|
||||
AddDeprecatedDiagnosticMessage(rawProject, project, "compileExclude", compileWarning);
|
||||
|
@ -870,6 +858,7 @@ namespace Microsoft.DotNet.Internal.ProjectModel
|
|||
|
||||
private static void ConvertDeprecatedToSupportedFormat(JObject rawProject)
|
||||
{
|
||||
ConvertToBuildOptions(rawProject);
|
||||
ConvertToBuildOptionsCompile(rawProject);
|
||||
ConvertToBuildOptionsEmbed(rawProject);
|
||||
ConvertToBuildOptionsCopyToOutput(rawProject);
|
||||
|
@ -877,6 +866,21 @@ namespace Microsoft.DotNet.Internal.ProjectModel
|
|||
ConvertToPublishOptions(rawProject);
|
||||
}
|
||||
|
||||
private static void ConvertToBuildOptions(JObject rawProject)
|
||||
{
|
||||
var jpath = "buildOptions";
|
||||
if (AreDeprecatedOptionsIgnored(rawProject, jpath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var deprecatedValue = rawProject.Value<JToken>("compilationOptions");
|
||||
if (deprecatedValue != null)
|
||||
{
|
||||
rawProject["buildOptions"] = deprecatedValue.DeepClone();
|
||||
}
|
||||
}
|
||||
|
||||
private static void ConvertToBuildOptionsCompile(JObject rawProject)
|
||||
{
|
||||
var jpath = "buildOptions.compile";
|
||||
|
|
|
@ -53,6 +53,17 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
|||
Version = ConstantPackageVersions.AspNetToolsVersion
|
||||
}
|
||||
},
|
||||
{
|
||||
new PackageDependencyInfo
|
||||
{
|
||||
Name = "Microsoft.EntityFrameworkCore.Tools.DotNet",
|
||||
Version = "[1.0.0-*,)"
|
||||
},
|
||||
new PackageDependencyInfo {
|
||||
Name = "Microsoft.EntityFrameworkCore.Tools.DotNet",
|
||||
Version = ConstantPackageVersions.AspNetToolsVersion
|
||||
}
|
||||
},
|
||||
{
|
||||
new PackageDependencyInfo
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Microsoft.Build.Execution;
|
||||
using Microsoft.DotNet.Cli.Sln.Internal;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
@ -37,9 +38,9 @@ namespace Microsoft.DotNet.Tools.Common
|
|||
//ISSUE: https://github.com/dotnet/sdk/issues/522
|
||||
//The real behavior we want (once DefaultProjectTypeGuid support is in) is to throw
|
||||
//when we cannot find ProjectTypeGuid or DefaultProjectTypeGuid. But for now we
|
||||
//need the same behavior we had before this change.
|
||||
//need to default to the C# one.
|
||||
//throw new GracefulException(CommonLocalizableStrings.UnsupportedProjectType);
|
||||
projectTypeGuid = "{13B669BE-BB05-4DDF-9536-439F39A36129}"; // CPS guid
|
||||
projectTypeGuid = ProjectTypeGuids.CSharpProjectTypeGuid;
|
||||
}
|
||||
|
||||
return projectTypeGuid;
|
||||
|
|
|
@ -39,19 +39,19 @@ Prints out a short help and a list of current commands.
|
|||
|
||||
The following commands exist for dotnet:
|
||||
|
||||
* [dotnet-new](commands/dotnet-new/README.md)
|
||||
* [dotnet-new](https://aka.ms/dotnet-new)
|
||||
* Initializes a C# or F# console application project.
|
||||
* [dotnet-restore](commands/dotnet-restore/README.md)
|
||||
* [dotnet-restore](https://aka.ms/dotnet-restore)
|
||||
* Restores the dependencies for a given application.
|
||||
* [dotnet-build](commands/dotnet-build/README.md)
|
||||
* [dotnet-build](https://aka.ms/dotnet-build)
|
||||
* Builds a .NET Core application.
|
||||
* [dotnet-publish](commands/dotnet-publish/README.md)
|
||||
* [dotnet-publish](https://aka.ms/dotnet-publish)
|
||||
* Publishes a .NET portable or self-contained application.
|
||||
* [dotnet-run](commands/dotnet-run/README.md)
|
||||
* [dotnet-run](https://aka.ms/dotnet-run)
|
||||
* Runs the application from source.
|
||||
* [dotnet-test](commands/dotnet-test/README.md)
|
||||
* [dotnet-test](https://aka.ms/dotnet-test)
|
||||
* Runs tests using a test runner specified in the project.json.
|
||||
* [dotnet-pack](commands/dotnet-pack/README.md)
|
||||
* [dotnet-pack](https://aka.ms/dotnet-pack)
|
||||
* Creates a NuGet package of your code.
|
||||
|
||||
## EXAMPLES
|
||||
|
|
|
@ -172,7 +172,7 @@ namespace Microsoft.DotNet.Tools.Common
|
|||
this SlnFile slnFile,
|
||||
SlnPropertySet nestedProjects)
|
||||
{
|
||||
var solutionFolderPaths = new Dictionary<string, string>();
|
||||
var solutionFolderPaths = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var solutionFolderProjects = slnFile.Projects.GetProjectsByType(ProjectTypeGuids.SolutionFolderGuid);
|
||||
foreach (var slnProject in solutionFolderProjects)
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<Version>$(CLI_MSBuild_Version)</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.TemplateEngine.Abstractions" Version="$(TemplateEngineVersion)" />
|
||||
<PackageReference Include="Microsoft.TemplateEngine.Cli" Version="$(TemplateEngineVersion)" />
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(CLI_Roslyn_Version)" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Build.Tasks" Version="$(CLI_Roslyn_Version)" />
|
||||
<PackageReference Include="Microsoft.Net.Compilers.netcore" Version="$(CLI_Roslyn_Version)" />
|
||||
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="1.4.0" />
|
||||
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="1.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<Version>2.2.0-beta4-build3444</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<Version>1.0.0-prerelease-00206</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace Microsoft.DotNet.Tests
|
|||
private const string TestProjectName = "AppWithToolDependency";
|
||||
|
||||
[Fact]
|
||||
public void It_returns_null_when_CommandName_is_null()
|
||||
public void ItReturnsNullWhenCommandNameIsNull()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_returns_null_when_ProjectDirectory_is_null()
|
||||
public void ItReturnsNullWhenProjectDirectoryIsNull()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -57,7 +57,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_returns_null_when_ProjectDirectory_does_not_contain_a_project_file()
|
||||
public void ItReturnsNullWhenProjectDirectoryDoesNotContainAProjectFile()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -76,7 +76,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_returns_null_when_CommandName_does_not_exist_in_ProjectTools()
|
||||
public void ItReturnsNullWhenCommandNameDoesNotExistInProjectTools()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -98,7 +98,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_returns_a_CommandSpec_with_DOTNET_as_FileName_and_CommandName_in_Args_when_CommandName_exists_in_ProjectTools()
|
||||
public void ItReturnsACommandSpecWithDOTNETAsFileNameAndCommandNameInArgsWhenCommandNameExistsInProjectTools()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -126,7 +126,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_escapes_CommandArguments_when_returning_a_CommandSpec()
|
||||
public void ItEscapesCommandArgumentsWhenReturningACommandSpec()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -149,7 +149,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_returns_a_CommandSpec_with_Args_containing_CommandPath_when_returning_a_CommandSpec_and_CommandArguments_are_null()
|
||||
public void ItReturnsACommandSpecWithArgsContainingCommandPathWhenReturningACommandSpecAndCommandArgumentsAreNull()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -174,7 +174,32 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_writes_a_deps_json_file_next_to_the_lockfile()
|
||||
public void ItReturnsACommandSpecWithArgsContainingCommandPathWhenInvokingAToolReferencedWithADifferentCasing()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
var testInstance = TestAssets.Get(TestProjectName)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.WithRestoreFiles();
|
||||
|
||||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = "dotnet-prefercliruntime",
|
||||
CommandArguments = null,
|
||||
ProjectDirectory = testInstance.Root.FullName
|
||||
};
|
||||
|
||||
var result = projectToolsCommandResolver.Resolve(commandResolverArguments);
|
||||
|
||||
result.Should().NotBeNull();
|
||||
|
||||
var commandPath = result.Args.Trim('"');
|
||||
commandPath.Should().Contain("dotnet-prefercliruntime.dll");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItWritesADepsJsonFileNextToTheLockfile()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -221,7 +246,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void Generate_deps_json_method_doesnt_overwrite_when_deps_file_already_exists()
|
||||
public void GenerateDepsJsonMethodDoesntOverwriteWhenDepsFileAlreadyExists()
|
||||
{
|
||||
var testInstance = TestAssets.Get(TestProjectName)
|
||||
.CreateInstance()
|
||||
|
@ -262,7 +287,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_adds_fx_version_as_a_param_when_the_tool_has_the_prefercliruntime_file()
|
||||
public void ItAddsFxVersionAsAParamWhenTheToolHasThePrefercliruntimeFile()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
@ -286,7 +311,7 @@ namespace Microsoft.DotNet.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void It_does_not_add_fx_version_as_a_param_when_the_tool_does_not_have_the_prefercliruntime_file()
|
||||
public void ItDoesNotAddFxVersionAsAParamWhenTheToolDoesNotHaveThePrefercliruntimeFile()
|
||||
{
|
||||
var projectToolsCommandResolver = SetupProjectToolsCommandResolver();
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
<Version>2.2.0-beta4-build3444</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Build.Runtime">
|
||||
<Version>$(CLI_MSBuild_Version)</Version>
|
||||
|
|
|
@ -16,6 +16,37 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
|||
{
|
||||
public class GivenThatIWantToMigrateBuildOptions : TestBase
|
||||
{
|
||||
[Fact]
|
||||
public void MigratingDeprecatedCompilationOptionsWithEmitEntryPointPopulatesOutputTypeField()
|
||||
{
|
||||
var mockProj = RunBuildOptionsRuleOnPj(@"
|
||||
{
|
||||
""compilationOptions"": {
|
||||
""emitEntryPoint"": ""true""
|
||||
},
|
||||
""exclude"": [
|
||||
""node_modules""
|
||||
]
|
||||
}");
|
||||
|
||||
mockProj.Properties.Count(p => p.Name == "OutputType").Should().Be(1);
|
||||
mockProj.Properties.First(p => p.Name == "OutputType").Value.Should().Be("Exe");
|
||||
|
||||
mockProj.Items.Count(i => i.ItemType.Equals("Compile", StringComparison.Ordinal))
|
||||
.Should().Be(1);
|
||||
mockProj.Items.Count(i =>
|
||||
i.ItemType.Equals("Compile", StringComparison.Ordinal) &&
|
||||
i.Remove.Equals("node_modules"))
|
||||
.Should().Be(1);
|
||||
|
||||
mockProj.Items.Count(i => i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal))
|
||||
.Should().Be(1);
|
||||
mockProj.Items.Count(i =>
|
||||
i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal) &&
|
||||
i.Remove.Equals("node_modules"))
|
||||
.Should().Be(1);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SpecifiedDefaultPropertiesAreRemovedWhenTheyExistInTheCsprojTemplate()
|
||||
{
|
||||
|
|
|
@ -59,6 +59,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
|||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("Microsoft.EntityFrameworkCore.Tools.DotNet", "Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)]
|
||||
[InlineData("Microsoft.EntityFrameworkCore.Tools", "Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion)]
|
||||
[InlineData("Microsoft.VisualStudio.Web.CodeGeneration.Tools", "Microsoft.VisualStudio.Web.CodeGeneration.Tools", ConstantPackageVersions.AspNetToolsVersion)]
|
||||
[InlineData("Microsoft.DotNet.Watcher.Tools", "Microsoft.DotNet.Watcher.Tools", ConstantPackageVersions.AspNetToolsVersion)]
|
||||
|
@ -90,5 +91,13 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
|||
|
||||
var packageRef = mockProj.Items.Where(i => i.ItemType == "DotNetCliToolReference").Should().BeEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItMergesEntityFrameworkCoreToolsAndEntityFrameworkCoreToolsDotNet()
|
||||
{
|
||||
var mockProj = RunPackageDependenciesRuleOnPj("{ \"tools\": { \"Microsoft.EntityFrameworkCore.Tools\": \"1.0.0-preview4-final\", \"Microsoft.EntityFrameworkCore.Tools.DotNet\": \"1.0.0-preview4-final\" } }");
|
||||
|
||||
EmitsToolReferences(mockProj, Tuple.Create("Microsoft.EntityFrameworkCore.Tools.DotNet", ConstantPackageVersions.AspNetToolsVersion));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,7 +26,7 @@
|
|||
<Version>2.2.0-beta4-build3444</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -33,7 +33,7 @@
|
|||
<Version>2.2.0-beta4-build1194</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NETCore.App">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(CLI_SharedFrameworkVersion)</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Runtime.Serialization.Primitives">
|
||||
<Version>4.3.0</Version>
|
||||
|
|
|
@ -17,6 +17,6 @@
|
|||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(CLI_TestPlatform_Version)" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
<PackageReference Include="xunit" Version="2.2.0-beta4-build3444" />
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="$(PlatformAbstractionsVersion)" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<Version>2.2.0-beta4-build3444</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions">
|
||||
<Version>4.18.0</Version>
|
||||
|
|
|
@ -42,7 +42,7 @@ VisualStudioVersion = 15.0.26006.2
|
|||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App\App.csproj"", ""{7072A694-548F-4CAE-A58F-12D257D5F486}""
|
||||
EndProject
|
||||
Project(""{13B669BE-BB05-4DDF-9536-439F39A36129}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__""
|
||||
Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__""
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -90,7 +90,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26006.2
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project(""{13B669BE-BB05-4DDF-9536-439F39A36129}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__""
|
||||
Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__""
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -127,7 +127,7 @@ Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""App"", ""App.csproj"", "
|
|||
EndProject
|
||||
Project(""{2150E333-8FDC-42A3-9474-1A3956D46DE8}"") = ""src"", ""src"", ""__SRC_FOLDER_GUID__""
|
||||
EndProject
|
||||
Project(""{13B669BE-BB05-4DDF-9536-439F39A36129}"") = ""Lib"", ""src\Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__""
|
||||
Project(""{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"") = ""Lib"", ""src\Lib\Lib.csproj"", ""__LIB_PROJECT_GUID__""
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -515,11 +515,13 @@ EndGlobal
|
|||
.Count().Should().Be(1, $"Lib {reasonString}");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenSolutionAlreadyContainsProjectItDoesntDuplicate()
|
||||
[Theory]
|
||||
[InlineData("TestAppWithSlnAndExistingCsprojReferences")]
|
||||
[InlineData("TestAppWithSlnAndExistingCsprojReferencesWithEscapedDirSep")]
|
||||
public void WhenSolutionAlreadyContainsProjectItDoesntDuplicate(string testAsset)
|
||||
{
|
||||
var projectDirectory = TestAssets
|
||||
.Get("TestAppWithSlnAndExistingCsprojReferences")
|
||||
.Get(testAsset)
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.Root
|
||||
|
@ -619,6 +621,28 @@ EndGlobal
|
|||
nonSolutionFolderProjects.Single().TypeGuid.Should().Be(expectedTypeGuid);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
private void WhenSlnContainsSolutionFolderWithDifferentCasingItDoesNotCreateDuplicate()
|
||||
{
|
||||
var projectDirectory = TestAssets
|
||||
.Get("TestAppWithSlnAndCaseSensitiveSolutionFolders")
|
||||
.CreateInstance()
|
||||
.WithSourceFiles()
|
||||
.Root
|
||||
.FullName;
|
||||
|
||||
var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj");
|
||||
var cmd = new DotnetCommand()
|
||||
.WithWorkingDirectory(projectDirectory)
|
||||
.Execute($"sln App.sln add {projectToAdd}");
|
||||
cmd.Should().Pass();
|
||||
|
||||
var slnFile = SlnFile.Read(Path.Combine(projectDirectory, "App.sln"));
|
||||
var solutionFolderProjects = slnFile.Projects.Where(
|
||||
p => p.TypeGuid == ProjectTypeGuids.SolutionFolderGuid);
|
||||
solutionFolderProjects.Count().Should().Be(1);
|
||||
}
|
||||
|
||||
private string GetExpectedSlnContents(
|
||||
string slnPath,
|
||||
string slnTemplate,
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.Cli;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
|
@ -18,14 +17,28 @@ namespace Microsoft.DotNet.Tests
|
|||
[Fact]
|
||||
public void VersionCommandDisplaysCorrectVersion()
|
||||
{
|
||||
var versionFilePath = Path.Combine(AppContext.BaseDirectory, ".version");
|
||||
var version = GetVersionFromFile(versionFilePath);
|
||||
|
||||
CommandResult result = new DotnetCommand()
|
||||
.ExecuteWithCapturedOutput("--version");
|
||||
|
||||
result.Should().Pass();
|
||||
|
||||
Regex.IsMatch(result.StdOut.Trim(), @"[0-9]{1}\.[0-9]{1}\.[0-9]{1}-[a-zA-Z0-9]+-[0-9]{6}$").Should()
|
||||
.BeTrue($"Unexpected dotnet sdk version - {result.StdOut}");
|
||||
result.StdOut.Trim().Should().Be(version);
|
||||
}
|
||||
|
||||
private string GetVersionFromFile(string versionFilePath)
|
||||
{
|
||||
using (var reader = new StreamReader(File.OpenRead(versionFilePath)))
|
||||
{
|
||||
SkipCommit(reader);
|
||||
return reader.ReadLine();
|
||||
}
|
||||
}
|
||||
|
||||
private void SkipCommit(StreamReader reader)
|
||||
{
|
||||
reader.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="..\..\artifacts\*\stage2\sdk\*\.version">
|
||||
<Link>.version</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -61,7 +65,7 @@
|
|||
<Version>1.0.0-prerelease-00206</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions">
|
||||
<Version>1.1.0</Version>
|
||||
<Version>$(PlatformAbstractionsVersion)</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue