Skip to content

Commit cc28d37

Browse files
committed
sdk out-of-proc build on linux/mac
1 parent 722d9bd commit cc28d37

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/Peachpie.CodeAnalysis/CommandLine/PhpCompilerDriver.cs

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public static class PhpCompilerDriver
1818
/// </summary>
1919
public static int Main(string[] args)
2020
{
21-
Debugger.Launch();
22-
2321
// $"/baseDirectory:{BasePath}",
2422
// $"/sdkDirectory:{NetFrameworkPath}",
2523
// $"/additionalReferenceDirectories:{libs}",

src/Peachpie.NET.Sdk/BuildTask.cs

+11-2
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,12 @@ public override bool Execute()
368368
{
369369
cancellation.ThrowIfCancellationRequested();
370370

371-
Debug.Assert(File.Exists(PeachpieCompilerFullPath));
371+
var compilerPath = Path.GetFullPath(PeachpieCompilerFullPath);
372+
373+
Debug.Assert(File.Exists(compilerPath));
372374

373375
//
374-
var pi = new ProcessStartInfo(PeachpieCompilerFullPath)
376+
var pi = new ProcessStartInfo(compilerPath)
375377
{
376378
Arguments = FlatternArgs(args),
377379
CreateNoWindow = true,
@@ -382,6 +384,13 @@ public override bool Execute()
382384
UseShellExecute = false,
383385
};
384386

387+
// non-windows?
388+
if (Environment.OSVersion.Platform != PlatformID.Win32NT)
389+
{
390+
pi.FileName = "dotnet";
391+
pi.Arguments = $"\"{Path.ChangeExtension(compilerPath, ".dll")}\" {pi.Arguments}";
392+
}
393+
385394
//
386395
var process = Process.Start(pi);
387396
var dataReceived = new DataReceivedEventHandler((o, e) =>

0 commit comments

Comments
 (0)