From 508ad89a4478929cf09427e95f182f6edbcafc68 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 29 Jun 2017 10:27:06 -0700 Subject: [PATCH] Enable VB for dotnet cli 1.1 --- build/Microsoft.DotNet.Cli.Compile.targets | 6 ------ .../dotnet-msbuild/MSBuildForwardingApp.cs | 7 +++++++ src/tool_roslyn/RunVbc.cmd | 6 ++++++ src/tool_roslyn/RunVbc.sh | 17 +++++++++++++++++ src/tool_roslyn/tool_roslyn.csproj | 11 +++++++++-- 5 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 src/tool_roslyn/RunVbc.cmd create mode 100644 src/tool_roslyn/RunVbc.sh diff --git a/build/Microsoft.DotNet.Cli.Compile.targets b/build/Microsoft.DotNet.Cli.Compile.targets index 9f8802765..b38fea623 100644 --- a/build/Microsoft.DotNet.Cli.Compile.targets +++ b/build/Microsoft.DotNet.Cli.Compile.targets @@ -240,12 +240,6 @@ - - - - - - diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs index 6b2b0f47f..3c74c7193 100644 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs @@ -27,6 +27,7 @@ namespace Microsoft.DotNet.Tools.MSBuild { { "MSBuildExtensionsPath", AppContext.BaseDirectory }, { "CscToolExe", GetRunCscPath() }, + { "VbcToolExe", GetRunVbcPath() }, { "MSBuildSDKsPath", GetMSBuildSDKsPath() } }; @@ -111,5 +112,11 @@ namespace Microsoft.DotNet.Tools.MSBuild var scriptExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".cmd" : ".sh"; return Path.Combine(AppContext.BaseDirectory, "Roslyn", $"RunCsc{scriptExtension}"); } + + private static string GetRunVbcPath() + { + var scriptExtension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".cmd" : ".sh"; + return Path.Combine(AppContext.BaseDirectory, "Roslyn", $"RunVbc{scriptExtension}"); + } } } diff --git a/src/tool_roslyn/RunVbc.cmd b/src/tool_roslyn/RunVbc.cmd new file mode 100644 index 000000000..e891b1bf5 --- /dev/null +++ b/src/tool_roslyn/RunVbc.cmd @@ -0,0 +1,6 @@ +@echo off + +REM Copyright (c) .NET Foundation and contributors. All rights reserved. +REM Licensed under the MIT license. See LICENSE file in the project root for full license information. + +"%~dp0..\..\..\dotnet" "%~dp0vbc.exe" %* diff --git a/src/tool_roslyn/RunVbc.sh b/src/tool_roslyn/RunVbc.sh new file mode 100644 index 000000000..3dda886a0 --- /dev/null +++ b/src/tool_roslyn/RunVbc.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# 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. +# + +set -e + +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +"$DIR/../../../dotnet" "$DIR/vbc.exe" "$@" diff --git a/src/tool_roslyn/tool_roslyn.csproj b/src/tool_roslyn/tool_roslyn.csproj index f040f15c5..4bed7fe7b 100644 --- a/src/tool_roslyn/tool_roslyn.csproj +++ b/src/tool_roslyn/tool_roslyn.csproj @@ -16,7 +16,7 @@ - + PreserveNewest PreserveNewest @@ -33,7 +33,7 @@ DestinationFiles="@(HackFilesToCopy->'$(PublishDir)/%(RecursiveDir)%(Filename)%(Extension)')" /> - @@ -55,6 +55,13 @@ DestinationFiles="$(PublishDir)/csc.exe; $(PublishDir)/csc.runtimeconfig.json; $(PublishDir)/csc.deps.json;" /> + +