-
Notifications
You must be signed in to change notification settings - Fork 30
/
post-build.ps1
36 lines (32 loc) · 1.07 KB
/
post-build.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
$OutputDir = $args[0]
if (!$OutputDir) {
Write-Warning "Please specific output directory."
exit -1
}
# Write-Output $OutputDir
$SentryDllPath = Join-Path -Path $OutputDir -ChildPath "OsuPlayer.Sentry.dll"
# Write-Output $SentryDllPath
if (![System.IO.File]::Exists($SentryDllPath)) {
Write-Warning """$($SentryDllPath)"" does not exists. Skip!"
exit
}
try {
if (Get-Command "Confuser.CLI") {
$line =
"<project outputDir=""."" baseDir=""."" xmlns=""http://confuser.codeplex.com"">
<rule pattern=""true"" preset=""maximum"" inherit=""false"" />
<module path=""OsuPlayer.Sentry.dll"" />
</project>"
Write-Output $line
$tempProjPath = Join-Path -Path $OutputDir -ChildPath "confuser.crproj"
Out-File -FilePath $tempProjPath -InputObject $line
Confuser.CLI $tempProjPath -n
Remove-Item $tempProjPath
exit $LastExitCode
}
}
catch {
Write-Warning """Confuser.CLI"" is not in the environment path. Skip!
Latest release of ConfuserEX: https://github.com/mkaring/ConfuserEx/releases"
exit
}