/// <summary> /// Writes out <c>BuildInfo</c> prior to build. /// </summary> public override void OnBeforeBuild() { GDXConfig config = GDXConfig.Get(); if (config == null || !config.developerBuildInfoEnabled) { return; } // Cache for destructor _enabled = true; try { string path = Path.Combine(Application.dataPath, config.developerBuildInfoPath); Platform.EnsureFileFolderHierarchyExists(path); File.WriteAllText(path, BuildInfoProvider.GetContent(config, false, Context.BuildConfigurationName)); BuildInfoProvider.CheckForAssemblyDefinition(); } catch (Exception e) { Debug.LogWarning(e); } }
/// <summary> /// Writes out <c>BuildInfo</c> prior to build. /// </summary> /// <param name="report">Build process reported information.</param> public void OnPreprocessBuild(BuildReport report) { GDXConfig config = GDXConfig.Get(); if (config == null || !config.developerBuildInfoEnabled) { return; } try { string path = Path.Combine(Application.dataPath, config.developerBuildInfoPath); Platform.EnsureFileFolderHierarchyExists(path); File.WriteAllText(path, BuildInfoProvider.GetContent(config, false, "Legacy")); BuildInfoProvider.CheckForAssemblyDefinition(); } catch (Exception e) { Debug.LogWarning(e); } }
public void True_GetContent_ForceDefaults() { string generateContent = BuildInfoProvider.GetContent(GDXConfig.Get(), true); Assert.IsTrue(generateContent.Contains(" public const int Changelist = 0;"), "Expected to find 'public const int Changelist = 0;'"); }