Skip to content

Added user agent string for build source to unity builds. #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ option(FIREBASE_INCLUDE_STORAGE
option(FIREBASE_UNITY_BUILD_TESTS
"Enable the Firebase Unity Build Tests." OFF)

# This should only be enabled by the GitHub Action build script.
option(FIREBASE_GITHUB_ACTION_BUILD
"Indicates that this build was created from a GitHub Action" OFF)

# These options allow selecting what built outputs go into the CPack zip file
# as we merge the different platform zip's together for unity package
# For example: only packing dotnet libraries on linux builds
Expand Down
11 changes: 11 additions & 0 deletions app/src/VersionInfoTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ internal class VersionInfo {
/// @brief Retrieves the Firebase Unity SDK version number as a string.
// "@FIREBASE_UNITY_SDK_VERSION@" is replaced at build time.
internal static string SdkVersion { get { return "@FIREBASE_UNITY_SDK_VERSION@"; } }

/// @brief Retrieves a string indicating whether the SDK was built on github.
internal static string BuildSource {
get {
#if FIREBASE_GITHUB_ACTION_BUILD
return "github_action_built";
#else
return "custom_built";
#endif
}
}
}

} // namespace Firebase
3 changes: 3 additions & 0 deletions app/src/swig/app.i
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,9 @@ static firebase::AppOptions* AppOptionsLoadFromJsonConfig(const char* config) {
RegisterLibraryInternal(
libraryPrefix + "-ver",
Firebase.Platform.PlatformInformation.RuntimeVersion);
// fire-(unity|mono)/<github-action-built|custom_built>
RegisterLibraryInternal(
libraryPrefix + "-buildsrc", Firebase.VersionInfo.BuildSource);
}
// Cache the name so that it can be accessed after the app is disposed.
newProxy.name = newProxy.NameInternal;
Expand Down