Merge branch 'release/2.0.0' into update-sdk
This commit is contained in:
commit
726b86cc8d
34 changed files with 798 additions and 324 deletions
|
@ -10,6 +10,7 @@
|
|||
<add key="websdkfeed" value="https://dotnet.myget.org/F/dotnet-web/api/v3/index.json" />
|
||||
<add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" />
|
||||
<add key="roslyn" value="https://dotnet.myget.org/f/roslyn/api/v3/index.json" />
|
||||
<add key="symreader-native" value="https://dotnet.myget.org/f/symreader-native/api/v3/index.json" />
|
||||
<add key="xunit" value="https://www.myget.org/F/xunit/api/v3/index.json" />
|
||||
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="vstest" value="https://dotnet.myget.org/F/vstest/api/v3/index.json" />
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<Channel>master</Channel>
|
||||
<BranchName>master</BranchName>
|
||||
<Channel>release/2.0.0</Channel>
|
||||
<BranchName>release/2.0.0</BranchName>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
|
@ -3,28 +3,29 @@
|
|||
<PropertyGroup>
|
||||
<CLI_SharedFrameworkVersion>2.0.0-preview2-25319-02</CLI_SharedFrameworkVersion>
|
||||
<CLI_MSBuild_Version>15.3.0-preview-000246-05</CLI_MSBuild_Version>
|
||||
<CLI_Roslyn_Version>2.0.0-rc4-61325-08</CLI_Roslyn_Version>
|
||||
<CLI_Roslyn_Version>2.3.0-beta2-61716-09</CLI_Roslyn_Version>
|
||||
<CLI_DiaSymNative_Version>1.6.0-beta2-25304</CLI_DiaSymNative_Version>
|
||||
<CLI_FSharp_Version>1.0.0-rc-170511-0</CLI_FSharp_Version>
|
||||
<CLI_NETSDK_Version>2.0.0-preview2-20170524-2</CLI_NETSDK_Version>
|
||||
<CLI_NuGet_Version>4.3.0-preview1-2500</CLI_NuGet_Version>
|
||||
<CLI_WEBSDK_Version>1.0.0-rel-20170501-473</CLI_WEBSDK_Version>
|
||||
<CLI_WEBSDK_Version>2.0.0-rel-20170518-512</CLI_WEBSDK_Version>
|
||||
<CLI_TestPlatform_Version>15.3.0-preview-20170502-03</CLI_TestPlatform_Version>
|
||||
<SharedFrameworkVersion>$(CLI_SharedFrameworkVersion)</SharedFrameworkVersion>
|
||||
<SharedHostVersion>$(CLI_SharedFrameworkVersion)</SharedHostVersion>
|
||||
<HostFxrVersion>$(CLI_SharedFrameworkVersion)</HostFxrVersion>
|
||||
<TemplateEngineVersion>1.0.0-beta2-20170518-237</TemplateEngineVersion>
|
||||
<TemplateEngineTemplateVersion>1.0.0-beta2-20170519-239</TemplateEngineTemplateVersion>
|
||||
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170519-239</TemplateEngineTemplate2_0Version>
|
||||
<TemplateEngineVersion>1.0.0-beta2-20170523-241</TemplateEngineVersion>
|
||||
<TemplateEngineTemplateVersion>1.0.0-beta2-20170523-241</TemplateEngineTemplateVersion>
|
||||
<TemplateEngineTemplate2_0Version>1.0.0-beta2-20170523-241</TemplateEngineTemplate2_0Version>
|
||||
<PlatformAbstractionsVersion>2.0.0-preview2-25319-02</PlatformAbstractionsVersion>
|
||||
<DependencyModelVersion>2.0.0-preview2-25319-02</DependencyModelVersion>
|
||||
<CliCommandLineParserVersion>0.1.0-alpha-142</CliCommandLineParserVersion>
|
||||
<CliMigrateVersion>1.2.1-alpha-002130</CliMigrateVersion>
|
||||
<MicroBuildVersion>0.2.0</MicroBuildVersion>
|
||||
|
||||
|
||||
<!-- This should either be timestamped or notimestamp as appropriate -->
|
||||
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
|
||||
<AspNetCoreRuntimeVersion>dev-121</AspNetCoreRuntimeVersion>
|
||||
<AspNetCoreCoherenceTimestamp>preview2-25102</AspNetCoreCoherenceTimestamp>
|
||||
<AspNetCoreRuntimeVersion>dev-125</AspNetCoreRuntimeVersion>
|
||||
<AspNetCoreCoherenceTimestamp>preview2-25159</AspNetCoreCoherenceTimestamp>
|
||||
|
||||
</PropertyGroup>
|
||||
|
||||
|
|
|
@ -7,9 +7,12 @@ echo "Welcome to .NET Core!
|
|||
---------------------
|
||||
Learn more about .NET Core @ https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
|
||||
|
||||
Telemetry
|
||||
.NET Core Tools Telemetry
|
||||
--------------
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community.
|
||||
You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell.
|
||||
You can read more about .NET Core tools telemetry @ https://aka.ms/dotnet-cli-telemetry."
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry."
|
||||
|
||||
su - $SUDO_USER -c "dotnet new > /dev/null 2>&1 || true"
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<body>
|
||||
<font face="Helvetica">
|
||||
<h3>
|
||||
Welcome to .NET Core!
|
||||
Installation completed successfully. Welcome to .NET Core!
|
||||
</h3>
|
||||
<p>
|
||||
Learn more about .NET Core at <a href="https://aka.ms/dotnet-docs">https://aka.ms/dotnet-docs</a> . Use dotnet --help to see available commands or go to <a href="https://aka.ms/dotnet-cli-docs">https://aka.ms/dotnet-cli-docs</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
<h3>
|
||||
Configuration
|
||||
.NET Core Tools Telemetry
|
||||
</h3>
|
||||
<p>
|
||||
A command is run in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
</p>
|
||||
<p>
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
</p>
|
||||
<p>
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at <a href="https://aka.ms/dotnet-cli-telemetry">https://aka.ms/dotnet-cli-telemetry</a>.
|
||||
</p>
|
||||
</font>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
|
||||
<Window Width="620" Height="468" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
|
||||
<Window Width="620" Height="418" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
|
||||
<Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="FFFFFF">Segoe UI</Font>
|
||||
<Font Id="1" Height="-24" Weight="900" Foreground="FFFFFF" Background="682079">Segoe UI</Font>
|
||||
<Font Id="2" Height="-22" Weight="500" Foreground="666666">Segoe UI</Font>
|
||||
|
@ -52,7 +52,6 @@
|
|||
<Text X="11" Y="80" Width="-11" Height="30" FontId="2" DisablePrefix="yes">#(loc.ProgressHeader)</Text>
|
||||
<Text X="11" Y="121" Width="70" Height="17" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Text>
|
||||
<Text Name="OverallProgressPackageText" X="85" Y="121" Width="-11" Height="17" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Text>
|
||||
<Text X="160" Y="180" Width="442" Height="300" FontId="3">#(loc.FirstTimeWelcomeMessage)</Text>
|
||||
<Progressbar Name="OverallCalculatedProgressbar" X="11" Y="143" Width="-11" Height="15" />
|
||||
<Button Name="ProgressCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.ProgressCancelButton)</Button>
|
||||
</Page>
|
||||
|
@ -70,7 +69,7 @@
|
|||
<Text X="0" Y="0" Width="620" Height="75" FontId="1" />
|
||||
|
||||
<Text Name="SuccessHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessHeader)</Text>
|
||||
<Text Name="SuccessInstallHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessInstallHeader)</Text>
|
||||
<Richedit Name="SuccessInstallHeader" X="158" Y="81" Width="-12" Height="-71" FontId="5" HideWhenDisabled="yes">#(loc.FirstTimeWelcomeMessage)</Richedit>
|
||||
<Text Name="SuccessRepairHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessRepairHeader)</Text>
|
||||
<Text Name="SuccessUninstallHeader" X="11" Y="80" Width="-11" Height="30" FontId="2" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessUninstallHeader)</Text>
|
||||
<Button Name="LaunchButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessLaunchButton)</Button>
|
||||
|
|
|
@ -31,7 +31,6 @@ Ready? Set? Let's go!</String>
|
|||
<String Id="ModifyCloseButton">&Close</String>
|
||||
<String Id="SuccessRepairHeader">Repair Successfully Completed</String>
|
||||
<String Id="SuccessUninstallHeader">Uninstall Successfully Completed</String>
|
||||
<String Id="SuccessInstallHeader">Installation Successfully Completed</String>
|
||||
<String Id="SuccessHeader">Setup Successful</String>
|
||||
<String Id="SuccessLaunchButton">&Launch</String>
|
||||
<String Id="SuccessRestartText">You must restart your computer before you can use the software.</String>
|
||||
|
@ -51,11 +50,16 @@ Ready? Set? Let's go!</String>
|
|||
<String Id="FilesInUseDontCloseRadioButton">&Do not close applications. A reboot will be required.</String>
|
||||
<String Id="FilesInUseOkButton">&OK</String>
|
||||
<String Id="FilesInUseCancelButton">&Cancel</String>
|
||||
<String Id="FirstTimeWelcomeMessage">Welcome to .NET Core!
|
||||
<String Id="FirstTimeWelcomeMessage">Installation completed successfully. Welcome to .NET Core!
|
||||
|
||||
Learn more about .NET Core at https://aka.ms/dotnet-docs. Use dotnet --help to see available commands or go to https://aka.ms/dotnet-cli-docs.
|
||||
Telemetry:
|
||||
The .NET Core tools collect usage data in order to improve your experience. The data is anonymous and does not include command-line arguments. The data is collected by Microsoft and shared with the community. You can opt out of telemetry by setting a DOTNET_CLI_TELEMETRY_OPTOUT environment variable to 1 using your favorite shell. You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry.
|
||||
Configuration:
|
||||
A command is running in the end of install process to initially populate your local package cache, to improve restore speed and enable offline access. This command will take up to a minute to complete and will only happen once.
|
||||
|
||||
.NET Core Tools Telemetry
|
||||
|
||||
The .NET Core Tools include a telemetry feature that collects usage information. It is important that the .NET Team understands how the tools are being used so that we can improve them.
|
||||
|
||||
The data collected is anonymous and will be published in an aggregated form for use by both Microsoft and community engineers under the Creative Commons Attribution License.
|
||||
|
||||
The .NET Core Tools telemetry feature is enabled by default. You can opt-out of the telemetry feature by setting an environment variable DOTNET_CLI_TELEMETRY_OPTOUT (for example, 'export' on macOS/Linux, 'set' on Windows) to true (for example, 'true', 1). You can read more about .NET Core tools telemetry at https://aka.ms/dotnet-cli-telemetry.
|
||||
</String>
|
||||
</WixLocalization>
|
||||
|
|
56
scripts/obtain/dotnet-install.ps1
vendored
56
scripts/obtain/dotnet-install.ps1
vendored
|
@ -10,18 +10,14 @@
|
|||
Installs dotnet cli. If dotnet installation already exists in the given directory
|
||||
it will update it only if the requested version differs from the one already installed.
|
||||
.PARAMETER Channel
|
||||
Default: preview
|
||||
Channel is the way of reasoning about stability and quality of dotnet. This parameter takes one of the values:
|
||||
- future - Possibly unstable, frequently changing, may contain new finished and unfinished features
|
||||
- preview - Pre-release stable with known issues and feature gaps
|
||||
- production - Most stable releases
|
||||
Default: release/1.0.0
|
||||
Download from the Channel specified
|
||||
.PARAMETER Version
|
||||
Default: latest
|
||||
Represents a build version on specific channel. Possible values:
|
||||
- 4-part version in a format A.B.C.D - represents specific version of build
|
||||
- latest - most latest build on specific channel
|
||||
- lkg - last known good version on specific channel
|
||||
Note: LKG work is in progress. Once the work is finished, this will become new default
|
||||
- 3-part version in a format A.B.C - represents specific version of build
|
||||
examples: 2.0.0-preview2-006120; 1.1.0
|
||||
.PARAMETER InstallDir
|
||||
Default: %LocalAppData%\Microsoft\dotnet
|
||||
Path to where to install dotnet. Note that binaries will be placed directly in a given directory.
|
||||
|
@ -46,7 +42,11 @@
|
|||
Displays diagnostics information.
|
||||
.PARAMETER AzureFeed
|
||||
Default: https://dotnetcli.azureedge.net/dotnet
|
||||
This parameter should not be usually changed by user. It allows to change URL for the Azure feed used by this installer.
|
||||
This parameter typically is not changed by the user.
|
||||
It allows to change URL for the Azure feed used by this installer.
|
||||
.PARAMETER UncachedFeed
|
||||
This parameter typically is not changed by the user.
|
||||
It allows to change URL for the Uncached feed used by this installer.
|
||||
.PARAMETER ProxyAddress
|
||||
If set, the installer will use the proxy when making web requests
|
||||
.PARAMETER ProxyUseDefaultCredentials
|
||||
|
@ -55,7 +55,7 @@
|
|||
#>
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[string]$Channel="rel-1.0.0",
|
||||
[string]$Channel="release/1.0.0",
|
||||
[string]$Version="Latest",
|
||||
[string]$InstallDir="<auto>",
|
||||
[string]$Architecture="<auto>",
|
||||
|
@ -160,8 +160,8 @@ function GetHTTPResponse([Uri] $Uri)
|
|||
$HttpClient = New-Object System.Net.Http.HttpClient
|
||||
}
|
||||
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
|
||||
# 5 minutes allows it to work over much slower connections.
|
||||
$HttpClient.Timeout = New-TimeSpan -Minutes 5
|
||||
# 10 minutes allows it to work over much slower connections.
|
||||
$HttpClient.Timeout = New-TimeSpan -Minutes 10
|
||||
$Response = $HttpClient.GetAsync($Uri).Result
|
||||
if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode)))
|
||||
{
|
||||
|
@ -184,15 +184,15 @@ function GetHTTPResponse([Uri] $Uri)
|
|||
}
|
||||
|
||||
|
||||
function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [string]$CLIArchitecture) {
|
||||
function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
$VersionFileUrl = $null
|
||||
if ($SharedRuntime) {
|
||||
$VersionFileUrl = "$UncachedFeed/$AzureChannel/dnvm/latest.sharedfx.win.$CLIArchitecture.version"
|
||||
$VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version"
|
||||
}
|
||||
else {
|
||||
$VersionFileUrl = "$UncachedFeed/Sdk/$AzureChannel/latest.version"
|
||||
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version"
|
||||
}
|
||||
|
||||
$Response = GetHTTPResponse -Uri $VersionFileUrl
|
||||
|
@ -201,6 +201,7 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str
|
|||
switch ($Response.Content.Headers.ContentType) {
|
||||
{ ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($StringContent) }
|
||||
{ ($_ -eq "text/plain") } { $VersionText = $StringContent }
|
||||
{ ($_ -eq "text/plain; charset=UTF-8") } { $VersionText = $StringContent }
|
||||
default { throw "``$Response.Content.Headers.ContentType`` is an unknown .version file content type." }
|
||||
}
|
||||
|
||||
|
@ -209,38 +210,26 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str
|
|||
return $VersionInfo
|
||||
}
|
||||
|
||||
# TODO: AzureChannel and Channel should be unified
|
||||
function Get-Azure-Channel-From-Channel([string]$Channel) {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
# For compatibility with build scripts accept also directly Azure channels names
|
||||
switch ($Channel.ToLower()) {
|
||||
{ ($_ -eq "future") -or ($_ -eq "dev") } { return "dev" }
|
||||
{ $_ -eq "production" } { throw "Production channel does not exist yet" }
|
||||
default { return $_ }
|
||||
}
|
||||
}
|
||||
|
||||
function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$AzureChannel, [string]$CLIArchitecture, [string]$Version) {
|
||||
function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel, [string]$Version) {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
switch ($Version.ToLower()) {
|
||||
{ $_ -eq "latest" } {
|
||||
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -AzureChannel $AzureChannel -CLIArchitecture $CLIArchitecture
|
||||
$LatestVersionInfo = Get-Latest-Version-Info -AzureFeed $AzureFeed -Channel $Channel
|
||||
return $LatestVersionInfo.Version
|
||||
}
|
||||
{ $_ -eq "lkg" } { throw "``-Version LKG`` not supported yet." }
|
||||
default { return $Version }
|
||||
}
|
||||
}
|
||||
|
||||
function Get-Download-Links([string]$AzureFeed, [string]$AzureChannel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||
function Get-Download-Links([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
$ret = @()
|
||||
|
||||
if ($SharedRuntime) {
|
||||
$PayloadURL = "$AzureFeed/$AzureChannel/Binaries/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip"
|
||||
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip"
|
||||
}
|
||||
else {
|
||||
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip"
|
||||
|
@ -405,10 +394,9 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
|
|||
}
|
||||
}
|
||||
|
||||
$AzureChannel = Get-Azure-Channel-From-Channel -Channel $Channel
|
||||
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
|
||||
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -AzureChannel $AzureChannel -CLIArchitecture $CLIArchitecture -Version $Version
|
||||
$DownloadLinks = Get-Download-Links -AzureFeed $AzureFeed -AzureChannel $AzureChannel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
|
||||
$DownloadLinks = Get-Download-Links -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
|
||||
if ($DryRun) {
|
||||
Say "Payload URLs:"
|
||||
|
|
209
scripts/obtain/dotnet-install.sh
vendored
209
scripts/obtain/dotnet-install.sh
vendored
|
@ -111,6 +111,24 @@ get_os_download_name_from_platform() {
|
|||
get_current_os_name() {
|
||||
eval $invocation
|
||||
|
||||
local uname=$(uname)
|
||||
if [ "$uname" = "Darwin" ]; then
|
||||
echo "osx"
|
||||
return 0
|
||||
else
|
||||
if [ "$uname" = "Linux" ]; then
|
||||
echo "linux"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
say_err "OS name could not be detected: $ID.$VERSION_ID"
|
||||
return 1
|
||||
}
|
||||
|
||||
get_distro_specific_os_name() {
|
||||
eval $invocation
|
||||
|
||||
local uname=$(uname)
|
||||
if [ "$uname" = "Darwin" ]; then
|
||||
echo "osx"
|
||||
|
@ -140,12 +158,19 @@ machine_has() {
|
|||
return $?
|
||||
}
|
||||
|
||||
|
||||
check_min_reqs() {
|
||||
if ! machine_has "curl"; then
|
||||
say_err "curl is required to download dotnet. Install curl to proceed."
|
||||
local hasMinimum=false
|
||||
if machine_has "curl"; then
|
||||
hasMinimum=true
|
||||
elif machine_has "wget"; then
|
||||
hasMinimum=true
|
||||
fi
|
||||
|
||||
if [ "$hasMinimum" = "false" ]; then
|
||||
say_err "curl (recommended) or wget are required to download dotnet. Install missing prerequisite to proceed."
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -168,7 +193,6 @@ check_pre_reqs() {
|
|||
|
||||
[ -z "$($LDCONFIG_COMMAND -p | grep libunwind)" ] && say_err "Unable to locate libunwind. Install libunwind to continue" && failing=true
|
||||
[ -z "$($LDCONFIG_COMMAND -p | grep libssl)" ] && say_err "Unable to locate libssl. Install libssl to continue" && failing=true
|
||||
[ -z "$($LDCONFIG_COMMAND -p | grep libcurl)" ] && say_err "Unable to locate libcurl. Install libcurl to continue" && failing=true
|
||||
[ -z "$($LDCONFIG_COMMAND -p | grep libicu)" ] && say_err "Unable to locate libicu. Install libicu to continue" && failing=true
|
||||
fi
|
||||
|
||||
|
@ -252,12 +276,12 @@ get_normalized_architecture_from_architecture() {
|
|||
return 0
|
||||
;;
|
||||
x86)
|
||||
say_err "Architecture ``x86`` currently not supported"
|
||||
say_err "Architecture \`x86\` currently not supported"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
say_err "Architecture ``$architecture`` not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues"
|
||||
say_err "Architecture \`$architecture\` not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues"
|
||||
return 1
|
||||
}
|
||||
|
||||
|
@ -307,23 +331,20 @@ is_dotnet_package_installed() {
|
|||
|
||||
# args:
|
||||
# azure_feed - $1
|
||||
# azure_channel - $2
|
||||
# channel - $2
|
||||
# normalized_architecture - $3
|
||||
get_latest_version_info() {
|
||||
eval $invocation
|
||||
|
||||
local azure_feed=$1
|
||||
local azure_channel=$2
|
||||
local channel=$2
|
||||
local normalized_architecture=$3
|
||||
|
||||
local osname
|
||||
osname=$(get_current_os_name) || return 1
|
||||
|
||||
local version_file_url=null
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
version_file_url="$uncached_feed/$azure_channel/dnvm/latest.sharedfx.$osname.$normalized_architecture.version"
|
||||
version_file_url="$uncached_feed/Runtime/$channel/latest.version"
|
||||
else
|
||||
version_file_url="$uncached_feed/Sdk/$azure_channel/latest.version"
|
||||
version_file_url="$uncached_feed/Sdk/$channel/latest.version"
|
||||
fi
|
||||
say_verbose "get_latest_version_info: latest url: $version_file_url"
|
||||
|
||||
|
@ -331,51 +352,27 @@ get_latest_version_info() {
|
|||
return $?
|
||||
}
|
||||
|
||||
# args:
|
||||
# channel - $1
|
||||
get_azure_channel_from_channel() {
|
||||
eval $invocation
|
||||
|
||||
local channel=$(to_lowercase $1)
|
||||
case $channel in
|
||||
future|dev)
|
||||
echo "dev"
|
||||
return 0
|
||||
;;
|
||||
production)
|
||||
say_err "Production channel does not exist yet"
|
||||
return 1
|
||||
esac
|
||||
|
||||
echo $channel
|
||||
return 0
|
||||
}
|
||||
|
||||
# args:
|
||||
# azure_feed - $1
|
||||
# azure_channel - $2
|
||||
# channel - $2
|
||||
# normalized_architecture - $3
|
||||
# version - $4
|
||||
get_specific_version_from_version() {
|
||||
eval $invocation
|
||||
|
||||
local azure_feed=$1
|
||||
local azure_channel=$2
|
||||
local channel=$2
|
||||
local normalized_architecture=$3
|
||||
local version=$(to_lowercase $4)
|
||||
|
||||
case $version in
|
||||
latest)
|
||||
local version_info
|
||||
version_info="$(get_latest_version_info $azure_feed $azure_channel $normalized_architecture)" || return 1
|
||||
version_info="$(get_latest_version_info $azure_feed $channel $normalized_architecture)" || return 1
|
||||
say_verbose "get_specific_version_from_version: version_info=$version_info"
|
||||
echo "$version_info" | get_version_from_version_info
|
||||
return 0
|
||||
;;
|
||||
lkg)
|
||||
say_err "``--version LKG`` not supported yet."
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
echo $version
|
||||
return 0
|
||||
|
@ -385,23 +382,23 @@ get_specific_version_from_version() {
|
|||
|
||||
# args:
|
||||
# azure_feed - $1
|
||||
# azure_channel - $2
|
||||
# channel - $2
|
||||
# normalized_architecture - $3
|
||||
# specific_version - $4
|
||||
construct_download_link() {
|
||||
eval $invocation
|
||||
|
||||
local azure_feed=$1
|
||||
local azure_channel=$2
|
||||
local channel=$2
|
||||
local normalized_architecture=$3
|
||||
local specific_version=${4//[$'\t\r\n']}
|
||||
|
||||
local osname
|
||||
osname=$(get_current_os_name) || return 1
|
||||
|
||||
|
||||
local download_link=null
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
download_link="$azure_feed/$azure_channel/Binaries/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
download_link="$azure_feed/Runtime/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
else
|
||||
download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
fi
|
||||
|
@ -410,6 +407,33 @@ construct_download_link() {
|
|||
return 0
|
||||
}
|
||||
|
||||
# args:
|
||||
# azure_feed - $1
|
||||
# channel - $2
|
||||
# normalized_architecture - $3
|
||||
# specific_version - $4
|
||||
construct_alt_download_link() {
|
||||
eval $invocation
|
||||
|
||||
local azure_feed=$1
|
||||
local channel=$2
|
||||
local normalized_architecture=$3
|
||||
local specific_version=${4//[$'\t\r\n']}
|
||||
|
||||
local distro_specific_osname
|
||||
distro_specific_osname=$(get_distro_specific_os_name) || return 1
|
||||
|
||||
local alt_download_link=null
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
alt_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
else
|
||||
alt_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
fi
|
||||
|
||||
echo "$alt_download_link"
|
||||
return 0
|
||||
}
|
||||
|
||||
get_user_install_path() {
|
||||
eval $invocation
|
||||
|
||||
|
@ -520,49 +544,90 @@ extract_dotnet_package() {
|
|||
# [out_path] - $2 - stdout if not provided
|
||||
download() {
|
||||
eval $invocation
|
||||
|
||||
|
||||
local remote_path=$1
|
||||
local out_path=${2:-}
|
||||
|
||||
local failed=false
|
||||
if machine_has "curl"; then
|
||||
downloadcurl $remote_path $out_path || failed=true
|
||||
elif machine_has "wget"; then
|
||||
downloadwget $remote_path $out_path || failed=true
|
||||
else
|
||||
failed=true
|
||||
fi
|
||||
if [ "$failed" = true ]; then
|
||||
say_verbose "Download failed: $remote_path"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
downloadcurl() {
|
||||
eval $invocation
|
||||
local remote_path=$1
|
||||
local out_path=${2:-}
|
||||
|
||||
local failed=false
|
||||
if [ -z "$out_path" ]; then
|
||||
curl --fail -s $remote_path || failed=true
|
||||
curl --retry 10 -sSL -f --create-dirs $remote_path || failed=true
|
||||
else
|
||||
curl --fail -s -o $out_path $remote_path || failed=true
|
||||
curl --retry 10 -sSL -f --create-dirs -o $out_path $remote_path || failed=true
|
||||
fi
|
||||
|
||||
if [ "$failed" = true ]; then
|
||||
say_err "Download failed"
|
||||
say_verbose "Curl download failed"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
downloadwget() {
|
||||
eval $invocation
|
||||
local remote_path=$1
|
||||
local out_path=${2:-}
|
||||
|
||||
local failed=false
|
||||
if [ -z "$out_path" ]; then
|
||||
wget -q --tries 10 $remote_path || failed=true
|
||||
else
|
||||
wget -v --tries 10 -O $out_path $remote_path || failed=true
|
||||
fi
|
||||
if [ "$failed" = true ]; then
|
||||
say_verbose "Wget download failed"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
calculate_vars() {
|
||||
eval $invocation
|
||||
|
||||
azure_channel=$(get_azure_channel_from_channel "$channel")
|
||||
say_verbose "azure_channel=$azure_channel"
|
||||
|
||||
normalized_architecture=$(get_normalized_architecture_from_architecture "$architecture")
|
||||
say_verbose "normalized_architecture=$normalized_architecture"
|
||||
|
||||
specific_version=$(get_specific_version_from_version $azure_feed $azure_channel $normalized_architecture $version)
|
||||
specific_version=$(get_specific_version_from_version $azure_feed $channel $normalized_architecture $version)
|
||||
say_verbose "specific_version=$specific_version"
|
||||
if [ -z "$specific_version" ]; then
|
||||
say_err "Could not get version information."
|
||||
return 1
|
||||
fi
|
||||
|
||||
download_link=$(construct_download_link $azure_feed $azure_channel $normalized_architecture $specific_version)
|
||||
download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
||||
say_verbose "download_link=$download_link"
|
||||
|
||||
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
alt_download_link=$(construct_alt_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
||||
say_verbose "alt_download_link=$alt_download_link"
|
||||
fi
|
||||
|
||||
install_root=$(resolve_installation_path $install_dir)
|
||||
say_verbose "install_root=$install_root"
|
||||
}
|
||||
|
||||
install_dotnet() {
|
||||
eval $invocation
|
||||
|
||||
local download_failed=false
|
||||
|
||||
if is_dotnet_package_installed $install_root "sdk" $specific_version; then
|
||||
say ".NET SDK version $specific_version is already installed."
|
||||
return 0
|
||||
|
@ -571,10 +636,18 @@ install_dotnet() {
|
|||
mkdir -p $install_root
|
||||
zip_path=$(mktemp $temporary_file_template)
|
||||
say_verbose "Zip path: $zip_path"
|
||||
|
||||
say "Downloading $download_link"
|
||||
download "$download_link" $zip_path
|
||||
say_verbose "Downloaded file exists and readable? $(if [ -r $zip_path ]; then echo "yes"; else echo "no"; fi)"
|
||||
|
||||
say "Downloading link: $download_link"
|
||||
download "$download_link" $zip_path || download_failed=true
|
||||
|
||||
# if the download fails, download the alt_download_link [Linux only]
|
||||
if [ "$(uname)" = "Linux" ] && [ "$download_failed" = true ]; then
|
||||
say "Cannot download: $download_link"
|
||||
zip_path=$(mktemp $temporary_file_template)
|
||||
say_verbose "Alternate zip path: $zip_path"
|
||||
say "Downloading alternate link: $alt_download_link"
|
||||
download "$alt_download_link" $zip_path
|
||||
fi
|
||||
|
||||
say "Extracting zip"
|
||||
extract_dotnet_package $zip_path $install_root
|
||||
|
@ -586,7 +659,7 @@ local_version_file_relative_path="/.version"
|
|||
bin_folder_relative_path=""
|
||||
temporary_file_template="${TMPDIR:-/tmp}/dotnet.XXXXXXXXX"
|
||||
|
||||
channel="rel-1.0.0"
|
||||
channel="release/1.0.0"
|
||||
version="Latest"
|
||||
install_dir="<auto>"
|
||||
architecture="<auto>"
|
||||
|
@ -638,6 +711,10 @@ do
|
|||
shift
|
||||
azure_feed="$1"
|
||||
;;
|
||||
--uncached-feed|-[Uu]ncached[Ff]eed)
|
||||
shift
|
||||
uncached_feed="$1"
|
||||
;;
|
||||
--runtime-id|-[Rr]untime[Ii]d)
|
||||
shift
|
||||
runtime_id="$1"
|
||||
|
@ -653,7 +730,7 @@ do
|
|||
echo "Options:"
|
||||
echo " -c,--channel <CHANNEL> Download from the CHANNEL specified (default: $channel)."
|
||||
echo " -Channel"
|
||||
echo " -v,--version <VERSION> Use specific version, ``latest`` or ``lkg``. Defaults to ``latest``."
|
||||
echo " -v,--version <VERSION> Use specific version, or \`latest\`. Defaults to \`latest\`."
|
||||
echo " -Version"
|
||||
echo " -i,--install-dir <DIR> Install under specified location (see Install Location below)"
|
||||
echo " -InstallDir"
|
||||
|
@ -665,7 +742,8 @@ do
|
|||
echo " --dry-run,-DryRun Do not perform installation. Display download link."
|
||||
echo " --no-path, -NoPath Do not set PATH for the current process."
|
||||
echo " --verbose,-Verbose Display diagnostics information."
|
||||
echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed"
|
||||
echo " --azure-feed,-AzureFeed Azure feed location. Defaults to $azure_feed, This parameter typically is not changed by the user."
|
||||
echo " --uncached-feed,-UncachedFeed Uncached feed location. This parameter typically is not changed by the user."
|
||||
echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)."
|
||||
echo " -RuntimeId"
|
||||
echo " -?,--?,-h,--help,-Help Shows this help message"
|
||||
|
@ -690,6 +768,9 @@ check_min_reqs
|
|||
calculate_vars
|
||||
if [ "$dry_run" = true ]; then
|
||||
say "Payload URL: $download_link"
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
say "Alternate payload URL: $alt_download_link"
|
||||
fi
|
||||
say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir"
|
||||
exit 0
|
||||
fi
|
||||
|
@ -699,7 +780,7 @@ install_dotnet
|
|||
|
||||
bin_path=$(get_absolute_path $(combine_paths $install_root $bin_folder_relative_path))
|
||||
if [ "$no_path" = false ]; then
|
||||
say "Adding to current process PATH: ``$bin_path``. Note: This change will be visible only when sourcing script."
|
||||
say "Adding to current process PATH: \`$bin_path\`. Note: This change will be visible only when sourcing script."
|
||||
export PATH=$bin_path:$PATH
|
||||
else
|
||||
say "Binaries of dotnet can be found in $bin_path"
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Microsoft.DotNet.MSBuildSdkResolver
|
||||
{
|
||||
internal class EnvironmentProvider
|
||||
{
|
||||
private IEnumerable<string> _searchPaths;
|
||||
|
||||
private readonly Func<string, string> _getEnvironmentVariable;
|
||||
|
||||
public EnvironmentProvider(Func<string, string> getEnvironmentVariable)
|
||||
{
|
||||
_getEnvironmentVariable = getEnvironmentVariable;
|
||||
}
|
||||
|
||||
public string ExecutableExtension
|
||||
{
|
||||
get
|
||||
{
|
||||
return Interop.RunningOnWindows ? ".exe" : string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<string> SearchPaths
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_searchPaths == null)
|
||||
{
|
||||
var searchPaths = new List<string>();
|
||||
|
||||
searchPaths.AddRange(
|
||||
_getEnvironmentVariable("PATH")
|
||||
.Split(Path.PathSeparator)
|
||||
.Select(p => p.Trim('"')));
|
||||
|
||||
_searchPaths = searchPaths;
|
||||
}
|
||||
|
||||
return _searchPaths;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetCommandPath(string commandName)
|
||||
{
|
||||
var commandNameWithExtension = commandName + ExecutableExtension;
|
||||
var commandPath = SearchPaths
|
||||
.Select(p => Path.Combine(p, commandNameWithExtension))
|
||||
.FirstOrDefault(File.Exists);
|
||||
|
||||
return commandPath;
|
||||
}
|
||||
}
|
||||
}
|
129
src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs
Normal file
129
src/Microsoft.DotNet.MSBuildSdkResolver/FXVersion.cs
Normal file
|
@ -0,0 +1,129 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
namespace Microsoft.DotNet.MSBuildSdkResolver
|
||||
{
|
||||
// Note: This is not SemVer (esp., in comparing pre-release part, fx_ver_t does not
|
||||
// compare multiple dot separated identifiers individually.) ex: 1.0.0-beta.2 vs. 1.0.0-beta.11
|
||||
// See the original version of this code here: https://github.com/dotnet/core-setup/blob/master/src/corehost/cli/fxr/fx_ver.cpp
|
||||
internal sealed class FXVersion
|
||||
{
|
||||
public int Major { get; }
|
||||
public int Minor { get; }
|
||||
public int Patch { get; }
|
||||
public string Pre { get; }
|
||||
public string Build { get; }
|
||||
|
||||
public FXVersion(int major, int minor, int patch, string pre = "", string build = "")
|
||||
{
|
||||
Major = major;
|
||||
Minor = minor;
|
||||
Patch = patch;
|
||||
Pre = pre;
|
||||
Build = build;
|
||||
}
|
||||
|
||||
public static int Compare(FXVersion s1, FXVersion s2)
|
||||
{
|
||||
if (s1.Major != s2.Major)
|
||||
{
|
||||
return s1.Major > s2.Major ? 1 : -1;
|
||||
}
|
||||
|
||||
if (s1.Minor != s2.Minor)
|
||||
{
|
||||
return s1.Minor > s2.Minor ? 1 : -1;
|
||||
}
|
||||
|
||||
if (s1.Patch != s2.Patch)
|
||||
{
|
||||
return s1.Patch > s2.Patch ? 1 : -1;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(s1.Pre) != string.IsNullOrEmpty(s2.Pre))
|
||||
{
|
||||
return string.IsNullOrEmpty(s1.Pre) ? 1 : -1;
|
||||
}
|
||||
|
||||
int preCompare = string.CompareOrdinal(s1.Pre, s2.Pre);
|
||||
if (preCompare != 0)
|
||||
{
|
||||
return preCompare;
|
||||
}
|
||||
|
||||
return string.CompareOrdinal(s1.Build, s2.Build);
|
||||
}
|
||||
|
||||
public static bool TryParse(string fxVersionString, out FXVersion FXVersion)
|
||||
{
|
||||
FXVersion = null;
|
||||
if (string.IsNullOrEmpty(fxVersionString))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int majorSeparator = fxVersionString.IndexOf(".");
|
||||
if (majorSeparator == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int major = 0;
|
||||
if (!int.TryParse(fxVersionString.Substring(0, majorSeparator), out major))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int minorStart = majorSeparator + 1;
|
||||
int minorSeparator = fxVersionString.IndexOf(".", minorStart);
|
||||
if (minorSeparator == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int minor = 0;
|
||||
if (!int.TryParse(fxVersionString.Substring(minorStart, minorSeparator - minorStart), out minor))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int patch = 0;
|
||||
int patchStart = minorSeparator + 1;
|
||||
int patchSeparator = fxVersionString.FindFirstNotOf("0123456789", patchStart);
|
||||
if (patchSeparator == -1)
|
||||
{
|
||||
if (!int.TryParse(fxVersionString.Substring(patchStart), out patch))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
FXVersion = new FXVersion(major, minor, patch);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!int.TryParse(fxVersionString.Substring(patchStart, patchSeparator - patchStart), out patch))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int preStart = patchSeparator;
|
||||
int preSeparator = fxVersionString.IndexOf("+", preStart);
|
||||
if (preSeparator == -1)
|
||||
{
|
||||
FXVersion = new FXVersion(major, minor, patch, fxVersionString.Substring(preStart));
|
||||
}
|
||||
else
|
||||
{
|
||||
int buildStart = preSeparator + 1;
|
||||
FXVersion = new FXVersion(
|
||||
major,
|
||||
minor,
|
||||
patch,
|
||||
fxVersionString.Substring(preStart, preSeparator - preStart),
|
||||
fxVersionString.Substring(buildStart));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,6 +12,8 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
|
|||
{
|
||||
internal static partial class Interop
|
||||
{
|
||||
internal static readonly bool RunningOnWindows = true;
|
||||
|
||||
static Interop()
|
||||
{
|
||||
PreloadLibrary("hostfxr.dll");
|
||||
|
|
|
@ -14,13 +14,13 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
|
|||
{
|
||||
internal static partial class Interop
|
||||
{
|
||||
internal static readonly bool s_runningOnWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
internal static readonly bool RunningOnWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
|
||||
private static int hostfxr_resolve_sdk(string exe_dir, string working_dir, [Out] StringBuilder buffer, int buffer_size)
|
||||
{
|
||||
// hostfxr string encoding is platform -specific so dispatch to the
|
||||
// appropriately annotated P/Invoke for the current platform.
|
||||
return s_runningOnWindows
|
||||
return RunningOnWindows
|
||||
? windows_hostfxr_resolve_sdk(exe_dir, working_dir, buffer, buffer_size)
|
||||
: unix_hostfxr_resolve_sdk(exe_dir, working_dir, buffer, buffer_size);
|
||||
}
|
||||
|
|
|
@ -53,6 +53,19 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
|
|||
netcoreSdkVersion = new DirectoryInfo(netcoreSdkDir).Name;;
|
||||
}
|
||||
|
||||
if (!IsNetCoreSDKOveridden(netcoreSdkVersion) &&
|
||||
IsNetCoreSDKSmallerThanTheMinimumVersion(netcoreSdkVersion, sdkReference.MinimumVersion))
|
||||
{
|
||||
return factory.IndicateFailure(
|
||||
new[]
|
||||
{
|
||||
$"Version {netcoreSdkVersion} of the SDK is smaller than the minimum version"
|
||||
+ $" {sdkReference.MinimumVersion} requested. Check that a recent enough .NET Core SDK is"
|
||||
+ " installed, increase the minimum version specified in the project, or increase"
|
||||
+ " the version specified in global.json."
|
||||
});
|
||||
}
|
||||
|
||||
string msbuildSdkDir = Path.Combine(msbuildSdksDir, sdkReference.Name, "Sdk");
|
||||
if (!Directory.Exists(msbuildSdkDir))
|
||||
{
|
||||
|
@ -60,80 +73,57 @@ namespace Microsoft.DotNet.MSBuildSdkResolver
|
|||
new[]
|
||||
{
|
||||
$"{msbuildSdkDir} not found. Check that a recent enough .NET Core SDK is installed"
|
||||
+ " and/or increase the version specified in global.json. "
|
||||
+ " and/or increase the version specified in global.json."
|
||||
});
|
||||
}
|
||||
|
||||
return factory.IndicateSuccess(msbuildSdkDir, netcoreSdkVersion);
|
||||
}
|
||||
|
||||
private string ResolveNetcoreSdkDirectory(SdkResolverContext context)
|
||||
private bool IsNetCoreSDKOveridden(string netcoreSdkVersion)
|
||||
{
|
||||
foreach (string exeDir in GetDotnetExeDirectoryCandidates())
|
||||
{
|
||||
string workingDir = context.SolutionFilePath ?? context.ProjectFilePath;
|
||||
string netcoreSdkDir = Interop.hostfxr_resolve_sdk(exeDir, workingDir);
|
||||
|
||||
if (netcoreSdkDir != null)
|
||||
{
|
||||
return netcoreSdkDir;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
return netcoreSdkVersion == null;
|
||||
}
|
||||
|
||||
// Search for [ProgramFiles]\dotnet in this order.
|
||||
private static readonly string[] s_programFiles = new[]
|
||||
private bool IsNetCoreSDKSmallerThanTheMinimumVersion(string netcoreSdkVersion, string minimumVersion)
|
||||
{
|
||||
// "c:\Program Files" on x64 machine regardless process architecture.
|
||||
// Undefined on x86 machines.
|
||||
"ProgramW6432",
|
||||
FXVersion netCoreSdkFXVersion;
|
||||
FXVersion minimumFXVersion;
|
||||
|
||||
// "c:\Program Files (x86)" on x64 machine regardless of process architecture
|
||||
// Undefined on x86 machines.
|
||||
"ProgramFiles(x86)",
|
||||
if (string.IsNullOrEmpty(minimumVersion))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// "c:\Program Files" or "C:\Program Files (x86)" on x64 machine depending on process architecture.
|
||||
// "c:\Program Files" on x86 machines (therefore not redundant with the two locations above in that case).
|
||||
//
|
||||
// NOTE: hostfxr will search this on its own if multilevel lookup is not disable, but we do it explicitly
|
||||
// to prevent an environment with disabled multilevel lookup from crippling desktop msbuild and VS.
|
||||
"ProgramFiles",
|
||||
};
|
||||
if (!FXVersion.TryParse(netcoreSdkVersion, out netCoreSdkFXVersion) ||
|
||||
!FXVersion.TryParse(minimumVersion, out minimumFXVersion))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<string> GetDotnetExeDirectoryCandidates()
|
||||
return FXVersion.Compare(netCoreSdkFXVersion, minimumFXVersion) == -1;
|
||||
}
|
||||
|
||||
private string ResolveNetcoreSdkDirectory(SdkResolverContext context)
|
||||
{
|
||||
string exeDir = GetDotnetExeDirectory();
|
||||
string workingDir = context.SolutionFilePath ?? context.ProjectFilePath;
|
||||
string netcoreSdkDir = Interop.hostfxr_resolve_sdk(exeDir, workingDir);
|
||||
|
||||
return netcoreSdkDir;
|
||||
}
|
||||
|
||||
private string GetDotnetExeDirectory()
|
||||
{
|
||||
string environmentOverride = _getEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR");
|
||||
if (environmentOverride != null)
|
||||
{
|
||||
return new List<string>(capacity: 1) { environmentOverride };
|
||||
return environmentOverride;
|
||||
}
|
||||
|
||||
// Initial capacity is 2 because while there are 3 candidates, we expect at most 2 unique ones (x64 + x86)
|
||||
// Also, N=3 here means that we needn't be concerned with the O(N^2) complexity of the foreach + contains.
|
||||
var candidates = new List<string>(capacity: 2);
|
||||
foreach (string variable in s_programFiles)
|
||||
{
|
||||
string directory = _getEnvironmentVariable(variable);
|
||||
if (directory == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var environmentProvider = new EnvironmentProvider(_getEnvironmentVariable);
|
||||
|
||||
directory = Path.Combine(directory, "dotnet");
|
||||
if (!candidates.Contains(directory))
|
||||
{
|
||||
candidates.Add(directory);
|
||||
}
|
||||
}
|
||||
|
||||
if (candidates.Count == 0)
|
||||
{
|
||||
candidates.Add(null);
|
||||
}
|
||||
|
||||
return candidates;
|
||||
return Path.GetDirectoryName(environmentProvider.GetCommandPath("dotnet"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
15
src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs
Normal file
15
src/Microsoft.DotNet.MSBuildSdkResolver/StringExtensions.cs
Normal file
|
@ -0,0 +1,15 @@
|
|||
namespace Microsoft.DotNet.MSBuildSdkResolver
|
||||
{
|
||||
internal static class StringExtensions
|
||||
{
|
||||
public static int FindFirstNotOf(this string s, string chars, int startIndex)
|
||||
{
|
||||
for (int i = startIndex; i < s.Length; i++)
|
||||
{
|
||||
if (chars.IndexOf(s[i]) == -1) return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,6 +23,10 @@
|
|||
<PackageReference Include="Microsoft.TestPlatform.Build" Version="$(CLI_TestPlatform_Version)" />
|
||||
<PackageReference Include="NuGet.Packaging.Core.Types" Version="$(CLI_NuGet_Version)" />
|
||||
<PackageReference Include="NuGet.ProjectModel" Version="$(CLI_NuGet_Version)" />
|
||||
<!-- The project json migration commands depend on an older version of Roslyn.
|
||||
Lift the version here to match what tool_roslyn depends on (otherwise an older version will
|
||||
be added to the TPA when we crossgen and we won't be able to crossgen tool_roslyn -->
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(CLI_Roslyn_Version)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -16,7 +16,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.1" />
|
||||
<PackageReference Include="Microsoft.DiaSymReader.Native" Version="$(CLI_DiaSymNative_Version)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -30,9 +30,9 @@
|
|||
AfterTargets="Publish"
|
||||
BeforeTargets="RemoveFilesAfterPublish">
|
||||
<ItemGroup>
|
||||
<AssetsToRemoveFromDeps Include="runtimes/any/native/csc.exe"
|
||||
<AssetsToRemoveFromDeps Include="runtimes/any/native/csc.dll"
|
||||
SectionName="runtimeTargets" />
|
||||
<AssetsToRemoveFromDeps Include="runtimes/any/native/vbc.exe"
|
||||
<AssetsToRemoveFromDeps Include="runtimes/any/native/vbc.dll"
|
||||
SectionName="runtimeTargets" />
|
||||
<AssetsToRemoveFromDeps Include="tool_roslyn.dll"
|
||||
SectionName="runtime"/>
|
||||
|
@ -42,14 +42,14 @@
|
|||
SectionName="%(AssetsToRemoveFromDeps.SectionName)"
|
||||
AssetPath="%(AssetsToRemoveFromDeps.Identity)" />
|
||||
|
||||
<Copy SourceFiles="$(PublishDir)/runtimes/any/native/csc.exe;
|
||||
<Copy SourceFiles="$(PublishDir)/runtimes/any/native/csc.dll;
|
||||
$(PublishDir)/$(TargetName).runtimeconfig.json;
|
||||
$(PublishDir)/$(TargetName).deps.json;"
|
||||
DestinationFiles="$(PublishDir)/csc.exe;
|
||||
$(PublishDir)/csc.runtimeconfig.json;
|
||||
$(PublishDir)/csc.deps.json;" />
|
||||
|
||||
<Copy SourceFiles="$(PublishDir)/runtimes/any/native/vbc.exe;
|
||||
<Copy SourceFiles="$(PublishDir)/runtimes/any/native/vbc.dll;
|
||||
$(PublishDir)/$(TargetName).runtimeconfig.json;
|
||||
$(PublishDir)/$(TargetName).deps.json;"
|
||||
DestinationFiles="$(PublishDir)/vbc.exe;
|
||||
|
|
|
@ -8,6 +8,7 @@ using Microsoft.DotNet.Tools.Test.Utilities;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using System;
|
||||
|
@ -40,6 +41,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.98");
|
||||
environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99");
|
||||
environment.CreateGlobalJson(environment.TestDirectory, "99.99.98");
|
||||
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
|
||||
|
||||
var resolver = environment.CreateResolver();
|
||||
var result = (MockResult)resolver.Resolve(
|
||||
|
@ -47,13 +49,75 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
new MockContext { ProjectFilePath = environment.TestDirectory.FullName },
|
||||
new MockFactory());
|
||||
|
||||
result.Success.Should().Be(true);
|
||||
result.Success.Should().BeTrue();
|
||||
result.Path.Should().Be(expected.FullName);
|
||||
result.Version.Should().Be("99.99.98");
|
||||
result.Warnings.Should().BeNullOrEmpty();
|
||||
result.Errors.Should().BeNullOrEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReturnsNullIfTheVersionFoundDoesNotSatisfyTheMinVersion()
|
||||
{
|
||||
var environment = new TestEnvironment();
|
||||
environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99");
|
||||
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
|
||||
|
||||
var resolver = environment.CreateResolver();
|
||||
var result = (MockResult)resolver.Resolve(
|
||||
new SdkReference("Some.Test.Sdk", null, "999.99.99"),
|
||||
new MockContext { ProjectFilePath = environment.TestDirectory.FullName },
|
||||
new MockFactory());
|
||||
|
||||
result.Success.Should().BeFalse();
|
||||
result.Path.Should().BeNull();
|
||||
result.Version.Should().BeNull();
|
||||
result.Warnings.Should().BeNullOrEmpty();
|
||||
result.Errors.Should().Contain("Version 99.99.99 of the SDK is smaller than the minimum version 999.99.99"
|
||||
+ " requested. Check that a recent enough .NET Core SDK is installed, increase the minimum version"
|
||||
+ " specified in the project, or increase the version specified in global.json.");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReturnsTheVersionIfItIsEqualToTheMinVersion()
|
||||
{
|
||||
var environment = new TestEnvironment();
|
||||
var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "99.99.99");
|
||||
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
|
||||
|
||||
var resolver = environment.CreateResolver();
|
||||
var result = (MockResult)resolver.Resolve(
|
||||
new SdkReference("Some.Test.Sdk", null, "99.99.99"),
|
||||
new MockContext { ProjectFilePath = environment.TestDirectory.FullName },
|
||||
new MockFactory());
|
||||
|
||||
result.Success.Should().BeTrue();
|
||||
result.Path.Should().Be(expected.FullName);
|
||||
result.Version.Should().Be("99.99.99");
|
||||
result.Warnings.Should().BeNullOrEmpty();
|
||||
result.Errors.Should().BeNullOrEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ItReturnsTheVersionIfItIsHigherThanTheMinVersion()
|
||||
{
|
||||
var environment = new TestEnvironment();
|
||||
var expected = environment.CreateSdkDirectory(ProgramFiles.X64, "Some.Test.Sdk", "999.99.99");
|
||||
environment.CreateMuxerAndAddToPath(ProgramFiles.X64);
|
||||
|
||||
var resolver = environment.CreateResolver();
|
||||
var result = (MockResult)resolver.Resolve(
|
||||
new SdkReference("Some.Test.Sdk", null, "99.99.99"),
|
||||
new MockContext { ProjectFilePath = environment.TestDirectory.FullName },
|
||||
new MockFactory());
|
||||
|
||||
result.Success.Should().BeTrue();
|
||||
result.Path.Should().Be(expected.FullName);
|
||||
result.Version.Should().Be("999.99.99");
|
||||
result.Warnings.Should().BeNullOrEmpty();
|
||||
result.Errors.Should().BeNullOrEmpty();
|
||||
}
|
||||
|
||||
private enum ProgramFiles
|
||||
{
|
||||
X64,
|
||||
|
@ -63,6 +127,10 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
|
||||
private sealed class TestEnvironment : SdkResolverContext
|
||||
{
|
||||
public string Muxer => RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet";
|
||||
|
||||
public string PathEnvironmentVariable { get; set; }
|
||||
|
||||
public DirectoryInfo TestDirectory { get; }
|
||||
|
||||
public TestEnvironment(string identifier = "", [CallerMemberName] string callingMethod = "")
|
||||
|
@ -71,6 +139,8 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
"temp",
|
||||
identifier: identifier,
|
||||
callingMethod: callingMethod);
|
||||
|
||||
PathEnvironmentVariable = string.Empty;
|
||||
}
|
||||
|
||||
public SdkResolver CreateResolver()
|
||||
|
@ -89,30 +159,28 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
return dir;
|
||||
}
|
||||
|
||||
public void CreateMuxerAndAddToPath(ProgramFiles programFiles)
|
||||
{
|
||||
var muxerDirectory = TestDirectory.GetDirectory(GetProgramFilesDirectory(programFiles).FullName, "dotnet");
|
||||
|
||||
new FileInfo(Path.Combine(muxerDirectory.FullName, Muxer)).Create();
|
||||
|
||||
PathEnvironmentVariable = $"{muxerDirectory}{Path.PathSeparator}{PathEnvironmentVariable}";
|
||||
}
|
||||
|
||||
public void CreateGlobalJson(DirectoryInfo directory, string version)
|
||||
=> File.WriteAllText(directory.GetFile("global.json").FullName,
|
||||
$@"{{ ""sdk"": {{ ""version"": ""{version}"" }} }}");
|
||||
|
||||
public string GetEnvironmentVariable(string variable)
|
||||
{
|
||||
ProgramFiles programFiles;
|
||||
|
||||
switch (variable)
|
||||
{
|
||||
case "ProgramW6432":
|
||||
programFiles = ProgramFiles.X64;
|
||||
break;
|
||||
case "ProgramFiles(x86)":
|
||||
programFiles = ProgramFiles.X86;
|
||||
break;
|
||||
case "ProgramFiles":
|
||||
programFiles = ProgramFiles.Default;
|
||||
break;
|
||||
case "PATH":
|
||||
return PathEnvironmentVariable;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
return GetProgramFilesDirectory(programFiles).FullName;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Xunit;
|
||||
using Microsoft.DotNet.MSBuildSdkResolver;
|
||||
using FluentAssertions;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||
{
|
||||
public class GivenThatWeWantToCompareFXVersions
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("2.0.0", "1.0.0", 1)]
|
||||
[InlineData("1.1.0", "1.0.0", 1)]
|
||||
[InlineData("1.0.1", "1.0.0", 1)]
|
||||
[InlineData("1.0.0", "1.0.0-pre", 1)]
|
||||
[InlineData("1.0.0-pre+2", "1.0.0-pre+1", 1)]
|
||||
[InlineData("1.0.0", "2.0.0", -1)]
|
||||
[InlineData("1.0.0", "1.1.0", -1)]
|
||||
[InlineData("1.0.0", "1.0.1", -1)]
|
||||
[InlineData("1.0.0-pre", "1.0.0", -1)]
|
||||
[InlineData("1.0.0-pre+1", "1.0.0-pre+2", -1)]
|
||||
[InlineData("1.2.3", "1.2.3", 0)]
|
||||
[InlineData("1.2.3-pre", "1.2.3-pre", 0)]
|
||||
[InlineData("1.2.3-pre+1", "1.2.3-pre+1", 0)]
|
||||
public void OneFXVersionIsBiggerThanTheOther(string s1, string s2, int expectedResult)
|
||||
{
|
||||
FXVersion fxVersion1;
|
||||
FXVersion fxVersion2;
|
||||
FXVersion.TryParse(s1, out fxVersion1);
|
||||
FXVersion.TryParse(s2, out fxVersion2);
|
||||
FXVersion.Compare(fxVersion1, fxVersion2).Should().Be(expectedResult);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Xunit;
|
||||
using Microsoft.DotNet.MSBuildSdkResolver;
|
||||
using FluentAssertions;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||
{
|
||||
public class GivenThatWeWantToParseFXVersions
|
||||
{
|
||||
[Fact]
|
||||
public void ReturnsNullWhenNoMajorSeparatorIsFound()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
FXVersion.TryParse("1", out fxVersion).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnsNullWhenMajorPortionIsNotANumber()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
FXVersion.TryParse("a.0.0", out fxVersion).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnsNullWhenNoMinorSeparatorIsFound()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
FXVersion.TryParse("1.0", out fxVersion).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnsNullWhenMinorPortionIsNotANumber()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
FXVersion.TryParse("1.a.0", out fxVersion).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnsNullWhenPatchPortionIsNotANumber()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
FXVersion.TryParse("1.0.a", out fxVersion).Should().BeFalse();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnsFXVersionWhenOnlyMajorMinorPatchIsFound()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
|
||||
var result = FXVersion.TryParse("1.2.3", out fxVersion);
|
||||
|
||||
result.Should().BeTrue();
|
||||
fxVersion.Major.Should().Be(1);
|
||||
fxVersion.Minor.Should().Be(2);
|
||||
fxVersion.Patch.Should().Be(3);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnsFXVersionWhenOnlyMajorMinorPatchAndPreIsFound()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
|
||||
var result = FXVersion.TryParse("1.2.3-pre", out fxVersion);
|
||||
|
||||
result.Should().BeTrue();
|
||||
fxVersion.Major.Should().Be(1);
|
||||
fxVersion.Minor.Should().Be(2);
|
||||
fxVersion.Patch.Should().Be(3);
|
||||
fxVersion.Pre.Should().Be("-pre");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ReturnsFXVersionWhenMajorMinorPatchAndPreAndBuildIsFound()
|
||||
{
|
||||
FXVersion fxVersion;
|
||||
|
||||
var result = FXVersion.TryParse("1.2.3-pre+build", out fxVersion);
|
||||
|
||||
result.Should().BeTrue();
|
||||
fxVersion.Major.Should().Be(1);
|
||||
fxVersion.Minor.Should().Be(2);
|
||||
fxVersion.Patch.Should().Be(3);
|
||||
fxVersion.Pre.Should().Be("-pre");
|
||||
fxVersion.Build.Should().Be("build");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,8 +2,8 @@
|
|||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net461;$(CliTargetFramework)</TargetFrameworks>
|
||||
<TargetFrameworks Condition="'$(OS)' != 'Windows_NT'">$(CliTargetFramework)</TargetFrameworks>
|
||||
<!-- https://github.com/dotnet/cli/issues/6672: Re-enable net461 as a TFM for tests. -->
|
||||
<TargetFrameworks>$(CliTargetFramework)</TargetFrameworks>
|
||||
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AssemblyOriginatorKeyFile>../../tools/Key.snk</AssemblyOriginatorKeyFile>
|
||||
|
@ -29,6 +29,10 @@
|
|||
<None Update="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
|
||||
<Reference Include="System.Core" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Add table
Reference in a new issue