瀏覽代碼

linux android build processing

JimMarlowe 9 年之前
父節點
當前提交
8baa1de26e
共有 1 個文件被更改,包括 21 次插入1 次删除
  1. 21 1
      Source/ToolCore/Build/BuildAndroid.cpp

+ 21 - 1
Source/ToolCore/Build/BuildAndroid.cpp

@@ -249,7 +249,8 @@ void BuildAndroid::RunAntDebug()
     String antCommand = tprefs->GetAntPath();
     Vector<String> args;
     args.Push("debug");
-#else
+#endif
+#ifdef ATOMIC_PLATFORM_WINDOWS
     // C:\ProgramData\Oracle\Java\javapath;
     Vector<String> args;
     String antCommand = "cmd";
@@ -260,6 +261,25 @@ void BuildAndroid::RunAntDebug()
     args.Push("\"" + antPath + "\"");
     args.Push("debug");
 #endif
+#ifdef ATOMIC_PLATFORM_LINUX 
+
+    String antCommand = tprefs->GetAntPath();
+    if ( antCommand.Empty() ) // user didnt fill it out, use installed one
+    {
+ 		antCommand = "/usr/bin/ant"; // system default if installed
+	}
+	else
+	{
+		antCommand.Append("/ant"); 
+	}
+ 	FileSystem* fileSystem = GetSubsystem<FileSystem>();
+    if ( !fileSystem->FileExists ( antCommand) ) 
+    {
+		FailBuild("BuildFailed ant program not installed");
+	}	
+    Vector<String> args;
+    args.Push("debug");
+#endif
 
     currentBuildPhase_ = AntBuildDebug;
     Subprocess* subprocess = subs->Launch(antCommand, args, buildPath_, env);