Skip to content

Commit

Permalink
Fix analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe committed Apr 7, 2024
1 parent 7c47494 commit 5249b79
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ffigen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,25 @@ jobs:
working-directory: pkgs/ffigen/
strategy:
fail-fast: false
matrix:
sdk: [3.3.0]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: ${{ matrix.sdk }}
sdk: 3.3.0
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
flutter-version: 3.19.0
channel: 'stable'
- id: install
name: Install dependencies
run: dart pub get && dart pub get --directory="example/shared_bindings"
run: flutter pub get && flutter pub get --directory="example/shared_bindings"
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Build test dylib and bindings
run: dart test/setup.dart
- name: Analyze code
run: dart analyze --fatal-infos
run: flutter analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

test-linux:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ffigen_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
with:
sdk: dev #3.3.0
sdk: 3.3.0
- uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225
with:
flutter-version: 3.19.0
channel: 'stable'
- name: Install dependencies
run: dart pub get
run: flutter pub get
- name: Build test dylib and bindings
run: dart test/setup.dart
- name: Run VM tests
Expand Down
12 changes: 9 additions & 3 deletions pkgs/objective_c/lib/objective_c.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
// BSD-style license that can be found in the LICENSE file.

export 'src/core.dart';
export 'src/objective_c_bindings_generated.dart' show
ObjCSelector, ObjCObject, ObjCBlock,
objectRetain, objectRelease, blockCopy, blockRelease;
export 'src/objective_c_bindings_generated.dart'
show
ObjCSelector,
ObjCObject,
ObjCBlock,
objectRetain,
objectRelease,
blockCopy,
blockRelease;
17 changes: 6 additions & 11 deletions pkgs/objective_c/lib/src/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:ffi';
import 'dart:io';
import 'dart:isolate';

import 'package:ffi/ffi.dart';

Expand Down Expand Up @@ -79,14 +76,13 @@ class _ObjCFinalizable<T extends NativeType> implements Finalizable {
}

NativeFinalizer get _finalizer => throw UnimplementedError();
void _retain(Pointer<T> pointer) => throw UnimplementedError();
void _release(Pointer<T> pointer) => throw UnimplementedError();
void _retain(Pointer<T> ptr) => throw UnimplementedError();
void _release(Pointer<T> ptr) => throw UnimplementedError();
}

class ObjCObjectBase extends _ObjCFinalizable<objc.ObjCObject> {
ObjCObjectBase(Pointer<objc.ObjCObject> ptr,
{required bool retain, required bool release})
: super(ptr, retain: retain, release: release);
ObjCObjectBase(super.ptr,
{required super.retain, required super.release});

static final _objectFinalizer = NativeFinalizer(
Native.addressOf<NativeFunction<Void Function(Pointer<objc.ObjCObject>)>>(
Expand All @@ -104,9 +100,8 @@ class ObjCObjectBase extends _ObjCFinalizable<objc.ObjCObject> {
}

class ObjCBlockBase extends _ObjCFinalizable<objc.ObjCBlock> {
ObjCBlockBase(Pointer<objc.ObjCBlock> ptr,
{required bool retain, required bool release})
: super(ptr, retain: retain, release: release);
ObjCBlockBase(super.ptr,
{required super.retain, required super.release});

static final _blockFinalizer = NativeFinalizer(
Native.addressOf<NativeFunction<Void Function(Pointer<objc.ObjCBlock>)>>(
Expand Down

0 comments on commit 5249b79

Please sign in to comment.