Browse Source

Revert "Changes build process so that both .Net4 and .Net45 libs are built"

This reverts commit 652ac8b4b2 [formerly 79785b82a85672549094ea67000afc779b3ab1b0] [formerly a467c2f8b54ae1c34053dbbbfecacfdc3e185467].


Former-commit-id: 6617c17a6c4bfd638a579c6a1d2a32c4bd2f1bce
Former-commit-id: c9282aa247b798d47b3bae436b3a75d0310d96fc
pull/17/head
James South 12 years ago
parent
commit
f2e81c7fdf
  1. 1
      build/NuSpecs/ImageProcessor.nuspec
  2. 31
      build/build.ps1
  3. 17
      build/build.xml
  4. 22
      src/ImageProcessor/ImageProcessor.csproj

1
build/NuSpecs/ImageProcessor.nuspec

@ -29,7 +29,6 @@
</tags>
</metadata>
<files>
<file src="..\_BuildOutput\ImageProcessor\lib\net40\ImageProcessor.dll" target="lib\net40\ImageProcessor.dll" />
<file src="..\_BuildOutput\ImageProcessor\lib\net45\ImageProcessor.dll" target="lib\net45\ImageProcessor.dll" />
<file src="..\_BuildOutput\Help\docu\**" target="contents\docs\api" />
</files>

31
build/build.ps1

@ -76,28 +76,21 @@ task Build-Solution -depends Cleanup-Binaries, Set-VersionNumber {
Write-Host "Building projects"
# build the projects
# regular "$xmlobject.node | % { $_ }" don't work when they're nested: http://fredmorrison.wordpress.com/2013/03/19/reading-xml-with-powershell-why-most-examples-you-see-are-wrong/
[System.Xml.XmlElement] $root = $PROJECTS.get_DocumentElement()
[System.Xml.XmlElement] $project = $null
foreach($project in $root.ChildNodes) {
if ($project.projfile -eq $null -or $project.projfile -eq "") {
continue # goes to next item
$PROJECTS.projects.project | % {
if ($_.projfile -eq $null -or $_.projfile -eq "") {
return # breaks out of ForEach-Object loop
}
$projectPath = Resolve-Path $project.folder
Write-Host "Building project $($project.name) at version $($project.version)"
$projectPath = Resolve-Path $_.folder
Write-Host "Building project $($_.name) at version $($_.version)"
# it would be possible to update more infos from the xml (description etc), so as to have all infos in one place
Update-AssemblyInfo -file (Join-Path $projectPath "Properties\AssemblyInfo.cs") -version $project.version
[System.Xml.XmlElement] $output = $null
foreach($output in $project.outputs.ChildNodes) {
# using invoke-expression solves a few character escape issues
$buildCommand = "msbuild $(Join-Path $projectPath $project.projfile) /t:Build /p:Warnings=true /p:Configuration=Release /p:PipelineDependsOnBuild=False /p:OutDir=$(Join-Path $BIN_PATH $output.folder) $($output.additionalParameters) /clp:WarningsOnly /clp:ErrorsOnly /clp:Summary /clp:PerformanceSummary /v:Normal /nologo"
Write-Host $buildCommand -ForegroundColor DarkGreen
Exec {
Invoke-Expression $buildCommand
}
Update-AssemblyInfo -file (Join-Path $projectPath "Properties\AssemblyInfo.cs") -version $_.version
# using the invoke-expression on a string solves a few character escape issues
$buildCommand = "msbuild $(Join-Path $projectPath $_.projfile) /t:Build /p:Warnings=true /p:Configuration=Release /p:PipelineDependsOnBuild=False /p:OutDir=$(Join-Path $BIN_PATH $($_.output)) /clp:WarningsOnly /clp:ErrorsOnly /clp:Summary /clp:PerformanceSummary /v:Normal /nologo"
Exec {
Invoke-Expression $buildCommand
}
}
}

17
build/build.xml

@ -4,10 +4,7 @@
<version>2.1.0.0</version>
<folder>..\src\ImageProcessor</folder>
<projfile>ImageProcessor.csproj</projfile>
<outputs>
<output additionalParameters="/p:Framework=NET40" folder="ImageProcessor\lib\net40" />
<output additionalParameters="/p:Framework=NET45" folder="ImageProcessor\lib\net45" />
</outputs>
<output>ImageProcessor\lib\net45</output>
<nuspec>ImageProcessor.nuspec</nuspec>
</project>
@ -16,9 +13,7 @@
<version>4.1.0.0</version>
<folder>..\src\ImageProcessor.Web</folder>
<projfile>ImageProcessor.Web.csproj</projfile>
<outputs>
<output folder="ImageProcessor.Web\lib\net45" />
</outputs>
<output>ImageProcessor.Web\lib\net45</output>
<nuspec>ImageProcessor.Web.nuspec</nuspec>
</project>
@ -33,9 +28,7 @@
<version>1.0.0.0</version>
<folder>..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.Cair</folder>
<projfile>ImageProcessor.Plugins.Cair.csproj</projfile>
<outputs>
<output folder="ImageProcessor.Plugins.Cair\lib\net45" />
</outputs>
<output>ImageProcessor.Plugins.Cair\lib\net45</output>
<nuspec>ImageProcessor.Plugins.Cair.nuspec</nuspec>
</project>
@ -44,9 +37,7 @@
<version>1.0.1.0</version>
<folder>..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.WebP</folder>
<projfile>ImageProcessor.Plugins.WebP.csproj</projfile>
<outputs>
<output folder="ImageProcessor.Plugins.WebP\lib\net45" />
</outputs>
<output>ImageProcessor.Plugins.WebP\lib\net45</output>
<nuspec>ImageProcessor.Plugins.WebP.nuspec</nuspec>
</project>
</projects>

22
src/ImageProcessor/ImageProcessor.csproj

@ -25,7 +25,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\ImageProcessor.XML</DocumentationFile>
@ -54,7 +54,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET45</DefineConstants>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\ImageProcessor.XML</DocumentationFile>
@ -80,7 +80,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'All|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\All\</OutputPath>
<DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DocumentationFile>bin\Debug\ImageProcessor.XML</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
@ -225,4 +225,20 @@
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.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>
-->
<Target Name="AfterBuild">
<!-- This just allows us to drop a note in the build output -->
<Message Text="Enter After Build TargetFrameworkVersion:$(TargetFrameworkVersion) Framework:$(Framework)" Importance="high" />
<!-- This is the key to the whole process. The second build happens here. We set our 'Framework' variable allowing the above PropertyGroups to run more frameworks. -->
<MSBuild Condition=" '$(Framework)' != 'NET40'" Projects="$(MSBuildProjectFile)" Properties="Framework=NET40" RunEachTargetSeparately="true" />
<!-- You could repeat the above node again here and target another framework if there was a property group that would evaluate to true-->
<!-- Just more logging -->
<Message Text="Exiting After Build TargetFrameworkVersion:$(TargetFrameworkVersion) Framework:$(Framework)" Importance="high" />
</Target>
</Project>
Loading…
Cancel
Save