@@ -18,7 +18,7 @@ namespace Flax.Build.Platforms
|
||||
public static readonly AndroidNdk Instance = new AndroidNdk();
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetPlatform[] Platforms => new []
|
||||
public override TargetPlatform[] Platforms => new[]
|
||||
{
|
||||
TargetPlatform.Windows,
|
||||
TargetPlatform.Linux,
|
||||
@@ -63,20 +63,37 @@ namespace Flax.Build.Platforms
|
||||
{
|
||||
Log.Warning(string.Format("Specified Android NDK folder in ANDROID_NDK env variable doesn't exist ({0})", sdkPath));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(sdkPath))
|
||||
if (!string.IsNullOrEmpty(sdkPath) && Directory.Exists(sdkPath))
|
||||
{
|
||||
var lines = File.ReadAllLines(Path.Combine(sdkPath, "source.properties"));
|
||||
if (lines.Length > 1)
|
||||
var sourceProperties = Path.Combine(sdkPath, "source.properties");
|
||||
if (File.Exists(sourceProperties))
|
||||
{
|
||||
var ver = lines[1].Substring(lines[1].IndexOf(" = ", StringComparison.Ordinal) + 2);
|
||||
if (Version.TryParse(ver, out var v))
|
||||
var lines = File.ReadAllLines(sourceProperties);
|
||||
if (lines.Length > 1)
|
||||
{
|
||||
RootPath = sdkPath;
|
||||
Version = v;
|
||||
IsValid = true;
|
||||
Log.Info(string.Format("Found Android NDK {1} at {0}", RootPath, Version));
|
||||
var ver = lines[1].Substring(lines[1].IndexOf(" = ", StringComparison.Ordinal) + 2);
|
||||
if (Version.TryParse(ver, out var v))
|
||||
{
|
||||
Version = v;
|
||||
IsValid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Version.TryParse(Path.GetFileName(sdkPath), out var v))
|
||||
{
|
||||
Version = v;
|
||||
IsValid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Warning(string.Format("Failed to detect Android NDK version ({0})", sdkPath));
|
||||
}
|
||||
}
|
||||
if (IsValid)
|
||||
{
|
||||
RootPath = sdkPath;
|
||||
IsValid = true;
|
||||
Log.Info(string.Format("Found Android NDK {1} at {0}", RootPath, Version));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user