Skip to content
Closed
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
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<NoWarn>$(NoWarn);NU1507</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Basic.CompilerLog.Util" Version="0.9.9" />
<PackageVersion Include="Basic.CompilerLog.Util" Version="0.9.18" />
<PackageVersion Include="AwesomeAssertions" Version="$(AwesomeAssertionsVersion)" />
<PackageVersion Include="BenchmarkDotNet" Version="$(BenchmarkDotNetPackageVersion)" />
<PackageVersion Include="AwesomeAssertions.Json" Version="$(AwesomeAssertionsJsonVersion)" />
Expand Down Expand Up @@ -93,7 +93,7 @@
<PackageVersion Include="Microsoft.WixToolset.Heat" Version="$(MicrosoftWixToolsetSdkVersion)" />
<PackageVersion Include="Microsoft.WixToolset.Util.wixext" Version="$(MicrosoftWixToolsetSdkVersion)" />
<PackageVersion Include="Microsoft.WixToolset.UI.wixext" Version="$(MicrosoftWixToolsetSdkVersion)" />
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.2.386" />
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.3.45" />
<PackageVersion Include="Moq" Version="$(MoqPackageVersion)" />
<PackageVersion Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" />
<PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
Expand Down
3 changes: 3 additions & 0 deletions eng/Signing.props
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@

<ItemGroup>
<FileSignInfo Include="StreamJsonRpc.dll" CertificateName="MicrosoftSHA2" />

<!-- Roslyn apphosts -->
<FileSignInfo Condition="'$(TargetOS)' == 'osx'" Include="csc;vbc;VBCSCompiler" CertificateName="MacDeveloperHarden" />
</ItemGroup>

<!-- Filter out any test packages from ItemsToSign -->
Expand Down
22 changes: 11 additions & 11 deletions eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ This file should be imported by eng/Versions.props
<MicrosoftBuildLocalizationPackageVersion>17.15.0-preview-25427-104</MicrosoftBuildLocalizationPackageVersion>
<MicrosoftBuildNuGetSdkResolverPackageVersion>7.0.0-preview.1.42804</MicrosoftBuildNuGetSdkResolverPackageVersion>
<MicrosoftBuildTasksGitPackageVersion>10.0.0-beta.25427.104</MicrosoftBuildTasksGitPackageVersion>
<MicrosoftCodeAnalysisPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisPackageVersion>
<MicrosoftCodeAnalysisBuildClientPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisBuildClientPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>
<MicrosoftCodeAnalysisPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisPackageVersion>
<MicrosoftCodeAnalysisBuildClientPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisBuildClientPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisCSharpCodeStylePackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>
<MicrosoftCodeAnalysisRazorToolingInternalPackageVersion>10.0.0-preview.25427.104</MicrosoftCodeAnalysisRazorToolingInternalPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.0.0-2.25427.104</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.0.0-2.25463.3</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftDeploymentDotNetReleasesPackageVersion>2.0.0-preview.1.25427.104</MicrosoftDeploymentDotNetReleasesPackageVersion>
<MicrosoftDiaSymReaderPackageVersion>2.2.0-beta.25427.104</MicrosoftDiaSymReaderPackageVersion>
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25427.104</MicrosoftDotNetArcadeSdkPackageVersion>
Expand All @@ -68,8 +68,8 @@ This file should be imported by eng/Versions.props
<MicrosoftExtensionsObjectPoolPackageVersion>10.0.0-rc.2.25427.104</MicrosoftExtensionsObjectPoolPackageVersion>
<MicrosoftFSharpCompilerPackageVersion>14.0.100-rc2.25427.104</MicrosoftFSharpCompilerPackageVersion>
<MicrosoftJSInteropPackageVersion>10.0.0-rc.2.25427.104</MicrosoftJSInteropPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>5.0.0-2.25427.104</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftNetCompilersToolsetFrameworkPackageVersion>5.0.0-2.25427.104</MicrosoftNetCompilersToolsetFrameworkPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>5.0.0-2.25463.3</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftNetCompilersToolsetFrameworkPackageVersion>5.0.0-2.25463.3</MicrosoftNetCompilersToolsetFrameworkPackageVersion>
<MicrosoftNETHostModelPackageVersion>10.0.0-rc.2.25427.104</MicrosoftNETHostModelPackageVersion>
<MicrosoftNETILLinkTasksPackageVersion>10.0.0-rc.2.25427.104</MicrosoftNETILLinkTasksPackageVersion>
<MicrosoftNETRuntimeEmscripten3156Cachewinx64PackageVersion>10.0.0-rc.2.25427.104</MicrosoftNETRuntimeEmscripten3156Cachewinx64PackageVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ private IEnumerable<string> GetCscArguments(
"/deterministic+",
"/langversion:14.0",
"/features:FileBasedProgram",
$"/analyzerconfig:{SdkPath}/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/config/analysislevelstyle_default.globalconfig",
$"/analyzerconfig:{objDir}/{fileNameWithoutExtension}.GeneratedMSBuildEditorConfig.editorconfig",
$"/analyzerconfig:{SdkPath}/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_10_default.globalconfig",
$"/analyzer:{SdkPath}/Sdks/Microsoft.NET.Sdk/targets/../analyzers/Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll",
Expand Down
6 changes: 6 additions & 0 deletions src/Layout/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,10 @@
<SdkPkgSourcesRootDirectory>$(MSBuildThisFileDirectory)pkg\</SdkPkgSourcesRootDirectory>
</PropertyGroup>

<ItemGroup>
<_RoslynAppHost Include="$(OutputPath)Roslyn\bincore\csc.dll" />
<_RoslynAppHost Include="$(OutputPath)Roslyn\bincore\vbc.dll" />
<_RoslynAppHost Include="$(OutputPath)Roslyn\bincore\VBCSCompiler.dll" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Layout/redist/targets/Crossgen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@

<Exec Command="find $(InstallerOutputDirectory) -type d -exec chmod 755 {} \;" Condition="'$(OSName)' != 'win'" />
<Exec Command="find $(InstallerOutputDirectory) -type f -exec chmod 644 {} \;" Condition="'$(OSName)' != 'win'" />
<Exec Command="chmod 755 $(InstallerOutputDirectory)Roslyn/bincore/%(_RoslynAppHost.Filename)" Condition="'$(OSName)' != 'win'" />
</Target>

</Project>
7 changes: 7 additions & 0 deletions src/Layout/redist/targets/GenerateLayout.targets
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
<Copy SourceFiles="@(RoslynFile)"
DestinationFiles="@(RoslynFile->'$(OutputPath)Roslyn\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true" />

<CreateAppHost AppHostSourcePath="$(NuGetPackageRoot)\microsoft.netcore.app.host.$(SharedFrameworkRid)\$(MicrosoftNETCoreAppHostPackageVersion)\runtimes\$(SharedFrameworkRid)\native\apphost$(ExeExtension)"
AppHostDestinationPath="%(_RoslynAppHost.RootDir)%(_RoslynAppHost.Directory)%(_RoslynAppHost.Filename)$(ExeExtension)"
AppBinaryName="%(_RoslynAppHost.Filename)%(_RoslynAppHost.Extension)"
IntermediateAssembly="%(_RoslynAppHost.FullPath)"
EnableMacOSCodeSign="$(TargetRid.StartsWith('osx'))" />
</Target>

<Target Name="PublishNETAnalyzers">
Expand Down Expand Up @@ -495,6 +501,7 @@

<Exec Command="find $(OutputPath) -type d -exec chmod 755 {} \;" />
<Exec Command="find $(OutputPath) -type f -exec chmod 644 {} \;" />
<Exec Command="chmod 755 %(_RoslynAppHost.RootDir)%(_RoslynAppHost.Directory)%(_RoslynAppHost.Filename)" />
</Target>

<Target Name="DeleteSymbolsFromPublishDir" DependsOnTargets="GenerateCliRuntimeConfigurationFiles">
Expand Down
17 changes: 9 additions & 8 deletions test/Microsoft.NET.Build.Tests/RoslynBuildTaskTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Basic.CompilerLog.Util;
using Microsoft.Build.Logging.StructuredLogger;
using Microsoft.CodeAnalysis;
using Microsoft.DotNet.Cli.Utils;

namespace Microsoft.NET.Build.Tests;

Expand All @@ -18,16 +19,16 @@ public sealed class RoslynBuildTaskTests(ITestOutputHelper log) : SdkTest(log)
_ => throw new ArgumentOutOfRangeException(paramName: nameof(language)),
};

private static string CoreCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + ".dll";
private static string DotNetExecCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + ".dll";

private static string FxCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + ".exe";
private static string AppHostCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + FileNameSuffixes.CurrentPlatform.Exe;

[FullMSBuildOnlyTheory, CombinatorialData]
public void FullMSBuild_SdkStyle(bool useSharedCompilation, Language language)
{
var testAsset = CreateProject(useSharedCompilation, language);
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
VerifyCompiler(buildCommand, CoreCompilerFileName(language), useSharedCompilation);
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
}

[FullMSBuildOnlyTheory, CombinatorialData]
Expand All @@ -38,7 +39,7 @@ public void FullMSBuild_SdkStyle_OptOut(bool useSharedCompilation, Language lang
doc.Root!.Element("PropertyGroup")!.Add(new XElement("RoslynCompilerType", "Framework"));
});
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
VerifyCompiler(buildCommand, FxCompilerFileName(language), useSharedCompilation);
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
}

[FullMSBuildOnlyTheory, CombinatorialData]
Expand All @@ -50,23 +51,23 @@ public void FullMSBuild_NonSdkStyle(bool useSharedCompilation, Language language
project.TargetFrameworkVersion = "v4.7.2";
});
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
VerifyCompiler(buildCommand, FxCompilerFileName(language), useSharedCompilation);
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
}

[FullMSBuildOnlyTheory, CombinatorialData]
public void FullMSBuild_SdkStyle_ToolsetPackage(bool useSharedCompilation, Language language)
{
var testAsset = CreateProject(useSharedCompilation, language, AddCompilersToolsetPackage);
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
VerifyCompiler(buildCommand, FxCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
}

[Theory, CombinatorialData]
public void DotNet(bool useSharedCompilation, Language language)
{
var testAsset = CreateProject(useSharedCompilation, language);
var buildCommand = BuildAndRunUsingDotNet(testAsset);
VerifyCompiler(buildCommand, CoreCompilerFileName(language), useSharedCompilation);
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
}

// https://github.com/dotnet/sdk/issues/49665
Expand All @@ -75,7 +76,7 @@ public void DotNet_ToolsetPackage(bool useSharedCompilation, Language language)
{
var testAsset = CreateProject(useSharedCompilation, language, AddCompilersToolsetPackage);
var buildCommand = BuildAndRunUsingDotNet(testAsset);
VerifyCompiler(buildCommand, CoreCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
VerifyCompiler(buildCommand, DotNetExecCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
}

private TestAsset CreateProject(bool useSharedCompilation, Language language, Action<TestProject>? configure = null, [CallerMemberName] string callingMethod = "")
Expand Down