Skip to content

Commit

Permalink
Add Microsoft Web Targets as nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbeach committed Jul 23, 2017
1 parent ddfbc70 commit a0dc892
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,5 @@ opencoverCoverage.xml

# NUnit
results.xml

package-lock.json
4 changes: 2 additions & 2 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function(grunt) {
projectConfiguration: 'Release',
platform: '<%= platform %>',
targets: ['Clean', 'Rebuild'],
version: 12,
version: 4.0,
buildParameters: {
StyleCopEnabled: false
}
Expand All @@ -57,7 +57,7 @@ module.exports = function(grunt) {
projectConfiguration: 'Debug',
platform: '<%= platform %>',
targets: ['Clean', 'Rebuild'],
version: 12,
version: 4.0,
buildParameters: {
StyleCopEnabled: true,
StyleCopTreatErrorsAsWarnings: false,
Expand Down
3 changes: 2 additions & 1 deletion tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<package id="BuildTools.StyleCopPlus" version="4.7.49.4" targetFramework="net45" />
<package id="coveralls.net" version="0.6.0" targetFramework="net45" />
<package id="Hylasoft.Behavior" version="0.1.3" targetFramework="net45" />
<package id="MSBuild.Microsoft.VisualStudio.Web.targets" version="14.0.0.3" targetFramework="net45" />
<package id="NUnit" version="3.4.1" targetFramework="net45" />
<package id="NUnit.ConsoleRunner" version="3.4.1" targetFramework="net45" />
<package id="NUnit.Runners" version="3.4.1" targetFramework="net45" />
<package id="OpenCover" version="4.6.519" targetFramework="net45" />
<package id="ReportGenerator" version="2.4.5.0" targetFramework="net45" />
</packages>
</packages>
12 changes: 10 additions & 2 deletions tests/tests.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\build\MSBuild.Microsoft.VisualStudio.Web.targets.props" Condition="Exists('..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\build\MSBuild.Microsoft.VisualStudio.Web.targets.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -19,7 +20,8 @@
<StyleCopOverrideSettingsFile>Settings.StyleCop</StyleCopOverrideSettingsFile>
<BuildToolsStyleCopVersion>4.7.44.0</BuildToolsStyleCopVersion>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>cf39ef6a</NuGetPackageImportStamp>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -137,7 +139,7 @@
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\BuildTools.StyleCop.4.7.49.0\tools\StyleCop.targets" Condition="Exists('..\packages\BuildTools.StyleCop.4.7.49.0\tools\StyleCop.targets')" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.targets" />
<Import Project="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\tools\VSToolsPath\Web\Microsoft.Web.Publishing.targets" />
<Target Name="___packages_BuildTools_StyleCop_4_7_49_0_tools_StyleCop_targets" Condition="$(StyleCopOutputFile)==''" BeforeTargets="BeforeBuild">
<Error Text="BuildTools_StyleCop - the BuildTools_StyleCop package has not been restored.&#xD;&#xA;If you are running this from an IDE, make sure NuGet Package Restore has been enabled, then reload the solution and re-run the build.&#xD;&#xA;If you are running this from the command line, run the build again.&#xD;&#xA;If this is a CI server, you may want to make sure NuGet Package Restore runs before your build with:&#xD;&#xA; msbuild solution.sln /t:restorepackages" />
</Target>
Expand All @@ -151,4 +153,10 @@
<Target Name="AfterBuild">
<TransformXml Source="@(AppConfigWithTargetPath)" Transform="$(ProjectConfigTransformFileName)" Destination="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')" />
</Target>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\build\MSBuild.Microsoft.VisualStudio.Web.targets.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.14.0.0.3\build\MSBuild.Microsoft.VisualStudio.Web.targets.props'))" />
</Target>
</Project>

0 comments on commit a0dc892

Please sign in to comment.