未验证 提交 9b3223e1 编写于 作者: A Andy Gocke 提交者: GitHub

Remove CrossPlatform.sln (#22895)

The core work here is that we were pulling reference assemblies out of a folder with the name RoslynTools.ReferenceAssemblies. A while ago NuGet switched to unpacking all folders with lowercase paths. On Windows this continues to work fine as the filesystem APIs are case-insensitive, but this fails on Linux. By matching casing we can build both net461 and netcoreapp targets on any operating system. The inability to do this was the primary reason for CrossPlatform.sln, so there's now no reason for the solution and we can switch to using Compilers.sln, which is a more reasonable superset of everything in CrossPlatform.sln.

Fixes #20932
上级 3dcdf6d2
此差异已折叠。
......@@ -118,12 +118,6 @@
</When>
</Choose>
<!-- Settings for strong name signing -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<!-- Strong name signing is not supported on non-Windows platforms -->
<PublicSign>true</PublicSign>
</PropertyGroup>
<Choose>
<When Condition="'$(SignAssembly)' == 'true'">
<Choose>
......@@ -146,6 +140,10 @@
<PublicKey>$(RoslynInternalKey)</PublicKey>
<PublicKeyToken>fc793a00266884fb</PublicKeyToken>
</PropertyGroup>
<!-- Real-signing is not currently supported cross-platform -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<PublicSign>true</PublicSign>
</PropertyGroup>
</Otherwise>
</Choose>
</When>
......
......@@ -61,7 +61,7 @@
<ToolsetCompilerPackageVersion Condition="'$(OS)' == 'Windows_NT'">$(MicrosoftNetCompilersVersion)</ToolsetCompilerPackageVersion>
<ToolsetCompilerPackageVersion Condition="'$(OS)' != 'Windows_NT'">$(MicrosoftNETCoreCompilersVersion)</ToolsetCompilerPackageVersion>
<ToolsetCompilerPropsFilePath>$(NuGetPackageRoot)/$(ToolsetCompilerPackageName.ToLower())/$(ToolsetCompilerPackageVersion)/build/$(ToolsetCompilerPackageName).props</ToolsetCompilerPropsFilePath>
<TargetFrameworkRootPath>$(NuGetPackageRoot)\RoslynTools.ReferenceAssemblies\$(RoslynToolsReferenceAssembliesVersion)\tools\Framework</TargetFrameworkRootPath>
<TargetFrameworkRootPath>$(NuGetPackageRoot)\roslyntools.referenceassemblies\$(RoslynToolsReferenceAssembliesVersion)\tools\framework</TargetFrameworkRootPath>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VisualStudioReferenceMajorVersion Condition="'$(VisualStudioReferenceMajorVersion)' == ''">$(VisualStudioVersion.Substring($([System.Convert]::ToInt32(0)), $(VisualStudioVersion.IndexOf('.'))))</VisualStudioReferenceMajorVersion>
......@@ -156,12 +156,7 @@
<!-- Unix specific settings -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<!-- Presently can't build anything with a net46 TargetFramework on non-Windows. Disabling
for now.
https://github.com/dotnet/roslyn/issues/20932 -->
<RoslynPortableTargetFrameworks>netcoreapp2.0</RoslynPortableTargetFrameworks>
<RoslynPortableTargetFrameworks46>netcoreapp2.0</RoslynPortableTargetFrameworks46>
<RoslynDebugType>portable</RoslynDebugType>
<RoslynPortableRuntimeIdentifiers>ubuntu.14.04-x64;ubuntu.16.04-x64;osx.10.12-x64</RoslynPortableRuntimeIdentifiers>
</PropertyGroup>
......
#!/usr/bin/env bash
THIS_DIR=$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Workaround, see https://github.com/dotnet/roslyn/issues/10210
export HOME="$(cd ~ && pwd)"
# $HOME is unset when running the mac unit tests.
if [[ -z ${HOME+x} ]]
then
# Note that while ~ usually refers to $HOME, in the case where $HOME is unset,
# it looks up the current user's home dir, which is what we want.
# https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html
export HOME=$(cd ~ && pwd)
fi
echo "Restoring toolset packages"
dotnet restore -v Minimal --disable-parallel "$(pwd)"/build/ToolsetPackages/BaseToolset.csproj
echo "Restore CrossPlatform.sln"
dotnet restore "$(pwd)"/CrossPlatform.sln
RESTORE_ARGS="-v Minimal --disable-parallel"
echo "Restoring BaseToolset.csproj"
dotnet restore ${RESTORE_ARGS} ${THIS_DIR}/../ToolsetPackages/BaseToolset.csproj
echo "Restoring CoreToolset.csproj"
dotnet restore ${RESTORE_ARGS} ${THIS_DIR}/../ToolsetPackages/CoreToolset.csproj
echo "Restoring Compilers.sln"
dotnet restore ${RESTORE_ARGS} ${THIS_DIR}/../../Compilers.sln
......@@ -39,7 +39,7 @@ try {
# Verify the state of our various build artifacts
Write-Host "Running BuildBoss"
$buildBossPath = Join-Path $configDir "Exes\BuildBoss\BuildBoss.exe"
Exec-Console $buildBossPath "Roslyn.sln Compilers.sln src\Samples\Samples.sln CrossPlatform.sln build\Targets $logPath"
Exec-Console $buildBossPath "Roslyn.sln Compilers.sln src\Samples\Samples.sln build\Targets $logPath"
Write-Host ""
# Verify the state of our generated syntax files
......
......@@ -102,13 +102,7 @@ source "${ROOT_PATH}"/build/scripts/obtain_dotnet.sh
RUNTIME_ID="$(dotnet --info | awk '/RID:/{print $2;}')"
echo "Using Runtime Identifier: ${RUNTIME_ID}"
RESTORE_ARGS="-r ${RUNTIME_ID} -v Minimal --disable-parallel"
echo "Restoring BaseToolset.csproj"
dotnet restore ${RESTORE_ARGS} "${ROOT_PATH}"/build/ToolsetPackages/BaseToolset.csproj
echo "Restoring CoreToolset.csproj"
dotnet restore ${RESTORE_ARGS} "${ROOT_PATH}"/build/ToolsetPackages/CoreToolset.csproj
echo "Restoring CrossPlatform.sln"
dotnet restore ${RESTORE_ARGS} "${ROOT_PATH}"/CrossPlatform.sln
"${ROOT_PATH}"/build/scripts/restore.sh
BUILD_ARGS="--no-restore -c ${BUILD_CONFIGURATION} /nologo /consoleloggerparameters:Verbosity=minimal;summary /bl:${BUILD_LOG_PATH} /maxcpucount:1"
PUBLISH_ARGS="-f ${TARGET_FRAMEWORK} -r ${RUNTIME_ID} ${BUILD_ARGS}"
......@@ -120,8 +114,8 @@ dotnet publish "${SRC_PATH}"/Compilers/VisualBasic/vbc -o "${BOOTSTRAP_PATH}"/vb
rm -rf "${BINARIES_PATH:?}"/"${BUILD_CONFIGURATION}"
BUILD_ARGS+=" /p:CscToolPath=${BOOTSTRAP_PATH}/csc /p:CscToolExe=csc /p:VbcToolPath=${BOOTSTRAP_PATH}/vbc /p:VbcToolExe=vbc"
echo "Building CrossPlatform.sln"
dotnet build "${ROOT_PATH}"/CrossPlatform.sln ${BUILD_ARGS}
echo "Building Compilers.sln"
dotnet build "${ROOT_PATH}"/Compilers.sln ${BUILD_ARGS}
if [[ "${SKIP_TESTS}" == false ]]
then
......
......@@ -6,9 +6,15 @@ Linux and Mac support for developing Roslyn is very much a work in progress. No
## Building
Build all cross-platform projects with: `dotnet build CrossPlatform.sln`.
Build all cross-platform projects with:
If you do not have a system-wide `dotnet` install, you can obtain one with `./build/scripts/obtain_dotnet.sh`. This will install a compatible version of the CLI to `./Binaries/dotnet-cli` - add this to your PATH before trying to build `CrossPlatform.sln`. Alternatively, sourcing the script with `source ./build/scripts/obtain_dotnet.sh` will add it to your PATH for you.
```
cd <roslyn-git-directory>
./build/scripts/restore.sh
dotnet build Compilers.sln
```
If you do not have a system-wide `dotnet` install, you can obtain one with `./build/scripts/obtain_dotnet.sh`. This will install a compatible version of the CLI to `./Binaries/dotnet-cli` - add this to your PATH before trying to build `Compilers.sln`. Alternatively, sourcing the script with `source ./build/scripts/obtain_dotnet.sh` will add it to your PATH for you.
## Using the compiler
......
......@@ -198,7 +198,7 @@ private static (T Result, string Output) UseTextWriter<T>(Encoding encoding, Fun
var client = ServerUtil.CreateBuildClient(language);
client.TimeoutOverride = Timeout.Infinite;
#if NET46
#if NET461
var sdkDir = RuntimeEnvironment.GetRuntimeDirectory();
#else
string sdkDir = null;
......@@ -222,7 +222,7 @@ private static DisposableFile GetResultFile(TempDirectory directory, string resu
private static void RunCompilerOutput(TempFile file, string expectedOutput)
{
#if NET46
#if NET461
var result = ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path));
Assert.Equal(expectedOutput, result.Output);
#endif
......
......@@ -69,7 +69,7 @@ public void Dispose()
internal static class ServerUtil
{
internal static string DefaultClientDirectory { get; } = Path.GetDirectoryName(typeof(DesktopBuildClientTests).Assembly.Location);
#if NET46
#if NET461
internal static string DefaultSdkDirectory { get; } = RuntimeEnvironment.GetRuntimeDirectory();
#else
internal static string DefaultSdkDirectory { get; } = null;
......
......@@ -10,7 +10,7 @@
<RootNamespace>Microsoft.CodeAnalysis.CompilerServer.UnitTests</RootNamespace>
<AssemblyName>Roslyn.Compilers.CompilerServer.UnitTests</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(RoslynPortableTargetFrameworks46)</TargetFrameworks>
<TargetFrameworks>$(RoslynPortableTargetFrameworks)</TargetFrameworks>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
<RoslynProjectType>UnitTestPortable</RoslynProjectType>
</PropertyGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册