From 64143fc6edfba06c4df43796395c3a16b87acd24 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 27 Sep 2016 15:49:21 -0700 Subject: [PATCH] add F#-specific command line initialization batch file for Dev15 --- .../component-groups/Compiler_Redist.wxs | 1 + .../Microsoft.FSharp.Dependencies/Files.swr | 3 ++ .../Microsoft.FSharp.Dependencies/fsharp.bat | 45 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 setup/Swix/Microsoft.FSharp.Dependencies/fsharp.bat diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs index 7aeee352462..04c74ab88a5 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs @@ -110,6 +110,7 @@ + diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr index 04eeec577a8..6add787bcb2 100644 --- a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr @@ -32,3 +32,6 @@ folder "InstallDir:Common7\IDE\NewFileItems" file source="$(BinariesFolder)\setup\resources\NewFileDialog\General\NewFSharpFileItems.vsdir" file source="$(BinariesFolder)\setup\resources\NewFileDialog\General\File.fs" file source="$(BinariesFolder)\setup\resources\NewFileDialog\General\Script.fsx" + +folder "InstallDir:Common7\Tools\VsDevCmd\Ext" + file source="fsharp.bat" diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/fsharp.bat b/setup/Swix/Microsoft.FSharp.Dependencies/fsharp.bat new file mode 100644 index 00000000000..9d5d7f7d77d --- /dev/null +++ b/setup/Swix/Microsoft.FSharp.Dependencies/fsharp.bat @@ -0,0 +1,45 @@ +if "%VSCMD_TEST%" NEQ "" goto :test +if "%VSCMD_ARG_CLEAN_ENV%" NEQ "" goto :clean_env + +if "%FSHARPINSTALLDIR%" NEQ "" set "PATH=%FSHARPINSTALLDIR%;%PATH%" + +goto :end + +:test + +set __VSCMD_TEST_FSHARP_STATUS=pass + +@REM ****************************************************************** +@REM basic environment validation cases go here +@REM ****************************************************************** + +where fsc.exe +if "%ERRORLEVEL%" NEQ "0" ( + @echo [ERROR:%~nx0] Unable to find F# compiler via 'where fsc.exe'. + set __VSCMD_TEST_FSHARP_STATUS=fail +) + +where fsi.exe +if "%ERRORLEVEL%" NEQ "0" ( + @echo [ERROR:%~nx0] Unable to find F# Interactive via 'where fsi.exe'. + set __VSCMD_TEST_FSHARP_STATUS=fail +) + +@REM return value other than 0 if tests failed. +if "%__VSCMD_TEST_FSHARP_STATUS%" NEQ "pass" ( + set __VSCMD_TEST_FSHARP_STATUS= + exit /B 1 +) + +set __VSCMD_TEST_FSHARP_STATUS= +exit /B 0 + +:clean_env + +@REM Script only adds to PATH, no custom action required for -clean_env +@REM vsdevcmd.bat will clean-up this variable. + +goto :end +:end + +exit /B 0