Improve workflow with Android project generated after #1570

This commit is contained in:
Wojtek Figat
2023-10-02 11:05:19 +02:00
parent 652510ee50
commit 0ea3cb0d69
2 changed files with 22 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ namespace Flax.Build.Platforms
public LinuxPlatform() public LinuxPlatform()
{ {
// Try to use system compiler // Try to use system compiler
if (Platform.BuildTargetPlatform == TargetPlatform.Linux) if (BuildTargetPlatform == TargetPlatform.Linux)
{ {
// Pick the newest compiler (overriden by specified in command line) // Pick the newest compiler (overriden by specified in command line)
if (Which(Configuration.Compiler) != null) if (Which(Configuration.Compiler) != null)
@@ -67,7 +67,7 @@ namespace Flax.Build.Platforms
Log.Verbose($"Using native Linux toolchain (compiler {Compiler})"); Log.Verbose($"Using native Linux toolchain (compiler {Compiler})");
HasRequiredSDKsInstalled = true; HasRequiredSDKsInstalled = true;
} }
else if (Platform.BuildTargetPlatform != TargetPlatform.Mac) else if (BuildTargetPlatform != TargetPlatform.Mac)
{ {
// Check if Linux toolchain is installed // Check if Linux toolchain is installed
string toolchainName = "v13_clang-7.0.1-centos7"; string toolchainName = "v13_clang-7.0.1-centos7";
@@ -76,9 +76,11 @@ namespace Flax.Build.Platforms
{ {
if (string.IsNullOrEmpty(toolchainsRoot)) if (string.IsNullOrEmpty(toolchainsRoot))
{ {
Log.Warning("Missing Linux Toolchain. Cannot build for Linux platform."); if (BuildTargetPlatform == TargetPlatform.Linux)
Log.Warning("Missing Linux Toolchain. Cannot build for Linux platform.");
else
Log.Verbose("Missing Linux Toolchain. Cannot build for Linux platform.");
} }
return; return;
} }

View File

@@ -24,6 +24,13 @@ namespace Flax.Build.Projects.VisualStudio
/// <inheritdoc /> /// <inheritdoc />
public override void Generate(string solutionPath) public override void Generate(string solutionPath)
{ {
// Try to reuse the existing project guid from existing files
ProjectGuid = GetProjectGuid(Path, Name);
if (ProjectGuid == Guid.Empty)
ProjectGuid = GetProjectGuid(solutionPath, Name);
if (ProjectGuid == Guid.Empty)
ProjectGuid = Guid.NewGuid();
var gen = (VisualStudioProjectGenerator)Generator; var gen = (VisualStudioProjectGenerator)Generator;
var projectFileToolVersion = gen.ProjectFileToolVersion; var projectFileToolVersion = gen.ProjectFileToolVersion;
var vcProjectFileContent = new StringBuilder(); var vcProjectFileContent = new StringBuilder();
@@ -500,7 +507,15 @@ namespace Flax.Build.Projects.VisualStudio
firstEditorMatch = i; firstEditorMatch = i;
} }
} }
if (firstFullMatch != -1) if (project is AndroidProject)
{
// Utility Android deploy project only for exact match
if (firstFullMatch != -1)
projectConfiguration = configuration;
else
projectConfiguration = new SolutionConfiguration(project.Configurations[0]);
}
else if (firstFullMatch != -1)
{ {
projectConfiguration = configuration; projectConfiguration = configuration;
build = solution.MainProject == project || (solution.MainProject == null && project.Name == solution.Name); build = solution.MainProject == project || (solution.MainProject == null && project.Name == solution.Name);