Browse Source

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

This reverts commit f67979f83f [formerly 4297405a390ccbcc9136445e9430e976cc7af1a3] [formerly aa31ae86c57378f17c12cb416112a70dc5349f86].


Former-commit-id: e6fb846c5b291f0c2ee854ddf9e1b2949945997b
Former-commit-id: b61fd5df824a3495f0725d1a27ddfebd80e173a2
af/merge-core
James South 12 years ago
parent
commit
a4e5bd15a2
  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,6 +29,7 @@
</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,21 +76,28 @@ task Build-Solution -depends Cleanup-Binaries, Set-VersionNumber {
Write-Host "Building projects"
# build the projects
$PROJECTS.projects.project | % {
if ($_.projfile -eq $null -or $_.projfile -eq "") {
return # breaks out of ForEach-Object loop
# 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
}
$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 $_.version
$projectPath = Resolve-Path $project.folder
Write-Host "Building project $($project.name) at version $($project.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
# 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
}
}
}
}

17
build/build.xml

@ -4,7 +4,10 @@
<version>2.1.0.0</version>
<folder>..\src\ImageProcessor</folder>
<projfile>ImageProcessor.csproj</projfile>
<output>ImageProcessor\lib\net45</output>
<outputs>
<output additionalParameters="/p:Framework=NET40" folder="ImageProcessor\lib\net40" />
<output additionalParameters="/p:Framework=NET45" folder="ImageProcessor\lib\net45" />
</outputs>
<nuspec>ImageProcessor.nuspec</nuspec>
</project>
@ -13,7 +16,9 @@
<version>4.1.0.0</version>
<folder>..\src\ImageProcessor.Web</folder>
<projfile>ImageProcessor.Web.csproj</projfile>
<output>ImageProcessor.Web\lib\net45</output>
<outputs>
<output folder="ImageProcessor.Web\lib\net45" />
</outputs>
<nuspec>ImageProcessor.Web.nuspec</nuspec>
</project>
@ -28,7 +33,9 @@
<version>1.0.0.0</version>
<folder>..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.Cair</folder>
<projfile>ImageProcessor.Plugins.Cair.csproj</projfile>
<output>ImageProcessor.Plugins.Cair\lib\net45</output>
<outputs>
<output folder="ImageProcessor.Plugins.Cair\lib\net45" />
</outputs>
<nuspec>ImageProcessor.Plugins.Cair.nuspec</nuspec>
</project>
@ -37,7 +44,9 @@
<version>1.0.1.0</version>
<folder>..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.WebP</folder>
<projfile>ImageProcessor.Plugins.WebP.csproj</projfile>
<output>ImageProcessor.Plugins.WebP\lib\net45</output>
<outputs>
<output folder="ImageProcessor.Plugins.WebP\lib\net45" />
</outputs>
<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</DefineConstants>
<DefineConstants>DEBUG;TRACE;NET45</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</DefineConstants>
<DefineConstants>TRACE;NET45</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</DefineConstants>
<DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<DocumentationFile>bin\Debug\ImageProcessor.XML</DocumentationFile>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
@ -225,20 +225,4 @@
<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