Skip to content

Commit

Permalink
Fixes #342, removed direct dependency on WebActivator.dll from MvcSit…
Browse files Browse the repository at this point in the history
…eMapProvider.dll. The WebActivator dependency was moved to a new library MvcSiteMapProvider.WebActivator.dll that is deployed as part of the optional MvcSiteMapProvider.MVCx NuGet package.
  • Loading branch information
NightOwl888 committed Aug 21, 2014
1 parent bf2e4d8 commit 874258c
Show file tree
Hide file tree
Showing 19 changed files with 188 additions and 47 deletions.
70 changes: 51 additions & 19 deletions build/runbuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ task Compile -depends Clean, Init, Restore -description "This task compiles the

Write-Host "Compiling..." -ForegroundColor Green

Build-MvcSiteMapProvider-Core-Versions ("net35", "net40", "net45") -mvc_version "2"
Build-MvcSiteMapProvider-Core-Versions ("net40", "net45") -mvc_version "3"
Build-MvcSiteMapProvider-Core-Versions ("net40", "net45") -mvc_version "4"
Build-MvcSiteMapProvider-Core-Versions ("net45") -mvc_version "5"
Build-MvcSiteMapProvider-Versions ("net35", "net40", "net45") -mvc_version "2"
Build-MvcSiteMapProvider-Versions ("net40", "net45") -mvc_version "3"
Build-MvcSiteMapProvider-Versions ("net40", "net45") -mvc_version "4"
Build-MvcSiteMapProvider-Versions ("net45") -mvc_version "5"
}

task NuGet -depends Compile -description "This tasks makes creates the NuGet packages" {
Expand Down Expand Up @@ -131,28 +131,21 @@ function Tokenize-Namespaces ([string] $source) {
} | Set-Content $source -Force
}

function Build-MvcSiteMapProvider-Core-Versions ([string[]] $net_versions, [string] $mvc_version) {
function Build-MvcSiteMapProvider-Versions ([string[]] $net_versions, [string] $mvc_version) {
#create the build for each version of the framework
foreach ($net_version in $net_versions) {
Build-MvcSiteMapProvider-Core-Version $net_version $mvc_version
Build-MvcSiteMapProvider-Version $net_version $mvc_version
Build-MvcSiteMapProvider-WebActivator-Version $net_version $mvc_version
}
}

function Build-MvcSiteMapProvider-Core-Version ([string] $net_version, [string] $mvc_version) {
function Build-MvcSiteMapProvider-Version ([string] $net_version, [string] $mvc_version) {
$net_version_upper = $net_version.toUpper()
Write-Host "Compiling MvcSiteMapProvider for $net_version_upper, MVC$mvc_version" -ForegroundColor Blue
$outdir = "$build_directory\mvcsitemapprovider.mvc$mvc_version.core\lib\$net_version\"
$documentation_file = $outdir + "MvcSiteMapProvider.xml"

if ($net_version -eq "net35") {
$targetFramework = "v3.5"
}
if ($net_version -eq "net40") {
$targetFramework = "v4.0"
}
if ($net_version -eq "net45") {
$targetFramework = "v4.5"
}
$targetFramework = Get-TargetFramework-Version $net_version
Write-Host "Targeting framework $targetFramework" -ForegroundColor Cyan

exec {
msbuild $source_directory\MvcSiteMapProvider\MvcSiteMapProvider.csproj `
Expand All @@ -163,13 +156,38 @@ function Build-MvcSiteMapProvider-Core-Version ([string] $net_version, [string]
/property:WarningLevel=3 `
/property:DefineConstants=`" MVC$mvc_version`;$net_version_upper`" `
/property:TargetFrameworkVersion=$targetFramework `
/property:EnableNuGetPackageRestore=true `
/property:DocumentationFile=`"$documentation_file`"
}

dir $outdir | ?{ -not($_.Name -match 'MvcSiteMapProvider') } | %{ del $_.FullName }
}

function Build-MvcSiteMapProvider-WebActivator-Version ([string] $net_version, [string] $mvc_version) {
$net_version_upper = $net_version.toUpper()
Write-Host "Compiling MvcSiteMapProvider.WebActivator for $net_version_upper, MVC$mvc_version" -ForegroundColor Blue
$outdir = "$build_directory\mvcsitemapprovider.mvc$mvc_version\lib\$net_version\"
$documentation_file = $outdir + "MvcSiteMapProvider.WebActivator.xml"
$targetFramework = Get-TargetFramework-Version $net_version
Write-Host "Targeting framework $targetFramework" -ForegroundColor Cyan

#Create a webactivator for all versions except .NET 3.5
if ($net_version -ne "net35") {
exec {
msbuild $source_directory\MvcSiteMapProvider.WebActivator\MvcSiteMapProvider.WebActivator.csproj `
/property:outdir=$outdir `
/verbosity:quiet `
/property:Configuration=$configuration `
"/t:Clean;Rebuild" `
/property:WarningLevel=3 `
/property:DefineConstants=`" MVC$mvc_version`;$net_version_upper`" `
/property:TargetFrameworkVersion=$targetFramework `
/property:DocumentationFile=`"$documentation_file`"
}

dir $outdir | ?{ -not($_.Name -match 'MvcSiteMapProvider.WebActivator') } | %{ del $_.FullName }
}
}

function Create-MvcSiteMapProvider-Legacy-Package ([string] $mvc_version) {
$output_nuspec_file = "$build_directory\mvcsitemapprovider\mvcsitemapprovider.nuspec"
Ensure-Directory-Exists $output_nuspec_file
Expand Down Expand Up @@ -418,4 +436,18 @@ function Get-Prerelease-Text {
return ".0$prerelease"
}
return ""
}

function Get-TargetFramework-Version ([string] $net_version) {
$targetFramework = "v4.0"
if ($net_version -eq "net35") {
$targetFramework = "v3.5"
}
if ($net_version -eq "net40") {
$targetFramework = "v4.0"
}
if ($net_version -eq "net45") {
$targetFramework = "v4.5"
}
return $targetFramework
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
<group targetFramework="net35">
</group>
<group targetFramework="net40">
<dependency id="WebActivatorEx" version="2.0.1" />
</group>
<group targetFramework="net45">
<dependency id="WebActivatorEx" version="2.0.1" />
</group>
</dependencies>
</metadata>
Expand Down
2 changes: 2 additions & 0 deletions nuget/mvcsitemapprovider/MvcSiteMapProvider.Shared.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
<dependency id="MvcSiteMapProvider.MVC#mvc_version#.Core" version="[$version$]" />
<!-- For new projects, we need to ensure the last update to MvcSiteMapProvider.Web is included -->
<dependency id="MvcSiteMapProvider.Web" version="4.6#prerelease#" />
<dependency id="WebActivatorEx" version="2.0.1" />
</group>
<group targetFramework="net45">
<dependency id="MvcSiteMapProvider.MVC#mvc_version#.Core" version="[$version$]" />
<!-- For new projects, we need to ensure the last update to MvcSiteMapProvider.Web is included -->
<dependency id="MvcSiteMapProvider.Web" version="4.6#prerelease#" />
<dependency id="WebActivatorEx" version="2.0.1" />
</group>
</dependencies>
</metadata>
Expand Down

This file was deleted.

3 changes: 0 additions & 3 deletions nuget/mvcsitemapprovider/tools/install.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# install.ps1
param($rootPath, $toolsPath, $package, $project)

#Delete the dummy readme file
(Get-Project).ProjectItems | ?{ $_.Name -eq "MvcSiteMapProvider_Temp_ReadMe.txt" } | %{ $_.Delete() }

$DTE.ItemOperations.Navigate("http://maartenba.github.io/MvcSiteMapProvider/getting-started.html", $DTE.vsNavigateOptions.vsNavigateOptionsNewWindow)
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
Expand Down
4 changes: 4 additions & 0 deletions src/MvcSiteMapProvider/MvcMenuTest/MvcMenuTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MvcSiteMapProvider.WebActivator\MvcSiteMapProvider.WebActivator.csproj">
<Project>{312503cd-bfda-4a09-8299-2b0c09a1239f}</Project>
<Name>MvcSiteMapProvider.WebActivator</Name>
</ProjectReference>
<ProjectReference Include="..\MvcSiteMapProvider\MvcSiteMapProvider.csproj">
<Project>{8625fb9c-be71-41ef-993d-3c05ea11def4}</Project>
<Name>MvcSiteMapProvider</Name>
Expand Down
8 changes: 4 additions & 4 deletions src/MvcSiteMapProvider/MvcMenuTest/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,27 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
<bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
4 changes: 4 additions & 0 deletions src/MvcSiteMapProvider/MvcMusicStore/MvcMusicStore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ configured in the compilation constants -->
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MvcSiteMapProvider.WebActivator\MvcSiteMapProvider.WebActivator.csproj">
<Project>{312503cd-bfda-4a09-8299-2b0c09a1239f}</Project>
<Name>MvcSiteMapProvider.WebActivator</Name>
</ProjectReference>
<ProjectReference Include="..\MvcSiteMapProvider\MvcSiteMapProvider.csproj">
<Project>{8625FB9C-BE71-41EF-993D-3C05EA11DEF4}</Project>
<Name>MvcSiteMapProvider</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
using System;

// Startup using WebActivatorEx (which allows multiple things to be started up, as opposed to the System.Web version).
[assembly: WebActivatorEx.PostApplicationStartMethod(typeof(MvcSiteMapProvider.DI.Composer), "Compose")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{312503CD-BFDA-4A09-8299-2B0C09A1239F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MvcSiteMapProvider.WebActivator</RootNamespace>
<AssemblyName>MvcSiteMapProvider.WebActivator</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>NET40;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>NET40;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" !$(DefineConstants.Contains(';NET')) ">$(DefineConstants);$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""));</DefineConstants>
<DefineConstants Condition=" $(DefineConstants.Contains(';NET')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(";NET"))));$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""));</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\WebActivatorEx.2.0.1\lib\net40\WebActivatorEx.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\Shared\CommonAssemblyInfo.cs">
<Link>Properties\CommonAssemblyInfo.cs</Link>
</Compile>
<Compile Include="Bootstrapper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MvcSiteMapProvider\MvcSiteMapProvider.csproj">
<Project>{8625fb9c-be71-41ef-993d-3c05ea11def4}</Project>
<Name>MvcSiteMapProvider</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MvcSiteMapProvider.WebActivator")]
[assembly: AssemblyDescription("Bootstrapper for MvcSiteMapProvider when installed in an ASP.NET client project.")]
[assembly: AssemblyProduct("MvcSiteMapProvider.WebActivator")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
<package id="WebActivatorEx" version="2.0.1" targetFramework="net40" />
</packages>
7 changes: 7 additions & 0 deletions src/MvcSiteMapProvider/MvcSiteMapProvider.sln
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleInjector", "CodeAsCon
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcMenuTest", "MvcMenuTest\MvcMenuTest.csproj", "{36B7ABBC-F8D8-4BF1-9E47-31A0DA11B225}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MvcSiteMapProvider.WebActivator", "MvcSiteMapProvider.WebActivator\MvcSiteMapProvider.WebActivator.csproj", "{312503CD-BFDA-4A09-8299-2B0C09A1239F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -92,6 +94,10 @@ Global
{36B7ABBC-F8D8-4BF1-9E47-31A0DA11B225}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36B7ABBC-F8D8-4BF1-9E47-31A0DA11B225}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36B7ABBC-F8D8-4BF1-9E47-31A0DA11B225}.Release|Any CPU.Build.0 = Release|Any CPU
{312503CD-BFDA-4A09-8299-2B0C09A1239F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{312503CD-BFDA-4A09-8299-2B0C09A1239F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{312503CD-BFDA-4A09-8299-2B0C09A1239F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{312503CD-BFDA-4A09-8299-2B0C09A1239F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -100,6 +106,7 @@ Global
{C83FE52C-47DD-4433-B34E-9C9D72BBFFA1} = {0EC6B430-52BD-4514-9174-8BE70C3029E3}
{36B7ABBC-F8D8-4BF1-9E47-31A0DA11B225} = {0EC6B430-52BD-4514-9174-8BE70C3029E3}
{8625FB9C-BE71-41EF-993D-3C05EA11DEF4} = {EBBE2F83-8F97-4A25-BF8C-C6A43112926A}
{312503CD-BFDA-4A09-8299-2B0C09A1239F} = {EBBE2F83-8F97-4A25-BF8C-C6A43112926A}
{406FDBF5-BD07-4BCD-8801-BDC3F22E152F} = {7DFCAC9C-4458-457F-9F1A-EA7637653D31}
{7C763B28-50B2-4201-9BD0-659FC155E5F3} = {FAADDBE0-A4D5-4EEE-A924-FE2582D734A9}
{2282E09D-96D4-4173-96CA-ED716B72AAB4} = {FAADDBE0-A4D5-4EEE-A924-FE2582D734A9}
Expand Down
5 changes: 0 additions & 5 deletions src/MvcSiteMapProvider/MvcSiteMapProvider/DI/Composer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
using System.Web.WebPages.Razor;
#endif

#if !NET35
// Startup using WebActivatorEx (which allows multiple things to be started up, as opposed to the System.Web version).
[assembly: WebActivatorEx.PostApplicationStartMethod(typeof(MvcSiteMapProvider.DI.Composer), "Compose")]
#endif

namespace MvcSiteMapProvider.DI
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<AssemblyOriginatorKeyFile>..\Shared\MvcSiteMapProvider.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" !$(DefineConstants.Contains(';NET')) ">$(DefineConstants);$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""))</DefineConstants>
<DefineConstants Condition=" $(DefineConstants.Contains(';NET')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(";NET"))));$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""))</DefineConstants>
<DefineConstants Condition=" !$(DefineConstants.Contains(';NET')) ">$(DefineConstants);$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""));</DefineConstants>
<DefineConstants Condition=" $(DefineConstants.Contains(';NET')) ">$(DefineConstants.Remove($(DefineConstants.LastIndexOf(";NET"))));$(TargetFrameworkVersion.Replace("v", "NET").Replace(".", ""));</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" $(DefineConstants.Contains('MVC2')) ">
<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
Expand Down Expand Up @@ -97,9 +97,6 @@
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
</Reference>
<Reference Include="WebActivatorEx, Version=2.0.0.0, Culture=neutral, PublicKeyToken=7b26dc2a43f6a0d4, processorArchitecture=MSIL">
<HintPath>..\packages\WebActivatorEx.2.0.1\lib\net40\WebActivatorEx.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Caching" />
</ItemGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 874258c

Please sign in to comment.