Skip to content
Permalink
Browse files
Refactored package.ps1 to create two ZIP files instead of several.
  • Loading branch information
Jim Gomes committed Jun 18, 2009
1 parent a952f95 commit 57f9fa61ac67b4ed72d2db481e10907e4e006ee1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 52 deletions.
@@ -502,6 +502,7 @@
<delete dir="build" if="${directory::exists('build')}" />
<delete dir="obj" if="${directory::exists('obj')}" />
<delete dir="lib" if="${directory::exists('lib')}" />
<delete dir="package" if="${directory::exists('package')}" />
</target>

<target name="doc" depends="compile">
@@ -18,71 +18,44 @@ $pkgver = "1.2.0"
$configurations = "release", "debug"
$frameworks = "mono-2.0", "net-1.1", "net-2.0", "net-3.5", "netcf-2.0"

function package-legalfiles($zipfile)
{
zip -9 -u -j "$zipfile" ..\LICENSE.txt
zip -9 -u -j "$zipfile" ..\NOTICE.txt
}

write-progress "Creating package directory." "Initializing..."
if(!(test-path package))
{
md package
}

pushd build

$pkgdir = "..\package"

write-progress "Packaging Application files." "Scanning..."
foreach($configuration in $configurations)
if(test-path build)
{
$zipfile = "$pkgdir\$pkgname-$pkgver-bin-$configuration.zip"
package-legalfiles $zipfile
foreach($framework in $frameworks)
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.dll"
}
}
pushd build

write-progress "Packaging PDB files." "Scanning..."
foreach($configuration in $configurations)
{
$zipfile = "$pkgdir\$pkgname-$pkgver-PDBs-$configuration.zip"
package-legalfiles $zipfile
foreach($framework in $frameworks)
{
if($framework -ieq "mono-2.0")
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.dll.mdb"
}
else
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.pdb"
}
}
}
$pkgdir = "..\package"

write-progress "Packaging Unit test files." "Scanning..."
foreach($configuration in $configurations)
{
$zipfile = "$pkgdir\$pkgname-$pkgver-UnitTests-$configuration.zip"
package-legalfiles $zipfile
foreach($framework in $frameworks)
write-progress "Packaging Application files." "Scanning..."
$zipfile = "$pkgdir\$pkgname-$pkgver-bin.zip"
zip -9 -u -j "$zipfile" ..\LICENSE.txt
zip -9 -u -j "$zipfile" ..\NOTICE.txt
foreach($configuration in $configurations)
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.dll"
if($framework -ieq "mono-2.0")
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.dll.mdb"
}
else
foreach($framework in $frameworks)
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.pdb"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.dll"
zip -9 -u "$zipfile" "$framework\$configuration\nmsprovider*.config"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.dll"
if($framework -ieq "mono-2.0")
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.dll.mdb"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.dll.mdb"
}
else
{
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.pdb"
zip -9 -u "$zipfile" "$framework\$configuration\$pkgname.Test.pdb"
}
}
}
}

popd
popd
}

write-progress "Packaging Source code files." "Scanning..."
$pkgdir = "package"
@@ -91,4 +64,4 @@ $zipfile = "$pkgdir\$pkgname-$pkgver-src.zip"
zip -9 -u "$zipfile" LICENSE.txt NOTICE.txt nant-common.xml nant.build package.ps1 vs2008-nms-test.csproj vs2008-nms.csproj vs2008-nms.sln
zip -9 -u -r "$zipfile" keyfile src

write-progress "Packaging" "Complete."
write-progress -Completed "Packaging" "Complete."

0 comments on commit 57f9fa6

Please sign in to comment.