Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Commit

Permalink
Use MuxerPath to determine location to dotnet.exe
Browse files Browse the repository at this point in the history
Fixes $50
  • Loading branch information
pranavkm committed Jun 20, 2017
1 parent e300cf1 commit fe4cc97
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 6 deletions.
17 changes: 16 additions & 1 deletion RazorViewCompilation.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26516.2
VisualStudioVersion = 15.0.26430.6
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation", "src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj", "{4339FC9B-AEC6-442A-B413-A41555ED76C7}"
EndProject
Expand Down Expand Up @@ -58,6 +58,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{75244EBD
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86", "tools\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86.csproj", "{DFB86DBD-17DA-4A97-A4FD-00D6E5160B3D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks", "src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.csproj", "{996D4DEB-1701-435E-8048-1E65790C2050}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -284,6 +286,18 @@ Global
{DFB86DBD-17DA-4A97-A4FD-00D6E5160B3D}.Release|x64.Build.0 = Release|Any CPU
{DFB86DBD-17DA-4A97-A4FD-00D6E5160B3D}.Release|x86.ActiveCfg = Release|Any CPU
{DFB86DBD-17DA-4A97-A4FD-00D6E5160B3D}.Release|x86.Build.0 = Release|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Debug|Any CPU.Build.0 = Debug|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x64.ActiveCfg = Debug|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x64.Build.0 = Debug|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x86.ActiveCfg = Debug|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Debug|x86.Build.0 = Debug|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Release|Any CPU.ActiveCfg = Release|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Release|Any CPU.Build.0 = Release|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Release|x64.ActiveCfg = Release|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Release|x64.Build.0 = Release|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Release|x86.ActiveCfg = Release|Any CPU
{996D4DEB-1701-435E-8048-1E65790C2050}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -307,5 +321,6 @@ Global
{779BACC4-B20E-4F73-A9C7-350443CF1941} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7}
{D838D8E1-997A-4053-BB2A-2CBDE9F09A0B} = {0DC7C88C-E3DB-46DF-B47E-AC5ECB2A16B7}
{DFB86DBD-17DA-4A97-A4FD-00D6E5160B3D} = {75244EBD-DFBD-4C4B-9543-C135AC142C7F}
{996D4DEB-1701-435E-8048-1E65790C2050} = {02F7AA35-91AF-491E-9F0E-03CFAF86C720}
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions build/common-testapps.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<Import Project="dependencies.props" />
<PropertyGroup>
<TestIncludeViewCompilationTargets Condition="'$(TestIncludeViewCompilationTargets)'==''">$(MvcRazorCompileOnPublish)</TestIncludeViewCompilationTargets>
<_MvcViewCompilationTasksPath>$(MSBuildThisFileDirectory)..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\bin\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll</_MvcViewCompilationTasksPath>
</PropertyGroup>

<Import Project="..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\build\netstandard2.0\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.targets"
Expand Down
1 change: 1 addition & 0 deletions build/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<AspNetCoreVersion>2.0.0-*</AspNetCoreVersion>
<AspNetCoreIntegrationTestingVersion>0.4.0-*</AspNetCoreIntegrationTestingVersion>
<InternalAspNetCoreSdkVersion>2.1.0-*</InternalAspNetCoreSdkVersion>
<MsBuildPackageVersions>15.1.1012</MsBuildPackageVersions>
<NETStandardImplicitPackageVersion>2.0.0-*</NETStandardImplicitPackageVersion>
<NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion>
Expand Down
5 changes: 5 additions & 0 deletions build/repo.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<ItemGroup>
<ExcludeFromPack Include="$(RepositoryRoot)src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Microsoft.Extensions.CommandLineUtils;

namespace Microsoft.AspNetCore.BuildTools
{
public class GetDotNetHost : Task
{
[Output]
public string MuxerPath { get; set; }

public override bool Execute()
{
MuxerPath = DotNetMuxer.MuxerPathOrDefault();
return true;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<Import Project="..\..\build\common.props" />

<PropertyGroup>

This comment has been minimized.

Copy link
@natemcmaster

natemcmaster Jun 20, 2017

Contributor

Add <IsPackable>false</IsPackable> since we don't really want to produce a nupkg with this assembly.

<Description>Microsoft Build Tasks supporting Razor view compilation.</Description>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MsBuildPackageVersions)" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
<PreserveCompilationContext>true</PreserveCompilationContext>
<OutputType>exe</OutputType>
<X86ProjectDirectory>..\..\tools\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation-x86\</X86ProjectDirectory>
<TasksProjectDirectory>..\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks\</TasksProjectDirectory>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(X86ProjectDirectory)$(MSBuildThisFileName)-x86.csproj" PrivateAssets="true" ReferenceOutputAssembly="false" Condition="'$(TargetFramework)'=='net461'" />
<ProjectReference Include="$(TasksProjectDirectory)Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.csproj" PrivateAssets="true" ReferenceOutputAssembly="false" />

<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.RazorPages" Version="$(AspNetCoreVersion)" />
Expand All @@ -25,6 +27,7 @@
<ItemGroup>
<None Include="build\**\*.*" Pack="true" PackagePath="%(Identity)" />
<None Include="$(OutputPath)netcoreapp2.0\$(AssemblyName).dll" Pack="true" PackagePath="build\netstandard2.0\$(AssemblyName).dll" />
<None Include="$(TasksProjectDirectory)bin\$(Configuration)\netstandard2.0\$(AssemblyName).Tasks.dll" Pack="true" PackagePath="build\netstandard2.0\$(AssemblyName).Tasks.dll" />
</ItemGroup>

<ItemGroup Condition="'$(OS)'=='Windows_NT'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,28 @@
<CallTarget Targets="_MvcRazorPrecompile" />
</Target>

<Target
Name="_MvcRazorPrecompile"
DependsOnTargets="_RunForCore;_RunForDesktop">
<Target Name="_MvcRazorPrecompile" DependsOnTargets="_RunForCore;_RunForDesktop" />

</Target>
<PropertyGroup>
<_MvcViewCompilationTasksPath Condition="'$(_MvcViewCompilationTasksPath)'==''">$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Tasks.dll</_MvcViewCompilationTasksPath>
</PropertyGroup>

<UsingTask TaskName="GetDotNetHost" AssemblyFile="$(_MvcViewCompilationTasksPath)" />

<Target
Name="_RunForCore"
DependsOnTargets="_CreateResponseFileForMvcRazorPrecompile"
Condition="'$(TargetFrameworkIdentifier)'=='.NETCoreApp'">

<GetDotNetHost Condition="'$(MvcRazorRunCommand)'==''">
<Output TaskParameter="MuxerPath" PropertyName="MvcRazorRunCommand" />
</GetDotNetHost>

<PropertyGroup>
<_MvcViewCompilationBinaryPath Condition="'$(_MvcViewCompilationBinaryPath)'==''">$(MSBuildThisFileDirectory)$(MSBuildThisFileName).dll</_MvcViewCompilationBinaryPath>

<ExecArgs>dotnet exec --runtimeconfig &quot;$(ProjectRuntimeConfigFilePath)&quot;</ExecArgs>
<ExecArgs>&quot;$(MvcRazorRunCommand)&quot; exec</ExecArgs>
<ExecArgs>$(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>
Expand Down

0 comments on commit fe4cc97

Please sign in to comment.