-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuildWindows.ps1
40 lines (33 loc) · 1.27 KB
/
buildWindows.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
# Step 1: Build the Flutter Windows application
Write-Host "Building Flutter Windows app..."
flutter build windows
# Define the source files and destination directory
# Adjust these paths according to your project's structure
$sourceFiles = @(
".\windows\pactus-daemon.exe",
".\windows\pactus-wallet.exe"
)
$destinationDir = ".\build\windows\x64\runner\Debug" # Adjust based on your build configuration
$releaseDestinationDir = ".\build\windows\x64\runner\Release" # Adjust based on your build configuration
# Function to copy files to a destination
function Copy-Files {
param (
[string]$destinationDir
)
# Ensure the destination directory exists
if (-not (Test-Path -Path $destinationDir)) {
Write-Host "Destination directory does not exist: $destinationDir"
return
}
# Copy each source file to the destination directory
foreach ($file in $sourceFiles) {
Write-Host "Copying $file to $destinationDir"
Copy-Item -Path $file -Destination $destinationDir
}
}
# Step 2: Copy files to Debug and Release directories
Copy-Files -destinationDir $destinationDir
Copy-Files -destinationDir $releaseDestinationDir
# Step 3: Run the Flutter Windows app
Write-Host "Running Flutter Windows app..."
flutter run -d windows