Skip to content

Commit 13aba5b

Browse files
Based on your feedback, I've reverted some recent changes to simplify the file structure and address a potential build error you encountered on Mac.
Specifically, I have: 1. **Removed `.asmdef` from `editor/app/src/`**: The editor scripts in this directory will now be compiled into the default editor assembly. 2. **Removed `FirebaseAnalyticsEditorConstants.cs` and reverted its usage**: * `editor/app/src/DllLocationPatcher.cs` now uses hardcoded strings for DLL names, paths, and type lookups. * `editor/app/src/AnalyticsPlayModeSetup.cs` now uses hardcoded strings for DLL names, paths, and type lookups. The goal here is to make things simpler and resolve the Mac build error (`CS0103: The name 'FirebaseAnalyticsEditorConstants' does not exist in the current context`) by removing the file that seemed to be causing the issue. If the build error continues on your Mac, I'll investigate further with this simplified setup.
1 parent 7d38c42 commit 13aba5b

File tree

4 files changed

+15
-54
lines changed

4 files changed

+15
-54
lines changed

editor/app/src/AnalyticsPlayModeSetup.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,29 @@ static AnalyticsPlayModeSetup() {
1616
private static void OnPlayModeStateChanged(PlayModeStateChange state) {
1717
if (state == PlayModeStateChange.EnteredPlayMode) {
1818
if (Application.platform == RuntimePlatform.WindowsEditor) {
19-
Type firebaseAnalyticsType = Type.GetType(FirebaseAnalyticsEditorConstants.AnalyticsTypeFullName);
19+
Type firebaseAnalyticsType = Type.GetType("Firebase.Analytics.FirebaseAnalytics, Firebase.Analytics");
2020
if (firebaseAnalyticsType != null) {
21-
if (File.Exists(FirebaseAnalyticsEditorConstants.DllSourcePath)) {
22-
string fullSourcePath = Path.GetFullPath(FirebaseAnalyticsEditorConstants.DllSourcePath);
21+
if (File.Exists("./analytics_win.dll")) {
22+
string fullSourcePath = Path.GetFullPath("./analytics_win.dll");
2323
// string destinationDirectory = "./"; // This is DestinationDir
24-
string fullDestinationPath = Path.GetFullPath(Path.Combine(DestinationDir, FirebaseAnalyticsEditorConstants.DllName));
24+
string fullDestinationPath = Path.GetFullPath(Path.Combine(DestinationDir, "analytics_win.dll"));
2525

2626
if (fullSourcePath.Equals(fullDestinationPath, StringComparison.OrdinalIgnoreCase)) {
27-
Debug.Log("Firebase Analytics: " + FirebaseAnalyticsEditorConstants.DllName + " is already in the project root. No copy needed for Play Mode.");
27+
Debug.Log("Firebase Analytics: analytics_win.dll is already in the project root. No copy needed for Play Mode.");
2828
return;
2929
}
3030

3131
try {
3232
Directory.CreateDirectory(DestinationDir); // Should be benign for "./"
33-
string destinationDllPath = Path.Combine(DestinationDir, FirebaseAnalyticsEditorConstants.DllName);
34-
File.Copy(FirebaseAnalyticsEditorConstants.DllSourcePath, destinationDllPath, true);
35-
Debug.Log("Firebase Analytics: Copied " + FirebaseAnalyticsEditorConstants.DllName + " to project root for Play Mode.");
33+
string destinationDllPath = Path.Combine(DestinationDir, "analytics_win.dll");
34+
File.Copy("./analytics_win.dll", destinationDllPath, true);
35+
Debug.Log("Firebase Analytics: Copied analytics_win.dll to project root for Play Mode.");
3636
} catch (Exception e) {
37-
Debug.LogError("Firebase Analytics: Error copying " + FirebaseAnalyticsEditorConstants.DllName + " for Play Mode: " + e.Message);
37+
Debug.LogError("Firebase Analytics: Error copying analytics_win.dll for Play Mode: " + e.Message);
3838
}
3939
} else {
4040
// Optional: Log if source DLL is not found, as it might be expected if Analytics is not used.
41-
// Debug.LogWarning("Firebase Analytics: Source DLL " + FirebaseAnalyticsEditorConstants.DllSourcePath + " not found. Skipping Play Mode setup.");
41+
// Debug.LogWarning("Firebase Analytics: Source DLL ./analytics_win.dll not found. Skipping Play Mode setup.");
4242
}
4343
}
4444
}

editor/app/src/DllLocationPatcher.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,21 @@ internal static void OnPostProcessBuildWindowsAnalytics(
9696
BuildTarget buildTarget, string pathToBuiltProject) {
9797
if (buildTarget == BuildTarget.StandaloneWindows ||
9898
buildTarget == BuildTarget.StandaloneWindows64) {
99-
Type firebaseAnalyticsType = Type.GetType(FirebaseAnalyticsEditorConstants.AnalyticsTypeFullName);
99+
Type firebaseAnalyticsType = Type.GetType("Firebase.Analytics.FirebaseAnalytics, Firebase.Analytics");
100100
if (firebaseAnalyticsType != null) {
101-
string sourceDllPath = FirebaseAnalyticsEditorConstants.DllSourcePath;
101+
string sourceDllPath = "./analytics_win.dll";
102102
if (System.IO.File.Exists(sourceDllPath)) {
103103
try {
104104
string destinationDirectory = Path.Combine(
105105
Path.GetDirectoryName(pathToBuiltProject),
106106
Path.GetFileNameWithoutExtension(pathToBuiltProject) + "_Data",
107107
"Plugins");
108108
System.IO.Directory.CreateDirectory(destinationDirectory);
109-
string destinationDllPath = Path.Combine(destinationDirectory, FirebaseAnalyticsEditorConstants.DllName);
109+
string destinationDllPath = Path.Combine(destinationDirectory, "analytics_win.dll");
110110
System.IO.File.Copy(sourceDllPath, destinationDllPath, true);
111-
Debug.Log("Firebase Analytics: Copied " + FirebaseAnalyticsEditorConstants.DllName + " to build plugins directory.");
111+
Debug.Log("Firebase Analytics: Copied analytics_win.dll to build plugins directory.");
112112
} catch (System.Exception e) {
113-
Debug.LogError("Firebase Analytics: Error copying " + FirebaseAnalyticsEditorConstants.DllName + " for build: " + e.Message);
113+
Debug.LogError("Firebase Analytics: Error copying analytics_win.dll for build: " + e.Message);
114114
}
115115
}
116116
}

editor/app/src/Firebase.Editor.App.asmdef

Lines changed: 0 additions & 16 deletions
This file was deleted.

editor/app/src/FirebaseAnalyticsEditorConstants.cs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)