[go: nahoru, domu]

Skip to content

Commit

Permalink
Integrate Latest @ 345456564
Browse files Browse the repository at this point in the history
CL: 345456564
  • Loading branch information
a-maurice committed Dec 3, 2020
1 parent dab9375 commit abf77f4
Show file tree
Hide file tree
Showing 7 changed files with 460 additions and 169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public class UIHandler : MonoBehaviour {
// Set the user ID.
FirebaseAnalytics.SetUserId("uber_user_510");
// Set default session duration values.
FirebaseAnalytics.SetMinimumSessionDuration(new TimeSpan(0, 0, 10));
FirebaseAnalytics.SetSessionTimeoutDuration(new TimeSpan(0, 30, 0));
firebaseInitialized = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace Firebase.Sample.Database {
using Firebase;
using Firebase.Database;
using Firebase.Extensions;
using Firebase.Unity.Editor;
using System;
using System.Collections;
using System.Collections.Generic;
Expand Down
27 changes: 27 additions & 0 deletions firestore/testapp/Assets/Firebase/Editor/Builder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using UnityEditor;
using UnityEngine;

// Allows doing builds from the command line.
//
// For more information, see:
// https://docs.unity3d.com/Manual/CommandLineArguments.html
// https://docs.unity3d.com/ScriptReference/BuildOptions.html
// https://docs.unity3d.com/ScriptReference/BuildPipeline.BuildPlayer.html
public class Builder {

public static void BuildIos() {
var options = new BuildPlayerOptions();

options.scenes = new string[] { "Assets/Firebase/Sample/Firestore/MainSceneAutomated.unity" };
options.locationPathName = "ios-build";
options.target = BuildTarget.iOS;
// AcceptExternalModificationsToPlayer corresponds to "Append" in the Unity
// UI -- it allows doing incremental iOS build.
options.options = BuildOptions.AcceptExternalModificationsToPlayer;
// Firebase Unity plugins don't seem to work on a simulator.
PlayerSettings.iOS.sdkVersion = iOSSdkVersion.DeviceSDK;

BuildPipeline.BuildPlayer(options);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;

Expand All @@ -10,6 +12,12 @@ class EventAccumulator<T> {
private readonly List<T> events = new List<T>();
private int maxEvents = 0;
private bool assertOnAnyEvent = false;
private int mainThreadId = -1;

public EventAccumulator() { }
public EventAccumulator(int mainThreadId) {
this.mainThreadId = mainThreadId;
}

/// <summary>
/// Returns a listener callback suitable for passing to Listen().
Expand All @@ -19,7 +27,9 @@ class EventAccumulator<T> {
return (value) => {
lock (this) {
HardAssert(!assertOnAnyEvent, "Received unexpected event: " + value);
Debug.Log("EventAccumulator Received new event: " + value);
if (mainThreadId > 0) {
HardAssert(1 == Thread.CurrentThread.ManagedThreadId, "Listener callback from non-main thread.");
}
events.Add(value);
CheckFulfilled();
}
Expand Down Expand Up @@ -74,7 +84,7 @@ class EventAccumulator<T> {
private void HardAssert(bool condition, string message) {
if (!condition) {
string text = "Assertion Failure: " + message;
Debug.Log(text);
UnityEngine.Debug.Log(text);
throw new Exception(text);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E6ACD1E8-3BBF-45DE-A5C3-61A66F843BED}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Firebase.Sample.Firestore</RootNamespace>
<AssemblyName>Firebase.Sample.Firestore</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>False</ConsolePause>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="EventAccumulator.cs" />
<Compile Include="SerializationTestData.cs" />
<Compile Include="UIHandler.cs" />
<Compile Include="UIHandlerAutomated.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
Loading

0 comments on commit abf77f4

Please sign in to comment.