public static BeeDriver Make(RunnableProgram buildProgram, string dagName,
                                     string dagDirectory, bool useScriptUpdater, string projectDirectory, 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(), 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,
            });
            return(result);
        }
Example #2
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,
                    }
                }
            });
        }