Some pre-requisites for for Razor build server

This commit is contained in:
Ajay Bhargav Baaskaran 2018-01-12 16:15:23 -08:00
parent ecb323b5dc
commit d238c0dcfc
21 changed files with 36 additions and 21 deletions

View File

@ -29,9 +29,10 @@
<TaskFolder Condition=" '$(MSBuildRuntimeType)' == 'Core' ">netstandard2.0</TaskFolder>
<TaskFolder Condition=" '$(MSBuildRuntimeType)' != 'Core' ">net46</TaskFolder>
<TaskAssembly>$(_RazorMSBuildRoot)\tasks\$(TaskFolder)\Microsoft.AspNetCore.Razor.Tasks.dll</TaskAssembly>
<_RazorTaskAssembly Condition="'$(_RazorTaskAssembly)'==''">$(_RazorMSBuildRoot)\tasks\$(TaskFolder)\Microsoft.AspNetCore.Razor.Tasks.dll</_RazorTaskAssembly>
</PropertyGroup>
<UsingTask TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorGenerate" AssemblyFile="$(TaskAssembly)" />
<UsingTask TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper" AssemblyFile="$(TaskAssembly)" />
<UsingTask TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorGenerate" AssemblyFile="$(_RazorTaskAssembly)" />
<UsingTask TaskName="Microsoft.AspNetCore.Razor.Tasks.RazorTagHelper" AssemblyFile="$(_RazorTaskAssembly)" />
</Project>

View File

@ -114,6 +114,7 @@
Debug="$(_RazorDebugTagHelperTask)"
DebugTool="$(_RazorDebugTagHelperTool)"
ToolAssembly="$(_RazorTagHelperToolAssembly)"
ServerAssembly="$(_RazorBuildServerAssembly)"
Assemblies="@(RazorReferencePath)"
TagHelperManifest="$(_RazorTagHelperOutputCache)">
<Output

View File

@ -62,6 +62,11 @@ namespace Microsoft.AspNetCore.Razor.Tasks
}
}
if (TryExecuteOnServer(out var result))
{
return result;
}
return base.Execute();
}
@ -76,5 +81,11 @@ namespace Microsoft.AspNetCore.Razor.Tasks
base.LogToolCommand(message);
}
}
protected virtual bool TryExecuteOnServer(out bool result)
{
result = false;
return false;
}
}
}

View File

@ -16,7 +16,9 @@ namespace Microsoft.AspNetCore.Razor.Tasks
[Output]
[Required]
public string TagHelperManifest { get; set; }
public string ServerAssembly { get; set; }
protected override bool SkipTaskExecution()
{
if (Assemblies.Length == 0)

View File

@ -8,7 +8,7 @@ using System.Reflection;
using System.Threading;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal class Application : CommandLineApplication
{

View File

@ -8,7 +8,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CommandLine;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal abstract class Client : IDisposable
{

View File

@ -6,7 +6,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal abstract class CommandBase : CommandLineApplication
{

View File

@ -5,7 +5,7 @@ using System.Collections.Generic;
using System.Threading;
using Microsoft.CodeAnalysis.CommandLine;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal abstract class CompilerHost
{

View File

@ -6,7 +6,7 @@ using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal abstract class Connection : IDisposable
{

View File

@ -7,7 +7,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CommandLine;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
// Heavily influenced by:
// https://github.com/dotnet/roslyn/blob/14aed138a01c448143b9acf0fe77a662e3dfe2f4/src/Compilers/Server/VBCSCompiler/NamedPipeClientConnection.cs#L17

View File

@ -3,7 +3,7 @@
using System;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal struct ConnectionResult
{

View File

@ -6,7 +6,7 @@ using System.Diagnostics;
using System.Linq;
using System.Threading;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal static class DebugMode
{

View File

@ -16,7 +16,7 @@ using Microsoft.Extensions.CommandLineUtils;
using Microsoft.VisualStudio.LanguageServices.Razor;
using Newtonsoft.Json;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal class DiscoverCommand : CommandBase
{

View File

@ -3,7 +3,7 @@
using System;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal abstract class EventBus
{

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal static class Memory
{

View File

@ -1,7 +1,7 @@
// 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.
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal static class MutexName
{

View File

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal static class PipeName
{

View File

@ -4,7 +4,7 @@
using System;
using System.Threading;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal static class Program
{

View File

@ -11,7 +11,7 @@ using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CommandLine;
using Microsoft.CodeAnalysis.CompilerServer;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
// Heavily influenced by:
// https://github.com/dotnet/roslyn/blob/14aed138a01c448143b9acf0fe77a662e3dfe2f4/src/Compilers/Server/ServerShared/ServerDispatcher.cs#L15

View File

@ -5,7 +5,7 @@ using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal class ServerCommand : CommandBase
{

View File

@ -8,7 +8,7 @@ using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CommandLine;
using Microsoft.Extensions.CommandLineUtils;
namespace Microsoft.AspNetCore.Razor.TagHelperTool
namespace Microsoft.AspNetCore.Razor.Tools
{
internal class ShutdownCommand : CommandBase
{