-
Notifications
You must be signed in to change notification settings - Fork 201
/
build-release.ps1
129 lines (96 loc) · 6.13 KB
/
build-release.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env pwsh
$ErrorActionPreference = "Stop"
$CURRENTPATH=$pwd.Path
# /p:Configuration="Debug", "Debug-DrawingCompat", "Release", "Release-DrawingCompat"
$pConfiguration="Release"
$pTargetFramework="net8.0-windows"
function delete_files([string]$path)
{
If (Test-Path $path){
Write-Host "Deleting path $path" -ForegroundColor Green
Remove-Item -recurse -force $path
}
}
function GetVersions([ref]$theVersion)
{
$csprojPath = Join-Path $CURRENTPATH ".\Directory.Build.props"
$xml = [xml](Get-Content $csprojPath)
$theVersion.Value = $xml.Project.PropertyGroup.Version
}
Get-ChildItem .\ -include bin,obj,build-output -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }
$Version=""
GetVersions([ref]$Version)
Write-Host $Version
dotnet restore "./MajorsilenceReporting.sln"
# ************* Begin anycpu *********************************************
dotnet build "$CURRENTPATH\MajorsilenceReporting.sln" --configuration $pConfiguration --verbosity minimal
$buildoutputpath_designer="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-designer-$pTargetFramework-anycpu"
$buildoutputpath_desktop="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-desktop-$pTargetFramework-anycpu"
$buildoutputpath_rdlcmd="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-rdlcmd-$pTargetFramework-anycpu"
$buildoutputpath_viewer="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-viewer-$pTargetFramework-anycpu"
$buildoutputpath_mapfile="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-mapfile-$pTargetFramework-anycpu"
Remove-Item "$buildoutputpath_designer" -Recurse -ErrorAction Ignore
mkdir "$buildoutputpath_designer"
Remove-Item "$buildoutputpath_desktop" -Recurse -ErrorAction Ignore
mkdir "$buildoutputpath_desktop"
Remove-Item "$buildoutputpath_rdlcmd" -Recurse -ErrorAction Ignore
mkdir "$buildoutputpath_rdlcmd"
Remove-Item "$buildoutputpath_viewer" -Recurse -ErrorAction Ignore
mkdir "$buildoutputpath_viewer"
Remove-Item "$buildoutputpath_mapfile" -Recurse -ErrorAction Ignore
mkdir "$buildoutputpath_mapfile"
Copy-Item .\RdlDesign\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_designer\" -Recurse
Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_desktop\" -Recurse
Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_rdlcmd\" -Recurse
Copy-Item .\RdlViewer\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_viewer\" -Recurse
Copy-Item .\RdlMapFile\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_mapfile\" -Recurse
cd Release-Builds
cd build-output
..\7za.exe a -tzip $Version-majorsilence-reporting-designer-$pTargetFramework-anycpu.zip majorsilence-reporting-designer-$pTargetFramework-anycpu\
..\7za.exe a -tzip $Version-majorsilence-reporting-desktop-$pTargetFramework-anycpu.zip majorsilence-reporting-desktop-$pTargetFramework-anycpu\
..\7za.exe a -tzip $Version-majorsilence-reporting-rdlcmd-$pTargetFramework-anycpu.zip majorsilence-reporting-rdlcmd-$pTargetFramework-anycpu\
..\7za.exe a -tzip $Version-majorsilence-reporting-viewer-$pTargetFramework-anycpu.zip majorsilence-reporting-viewer-$pTargetFramework-anycpu\
..\7za.exe a -tzip $Version-majorsilence-reporting-mapfile-$pTargetFramework-anycpu.zip majorsilence-reporting-mapfile-$pTargetFramework-anycpu\
cd "$CURRENTPATH"
# ************* End anycpu *********************************************
# ************* Begin PHP *********************************************
$buildoutputpath_php="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-php"
delete_files "$buildoutputpath_php"
mkdir "$buildoutputpath_php"
Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\config.xml "$buildoutputpath_php\config.xml"
Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_php\" -Recurse
Copy-Item ".\LanguageWrappers\php\config.php" "$buildoutputpath_php\config.php"
Copy-Item ".\LanguageWrappers\php\report.php" "$buildoutputpath_php\report.php"
cd Release-Builds
cd build-output
..\7za.exe a -tzip $Version-majorsilence-reporting-build-php.zip majorsilence-reporting-php\
cd "$CURRENTPATH"
# ************* End PHP *********************************************
# ************* Begin Python *********************************************
$buildoutputpath_python="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-python"
delete_files "$buildoutputpath_python"
mkdir "$buildoutputpath_python"
Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\config.xml "$buildoutputpath_python\config.xml"
Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_python\" -Recurse
Copy-Item ".\LanguageWrappers\python\config.py" "$buildoutputpath_python\config.py"
Copy-Item ".\LanguageWrappers\python\report.py" "$buildoutputpath_python\report.py"
cd Release-Builds
cd build-output
..\7za.exe a -tzip $Version-majorsilence-reporting-python.zip majorsilence-reporting-python\
cd "$CURRENTPATH"
# ************* End Python *********************************************
# ************* Begin Ruby *********************************************
$buildoutputpath_ruby="$CURRENTPATH\Release-Builds\build-output\majorsilence-reporting-ruby"
delete_files "$buildoutputpath_ruby"
mkdir "$buildoutputpath_ruby"
Copy-Item .\RdlDesktop\bin\$pConfiguration\$pTargetFramework\config.xml "$buildoutputpath_ruby\config.xml"
Copy-Item .\RdlCmd\bin\$pConfiguration\$pTargetFramework\ -Destination "$buildoutputpath_ruby\" -Recurse
Copy-Item ".\LanguageWrappers\ruby\config.rb" "$buildoutputpath_ruby\config.rb"
Copy-Item ".\LanguageWrappers\ruby\report.rb" "$buildoutputpath_ruby\report.rb"
cd Release-Builds
cd build-output
..\7za.exe a -tzip $Version-majorsilence-reporting-ruby.zip majorsilence-reporting-ruby\
cd "$CURRENTPATH"
# ************* End Ruby *********************************************
# ************* Nuget ************************************************
Get-ChildItem -Recurse -Exclude "$CURRENTPATH\Release-Builds\build-output" .\*.nupkg | Copy-Item -Destination "$CURRENTPATH\Release-Builds\build-output" -Force -ErrorAction SilentlyContinue