Skip to content

Commit 2c14492

Browse files
Merge branch 'flutter-3.0'
2 parents 5fbdef1 + dfa8a30 commit 2c14492

File tree

8 files changed

+46
-40
lines changed

8 files changed

+46
-40
lines changed

.github/workflows/dart.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
generator:
1717
runs-on: ubuntu-20.04
1818
container:
19-
image: google/dart:latest
19+
image: dart:2.17.0
2020
steps:
2121
- uses: actions/checkout@v2
2222
- name: Install ObjectBox C-API
@@ -30,6 +30,9 @@ jobs:
3030
steps:
3131
- uses: actions/checkout@v2
3232
- uses: subosito/flutter-action@v2
33+
with:
34+
flutter-version: 3.0.0
35+
cache: true
3336
- run: ./tool/init.sh
3437

3538
lib:
@@ -41,17 +44,16 @@ jobs:
4144
- macos-11
4245
- ubuntu-20.04
4346
sdk:
44-
- stable
47+
- 2.17.0
48+
- 2.16.2
4549
- 2.15.1
4650
- 2.14.4
47-
- 2.13.4
4851
- 2.12.0 # currently the lowest fully supported version (i.e. generator + lib)
4952
runs-on: ${{ matrix.os }}
5053
steps:
5154
- uses: dart-lang/setup-dart@v1
5255
with:
5356
sdk: ${{ matrix.sdk }}
54-
- run: dart --version
5557
- uses: actions/checkout@v2
5658
- name: Install ObjectBox C-API
5759
working-directory: objectbox
@@ -67,6 +69,8 @@ jobs:
6769
runs-on: ubuntu-20.04
6870
steps:
6971
- uses: dart-lang/setup-dart@v1
72+
with:
73+
sdk: 2.17.0
7074
- uses: actions/checkout@v2
7175
- name: Install ObjectBox C-API
7276
run: ./install.sh
@@ -87,25 +91,34 @@ jobs:
8791
fail-fast: false
8892
matrix:
8993
os:
90-
- windows-2022
9194
- macos-11
9295
- ubuntu-20.04
93-
channel:
94-
- beta
95-
- stable
96+
flutter-version:
97+
- 3.0.0
98+
- 2.2.0
99+
# 2.0.0 technically lowest supported, but need 2.2.0 to correctly resolve null safety dependencies.
100+
# https://github.com/flutter/flutter/issues/77282
101+
include:
102+
- flutter-version: 3.0.0 # Flutter 2.9 and newer need Visual Studio 2022 to build desktop.
103+
os: windows-2022
104+
- flutter-version: 2.2.0 # Flutter 2.8.1 and older need Visual Studio 2019 to build desktop.
105+
os: windows-2019
96106
runs-on: ${{ matrix.os }}
97107
steps:
98108
- uses: actions/checkout@v2
99109
- uses: subosito/flutter-action@v2
100110
with:
101-
channel: ${{ matrix.channel }}
102-
- uses: actions/setup-java@v2 # macos-10.15 and windows-2019 default to Java 8, but Android Plugin requires 11
111+
flutter-version: ${{ matrix.flutter-version }}
112+
cache: true
113+
# macos-11 and windows-2019/2022 default to Java 8, but Android Plugin requires 11.
114+
- uses: actions/setup-java@v2
103115
with:
104116
distribution: 'temurin'
105117
java-version: '11'
106118
- run: echo $PATH
107119
- run: flutter --version
120+
# https://docs.flutter.dev/desktop#additional-linux-requirements
108121
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
109122
run: ./tool/apt-install.sh ninja-build pkg-config libgtk-3-dev
110123
- run: make integration-test
111-
working-directory: objectbox
124+
working-directory: objectbox

.github/workflows/lint.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
analyze:
1313
runs-on: ubuntu-20.04
1414
container:
15-
image: google/dart:latest
15+
image: dart:2.17.0
1616
steps:
1717
- uses: actions/checkout@v2
1818
- run: dart run build_runner build
@@ -22,7 +22,7 @@ jobs:
2222
- run: dart format --set-exit-if-changed --fix .
2323

2424
pana:
25-
runs-on: ubuntu-latest
25+
runs-on: ubuntu-20.04
2626
steps:
2727
- uses: actions/checkout@v2
2828
- uses: axel-op/dart-package-analyzer@v3
@@ -41,11 +41,14 @@ jobs:
4141
fi
4242
4343
coverage:
44-
runs-on: ubuntu-latest
44+
runs-on: ubuntu-20.04
4545
steps:
4646
- uses: actions/checkout@v2
4747
- uses: subosito/flutter-action@v2
48-
- name: Generage test coverage
48+
with:
49+
flutter-version: 3.0.0
50+
cache: true
51+
- name: Generate test coverage
4952
working-directory: objectbox
5053
run: |
5154
../tool/apt-install.sh lcov

.gitlab-ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ stages:
55
variables:
66
# Note: use specific tags as docker images may not always be pulled due to "if-not-present" pull policy.
77
# Thus, do not use tags like latest/beta, but check https://hub.docker.com/_/dart?tab=tags for latest.
8-
DART_VERSION: '2.16.2'
8+
DART_VERSION: '2.17.0'
99

1010
# Make PUB_CACHE cacheable in GitLab;
1111
# see also https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77791/diffs and
@@ -67,4 +67,5 @@ test-lib:linux:x64:
6767
matrix:
6868
# Note: use specific tags as docker images may not always be pulled due to "if-not-present" pull policy.
6969
# Thus, do not use tags like latest/beta, but check https://hub.docker.com/_/dart?tab=tags for latest.
70-
- DART_VERSION: [ '2.13.4', '2.14.4', '2.15.1', '2.16.1', '2.16.2' ]
70+
# Always include lowest supported version (see sdk key in objectbox and generator pubspec.yaml).
71+
- DART_VERSION: [ '2.12', '2.14.4', '2.15.1', '2.16.1', '2.16.2', '2.17.0' ]

objectbox/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ help: ## Show this help
1111
all: depend test valgrind-test integration-test
1212

1313
depend: ## Build dependencies
14-
pub get
14+
dart pub get
1515
../install.sh
1616

1717
test: ## Test all targets
18-
pub run build_runner build
19-
pub run test
18+
dart run build_runner build
19+
dart run test
2020

2121
coverage: ## Calculate test coverage
22-
pub run build_runner build
22+
dart run build_runner build
2323
# Note: only flutter test generates `.lcov` - can't use `dart test`
2424
flutter test --coverage
2525
lcov --remove coverage/lcov.info 'lib/src/native/sync.dart' 'lib/src/native/bindings/objectbox_c.dart' 'lib/src/native/bindings/bindings.dart' 'lib/src/modelinfo/*' -o coverage/lcov.info
2626
genhtml coverage/lcov.info -o coverage/html || true
2727

2828
valgrind-test: ## Test all targets with valgrind
29-
pub run build_runner build
29+
dart run build_runner build
3030
./tool/valgrind.sh
3131

3232
integration-test: ## Execute integration tests
@@ -35,4 +35,4 @@ integration-test: ## Execute integration tests
3535
./tool/integration-test.sh example/flutter/objectbox_demo_sync
3636

3737
format: ## Format all code
38-
dartfmt -w .
38+
dart format .

objectbox/example/flutter/objectbox_demo/pubspec.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ description: An example project for the objectbox-dart binding.
33
version: 0.3.0+1
44

55
environment:
6-
sdk: ^2.12.0
7-
flutter: ^2.0.0
6+
sdk: ">=2.13.0 <3.0.0"
87

98
dependencies:
109
flutter:
@@ -32,8 +31,3 @@ dependency_overrides:
3231
path: ../../../../generator
3332
objectbox_flutter_libs:
3433
path: ../../../../flutter_libs
35-
36-
# Temporary flutter_driver issue, same as https://github.com/flutter/flutter/issues/77282
37-
archive: ^3.0.0
38-
convert: ^3.0.0
39-
crypto: ^3.0.0

objectbox/example/flutter/objectbox_demo_relations/pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1818
version: 1.0.0+1
1919

2020
environment:
21-
sdk: ">=2.12.0 <3.0.0"
21+
sdk: ">=2.13.0 <3.0.0"
2222

2323
# Dependencies specify other packages that your package needs in order to work.
2424
# To automatically upgrade your package dependencies to the latest versions
@@ -50,7 +50,6 @@ dev_dependencies:
5050
# package. See that file for information about deactivating specific lint
5151
# rules and activating additional ones.
5252
flutter_lints: ^1.0.0
53-
test: ^1.17.10
5453

5554
# For information on the generic Dart part of this file, see the
5655
# following page: https://dart.dev/tools/pub/pubspec

objectbox/example/flutter/objectbox_demo_sync/pubspec.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ description: An example project for the objectbox-dart binding.
33
version: 0.3.0+1
44

55
environment:
6-
sdk: ^2.12.0
7-
flutter: ^2.0.0
6+
sdk: ">=2.13.0 <3.0.0"
87

98
dependencies:
109
flutter:
@@ -32,8 +31,3 @@ dependency_overrides:
3231
path: ../../../../generator
3332
objectbox_sync_flutter_libs:
3433
path: ../../../../sync_flutter_libs
35-
36-
# Temporary flutter_driver issue, same as https://github.com/flutter/flutter/issues/77282
37-
archive: ^3.0.0
38-
convert: ^3.0.0
39-
crypto: ^3.0.0

objectbox/tool/integration-test.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ cd "${root}/$1"
1515
flutter clean
1616
flutter pub get
1717

18-
flutter pub run build_runner build --delete-conflicting-outputs
18+
# Flutter ~2.0 fails: The pubspec.lock file has changed since the .dart_tool/package_config.json file was generated, please run "pub get" again.
19+
generateCmd="flutter pub run build_runner build --delete-conflicting-outputs"
20+
$generateCmd || (flutter pub get && $generateCmd)
1921

2022
# flutter drive is currently not available in GitHub Actions (TODO start an emulator/simulator?)
2123
if [[ "${GITHUB_ACTIONS:-}" == "" ]]; then

0 commit comments

Comments
 (0)