Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit eaa1388

Browse files
authored
Reconfigure Cirrus to use clang 7 (#905)
clang-format 5.0 formats ObjC files differently than newer versions, which results in the CI failing the format check for PRs formatted locally with a recent clang version. The latest clang version available on the Ubuntu repositories for the Cirrus machines is 7, upgrading to that seems to be consistent with what I locally get with clang-format 8.0. This PR also reformats all files with the new clang style.
1 parent 78e23e4 commit eaa1388

File tree

63 files changed

+250
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+250
-238
lines changed

.cirrus.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ task:
1414
- name: test+format
1515
install_script:
1616
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
17-
- sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main"
17+
- sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main"
1818
- sudo apt-get update
19-
- sudo apt-get install -y --allow-unauthenticated clang-format-5.0
20-
format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-5.0
19+
- sudo apt-get install -y --allow-unauthenticated clang-format-7
20+
format_script: ./script/incremental_build.sh format --travis --clang-format=clang-format-7
2121
test_script: ./script/incremental_build.sh test
2222
- name: analyze
2323
script: ./script/incremental_build.sh analyze

packages/android_alarm_manager/ios/Classes/AndroidAlarmManagerPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
#import <Flutter/Flutter.h>
66

7-
@interface FLTAndroidAlarmManagerPlugin : NSObject<FlutterPlugin>
7+
@interface FLTAndroidAlarmManagerPlugin : NSObject <FlutterPlugin>
88
@end

packages/android_intent/ios/Classes/AndroidIntentPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
#import <Flutter/Flutter.h>
66

7-
@interface FLTAndroidIntentPlugin : NSObject<FlutterPlugin>
7+
@interface FLTAndroidIntentPlugin : NSObject <FlutterPlugin>
88
@end

packages/battery/ios/Classes/BatteryPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
#import <Flutter/Flutter.h>
66

7-
@interface FLTBatteryPlugin : NSObject<FlutterPlugin>
7+
@interface FLTBatteryPlugin : NSObject <FlutterPlugin>
88
@end

packages/battery/ios/Classes/BatteryPlugin.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#import "BatteryPlugin.h"
66

7-
@interface FLTBatteryPlugin ()<FlutterStreamHandler>
7+
@interface FLTBatteryPlugin () <FlutterStreamHandler>
88
@end
99

1010
@implementation FLTBatteryPlugin {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#import <Flutter/Flutter.h>
22

3-
@interface CameraPlugin : NSObject<FlutterPlugin>
3+
@interface CameraPlugin : NSObject <FlutterPlugin>
44
@end

packages/camera/ios/Classes/CameraPlugin.m

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ - (FlutterError *)flutterError {
1414
}
1515
@end
1616

17-
@interface FLTSavePhotoDelegate : NSObject<AVCapturePhotoCaptureDelegate>
17+
@interface FLTSavePhotoDelegate : NSObject <AVCapturePhotoCaptureDelegate>
1818
@property(readonly, nonatomic) NSString *path;
1919
@property(readonly, nonatomic) FlutterResult result;
2020

@@ -59,8 +59,10 @@ - (void)captureOutput:(AVCapturePhotoOutput *)output
5959
}
6060
@end
6161

62-
@interface FLTCam : NSObject<FlutterTexture, AVCaptureVideoDataOutputSampleBufferDelegate,
63-
AVCaptureAudioDataOutputSampleBufferDelegate, FlutterStreamHandler>
62+
@interface FLTCam : NSObject <FlutterTexture,
63+
AVCaptureVideoDataOutputSampleBufferDelegate,
64+
AVCaptureAudioDataOutputSampleBufferDelegate,
65+
FlutterStreamHandler>
6466
@property(readonly, nonatomic) int64_t textureId;
6567
@property(nonatomic, copy) void (^onFrameAvailable)();
6668
@property(nonatomic) FlutterEventChannel *eventChannel;
@@ -111,8 +113,8 @@ - (instancetype)initWithCameraName:(NSString *)cameraName
111113
_captureSession.sessionPreset = preset;
112114
_captureDevice = [AVCaptureDevice deviceWithUniqueID:cameraName];
113115
NSError *localError = nil;
114-
_captureVideoInput =
115-
[AVCaptureDeviceInput deviceInputWithDevice:_captureDevice error:&localError];
116+
_captureVideoInput = [AVCaptureDeviceInput deviceInputWithDevice:_captureDevice
117+
error:&localError];
116118
if (localError) {
117119
*error = localError;
118120
return nil;
@@ -123,7 +125,7 @@ - (instancetype)initWithCameraName:(NSString *)cameraName
123125

124126
_captureVideoOutput = [AVCaptureVideoDataOutput new];
125127
_captureVideoOutput.videoSettings =
126-
@{(NSString *)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA) };
128+
@{(NSString *)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA)};
127129
[_captureVideoOutput setAlwaysDiscardsLateVideoFrames:YES];
128130
[_captureVideoOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];
129131

@@ -154,9 +156,9 @@ - (void)stop {
154156
- (void)captureToFile:(NSString *)path result:(FlutterResult)result {
155157
AVCapturePhotoSettings *settings = [AVCapturePhotoSettings photoSettings];
156158
[settings setHighResolutionPhotoEnabled:YES];
157-
[_capturePhotoOutput
158-
capturePhotoWithSettings:settings
159-
delegate:[[FLTSavePhotoDelegate alloc] initWithPath:path result:result]];
159+
[_capturePhotoOutput capturePhotoWithSettings:settings
160+
delegate:[[FLTSavePhotoDelegate alloc] initWithPath:path
161+
result:result]];
160162
}
161163

162164
- (void)captureOutput:(AVCaptureOutput *)output
@@ -330,8 +332,9 @@ - (BOOL)setupWriterForPath:(NSString *)path {
330332
if (!_isAudioSetup) {
331333
[self setUpCaptureSessionForAudio];
332334
}
333-
_videoWriter =
334-
[[AVAssetWriter alloc] initWithURL:outputURL fileType:AVFileTypeQuickTimeMovie error:&error];
335+
_videoWriter = [[AVAssetWriter alloc] initWithURL:outputURL
336+
fileType:AVFileTypeQuickTimeMovie
337+
error:&error];
335338
NSParameterAssert(_videoWriter);
336339
if (error) {
337340
_eventSink(@{@"event" : @"error", @"errorDescription" : error.description});
@@ -375,8 +378,8 @@ - (void)setUpCaptureSessionForAudio {
375378
// Create a device input with the device and add it to the session.
376379
// Setup the audio input.
377380
AVCaptureDevice *audioDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeAudio];
378-
AVCaptureDeviceInput *audioInput =
379-
[AVCaptureDeviceInput deviceInputWithDevice:audioDevice error:&error];
381+
AVCaptureDeviceInput *audioInput = [AVCaptureDeviceInput deviceInputWithDevice:audioDevice
382+
error:&error];
380383
if (error) {
381384
_eventSink(@{@"event" : @"error", @"errorDescription" : error.description});
382385
}
@@ -411,8 +414,8 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
411414
FlutterMethodChannel *channel =
412415
[FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/camera"
413416
binaryMessenger:[registrar messenger]];
414-
CameraPlugin *instance =
415-
[[CameraPlugin alloc] initWithRegistry:[registrar textures] messenger:[registrar messenger]];
417+
CameraPlugin *instance = [[CameraPlugin alloc] initWithRegistry:[registrar textures]
418+
messenger:[registrar messenger]];
416419
[registrar addMethodCallDelegate:instance channel:channel];
417420
}
418421

packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
#import <Flutter/Flutter.h>
66

7-
@interface FLTCloudFirestorePlugin : NSObject<FlutterPlugin>
7+
@interface FLTCloudFirestorePlugin : NSObject <FlutterPlugin>
88
@end

packages/cloud_firestore/ios/Classes/CloudFirestorePlugin.m

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -295,27 +295,28 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
295295
result(error.flutterError);
296296
};
297297
if ([@"Firestore#runTransaction" isEqualToString:call.method]) {
298-
[getFirestore(call.arguments) runTransactionWithBlock:^id(FIRTransaction *transaction,
299-
NSError **pError) {
300-
NSNumber *transactionId = call.arguments[@"transactionId"];
301-
NSNumber *transactionTimeout = call.arguments[@"transactionTimeout"];
298+
[getFirestore(call.arguments)
299+
runTransactionWithBlock:^id(FIRTransaction *transaction, NSError **pError) {
300+
NSNumber *transactionId = call.arguments[@"transactionId"];
301+
NSNumber *transactionTimeout = call.arguments[@"transactionTimeout"];
302302

303-
self->transactions[transactionId] = transaction;
303+
self->transactions[transactionId] = transaction;
304304

305-
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
305+
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
306306

307-
[self.channel invokeMethod:@"DoTransaction"
308-
arguments:call.arguments
309-
result:^(id doTransactionResult) {
310-
self->transactionResults[transactionId] = doTransactionResult;
311-
dispatch_semaphore_signal(semaphore);
312-
}];
307+
[self.channel invokeMethod:@"DoTransaction"
308+
arguments:call.arguments
309+
result:^(id doTransactionResult) {
310+
self->transactionResults[transactionId] = doTransactionResult;
311+
dispatch_semaphore_signal(semaphore);
312+
}];
313313

314-
dispatch_semaphore_wait(
315-
semaphore, dispatch_time(DISPATCH_TIME_NOW, [transactionTimeout integerValue] * 1000000));
314+
dispatch_semaphore_wait(
315+
semaphore,
316+
dispatch_time(DISPATCH_TIME_NOW, [transactionTimeout integerValue] * 1000000));
316317

317-
return self->transactionResults[transactionId];
318-
}
318+
return self->transactionResults[transactionId];
319+
}
319320
completion:^(id transactionResult, NSError *error) {
320321
if (error != nil) {
321322
result([FlutterError errorWithCode:[NSString stringWithFormat:@"%ld", error.code]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#import <Flutter/Flutter.h>
22

3-
@interface CloudFunctionsPlugin : NSObject<FlutterPlugin>
3+
@interface CloudFunctionsPlugin : NSObject <FlutterPlugin>
44
@end

0 commit comments

Comments
 (0)