Make ViewCompilation a target
This commit is contained in:
parent
f9efbf8e78
commit
3f5cce41c1
|
|
@ -10,6 +10,7 @@ packages/
|
|||
artifacts/
|
||||
PublishProfiles/
|
||||
.vs/
|
||||
.vscode/
|
||||
bower_components/
|
||||
node_modules/
|
||||
debugSettings.json
|
||||
|
|
@ -36,4 +37,5 @@ nuget.exe
|
|||
node_modules
|
||||
*launchSettings.json
|
||||
*.orig
|
||||
BuildInfo.generated.cs
|
||||
BuildInfo.generated.cs
|
||||
msbuild.log
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26014.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design", "src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.xproj", "{4339FC9B-AEC6-442A-B413-A41555ED76C7}"
|
||||
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
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFiles", "SolutionFiles", "{01707B64-7DC7-4B5A-B0BB-7CD2773AA297}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
|
|
@ -13,51 +13,77 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionFiles", "SolutionFi
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02F7AA35-91AF-491E-9F0E-03CFAF86C720}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools", "src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools.xproj", "{F8BF7D95-0633-407F-BB0B-02563F13C068}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0398AFFF-505E-4283-89DA-BBD9D28B53DB}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests", "test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests.xproj", "{46C9A4B2-8B1C-451B-B670-C194901D66AC}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests", "test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.FunctionalTests.csproj", "{46C9A4B2-8B1C-451B-B670-C194901D66AC}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools.Test", "test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools.Test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools.Test.xproj", "{B58E3380-D451-4E54-B522-CD21404FCD58}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Test", "test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Test.xproj", "{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test", "test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Test.csproj", "{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}"
|
||||
EndProject
|
||||
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x64.Build.0 = Debug|x64
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Debug|x86.Build.0 = Debug|x86
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F8BF7D95-0633-407F-BB0B-02563F13C068}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F8BF7D95-0633-407F-BB0B-02563F13C068}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F8BF7D95-0633-407F-BB0B-02563F13C068}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F8BF7D95-0633-407F-BB0B-02563F13C068}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x64.ActiveCfg = Release|x64
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x64.Build.0 = Release|x64
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x86.ActiveCfg = Release|x86
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7}.Release|x86.Build.0 = Release|x86
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x64.Build.0 = Debug|x64
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Debug|x86.Build.0 = Debug|x86
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B58E3380-D451-4E54-B522-CD21404FCD58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B58E3380-D451-4E54-B522-CD21404FCD58}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B58E3380-D451-4E54-B522-CD21404FCD58}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B58E3380-D451-4E54-B522-CD21404FCD58}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x64.ActiveCfg = Release|x64
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x64.Build.0 = Release|x64
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x86.ActiveCfg = Release|x86
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC}.Release|x86.Build.0 = Release|x86
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x64.Build.0 = Debug|x64
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Debug|x86.Build.0 = Debug|x86
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x64.ActiveCfg = Release|x64
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x64.Build.0 = Release|x64
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x86.ActiveCfg = Release|x86
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F}.Release|x86.Build.0 = Release|x86
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Debug|x64.Build.0 = Debug|x64
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Debug|x86.Build.0 = Debug|x86
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Release|x64.ActiveCfg = Release|x64
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Release|x64.Build.0 = Release|x64
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Release|x86.ActiveCfg = Release|x86
|
||||
{1140C5E1-1C9A-4895-BB7E-C2AB2C320472}.Release|x86.Build.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{4339FC9B-AEC6-442A-B413-A41555ED76C7} = {02F7AA35-91AF-491E-9F0E-03CFAF86C720}
|
||||
{F8BF7D95-0633-407F-BB0B-02563F13C068} = {02F7AA35-91AF-491E-9F0E-03CFAF86C720}
|
||||
{46C9A4B2-8B1C-451B-B670-C194901D66AC} = {0398AFFF-505E-4283-89DA-BBD9D28B53DB}
|
||||
{B58E3380-D451-4E54-B522-CD21404FCD58} = {0398AFFF-505E-4283-89DA-BBD9D28B53DB}
|
||||
{E0D75B4E-839F-4F80-9B1F-B33F616BCC5F} = {0398AFFF-505E-4283-89DA-BBD9D28B53DB}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ cd $PSScriptRoot
|
|||
$repoFolder = $PSScriptRoot
|
||||
$env:REPO_FOLDER = $repoFolder
|
||||
|
||||
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
|
||||
$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip"
|
||||
if ($env:KOREBUILD_ZIP)
|
||||
{
|
||||
$koreBuildZip=$env:KOREBUILD_ZIP
|
||||
|
|
|
|||
2
build.sh
2
build.sh
|
|
@ -2,7 +2,7 @@
|
|||
repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd $repoFolder
|
||||
|
||||
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip"
|
||||
koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild/dev.zip"
|
||||
if [ ! -z $KOREBUILD_ZIP ]; then
|
||||
koreBuildZip=$KOREBUILD_ZIP
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
<Project>
|
||||
<Import Project="..\version.props" />
|
||||
<Import Project="..\.build\common.props" Condition="Exists('..\.build\common.props')" />
|
||||
|
||||
<PropertyGroup>
|
||||
<Product>Microsoft ASP.NET Core</Product>
|
||||
<RepositoryUrl>https://github.com/aspnet/MvcPrecompilation</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)../build/Key.snk</AssemblyOriginatorKeyFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="EnsureInitialized"
|
||||
BeforeTargets="Build"
|
||||
Condition="!Exists('$(MSBuildThisFileDirectory)..\.build\common.props')">
|
||||
<Error File="$(MSBuildProjectFile)"
|
||||
Text="Project has not been initialized. Run 'build initialize' in the solution directory." />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
{
|
||||
"projects": [
|
||||
"src",
|
||||
"samples"
|
||||
],
|
||||
"sdk": {
|
||||
"version": "1.0.0-preview2-1-003180"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
use namespace="System.IO"
|
||||
|
||||
-BuildQuality = "preview4";
|
||||
use-standard-lifecycle
|
||||
k-standard-goals
|
||||
|
||||
#repo-initialize target='initialize'
|
||||
use-volatile-feed
|
||||
@{
|
||||
var directoriesToRestore = "test";
|
||||
if (Directory.Exists("src"))
|
||||
{
|
||||
directoriesToRestore = "src " + directoriesToRestore;
|
||||
}
|
||||
}
|
||||
dotnet command='restore ${directoriesToRestore} ${E("KOREBUILD_DOTNET_RESTORE_OPTIONS")}' workingDir='${Directory.GetCurrentDirectory()}' if='!NoRestore'
|
||||
- Directory.CreateDirectory(Path.Combine(Directory.GetCurrentDirectory(), "artifacts", "build"));
|
||||
|
||||
#xunit-test
|
||||
- // Temporarily no-op until we have a resolution for https://github.com/aspnet/MvcPrecompilation/issues/48
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>4339fc9b-aec6-442a-b413-a41555ed76c7</ProjectGuid>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
// 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 System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
private readonly static Type ProgramType = typeof(Program);
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
#if DEBUG
|
||||
DebugHelper.HandleDebugSwitch(ref args);
|
||||
#endif
|
||||
|
||||
EnsureValidDispatchRecipient(ref args);
|
||||
|
||||
var app = new PrecompilationApplication(ProgramType);
|
||||
new PrecompileRunCommand().Configure(app);
|
||||
return app.Execute(args);
|
||||
}
|
||||
|
||||
private static void EnsureValidDispatchRecipient(ref string[] args)
|
||||
{
|
||||
const string DispatcherVersionArgumentName = "--dispatcher-version";
|
||||
|
||||
var dispatcherArgumentIndex = Array.FindIndex(
|
||||
args,
|
||||
(value) => string.Equals(value, DispatcherVersionArgumentName, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (dispatcherArgumentIndex < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var dispatcherArgumentValueIndex = dispatcherArgumentIndex + 1;
|
||||
if (dispatcherArgumentValueIndex < args.Length)
|
||||
{
|
||||
var dispatcherVersion = args[dispatcherArgumentValueIndex];
|
||||
|
||||
var thisAssembly = ProgramType.GetTypeInfo().Assembly;
|
||||
var version = thisAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
||||
?.InformationalVersion
|
||||
?? thisAssembly.GetName().Version.ToString();
|
||||
|
||||
if (string.Equals(dispatcherVersion, version, StringComparison.Ordinal))
|
||||
{
|
||||
// Remove dispatcher arguments from
|
||||
var preDispatcherArgument = args.Take(dispatcherArgumentIndex);
|
||||
var postDispatcherArgument = args.Skip(dispatcherArgumentIndex + 2);
|
||||
var newProgramArguments = preDispatcherArgument.Concat(postDispatcherArgument);
|
||||
args = newProgramArguments.ToArray();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Could not validate the dispatcher version.
|
||||
throw new InvalidOperationException("Could not invoke tool");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
// 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 System.Reflection;
|
||||
using System.Resources;
|
||||
|
||||
[assembly: AssemblyMetadata("Serviceable", "True")]
|
||||
[assembly: NeutralResourcesLanguage("en-us")]
|
||||
[assembly: AssemblyCompany("Microsoft Corporation.")]
|
||||
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
|
||||
[assembly: AssemblyProduct("Microsoft ASP.NET Core")]
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
"version": "1.2.0-*",
|
||||
"description": "Build-time references required to enable Razor view compilation as part of building the application.",
|
||||
"packOptions": {
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/AspNet/Mvc"
|
||||
},
|
||||
"tags": [
|
||||
"cshtml",
|
||||
"razor",
|
||||
"compilation",
|
||||
"precompilation",
|
||||
"aspnetcore"
|
||||
]
|
||||
},
|
||||
"buildOptions": {
|
||||
"keyFile": "../../tools/Key.snk",
|
||||
"warningsAsErrors": true,
|
||||
"emitEntryPoint": true,
|
||||
"nowarn": [
|
||||
"CS1591"
|
||||
],
|
||||
"xmlDoc": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Hosting": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor": "1.2.0-*",
|
||||
"Microsoft.Extensions.CommandLineUtils": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.1.0-*"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,213 +0,0 @@
|
|||
// 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 System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal;
|
||||
using Microsoft.DotNet.InternalAbstractions;
|
||||
using Microsoft.DotNet.ProjectModel;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
using Microsoft.Extensions.Internal;
|
||||
using NuGet.Frameworks;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class PrecompileDispatchCommand
|
||||
{
|
||||
private CommandLineApplication Application { get; set; }
|
||||
|
||||
private CommonOptions Options { get; } = new CommonOptions();
|
||||
|
||||
private CommandOption FrameworkOption { get; set; }
|
||||
|
||||
private CommandOption ConfigurationOption { get; set; }
|
||||
|
||||
private CommandOption OutputPathOption { get; set; }
|
||||
|
||||
private CommandOption BuildBasePathOption { get; set; }
|
||||
|
||||
private NuGetFramework TargetFramework { get; set; }
|
||||
|
||||
private CommandOption DumpFilesOption { get; set; }
|
||||
|
||||
private string ProjectPath { get; set; }
|
||||
|
||||
private string Configuration { get; set; }
|
||||
|
||||
private string OutputPath { get; set; }
|
||||
|
||||
public void Configure(CommandLineApplication app)
|
||||
{
|
||||
Application = app;
|
||||
Options.Configure(app);
|
||||
FrameworkOption = app.Option(
|
||||
"-f|--framework",
|
||||
"Target Framework",
|
||||
CommandOptionType.SingleValue);
|
||||
|
||||
ConfigurationOption = app.Option(
|
||||
"-c|--configuration",
|
||||
"Configuration",
|
||||
CommandOptionType.SingleValue);
|
||||
|
||||
OutputPathOption = app.Option(
|
||||
"-o|--output-path",
|
||||
"Output path.",
|
||||
CommandOptionType.SingleValue);
|
||||
|
||||
app.OnExecute(() => Execute());
|
||||
}
|
||||
|
||||
private int Execute()
|
||||
{
|
||||
if (!ParseArguments())
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
var runtimeContext = GetRuntimeContext();
|
||||
|
||||
var outputPaths = runtimeContext.GetOutputPaths(Configuration);
|
||||
var applicationName = Path.GetFileNameWithoutExtension(outputPaths.CompilationFiles.Assembly);
|
||||
var dispatchArgs = new List<string>
|
||||
{
|
||||
ProjectPath,
|
||||
PrecompileRunCommand.ApplicationNameTemplate,
|
||||
applicationName,
|
||||
PrecompileRunCommand.OutputPathTemplate,
|
||||
OutputPath,
|
||||
CommonOptions.ContentRootTemplate,
|
||||
Options.ContentRootOption.Value() ?? Directory.GetCurrentDirectory(),
|
||||
};
|
||||
|
||||
if (Options.ConfigureCompilationType.HasValue())
|
||||
{
|
||||
dispatchArgs.Add(CommonOptions.ConfigureCompilationTypeTemplate);
|
||||
dispatchArgs.Add(Options.ConfigureCompilationType.Value());
|
||||
}
|
||||
|
||||
if (Options.EmbedViewSourcesOption.HasValue())
|
||||
{
|
||||
dispatchArgs.Add(CommonOptions.EmbedViewSourceTemplate);
|
||||
}
|
||||
|
||||
var compilerOptions = runtimeContext.ProjectFile.GetCompilerOptions(runtimeContext.TargetFramework, Configuration);
|
||||
if (!string.IsNullOrEmpty(compilerOptions.KeyFile))
|
||||
{
|
||||
dispatchArgs.Add(StrongNameOptions.StrongNameKeyPath);
|
||||
var keyFilePath = Path.GetFullPath(Path.Combine(runtimeContext.ProjectDirectory, compilerOptions.KeyFile));
|
||||
dispatchArgs.Add(keyFilePath);
|
||||
|
||||
if (compilerOptions.DelaySign ?? false)
|
||||
{
|
||||
dispatchArgs.Add(StrongNameOptions.DelaySignTemplate);
|
||||
}
|
||||
|
||||
if (compilerOptions.PublicSign ?? false)
|
||||
{
|
||||
dispatchArgs.Add(StrongNameOptions.PublicSignTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
var commandLineArgs = Environment.GetCommandLineArgs();
|
||||
if (commandLineArgs.Length > 1 && commandLineArgs[1] == "--debug")
|
||||
{
|
||||
dispatchArgs.Insert(0, commandLineArgs[1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
var toolName = typeof(Design.Program).GetTypeInfo().Assembly.GetName().Name;
|
||||
var dispatchCommand = DotnetToolDispatcher.CreateDispatchCommand(
|
||||
dispatchArgs,
|
||||
runtimeContext.TargetFramework,
|
||||
Configuration,
|
||||
outputPath: outputPaths.RuntimeOutputPath,
|
||||
buildBasePath: null,
|
||||
projectDirectory: ProjectPath,
|
||||
toolName: toolName);
|
||||
|
||||
var commandExitCode = dispatchCommand
|
||||
.ForwardStdErr(Application.Error)
|
||||
.ForwardStdOut(Application.Out)
|
||||
.Execute()
|
||||
.ExitCode;
|
||||
|
||||
return commandExitCode;
|
||||
}
|
||||
|
||||
private bool ParseArguments()
|
||||
{
|
||||
ProjectPath = GetProjectPath(Options.ProjectArgument.Value);
|
||||
Configuration = ConfigurationOption.Value() ?? DotNet.Cli.Utils.Constants.DefaultConfiguration;
|
||||
|
||||
if (FrameworkOption.HasValue())
|
||||
{
|
||||
TargetFramework = NuGetFramework.Parse(FrameworkOption.Value());
|
||||
}
|
||||
|
||||
if (!OutputPathOption.HasValue())
|
||||
{
|
||||
Application.Error.WriteLine($"Option {OutputPathOption.Template} does not have a value.");
|
||||
return false;
|
||||
}
|
||||
OutputPath = OutputPathOption.Value();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static string GetProjectPath(string projectArgument)
|
||||
{
|
||||
string projectPath;
|
||||
if (!string.IsNullOrEmpty(projectArgument))
|
||||
{
|
||||
projectPath = Path.GetFullPath(projectArgument);
|
||||
if (string.Equals(Path.GetFileName(projectPath), "project.json", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
projectPath = Path.GetDirectoryName(projectPath);
|
||||
}
|
||||
|
||||
if (!Directory.Exists(projectPath))
|
||||
{
|
||||
throw new InvalidOperationException($"Could not find directory {projectPath}.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectPath = Directory.GetCurrentDirectory();
|
||||
}
|
||||
|
||||
return projectPath;
|
||||
}
|
||||
|
||||
private ProjectContext GetRuntimeContext()
|
||||
{
|
||||
var workspace = new BuildWorkspace(ProjectReaderSettings.ReadFromEnvironment());
|
||||
var projectContexts = ProjectContext.CreateContextForEachFramework(ProjectPath).ToArray();
|
||||
ProjectContext projectContext;
|
||||
if (TargetFramework != null)
|
||||
{
|
||||
projectContext = projectContexts.FirstOrDefault(context => context.TargetFramework.Equals(TargetFramework));
|
||||
if (projectContext == null)
|
||||
{
|
||||
throw new InvalidOperationException($"Project '{ProjectPath}' does not support framework: {FrameworkOption.Value()}");
|
||||
}
|
||||
}
|
||||
else if (projectContexts.Length == 1)
|
||||
{
|
||||
projectContext = projectContexts[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException($"Project '{ProjectPath}' targets multiple frameworks. Specify one using '{FrameworkOption.Template}.");
|
||||
}
|
||||
|
||||
return workspace.GetRuntimeContext(
|
||||
projectContext,
|
||||
RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>f8bf7d95-0633-407f-bb0b-02563f13c068</ProjectGuid>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
// 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 System.Reflection;
|
||||
using System.Resources;
|
||||
|
||||
[assembly: AssemblyMetadata("Serviceable", "True")]
|
||||
[assembly: NeutralResourcesLanguage("en-us")]
|
||||
[assembly: AssemblyCompany("Microsoft Corporation.")]
|
||||
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
|
||||
[assembly: AssemblyProduct("Microsoft ASP.NET Core")]
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
{
|
||||
"version": "1.2.0-*",
|
||||
"description": "Razor view compilation for compiling CSHTML files into DLLs.",
|
||||
"packOptions": {
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/AspNet/Mvc"
|
||||
},
|
||||
"tags": [
|
||||
"cshtml",
|
||||
"razor",
|
||||
"compilation",
|
||||
"precompilation",
|
||||
"aspnetcore"
|
||||
]
|
||||
},
|
||||
"buildOptions": {
|
||||
"outputName": "dotnet-razor-precompile",
|
||||
"keyFile": "../../tools/Key.snk",
|
||||
"warningsAsErrors": true,
|
||||
"emitEntryPoint": true,
|
||||
"nowarn": [
|
||||
"CS1591"
|
||||
],
|
||||
"xmlDoc": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"target": "project"
|
||||
},
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-preview2-003121",
|
||||
"Microsoft.Extensions.CommandLineUtils": "1.2.0-*",
|
||||
"Microsoft.Extensions.DotnetToolDispatcher.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.2.0-*"
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.DotNet.InternalAbstractions": "1.0.0",
|
||||
"Microsoft.DotNet.ProjectModel.Loader": "1.0.0-preview2-003121",
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.1.0-*"
|
||||
},
|
||||
"System.Runtime.Serialization.Primitives": "4.3.0-*"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class CommonOptions
|
||||
{
|
||||
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public static class DebugHelper
|
||||
{
|
||||
|
|
@ -14,7 +14,7 @@ using Microsoft.Extensions.FileProviders;
|
|||
using Microsoft.Extensions.ObjectPool;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class MvcServiceProvider
|
||||
{
|
||||
|
|
@ -2,10 +2,12 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class PrecompilationApplication : CommandLineApplication
|
||||
{
|
||||
|
|
@ -33,7 +35,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
|||
{
|
||||
try
|
||||
{
|
||||
return base.Execute(args);
|
||||
return base.Execute(ExpandResponseFiles(args));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -49,5 +51,24 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
|||
var attribute = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
return attribute.InformationalVersion;
|
||||
}
|
||||
|
||||
private static string[] ExpandResponseFiles(string[] args)
|
||||
{
|
||||
var expandedArgs = new List<string>();
|
||||
foreach (var arg in args)
|
||||
{
|
||||
if (!arg.StartsWith("@", StringComparison.Ordinal))
|
||||
{
|
||||
expandedArgs.Add(arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
var fileName = arg.Substring(1);
|
||||
expandedArgs.AddRange(File.ReadLines(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
return expandedArgs.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ using Microsoft.CodeAnalysis.Text;
|
|||
using Microsoft.Extensions.CommandLineUtils;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class PrecompileRunCommand
|
||||
{
|
||||
|
|
@ -76,9 +76,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
|||
Options.ContentRootOption.Value(),
|
||||
Options.ConfigureCompilationType.Value());
|
||||
|
||||
Application.Out.WriteLine("Running Razor view precompilation.");
|
||||
|
||||
var stopWatch = Stopwatch.StartNew();
|
||||
var results = GenerateCode();
|
||||
var success = true;
|
||||
foreach (var result in results)
|
||||
|
|
@ -119,9 +116,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
|||
return 1;
|
||||
}
|
||||
|
||||
stopWatch.Stop();
|
||||
Application.Out.WriteLine($"Precompiled views emitted to {assemblyPath}.");
|
||||
Application.Out.WriteLine($"Successfully compiled {results.Length} Razor views in {stopWatch.ElapsedMilliseconds}ms.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Collections.Immutable;
|
||||
using System.IO;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
// Copied from https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.DotNet.ProjectModel.Workspaces/SnkUtils.cs
|
||||
public static class SnkUtils
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using Microsoft.Extensions.CommandLineUtils;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class StrongNameOptions
|
||||
{
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
using Microsoft.AspNetCore.Mvc.Razor.Compilation;
|
||||
using Microsoft.AspNetCore.Razor.CodeGenerators;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class ViewCompilationInfo
|
||||
{
|
||||
|
|
@ -13,7 +13,7 @@ using Microsoft.CodeAnalysis;
|
|||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
||||
{
|
||||
public class ViewInfoContainerCodeGenerator
|
||||
{
|
||||
|
|
@ -63,15 +63,16 @@ namespace {ViewsFeatureProvider.ViewInfoContainerNamespace}
|
|||
if (!string.IsNullOrEmpty(strongNameOptions.KeyFile))
|
||||
{
|
||||
var updatedOptions = Compilation.Options.WithStrongNameProvider(new DesktopStrongNameProvider());
|
||||
var keyFilePath = Path.GetFullPath(strongNameOptions.KeyFile);
|
||||
|
||||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || strongNameOptions.PublicSign)
|
||||
{
|
||||
updatedOptions = updatedOptions.WithCryptoPublicKey(
|
||||
SnkUtils.ExtractPublicKey(File.ReadAllBytes(strongNameOptions.KeyFile)));
|
||||
SnkUtils.ExtractPublicKey(File.ReadAllBytes(keyFilePath)));
|
||||
}
|
||||
else
|
||||
{
|
||||
updatedOptions = updatedOptions.WithCryptoKeyFile(strongNameOptions.KeyFile)
|
||||
updatedOptions = updatedOptions.WithCryptoKeyFile(keyFilePath)
|
||||
.WithDelaySign(strongNameOptions.DelaySign);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<Import Project="..\..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<Description>Build-time references required to enable Razor view compilation as part of building the application.</Description>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<PackageTags>cshtml;razor;compilation;precompilation;aspnetcore</PackageTags>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>exe</OutputType>
|
||||
|
||||
<!-- Include the build outputs in the build directory (and not the lib directory) -->
|
||||
<BuildOutputTargetFolder>build</BuildOutputTargetFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
<None Include="build\**\*" Pack="true" PackagePath="%(Identity)" />
|
||||
<None Include="buildCrossTargeting/*" Pack="true" PackagePath="%(Identity)" />
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,21 +1,25 @@
|
|||
// 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.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
private readonly static Type ProgramType = typeof(Program);
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
#if DEBUG
|
||||
DebugHelper.HandleDebugSwitch(ref args);
|
||||
#endif
|
||||
|
||||
var app = new PrecompilationApplication(typeof(Program));
|
||||
new PrecompileDispatchCommand().Configure(app);
|
||||
var app = new PrecompilationApplication(ProgramType);
|
||||
new PrecompileRunCommand().Configure(app);
|
||||
return app.Execute(args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<_MvcRazorOutputPath Condition="'$(MvcRazorOutputPath)'!=''">$([MSBuild]::EnsureTrailingSlash('$(MvcRazorOutputPath)'))</_MvcRazorOutputPath>
|
||||
<_MvcRazorOutputPath Condition="'$(_MvcRazorOutputPath)'==''">$(IntermediateOutputPath)</_MvcRazorOutputPath>
|
||||
<_MvcRazorOutputFullPath>$([System.IO.Path]::Combine($([System.IO.Path]::GetFullPath('$(_MvcRazorOutputPath)')), '$(MSBuildProjectName).PrecompiledViews.dll'))</_MvcRazorOutputFullPath>
|
||||
<_MvcRazorResponseFilePath>$(IntermediateOutputPath)microsoft.aspnetcore.mvc.razor.viewcompilation.rsp</_MvcRazorResponseFilePath>
|
||||
|
||||
<MvcRazorContentRoot Condition="'$(MvcRazorContentRoot)'==''">$(MSBuildProjectDirectory)</MvcRazorContentRoot>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_MvcRazorContentFiles Include="$([MSBuild]::EnsureTrailingSlash('$(MvcRazorOutputPath)'))**\*.cshtml" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_CreateResponseFileForMvcRazorPrecompile">
|
||||
<ItemGroup>
|
||||
<ExecArgs Include="
|
||||
$(MSBuildProjectDirectory);
|
||||
--output-path=$(_MvcRazorOutputPath);
|
||||
--application-name=$(MSBuildProjectName);
|
||||
--content-root=$(MvcRazorContentRoot);" />
|
||||
|
||||
<ExecArgs
|
||||
Condition="'$(MvcRazorEmbedViewSources)'=='true'"
|
||||
Include="--embed-view-sources" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(SignAssembly)'=='true'">
|
||||
<ExecArgs
|
||||
Condition="'$(DelaySign)'=='true'"
|
||||
Include="--delay-sign" />
|
||||
<ExecArgs
|
||||
Condition="'$(PublicSign)'=='true'"
|
||||
Include="--public-sign" />
|
||||
<ExecArgs Include="--key-file=$(AssemblyOriginatorKeyFile)" />
|
||||
</ItemGroup>
|
||||
|
||||
<WriteLinesToFile
|
||||
File="$(_MvcRazorResponseFilePath)"
|
||||
Lines="@(ExecArgs)"
|
||||
Overwrite="true" />
|
||||
</Target>
|
||||
|
||||
<Target
|
||||
Name="_MvcRazorPrecompileOnPublish"
|
||||
DependsOnTargets="MvcRazorPrecompile"
|
||||
AfterTargets="PrepareForPublish"
|
||||
Condition="'$(MvcRazorCompileOnPublish)'=='true'">
|
||||
|
||||
<ItemGroup>
|
||||
<ResolvedFileToPublish Include="$(_MvcRazorOutputFullPath)" CopyToPublishDirectory="Always">
|
||||
<RelativePath>$([System.IO.Path]::GetFileName('$(_MvcRazorOutputFullPath)'))</RelativePath>
|
||||
</ResolvedFileToPublish>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\common.targets" />
|
||||
<Target
|
||||
Name="MvcRazorPrecompile"
|
||||
Inputs="$(MSBuildThisFileFullPath);@(_MvcRazorContentFiles);@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePath);$(MSBuildAllProjects);"
|
||||
Outputs="$(_MvcRazorOutputFullPath)">
|
||||
|
||||
<CallTarget Targets="_CreateResponseFileForMvcRazorPrecompile" />
|
||||
|
||||
<ItemGroup>
|
||||
<FilesToCopy Include="$(OutputPath)$(AssemblyName).exe.config">
|
||||
<Destination>$(OutputPath)$(MSBuildThisFileName).exe.config</Destination>
|
||||
</FilesToCopy>
|
||||
<FilesToCopy Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).exe">
|
||||
<Destination>$(OutputPath)$(MSBuildThisFileName).exe</Destination>
|
||||
</FilesToCopy>
|
||||
</ItemGroup>
|
||||
|
||||
<Copy
|
||||
SourceFiles="@(FilesToCopy)"
|
||||
DestinationFiles="%(Destination)" />
|
||||
|
||||
<Message
|
||||
Text="Executing Razor view precompilation."
|
||||
Importance="Low" />
|
||||
|
||||
<Exec
|
||||
Command="$(OutputPath)$(MSBuildThisFileName).exe @"$(_MvcRazorResponseFilePath)""
|
||||
WorkingDirectory="$(MSBuildProjectDirectory)"/>
|
||||
|
||||
<Message
|
||||
Text="Razor view compilation for $(MSBuildProjectName) -> $(_MvcRazorOutputFullPath)"
|
||||
Importance="High" />
|
||||
|
||||
<Delete Files="%(FilesToCopy.Destination)" />
|
||||
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildThisFileDirectory)..\common.targets" />
|
||||
<Target
|
||||
Name="MvcRazorPrecompile"
|
||||
Inputs="$(MSBuildThisFileFullPath);@(_MvcRazorContentFiles);@(IntermediateAssembly);@(DocFileItem);@(_DebugSymbolsIntermediatePath);@(ReferencePath);$(MSBuildAllProjects)"
|
||||
Outputs="$(_MvcRazorOutputFullPath)">
|
||||
|
||||
<CallTarget Targets="_CreateResponseFileForMvcRazorPrecompile" />
|
||||
|
||||
<PropertyGroup>
|
||||
<ExecArgs>--runtimeconfig "$(ProjectRuntimeConfigFilePath)"</ExecArgs>
|
||||
<ExecArgs>$(ExecArgs) --depsfile "$(ProjectDepsFilePath)"</ExecArgs>
|
||||
<ExecArgs>$(ExecArgs) "$(MSBuildThisFileDirectory)$(MSBuildThisFileName).dll"</ExecArgs>
|
||||
<ExecArgs>$(ExecArgs) @"$(_MvcRazorResponseFilePath)"</ExecArgs>
|
||||
</PropertyGroup>
|
||||
|
||||
<Message
|
||||
Text="Executing Razor view precompilation."
|
||||
Importance="Low" />
|
||||
|
||||
<Exec
|
||||
Command="dotnet exec $(ExecArgs)"
|
||||
WorkingDirectory="$(MSBuildProjectDirectory)" />
|
||||
|
||||
<Message
|
||||
Text="Razor view compilation for $(MSBuildProjectName) -> $(_MvcRazorOutputFullPath)"
|
||||
Importance="High" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
<!--
|
||||
Copyright (c) .NET Foundation. All rights reserved.
|
||||
Licensed under the Apache License, Version 2.0.
|
||||
-->
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!--
|
||||
**********************************************************************************
|
||||
Target: ResolveRazorTargetFramework
|
||||
Outputs the Razor target framework used by tooling to the console.
|
||||
**********************************************************************************
|
||||
-->
|
||||
<Target Name="ResolveRazorTargetFramework">
|
||||
<MSBuild Projects="$(MSBuildProjectFile)"
|
||||
Targets="ResolveRazorTargetFramework"
|
||||
Properties="TargetFramework=$(TargetFrameworks.Split(';')[0])">
|
||||
</MSBuild>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>e0d75b4e-839f-4f80-9b1f-b33f616bcc5f</ProjectGuid>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"dotnet-test-xunit": "2.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*",
|
||||
"xunit": "2.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.1.0-*"
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
}
|
||||
},
|
||||
"testRunner": "xunit"
|
||||
}
|
||||
|
|
@ -59,37 +59,24 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
|||
protected override void Restore()
|
||||
{
|
||||
CreateClassLibraryPackage();
|
||||
RestoreProject(ApplicationPath, new[] { _packOutputDirectory });
|
||||
RestoreProject(ApplicationPath, new[] { _packOutputDirectory, "https://api.nuget.org/v3/index.json" });
|
||||
}
|
||||
|
||||
private void CreateClassLibraryPackage()
|
||||
{
|
||||
RestoreProject(ClassLibraryPath);
|
||||
ExecuteForClassLibrary(Command.CreateDotNet("build", new[] { ClassLibraryPath, "-c", "Release" }));
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
// Don't run precompile tool for net451 on xplat.
|
||||
ExecuteForClassLibrary(Command.CreateDotNet(
|
||||
"razor-precompile",
|
||||
GetPrecompileArguments("net451")));
|
||||
}
|
||||
|
||||
ExecuteForClassLibrary(Command.CreateDotNet(
|
||||
"razor-precompile",
|
||||
GetPrecompileArguments("netcoreapp1.1")));
|
||||
|
||||
var timestamp = "z" + DateTime.UtcNow.Ticks.ToString().PadLeft(18, '0');
|
||||
"build",
|
||||
new[] { "-c", "Release" }));
|
||||
var packCommand = Command
|
||||
.CreateDotNet("pack", new[] { "--no-build", "-c", "Release", "-o", _packOutputDirectory })
|
||||
.EnvironmentVariable("DOTNET_BUILD_VERSION", timestamp);
|
||||
.CreateDotNet("pack", new[] { "-c", "Release", "-o", _packOutputDirectory });
|
||||
|
||||
ExecuteForClassLibrary(packCommand);
|
||||
}
|
||||
|
||||
private void ExecuteForClassLibrary(ICommand command)
|
||||
{
|
||||
Console.WriteLine($"Running {command.CommandName} {command.CommandArgs}");
|
||||
Console.WriteLine($"Running {command.CommandName} {command.CommandArgs} in {ClassLibraryPath}");
|
||||
command
|
||||
.WorkingDirectory(ClassLibraryPath)
|
||||
.EnvironmentVariable(NuGetPackagesEnvironmentKey, TempRestoreDirectory)
|
||||
|
|
@ -100,20 +87,6 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
|||
.EnsureSuccessful();
|
||||
}
|
||||
|
||||
private string[] GetPrecompileArguments(string targetFramework)
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
ClassLibraryPath,
|
||||
"-c",
|
||||
"Release",
|
||||
"-f",
|
||||
$"{targetFramework}",
|
||||
"-o",
|
||||
$"obj/precompiled/{targetFramework}",
|
||||
};
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
TryDeleteDirectory(_packOutputDirectory);
|
||||
|
|
|
|||
|
|
@ -111,11 +111,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
|||
}
|
||||
|
||||
protected void RestoreProject(string applicationDirectory, string[] additionalFeeds = null)
|
||||
{
|
||||
var packagesDirectory = GetNuGetPackagesDirectory();
|
||||
{
|
||||
var args = new List<string>
|
||||
{
|
||||
Path.Combine(applicationDirectory, "project.json"),
|
||||
"--packages",
|
||||
TempRestoreDirectory,
|
||||
};
|
||||
|
|
@ -124,7 +122,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
|||
{
|
||||
foreach (var feed in additionalFeeds)
|
||||
{
|
||||
args.Add("-f");
|
||||
args.Add("-s");
|
||||
args.Add(feed);
|
||||
}
|
||||
}
|
||||
|
|
@ -134,6 +132,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
|||
.EnvironmentVariable(DotnetSkipFirstTimeExperience, "true")
|
||||
.ForwardStdErr(Console.Error)
|
||||
.ForwardStdOut(Console.Out)
|
||||
.WorkingDirectory(applicationDirectory)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<Import Project="..\..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||
<DefineConstants>$(DefineConstants);__remove_this_to__GENERATE_BASELINES</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
<EmbeddedResource Include="Resources\*" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="0.3.0-*" />
|
||||
<PackageReference Include="Microsoft.DotNet.Cli.Utils" Version="1.0.0-preview2-003121" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
<PackageReference Include="xunit" Version="2.2.0-*" />
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.2.0-*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>46c9a4b2-8b1c-451b-b670-c194901d66ac</ProjectGuid>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"define": [
|
||||
"__remove_this_to__GENERATE_BASELINES"
|
||||
],
|
||||
"embed": "Resources/*"
|
||||
},
|
||||
"dependencies": {
|
||||
"dotnet-test-xunit": "2.2.0-*",
|
||||
"Microsoft.AspNetCore.Server.IntegrationTesting": "0.3.0-*",
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||
"Microsoft.Extensions.Logging": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*",
|
||||
"Microsoft.Extensions.PlatformAbstractions": "1.2.0-*",
|
||||
"xunit": "2.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.1.0-*"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"testRunner": "xunit"
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
|
||||
<Import Project="..\..\build\common.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation\Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20161123-03" />
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.2.0-*" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0-beta4-build1194" />
|
||||
<PackageReference Include="xunit" Version="2.2.0-beta4-build3444" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -5,13 +5,13 @@ using System;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.Emit;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation
|
||||
{
|
||||
public class PrecompileRunCommandTest
|
||||
{
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>b58e3380-d451-4e54-b522-cd21404fcd58</ProjectGuid>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,180 +0,0 @@
|
|||
// 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 System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design.Internal;
|
||||
using Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools
|
||||
{
|
||||
public class PrecompileDispatchCommandTest
|
||||
{
|
||||
[Fact]
|
||||
public void RunPrintsHelp_WhenHelpOptionIsSpecified()
|
||||
{
|
||||
// Arrange
|
||||
var expected =
|
||||
$@"Microsoft Razor Precompilation Utility {GetToolVersion()}
|
||||
|
||||
Usage: razor-precompile [arguments] [options]
|
||||
|
||||
Arguments:
|
||||
project The path to the project (project folder or project.json) with precompilation.
|
||||
|
||||
Options:
|
||||
-?|-h|--help Show help information
|
||||
--configure-compilation-type Type with Configure method
|
||||
--content-root The application's content root.
|
||||
--embed-view-sources Embed view sources as resources in the generated assembly.
|
||||
-f|--framework Target Framework
|
||||
-c|--configuration Configuration
|
||||
-o|--output-path Output path.";
|
||||
var args = new[]
|
||||
{
|
||||
"--help"
|
||||
};
|
||||
|
||||
// Act
|
||||
var result = Execute(args);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(0, result.ExitCode);
|
||||
Assert.Equal(expected, result.Out.Trim(), ignoreLineEndingDifferences: true);
|
||||
Assert.Empty(result.Error);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RunPrintsHelp_WhenInvalidOptionsAreSpecified()
|
||||
{
|
||||
// Arrange
|
||||
var expectedOut = @"Specify --help for a list of available options and commands.";
|
||||
var expectedError = @"Unrecognized option '--bad-option'";
|
||||
var args = new[]
|
||||
{
|
||||
"--bad-option"
|
||||
};
|
||||
|
||||
// Act
|
||||
var result = Execute(args);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(1, result.ExitCode);
|
||||
Assert.Equal(expectedOut, result.Out.Trim());
|
||||
Assert.Equal(
|
||||
expectedError,
|
||||
result.Error.Split(new[] { Environment.NewLine }, StringSplitOptions.None).First());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RunPrintsError_IfOutputPathIfNotSpecified()
|
||||
{
|
||||
// Arrange
|
||||
var expected = "Option -o|--output-path does not have a value.";
|
||||
var args = new[]
|
||||
{
|
||||
"-f",
|
||||
"framework"
|
||||
};
|
||||
|
||||
// Act
|
||||
var result = Execute(args);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(1, result.ExitCode);
|
||||
Assert.Empty(result.Out);
|
||||
Assert.Equal(expected, result.Error.Trim());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null)]
|
||||
[InlineData("")]
|
||||
public void GetProjectPath_ReturnsCurrentDirectoryIfArgumentIsNullOrEmpty(string projectPath)
|
||||
{
|
||||
// Act
|
||||
var actual = PrecompileDispatchCommand.GetProjectPath(projectPath);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(Directory.GetCurrentDirectory(), actual);
|
||||
}
|
||||
|
||||
public static TheoryData GetProjectPath_ReturnsArgumentIfNotNullOrEmptyData
|
||||
{
|
||||
get
|
||||
{
|
||||
return new TheoryData<string, string>
|
||||
{
|
||||
{ "", Directory.GetCurrentDirectory() },
|
||||
{ "project.json", Directory.GetCurrentDirectory() },
|
||||
{ Path.GetTempPath(), Path.GetTempPath() },
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(GetProjectPath_ReturnsArgumentIfNotNullOrEmptyData))]
|
||||
public void GetProjectPath_ReturnsArgumentIfNotNullOrEmpty(string projectPath, string expected)
|
||||
{
|
||||
// Act
|
||||
var actual = PrecompileDispatchCommand.GetProjectPath(projectPath);
|
||||
|
||||
// Assert
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetProjectPath_ThrowsIfDirectoryDoesNotExist()
|
||||
{
|
||||
// Arrange
|
||||
var nonExistent = Path.GetRandomFileName();
|
||||
|
||||
// Act & Assert
|
||||
var ex = Assert.Throws<InvalidOperationException>(
|
||||
() => PrecompileDispatchCommand.GetProjectPath(nonExistent));
|
||||
Assert.Equal($"Could not find directory {Path.GetFullPath(nonExistent)}.", ex.Message);
|
||||
}
|
||||
|
||||
private static string GetToolVersion()
|
||||
{
|
||||
return typeof(Program)
|
||||
.GetTypeInfo()
|
||||
.Assembly
|
||||
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()
|
||||
.InformationalVersion;
|
||||
}
|
||||
|
||||
private class ExecuteResult
|
||||
{
|
||||
public string Out { get; set; }
|
||||
|
||||
public string Error { get; set; }
|
||||
|
||||
public int ExitCode { get; set; }
|
||||
}
|
||||
|
||||
private ExecuteResult Execute(string[] args)
|
||||
{
|
||||
using (var outputWriter = new StringWriter())
|
||||
using (var errorWriter = new StringWriter())
|
||||
{
|
||||
var app = new PrecompilationApplication(typeof(Program))
|
||||
{
|
||||
Out = outputWriter,
|
||||
Error = errorWriter,
|
||||
};
|
||||
new PrecompileDispatchCommand().Configure(app);
|
||||
var exitCode = app.Execute(args);
|
||||
|
||||
return new ExecuteResult
|
||||
{
|
||||
ExitCode = exitCode,
|
||||
Out = outputWriter.ToString(),
|
||||
Error = errorWriter.ToString(),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"dotnet-test-xunit": "2.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*",
|
||||
"xunit": "2.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.0": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"type": "platform",
|
||||
"version": "1.1.0-*"
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
}
|
||||
},
|
||||
"testRunner": "xunit"
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ClassLibraryWithPrecompiledViews" Version="1.0.0-*" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>cef718e4-4556-422f-b64f-9d9671218e67</ProjectGuid>
|
||||
<RootNamespace>ApplicationUsingPrecompiledViewClassLibrary</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"preserveCompilationContext": true
|
||||
},
|
||||
"dependencies": {
|
||||
"ClassLibraryWithPrecompiledViews": {
|
||||
"target": "package",
|
||||
"version": "1.0.0-*"
|
||||
},
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.1.0-*",
|
||||
"type": "platform"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"wwwroot",
|
||||
"appsettings.json",
|
||||
"web.config"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>e2eaeb85-91d5-478e-9ce2-964f68de20d0</ProjectGuid>
|
||||
<RootNamespace>ApplicationWithConfigureMvc</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"preserveCompilationContext": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"version": "1.2.0-*",
|
||||
"target": "package",
|
||||
"type": "build"
|
||||
},
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
|
||||
},
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.1.0-*",
|
||||
"type": "platform"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"wwwroot",
|
||||
"appsettings.json",
|
||||
"web.config"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "dotnet razor-precompile --configuration %publish:Configuration% --framework %publish:TargetFramework% --output-path %publish:OutputPath% %publish:ProjectPath%"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win7-x64</RuntimeIdentifiers>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ClassLibraryTagHelper\ClassLibraryTagHelper.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
<PackageReference Include="TagHelperSamples.Bootstrap" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>2079872f-e8f9-4db1-a340-c0d897807b86</ProjectGuid>
|
||||
<RootNamespace>ApplicationWithTagHelpers</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
// 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 System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace ApplicationWithTagHelpers
|
||||
{
|
||||
public class CopyrightViewComponent : ViewComponent
|
||||
{
|
||||
public IViewComponentResult Invoke(string website, int year)
|
||||
{
|
||||
var dict = new Dictionary<string, object>
|
||||
{
|
||||
["website"] = website,
|
||||
["year"] = year
|
||||
};
|
||||
|
||||
return View(dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
@model Dictionary<string, object>
|
||||
© @Model["year"] - @Model["website"]
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
@addTagHelper *, ApplicationWithTagHelpers
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>@ViewData["Title"] - ApplicationWithTagHelpers</title>
|
||||
|
|
@ -11,7 +12,7 @@
|
|||
@RenderBody()
|
||||
<hr />
|
||||
<footer>
|
||||
<p>© 2016 - ApplicationWithTagHelpers</p>
|
||||
<p><vc:copyright website="ApplicationWithTagHelpers" year="2016" bold></vc:copyright></p>
|
||||
</footer>
|
||||
</div>
|
||||
@RenderSection("scripts", required: false)
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"preserveCompilationContext": true
|
||||
},
|
||||
"dependencies": {
|
||||
"ClassLibraryTagHelper": {
|
||||
"target": "project"
|
||||
},
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"version": "1.2.0-*",
|
||||
"target": "package",
|
||||
"type": "build"
|
||||
},
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*",
|
||||
"TagHelperSamples.Bootstrap": "1.1.1"
|
||||
},
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.1.0-*",
|
||||
"type": "platform"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"wwwroot",
|
||||
"appsettings.json",
|
||||
"web.config"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "dotnet razor-precompile --configuration %publish:Configuration% --framework %publish:TargetFramework% --output-path %publish:OutputPath% %publish:ProjectPath%"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="**\*.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="1.1.0" />
|
||||
<PackageReference Include="NETStandard.Library" Version="1.6.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>39efa075-3673-49ab-95f3-aa5e88df6c30</ProjectGuid>
|
||||
<RootNamespace>ClassLibraryTagHelpers</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Razor.Runtime": "1.2.0-*",
|
||||
"NETStandard.Library": "1.6.1-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netstandard1.6": {},
|
||||
"net451": {}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.0.0-z$([System.DateTime]::UtcNow.Ticks)</Version>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<MvcRazorOutputPath Condition="'$(TargetFramework)'!=''">obj\precompiled\$(TargetFramework)</MvcRazorOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content
|
||||
Include="obj\precompiled\**\*"
|
||||
Pack="true"
|
||||
PackagePath="lib\%(RecursiveDir)%(FileName)%(Extension)" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target
|
||||
Name="PrecompileRazorViews"
|
||||
AfterTargets="Build"
|
||||
DependsOnTargets="MvcRazorPrecompile"
|
||||
Condition="'$(TargetFramework)'!=''" />
|
||||
|
||||
</Project>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>4684de8b-3fbe-421b-8798-56c3d6698b76</ProjectGuid>
|
||||
<RootNamespace>ClassLibraryWithPrecompiledViews</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
{
|
||||
"version": "1.0.0-*",
|
||||
"buildOptions": {
|
||||
"preserveCompilationContext": true,
|
||||
"emitEntryPoint": true
|
||||
},
|
||||
"packOptions": {
|
||||
"files": {
|
||||
"mappings": {
|
||||
"lib/": "obj/precompiled/"
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"version": "1.2.0-*",
|
||||
"target": "package",
|
||||
"type": "build"
|
||||
}
|
||||
},
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.1.0-*",
|
||||
"type": "platform"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
<MvcRazorEmbedViewSources>true</MvcRazorEmbedViewSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>e3462190-3068-40f0-9aa5-34779fe252ac</ProjectGuid>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"preserveCompilationContext": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"version": "1.2.0-*",
|
||||
"target": "package",
|
||||
"type": "build"
|
||||
},
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
|
||||
},
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.1.0-*",
|
||||
"type": "platform"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"wwwroot",
|
||||
"appsettings.json",
|
||||
"web.config"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "dotnet razor-precompile --embed-view-sources --configuration %publish:Configuration% --framework %publish:TargetFramework% --output-path %publish:OutputPath% %publish:ProjectPath%"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>8fa176ed-c29e-48d6-bc7a-1c3a862cb15f</ProjectGuid>
|
||||
<RootNamespace>SimpleApp</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DnxInvisibleContent Include="bower.json" />
|
||||
<DnxInvisibleContent Include=".bowerrc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"preserveCompilationContext": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"version": "1.2.0-*",
|
||||
"target": "package",
|
||||
"type": "build"
|
||||
},
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
|
||||
},
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.1.0-*",
|
||||
"type": "platform"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"wwwroot",
|
||||
"appsettings.json",
|
||||
"web.config"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "dotnet razor-precompile --configuration %publish:Configuration% --framework %publish:TargetFramework% --output-path %publish:OutputPath% %publish:ProjectPath%"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net451</TargetFramework>
|
||||
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
<PrivateAssets>All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>a0b0a141-a32b-4f33-b85f-5ca8c107105f</ProjectGuid>
|
||||
<RootNamespace>SimpleAppDesktopOnly</RootNamespace>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"preserveCompilationContext": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"version": "1.2.0-*",
|
||||
"target": "package",
|
||||
"type": "build"
|
||||
},
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
|
||||
},
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"net451": {}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"wwwroot",
|
||||
"appsettings.json",
|
||||
"web.config"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "dotnet razor-precompile --configuration %publish:Configuration% --framework %publish:TargetFramework% --output-path %publish:OutputPath% %publish:ProjectPath%"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk.Web" ToolsVersion="15.0">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp1.1;net451</TargetFrameworks>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AssemblyOriginatorKeyFile>../../build/Key.snk</AssemblyOriginatorKeyFile>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
|
||||
<RuntimeIdentifier Condition="!$(TargetFramework.StartsWith('netcoreapp'))">win7-x64</RuntimeIdentifier>
|
||||
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.ViewCompilation">
|
||||
<Version>1.1.0-*</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
|
||||
<PackageReference Include="Microsoft.NETCore.App" Version="1.1.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0.25420" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0.25420</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>88903be5-0676-4667-8160-b24646e0b76e</ProjectGuid>
|
||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
</Project>
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
{
|
||||
"buildOptions": {
|
||||
"emitEntryPoint": true,
|
||||
"preserveCompilationContext": true,
|
||||
"keyFile": "../../tools/Key.snk"
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.AspNetCore.Mvc": "1.2.0-*",
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design": {
|
||||
"version": "1.2.0-*",
|
||||
"target": "package",
|
||||
"type": "build"
|
||||
},
|
||||
"Microsoft.AspNetCore.Server.Kestrel": "1.2.0-*",
|
||||
"Microsoft.Extensions.Configuration.CommandLine": "1.2.0-*",
|
||||
"Microsoft.Extensions.Logging.Console": "1.2.0-*"
|
||||
},
|
||||
"tools": {
|
||||
"Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools": "1.2.0-*"
|
||||
},
|
||||
"frameworks": {
|
||||
"netcoreapp1.1": {
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"version": "1.1.0-*",
|
||||
"type": "platform"
|
||||
}
|
||||
}
|
||||
},
|
||||
"net451": {}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"wwwroot",
|
||||
"appsettings.json",
|
||||
"web.config"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"postpublish": "dotnet razor-precompile --configuration %publish:Configuration% --framework %publish:TargetFramework% --output-path %publish:OutputPath% %publish:ProjectPath%"
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +1,27 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.26014.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SimpleApp", "testapps\SimpleApp\SimpleApp.xproj", "{8FA176ED-C29E-48D6-BC7A-1C3A862CB15F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{43488AEE-CCF2-4A90-B890-05320282BE29}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
testapps\global.json = testapps\global.json
|
||||
testapps\NuGet.config = testapps\NuGet.config
|
||||
global.json = global.json
|
||||
NuGet.config = NuGet.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ApplicationWithTagHelpers", "testapps\ApplicationWithTagHelpers\ApplicationWithTagHelpers.xproj", "{2079872F-E8F9-4DB1-A340-C0D897807B86}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithTagHelpers", "ApplicationWithTagHelpers\ApplicationWithTagHelpers.csproj", "{2079872F-E8F9-4DB1-A340-C0D897807B86}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ClassLibraryTagHelper", "testapps\ClassLibraryTagHelper\ClassLibraryTagHelper.xproj", "{39EFA075-3673-49AB-95F3-AA5E88DF6C30}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibraryTagHelper", "ClassLibraryTagHelper\ClassLibraryTagHelper.csproj", "{39EFA075-3673-49AB-95F3-AA5E88DF6C30}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ApplicationWithConfigureMvc", "testapps\ApplicationWithConfigureMvc\ApplicationWithConfigureMvc.xproj", "{E2EAEB85-91D5-478E-9CE2-964F68DE20D0}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationWithConfigureMvc", "ApplicationWithConfigureMvc\ApplicationWithConfigureMvc.csproj", "{E2EAEB85-91D5-478E-9CE2-964F68DE20D0}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "ClassLibraryWithPrecompiledViews", "testapps\ClassLibraryWithPrecompiledViews\ClassLibraryWithPrecompiledViews.xproj", "{4684DE8B-3FBE-421B-8798-56C3D6698B76}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibraryWithPrecompiledViews", "ClassLibraryWithPrecompiledViews\ClassLibraryWithPrecompiledViews.csproj", "{4684DE8B-3FBE-421B-8798-56C3D6698B76}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PublishWIthEmbedViewSources", "testapps\PublishWIthEmbedViewSources\PublishWIthEmbedViewSources.xproj", "{E3462190-3068-40F0-9AA5-34779FE252AC}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PublishWIthEmbedViewSources", "PublishWIthEmbedViewSources\PublishWIthEmbedViewSources.csproj", "{E3462190-3068-40F0-9AA5-34779FE252AC}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "StrongNamedApp", "testapps\StrongNamedApp\StrongNamedApp.xproj", "{88903BE5-0676-4667-8160-B24646E0B76E}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StrongNamedApp", "StrongNamedApp\StrongNamedApp.csproj", "{88903BE5-0676-4667-8160-B24646E0B76E}"
|
||||
EndProject
|
||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "SimpleAppDesktopOnly", "testapps\SimpleAppDesktopOnly\SimpleAppDesktopOnly.xproj", "{A0B0A141-A32B-4F33-B85F-5CA8C107105F}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleAppDesktopOnly", "SimpleAppDesktopOnly\SimpleAppDesktopOnly.csproj", "{A0B0A141-A32B-4F33-B85F-5CA8C107105F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
|
@ -31,10 +29,6 @@ Global
|
|||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{8FA176ED-C29E-48D6-BC7A-1C3A862CB15F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8FA176ED-C29E-48D6-BC7A-1C3A862CB15F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8FA176ED-C29E-48D6-BC7A-1C3A862CB15F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8FA176ED-C29E-48D6-BC7A-1C3A862CB15F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2079872F-E8F9-4DB1-A340-C0D897807B86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2079872F-E8F9-4DB1-A340-C0D897807B86}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2079872F-E8F9-4DB1-A340-C0D897807B86}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"projects": [],
|
||||
"sdk": {
|
||||
"version": "1.0.0-preview2-1-003180"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>1.1.0</VersionPrefix>
|
||||
<VersionSuffix>msbuild3</VersionSuffix>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Loading…
Reference in New Issue