forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonoScriptCompilerBase.cs
More file actions
36 lines (32 loc) · 1.46 KB
/
Copy pathMonoScriptCompilerBase.cs
File metadata and controls
36 lines (32 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.IO;
using UnityEditor.Utils;
namespace UnityEditor.Scripting.Compilers
{
internal abstract class MonoScriptCompilerBase : ScriptCompilerBase
{
private readonly bool runUpdater;
protected MonoScriptCompilerBase(MonoIsland island, bool runUpdater) : base(island)
{
this.runUpdater = runUpdater;
}
protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List<string> arguments)
{
base.AddCustomResponseFileIfPresent(arguments, Path.GetFileNameWithoutExtension(compiler) + ".rsp");
string monodistro = (this._island._api_compatibility_level != ApiCompatibilityLevel.NET_4_6) ? MonoInstallationFinder.GetMonoInstallation() : MonoInstallationFinder.GetMonoBleedingEdgeInstallation();
return this.StartCompiler(target, compiler, arguments, true, monodistro);
}
protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List<string> arguments, bool setMonoEnvironmentVariables, string monodistro)
{
string text = CommandLineFormatter.GenerateResponseFile(arguments);
if (this.runUpdater)
{
APIUpdaterHelper.UpdateScripts(text, this._island.GetExtensionOfSourceFiles());
}
ManagedProgram managedProgram = new ManagedProgram(monodistro, BuildPipeline.CompatibilityProfileToClassLibFolder(this._island._api_compatibility_level), compiler, " @" + text, setMonoEnvironmentVariables, null);
managedProgram.Start();
return managedProgram;
}
}
}