// get and store data that are only allowed to be accessed // from the main thread here so it won't generate errors // when we access them from threads. // // which means this function has to be called from the main // thread public static void Init(ref BuildInfo buildInfo) { if (buildInfo == null) { buildInfo = CreateNewBuildInfo(); } //Debug.Log("BuildTargetOfLastBuild: " + BuildReportTool.Util.BuildTargetOfLastBuild); buildInfo.TimeGot = DateTime.Now; buildInfo.TimeGotReadable = buildInfo.TimeGot.ToString(TIME_OF_BUILD_FORMAT); buildInfo.EditorAppContentsPath = EditorApplication.applicationContentsPath; buildInfo.ProjectAssetsPath = Application.dataPath; buildInfo.SetBuildTargetUsed(BuildReportTool.Util.BuildTargetOfLastBuild); buildInfo.ScenesIncludedInProject = BuildReportTool.Util.GetAllScenesUsedInProject(); //for (int n = 0, len = buildInfo.ScenesIncludedInProject.Length; n < len; ++n) //{ // Debug.Log("scene " + n + ": " + buildInfo.ScenesIncludedInProject[n]); //} buildInfo.UnityVersion = "Unity " + Application.unityVersion; buildInfo.IncludedSvnInUnused = BuildReportTool.Options.IncludeSvnInUnused; buildInfo.IncludedGitInUnused = BuildReportTool.Options.IncludeGitInUnused; buildInfo.UnusedAssetsEntriesPerBatch = BuildReportTool.Options.UnusedAssetsEntriesPerBatch; buildInfo.MonoLevel = PlayerSettings.apiCompatibilityLevel; buildInfo.CodeStrippingLevel = PlayerSettings.strippingLevel; if (BuildReportTool.Options.GetProjectSettings) { buildInfo.HasUnityBuildSettings = true; buildInfo.UnityBuildSettings = new UnityBuildSettings(); UnityBuildSettingsUtility.Populate(buildInfo.UnityBuildSettings); } else { buildInfo.HasUnityBuildSettings = false; buildInfo.UnityBuildSettings = null; } if (!string.IsNullOrEmpty(_lastPathToBuiltProject)) { buildInfo.BuildFilePath = _lastPathToBuiltProject; } else { buildInfo.BuildFilePath = EditorUserBuildSettings.GetBuildLocation(BuildReportTool.Util.BuildTargetOfLastBuild); } #if (UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_4 || UNITY_4_5 || UNITY_4_6) buildInfo.AndroidUseAPKExpansionFiles = PlayerSettings.Android.useAPKExpansionFiles; #endif buildInfo.AndroidCreateProject = buildInfo.BuildTargetUsed == BuildTarget.Android && Util.IsFileOfType(buildInfo.BuildFilePath, ".apk") == false; //Debug.Log("buildInfo.AndroidCreateProject: " + buildInfo.AndroidCreateProject); //Debug.Log("PlayerSettings.Android.useAPKExpansionFiles: " + PlayerSettings.Android.useAPKExpansionFiles); //Debug.Log("BuildOptions.AcceptExternalModificationsToPlayer: " + BuildOptions.AcceptExternalModificationsToPlayer); buildInfo.UsedAssetsIncludedInCreation = BuildReportTool.Options.IncludeUsedAssetsInReportCreation; buildInfo.UnusedAssetsIncludedInCreation = BuildReportTool.Options.IncludeUnusedAssetsInReportCreation; buildInfo.UnusedPrefabsIncludedInCreation = BuildReportTool.Options.IncludeUnusedPrefabsInReportCreation; _shouldCalculateBuildSize = BuildReportTool.Options.IncludeBuildSizeInReportCreation; // clear old values if any buildInfo.ProjectName = null; buildInfo.UsedAssets = null; buildInfo.UnusedAssets = null; //Debug.Log("getting _lastEditorLogPath"); _lastEditorLogPath = BuildReportTool.Util.UsedEditorLogPath; _lastSavePath = BuildReportTool.Options.BuildReportSavePath; }
// get and store data that are only allowed to be accessed // from the main thread here so it won't generate errors // when we access them from threads. // // which means this function has to be called from the main // thread public static void Init(ref BuildInfo buildInfo) { if (buildInfo == null) { buildInfo = CreateNewBuildInfo(); } buildInfo.TimeGot = DateTime.Now; buildInfo.TimeGotReadable = buildInfo.TimeGot.ToString(TIME_OF_BUILD_FORMAT); buildInfo.EditorAppContentsPath = EditorApplication.applicationContentsPath; buildInfo.ProjectAssetsPath = Application.dataPath; buildInfo.BuildFilePath = EditorUserBuildSettings.GetBuildLocation(EditorUserBuildSettings.activeBuildTarget); buildInfo.ScenesIncludedInProject = BuildReportTool.Util.GetAllScenesUsedInProject(); buildInfo.UnityVersion = "Unity " + Application.unityVersion; buildInfo.IncludedSvnInUnused = BuildReportTool.Options.IncludeSvnInUnused; buildInfo.IncludedGitInUnused = BuildReportTool.Options.IncludeGitInUnused; buildInfo.UnusedAssetsEntriesPerBatch = BuildReportTool.Options.UnusedAssetsEntriesPerBatch; buildInfo.CodeStrippingLevel = PlayerSettings.strippingLevel; buildInfo.MonoLevel = PlayerSettings.apiCompatibilityLevel; buildInfo.UsedAssetsIncludedInCreation = BuildReportTool.Options.IncludeUsedAssetsInReportCreation; buildInfo.UnusedAssetsIncludedInCreation = BuildReportTool.Options.IncludeUnusedAssetsInReportCreation; buildInfo.UnusedPrefabsIncludedInCreation = BuildReportTool.Options.IncludeUnusedPrefabsInReportCreation; buildInfo.SetBuildTargetUsed(EditorUserBuildSettings.activeBuildTarget); // clear old values if any buildInfo.ProjectName = null; buildInfo.UsedAssets = null; buildInfo.UnusedAssets = null; //Debug.Log("getting _lastEditorLogPath"); _lastEditorLogPath = BuildReportTool.Util.UsedEditorLogPath; _lastSavePath = BuildReportTool.Options.BuildReportSavePath; }