[mapguide-commits] r9093 - sandbox/jng/diet_v2/MgDev/nuget

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Nov 21 07:18:33 PST 2016


Author: jng
Date: 2016-11-21 07:18:33 -0800 (Mon, 21 Nov 2016)
New Revision: 9093

Modified:
   sandbox/jng/diet_v2/MgDev/nuget/make-nuget.ps1
Log:
Add missing:
 - cs-map-dictionaries preparation
 - nuspec templating
 - nuget package creation

Modified: sandbox/jng/diet_v2/MgDev/nuget/make-nuget.ps1
===================================================================
--- sandbox/jng/diet_v2/MgDev/nuget/make-nuget.ps1	2016-11-21 14:23:15 UTC (rev 9092)
+++ sandbox/jng/diet_v2/MgDev/nuget/make-nuget.ps1	2016-11-21 15:18:33 UTC (rev 9093)
@@ -38,11 +38,13 @@
     [Int]$rev = 0
 )
 
+$fullVer = "$major.$minor.$patch.$rev"
+
 Write-Host "CPU: $cpu"
 Write-Host "mg-desktop base dir: $desktopBaseDir"
 Write-Host "cs-map base dir: $csMapBaseDir"
 Write-Host "web bin base dir: $webBinDir"
-Write-Host "Version: $major.$minor.$patch.$rev"
+Write-Host "Version: $fullVer"
 
 Function Prepare-Staging {
     Param(
@@ -53,7 +55,7 @@
         [string[]]$libFileList
     )
 
-    Write-Host "Copy $packageName files to nuget staging"
+    Write-Host "[prepare]: Copy $packageName files to nuget staging"
     $destinationFolder = ".\$cpu\$packageName\$contentDirName"
     if (!(Test-Path -path $destinationFolder)) {
         New-Item $destinationFolder -Type Directory | Out-Null
@@ -111,7 +113,7 @@
 Prepare-Staging "api-web" "mapguide-api-web" $webBinDir $webFileSetContent $webFileSetLibs
 
 # api-desktop
-Write-Host "Copy api-desktop files to nuget staging"
+Write-Host "[prepare]: Copy api-desktop files to nuget staging"
 $destDir = ".\$cpu\api-desktop\mg-desktop"
 if (!(Test-Path -path $destDir)) {
     New-Item $destDir -Type Directory | Out-Null
@@ -139,3 +141,39 @@
     "OSGeo.MapGuide.Viewer.xml"
 )
 Prepare-Staging "api-desktop-viewer" "" $desktopBaseDir $viewerFileSetContent $viewerFileSetLibs
+
+#cs-map-dictionaries
+Write-Host "[prepare]: Copy cs-map-dictionaries files to nuget staging"
+$destDir = ".\cs-map-dicts\dictionaries"
+if (!(Test-Path -path $destDir)) {
+    New-Item $destDir -Type Directory | Out-Null
+}
+Copy-Item -Path "$csMapBaseDir\*.CSD" $destDir -Force
+Copy-Item -Path "$csMapBaseDir\*.gdc" $destDir -Force
+Copy-Item -Path "$csMapBaseDir\*.txt" $destDir -Force
+Copy-Item -Path "$csMapBaseDir\OSTN02._02" $destDir -Force
+Copy-Item -Path "$csMapBaseDir\OSTN97._nt" $destDir -Force
+Copy-Item -Path "$csMapBaseDir\*.csv" $destDir -Force
+
+# Write out templated nuspec files, plugging in the version number
+$nuspecFiles = @(
+    "mapguide-api-base",
+    "mapguide-api-web",
+    "mg-desktop",
+    "mg-desktop-viewer",
+    "cs-map-dictionaries"
+)
+foreach ($nuspec in $nuspecFiles) {
+    if (Test-Path -path $nuspec) {
+        Remove-Item -Path $nuspec
+    }
+    $tpl = ".\$nuspec.nuspec.tpl"
+    Write-Host "[prepare]: $nuspec"
+    (Get-Content $tpl).Replace("MG_CPU", $cpu).Replace("MG_VERSION", $fullVer) | Set-Content ".\$nuspec-$cpu.nuspec"
+}
+
+& .\NuGet.exe pack ".\mapguide-api-base-$cpu.nuspec" -BasePath "$cpu\api-base"
+& .\NuGet.exe pack ".\mapguide-api-web-$cpu.nuspec" -BasePath "$cpu\api-web"
+& .\NuGet.exe pack ".\mg-desktop-$cpu.nuspec" -BasePath "$cpu\api-desktop"
+& .\NuGet.exe pack ".\mg-desktop-viewer-$cpu.nuspec" -BasePath "$cpu\api-desktop-viewer"
+& .\NuGet.exe pack ".\cs-map-dictionaries-$cpu.nuspec" -BasePath cs-map-dicts
\ No newline at end of file



More information about the mapguide-commits mailing list