forked from Unity-Technologies/UnityCsReference
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMonoScriptCompilerBase.cs
More file actions
44 lines (35 loc) · 1.89 KB
/
Copy pathMonoScriptCompilerBase.cs
File metadata and controls
44 lines (35 loc) · 1.89 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
37
38
39
40
41
42
43
44
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System.Collections.Generic;
using System.IO;
using UnityEditor.Utils;
namespace UnityEditor.Scripting.Compilers
{
internal abstract class MonoScriptCompilerBase : ScriptCompilerBase
{
protected MonoScriptCompilerBase(MonoIsland island, bool runUpdater) : base(island, runUpdater)
{
}
protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List<string> arguments)
{
return StartCompiler(target, compiler, arguments, BuildPipeline.CompatibilityProfileToClassLibFolder(_island._api_compatibility_level));
}
protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List<string> arguments, string profileDirectory)
{
AddCustomResponseFileIfPresent(arguments, Path.GetFileNameWithoutExtension(compiler) + ".rsp");
var monoInstallation = (PlayerSettingsEditor.IsLatestApiCompatibility(_island._api_compatibility_level))
? MonoInstallationFinder.GetMonoBleedingEdgeInstallation()
: MonoInstallationFinder.GetMonoInstallation();
return StartCompiler(target, compiler, arguments, profileDirectory, true, monoInstallation);
}
protected ManagedProgram StartCompiler(BuildTarget target, string compiler, List<string> arguments, string profileDirectory, bool setMonoEnvironmentVariables, string monodistro)
{
var responseFile = CommandLineFormatter.GenerateResponseFile(arguments);
RunAPIUpdaterIfRequired(responseFile);
var program = new ManagedProgram(monodistro, profileDirectory, compiler, " @" + responseFile, setMonoEnvironmentVariables, null);
program.Start();
return program;
}
}
}