Merge pull request #9 from HavretGC/fix_ps_script

AMQNET-588 Solution clean up
diff --git a/package.ps1 b/package.ps1
index 4059091..21ffb7a 100644
--- a/package.ps1
+++ b/package.ps1
@@ -20,7 +20,8 @@
 write-progress "Creating package directory." "Initializing..."

 if (!(test-path package)) {

     mkdir package

-} else {

+}

+else {

     # Clean package content if exists

     Remove-Item package\* -Recurse

 }

@@ -33,16 +34,27 @@
     write-progress "Packaging Application files." "Scanning..."

     $zipfile = "$pkgdir\$pkgname-$pkgver-bin.zip"

 

-    Compress-Archive -Path ..\LICENSE.txt, ..\NOTICE.txt -Update -DestinationPath $zipfile    

+    Compress-Archive -Path ..\LICENSE.txt, ..\NOTICE.txt -Update -DestinationPath $zipfile        

     

+    # clean up temp

+    Remove-Item temp -Recurse -ErrorAction Ignore

+

     foreach ($framework in $frameworks) {

-        Compress-Archive -Path $framework -Update -DestinationPath $zipfile

+        Copy-Item $framework -Destination temp\$framework -Recurse

+

+        # clean up third party binaries

+        Get-ChildItem temp -File -Exclude "*Apache.NMS*" -Recurse | Remove-Item -Recurse

+

+        Compress-Archive -Path "temp\$framework" -Update -DestinationPath $zipfile

     }

     

     $nupkg = "$pkgname.$pkgver.nupkg"

     $nupkgdestination = "$pkgdir\$nupkg"

     Copy-Item -Path $nupkg -Destination $nupkgdestination

 

+    # clean up temp

+    Remove-Item temp -Recurse -ErrorAction Inquire

+

     Pop-Location

 }

 

@@ -54,8 +66,8 @@
 Remove-Item temp -Recurse -ErrorAction Ignore

 

 # copy files to temp dir

-Copy-Item src\* -Destination temp\src -Recurse

-Copy-Item test\* -Destination temp\test -Recurse

+Copy-Item src -Destination temp\src -Recurse

+Copy-Item test -Destination temp\test -Recurse

 

 # clean up debug artifacts if there are any

 Get-ChildItem temp -Include bin, obj -Recurse | Remove-Item -Recurse