-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCopyToGameFolder.ps1
More file actions
95 lines (82 loc) · 3.14 KB
/
Copy pathCopyToGameFolder.ps1
File metadata and controls
95 lines (82 loc) · 3.14 KB
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
#!powershell.exe -ExecutionPolicy Bypass -File
param (
[string] $Configuration,
[string] $Mode
)
# Require Configuration
if (-not $Configuration -or ($Configuration -ne "Debug" -and $Configuration -ne "Release") -or -not $Mode -or ($Mode -ne "coop" -and $Mode -ne "pvp"))
{
Write-Host "Usage: .\CopyToGameFolder.ps1 -Configuration <Debug|Release> -Mode <coop|pvp>"
Exit 1
}
$Mods = @('Sdk')
# Bring in Get-ModFiles + CopyFiles
. ./BuildInfo.ps1
# Destination under Roaming AppData
$destRoot = Join-Path $env:APPDATA "ReadyM.Launcher/WukongMP/CSharpLoader"
# Build the combined dev file triplets across variants
$allDevFiles = @()
foreach ($p in $Mods)
{
$lists = Get-ModFiles -Mod $p -Configuration $Configuration
$allDevFiles += $lists.Dev
}
if ($Mode -eq "coop")
{
$allDevFiles += @(
@(@("WukongMp.Coop.dll"), "WukongMP-co-op-mod/WukongMp.Coop/bin/$Configuration/netstandard2.0", "Mods/WukongMp.Coop"),
@(@("WukongMp.Coop.Common.dll"), "WukongMP-co-op-mod/WukongMp.Coop/bin/$Configuration/netstandard2.0", "Mods/WukongMp.Coop"),
@(@("manifest.json"), "WukongMP-co-op-mod/Content", "Mods/WukongMp.Coop"),
@(@("ArchiveSaveFile.1.sav"), "WukongMP-co-op-mod/Content", "Mods/WukongMp.Coop")
)
if ($Configuration -eq "Debug")
{
$allDevFiles += @(
@(@("WukongMp.Coop.pdb"), "WukongMP-co-op-mod/WukongMp.Coop/bin/Debug/netstandard2.0", "Mods/WukongMp.Coop"),
@(@("WukongMp.Coop.Common.pdb"), "WukongMP-co-op-mod/WukongMp.Coop/bin/Debug/netstandard2.0", "Mods/WukongMp.Coop")
)
}
}
else
{
$allDevFiles += @(
@(@("WukongMp.Pvp.dll"), "WukongMP-PvP-mod/WukongMp.PvP/bin/$Configuration/netstandard2.0", "Mods/WukongMp.Pvp"),
@(@("manifest.json"), "WukongMP-PvP-mod/Content", "Mods/WukongMp.Pvp"),
@(@("ArchiveSaveFile.0.sav"), "WukongMP-PvP-mod/Content", "Mods/WukongMp.Pvp"),
@(@("ArchiveSaveFile.1.sav"), "WukongMP-PvP-mod/Content", "Mods/WukongMp.Pvp"),
@(@("ArchiveSaveFile.2.sav"), "WukongMP-PvP-mod/Content", "Mods/WukongMp.Pvp")
)
if ($Configuration -eq "Debug")
{
$allDevFiles += @(
,@(@("WukongMp.Pvp.pdb"), "WukongMP-PvP-mod/WukongMp.Pvp/bin/Debug/netstandard2.0", "Mods/WukongMp.Pvp")
)
}
}
if ($Configuration -eq "Debug")
{
$allDevFiles += @(
@(@("WukongMp.Api.pdb"), "WukongMp.Sdk/bin/Debug/netstandard2.0", "Mods/WukongMp.Sdk"),
@(@("WukongMp.Sdk.pdb"), "WukongMp.Sdk/bin/Debug/netstandard2.0", "Mods/WukongMp.Sdk")
)
}
# (Optional) de-dup identical triplets if desired
# $allDevFiles = $allDevFiles | Sort-Object { "$($_[1])|$($_[2])|$($_[0] -join ',')" } -Unique
# Pre-create destination directories
foreach ($item in $allDevFiles)
{
$destDir = Join-Path $destRoot $item[2]
if (-not (Test-Path $destDir))
{
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
}
}
# Perform copies
foreach ($item in $allDevFiles)
{
$files = $item[0]
$sourceDir = $item[1]
$destDir = Join-Path $destRoot $item[2]
CopyFiles $files $sourceDir $destDir
}
Write-Output "Copied developer files for: $( $ModVariants -join ', ' ) to $destRoot"