diff --git a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs index 7f5b70d28..237f8495d 100644 --- a/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ b/src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs @@ -32,20 +32,21 @@ namespace Microsoft.DotNet.Tools.MSBuild return new Dictionary { { "MSBuildExtensionsPath", AppContext.BaseDirectory }, - { "DotnetHostPath", GetHostPath() }, + { "CscToolExe", GetRunCscPath() } }; } - private static string GetHostPath() - { - return new Muxer().MuxerPath; - } - private static string GetMSBuildExePath() { return Path.Combine( AppContext.BaseDirectory, s_msbuildExeName); } + + private static string GetRunCscPath() + { + var scriptExtension = RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows ? ".cmd" : ".sh"; + return Path.Combine(AppContext.BaseDirectory, $"RunCsc{scriptExtension}"); + } } } diff --git a/src/redist/RunCsc.sh b/src/redist/RunCsc.sh new file mode 100755 index 000000000..dc4170a91 --- /dev/null +++ b/src/redist/RunCsc.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/csc.exe $@ \ No newline at end of file diff --git a/src/redist/project.json b/src/redist/project.json index ef6439d55..46697539d 100644 --- a/src/redist/project.json +++ b/src/redist/project.json @@ -1,7 +1,13 @@ { "version": "1.0.0-preview3-*", "buildOptions": { - "emitEntryPoint": true + "emitEntryPoint": true, + "copyToOutput": { + "include": "RunCsc.sh" + } + }, + "publishOptions": { + "include": "RunCsc.sh" }, "dependencies": { "Microsoft.NETCore.App": { @@ -19,6 +25,7 @@ "Microsoft.Build.Utilities.Core": "0.1.0-preview-00039-160922", "Microsoft.Build.Targets": "0.1.0-preview-00039-160922", "Microsoft.Build": "0.1.0-preview-00039-160922", + "Microsoft.CodeAnalysis.Build.Tasks": "2.0.0-beta6-60920-07", "System.Runtime.Serialization.Xml": "4.1.1", "NuGet.Build.Tasks": "3.6.0-beta.1.msbuild.9", "Microsoft.TestPlatform.CLI": "15.0.0-preview-20160915-01" diff --git a/src/tool_msbuild/project.json b/src/tool_msbuild/project.json index 18bdff7a1..d0365ad16 100644 --- a/src/tool_msbuild/project.json +++ b/src/tool_msbuild/project.json @@ -14,7 +14,7 @@ "Microsoft.CodeAnalysis.Build.Tasks": "2.0.0-beta6-60920-07", "Microsoft.Cci": "4.0.0-rc3-24128-00", "Microsoft.Composition": "1.0.30", - "Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000002" + "Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000003" }, "frameworks": { "netcoreapp1.0": {