Files
UnrealEngineUWP/Engine/Source/Developer/Android/AndroidPlatformEditor/Private/AndroidSDKSettings.cpp
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

71 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "AndroidSDKSettings.h"
#include "Misc/Paths.h"
#include "Interfaces/IAndroidDeviceDetection.h"
//#include "EngineTypes.h"
#include "Interfaces/ITargetPlatformManagerModule.h"
DEFINE_LOG_CATEGORY_STATIC(AndroidSDKSettings, Log, All);
UAndroidSDKSettings::UAndroidSDKSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
#if WITH_EDITOR
void UAndroidSDKSettings::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);
UpdateTargetModulePaths();
}
void UAndroidSDKSettings::SetTargetModule(ITargetPlatformManagerModule * InTargetManagerModule)
{
TargetManagerModule = InTargetManagerModule;
}
void UAndroidSDKSettings::SetDeviceDetection(IAndroidDeviceDetection * InAndroidDeviceDetection)
{
AndroidDeviceDetection = InAndroidDeviceDetection;
}
void UAndroidSDKSettings::UpdateTargetModulePaths()
{
TArray<FString> Keys;
TArray<FString> Values;
if (!SDKPath.Path.IsEmpty())
{
FPaths::NormalizeFilename(SDKPath.Path);
Keys.Add(TEXT("ANDROID_HOME"));
Values.Add(SDKPath.Path);
}
if (!NDKPath.Path.IsEmpty())
{
FPaths::NormalizeFilename(NDKPath.Path);
Keys.Add(TEXT("NDKROOT"));
Values.Add(NDKPath.Path);
}
if (!JavaPath.Path.IsEmpty())
{
FPaths::NormalizeFilename(JavaPath.Path);
Keys.Add(TEXT("JAVA_HOME"));
Values.Add(JavaPath.Path);
}
SaveConfig();
if (Keys.Num() != 0)
{
TargetManagerModule->UpdatePlatformEnvironment(TEXT("Android"), Keys, Values);
AndroidDeviceDetection->UpdateADBPath();
}
}
#endif