forked from devkeydet/PrepareSelfContainedSolutionForExport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.ps1
29 lines (24 loc) · 1.23 KB
/
pack.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function Pack ($solutionName) {
$packTemp = "pack-temp"
$vsSolutionPath = "./src/SelfContainedSolutionTest/code-first"
$unpackFolder = "src/$solutionName/unpacked-solution"
$solutionZip = "$packTemp/$solutionName.zip"
$unPackTemp = "$packTemp/u"
if (Test-Path $unPackTemp) {
Remove-Item "$unPackTemp/*" -Recurse -Force
}
else {
New-Item -Path $unPackTemp -ItemType Directory
}
Copy-Item "$unpackFolder/*" $unPackTemp -Recurse -Force
# need to delete _msapp folder before packing
$msappUnpackPath = (Get-ChildItem "$unPackTemp/CanvasApps/*_msapp")[0].FullName
Remove-Item $msappUnpackPath -Force -Recurse
$source = "$vsSolutionPath/Plugins/bin/Release/SelfContainedSolutionTest.Plugins.dll"
$destination = "$unpackFolder/PluginAssemblies/SelfContainedSolutionTestPlugins-BB2613D0-D86D-4460-B4EE-6042046E2ED9/SelfContainedSolutionTestPlugins.dll"
Copy-Item $source $destination -Force
#pac solution pack --zipfile $solutionZip --folder $unPackTemp --packagetype both
pac solution pack --zipfile $solutionZip --folder $unPackTemp --packagetype unmanaged
pac solution pack --zipfile $solutionZip.Replace(".zip","_managed.zip") --folder $unPackTemp --packagetype managed
}
Pack "SelfContainedSolutionTest"