diff --git a/build/Build.ImageProcessor.Plugins.Cair.proj b/build/Build.ImageProcessor.Plugins.Cair.proj
deleted file mode 100644
index d4668467d..000000000
--- a/build/Build.ImageProcessor.Plugins.Cair.proj
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
- .\
-
-
-
-
-
-
-
- Release
- _BuildOutput\
- False
- $(MSBuildProjectDirectory)\$(BuildFolder)
- $(BuildFolderAbsolutePath)ImageProcessor.Plugins.Cair\lib\net45
- ..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.Cair\
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/Build.ImageProcessor.Plugins.WebP.proj b/build/Build.ImageProcessor.Plugins.WebP.proj
deleted file mode 100644
index c2fca90fd..000000000
--- a/build/Build.ImageProcessor.Plugins.WebP.proj
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
- .\
-
-
-
-
-
-
-
- Release
- _BuildOutput\
- False
- $(MSBuildProjectDirectory)\$(BuildFolder)
- $(BuildFolderAbsolutePath)ImageProcessor.Plugins.WebP\lib\net45
- ..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.WebP\
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/Build.ImageProcessor.Web.proj b/build/Build.ImageProcessor.Web.proj
deleted file mode 100644
index ae6936faf..000000000
--- a/build/Build.ImageProcessor.Web.proj
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
- .\
-
-
-
-
-
-
-
- Release
- _BuildOutput\
- False
- ..\..\..\build\$(BuildFolder)
- $(MSBuildProjectDirectory)\$(BuildFolder)
- $(BuildFolder)bin\
- $(BuildFolderRelativeToProjects)bin\
- $(BuildFolderAbsolutePath)ImageProcessor.Web\lib\net45
- ..\src\ImageProcessor.Web\
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/Build.ImageProcessor.proj b/build/Build.ImageProcessor.proj
deleted file mode 100644
index 134c1ed9f..000000000
--- a/build/Build.ImageProcessor.proj
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
- .\
-
-
-
-
-
-
-
- Release
- _BuildOutput\
- False
- $(MSBuildProjectDirectory)\$(BuildFolder)
- $(BuildFolderAbsolutePath)ImageProcessor\lib\net45
- ..\src\ImageProcessor\
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll.REMOVED.git-id b/build/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll.REMOVED.git-id
deleted file mode 100644
index 0dc5124b5..000000000
--- a/build/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-77bafe8ba867a1618b8735200289f6fad68b825e
\ No newline at end of file
diff --git a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets b/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets
deleted file mode 100644
index 875d7c4c8..000000000
--- a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-
-
- $(MSBuildExtensionsPath)\MSBuildCommunityTasks
- $(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm.REMOVED.git-id b/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm.REMOVED.git-id
deleted file mode 100644
index 0863f2d0f..000000000
--- a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.chm.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-e9cfb77efd964e4fb6659c0c2cc9bc934b7edb17
\ No newline at end of file
diff --git a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll.REMOVED.git-id b/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll.REMOVED.git-id
deleted file mode 100644
index 0c5894f4d..000000000
--- a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-3d1dbd357f5e4ae47bf017d4227811bd052b5347
\ No newline at end of file
diff --git a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml.REMOVED.git-id b/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml.REMOVED.git-id
deleted file mode 100644
index 7bdd152c5..000000000
--- a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-0ddc819937fec260f50b99350f7643feced88342
\ No newline at end of file
diff --git a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.xsd.REMOVED.git-id b/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.xsd.REMOVED.git-id
deleted file mode 100644
index c226e06db..000000000
--- a/build/MSBuildCommunityTasks/MSBuild.Community.Tasks.xsd.REMOVED.git-id
+++ /dev/null
@@ -1 +0,0 @@
-14f9e4c08f357d1b2f185dbe24df292ce74ef064
\ No newline at end of file
diff --git a/build/MSBuildCommunityTasks/Sample.proj b/build/MSBuildCommunityTasks/Sample.proj
deleted file mode 100644
index 3b52ad68c..000000000
--- a/build/MSBuildCommunityTasks/Sample.proj
+++ /dev/null
@@ -1,153 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- list = new List();
- list.Add("Happy");
- list.Add("New");
- list.Add("Year");
- Console.WriteLine("Hello MSBuild Community Scripting World.");
- foreach(string s in list)
- {
- Console.WriteLine(s);
- }
- }
- ]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build/build.ps1 b/build/build.ps1
index cacc9b196..f4dad22c3 100644
--- a/build/build.ps1
+++ b/build/build.ps1
@@ -1,45 +1,27 @@
Properties {
- $version = "2.0.1.0"
- $webversion = "4.0.0.0"
- $webconfigversion = "2.0.0.0"
- $webppluginversion = "1.0.1.0"
- $cairpluginversion = "1.0.0.0"
-
# Input and output paths
- $PROJ_PATH = Resolve-Path "."
+ $BUILD_PATH = Resolve-Path "."
$SRC_PATH = Resolve-Path "..\src"
- $NUSPECS_PATH = Join-Path $PROJ_PATH "NuSpecs"
- $BIN_PATH = Join-Path $PROJ_PATH "_BuildOutput"
+ $PLUGINS_PATH = Join-Path $SRC_PATH "Plugins\ImageProcessor"
+ $NUSPECS_PATH = Join-Path $BUILD_PATH "NuSpecs"
+ $BIN_PATH = Join-Path $BUILD_PATH "_BuildOutput"
$NUGET_OUTPUT = Join-Path $BIN_PATH "NuGets"
- $TEST_RESULTS = Join-Path $PROJ_PATH "TestResults"
+ $TEST_RESULTS = Join-Path $BUILD_PATH "TestResults"
# External binaries paths
$NUGET_EXE = Join-Path $SRC_PATH ".nuget\NuGet.exe"
$NUNIT_EXE = Join-Path $SRC_PATH "packages\NUnit.Runners.2.6.3\tools\nunit-console.exe"
$OPENCOVER_EXE = Join-Path $SRC_PATH "packages\OpenCover.4.5.3207\OpenCover.Console.exe"
$REPORTGEN_EXE = Join-Path $SRC_PATH "packages\ReportGenerator.1.9.1.0\ReportGenerator.exe"
- $NUNITREPORT_EXE = Join-Path $PROJ_PATH "NUnitHTMLReportGenerator.exe"
+ $NUNITREPORT_EXE = Join-Path $BUILD_PATH "tools\NUnitHTMLReportGenerator.exe"
# list of projects
- $BuildProjects = @(
- "Build.ImageProcessor.proj",
- "Build.ImageProcessor.Web.proj",
- "Build.ImageProcessor.Plugins.WebP.proj",
- "Build.ImageProcessor.Plugins.Cair.proj"
- )
+ [xml]$PROJECTS = Get-Content ".\build.xml"
$TestProjects = @(
"ImageProcessor.UnitTests",
"ImageProcessor.Web.UnitTests"
)
-
- $Nuspecs = @{
- "ImageProcessor.nuspec" = $version ;
- "ImageProcessor.Web.nuspec" = $webversion ;
- "ImageProcessor.Web.Config.nuspec" = $webconfigversion ;
- "ImageProcessor.Plugins.WebP.nuspec" = $webppluginversion ;
- "ImageProcessor.Plugins.Cair.nuspec" = $cairpluginversion
- }
}
Framework "4.0x86"
@@ -67,10 +49,22 @@ task Cleanup-Binaries {
task Build-Solution -depends Cleanup-Binaries {
Write-Host "Building projects"
- $BuildProjects | % {
- Write-Host "Building project $_"
+ # build the projects
+ $PROJECTS.projects.project | % {
+ if ($_.projfile -eq $null -or $_.projfile -eq "") {
+ return # breaks out of ForEach-Object loop
+ }
+
+ $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
+
+ # 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 {
- msbuild (Join-Path $PROJ_PATH $_) /p:BUILD_RELEASE="$version"
+ Invoke-Expression $buildCommand
}
}
}
@@ -86,11 +80,11 @@ task Build-Tests -depends Cleanup-Binaries {
# make sure the runner exes are restored
& $NUGET_EXE restore (Join-Path $SRC_PATH "ImageProcessor.sln")
- # build the test projects (they don't have specific build files like the main projects)
+ # build the test projects
$TestProjects | % {
Write-Host "Building project $_"
Exec {
- msbuild (Join-Path $SRC_PATH "$_\$_.csproj") /t:Build /p:Configuration=Release /p:Platform="AnyCPU" /p:Warnings=true /v:Normal /nologo
+ msbuild (Join-Path $SRC_PATH "$_\$_.csproj") /t:Build /p:Configuration=Release /p:Platform="AnyCPU" /p:Warnings=true /clp:WarningsOnly /clp:ErrorsOnly /v:Normal /nologo
}
}
@@ -143,16 +137,30 @@ task Generate-Package -depends Build-Solution {
}
# Package the nuget
- $Nuspecs.GetEnumerator() | % {
- $nuspec_local_path = (Join-Path $NUSPECS_PATH $_.Key)
+ $PROJECTS.projects.project | % {
+ $nuspec_local_path = (Join-Path $NUSPECS_PATH $_.nuspec)
Write-Host "Building Nuget package from $nuspec_local_path"
# change the version values
[xml]$nuspec_contents = Get-Content $nuspec_local_path
- $nuspec_contents.package.metadata.version = $_.Value
+ $nuspec_contents.package.metadata.version = $_.version
$nuspec_contents.Save($nuspec_local_path)
# pack the nuget
& $NUGET_EXE Pack $nuspec_local_path -OutputDirectory $NUGET_OUTPUT
}
+}
+
+# updates the AssemblyInfo file with the specified version
+# http://www.luisrocha.net/2009/11/setting-assembly-version-with-windows.html
+function Update-AssemblyInfo ([string]$file, [string] $version) {
+ $assemblyVersionPattern = 'AssemblyVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
+ $fileVersionPattern = 'AssemblyFileVersion\("[0-9]+(\.([0-9]+|\*)){1,3}"\)'
+ $assemblyVersion = 'AssemblyVersion("' + $version + '")';
+ $fileVersion = 'AssemblyFileVersion("' + $version + '")';
+
+ (Get-Content $file) | ForEach-Object {
+ % {$_ -replace $assemblyVersionPattern, $assemblyVersion } |
+ % {$_ -replace $fileVersionPattern, $fileVersion }
+ } | Set-Content $file
}
\ No newline at end of file
diff --git a/build/build.xml b/build/build.xml
new file mode 100644
index 000000000..98376c30b
--- /dev/null
+++ b/build/build.xml
@@ -0,0 +1,43 @@
+
+
+ ImageProcessor
+ 2.0.1.0
+ ..\src\ImageProcessor
+ ImageProcessor.csproj
+
+ ImageProcessor.nuspec
+
+
+
+ ImageProcessor Web
+ 4.0.0.0
+ ..\src\ImageProcessor.Web
+ ImageProcessor.Web.csproj
+
+ ImageProcessor.Web.nuspec
+
+
+
+ ImageProcessor Web.config sample
+ 2.0.0.0
+ ImageProcessor.Web.nuspec
+
+
+
+ ImageProcessor Cair plugin
+ 1.0.0.0
+ ..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.Cair
+ ImageProcessor.Plugins.Cair.csproj
+
+ ImageProcessor.Plugins.Cair.nuspec
+
+
+
+ ImageProcessor WebP plugin
+ 1.0.1.0
+ ..\src\Plugins\ImageProcessor\ImageProcessor.Plugins.WebP
+ ImageProcessor.Plugins.WebP.csproj
+
+ ImageProcessor.Plugins.WebP.nuspec
+
+
\ No newline at end of file
diff --git a/build/NUnitHTMLReportGenerator.exe.REMOVED.git-id b/build/tools/NUnitHTMLReportGenerator.exe.REMOVED.git-id
similarity index 100%
rename from build/NUnitHTMLReportGenerator.exe.REMOVED.git-id
rename to build/tools/NUnitHTMLReportGenerator.exe.REMOVED.git-id
diff --git a/build/NUnitHTMLReportGenerator.exe.config b/build/tools/NUnitHTMLReportGenerator.exe.config
similarity index 100%
rename from build/NUnitHTMLReportGenerator.exe.config
rename to build/tools/NUnitHTMLReportGenerator.exe.config