|
@@ -65,7 +65,7 @@ namespace ToolCore
|
|
|
|
|
|
|
|
void NETProjectSystem::OpenSolution()
|
|
void NETProjectSystem::OpenSolution()
|
|
|
{
|
|
{
|
|
|
- if (!visualStudioPath_.Length())
|
|
|
|
|
|
|
+ if (!idePath_.Length())
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
FileSystem* fileSystem = GetSubsystem<FileSystem>();
|
|
FileSystem* fileSystem = GetSubsystem<FileSystem>();
|
|
@@ -82,28 +82,37 @@ namespace ToolCore
|
|
|
|
|
|
|
|
void NETProjectSystem::OpenSourceFile(const String& sourceFilePath)
|
|
void NETProjectSystem::OpenSourceFile(const String& sourceFilePath)
|
|
|
{
|
|
{
|
|
|
- if (!visualStudioPath_.Length())
|
|
|
|
|
|
|
+ if (!idePath_.Length())
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
|
|
+ String command = idePath_;
|
|
|
StringVector args;
|
|
StringVector args;
|
|
|
|
|
|
|
|
- if (vsSubprocess_.Expired())
|
|
|
|
|
|
|
+ if (ideSubprocess_.Expired())
|
|
|
{
|
|
{
|
|
|
SubprocessSystem* subs = GetSubsystem<SubprocessSystem>();
|
|
SubprocessSystem* subs = GetSubsystem<SubprocessSystem>();
|
|
|
- vsSubprocess_ = 0;
|
|
|
|
|
|
|
+ ideSubprocess_ = 0;
|
|
|
|
|
+
|
|
|
|
|
+#ifdef ATOMIC_PLATFORM_OSX
|
|
|
|
|
+
|
|
|
|
|
+ command = "open";
|
|
|
|
|
+ args.Push("-W");
|
|
|
|
|
+ args.Push("-a");
|
|
|
|
|
+ args.Push(idePath_);
|
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
args.Push(solutionPath_);
|
|
args.Push(solutionPath_);
|
|
|
|
|
|
|
|
if (sourceFilePath.Length())
|
|
if (sourceFilePath.Length())
|
|
|
- args.Push(sourceFilePath);
|
|
|
|
|
|
|
+ args.Push(sourceFilePath);
|
|
|
|
|
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
|
- vsSubprocess_ = subs->Launch(visualStudioPath_, args);
|
|
|
|
|
|
|
+ ideSubprocess_ = subs->Launch(command, args);
|
|
|
}
|
|
}
|
|
|
catch (Poco::SystemException)
|
|
catch (Poco::SystemException)
|
|
|
{
|
|
{
|
|
|
- vsSubprocess_ = 0;
|
|
|
|
|
|
|
+ ideSubprocess_ = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -113,11 +122,22 @@ namespace ToolCore
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
try
|
|
try
|
|
|
- {
|
|
|
|
|
|
|
+ {
|
|
|
std::vector<std::string> args;
|
|
std::vector<std::string> args;
|
|
|
|
|
+
|
|
|
|
|
+#ifdef ATOMIC_PLATFORM_WINDOWS
|
|
|
|
|
+
|
|
|
args.push_back("/edit");
|
|
args.push_back("/edit");
|
|
|
|
|
+
|
|
|
|
|
+#elif defined ATOMIC_PLATFORM_OSX
|
|
|
|
|
+
|
|
|
|
|
+ command = "open";
|
|
|
|
|
+ args.push_back("-a");
|
|
|
|
|
+ args.push_back(idePath_.CString());
|
|
|
|
|
+
|
|
|
|
|
+#endif
|
|
|
args.push_back(sourceFilePath.CString());
|
|
args.push_back(sourceFilePath.CString());
|
|
|
- Poco::Process::launch(visualStudioPath_.CString(), args);
|
|
|
|
|
|
|
+ Poco::Process::launch(command.CString(), args);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
catch (Poco::SystemException)
|
|
catch (Poco::SystemException)
|
|
@@ -355,14 +375,23 @@ namespace ToolCore
|
|
|
FileSystem* fileSystem = GetSubsystem<FileSystem>();
|
|
FileSystem* fileSystem = GetSubsystem<FileSystem>();
|
|
|
|
|
|
|
|
// Query for Visual Studio 2015 path
|
|
// Query for Visual Studio 2015 path
|
|
|
- visualStudioPath_ = Poco::Environment::get("VS140COMNTOOLS").c_str();
|
|
|
|
|
|
|
+ idePath_ = Poco::Environment::get("VS140COMNTOOLS").c_str();
|
|
|
|
|
|
|
|
- if (visualStudioPath_.Length())
|
|
|
|
|
|
|
+ if (idePath_.Length())
|
|
|
{
|
|
{
|
|
|
- visualStudioPath_.Replace("Tools\\", "IDE\\devenv.exe");
|
|
|
|
|
|
|
+ idePath_.Replace("Tools\\", "IDE\\devenv.exe");
|
|
|
|
|
+
|
|
|
|
|
+ if (!fileSystem->FileExists(idePath_))
|
|
|
|
|
+ idePath_.Clear();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (!fileSystem->FileExists(visualStudioPath_))
|
|
|
|
|
- visualStudioPath_.Clear();
|
|
|
|
|
|
|
+#elif defined ATOMIC_PLATFORM_OSX
|
|
|
|
|
+
|
|
|
|
|
+ FileSystem* fileSystem = GetSubsystem<FileSystem>();
|
|
|
|
|
+
|
|
|
|
|
+ if (fileSystem->DirExists("/Applications/Xamarin Studio.app"))
|
|
|
|
|
+ {
|
|
|
|
|
+ idePath_ = "/Applications/Xamarin Studio.app/Contents/MacOS/XamarinStudio";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|