-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathmono.releasebuild.ps1
56 lines (43 loc) · 2.37 KB
/
mono.releasebuild.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# ====================================================================================================
# See the releasebuild.ps1 script and mono-readme.txt for details - this script just builds using the MONO target.
# ====================================================================================================
Write-host "This script is TODO: Configuration=Mono is failing"
exit 1
$ErrorActionPreference = "Stop"
$zipFileName = "Roadkill.mono.1.7.zip"
# ---- Add the tool paths to our path
$runtimeDir = [System.Runtime.InteropServices.RuntimeEnvironment]::GetRuntimeDirectory()
$env:Path = $env:Path + $runtimeDir
$env:Path = $env:Path + ";C:\Program Files (x86)\IIS\Microsoft Web Deploy V3"
$env:Path = $env:Path + ";C:\Program Files\7-Zip"
# ---- Make sure the web.config file is the template one
copy -Force lib\Configs\web.dev.config src\Roadkill.site\web.config
# ---- Build the solution using the Mono target
msbuild roadkill.sln "/p:Configuration=Mono;DeployOnBuild=True;PackageAsSingleFile=False;AutoParameterizationWebConfigConnectionStrings=false;outdir=deploytemp\;OutputPath=bin\debug"
# ---- Use msdeploy to publish the website to disk
$currentDir = $(get-location).toString()
$packageSource = $currentDir +"\src\roadkill.site\obj\Mono\Package\PackageTmp\"
$packageDest = $currentDir + "\_WEBSITE"
msdeploy -verb:sync -source:contentPath=$packageSource -dest:contentPath=$packageDest
# ---- Copy licence + text files (skip)
# ---- Delete files that don't work on Apache/Mono
del _WEBSITE\bin\System.Web.dll
del _WEBSITE\bin\Microsoft.Web.Infrastructure.dll
del _WEBSITE\bin\Microsoft.Web.Administration.dll
# ---- Add Lightspeed files that are Mono specific
copy -Force lib\LightSpeed\Mindscape.LightSpeed.MetaData.dll _WEBSITE\bin
copy -Force lib\LightSpeed\Providers\log4net.dll _WEBSITE\bin
copy -Force lib\LightSpeed\Providers\Memcached.ClientLibrary.dll _WEBSITE\bin
# ---- Apache config
copy -Force lib\Configs\apache.txt _WEBSITE\
# ---- Zip up the folder (requires 7zip)
CD _WEBSITE
7z a $zipFileName
copy $zipFileName ..\$zipFileName
CD ..
# ---- Clean up the temporary deploy folders
Remove-Item -Force -Recurse _WEBSITE
Remove-Item -Force -Recurse src\Roadkill.Core\deploytemp
Remove-Item -Force -Recurse src\Roadkill.Site\deploytemp
Remove-Item -Force -Recurse src\Roadkill.Tests\deploytemp
"Mono release build complete."