Skip to content

Commit afd522a

Browse files
committed
Fix editor executable
Test Test Remove target name param Test Test Try comment commandlet execution Restore commandlet execution Move commadlet to runtime module Fix commandlet context Test Test test Revert "test" This reverts commit a6f7d76.
1 parent ac76aea commit afd522a

File tree

9 files changed

+55
-47
lines changed

9 files changed

+55
-47
lines changed
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
TARGET_PLATFORM="$1"
4-
TARGET_NAME="$2"
5-
TARGET_TYPE="$3"
6-
TARGET_CONFIGURATION="$4"
7-
PROJECT_FILE="$5"
8-
PLUGIN_DIR="$6"
9-
ENGINE_DIR="$7"
4+
TARGET_TYPE="$2"
5+
TARGET_CONFIGURATION="$3"
6+
PROJECT_FILE="$4"
7+
PLUGIN_DIR="$5"
8+
ENGINE_DIR="$6"
109

1110
# Grant execute permissions to sentry-cli binary (FAB version of the plugin doesn't preserve file permissions)
1211
if [ -f "$PLUGIN_DIR/Source/ThirdParty/CLI/sentry-cli-Linux-x86_64" ]; then
1312
chmod +x "$PLUGIN_DIR/Source/ThirdParty/CLI/sentry-cli-Linux-x86_64"
1413
fi
1514

15+
# Skip commandlet execution for Editor target type
16+
if [ "$TARGET_TYPE" = "Editor" ]; then
17+
echo "Skipping SentrySymbolUpload commandlet for Editor target type"
18+
exit 0
19+
fi
20+
1621
ENGINE_VERSION=$(grep -o '"EngineAssociation": *"[^"]*"' "$PROJECT_FILE" | cut -d'"' -f4)
1722

1823
if [ "$(printf %.1s "$ENGINE_VERSION")" = "4" ]; then
19-
EDITOR_EXE="$ENGINE_DIR/Binaries/Linux/UE4Editor"
24+
EDITOR_EXE="$ENGINE_DIR/Binaries/Linux/UE4Editor-Cmd"
2025
else
21-
EDITOR_EXE="$ENGINE_DIR/Binaries/Linux/UnrealEditor"
26+
EDITOR_EXE="$ENGINE_DIR/Binaries/Linux/UnrealEditor-Cmd"
2227
fi
2328

24-
"$EDITOR_EXE" "$PROJECT_FILE" -run=SentrySymbolUpload -target-platform="$TARGET_PLATFORM" -target-name="$TARGET_NAME" -target-type="$TARGET_TYPE" -target-configuration="$TARGET_CONFIGURATION" -unattended -nopause
29+
"$EDITOR_EXE" "$PROJECT_FILE" -run=SentrySymbolUpload -target-platform="$TARGET_PLATFORM" -target-type="$TARGET_TYPE" -target-configuration="$TARGET_CONFIGURATION" -unattended -nopause -stdout -CrashForUAT
Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
TARGET_PLATFORM="$1"
4-
TARGET_NAME="$2"
5-
TARGET_TYPE="$3"
6-
TARGET_CONFIGURATION="$4"
7-
PROJECT_FILE="$5"
8-
PLUGIN_DIR="$6"
9-
ENGINE_DIR="$7"
4+
TARGET_TYPE="$2"
5+
TARGET_CONFIGURATION="$3"
6+
PROJECT_FILE="$4"
7+
PLUGIN_DIR="$5"
8+
ENGINE_DIR="$6"
109

1110
# Copy sentry.dylib to plugin's Binaries\Mac dir if it doesn't exist there to ensure FAB version of the plugin works correctly - Epic obfuscates any extra binaries when pre-building the plugin
1211
if [ "$TARGET_PLATFORM" = "Mac" ] && [ ! -f "$PLUGIN_DIR/Binaries/Mac/sentry.dylib" ]; then
@@ -18,12 +17,18 @@ if [ -f "$PLUGIN_DIR/Source/ThirdParty/CLI/sentry-cli-Darwin-universal" ]; then
1817
chmod +x "$PLUGIN_DIR/Source/ThirdParty/CLI/sentry-cli-Darwin-universal"
1918
fi
2019

20+
# Skip commandlet execution for Editor target type
21+
if [ "$TARGET_TYPE" = "Editor" ]; then
22+
echo "Skipping SentrySymbolUpload commandlet for Editor target type"
23+
exit 0
24+
fi
25+
2126
ENGINE_VERSION=$(grep -o '"EngineAssociation": *"[^"]*"' "$PROJECT_FILE" | cut -d'"' -f4)
2227

2328
if [[ "${ENGINE_VERSION:0:1}" == "4" ]]; then
24-
EDITOR_EXE="$ENGINE_DIR/Binaries/Mac/UE4Editor"
29+
EDITOR_EXE="$ENGINE_DIR/Binaries/Mac/UE4Editor-Cmd"
2530
else
26-
EDITOR_EXE="$ENGINE_DIR/Binaries/Mac/UnrealEditor"
31+
EDITOR_EXE="$ENGINE_DIR/Binaries/Mac/UnrealEditor-Cmd"
2732
fi
2833

29-
"$EDITOR_EXE" "$PROJECT_FILE" -run=SentrySymbolUpload -target-platform="$TARGET_PLATFORM" -target-name="$TARGET_NAME" -target-type="$TARGET_TYPE" -target-configuration="$TARGET_CONFIGURATION" -unattended -nopause
34+
"$EDITOR_EXE" "$PROJECT_FILE" -run=SentrySymbolUpload -target-platform="$TARGET_PLATFORM" -target-type="$TARGET_TYPE" -target-configuration="$TARGET_CONFIGURATION" -unattended -nopause
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
@echo off
2+
23
setlocal enabledelayedexpansion
34

45
set "TARGET_PLATFORM=%~1"
5-
set "TARGET_NAME=%~2"
6-
set "TARGET_TYPE=%~3"
7-
set "TARGET_CONFIGURATION=%~4"
8-
set "PROJECT_FILE=%~5"
9-
set "PLUGIN_DIR=%~6"
10-
set "ENGINE_DIR=%~7"
6+
set "TARGET_TYPE=%~2"
7+
set "TARGET_CONFIGURATION=%~3"
8+
set "PROJECT_FILE=%~4"
9+
set "PLUGIN_DIR=%~5"
10+
set "ENGINE_DIR=%~6"
1111

1212
:: Copy crashpad handler executable to plugin's Binaries\Linux dir if it doesn't exist there to enable cross-compilation for Linux on Windows with FAB version of the plugin
1313
set "CRASHPAD_HANDLER_LINUX=%PLUGIN_DIR%\Binaries\Linux\crashpad_handler"
@@ -21,11 +21,19 @@ if "%TARGET_PLATFORM%"=="Win64" (
2121
if not exist "%CRASHPAD_HANDLER_WIN%" (xcopy "%PLUGIN_DIR%\Source\ThirdParty\Win64\Crashpad\bin\*" "%PLUGIN_DIR%\Binaries\Win64\" /F /R /Y /I)
2222
)
2323

24+
:: Skip commandlet execution for Editor target type
25+
if "%TARGET_TYPE%"=="Editor" (
26+
echo Sentry: Automatic symbols upload is not required for Editor target. Skipping...
27+
exit /B 0
28+
)
29+
2430
for /f "tokens=2 delims=:, " %%i in ('type "%PROJECT_FILE%" ^| findstr /C:"EngineAssociation"') do set "ENGINE_VERSION=%%~i"
2531
set "ENGINE_VERSION=!ENGINE_VERSION:~0,1!"
2632

2733
if "!ENGINE_VERSION!"=="4" (set "EDITOR_EXE=%ENGINE_DIR%\Binaries\Win64\UE4Editor-Cmd.exe") else (set "EDITOR_EXE=%ENGINE_DIR%\Binaries\Win64\UnrealEditor-Cmd.exe")
2834

29-
"!EDITOR_EXE!" "%PROJECT_FILE%" -run=SentrySymbolUpload -target-platform=%TARGET_PLATFORM% -target-name=%TARGET_NAME% -target-type=%TARGET_TYPE% -target-configuration=%TARGET_CONFIGURATION% -unattended -nopause
35+
"!EDITOR_EXE!" "%PROJECT_FILE%" -run=SentrySymbolUpload -target-platform=%TARGET_PLATFORM% -target-type=%TARGET_TYPE% -target-configuration=%TARGET_CONFIGURATION% -unattended -nopause
36+
37+
endlocal
3038

31-
endlocal
39+
exit /B 0

plugin-dev/Sentry.uplugin

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@
4040
"PostBuildSteps":
4141
{
4242
"Mac": [
43-
"\"$(PluginDir)/Scripts/post-build-steps-mac.sh\" $(TargetPlatform) $(TargetName) $(TargetType) $(TargetConfiguration) \"$(ProjectFile)\" \"$(PluginDir)\" \"$(EngineDir)\""
43+
"\"$(PluginDir)/Scripts/post-build-steps-mac.sh\" $(TargetPlatform) $(TargetType) $(TargetConfiguration) \"$(ProjectFile)\" \"$(PluginDir)\" \"$(EngineDir)\""
4444
],
4545
"Linux": [
46-
"\"$(PluginDir)/Scripts/post-build-steps-linux.sh\" $(TargetPlatform) $(TargetName) $(TargetType) $(TargetConfiguration) \"$(ProjectFile)\" \"$(PluginDir)\" \"$(EngineDir)\""
46+
"\"$(PluginDir)/Scripts/post-build-steps-linux.sh\" $(TargetPlatform) $(TargetType) $(TargetConfiguration) \"$(ProjectFile)\" \"$(PluginDir)\" \"$(EngineDir)\""
4747
],
4848
"Win64": [
49-
"\"$(PluginDir)/Scripts/post-build-steps-win.bat\" $(TargetPlatform) $(TargetName) $(TargetType) $(TargetConfiguration) \"$(ProjectFile)\" \"$(PluginDir)\" \"$(EngineDir)\""
49+
"\"$(PluginDir)/Scripts/post-build-steps-win.bat\" $(TargetPlatform) $(TargetType) $(TargetConfiguration) \"$(ProjectFile)\" \"$(PluginDir)\" \"$(EngineDir)\""
5050
]
5151
}
5252
}

plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ void USentrySubsystem::Initialize(FSubsystemCollectionBase& Collection)
4444

4545
UE_LOG(LogSentrySdk, Log, TEXT("Sentry plugin auto initialization: %s"), *LexToString(Settings->InitAutomatically));
4646

47-
if (IsRunningCommandlet())
48-
{
49-
return;
50-
}
51-
5247
if (Settings->InitAutomatically)
5348
{
5449
Initialize();

plugin-dev/Source/SentryEditor/Private/SentrySymbolUploadCommandlet.cpp renamed to plugin-dev/Source/Sentry/Private/SentrySymbolUploadCommandlet.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ bool USentrySymbolUploadCommandlet::ParseCommandLineParams(const FString& Params
8787
UE_LOG(LogTemp, Display, TEXT("Sentry: Commandlet called with params: %s"), *Params);
8888

8989
FParse::Value(*Params, TEXT("target-platform="), TargetPlatform);
90-
FParse::Value(*Params, TEXT("target-name="), TargetName);
9190
FParse::Value(*Params, TEXT("target-type="), TargetType);
9291
FParse::Value(*Params, TEXT("target-configuration="), TargetConfiguration);
9392

94-
UE_LOG(LogTemp, Display, TEXT("Sentry: Parsed params - Platform: %s, Name: %s, Type: %s, Config: %s"), *TargetPlatform, *TargetName, *TargetType, *TargetConfiguration);
93+
UE_LOG(LogTemp, Display, TEXT("Sentry: Parsed params - Platform: %s, Type: %s, Config: %s"), *TargetPlatform, *TargetType, *TargetConfiguration);
9594

96-
if (TargetPlatform.IsEmpty() || TargetName.IsEmpty() || TargetType.IsEmpty() || TargetConfiguration.IsEmpty())
95+
if (TargetPlatform.IsEmpty() || TargetType.IsEmpty() || TargetConfiguration.IsEmpty())
9796
{
9897
UE_LOG(LogTemp, Error, TEXT("Sentry: Missing required command line parameters"));
9998
return false;

plugin-dev/Source/SentryEditor/Public/SentrySymbolUploadCommandlet.h renamed to plugin-dev/Source/Sentry/Public/SentrySymbolUploadCommandlet.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Usage: UE4Editor-Cmd.exe YourProject -run=SentrySymbolUpload -target-platform=Win64 -target-name=YourGame -target-type=Game -target-configuration=Development -project-dir="C:\Path\To\Project" -plugin-dir="C:\Path\To\Plugin"
1515
*/
1616
UCLASS()
17-
class SENTRYEDITOR_API USentrySymbolUploadCommandlet : public UCommandlet
17+
class SENTRY_API USentrySymbolUploadCommandlet : public UCommandlet
1818
{
1919
GENERATED_BODY()
2020

@@ -52,7 +52,6 @@ class SENTRYEDITOR_API USentrySymbolUploadCommandlet : public UCommandlet
5252

5353
private:
5454
FString TargetPlatform;
55-
FString TargetName;
5655
FString TargetType;
5756
FString TargetConfiguration;
5857
FString ProjectDir;

plugin-dev/Source/SentryEditor/SentryEditor.Build.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ public SentryEditor(ReadOnlyTargetRules Target) : base(Target)
2727
"PropertyEditor",
2828
"Projects",
2929
"HTTP",
30-
"UATHelper",
31-
"ToolMenus",
32-
"UnrealEd",
33-
"DesktopPlatform"
30+
"UATHelper"
3431
}
3532
);
3633
}

scripts/packaging/package.snapshot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Source/Sentry/Private/SentryScope.cpp
175175
Source/Sentry/Private/SentrySettings.cpp
176176
Source/Sentry/Private/SentrySpan.cpp
177177
Source/Sentry/Private/SentrySubsystem.cpp
178+
Source/Sentry/Private/SentrySymbolUploadCommandlet.cpp
178179
Source/Sentry/Private/SentryTraceSampler.cpp
179180
Source/Sentry/Private/SentryTransaction.cpp
180181
Source/Sentry/Private/SentryTransactionContext.cpp
@@ -219,6 +220,7 @@ Source/Sentry/Public/SentryScope.h
219220
Source/Sentry/Public/SentrySettings.h
220221
Source/Sentry/Public/SentrySpan.h
221222
Source/Sentry/Public/SentrySubsystem.h
223+
Source/Sentry/Public/SentrySymbolUploadCommandlet.h
222224
Source/Sentry/Public/SentryTraceSampler.h
223225
Source/Sentry/Public/SentryTransaction.h
224226
Source/Sentry/Public/SentryTransactionContext.h
@@ -230,11 +232,9 @@ Source/Sentry/Sentry_IOS_UPL.xml
230232
Source/Sentry/Sentry.Build.cs
231233
Source/SentryEditor/Private/SentryEditorModule.cpp
232234
Source/SentryEditor/Private/SentrySettingsCustomization.cpp
233-
Source/SentryEditor/Private/SentrySymbolUploadCommandlet.cpp
234235
Source/SentryEditor/Private/SentrySymToolsDownloader.cpp
235236
Source/SentryEditor/Public/SentryEditorModule.h
236237
Source/SentryEditor/Public/SentrySettingsCustomization.h
237-
Source/SentryEditor/Public/SentrySymbolUploadCommandlet.h
238238
Source/SentryEditor/Public/SentrySymToolsDownloader.h
239239
Source/SentryEditor/SentryEditor.Build.cs
240240
Source/ThirdParty/Android/sentry-android-core-release.aar

0 commit comments

Comments
 (0)