Orchard.Web: Copying Roslyn files to the output folder using the provided target (CopyRoslynCompilerFilesToOutputDirectory) instead of our custom one

This commit is contained in:
Benedek Farkas
2024-03-25 13:54:10 +01:00
parent bdf19298db
commit 3b833ad7bf
2 changed files with 5 additions and 17 deletions

View File

@@ -142,9 +142,8 @@
<!-- To make sure that Roslyn tools are available, even if the Compile task was not called before this. -->
<MSBuild
Projects="$(OrchardWebFolder)\Orchard.Web.csproj"
Targets="CopyRoslynFilesToOutputFolder"
Properties="Configuration=$(Configuration)" />
<!-- The actual compilation with views also compiled. -->
Targets="CopyRoslynCompilerFilesToOutputDirectory" />
<!-- Compile to "regular" output folder for devs using VS locally -->
<MSBuild
Projects="$(Solution)"
Targets="Build"
@@ -212,7 +211,6 @@
<Stage-Media Include="$(SrcFolder)\Orchard.Web\Media\OrchardLogo.png" />
<Stage-PoFiles Include="$(SrcFolder)\Orchard.Web\**\*.po" />
<Stage-Core Include="$(WebSitesFolder)\Orchard.Core\**\*" Exclude="$(WebSitesFolder)\Orchard.Core\**\bin\**\*" />
<Stage-Roslyn Include="$(SrcFolder)\Orchard.Web\bin\roslyn\*" />
<!-- Get list of module names from the module definition files within ModulesSrcFolder -->
<Stage-Modules-Definitions Include="$(ModulesSrcFolder)\**\Module.txt" />
@@ -254,7 +252,7 @@
<!-- Copying module binaries is somewhat tricky: From a module "bin" directory, we
only want to include the files that are _not_ already present in
the "Orchard.Web\Bin" folder (except for "Orchard.Web\bin\roslyn"). -->
the "Orchard.Web\Bin" folder. -->
<FilterModuleBinaries
ModulesBinaries="@(Stage-Modules-Binaries)"
OrchardWebBinaries="@(Stage-Orchard-Web-Bins)">
@@ -284,7 +282,6 @@
<Copy SourceFiles="@(Stage-Themes-Custom)" DestinationFiles="@(Stage-Themes-Custom->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Themes-Binaries-Unique)" DestinationFiles="@(Stage-Themes-Binaries-Unique->'$(StageFolder)\Themes\%(ThemeName)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(Stage-Themes-Sources)" DestinationFolder="$(StageFolder)\Themes\%(RecursiveDir)"/>
<Copy SourceFiles="@(Stage-Roslyn)" DestinationFolder="$(StageFolder)\bin\roslyn"/>
<MakeDir Directories="$(StageFolder)\App_Data"/>
<WriteLinesToFile File="$(StageFolder)\App_Data\_marker.txt" Lines="some_text" Overwrite="true"/>

View File

@@ -15,7 +15,8 @@
<AssemblyName>Orchard.Web</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<RoslynCopyToOutDir>false</RoslynCopyToOutDir>
<RoslynCopyToOutDir>true</RoslynCopyToOutDir>
<RoslynToolPath>$(MSBuildThisFileDirectory)..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\tools\roslyn-4.1.0</RoslynToolPath>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort>44300</IISExpressSSLPort>
<IISExpressAnonymousAuthentication>enabled</IISExpressAnonymousAuthentication>
@@ -275,16 +276,6 @@
</PropertyGroup>
<CallTarget Targets="ExcludeRootBinariesDeployment" />
</Target>
<Target Name="CopyRoslynFilesToOutputFolder" AfterTargets="AfterBuild">
<!-- Copying Roslyn tools and their dependencies to the "bin" folder for Dynamic Compilation. -->
<PropertyGroup>
<RoslynFilesDestination>$(ProjectDir)bin\roslyn\</RoslynFilesDestination>
</PropertyGroup>
<ItemGroup>
<RoslynFiles Include="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\tools\Roslyn-4.1.0\*" />
</ItemGroup>
<Copy SourceFiles="@(RoslynFiles)" DestinationFolder="$(RoslynFilesDestination)" Condition="!Exists('$(RoslynFilesDestination)csc.exe')" />
</Target>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>