Mac progress

This commit is contained in:
Wojtek Figat
2021-12-27 17:06:26 +01:00
parent e296e94d2c
commit 22915489b7
3 changed files with 59 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
// Copyright (c) 2012-2020 Flax Engine. All rights reserved.
using System;
using System.IO;
using Flax.Build.Platforms;
@@ -67,6 +68,28 @@ namespace Flax.Build.Projects.VisualStudioCode
}
break;
}
case TargetPlatform.Mac:
{
var userFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
var paths = new string[]
{
"/Applications/Visual Studio Code.app",
userFolder + "/Visual Studio Code.app",
userFolder + "/Downloads/Visual Studio Code.app",
};
foreach (var path in paths)
{
if (Directory.Exists(path))
{
_instance = new VisualStudioCodeInstance
{
Path = path,
};
break;
}
}
break;
}
}
if (_instance != null)

View File

@@ -240,6 +240,35 @@ namespace Flax.Build.Projects.VisualStudioCode
json.EndObject();
break;
}
case TargetPlatform.Mac:
{
VisualStudioCodeInstance.GetInstance();
json.AddField("command", "mono"); // TODO: use bundled mono
json.BeginArray("args");
{
json.AddUnnamedField(buildToolPath);
json.AddUnnamedField("--build");
json.AddUnnamedField("--log");
json.AddUnnamedField("--mutex");
json.AddUnnamedField(string.Format("--workspace=\\\"{0}\\\"", buildToolWorkspace));
json.AddUnnamedField(string.Format("--arch={0}", configuration.Architecture));
json.AddUnnamedField(string.Format("--configuration={0}", configuration.ConfigurationName));
json.AddUnnamedField(string.Format("--platform={0}", configuration.PlatformName));
json.AddUnnamedField(string.Format("--buildTargets={0}", target.Name));
if (!string.IsNullOrEmpty(Configuration.Compiler))
json.AddUnnamedField(string.Format("--compiler={0}", Configuration.Compiler));
}
json.EndArray();
json.AddField("type", "shell");
json.BeginObject("options");
{
json.AddField("cwd", buildToolWorkspace);
}
json.EndObject();
break;
}
default: throw new Exception("Visual Code project generator does not support current platform.");
}

View File

@@ -71,11 +71,18 @@ namespace Flax.Build.Projects
contents.AppendLine("\tobjectVersion = 55;");
contents.AppendLine("\tobjects = {");
contents.AppendLine("");
var sourceGroupId = "04FD634B277A16FE000EA5CA";
contents.AppendLine("/* Begin PBXFileReference section */");
contents.AppendLine("\t\t" + sourceGroupId + " /* Source */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Source; sourceTree = \"<group>\"; };");
contents.AppendLine("/* End PBXFileReference section */");
contents.AppendLine("");
contents.AppendLine("/* Begin PBXGroup section */");
contents.AppendLine("\t\t" + groupId + " = {");
contents.AppendLine("\t\t\tisa = PBXGroup;");
contents.AppendLine("\t\t\tchildren = (");
contents.AppendLine("\t\t\t\t" + sourceGroupId + ",");
contents.AppendLine("\t\t\t);");
contents.AppendLine("\t\t\tsourceTree = \"<group>\";");
contents.AppendLine("\t\t};");