Move SkipStrongNames inside of build.cmd.
This commit is contained in:
Родитель
4764b0111b
Коммит
7825aa4e5b
|
@ -16,7 +16,7 @@
|
|||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
||||
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
|
||||
<PackageSource Include="https://nuget.org/api/v2/" />
|
||||
<PackageSource Include="https://www.myget.org/F/f05dce941ae4485090b04586209c8b08/" />
|
||||
<PackageSource Include="https://www.myget.org/F/30de4ee06dd54956a82013fa17a3accb/" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
||||
|
@ -67,21 +67,29 @@
|
|||
<Target Name="RestoreBinaryDependencies" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec
|
||||
Command='$(NuGetCommand) install StyleCop -source $(PackageSources) -o "$(PackagesDir)" -Version 4.7.10.0 > NUL'
|
||||
LogStandardErrorAsError="true" />
|
||||
<Exec
|
||||
Command='$(NuGetCommand) install Microsoft.Web.FxCop.v11 -source $(PackageSources) -o "$(PackagesDir)" -ExcludeVersion > NUL'
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" !Exists('$(PackagesDir)\Microsoft.Web.FxCop.v11') " />
|
||||
Condition=" !Exists('$(PackagesDir)\StyleCop.4.7.10.0') " />
|
||||
<Exec
|
||||
Command='$(NuGetCommand) install Microsoft.Web.StyleCop -source $(PackageSources) -o "$(PackagesDir)" -ExcludeVersion > NUL'
|
||||
Command='$(NuGetCommand) install Microsoft.Web.FxCop -source $(PackageSources) -o "$(PackagesDir)" -Version 1.0.0 > NUL'
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" !Exists('$(PackagesDir)\Microsoft.Web.StyleCop') " />
|
||||
Condition=" !Exists('$(PackagesDir)\Microsoft.Web.FxCop.1.0.0') " />
|
||||
<Exec
|
||||
Command='$(NuGetCommand) install Microsoft.Web.StyleCop -source $(PackageSources) -o "$(PackagesDir)" -Version 1.0.0 > NUL'
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" !Exists('$(PackagesDir)\Microsoft.Web.StyleCop.1.0.0') " />
|
||||
<Exec
|
||||
Command='$(NuGetCommand) install Microsoft.Bcl.Build -source $(PackageSources) -o "$(PackagesDir)" -Version 1.0.0-rc > NUL'
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" !Exists('$(PackagesDir)\Microsoft.Bcl.Build.1.0.0-rc') " />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreSkipStrongNames" DependsOnTargets="CheckPrerequisites" AfterTargets="RestoreBinaryDependencies">
|
||||
<Exec
|
||||
Command='$(NuGetCommand) install Microsoft.Web.SkipStrongNames -source $(PackageSources) -o "$(PackagesDir)" -Version 1.0.0 > NUL'
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" !Exists('$(PackagesDir)\Microsoft.Web.SkipStrongNames.1.0.0') " />
|
||||
</Target>
|
||||
|
||||
<Target Name="CheckPrerequisites">
|
||||
<!-- Raise an error if we're unable to locate nuget.exe -->
|
||||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Web.FxCop" version="1.0.0" />
|
||||
<package id="Microsoft.Web.SkipStrongNames" version="1.0.0" />
|
||||
<package id="Microsoft.Web.StyleCop" version="1.0.0" />
|
||||
</packages>
|
|
@ -1,5 +1,6 @@
|
|||
<Project DefaultTargets="UnitTest" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="tools/WebStack.tasks.targets"/>
|
||||
<UsingTask TaskName="SkipStrongNames.CheckSkipStrongNamesStatus" AssemblyFile="$(SkipStrongNamesExe)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- build.cmd sets /p:Desktop=true. The CI server does not; instead, it does an additional step with /p:Configuration=CodeAnalysis. -->
|
||||
|
@ -11,6 +12,8 @@
|
|||
<BuildInParallel Condition=" '$(BuildInParallel)' == '' And $(MSBuildNodeCount) > 1 ">true</BuildInParallel>
|
||||
<BuildInParallel Condition=" '$(BuildInParallel)' == '' ">false</BuildInParallel>
|
||||
<TestResultsDirectory>$(MSBuildThisFileDirectory)bin\$(Configuration)\test\TestResults\</TestResultsDirectory>
|
||||
<SkipStrongNamesExe>$(MSBuildThisFileDirectory)packages\Microsoft.Web.SkipStrongNames.1.0.0\tools\SkipStrongNames.exe</SkipStrongNamesExe>
|
||||
<SkipStrongNamesXml>$(MSBuildThisFileDirectory)tools\SkipStrongNames.xml</SkipStrongNamesXml>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -19,7 +22,23 @@
|
|||
<BuildInParallel>$(BuildInParallel)</BuildInParallel>
|
||||
<PortableLibrary>RuntimePortable.sln</PortableLibrary>
|
||||
</SolutionsToBuild>
|
||||
</ItemGroup>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="EnableSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
|
||||
<Exec Command="$(SkipStrongNamesExe) -e $(SkipStrongNamesXml)" />
|
||||
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
|
||||
<Output TaskParameter="Status" PropertyName="Status" />
|
||||
</CheckSkipStrongNamesStatus>
|
||||
<Message Text="SkipStrongNames: $(Status)" Importance="High" />
|
||||
</Target>
|
||||
|
||||
<Target Name="DisableSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
|
||||
<Exec Command="$(SkipStrongNamesExe) -d $(SkipStrongNamesXml)" />
|
||||
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
|
||||
<Output TaskParameter="Status" PropertyName="Status" />
|
||||
</CheckSkipStrongNamesStatus>
|
||||
<Message Text="SkipStrongNames: $(Status)" Importance="High" />
|
||||
</Target>
|
||||
|
||||
<Target Name="Integration" DependsOnTargets="Clean;Build;UnitTest" />
|
||||
|
||||
|
@ -36,6 +55,10 @@
|
|||
<RemoveDir Directories="bin\%(SolutionsToBuild.ReleaseRoot)\$(Configuration)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreSkipStrongNames">
|
||||
<MSBuild Projects=".nuget\nuget.targets" Targets="RestoreSkipStrongNames" />
|
||||
</Target>
|
||||
|
||||
<Target Name="Prereq" DependsOnTargets="PreRestorePackages">
|
||||
<MSBuild Projects=".nuget\nuget.targets" Targets="RestoreBinaryDependencies" />
|
||||
<MSBuild Projects="@(RestoreCsProjFiles)" Targets="RestorePackages" StopOnFirstFailure="true" />
|
||||
|
@ -80,11 +103,11 @@
|
|||
Properties="Configuration=$(Configuration);CodeAnalysis=$(CodeAnalysis);StyleCopEnabled=$(StyleCopEnabled);VisualStudioVersion=$(VisualStudioVersion)" />
|
||||
</Target>
|
||||
|
||||
<Target Name = "UnitTest" DependsOnTargets="Build">
|
||||
<Target Name="UnitTest" DependsOnTargets="CheckSkipStrongNames;Build">
|
||||
<CallTarget Targets="RunTests;PrintTestRunSummary" RunEachTargetSeparately="True" />
|
||||
</Target>
|
||||
|
||||
<Target Name = "RunTests">
|
||||
<Target Name="RunTests" DependsOnTargets="CheckSkipStrongNames">
|
||||
<ItemGroup>
|
||||
<TestDLLsXunit Include="bin\$(Configuration)\test\*.Test.dll;bin\$(Configuration)\test\*.Test.*.dll;bin\$(Configuration)\Test\NetCore\*.Test.dll" Exclude="**\SPA.Test.dll" />
|
||||
<XunitProject Include="tools\WebStack.xunit.targets">
|
||||
|
@ -99,6 +122,13 @@
|
|||
<MSBuild Projects="@(XunitProject)" BuildInParallel="$(BuildInParallel)" Targets="Xunit" />
|
||||
</Target>
|
||||
|
||||
<Target Name="CheckSkipStrongNames" DependsOnTargets="RestoreSkipStrongNames">
|
||||
<CheckSkipStrongNamesStatus AssembliesFile="$(SkipStrongNamesXml)">
|
||||
<Output TaskParameter="Status" PropertyName="Status" />
|
||||
</CheckSkipStrongNamesStatus>
|
||||
<Error Text="Unit tests will not run correctly unless SkipStrongNames is Enabled. Current status: $(Status). Run the EnableSkipStrongNames target to fix this problem." Condition="'$(Status)' != 'Enabled'" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PrintTestRunSummary">
|
||||
<PrintTestRunSummary TestResultsDirectory="$(TestResultsDirectory)" />
|
||||
</Target>
|
||||
|
|
|
@ -102,6 +102,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CB34D5
|
|||
.nuget\NuGet.Config = .nuget\NuGet.Config
|
||||
.nuget\NuGet.exe = .nuget\NuGet.exe
|
||||
.nuget\NuGet.targets = .nuget\NuGet.targets
|
||||
.nuget\packages.config = .nuget\packages.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="FxCop rules for ASP.NET Web Stack" Description="This rule set contains the rules for ASP.NET Web Stack." ToolsVersion="10.0">
|
||||
<RuleHintPaths>
|
||||
<Path>..\packages\Microsoft.Web.FxCop.v11</Path>
|
||||
<Path>..\packages\Microsoft.Web.FxCop.1.0.0</Path>
|
||||
</RuleHintPaths>
|
||||
<IncludeAll Action="Error" />
|
||||
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assemblies defaultPublicKeyToken="31bf3856ad364e35">
|
||||
<!-- Production assemblies -->
|
||||
<assembly name="Microsoft.AspNet.Mvc.Facebook"/>
|
||||
<assembly name="Microsoft.Web.Helpers"/>
|
||||
<assembly name="Microsoft.Web.Http.Data"/>
|
||||
<assembly name="Microsoft.Web.Http.Data.EntityFramework"/>
|
||||
<assembly name="Microsoft.Web.Http.Data.Helpers"/>
|
||||
<assembly name="Microsoft.Web.WebPages.OAuth"/>
|
||||
<assembly name="System.Json"/>
|
||||
<assembly name="System.Net.Http.Formatting"/>
|
||||
<assembly name="System.Web.Helpers"/>
|
||||
<assembly name="System.Web.Http"/>
|
||||
<assembly name="System.Web.Http.Common"/>
|
||||
<assembly name="System.Web.Http.OData"/>
|
||||
<assembly name="System.Web.Http.SelfHost"/>
|
||||
<assembly name="System.Web.Http.SignalR"/>
|
||||
<assembly name="System.Web.Http.Tracing"/>
|
||||
<assembly name="System.Web.Http.WebHost"/>
|
||||
<assembly name="System.Web.Mvc"/>
|
||||
<assembly name="System.Web.Razor"/>
|
||||
<assembly name="System.Web.WebPages"/>
|
||||
<assembly name="System.Web.WebPages.Administration"/>
|
||||
<assembly name="System.Web.WebPages.Deployment"/>
|
||||
<assembly name="System.Web.WebPages.Razor"/>
|
||||
<assembly name="WebApiHelpPage"/>
|
||||
<assembly name="WebApiHelpPageVB"/>
|
||||
<assembly name="WebMatrix.Data"/>
|
||||
<assembly name="WebMatrix.WebData"/>
|
||||
|
||||
<!-- Unit test assemblies and helpers -->
|
||||
<assembly name="Microsoft.AspNet.Mvc.Facebook.Test"/>
|
||||
<assembly name="Microsoft.TestCommon"/>
|
||||
<assembly name="Microsoft.Web.Helpers.Test"/>
|
||||
<assembly name="Microsoft.Web.Http.Data.Test"/>
|
||||
<assembly name="Microsoft.Web.WebPages.OAuth.Test"/>
|
||||
<assembly name="System.Json.Test"/>
|
||||
<assembly name="System.Json.Test.Integration"/>
|
||||
<assembly name="System.Net.Http.Formatting.Test"/>
|
||||
<assembly name="System.Net.Http.Formatting.NetCore.Test"/>
|
||||
<assembly name="System.Net.Http.Formatting.Test.Integration"/>
|
||||
<assembly name="System.Web.Helpers.Test"/>
|
||||
<assembly name="System.Web.Http.Common.Test"/>
|
||||
<assembly name="System.Web.Http.Integration.Test"/>
|
||||
<assembly name="System.Web.Http.OData.Test"/>
|
||||
<assembly name="System.Web.Http.SelfHost.Test"/>
|
||||
<assembly name="System.Web.Http.SignalR.Test"/>
|
||||
<assembly name="System.Web.Http.Test"/>
|
||||
<assembly name="System.Web.Http.Tracing.Test"/>
|
||||
<assembly name="System.Web.Http.WebHost.Test"/>
|
||||
<assembly name="System.Web.Mvc.Test"/>
|
||||
<assembly name="System.Web.Razor.Test"/>
|
||||
<assembly name="System.Web.WebPages.Administration.Test"/>
|
||||
<assembly name="System.Web.WebPages.Deployment.Test"/>
|
||||
<assembly name="System.Web.WebPages.Razor.Test"/>
|
||||
<assembly name="System.Web.WebPages.Test"/>
|
||||
<assembly name="WebApiHelpPage.Test"/>
|
||||
<assembly name="WebApiHelpPage.VB.Test" />
|
||||
<assembly name="WebMatrix.Data.Test"/>
|
||||
<assembly name="WebMatrix.WebData.Test"/>
|
||||
</assemblies>
|
Загрузка…
Ссылка в новой задаче