/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="executable">The executable to run</param>
 /// <param name="alwaysArguments">Any arguments that should always be passed to the executable</param>
 /// <param name="alwaysEnvironmentVariables">Environment variables to set when running this program</param>
 /// <param name="stdOutMode">The stdout logging behaviour to use</param>
 public SystemProcessRunnableProgramDuplicate(string executable, string[] alwaysArguments = null, Dictionary <string, string> alwaysEnvironmentVariables = null, StdOutMode stdOutMode = StdOutMode.LogStartArgumentsAndExitcode)
 {
     Executable                 = executable;
     AlwaysArguments            = alwaysArguments ?? new string[0];
     AlwaysEnvironmentVariables = alwaysEnvironmentVariables ?? new Dictionary <string, string>();
     StdOutMode                 = stdOutMode;
 }
コード例 #2
0
 internal static RunnableProgram UnityBeeBackendProgram(StdOutMode stdoutMode)
 {
     return(new SystemProcessRunnableProgramDuplicate(BeeBackendExecutable, alwaysEnvironmentVariables: new Dictionary <string, string>()
     {
         { "BEE_CACHE_BEHAVIOUR", "_" },
         { "CHROMETRACE_TIMEOFFSET", "unixepoch" }
     }, stdOutMode: stdoutMode));
 }
コード例 #3
0
        public static BeeDriver Make(
            RunnableProgram buildProgram,
            string dagName,
            string dagDirectory,
            bool useScriptUpdater,
            string projectDirectory,
            ILPostProcessingProgram ilpp,
            StdOutMode stdoutMode,
            ProgressAPI progressAPI           = null,
            RunnableProgram beeBackendProgram = null)
        {
            var sourceFileUpdaters = useScriptUpdater
                ? new[] { new UnityScriptUpdater(projectDirectory) }
            : Array.Empty <SourceFileUpdaterBase>();

            var processSourceFileUpdatersResult = new UnitySourceFileUpdatersResultHandler();

            NPath dagDir = dagDirectory ?? "Library/Bee";

            RecreateDagDirectoryIfNeeded(dagDir);
            NPath profilerOutputFile = UnityBeeDriverProfilerSession.GetTraceEventsOutputForNewBeeDriver() ?? $"{dagDir}/fullprofile.json";
            var   result             = new BeeDriver(buildProgram, beeBackendProgram ?? UnityBeeBackendProgram(stdoutMode), projectDirectory, dagName, dagDir.ToString(), sourceFileUpdaters, processSourceFileUpdatersResult, progressAPI ?? new UnityProgressAPI("Script Compilation"), profilerOutputFile: profilerOutputFile.ToString());

            result.DataForBuildProgram.Add(new ConfigurationData
            {
                Il2CppDir             = IL2CPPUtils.GetIl2CppFolder(),
                Il2CppPath            = IL2CPPUtils.GetExePath("il2cpp"),
                UnityLinkerPath       = IL2CPPUtils.GetExePath("UnityLinker"),
                NetCoreRunPath        = NetCoreRunProgram.NetCoreRunPath,
                EditorContentsPath    = EditorApplication.applicationContentsPath,
                Packages              = GetPackageInfos(NPath.CurrentDirectory.ToString()),
                UnityVersion          = Application.unityVersion,
                UnityVersionNumeric   = new BeeBuildProgramCommon.Data.Version(Application.unityVersionVer, Application.unityVersionMaj, Application.unityVersionMin),
                UnitySourceCodePath   = Unsupported.IsSourceBuild(false) ? Unsupported.GetBaseUnityDeveloperFolder() : null,
                AdvancedLicense       = PlayerSettings.advancedLicense,
                Batchmode             = InternalEditorUtility.inBatchMode,
                EmitDataForBeeWhy     = (Debug.GetDiagnosticSwitch("EmitDataForBeeWhy").value as bool?) ?? false,
                NamedPipeOrUnixSocket = ilpp.NamedPipeOrUnixSocket,
            });
            return(result);
        }
コード例 #4
0
        public static BuildRequest BuildRequestFor(RunnableProgram buildProgram, string dagName, string dagDirectory, bool useScriptUpdater, string projectDirectory, ILPostProcessingProgram ilpp, StdOutMode stdoutMode, RunnableProgram beeBackendProgram = null)
        {
            NPath dagDir = dagDirectory ?? "Library/Bee";

            RecreateDagDirectoryIfNeeded(dagDir);
            var   performingPlayerBuild = UnityBeeDriverProfilerSession.PerformingPlayerBuild;
            NPath profilerOutputFile    = performingPlayerBuild ? UnityBeeDriverProfilerSession.GetTraceEventsOutputForPlayerBuild() : $"{dagDir}/fullprofile.json";

            return(new BuildRequest()
            {
                BuildProgram = buildProgram,
                BackendProgram = beeBackendProgram ?? UnityBeeBackendProgram(stdoutMode),
                ProjectRoot = projectDirectory,
                DagName = dagName,
                BuildStateDirectory = dagDir.EnsureDirectoryExists().ToString(),
                ProfilerOutputFile = profilerOutputFile.ToString(),
                // Use a null process name during a player build to avoid writing process metadata.  The player profiler will take care of writing the process metadata
                ProfilerProcessName = performingPlayerBuild ? null : "BeeDriver",
                SourceFileUpdaters = useScriptUpdater
                    ? new[] { new UnityScriptUpdater(projectDirectory) }
                    : Array.Empty <SourceFileUpdaterBase>(),
                ProcessSourceFileUpdatersResult = new UnitySourceFileUpdatersResultHandler(),

                DataForBuildProgram =
                {
                    () => new ConfigurationData
                    {
                        Il2CppDir = IL2CPPUtils.GetIl2CppFolder(),
                        Il2CppPath = IL2CPPUtils.GetExePath("il2cpp"),
                        UnityLinkerPath = IL2CPPUtils.GetExePath("UnityLinker"),
                        NetCoreRunPath = NetCoreRunProgram.NetCoreRunPath,
                        EditorContentsPath = EditorApplication.applicationContentsPath,
                        Packages = GetPackageInfos(NPath.CurrentDirectory.ToString()),
                        UnityVersion = Application.unityVersion,
                        UnityVersionNumeric = new BeeBuildProgramCommon.Data.Version(Application.unityVersionVer, Application.unityVersionMaj, Application.unityVersionMin),
                        UnitySourceCodePath = Unsupported.IsSourceBuild(false) ? Unsupported.GetBaseUnityDeveloperFolder() : null,
                        AdvancedLicense = PlayerSettings.advancedLicense,
                        Batchmode = InternalEditorUtility.inBatchMode,
                        EmitDataForBeeWhy = (Debug.GetDiagnosticSwitch("EmitDataForBeeWhy").value as bool?) ?? false,
                        NamedPipeOrUnixSocket = ilpp.NamedPipeOrUnixSocket,
                    }
                }
            });
        }