Updates for dev with dotnet on linux

This commit is contained in:
Wojtek Figat
2023-01-08 20:27:28 +01:00
parent bf60955e5e
commit 4e4f4e700b
9 changed files with 28 additions and 15 deletions

View File

@@ -25,7 +25,13 @@ namespace Flax.Build
task.Cost = 100;
task.DisableCache = true;
task.CommandPath = VCEnvironment.MSBuildPath;
task.CommandArguments = string.Format("\"{0}\" /m /t:Build /p:Configuration=\"{1}\" /p:Platform=\"{2}\" {3} /nologo", target.CustomExternalProjectFilePath, configuration.ToString(), "AnyCPU", VCEnvironment.Verbosity);
task.CommandArguments = $"\"{target.CustomExternalProjectFilePath}\" /m /p:BuildProjectReferences=false /t:Restore,Build /p:Configuration=\"{configuration}\" /p:RestorePackagesConfig=True /p:Platform=AnyCPU /nologo {VCEnvironment.Verbosity}";
if (task.CommandPath.EndsWith(" msbuild"))
{
// Special case when using dotnet CLI as msbuild
task.CommandPath = task.CommandPath.Substring(0, task.CommandPath.Length - 8);
task.CommandArguments = "msbuild " + task.CommandArguments;
}
return;
}

View File

@@ -55,6 +55,13 @@ namespace Flax.Deploy
case TargetPlatform.Linux:
case TargetPlatform.Mac:
{
// Use msbuild for .NET
toolPath = UnixPlatform.Which("dotnet");
if (toolPath != null)
{
return toolPath + " msbuild";
}
// Use msbuild from Mono
toolPath = UnixPlatform.Which("msbuild");
if (toolPath != null)

View File

@@ -40,7 +40,7 @@ namespace Flax.Build.Platforms
if (Platform.BuildTargetPlatform == TargetPlatform.Linux)
{
// Pick the newest compiler (overriden by specified in command line)
if (Which(Compiler) != null)
if (Which(Configuration.Compiler) != null)
Compiler = Configuration.Compiler;
else if (Which("clang++-10") != null)
Compiler = "clang++-10";

View File

@@ -546,7 +546,7 @@ namespace Flax.Build.Projects.VisualStudioCode
json.EndObject();
// Extension settings
json.AddField("omnisharp.useModernNet", false);
json.AddField("omnisharp.useModernNet", true);
json.EndRootObject();
@@ -566,7 +566,7 @@ namespace Flax.Build.Projects.VisualStudioCode
json.AddField("jake.autoDetect", "off");
json.AddField("grunt.autoDetect", "off");
json.AddField("omnisharp.defaultLaunchSolution", solution.Name + ".sln");
json.AddField("omnisharp.useModernNet", false);
json.AddField("omnisharp.useModernNet", true);
json.EndObject();
// Folders