1
+ param ([string ] $TargetPlatform , [string ] $TargetName , [string ] $TargetType , [string ] $ProjectPath , [string ] $PluginPath )
2
+
3
+ $ProjectBinariesPath = " $ProjectPath \Binaries\$TargetPlatform "
4
+ $PluginBinariesPath = " $PluginPath \Source\ThirdParty\$TargetPlatform "
5
+ $ConfigPath = " $ProjectPath \Config"
6
+
7
+ Write-Host " Sentry: Start debug symbols upload"
8
+
9
+ If ($TargetType -eq " Editor" )
10
+ {
11
+ Write-Host " Sentry: Automatic symbols upload is not required for Editor target. Skipping..."
12
+ Exit
13
+ }
14
+
15
+ If ($TargetPlatform -eq " Win64" )
16
+ {
17
+ $CliExec = " $PluginPath \Source\ThirdParty\CLI\sentry-cli-Windows-x86_64.exe"
18
+ }
19
+ Else
20
+ {
21
+ Write-Warning " Sentry: Unexpected platform $TargetPlatform . Skipping..."
22
+ Exit
23
+ }
24
+
25
+ function ParseIniFile
26
+ {
27
+ param ([parameter (Mandatory = $true )] [string ] $filePath )
28
+
29
+ $anonymous = " NoSection"
30
+
31
+ $ini = @ {}
32
+ switch - regex - file $filePath
33
+ {
34
+ " ^\[(.+)\]$" # Section
35
+ {
36
+ $section = $matches [1 ]
37
+ $ini [$section ] = @ {}
38
+ $CommentCount = 0
39
+ }
40
+
41
+ " ^(;.*)$" # Comment
42
+ {
43
+ if (! ($section ))
44
+ {
45
+ $section = $anonymous
46
+ $ini [$section ] = @ {}
47
+ }
48
+ $value = $matches [1 ]
49
+ $CommentCount = $CommentCount + 1
50
+ $name = " Comment" + $CommentCount
51
+ $ini [$section ][$name ] = $value
52
+ }
53
+
54
+ " (.+?)\s*=\s*(.*)" # Key
55
+ {
56
+ if (! ($section ))
57
+ {
58
+ $section = $anonymous
59
+ $ini [$section ] = @ {}
60
+ }
61
+ $name , $value = $matches [1 .. 2 ]
62
+ $ini [$section ][$name ] = $value
63
+ }
64
+ }
65
+
66
+ return $ini
67
+ }
68
+
69
+ $ConfigIni = ParseIniFile " $ConfigPath \DefaultEngine.ini"
70
+ $SentrySettingsSection = " /Script/Sentry.SentrySettings"
71
+
72
+ $UploadSymbols = $ConfigIni .$SentrySettingsSection.UploadSymbolsAutomatically
73
+
74
+ If (" $UploadSymbols " .ToLower() -ne " true" )
75
+ {
76
+ Write-Host " Sentry: Automatic symbols upload is disabled in plugin settings. Skipping..."
77
+ Exit
78
+ }
79
+
80
+ Write-Host " Sentry: Parse project settings"
81
+
82
+ $PropertiesFile = " $ProjectPath /$ ( $ConfigIni .$SentrySettingsSection.PropertiesFilePath ) " .Replace(' \' , ' /' )
83
+
84
+ Write-Host " Sentry: Upload started using PropertiesFile '$PropertiesFile '"
85
+
86
+ $env: SENTRY_PROPERTIES = $PropertiesFile
87
+ & $CliExec upload- dif -- include- sources -- log- level info $ProjectBinariesPath $PluginBinariesPath
88
+
89
+ Write-Host " Sentry: Upload finished"
0 commit comments