1
+ param
2
+ (
3
+ [Parameter (Mandatory = $true )] [string ] $Arch
4
+ )
5
+
1
6
$ErrorPreference = ' Stop'
2
7
$ProgressPreference = ' SilentlyContinue'
3
8
Add-Type - AssemblyName System.IO.Compression, System.IO.Compression.FileSystem
4
9
10
+ Write-Host " === Start $Arch ==="
11
+
5
12
$root = Split-Path - Path $PSScriptRoot - Parent
6
13
7
- $publishDir = " $root \publish "
14
+ $publishDir = " $root \$Arch "
8
15
if (Test-Path $publishDir ) {
9
16
[System.IO.Directory ]::Delete($publishDir , $true ) | Out-Null
10
17
}
11
18
12
- $buildDir = " $root \publish\build"
13
-
14
- function Start-Publish
15
- {
16
- if (Test-Path $buildDir ) {
17
- [System.IO.Directory ]::Delete($buildDir , $true ) | Out-Null
18
- }
19
- [System.IO.Directory ]::CreateDirectory($buildDir ) | Out-Null
19
+ $buildDir = " $root \$Arch \build"
20
+ if (Test-Path $buildDir ) {
21
+ [System.IO.Directory ]::Delete($buildDir , $true ) | Out-Null
20
22
}
23
+ [System.IO.Directory ]::CreateDirectory($buildDir ) | Out-Null
21
24
22
25
$downloadsDir = " $root \downloads"
23
26
[System.IO.Directory ]::CreateDirectory($downloadsDir ) | Out-Null
24
27
25
- $bundleDir = " $root \publish\bundle"
26
- if (Test-Path $bundleDir ) {
27
- [System.IO.Directory ]::Delete($bundleDir , $true ) | Out-Null
28
- }
28
+ $bundleDir = " $root \bundle"
29
29
[System.IO.Directory ]::CreateDirectory($bundleDir ) | Out-Null
30
30
31
31
# Windows SDK
@@ -52,11 +52,6 @@ if (Test-Path $makepri) {
52
52
53
53
function Publish-App
54
54
{
55
- param
56
- (
57
- [Parameter (Mandatory = $true )] [string ] $Arch
58
- )
59
-
60
55
Write-Host " Publishing $Arch ."
61
56
dotnet publish " $root /src/J.App/J.App.csproj" -- output " $buildDir " -- self- contained -- runtime " win-$Arch " -- configuration Release -- verbosity quiet
62
57
Remove-Item - Path " $dir \*.pdb" - Force
@@ -76,7 +71,7 @@ function Get-FfmpegX64
76
71
}
77
72
78
73
Write-Host " Extracting ffmpeg/x64."
79
- $dstDir = " $buildDir \x64\ ffmpeg\"
74
+ $dstDir = " $buildDir \ffmpeg\"
80
75
[System.IO.Directory ]::CreateDirectory($dstDir ) | Out-Null
81
76
[System.IO.Compression.ZipFile ]::ExtractToDirectory($zipFilePath , $dstDir )
82
77
@@ -107,7 +102,7 @@ function Get-FfmpegArm64
107
102
}
108
103
109
104
Write-Host " Extracting ffmpeg/arm64."
110
- $dstDir = " $buildDir \arm64\ ffmpeg\"
105
+ $dstDir = " $buildDir \ffmpeg\"
111
106
[System.IO.Directory ]::CreateDirectory($dstDir ) | Out-Null
112
107
[System.IO.Compression.ZipFile ]::ExtractToDirectory($zipFilePath , $dstDir )
113
108
@@ -117,11 +112,6 @@ function Get-FfmpegArm64
117
112
118
113
function Copy-MiscFiles
119
114
{
120
- param
121
- (
122
- [Parameter (Mandatory = $true )] [string ] $Arch
123
- )
124
-
125
115
Copy-Item - Path " $root \COPYING" - Destination " $buildDir \COPYING"
126
116
Copy-Item - Path " $root \NOTICE" - Destination " $buildDir \NOTICE"
127
117
@@ -167,11 +157,6 @@ function Copy-MiscFiles
167
157
168
158
function New-Msix
169
159
{
170
- param
171
- (
172
- [Parameter (Mandatory = $true )] [string ] $Arch
173
- )
174
-
175
160
Write-Host " Creating MSIX package."
176
161
$msixFilePath = " $bundleDir \Jackpot-$Arch .msix"
177
162
if (Test-Path $msixFilePath ) { Remove-Item - Path $msixFilePath - Force }
@@ -183,26 +168,13 @@ function New-Msix
183
168
Write-Host " --- End: MakeAppx pack ---`n "
184
169
}
185
170
186
- Write-Host " === x64 build ==="
187
- Start-Publish
188
- Copy-MiscFiles - Arch " x64"
189
- Publish-App - Arch " x64"
190
- Get-FfmpegX64
191
- New-Msix - Arch " x64"
192
-
193
- Write-Host " === arm64 build ==="
194
- Start-Publish
195
- Copy-MiscFiles - Arch " arm64"
196
- Publish-App - Arch " arm64"
197
- Get-FfmpegArm64
198
- New-Msix - Arch " arm64"
199
-
200
- Write-Host " === msixbundle ==="
201
- $msixBundleFilePath = " $root \publish\Jackpot.msixbundle"
202
- if (Test-Path $msixBundleFilePath ) { Remove-Item - Path $msixBundleFilePath - Force }
203
- Write-Host " `n --- Start: MakeAppx bundle ---"
204
- & " $makeappx " bundle / p " $msixBundleFilePath " / d " $bundleDir "
205
- if ($LastExitCode -ne 0 ) {
206
- throw " Failed to create MSIX bundle."
171
+ Copy-MiscFiles
172
+ Publish-App
173
+ if ($Arch -eq " x64" ) {
174
+ Get-FfmpegX64
175
+ } elseif ($Arch -eq " arm64" ) {
176
+ Get-FfmpegArm64
207
177
}
208
- Write-Host " --- End: MakeAppx bundle ---`n "
178
+ New-Msix
179
+
180
+ Write-Host " === End $Arch ==="
0 commit comments