Move binaries in to the build folder

This commit is contained in:
Pranav K 2017-06-15 15:32:23 -07:00
Родитель 900f38b0c2
Коммит 942c677563
5 изменённых файлов: 90 добавлений и 118 удалений

Просмотреть файл

@ -4,11 +4,8 @@
<TestIncludeViewCompilationTargets Condition="'$(TestIncludeViewCompilationTargets)'==''">$(MvcRazorCompileOnPublish)</TestIncludeViewCompilationTargets>
</PropertyGroup>
<Import Project="..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\build\netcoreapp2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets"
Condition="'$(TestIncludeViewCompilationTargets)'=='true' AND '$(TargetFramework)'=='netcoreapp2.0'"/>
<Import Project="..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\build\net461\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets"
Condition="'$(TestIncludeViewCompilationTargets)'=='true' AND '$(TargetFramework)'=='net461'"/>
<Import Project="..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets"
Condition="'$(TestIncludeViewCompilationTargets)'=='true'"/>
<ItemGroup Condition="'$(TestIncludeViewCompilationTargets)'=='true'">
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj" />

Просмотреть файл

@ -11,31 +11,14 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<OutputType>exe</OutputType>
<X86ProjectDirectory>..\..\tools\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86\</X86ProjectDirectory>
<!--
This prevents dotnet from automatically generating a lib/tfm/*.dll; in turn we're then able
to exclude the lib/net461 and manually construct only the necessary folders:
- lib/netcoreapp2.0/...
- runtimes/win7-x64/lib/...
- runtimes/win7-x86/lib/...
-->
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>
<ItemGroup>
<None Include="build\common.targets" Pack="true" PackagePath="%(Identity)" />
<None Include="lib\net461\_._" Pack="true" PackagePath="%(Identity)" />
<None Include="lib\netcoreapp2.0\_._" Pack="true" PackagePath="runtimes\win7-x64\lib\netcoreapp2.0\_._" />
<None Include="lib\netcoreapp2.0\_._" Pack="true" PackagePath="runtimes\win7-x86\lib\netcoreapp2.0\_._" />
<None Include="build\netcoreapp2.0\*" Pack="true" PackagePath="%(Identity)" />
<None Include="bin\$(Configuration)\netcoreapp2.0\$(AssemblyName).dll" Pack="true" PackagePath="lib\netcoreapp2.0\$(AssemblyName).dll" />
<None Include="bin\$(Configuration)\netcoreapp2.0\$(AssemblyName).runtimeconfig.json" Pack="true" PackagePath="lib\netcoreapp2.0\$(AssemblyName).runtimeconfig.json" />
</ItemGroup>
<ItemGroup Condition=" '$(OS)' == 'Windows_NT' ">
<None Include="build\net461\*" Pack="true" PackagePath="%(Identity)" />
<None Include="bin\$(Configuration)\net461\win7-x64\$(AssemblyName).exe" Pack="true" PackagePath="runtimes\win7-x64\lib\net461\$(AssemblyName).exe" />
<None Include="$(X86ProjectDirectory)\bin\$(Configuration)\net461\win7-x86\$(AssemblyName)-x86.exe" Pack="true" PackagePath="runtimes\win7-x86\lib\net461\$(AssemblyName)-x86.exe" />
<None Include="build\**\*.*" Pack="true" PackagePath="%(Identity)" />
<None Include="$(OutputPath)netcoreapp2.0\$(AssemblyName).dll" Pack="true" PackagePath="build\netstandard2.0\$(AssemblyName).dll" />
<None Include="$(OutputPath)net461\win7-x64\$(AssemblyName).exe" Pack="true" PackagePath="build\netstandard2.0\$(AssemblyName)-x64.exe" />
<None Include="$(X86ProjectDirectory)\bin\$(Configuration)\net461\win7-x86\$(AssemblyName)-x86.exe" Pack="true" PackagePath="build\netstandard2.0\$(AssemblyName)-x86.exe" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,50 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)..\common.targets" />
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<Target
Name="MvcRazorPrecompile"
DependsOnTargets="_ResolveInputArguments"
Inputs="@(MvcRazorFilesToCompile);@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePath);$(MSBuildAllProjects);"
Outputs="$(_MvcRazorOutputFullPath)">
<PropertyGroup Condition="'$(MvcRazorRunCommand)'==''">
<MvcRazorRunCommand>$(OutputPath)$(MSBuildThisFileName).exe</MvcRazorRunCommand>
<MvcRazorRunCommand Condition="'$(PlatformTarget)'=='x86'">$(OutputPath)$(MSBuildThisFileName)-x86.exe</MvcRazorRunCommand>
</PropertyGroup>
<CallTarget Targets="_CreateResponseFileForMvcRazorPrecompile" />
<ItemGroup Condition="'$(PlatformTarget)'=='x86'">
<_PreCompilationFilesToCopy Include="$(OutputPath)$(AssemblyName).exe.config">
<Destination>$(OutputPath)$(MSBuildThisFileName)-x86.exe.config</Destination>
</_PreCompilationFilesToCopy>
</ItemGroup>
<ItemGroup Condition="'$(PlatformTarget)'!='x86'">
<_PreCompilationFilesToCopy Include="$(OutputPath)$(AssemblyName).exe.config" Condition="">
<Destination>$(OutputPath)$(MSBuildThisFileName).exe.config</Destination>
</_PreCompilationFilesToCopy>
</ItemGroup>
<Copy
SourceFiles="@(_PreCompilationFilesToCopy)"
DestinationFiles="%(Destination)" />
<Message
Text="Executing Razor view precompilation."
Importance="Low" />
<Exec
Command="$(MvcRazorRunCommand) @&quot;$(_MvcRazorResponseFilePath)&quot;"
WorkingDirectory="$(MSBuildProjectDirectory)"/>
<Message
Text="Razor view compilation for $(MSBuildProjectName) -> $(_MvcRazorOutputFullPath)"
Importance="High" />
<Delete Files="%(_PreCompilationFilesToCopy.Destination)" />
</Target>
</Project>

Просмотреть файл

@ -1,35 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)..\common.targets" />
<PropertyGroup>
<MvcRazorRunCommand>dotnet</MvcRazorRunCommand>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<_MvcViewCompilationBinaryPath Condition="'$(_MvcViewCompilationBinaryPath)'==''">$(MSBuildThisFileDirectory)../../lib/netcoreapp2.0/$(MSBuildThisFileName).dll</_MvcViewCompilationBinaryPath>
</PropertyGroup>
<Target
Name="MvcRazorPrecompile"
DependsOnTargets="_ResolveInputArguments"
Inputs="@(MvcRazorFilesToCompile);@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePath);$(MSBuildAllProjects)"
Outputs="$(_MvcRazorOutputFullPath)">
<CallTarget Targets="_CreateResponseFileForMvcRazorPrecompile" />
<PropertyGroup>
<ExecArgs>--runtimeconfig &quot;$(ProjectRuntimeConfigFilePath)&quot;</ExecArgs>
<ExecArgs>$(ExecArgs) --depsfile &quot;$(ProjectDepsFilePath)&quot;</ExecArgs>
<ExecArgs>$(ExecArgs) &quot;$(_MvcViewCompilationBinaryPath)&quot;</ExecArgs>
<ExecArgs>$(ExecArgs) @&quot;$(_MvcRazorResponseFilePath)&quot;</ExecArgs>
</PropertyGroup>
<Message
Text="Executing Razor view precompilation."
Importance="Low" />
<Exec
Command="$(MvcRazorRunCommand) exec $(ExecArgs)"
WorkingDirectory="$(MSBuildProjectDirectory)" />
<Message
Text="Razor view compilation for $(MSBuildProjectName) -> $(_MvcRazorOutputFullPath)"
Importance="High" />
</Target>
</Project>

Просмотреть файл

@ -16,34 +16,111 @@
</ItemGroup>
</Target>
<Target
Name="MvcRazorPrecompile"
DependsOnTargets="_ResolveInputArguments"
Inputs="@(MvcRazorFilesToCompile);@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePath);$(MSBuildAllProjects)"
Outputs="$(_MvcRazorOutputFullPath)">
<CallTarget Targets="_MvcRazorPrecompile" />
</Target>
<Target
Name="_MvcRazorPrecompile"
DependsOnTargets="_RunForCore;_RunForDesktop">
</Target>
<Target
Name="_RunForCore"
DependsOnTargets="_CreateResponseFileForMvcRazorPrecompile"
Condition="'$(TargetFrameworkIdentifier)'=='.NETCoreApp'">
<PropertyGroup>
<_MvcViewCompilationBinaryPath Condition="'$(_MvcViewCompilationBinaryPath)'==''">$(MSBuildThisFileDirectory)$(MSBuildThisFileName).dll</_MvcViewCompilationBinaryPath>
<ExecArgs>dotnet exec --runtimeconfig &quot;$(ProjectRuntimeConfigFilePath)&quot;</ExecArgs>
<ExecArgs>$(ExecArgs) --depsfile &quot;$(ProjectDepsFilePath)&quot;</ExecArgs>
<ExecArgs>$(ExecArgs) &quot;$(_MvcViewCompilationBinaryPath)&quot;</ExecArgs>
<ExecArgs>$(ExecArgs) @&quot;$(_MvcRazorResponseFilePath)&quot;</ExecArgs>
</PropertyGroup>
<Exec Command="$(ExecArgs)" WorkingDirectory="$(MSBuildProjectDirectory)" />
</Target>
<Target
Name="_AddDesktopReferences"
AfterTargets="ResolveLockFileReferences"
Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'">
<PropertyGroup Condition="'$(_MvcViewCompilationBinaryPath)'==''">
<_MvcViewCompilationBinaryPath Condition="'$(PlatformTarget)'=='x64'">$(MSBuildThisFileDirectory)$(MSBuildThisFileName)-x64.exe</_MvcViewCompilationBinaryPath>
<_MvcViewCompilationBinaryPath Condition="'$(PlatformTarget)'=='x86'">$(MSBuildThisFileDirectory)$(MSBuildThisFileName)-x86.exe</_MvcViewCompilationBinaryPath>
</PropertyGroup>
<ItemGroup Condition="'$(_DesktopViewCompilationBinary)'!=''">
<Reference Include="$(_DesktopViewCompilationBinary)" Private="true" />
</ItemGroup>
</Target>
<Target
Name="_RunForDesktop"
DependsOnTargets="_AddDesktopReferences;_CreateResponseFileForMvcRazorPrecompile"
Condition="'$(TargetFrameworkIdentifier)'=='.NETFramework'">
<ItemGroup>
<_PreCompilationFilesToCopy
Include="$(OutputPath)$(AssemblyName).exe.config"
Destination="$(OutputPath)$(MSBuildThisFileName)-$(PlatformTarget).exe.config" />
<_PreCompilationFilesToCopy
Include="$(_MvcViewCompilationBinaryPath)"
Destination="$(OutputPath)$(MSBuildThisFileName)-$(PlatformTarget).exe" />
</ItemGroup>
<PropertyGroup Condition="'$(MvcRazorRunCommand)'==''">
<MvcRazorRunCommand>$(_MvcViewCompilationBinaryPath)</MvcRazorRunCommand>
</PropertyGroup>
<Copy
SourceFiles="@(_PreCompilationFilesToCopy)"
DestinationFiles="%(Destination)" />
<Exec
Command="$(MvcRazorRunCommand) @&quot;$(_MvcRazorResponseFilePath)&quot;"
WorkingDirectory="$(MSBuildProjectDirectory)"/>
<Delete Files="%(_PreCompilationFilesToCopy.Destination)" />
</Target>
<Target Name="_CreateResponseFileForMvcRazorPrecompile">
<ItemGroup>
<ExecArgs Include="
<_ResponseFileLines Include="
$(MSBuildProjectDirectory);
--output-path=$(_MvcRazorOutputPath);
--application-name=$(AssemblyName);
--content-root=$(MvcRazorContentRoot);" />
<ExecArgs
<_ResponseFileLines
Condition="'$(MvcRazorEmbedViewSources)'=='true'"
Include="--embed-view-sources" />
<ExecArgs Include="--file=%(MvcRazorFilesToCompile.FullPath)" />
<_ResponseFileLines Include="--file=%(MvcRazorFilesToCompile.FullPath)" />
</ItemGroup>
<ItemGroup Condition="'$(SignAssembly)'=='true'">
<ExecArgs
<_ResponseFileLines
Condition="'$(DelaySign)'=='true'"
Include="--delay-sign" />
<ExecArgs
<_ResponseFileLines
Condition="'$(PublicSign)'=='true'"
Include="--public-sign" />
<ExecArgs Include="--key-file=$(AssemblyOriginatorKeyFile)" />
<_ResponseFileLines Include="--key-file=$(AssemblyOriginatorKeyFile)" />
</ItemGroup>
<WriteLinesToFile
File="$(_MvcRazorResponseFilePath)"
Lines="@(ExecArgs)"
Lines="@(_ResponseFileLines)"
Overwrite="true" />
</Target>