Skip to content

Commit

Permalink
Add local dev convenience scripts (dotnet#3389)
Browse files Browse the repository at this point in the history
  • Loading branch information
RussKie authored Jun 4, 2020
1 parent 5c741dc commit c517fac
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 318 deletions.
318 changes: 0 additions & 318 deletions build-local.ps1

This file was deleted.

29 changes: 29 additions & 0 deletions start-code.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@ECHO OFF
SETLOCAL

:: This command launches a Visual Studio Code with environment variables required to use a local version of the .NET Core SDK.

FOR /f "delims=" %%a IN ('where.exe code') DO @SET vscode=%%a& GOTO break
:break

IF ["%vscode%"] == [""] (
echo [ERROR] Visual Studio Code is not installed or can't be found.
exit /b 1
)

:: This tells .NET Core to use the same dotnet.exe that build scripts use
SET DOTNET_ROOT=%~dp0.dotnet
SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86

:: This tells .NET Core not to go looking for .NET Core in other places
SET DOTNET_MULTILEVEL_LOOKUP=0

:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
SET PATH=%DOTNET_ROOT%;%PATH%

IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] .NET has not yet been installed. Run `%~dp0restore.cmd` to install tools
exit /b 1
)

"%vscode%" "."
21 changes: 21 additions & 0 deletions start-vs.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@ECHO OFF
SETLOCAL

:: This command launches a Visual Studio solution with environment variables required to use a local version of the .NET Core SDK.

:: This tells .NET Core to use the same dotnet.exe that build scripts use
SET DOTNET_ROOT=%~dp0.dotnet
SET DOTNET_ROOT(x86)=%~dp0.dotnet\x86

:: This tells .NET Core not to go looking for .NET Core in other places
SET DOTNET_MULTILEVEL_LOOKUP=0

:: Put our local dotnet.exe on PATH first so Visual Studio knows which one to use
SET PATH=%DOTNET_ROOT%;%PATH%

IF NOT EXIST "%DOTNET_ROOT%\dotnet.exe" (
echo [ERROR] .NET Core has not yet been installed. Run `%~dp0restore.cmd` to install tools
exit /b 1
)

start "" "Winforms.sln"

0 comments on commit c517fac

Please sign in to comment.