Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions build/Microsoft.DotNet.Cli.Compile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,6 @@
<Copy SourceFiles="@(MSBuildTargetsToCopy)"
DestinationFiles="@(MSBuildTargetsToCopy->'$(SdkOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />

<ItemGroup>
<FilesToClean Include="$(StageDirectory)/sdk/**/vbc.exe" />
</ItemGroup>

<Delete Files="@(FilesToClean)" />

<ItemGroup>
<FilesToCopy Include="$(StageDirectory)/**/*" />
<PdbsToClean Include="$(StageDirectory)/sdk/**/*.pdb" />
Expand Down
7 changes: 7 additions & 0 deletions src/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class MSBuildForwardingApp
{
{ "MSBuildExtensionsPath", AppContext.BaseDirectory },
{ "CscToolExe", GetRunCscPath() },
{ "VbcToolExe", GetRunVbcPath() },
{ "MSBuildSDKsPath", GetMSBuildSDKsPath() }
};

Expand Down Expand Up @@ -111,5 +112,11 @@ private static string GetRunCscPath()
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}");
}
}
}
6 changes: 6 additions & 0 deletions src/tool_roslyn/RunVbc.cmd
Original file line number Diff line number Diff line change
@@ -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" %*
17 changes: 17 additions & 0 deletions src/tool_roslyn/RunVbc.sh
Original file line number Diff line number Diff line change
@@ -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" "$@"
11 changes: 9 additions & 2 deletions src/tool_roslyn/tool_roslyn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<Content Include="RunCsc.sh;RunCsc.cmd">
<Content Include="RunCsc.sh;RunCsc.cmd;RunVbc.sh;RunVbc.cmd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
Expand All @@ -33,7 +33,7 @@
DestinationFiles="@(HackFilesToCopy->'$(PublishDir)/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>

<Target Name="MakeCscRunnableAndMoveToPublishDir"
<Target Name="MakeCscAndVbcRunnableAndMoveToPublishDir"
AfterTargets="Publish"
BeforeTargets="RemoveFilesAfterPublish">
<ItemGroup>
Expand All @@ -55,6 +55,13 @@
DestinationFiles="$(PublishDir)/csc.exe;
$(PublishDir)/csc.runtimeconfig.json;
$(PublishDir)/csc.deps.json;" />

<Copy SourceFiles="$(PublishDir)/runtimes/any/native/vbc.dll;
$(PublishDir)/$(TargetName).runtimeconfig.json;
$(PublishDir)/$(TargetName).deps.json;"
DestinationFiles="$(PublishDir)/vbc.exe;
$(PublishDir)/vbc.runtimeconfig.json;
$(PublishDir)/vbc.deps.json;" />
</Target>

<Target Name="RemoveFilesAfterPublish"
Expand Down