Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif
using UnityEngine;

namespace CoreBluetoothEditor
Expand All @@ -16,15 +18,18 @@ public class BuildPostprocessor : IPostprocessBuildWithReport

public void OnPostprocessBuild(BuildReport report)
{
#if UNITY_IOS
var buildTarget = report.summary.platform;
if (buildTarget == BuildTarget.iOS)
{
ProcessForiOS(report);
}

Debug.Log("BuildPostprocessor.OnPostprocessBuild for target " + report.summary.platform + " at path " + report.summary.outputPath);
#endif
}

#if UNITY_IOS
void ProcessForiOS(BuildReport report)
{
var buildOutputPath = report.summary.outputPath;
Expand Down Expand Up @@ -73,5 +78,6 @@ void DisableBitcode(PBXProject project)
var unityFrameworkTargetGuid = project.GetUnityFrameworkTargetGuid();
project.SetBuildProperty(unityFrameworkTargetGuid, "ENABLE_BITCODE", "NO");
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class CBCentralManagerDelegateMock : ICBCentralManagerDelegate

public class CBCentralManagerTests : CBTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void Create()
{
Expand Down Expand Up @@ -88,5 +89,6 @@ public IEnumerator RetrievePeripherals()
Assert.That(peripherals, Is.Not.Null);
Assert.That(peripherals.Length, Is.EqualTo(0));
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace CoreBluetoothTests
{
public class CBCharacteristicTests : CBTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void Value_Set_NotImplemented()
{
Expand All @@ -19,5 +20,6 @@ public void Properties_Set_NotImplemented()
var characteristic = new CBCharacteristic(validUUID1, null);
Assert.That(() => characteristic.Properties = CBCharacteristicProperties.Broadcast, Throws.TypeOf<NotImplementedException>());
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace CoreBluetoothTests
{
public class CBMutableCharacteristicTests : CBTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void Create()
{
Expand Down Expand Up @@ -62,5 +63,6 @@ public void ToString_Output()
using var characteristic = new CBMutableCharacteristic(validUUID1, CBCharacteristicProperties.Broadcast, null, CBAttributePermissions.Readable);
Assert.That(characteristic.ToString(), Is.EqualTo($"CBMutableCharacteristic: UUID = {validUUID1}, properties = Broadcast, value = null, notifying = NO, permissions = Readable"));
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace CoreBluetoothTests
{
public class CBMutableServiceTests : CBTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void Create()
{
Expand Down Expand Up @@ -40,5 +41,6 @@ public void Characteristics_Set()
item.Dispose();
}
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void DidStartAdvertising(CBPeripheralManager peripheral, CBError error)

public class CBPeripheralManagerTests : CBTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void Create()
{
Expand Down Expand Up @@ -176,5 +177,6 @@ public IEnumerator AlreadyAdvertising()
Assert.That(delegateMock.DidStartAdvertisingCount, Is.EqualTo(2));
Assert.That(delegateMock.Error.ErrorCode, Is.EqualTo(CBError.Code.AlreadyAdvertising));
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace CoreBluetoothTests
{
public class CBServiceTests : CBTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void Characteristics_Set_NotImplemented()
{
Expand Down Expand Up @@ -36,5 +37,6 @@ public void UpdateCharacteristics()
service.UpdateCharacteristics(null);
Assert.That(service.Characteristics, Is.Null);
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace CoreBluetoothTests.Foundation
{
public class NSArrayTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void FromStrings()
{
Expand All @@ -20,5 +21,6 @@ public void StringsFromHandle()
var strings = NSArray.StringsFromHandle(nsArray.Handle);
Assert.That(strings, Is.EqualTo(new[] { "hoge", "fuga" }));
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace CoreBluetoothTests.Foundation
{
public class NSMutableDictionaryTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void New()
{
Expand Down Expand Up @@ -51,5 +52,6 @@ public void TryGetValue()
using var notFoundKey = new NSString("dummy");
Assert.That(nsDictionary.TryGetValue(notFoundKey.Handle, out gotPtr), Is.False);
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace CoreBluetoothTests.Foundation
{
public class NSNumberTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void IntValue()
{
Expand All @@ -27,5 +28,6 @@ public void BoolValue()
Assert.That(falseNumber.Handle.IsInvalid, Is.False);
Assert.That(falseNumber.BoolValue, Is.False);
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace CoreBluetoothTests.Foundation
{
public class NSStringTests
{
#if UNITY_IOS || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
[Test]
public void New()
{
Expand Down Expand Up @@ -50,5 +51,6 @@ public void HandleToString()
Assert.That(NSString.HandleToString(nsString.Handle), Is.EqualTo(string.Empty));
}
}
#endif
}
}