Browse Source

A poor man's attempt at powershell

Former-commit-id: 16299f097898120fc12e1998872db7316fa8007d
af/merge-core
James South 12 years ago
parent
commit
c3a2d51171
  1. 11
      build/NuSpecs/ImageProcessor.nuspec
  2. 12
      build/tools/imageprocessor.ps1
  3. 11
      build/tools/install.ps1
  4. 9
      build/tools/uninstall.ps1

11
build/NuSpecs/ImageProcessor.nuspec

@ -22,11 +22,16 @@ Feedback is always welcome.</description>
<copyright>James South</copyright> <copyright>James South</copyright>
<language>en-GB</language> <language>en-GB</language>
<tags>Image Imaging ASP Performance Processing Resize AutoRotate Rotate RoundedCorners Flip Crop Filter Effects Quality Watermark Alpha Vignette Saturation Brightness Contrast Gif Jpg Jpeg Bitmap Png Fluent GDI Gaussian Blur Sharpen Tint Quantizer Animated EXIF</tags> <tags>Image Imaging ASP Performance Processing Resize AutoRotate Rotate RoundedCorners Flip Crop Filter Effects Quality Watermark Alpha Vignette Saturation Brightness Contrast Gif Jpg Jpeg Bitmap Png Fluent GDI Gaussian Blur Sharpen Tint Quantizer Animated EXIF</tags>
<references>
<reference file="ImageProcessor.dll"/>
</references>
</metadata> </metadata>
<files> <files>
<file src="..\_BuildOutput\ImageProcessor\lib\ImageProcessor.dll" target="lib\ImageProcessor.dll" /> <file src="..\_BuildOutput\ImageProcessor\lib\ImageProcessor.dll" target="lib\ImageProcessor.dll" />
<file src="..\_BuildOutput\ImageProcessor\lib\x86\libwebp.dll" target="build\native\lib\x86\libwebp.dll" /> <file src="..\_BuildOutput\ImageProcessor\lib\x86\libwebp.dll" target="lib\x86\libwebp.dll" />
<file src="..\_BuildOutput\ImageProcessor\lib\x64\libwebp.dll" target="build\native\lib\x64\libwebp.dll" /> <file src="..\_BuildOutput\ImageProcessor\lib\x64\libwebp.dll" target="lib\x64\libwebp.dll" />
<file src="..\content\ImageProcessor\imageprocessor.targets" target="build\native\imageprocessor.targets" /> <file src="..\tools\install.ps1" target="tools\install.ps1" />
<file src="..\tools\uninstall.ps1" target="tools\uninstall.ps1" />
<file src="..\tools\imageprocessor.ps1" target="tools\imagprocessor.ps1" />
</files> </files>
</package> </package>

12
build/tools/imageprocessor.ps1

@ -0,0 +1,12 @@
$solutionDir = [System.IO.Path]::GetDirectoryName($dte.Solution.FullName) + "\"
$path = $installPath.Replace($solutionDir, "`$(SolutionDir)")
$NativeAssembliesDir = Join-Path $path "lib"
$x86 = $(Join-Path $NativeAssembliesDir "x86\*.*")
$x64 = $(Join-Path $NativeAssembliesDir "x64\*.*")
$ImageProcessorPostBuildCmd = "
if not exist `"`$(TargetDir)x86`" md `"`$(TargetDir)x86`"
xcopy /s /y `"$x86`" `"`$(TargetDir)x86`"
if not exist `"`$(TargetDir)amd64`" md `"`$(TargetDir)x64`"
xcopy /s /y `"$x64`" `"`$(TargetDir)x64`""

11
build/tools/install.ps1

@ -0,0 +1,11 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath "imageprocessor.ps1")
# Get the current Post Build Event cmd
$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value
# Append our post build command if it's not already there
if (!$currentPostBuildCmd.Contains($ImageProcessorPostBuildCmd)) {
$project.Properties.Item("PostBuildEvent").Value += $ImageProcessorPostBuildCmd
}

9
build/tools/uninstall.ps1

@ -0,0 +1,9 @@
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath "imageprocessor.ps1")
# Get the current Post Build Event cmd
$currentPostBuildCmd = $project.Properties.Item("PostBuildEvent").Value
# Remove our post build command from it (if it's there)
$project.Properties.Item("PostBuildEvent").Value = $currentPostBuildCmd.Replace($ImageProcessorPostBuildCmd, "")
Loading…
Cancel
Save