-
-
Notifications
You must be signed in to change notification settings - Fork 286
Pub Workspaces #1185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Pub Workspaces #1185
Changes from all commits
5981090
6b2ba20
83a100b
623d28f
71a91c4
2e24faf
48fc859
d7789b8
d50b5fc
e43d3b0
388eb2b
3bd64c9
bb77928
791add1
a7ee005
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| **/*.*.dart linguist-generated=true |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,71 +16,60 @@ jobs: | |||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||
| package: | ||||||||||||||||||||||||
| - benchmarks/ | ||||||||||||||||||||||||
| - packages/freezed | ||||||||||||||||||||||||
| - packages/freezed/example | ||||||||||||||||||||||||
| - packages/freezed_annotation | ||||||||||||||||||||||||
| - packages/freezed_lint | ||||||||||||||||||||||||
| - packages/freezed_lint/example | ||||||||||||||||||||||||
| channel: | ||||||||||||||||||||||||
| - master | ||||||||||||||||||||||||
| - stable | ||||||||||||||||||||||||
| dependencies: | ||||||||||||||||||||||||
| - get | ||||||||||||||||||||||||
| - downgrade | ||||||||||||||||||||||||
| exclude: | ||||||||||||||||||||||||
| - channel: stable | ||||||||||||||||||||||||
| - channel: master | ||||||||||||||||||||||||
| dependencies: downgrade | ||||||||||||||||||||||||
| - package: packages/freezed_lint | ||||||||||||||||||||||||
| channel: stable | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| defaults: | ||||||||||||||||||||||||
| run: | ||||||||||||||||||||||||
| working-directory: ${{ matrix.package }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||
| - uses: actions/checkout@v5 | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - uses: subosito/flutter-action@v2 | ||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||
| channel: ${{ matrix.channel }} | ||||||||||||||||||||||||
| cache: ${{ matrix.channel == 'stable' }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # It is executed separately | ||||||||||||||||||||||||
| - name: Removing example folder | ||||||||||||||||||||||||
| # Retain example for lint golden test | ||||||||||||||||||||||||
| if: matrix.package != 'packages/freezed_lint' | ||||||||||||||||||||||||
| run: rm -rf example | ||||||||||||||||||||||||
| working-directory: ${{ matrix.package }} | ||||||||||||||||||||||||
| cache: ${{ matrix.channel == 'master' }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| flutter pub ${{ matrix.dependencies }} | ||||||||||||||||||||||||
| working-directory: ${{ matrix.package }} | ||||||||||||||||||||||||
| run: flutter pub ${{ matrix.dependencies }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Check format | ||||||||||||||||||||||||
| # Check dart format only on stable | ||||||||||||||||||||||||
| if: matrix.channel == 'stable' | ||||||||||||||||||||||||
| run: dart format --set-exit-if-changed . | ||||||||||||||||||||||||
| working-directory: ${{ matrix.package }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Generate | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| if grep -q build_runner "pubspec.yaml"; then | ||||||||||||||||||||||||
| dart pub run build_runner build --delete-conflicting-outputs | ||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||
| working-directory: ${{ matrix.package }} | ||||||||||||||||||||||||
| if: matrix.package != 'packages/freezed_lint/example' | ||||||||||||||||||||||||
| continue-on-error: true | ||||||||||||||||||||||||
| run: dart run build_runner build --delete-conflicting-outputs | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Comment on lines
+56
to
59
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Gate codegen on dependency; drop continue-on-error. Instead of relying on - - name: Generate
- if: matrix.package != 'packages/freezed_lint/example'
- continue-on-error: true
- run: dart run build_runner build --delete-conflicting-outputs
+ - name: Generate
+ if: matrix.package != 'packages/freezed_lint/example'
+ run: |
+ if grep -Eq '^\s*build_runner\s*:' pubspec.yaml; then
+ dart run build_runner build --delete-conflicting-outputs
+ else
+ echo "Skipping build_runner (no dependency found)"
+ fi📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| - name: Analyze | ||||||||||||||||||||||||
| run: flutter analyze | ||||||||||||||||||||||||
| run: flutter analyze --fatal-infos | ||||||||||||||||||||||||
| working-directory: ${{ matrix.package }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| if grep -q "name: example" "pubspec.yaml"; then | ||||||||||||||||||||||||
| if grep -q "flutter_test:" "pubspec.yaml"; then | ||||||||||||||||||||||||
| flutter test | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| elif grep -q "test:" "pubspec.yaml"; then | ||||||||||||||||||||||||
| dart test | ||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||
| working-directory: ${{ matrix.package }} | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| - name: Lint golden test | ||||||||||||||||||||||||
| if: matrix.package == 'packages/freezed_lint' | ||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||
| dart pub get | ||||||||||||||||||||||||
| dart analyze | ||||||||||||||||||||||||
| dart run custom_lint | ||||||||||||||||||||||||
| working-directory: 'packages/freezed_lint/example' | ||||||||||||||||||||||||
| if: matrix.package == 'packages/freezed_lint/example' | ||||||||||||||||||||||||
| run: dart run custom_lint --fatal-infos | ||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| .dart_tool | ||
| .idea/ | ||
| *.iml | ||
| build/ | ||
| node_modules | ||
| /package-lock.json | ||
| /package-lock.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| /.dart_tool | ||
| /test/**/*.g.dart | ||
| /test/**/*.freezed.dart | ||
| .packages | ||
| # Remove the following pattern if you wish to check in your lock file | ||
| pubspec.lock |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,19 @@ | ||
| name: example | ||
| name: freezed_benchmarks | ||
| description: A new Flutter project. | ||
| publish_to: none | ||
|
|
||
| environment: | ||
| sdk: ^3.5.0 | ||
|
|
||
| resolution: workspace | ||
|
|
||
| dependencies: | ||
| flutter: | ||
| sdk: flutter | ||
| freezed_annotation: | ||
| path: ../packages/freezed_annotation | ||
| json_annotation: ^4.4.0 | ||
| freezed_annotation: ^3.0.0 | ||
| json_annotation: ^4.9.0 | ||
|
|
||
| dev_dependencies: | ||
| freezed: | ||
| path: ../packages/freezed | ||
| freezed: ^3.0.2 | ||
| json_serializable: ^6.1.3 | ||
| build_runner: | ||
| flutter_test: | ||
| sdk: flutter | ||
|
|
||
| dependency_overrides: | ||
| freezed: | ||
| path: ../packages/freezed | ||
| freezed_annotation: | ||
| path: ../packages/freezed_annotation |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| /.dart_tool | ||
| /test/**/*.g.dart | ||
| /test/**/*.freezed.dart | ||
| .packages | ||
| # Remove the following pattern if you wish to check in your lock file | ||
| pubspec.lock |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,3 @@ | ||
| *.freezed.dart | ||
| *.g.dart | ||
|
|
||
|
Comment on lines
-1
to
-3
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you change gitignores?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's been a while, I honestly don't remember.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I remember now. This was in the example, if the code wasn't checked in the order that CI ran tripped something up. c5d83a7 Probably not strictly needed anymore, but feels like a nice QoL improvement? |
||
| # Miscellaneous | ||
| *.class | ||
| *.log | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that flag is now deprecated, but I'm also coming back to dart after a hiatus, so maybe I'm wrong about that.