public override void OnGUI(string searchContext)
        {
            EditorGUIUtility.labelWidth     = 300;
            ProfilerUserSettings.frameCount = EditorGUILayout.IntSlider(Content.k_FrameCountText, ProfilerUserSettings.frameCount, ProfilerUserSettings.kMinFrameCount, ProfilerUserSettings.kMaxFrameCount);
            if (ProfilerUserSettings.frameCount > 600)
            {
                EditorGUILayout.HelpBox(Content.k_FrameCountWarningText);
            }
            if (Unsupported.IsDeveloperMode() || Unsupported.IsSourceBuild())
            {
                ProfilerUserSettings.useOutOfProcessProfiler =
                    EditorGUILayout.Toggle(Content.k_EnableOutOfProcessProfiler, ProfilerUserSettings.useOutOfProcessProfiler);
            }
            ProfilerUserSettings.rememberLastRecordState = EditorGUILayout.Toggle(Content.k_RememberLastRecordState, ProfilerUserSettings.rememberLastRecordState);

            var defaultRecordStateIndex = EditorGUILayout.Popup(Content.k_DefaultRecordState, ProfilerUserSettings.defaultRecordState ? 0 : 1, Content.k_RecordStates);

            ProfilerUserSettings.defaultRecordState = defaultRecordStateIndex == 0;

            if (ProfilerUserSettings.useOutOfProcessProfiler)
            {
                var defaultModeIndexIndex = EditorGUILayout.Popup(Content.k_DefaultTargetMode, (int)ProfilerUserSettings.defaultTargetMode, Content.k_TargetModes);
                ProfilerUserSettings.defaultTargetMode = (ProfilerEditorTargetMode)defaultModeIndexIndex;
            }
        }
예제 #2
0
        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);
        }
 static void DumpLogInfo(string message)
 {
     #if PB_ANALYTICS_LOGGING
     Debug.Log(message);
     Console.WriteLine(message);
     #else
     if (Unsupported.IsSourceBuild())
     {
         Console.WriteLine(message);
     }
     #endif
 }
 public override void OnGUI(string searchContext)
 {
     EditorGUIUtility.labelWidth     = 300;
     ProfilerUserSettings.frameCount = EditorGUILayout.IntSlider(Content.k_FrameCountText, ProfilerUserSettings.frameCount, ProfilerUserSettings.kMinFrameCount, ProfilerUserSettings.kMaxFrameCount);
     if (ProfilerUserSettings.frameCount > 600)
     {
         EditorGUILayout.HelpBox(Content.k_FrameCountWarningText);
     }
     if (Unsupported.IsDeveloperMode() || Unsupported.IsSourceBuild())
     {
         ProfilerUserSettings.useOutOfProcessProfiler =
             EditorGUILayout.Toggle(Content.k_EnableOutOfProcessProfiler, ProfilerUserSettings.useOutOfProcessProfiler);
     }
 }
 public virtual ScriptingImplementation[] Supported()
 {
     if (Unsupported.IsSourceBuild())  // CORECLR_FIXME remove sourcebuild
     {
         return(new[]
         {
             ScriptingImplementation.Mono2x,
             ScriptingImplementation.IL2CPP,
             #pragma warning disable 618
             ScriptingImplementation.CoreCLR
         });
     }
     return(new[]
     {
         ScriptingImplementation.Mono2x,
         ScriptingImplementation.IL2CPP,
     });
 }
예제 #6
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,
                    }
                }
            });
        }
예제 #7
0
        protected override void PrepareContext(BuildContext context)
        {
            base.PrepareContext(context);
            var androidNonIncrementalData = new AndroidNonIncrementalData(context);

            context.SetValue(androidNonIncrementalData);

            var classicData = context.GetValue <ClassicSharedData>();

            classicData.StreamingAssetsDirectory = Path.Combine(androidNonIncrementalData.GradleOuputDirectory, "unityLibrary/src/main/assets");

            // TODO: External\Android\NonRedistributable\ndk\builds\platforms doesn't contain android-16, which is used as default in Burst
            if (Unsupported.IsSourceBuild())
            {
#if UNITY_2019_3_OR_NEWER
                Environment.SetEnvironmentVariable("BURST_ANDROID_MIN_API_LEVEL", $"{21}");
#endif
            }
        }
예제 #8
0
 static Utils()
 {
     isDeveloperBuild = Unsupported.IsSourceBuild();
 }
예제 #9
0
    protected virtual string GetCannotBuildPlayerInCurrentSetupError()
    {
        var namedBuildTarget = EditorUserBuildSettingsUtils.CalculateSelectedNamedBuildTarget();
        var scriptingBackend = PlayerSettings.GetScriptingBackend(namedBuildTarget);

        if (namedBuildTarget == NamedBuildTarget.Server)
        {
            if (!m_HasServerPlayers)
            {
                return($"Dedicated Server support for {GetHostPlatformName()} is not installed.");
            }

            if (scriptingBackend == ScriptingImplementation.IL2CPP && !m_IsRunningOnHostPlatform)
            {
                return(string.Format("{0} IL2CPP player can only be built on {0}.", GetHostPlatformName()));
            }

            return(null);
        }

        switch (scriptingBackend)
        {
        case ScriptingImplementation.Mono2x:
        {
            if (!m_HasMonoPlayers)
            {
                return("Currently selected scripting backend (Mono) is not installed.");
            }
            break;
        }

            #pragma warning disable 618
        case ScriptingImplementation.CoreCLR:
        {
            if (!m_HasCoreCLRPlayers)
            {
                return($"Currently selected scripting backend (CoreCLR) is not {(Unsupported.IsSourceBuild() ? "installed" : "supported")}.");    // CORECLR_FIXME remove sourcebuild
            }
            break;
        }

        case ScriptingImplementation.IL2CPP:
        {
            if (!m_IsRunningOnHostPlatform)
            {
                return(string.Format("{0} IL2CPP player can only be built on {0}.", GetHostPlatformName()));
            }
            if (!m_HasIl2CppPlayers)
            {
                return("Currently selected scripting backend (IL2CPP) is not installed.");
            }
            break;
        }

        default:
        {
            return($"Unknown scripting backend: {scriptingBackend}");
        }
        }



        return(null);
    }