Skip to content

Commit

Permalink
[mono] Add Microsoft.NET.Sdk.Razor missed in the last update (dotnet#77)
Browse files Browse the repository at this point in the history
Missed committing the sdk files in
3f83070 !

cli commit: d36e5ce

Microsoft.NET.Sdk.Razor: 2.1.0

Version from:
    https://github.com/dotnet/cli/blob/d36e5ce1619640f4516c1e89ef20cf52f1a32878/build/DependencyVersions.props

(A future fix should guard against this kinda mistake)

Fixes mono/mono#11214 .
  • Loading branch information
radical authored Oct 29, 2018
1 parent 105cb8a commit c258604
Show file tree
Hide file tree
Showing 13 changed files with 1,305 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sdks/Microsoft.NET.Sdk.Razor/Sdk/Sdk.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
***********************************************************************************************
Sdk.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0">
<PropertyGroup>
<!-- Determines if the Razor Sdk is responsible for importing Microsoft.NET.Sdk. Microsoft.NET.Sdk.Web may have previously imported this. -->
<_RazorSdkImportsMicrosoftNetSdk Condition="'$(UsingMicrosoftNETSdk)' != 'true'">true</_RazorSdkImportsMicrosoftNetSdk>
</PropertyGroup>

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" Condition="'$(_RazorSdkImportsMicrosoftNetSdk)' == 'true'" />

<PropertyGroup>
<RazorSdkCurrentVersionProps Condition="'$(RazorSdkCurrentVersionProps)' == ''">$(MSBuildThisFileDirectory)..\build\netstandard2.0\Sdk.Razor.CurrentVersion.props</RazorSdkCurrentVersionProps>
</PropertyGroup>

<Import Project="$(RazorSdkCurrentVersionProps)" />
</Project>
23 changes: 23 additions & 0 deletions sdks/Microsoft.NET.Sdk.Razor/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!--
***********************************************************************************************
Sdk.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->
<Project ToolsVersion="14.0">

<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" Condition="'$(_RazorSdkImportsMicrosoftNetSdk)' == 'true'" />

<PropertyGroup Condition="'$(RazorSdkCurrentVersionTargets)' == ''">
<RazorSdkCurrentVersionTargets Condition="'$(IsCrossTargetingBuild)' == 'true'">$(MSBuildThisFileDirectory)..\buildMultiTargeting\Sdk.Razor.CurrentVersion.MultiTargeting.targets</RazorSdkCurrentVersionTargets>
<RazorSdkCurrentVersionTargets Condition="'$(IsCrossTargetingBuild)' != 'true'">$(MSBuildThisFileDirectory)..\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets</RazorSdkCurrentVersionTargets>
</PropertyGroup>

<Import Project="$(RazorSdkCurrentVersionTargets)" />

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<!--
***********************************************************************************************
Microsoft.NET.Sdk.Razor.Compilation.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->

<Project ToolsVersion="14.0">
<!--
What follows in this file is based on:
https://github.com/dotnet/roslyn/blob/4d92b18aee99ba8b1b4770ce65133e9ca65a94fe/src/Compilers/Core/MSBuildTask/Microsoft.CSharp.Core.targets
We need to keep this basically up to date, as well as track the set of modifications we've made. Try to keep the formatting
similar to the original to reduce noise. In general try to only deviate from the CoreCompile target when we need to for
correctness.
We also want to avoid doubling up on things that don't make a ton of sense in the Razor views assembly, like
embedded files and resources, these are already present in the application's assembly.
Changes:
Name="RazorCoreCompile"
Replace @(Compile) with @(RazorCompile)
Replace @(_DebugSymbolsIntermediatePath) with @(_RazorDebugSymbolsIntermediatePath)
Replace @(IntermediateAssembly) with @(RazorIntermediateAssembly)
Replace @(ReferencePathWithRefAssemblies) with @(RazorReferencePath)
Remove @(_CoreCompileResourceInputs) with @(_RazorCoreCompileResourceInputs)
Set TargetType="$(OutputType)" to TargetType="Library" - Razor is always a .dll
Remove Returns="@(CscCommandLineArgs)"
Remove @(EmbeddedFiles)
Remove $(ApplicationIcon) $(Win32Resource) $(Win32Manifest)
Remove @(EmbeddedDocumentation) and @(EmbeddedFiles)
Remove @(CustomAdditionalCompileInputs) and @(CustomAdditionalCompileOutputs)
Remove @(DocFileItem)
Remove PdbFile="$(PdbFile)"
Remove OutputRefAssembly="@(IntermediateRefAssembly)"
Remove EmbedAllSources="$(EmbedAllSources)" - not supported by our supported version of MSBuild
Remove additional steps after calling CSC
Add our FileWrites after the call to CSC
-->
<Target Name="RazorCoreCompile"
Inputs="$(MSBuildAllProjects);
@(RazorCompile);
$(AssemblyOriginatorKeyFile);
@(RazorReferencePath);
@(CompiledLicenseFile);
@(LinkResource);
$(ResolvedCodeAnalysisRuleSet);
@(AdditionalFiles);
@(_RazorCoreCompileResourceInputs)"
Outputs="@(RazorIntermediateAssembly);
@(_RazorDebugSymbolsIntermediatePath);
$(NonExistentFile)"
Condition="'@(RazorCompile)'!=''">
<!-- These two compiler warnings are raised when a reference is bound to a different version
than specified in the assembly reference version number. MSBuild raises the same warning in this case,
so the compiler warning would be redundant. -->
<PropertyGroup Condition="('$(TargetFrameworkVersion)' != 'v1.0') and ('$(TargetFrameworkVersion)' != 'v1.1')">
<NoWarn>$(NoWarn);1701;1702</NoWarn>
</PropertyGroup>

<PropertyGroup>
<!-- To match historical behavior, when inside VS11+ disable the warning from csc.exe indicating that no sources were passed in-->
<NoWarn Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(VisualStudioVersion)' != '' AND '$(VisualStudioVersion)' &gt; '10.0'">$(NoWarn);2008</NoWarn>
</PropertyGroup>

<ItemGroup Condition="'$(TargetingClr2Framework)' == 'true'">
<ReferencePathWithRefAssemblies>
<EmbedInteropTypes />
</ReferencePathWithRefAssemblies>
</ItemGroup>

<PropertyGroup>
<!-- If the user has specified AppConfigForCompiler, we'll use it. If they have not, but they set UseAppConfigForCompiler,
then we'll use AppConfig -->
<AppConfigForCompiler Condition="'$(AppConfigForCompiler)' == '' AND '$(UseAppConfigForCompiler)' == 'true'">$(AppConfig)</AppConfigForCompiler>
</PropertyGroup>

<!-- Prefer32Bit was introduced in .NET 4.5. Set it to false if we are targeting 4.0 -->
<PropertyGroup Condition="('$(TargetFrameworkVersion)' == 'v4.0')">
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>

<!-- TODO: Remove this ItemGroup once it has been moved to "_GenerateCompileInputs" target in Microsoft.Common.CurrentVersion.targets.
https://github.com/dotnet/roslyn/issues/12223 -->
<ItemGroup Condition="('$(AdditionalFileItemNames)' != '')">
<AdditionalFileItems Include="$(AdditionalFileItemNames)" />
<AdditionalFiles Include="@(%(AdditionalFileItems.Identity))" />
</ItemGroup>

<PropertyGroup Condition="'$(UseSharedCompilation)' == ''">
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>

<Csc
AdditionalLibPaths="$(AdditionalLibPaths)"
AddModules="@(AddModules)"
AdditionalFiles="@(AdditionalFiles)"
AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
Analyzers="@(Analyzer)"
ApplicationConfiguration="$(AppConfigForCompiler)"
BaseAddress="$(BaseAddress)"
CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
ChecksumAlgorithm="$(ChecksumAlgorithm)"
CodeAnalysisRuleSet="$(ResolvedCodeAnalysisRuleSet)"
CodePage="$(CodePage)"
DebugType="$(DebugType)"
DefineConstants="$(DefineConstants)"
DelaySign="$(DelaySign)"
DisabledWarnings="$(NoWarn)"
EmitDebugInformation="$(DebugSymbols)"
EnvironmentVariables="$(CscEnvironment)"
ErrorEndLocation="$(ErrorEndLocation)"
ErrorLog="$(ErrorLog)"
ErrorReport="$(ErrorReport)"
Features="$(Features)"
FileAlignment="$(FileAlignment)"
GenerateFullPaths="$(GenerateFullPaths)"
HighEntropyVA="$(HighEntropyVA)"
Instrument="$(Instrument)"
KeyContainer="$(KeyContainerName)"
KeyFile="$(KeyOriginatorFile)"
LangVersion="$(LangVersion)"
LinkResources="@(LinkResource)"
MainEntryPoint="$(StartupObject)"
ModuleAssemblyName="$(ModuleAssemblyName)"
NoConfig="true"
NoLogo="$(NoLogo)"
NoStandardLib="$(NoCompilerStandardLib)"
NoWin32Manifest="$(NoWin32Manifest)"
Optimize="$(Optimize)"
Deterministic="$(Deterministic)"
PublicSign="$(PublicSign)"
OutputAssembly="@(RazorIntermediateAssembly)"
Platform="$(PlatformTarget)"
Prefer32Bit="$(Prefer32Bit)"
PreferredUILang="$(PreferredUILang)"
ProvideCommandLineArgs="$(ProvideCommandLineArgs)"
References="@(RazorReferencePath)"
ReportAnalyzer="$(ReportAnalyzer)"
Resources="@(_RazorCoreCompileResourceInputs);@(CompiledLicenseFile)"
ResponseFiles="$(CompilerResponseFile)"
RuntimeMetadataVersion="$(RuntimeMetadataVersion)"
SharedCompilationId="$(SharedCompilationId)"
SkipCompilerExecution="$(SkipCompilerExecution)"
Sources="@(RazorCompile)"
SubsystemVersion="$(SubsystemVersion)"
TargetType="Library"
ToolExe="$(CscToolExe)"
ToolPath="$(CscToolPath)"
TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
UseSharedCompilation="$(UseSharedCompilation)"
Utf8Output="$(Utf8Output)"
VsSessionGuid="$(VsSessionGuid)"
WarningLevel="$(WarningLevel)"
WarningsAsErrors="$(WarningsAsErrors)"
WarningsNotAsErrors="$(WarningsNotAsErrors)"
PathMap="$(PathMap)"
SourceLink="$(SourceLink)">
<Output TaskParameter="CommandLineArgs" ItemName="CscCommandLineArgs" />
</Csc>

<ItemGroup>
<FileWrites Include="@(_RazorIntermediateAssembly)" Condition="Exists('@(_RazorIntermediateAssembly)')" />
<FileWrites Include="@(_RazorDebugSymbolsIntermediatePath)" Condition="Exists('@(_RazorDebugSymbolsIntermediatePath)')" />
</ItemGroup>
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
***********************************************************************************************
Microsoft.NET.Sdk.Razor.DesignTime.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->

<Project ToolsVersion="14.0">

<ItemGroup>
<!--
Defines the generic .NET Core 'Razor' capability.
Note that we don't define any capabilities here that depend on the version of the runtime/toolset
in use by the project. Those capabilities are defined by the relevant runtime packages so that
we use the lack of the capability to detect downlevel scenarios.
-->
<ProjectCapability Include="DotNetCoreRazor"/>
</ItemGroup>

<!--
WebSdk imports these capabilities for nesting in DotNetCoreWeb projects.
Conditinally import these capabilities if the project isn't targeting the WebSdk.
-->
<ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)'==''">
<ProjectCapability Include="SupportHierarchyContextSvc" />
<ProjectCapability Include="DynamicDependentFile" />
<ProjectCapability Include="DynamicFileNesting" />
</ItemGroup>

<ItemGroup>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorConfiguration.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorExtension.xaml">
<Context>File</Context>
</PropertyPageSchema>
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)Rules\RazorGeneral.xaml">
<Context>Project</Context>
</PropertyPageSchema>
</ItemGroup>

</Project>
Loading

0 comments on commit c258604

Please sign in to comment.