You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
[INTEGRATE] Change 2456485 by Peter.Sauerbrei@peter.sauerbrei_MacPro on 2015/02/23 13:34:43
fix for ANDROID_HOME not being set on Mac by default UE-10257, UE-10277 #lockdown josh.adams [CL 2460097 by Ben Marsh in Main branch]
This commit is contained in:
@@ -313,6 +313,38 @@ public:
|
||||
|
||||
FString ADBPath;
|
||||
|
||||
#if PLATFORM_MAC
|
||||
if (AndroidDirectory[0] == 0)
|
||||
{
|
||||
// didn't find ANDROID_HOME, so parse the .bash_profile file on MAC
|
||||
FArchive* FileReader = IFileManager::Get().CreateFileReader(*FString([@"~/.bash_profile" stringByExpandingTildeInPath]));
|
||||
if (FileReader)
|
||||
{
|
||||
const int64 FileSize = FileReader->TotalSize();
|
||||
ANSICHAR* AnsiContents = (ANSICHAR*)FMemory::Malloc(FileSize);
|
||||
FileReader->Serialize(AnsiContents, FileSize);
|
||||
FileReader->Close();
|
||||
delete FileReader;
|
||||
|
||||
TArray<FString> Lines;
|
||||
FString(ANSI_TO_TCHAR(AnsiContents)).ParseIntoArrayLines(&Lines);
|
||||
FMemory::Free(AnsiContents);
|
||||
|
||||
for (int32 Index = 0; Index < Lines.Num(); Index++)
|
||||
{
|
||||
if (AndroidDirectory[0] == 0 && Lines[Index].StartsWith(TEXT("export ANDROID_HOME=")))
|
||||
{
|
||||
FString Directory;
|
||||
Lines[Index].Split(TEXT("="), NULL, &Directory);
|
||||
Directory = Directory.Replace(TEXT("\""), TEXT(""));
|
||||
FCString::Strcpy(AndroidDirectory, *Directory);
|
||||
setenv("ANDROID_HOME", TCHAR_TO_ANSI(AndroidDirectory), 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (AndroidDirectory[0] != 0)
|
||||
{
|
||||
#if PLATFORM_WINDOWS
|
||||
|
||||
Reference in New Issue
Block a user