Browse Source

Check for exists android sdk path moved to the native code

rsredsq 10 years ago
parent
commit
8767fc8bf0

+ 0 - 2
Script/AtomicEditor/ui/modal/build/platforms/AndroidSettingsWidget.ts

@@ -125,8 +125,6 @@ class AndroidSettingsWidget extends Atomic.UIWidget implements BuildSettingsWind
 
 
     refreshAndroidTargets() {
     refreshAndroidTargets() {
 
 
-        if (ToolCore.toolEnvironment.toolPrefs.androidSDKPath.length <= 0) return;
-
         var platform = <ToolCore.PlatformAndroid>ToolCore.toolSystem.getPlatformByName("ANDROID");
         var platform = <ToolCore.PlatformAndroid>ToolCore.toolSystem.getPlatformByName("ANDROID");
 
 
         platform.refreshAndroidTargets();
         platform.refreshAndroidTargets();

+ 12 - 0
Source/ToolCore/Platform/PlatformAndroid.cpp

@@ -7,6 +7,7 @@
 
 
 #include <Atomic/IO/MemoryBuffer.h>
 #include <Atomic/IO/MemoryBuffer.h>
 #include <Atomic/IO/FileSystem.h>
 #include <Atomic/IO/FileSystem.h>
+#include <Atomic/IO/Log.h>
 
 
 #include "../ToolEnvironment.h"
 #include "../ToolEnvironment.h"
 #include "../Subprocess/SubprocessSystem.h"
 #include "../Subprocess/SubprocessSystem.h"
@@ -83,6 +84,17 @@ void PlatformAndroid::RefreshAndroidTargets()
     if (refreshAndroidTargetsProcess_.NotNull())
     if (refreshAndroidTargetsProcess_.NotNull())
         return;
         return;
 
 
+    ToolPrefs* prefs = GetSubsystem<ToolEnvironment>()->GetToolPrefs();
+    FileSystem* fileSystem = GetSubsystem<FileSystem>();
+
+    String androidSDKPath = prefs->GetAndroidSDKPath();
+
+    if (!fileSystem->DirExists(androidSDKPath))
+    {
+        LOGERRORF("Android path not exists");
+        return;
+    }
+
     SubprocessSystem* subs = GetSubsystem<SubprocessSystem>();
     SubprocessSystem* subs = GetSubsystem<SubprocessSystem>();
 
 
     String androidCommand = GetAndroidCommand();
     String androidCommand = GetAndroidCommand();