diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index c31b9c81d..7046a4fbe 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -38,42 +38,14 @@ jobs: - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyzer_and_format; linux; Dart 2.12.0; PKG: example; `dart analyze --fatal-warnings .`" + name: "analyzer_and_format; linux; Dart 2.12.0; PKG: frontend_server_client; `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@v2.1.6 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;dart:2.12.0;packages:example;commands:analyze_1" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;dart:2.12.0;packages:example - os:ubuntu-latest;pub-cache-hosted;dart:2.12.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - uses: dart-lang/setup-dart@v1.0 - with: - sdk: "2.12.0" - - id: checkout - uses: actions/checkout@v2.3.4 - - id: example_pub_upgrade - name: example; dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: example - run: dart pub upgrade - - name: "example; dart analyze --fatal-warnings ." - if: "always() && steps.example_pub_upgrade.conclusion == 'success'" - working-directory: example - run: dart analyze --fatal-warnings . - job_003: - name: "analyzer_and_format; linux; Dart 2.12.0; PKG: frontend_server_client; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos --fatal-warnings .`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@v2.1.6 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;dart:2.12.0;packages:frontend_server_client;commands:format-analyze_0" + key: "os:ubuntu-latest;pub-cache-hosted;dart:2.12.0;packages:frontend_server_client;commands:format-analyze" restore-keys: | os:ubuntu-latest;pub-cache-hosted;dart:2.12.0;packages:frontend_server_client os:ubuntu-latest;pub-cache-hosted;dart:2.12.0 @@ -93,19 +65,19 @@ jobs: if: "always() && steps.frontend_server_client_pub_upgrade.conclusion == 'success'" working-directory: frontend_server_client run: "dart format --output=none --set-exit-if-changed ." - - name: "frontend_server_client; dart analyze --fatal-infos --fatal-warnings ." + - name: "frontend_server_client; dart analyze --fatal-infos ." if: "always() && steps.frontend_server_client_pub_upgrade.conclusion == 'success'" working-directory: frontend_server_client - run: dart analyze --fatal-infos --fatal-warnings . - job_004: - name: "analyzer_and_format; linux; Dart dev; PKG: dwds; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos --fatal-warnings .`, `dart test test/build/ensure_version_test.dart`" + run: dart analyze --fatal-infos . + job_003: + name: "analyzer_and_format; linux; Dart dev; PKG: dwds; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`, `dart test test/build/ensure_version_test.dart`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@v2.1.6 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:dwds;commands:format-analyze_0-test_0" + key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:dwds;commands:format-analyze-test_0" restore-keys: | os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:dwds os:ubuntu-latest;pub-cache-hosted;dart:dev @@ -125,23 +97,23 @@ jobs: if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" working-directory: dwds run: "dart format --output=none --set-exit-if-changed ." - - name: "dwds; dart analyze --fatal-infos --fatal-warnings ." + - name: "dwds; dart analyze --fatal-infos ." if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" working-directory: dwds - run: dart analyze --fatal-infos --fatal-warnings . + run: dart analyze --fatal-infos . - name: dwds; dart test test/build/ensure_version_test.dart if: "always() && steps.dwds_pub_upgrade.conclusion == 'success'" working-directory: dwds run: dart test test/build/ensure_version_test.dart - job_005: - name: "analyzer_and_format; linux; Dart dev; PKGS: example, fixtures/_webdevSmoke, frontend_server_common; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos --fatal-warnings .`" + job_004: + name: "analyzer_and_format; linux; Dart dev; PKGS: example, fixtures/_webdevSmoke, frontend_server_common; `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@v2.1.6 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:example-fixtures/_webdevSmoke-frontend_server_common;commands:format-analyze_0" + key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:example-fixtures/_webdevSmoke-frontend_server_common;commands:format-analyze" restore-keys: | os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:example-fixtures/_webdevSmoke-frontend_server_common os:ubuntu-latest;pub-cache-hosted;dart:dev @@ -161,10 +133,10 @@ jobs: if: "always() && steps.example_pub_upgrade.conclusion == 'success'" working-directory: example run: "dart format --output=none --set-exit-if-changed ." - - name: "example; dart analyze --fatal-infos --fatal-warnings ." + - name: "example; dart analyze --fatal-infos ." if: "always() && steps.example_pub_upgrade.conclusion == 'success'" working-directory: example - run: dart analyze --fatal-infos --fatal-warnings . + run: dart analyze --fatal-infos . - id: fixtures__webdevSmoke_pub_upgrade name: fixtures/_webdevSmoke; dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" @@ -174,10 +146,10 @@ jobs: if: "always() && steps.fixtures__webdevSmoke_pub_upgrade.conclusion == 'success'" working-directory: fixtures/_webdevSmoke run: "dart format --output=none --set-exit-if-changed ." - - name: "fixtures/_webdevSmoke; dart analyze --fatal-infos --fatal-warnings ." + - name: "fixtures/_webdevSmoke; dart analyze --fatal-infos ." if: "always() && steps.fixtures__webdevSmoke_pub_upgrade.conclusion == 'success'" working-directory: fixtures/_webdevSmoke - run: dart analyze --fatal-infos --fatal-warnings . + run: dart analyze --fatal-infos . - id: frontend_server_common_pub_upgrade name: frontend_server_common; dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" @@ -187,19 +159,19 @@ jobs: if: "always() && steps.frontend_server_common_pub_upgrade.conclusion == 'success'" working-directory: frontend_server_common run: "dart format --output=none --set-exit-if-changed ." - - name: "frontend_server_common; dart analyze --fatal-infos --fatal-warnings ." + - name: "frontend_server_common; dart analyze --fatal-infos ." if: "always() && steps.frontend_server_common_pub_upgrade.conclusion == 'success'" working-directory: frontend_server_common - run: dart analyze --fatal-infos --fatal-warnings . - job_006: - name: "analyzer_and_format; linux; Dart dev; PKG: webdev; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos --fatal-warnings .`, `dart test test/build/ensure_build_test.dart`" + run: dart analyze --fatal-infos . + job_005: + name: "analyzer_and_format; linux; Dart dev; PKG: webdev; `dart format --output=none --set-exit-if-changed .`, `dart analyze --fatal-infos .`, `dart test test/build/ensure_build_test.dart`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@v2.1.6 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:webdev;commands:format-analyze_0-test_2" + key: "os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:webdev;commands:format-analyze-test_2" restore-keys: | os:ubuntu-latest;pub-cache-hosted;dart:dev;packages:webdev os:ubuntu-latest;pub-cache-hosted;dart:dev @@ -219,15 +191,15 @@ jobs: if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" working-directory: webdev run: "dart format --output=none --set-exit-if-changed ." - - name: "webdev; dart analyze --fatal-infos --fatal-warnings ." + - name: "webdev; dart analyze --fatal-infos ." if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" working-directory: webdev - run: dart analyze --fatal-infos --fatal-warnings . + run: dart analyze --fatal-infos . - name: webdev; dart test test/build/ensure_build_test.dart if: "always() && steps.webdev_pub_upgrade.conclusion == 'success'" working-directory: webdev run: dart test test/build/ensure_build_test.dart - job_007: + job_006: name: "unit_test; linux; Dart dev; PKG: dwds; `Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &`, `dart test`" runs-on: ubuntu-latest steps: @@ -265,8 +237,7 @@ jobs: - job_003 - job_004 - job_005 - - job_006 - job_008: + job_007: name: "unit_test; linux; Dart dev; PKG: webdev; `Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &`, `dart test -j 1`" runs-on: ubuntu-latest steps: @@ -304,8 +275,7 @@ jobs: - job_003 - job_004 - job_005 - - job_006 - job_009: + job_008: name: "unit_test; windows; Dart dev; PKG: dwds; `dart test`" runs-on: windows-latest steps: @@ -329,8 +299,7 @@ jobs: - job_003 - job_004 - job_005 - - job_006 - job_010: + job_009: name: "unit_test; windows; Dart dev; PKG: webdev; `dart test -j 1`" runs-on: windows-latest steps: @@ -354,8 +323,7 @@ jobs: - job_003 - job_004 - job_005 - - job_006 - job_011: + job_010: name: Notify failure runs-on: ubuntu-latest if: "(github.event_name == 'push' || github.event_name == 'schedule') && failure()" @@ -376,4 +344,3 @@ jobs: - job_007 - job_008 - job_009 - - job_010 diff --git a/dwds/mono_pkg.yaml b/dwds/mono_pkg.yaml index cf113cf71..a5d10893d 100644 --- a/dwds/mono_pkg.yaml +++ b/dwds/mono_pkg.yaml @@ -3,7 +3,7 @@ stages: - analyzer_and_format: - group: - format - - analyze: --fatal-infos --fatal-warnings . + - analyze: --fatal-infos . - test: test/build/ensure_version_test.dart dart: dev - unit_test: diff --git a/example/mono_pkg.yaml b/example/mono_pkg.yaml index bfcfdd47a..c65043b35 100644 --- a/example/mono_pkg.yaml +++ b/example/mono_pkg.yaml @@ -3,11 +3,8 @@ stages: - analyzer_and_format: - group: - format - - analyze: --fatal-infos --fatal-warnings . + - analyze: --fatal-infos . dart: dev - - group: - - analyze: --fatal-warnings . - dart: [2.12.0] cache: directories: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 55a51a8b1..7b90f664f 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,10 +1,13 @@ name: webdev_example_app description: A web app example for webdev CLI. +publish_to: none + environment: - sdk: ">=2.10.0 <3.0.0" + sdk: ">=2.13.0 <3.0.0" dev_dependencies: - build_runner: '>=1.6.2 <2.0.0' - build_web_compilers: ^2.12.0 - webdev: ^2.0.0 + build_runner: ^2.0.0 + build_web_compilers: ^3.0.0 + webdev: + path: ../webdev diff --git a/example/web/main.dart b/example/web/main.dart index b074df76b..fdccc301b 100644 --- a/example/web/main.dart +++ b/example/web/main.dart @@ -14,7 +14,7 @@ void main() { print('Hello World'); return ServiceExtensionResponse.result(json.encode({'success': true})); }); - document.body.append(SpanElement()..text = 'Hello World!!'); + document.body!.append(SpanElement()..text = 'Hello World!!'); var count = 0; Timer.periodic(const Duration(seconds: 1), (_) { diff --git a/example/web/scopes_main.dart b/example/web/scopes_main.dart index e2063f0f1..84cc7d786 100644 --- a/example/web/scopes_main.dart +++ b/example/web/scopes_main.dart @@ -9,7 +9,7 @@ import 'dart:collection'; final libraryPublicFinal = MyTestClass(); final _libraryPrivateFinal = 1; -Object libraryNull; +Object? libraryNull; var libraryPublic = ['library', 'public', 'variable']; var notAList = NotReallyAList(); @@ -28,7 +28,7 @@ void main() async { var local = 'local in main'; var intLocalInMain = 42; var testClass = MyTestClass(); - Object localThatsNull; + Object? localThatsNull; identityMap['a'] = 1; identityMap['b'] = 2; map['a'] = [1, 2, 3]; @@ -81,7 +81,7 @@ abstract class MyAbstractClass { class MyTestClass extends MyAbstractClass { final String message; - String notFinal; + String? notFinal; MyTestClass({this.message = 'world'}) { myselfField = this; @@ -104,7 +104,7 @@ class MyTestClass extends MyAbstractClass { //ignore: avoid_returning_this MyTestClass get myselfGetter => this; - MyTestClass myselfField; + late final MyTestClass myselfField; var count = 0; @@ -129,16 +129,16 @@ class MyTestClass extends MyAbstractClass { Function closure = someFunction; - String Function() tornOff; + late final String Function() tornOff; } -Function someFunction() => null; +Function? someFunction() => null; // ignore: unused_element int _libraryPrivateFunction(int a, int b) => a + b; -class NotReallyAList extends ListBase { - final List _internal; +class NotReallyAList extends ListBase { + final List _internal; NotReallyAList() : _internal = []; @@ -146,7 +146,7 @@ class NotReallyAList extends ListBase { Object operator [](x) => _internal[x]; @override - operator []=(x, y) => _internal[x] = y; + operator []=(int x, Object y) => _internal[x] = y; @override int get length => _internal.length; diff --git a/fixtures/_webdevSmoke/mono_pkg.yaml b/fixtures/_webdevSmoke/mono_pkg.yaml index ad85de059..c65043b35 100644 --- a/fixtures/_webdevSmoke/mono_pkg.yaml +++ b/fixtures/_webdevSmoke/mono_pkg.yaml @@ -3,7 +3,7 @@ stages: - analyzer_and_format: - group: - format - - analyze: --fatal-infos --fatal-warnings . + - analyze: --fatal-infos . dart: dev cache: diff --git a/frontend_server_client/mono_pkg.yaml b/frontend_server_client/mono_pkg.yaml index 53b646f60..40c94b332 100644 --- a/frontend_server_client/mono_pkg.yaml +++ b/frontend_server_client/mono_pkg.yaml @@ -3,5 +3,5 @@ stages: - analyzer_and_format: - group: - format - - analyze: --fatal-infos --fatal-warnings . - dart: [2.12.0] + - analyze: --fatal-infos . + dart: [2.12.0] diff --git a/frontend_server_common/mono_pkg.yaml b/frontend_server_common/mono_pkg.yaml index 56bbb28df..9b2817680 100644 --- a/frontend_server_common/mono_pkg.yaml +++ b/frontend_server_common/mono_pkg.yaml @@ -3,5 +3,5 @@ stages: - analyzer_and_format: - group: - format - - analyze: --fatal-infos --fatal-warnings . - dart: dev + - analyze: --fatal-infos . + dart: dev diff --git a/tool/ci.sh b/tool/ci.sh index f92adb7a8..e0a2dfa47 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -67,13 +67,9 @@ for PKG in ${PKGS}; do echo echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m" case ${TASK} in - analyze_0) - echo 'dart analyze --fatal-infos --fatal-warnings .' - dart analyze --fatal-infos --fatal-warnings . || EXIT_CODE=$? - ;; - analyze_1) - echo 'dart analyze --fatal-warnings .' - dart analyze --fatal-warnings . || EXIT_CODE=$? + analyze) + echo 'dart analyze --fatal-infos .' + dart analyze --fatal-infos . || EXIT_CODE=$? ;; command) echo 'Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &' diff --git a/webdev/mono_pkg.yaml b/webdev/mono_pkg.yaml index 0534bad5f..663173645 100644 --- a/webdev/mono_pkg.yaml +++ b/webdev/mono_pkg.yaml @@ -10,7 +10,7 @@ stages: - analyzer_and_format: - group: - format - - analyze: --fatal-infos --fatal-warnings . + - analyze: --fatal-infos . - test: test/build/ensure_build_test.dart dart: dev - unit_test: