Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dart-lang/source_gen
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.6
Choose a base ref
...
head repository: dart-lang/source_gen
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 5,856 additions and 2,018 deletions.
  1. +15 −0 .github/dependabot.yml
  2. +328 −0 .github/workflows/dart.yml
  3. +37 −0 .github/workflows/no-response.yml
  4. +17 −0 .github/workflows/publish.yaml
  5. +0 −17 .travis.yml
  6. +3 −2 LICENSE
  7. +0 −127 README.md
  8. +1 −0 README.md
  9. 0 _test_annotations/lib/{_test_annotations.dart → test_annotations.dart}
  10. +7 −0 _test_annotations/mono_pkg.yaml
  11. +8 −0 _test_annotations/pubspec.yaml
  12. +30 −50 analysis_options.yaml
  13. +3 −0 example/README.md
  14. +47 −0 example/build.yaml
  15. +9 −0 example/lib/annotations.dart
  16. +35 −0 example/lib/builder.dart
  17. +20 −0 example/lib/src/member_count_library_generator.dart
  18. +22 −0 example/lib/src/multiplier_generator.dart
  19. +21 −0 example/lib/src/property_product_generator.dart
  20. +21 −0 example/lib/src/property_sum_generator.dart
  21. +16 −0 example/lib/src/utils.dart
  22. +7 −0 example/mono_pkg.yaml
  23. +14 −0 example/pubspec.yaml
  24. +13 −0 example_usage/README.md
  25. +23 −0 example_usage/build.yaml
  26. +3 −0 example_usage/dart_test.yaml
  27. +14 −0 example_usage/lib/library_source.dart
  28. +23 −0 example_usage/lib/library_source.g.dart
  29. +9 −0 example_usage/lib/library_source.info.dart
  30. +17 −0 example_usage/mono_pkg.yaml
  31. +16 −0 example_usage/pubspec.yaml
  32. +18 −0 example_usage/test/ensure_build_test.dart
  33. +0 −259 lib/src/builder.dart
  34. +0 −104 lib/src/constants/revive.dart
  35. +0 −57 lib/src/generated_output.dart
  36. +0 −44 lib/src/generator.dart
  37. +0 −51 lib/src/generator_for_annotation.dart
  38. +0 −166 lib/src/utils.dart
  39. +9 −0 mono_repo.yaml
  40. +11 −20 pubspec.yaml
  41. +347 −0 { → source_gen}/CHANGELOG.md
  42. +27 −0 source_gen/LICENSE
  43. +223 −0 source_gen/README.md
  44. +14 −0 source_gen/build.yaml
  45. +153 −0 source_gen/lib/builder.dart
  46. +5 −5 { → source_gen}/lib/source_gen.dart
  47. +436 −0 source_gen/lib/src/builder.dart
  48. +37 −36 { → source_gen}/lib/src/constants/reader.dart
  49. +156 −0 source_gen/lib/src/constants/revive.dart
  50. +12 −9 { → source_gen}/lib/src/constants/utils.dart
  51. +24 −0 source_gen/lib/src/generated_output.dart
  52. +103 −0 source_gen/lib/src/generator.dart
  53. +97 −0 source_gen/lib/src/generator_for_annotation.dart
  54. +48 −59 { → source_gen}/lib/src/library.dart
  55. +38 −0 source_gen/lib/src/output_helpers.dart
  56. +31 −8 { → source_gen}/lib/src/span_for_element.dart
  57. +104 −47 { → source_gen}/lib/src/type_checker.dart
  58. +197 −0 source_gen/lib/src/utils.dart
  59. +24 −0 source_gen/mono_pkg.yaml
  60. +28 −0 source_gen/pubspec.yaml
  61. +1,147 −0 source_gen/test/builder_test.dart
  62. +20 −14 { → source_gen}/test/constants/utils_test.dart
  63. +145 −45 { → source_gen}/test/constants_test.dart
  64. +99 −0 source_gen/test/external_only_type_checker_test.dart
  65. +314 −0 source_gen/test/generator_for_annotation_test.dart
  66. +29 −6 { → source_gen}/test/library/find_type_test.dart
  67. +10 −10 { → source_gen}/test/library/path_to_url_test.dart
  68. +107 −0 source_gen/test/output_helpers_test.dart
  69. +117 −0 source_gen/test/span_for_element_test.dart
  70. +17 −13 { → source_gen}/test/src/comment_generator.dart
  71. +1 −3 { → source_gen}/test/src/unformatted_code_generator.dart
  72. +9 −8 { → source_gen}/test/test_files/annotated_classes.dart
  73. +3 −3 { → source_gen}/test/test_files/annotated_classes_part.dart
  74. +1 −1 { → source_gen}/test/test_files/annotation_part.dart
  75. +17 −15 { → source_gen}/test/test_files/annotations.dart
  76. +618 −0 source_gen/test/type_checker_test.dart
  77. +162 −0 source_gen/test/utils_test.dart
  78. +0 −374 test/builder_test.dart
  79. +0 −32 test/generator_for_annotation_test.dart
  80. +0 −31 test/span_for_element_test.dart
  81. +0 −359 test/type_checker_test.dart
  82. +0 −43 test/utils_test.dart
  83. +119 −0 tool/ci.sh
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Dependabot configuration file.
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
labels:
- autosubmit
groups:
github-actions:
patterns:
- "*"
328 changes: 328 additions & 0 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
# Created with package:mono_repo v6.6.2
name: Dart CI
on:
push:
branches:
- main
- master
pull_request:
schedule:
- cron: "0 0 * * 0"
defaults:
run:
shell: bash
env:
PUB_ENVIRONMENT: bot.github
permissions: read-all

jobs:
job_001:
name: mono_repo self validate
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: stable
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: mono_repo self validate
run: dart pub global activate mono_repo 6.6.2
- name: mono_repo self validate
run: dart pub global run mono_repo generate --validate
job_002:
name: "analyze_format; linux; Dart 3.6.0; PKG: source_gen; `dart analyze`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:source_gen;commands:analyze_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: source_gen_pub_upgrade
name: source_gen; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: source_gen
- name: source_gen; dart analyze
run: dart analyze
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
job_003:
name: "analyze_format; linux; Dart dev; PKGS: _test_annotations, example, example_usage, source_gen; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test_annotations-example-example_usage-source_gen;commands:format-analyze_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:_test_annotations-example-example_usage-source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: _test_annotations_pub_upgrade
name: _test_annotations; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: _test_annotations
- name: "_test_annotations; dart format --output=none --set-exit-if-changed ."
run: "dart format --output=none --set-exit-if-changed ."
if: "always() && steps._test_annotations_pub_upgrade.conclusion == 'success'"
working-directory: _test_annotations
- name: "_test_annotations; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps._test_annotations_pub_upgrade.conclusion == 'success'"
working-directory: _test_annotations
- id: example_pub_upgrade
name: example; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: example
- name: "example; dart format --output=none --set-exit-if-changed ."
run: "dart format --output=none --set-exit-if-changed ."
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
working-directory: example
- name: "example; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.example_pub_upgrade.conclusion == 'success'"
working-directory: example
- id: example_usage_pub_upgrade
name: example_usage; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: example_usage
- name: "example_usage; dart format --output=none --set-exit-if-changed ."
run: "dart format --output=none --set-exit-if-changed ."
if: "always() && steps.example_usage_pub_upgrade.conclusion == 'success'"
working-directory: example_usage
- name: "example_usage; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.example_usage_pub_upgrade.conclusion == 'success'"
working-directory: example_usage
- id: source_gen_pub_upgrade
name: source_gen; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: source_gen
- name: "source_gen; dart format --output=none --set-exit-if-changed ."
run: "dart format --output=none --set-exit-if-changed ."
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
- name: "source_gen; dart analyze --fatal-infos ."
run: dart analyze --fatal-infos .
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
job_004:
name: "unit_test; linux; Dart 3.6.0; PKG: example_usage; `dart test --run-skipped`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:example_usage;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:example_usage
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: example_usage_pub_upgrade
name: example_usage; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: example_usage
- name: "example_usage; dart test --run-skipped"
run: dart test --run-skipped
if: "always() && steps.example_usage_pub_upgrade.conclusion == 'success'"
working-directory: example_usage
needs:
- job_001
- job_002
- job_003
job_005:
name: "unit_test; linux; Dart 3.6.0; PKG: source_gen; `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:source_gen;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0;packages:source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:3.6.0
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: source_gen_pub_upgrade
name: source_gen; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: source_gen
- name: source_gen; dart test
run: dart test
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
needs:
- job_001
- job_002
- job_003
job_006:
name: "unit_test; linux; Dart dev; PKG: example_usage; `dart test --run-skipped`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:example_usage;commands:test_0"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:example_usage
os:ubuntu-latest;pub-cache-hosted;sdk:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: example_usage_pub_upgrade
name: example_usage; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: example_usage
- name: "example_usage; dart test --run-skipped"
run: dart test --run-skipped
if: "always() && steps.example_usage_pub_upgrade.conclusion == 'success'"
working-directory: example_usage
needs:
- job_001
- job_002
- job_003
job_007:
name: "unit_test; linux; Dart dev; PKG: source_gen; `dart test`"
runs-on: ubuntu-latest
steps:
- name: Cache Pub hosted dependencies
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
with:
path: "~/.pub-cache/hosted"
key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:source_gen;commands:test_1"
restore-keys: |
os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:source_gen
os:ubuntu-latest;pub-cache-hosted;sdk:dev
os:ubuntu-latest;pub-cache-hosted
os:ubuntu-latest
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: source_gen_pub_upgrade
name: source_gen; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: source_gen
- name: source_gen; dart test
run: dart test
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
needs:
- job_001
- job_002
- job_003
job_008:
name: "unit_test; windows; Dart 3.6.0; PKG: source_gen; `dart test`"
runs-on: windows-latest
steps:
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: "3.6.0"
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: source_gen_pub_upgrade
name: source_gen; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: source_gen
- name: source_gen; dart test
run: dart test
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
needs:
- job_001
- job_002
- job_003
job_009:
name: "unit_test; windows; Dart dev; PKG: source_gen; `dart test`"
runs-on: windows-latest
steps:
- name: Setup Dart SDK
uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
with:
sdk: dev
- id: checkout
name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: source_gen_pub_upgrade
name: source_gen; dart pub upgrade
run: dart pub upgrade
if: "always() && steps.checkout.conclusion == 'success'"
working-directory: source_gen
- name: source_gen; dart test
run: dart test
if: "always() && steps.source_gen_pub_upgrade.conclusion == 'success'"
working-directory: source_gen
needs:
- job_001
- job_002
- job_003
37 changes: 37 additions & 0 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# A workflow to close issues where the author hasn't responded to a request for
# more information; see https://github.com/actions/stale.

name: No Response

# Run as a daily cron.
on:
schedule:
# Every day at 8am
- cron: '0 8 * * *'

# All permissions not specified are set to 'none'.
permissions:
issues: write
pull-requests: write

jobs:
no-response:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'dart-lang' }}
steps:
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639
with:
# Don't automatically mark inactive issues+PRs as stale.
days-before-stale: -1
# Close needs-info issues and PRs after 14 days of inactivity.
days-before-close: 14
stale-issue-label: "needs-info"
close-issue-message: >
Without additional information we're not able to resolve this issue.
Feel free to add more info or respond to any questions above and we
can reopen the case. Thanks for your contribution!
stale-pr-label: "needs-info"
close-pr-message: >
Without additional information we're not able to resolve this PR.
Feel free to add more info or respond to any questions above.
Thanks for your contribution!
Loading