From 912698a49f149b3f508fb472f9d5c8d92d39b47b Mon Sep 17 00:00:00 2001 From: Levi Lesches Date: Wed, 18 Dec 2024 18:59:17 -0800 Subject: [PATCH] Pub Workspace and opencv_dart -> dartcv (#19) --- .github/pubspec_overrides.yaml | 7 +++++++ .github/workflows/analyze.yml | 12 ++++++++++-- .gitignore | 2 +- lib/src/isolates/opencv.dart | 2 +- lib/src/utils/aruco.dart | 2 +- lib/src/utils/constants.dart | 4 ++-- lib/src/utils/opencv.dart | 2 +- pubspec.yaml | 12 ++++++------ 8 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 .github/pubspec_overrides.yaml diff --git a/.github/pubspec_overrides.yaml b/.github/pubspec_overrides.yaml new file mode 100644 index 0000000..528baa8 --- /dev/null +++ b/.github/pubspec_overrides.yaml @@ -0,0 +1,7 @@ +resolution: + +dependency_overrides: + burt_network: + git: + url: https://github.com/BinghamtonRover/Networking + ref: 2.3.1 diff --git a/.github/workflows/analyze.yml b/.github/workflows/analyze.yml index 1d61903..6b75e51 100644 --- a/.github/workflows/analyze.yml +++ b/.github/workflows/analyze.yml @@ -17,9 +17,17 @@ jobs: # https://github.com/dart-lang/setup-dart/blob/main/README.md - uses: dart-lang/setup-dart@v1 + # This package is part of a Pub Workspace. However, CI still needs to + # run on this repo by itself, so we want to override burt_network to use + # a Git dependency ONLY on GitHub Actions. + # + # To get around this, we commit the overrides to the .github folder where + # Dart can't find them, then copy them as part of the CI workflow. - name: Install dependencies - run: dart pub get - + run: | + mv .github/pubspec_overrides.yaml . + dart pub get + - name: Analyze project source run: dart analyze --fatal-infos diff --git a/.gitignore b/.gitignore index e0df0f9..5bd5bb9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ .dart_tool/ # Needed to allow the rover to build offline but allow us to build online -pubspec_overrides.yaml +./pubspec_overrides.yaml pubspec.lock # RealSense SDK build artifacts diff --git a/lib/src/isolates/opencv.dart b/lib/src/isolates/opencv.dart index 1834085..5eabe58 100644 --- a/lib/src/isolates/opencv.dart +++ b/lib/src/isolates/opencv.dart @@ -1,4 +1,4 @@ -import "package:opencv_dart/opencv_dart.dart"; +import "package:dartcv4/dartcv.dart"; import "package:burt_network/burt_network.dart"; import "package:video/utils.dart"; diff --git a/lib/src/utils/aruco.dart b/lib/src/utils/aruco.dart index 7c35cd0..899fc24 100644 --- a/lib/src/utils/aruco.dart +++ b/lib/src/utils/aruco.dart @@ -1,4 +1,4 @@ -import "package:opencv_dart/opencv_dart.dart"; +import "package:dartcv4/dartcv.dart"; final _arucoDictionary = ArucoDictionary.predefined(PredefinedDictionaryType.DICT_4X4_50); final _arucoParams = ArucoDetectorParameters.empty(); diff --git a/lib/src/utils/constants.dart b/lib/src/utils/constants.dart index e9e533d..94d6f4c 100644 --- a/lib/src/utils/constants.dart +++ b/lib/src/utils/constants.dart @@ -1,7 +1,7 @@ import "dart:io"; -import "package:burt_network/generated.dart"; -import "package:opencv_dart/opencv_dart.dart"; +import "package:burt_network/protobuf.dart"; +import "package:dartcv4/dartcv.dart"; /// These list maps OpenCV IDs (index) to [CameraName]s. /// diff --git a/lib/src/utils/opencv.dart b/lib/src/utils/opencv.dart index e41bcce..4179cea 100644 --- a/lib/src/utils/opencv.dart +++ b/lib/src/utils/opencv.dart @@ -1,7 +1,7 @@ import "dart:ffi"; import "dart:typed_data"; -import "package:opencv_dart/opencv_dart.dart"; +import "package:dartcv4/dartcv.dart"; import "package:video/realsense.dart"; /// Useful methods to adjust settings of an OpenCV video device. diff --git a/pubspec.yaml b/pubspec.yaml index fbf1220..654c270 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,22 +1,22 @@ name: video description: A sample command-line application. -version: 1.0.0 +version: 1.1.0 publish_to: none +resolution: workspace environment: - sdk: ^3.0.0 + sdk: ^3.6.0 # Add regular dependencies here. dependencies: - burt_network: - git: https://github.com/BinghamtonRover/Networking + burt_network: ^2.3.1 typed_isolate: ^6.0.0 ffi: ^2.1.0 protobuf: ^3.1.0 - opencv_dart: ^2.1.0-dev.0 + dartcv4: ^1.0.1 dev_dependencies: - ffigen: ^15.0.0 + ffigen: ^16.0.0 test: ^1.21.0 very_good_analysis: ^6.0.0