From 899d72d6dd5e9b93e53e6ee94ce9c94b23025ada Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Fri, 16 Oct 2020 16:37:40 -0700 Subject: [PATCH] mono_repo self validate --- .travis.yml | 37 +++++++++++-------- angular_components/mono_pkg.yaml | 2 +- angular_gallery/mono_pkg.yaml | 2 +- angular_gallery_section/mono_pkg.yaml | 2 +- .../angular_components_example/mono_pkg.yaml | 2 +- mono_repo.yaml | 15 +++----- tool/mono_repo_self_validate.sh | 15 ++++++++ tool/travis.sh | 32 ++++++++-------- 8 files changed, 61 insertions(+), 46 deletions(-) create mode 100755 tool/mono_repo_self_validate.sh diff --git a/.travis.yml b/.travis.yml index 6481eda2b..f59efd86a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,46 +1,51 @@ -# Created with package:mono_repo v2.3.0 +# Created with package:mono_repo v2.5.0 language: dart jobs: include: - - stage: build - name: "SDK: 2.9.3; PKG: examples/angular_components_example; TASKS: [`pub run build_runner build web`, `pub run build_runner build web --release`]" - dart: "2.9.3" - os: linux - env: PKGS="examples/angular_components_example" - script: ./tool/travis.sh command_1 command_2 - - stage: build - name: "SDK: dev; PKG: examples/angular_components_example; TASKS: [`pub run build_runner build web`, `pub run build_runner build web --release`]" - dart: dev + - stage: mono_repo_self_validate + name: mono_repo self validate os: linux - env: PKGS="examples/angular_components_example" - script: ./tool/travis.sh command_1 command_2 + script: tool/mono_repo_self_validate.sh - stage: analyze_and_format name: "SDK: 2.9.3; PKGS: angular_components, angular_gallery, angular_gallery_section; TASKS: `dartanalyzer --fatal-warnings .`" dart: "2.9.3" os: linux env: PKGS="angular_components angular_gallery angular_gallery_section" - script: ./tool/travis.sh dartanalyzer + script: tool/travis.sh dartanalyzer - stage: analyze_and_format name: "SDK: dev; PKGS: angular_components, angular_gallery, angular_gallery_section; TASKS: [`dartfmt -n --set-exit-if-changed .`, `dartanalyzer --fatal-warnings .`]" dart: dev os: linux env: PKGS="angular_components angular_gallery angular_gallery_section" - script: ./tool/travis.sh dartfmt dartanalyzer + script: tool/travis.sh dartfmt dartanalyzer - stage: unit_test name: "SDK: 2.9.3; PKG: angular_components; TASKS: [`./tool/travis/install_protoc.sh`, `pub run test --run-skipped`]" dart: "2.9.3" os: linux env: PKGS="angular_components" - script: ./tool/travis.sh command_0 test + script: tool/travis.sh command_0 test - stage: unit_test name: "SDK: dev; PKG: angular_components; TASKS: [`./tool/travis/install_protoc.sh`, `pub run test --run-skipped`]" dart: dev os: linux env: PKGS="angular_components" - script: ./tool/travis.sh command_0 test + script: tool/travis.sh command_0 test + - stage: build + name: "SDK: 2.9.3; PKG: examples/angular_components_example; TASKS: [`pub run build_runner build web`, `pub run build_runner build web --release`]" + dart: "2.9.3" + os: linux + env: PKGS="examples/angular_components_example" + script: tool/travis.sh command_1 command_2 + - stage: build + name: "SDK: dev; PKG: examples/angular_components_example; TASKS: [`pub run build_runner build web`, `pub run build_runner build web --release`]" + dart: dev + os: linux + env: PKGS="examples/angular_components_example" + script: tool/travis.sh command_1 command_2 stages: + - mono_repo_self_validate - analyze_and_format - unit_test - build diff --git a/angular_components/mono_pkg.yaml b/angular_components/mono_pkg.yaml index d5d4b2fde..7dfabeca0 100644 --- a/angular_components/mono_pkg.yaml +++ b/angular_components/mono_pkg.yaml @@ -1,4 +1,4 @@ -# See https://github.com/dart-lang/mono_repo for details +# See https://github.com/google/mono_repo.dart for details dart: - 2.9.3 - dev diff --git a/angular_gallery/mono_pkg.yaml b/angular_gallery/mono_pkg.yaml index 627412407..8a6484a12 100644 --- a/angular_gallery/mono_pkg.yaml +++ b/angular_gallery/mono_pkg.yaml @@ -1,4 +1,4 @@ -# See https://github.com/dart-lang/mono_repo for details +# See https://github.com/google/mono_repo.dart for details stages: - analyze_and_format: - group: diff --git a/angular_gallery_section/mono_pkg.yaml b/angular_gallery_section/mono_pkg.yaml index 627412407..8a6484a12 100644 --- a/angular_gallery_section/mono_pkg.yaml +++ b/angular_gallery_section/mono_pkg.yaml @@ -1,4 +1,4 @@ -# See https://github.com/dart-lang/mono_repo for details +# See https://github.com/google/mono_repo.dart for details stages: - analyze_and_format: - group: diff --git a/examples/angular_components_example/mono_pkg.yaml b/examples/angular_components_example/mono_pkg.yaml index c8a2598b0..dc6f54d36 100644 --- a/examples/angular_components_example/mono_pkg.yaml +++ b/examples/angular_components_example/mono_pkg.yaml @@ -1,4 +1,4 @@ -# See https://github.com/dart-lang/mono_repo for details +# See https://github.com/google/mono_repo.dart for details dart: - 2.9.3 - dev diff --git a/mono_repo.yaml b/mono_repo.yaml index b9602d227..daf9ccad5 100644 --- a/mono_repo.yaml +++ b/mono_repo.yaml @@ -1,16 +1,11 @@ -# See with https://github.com/dart-lang/mono_repo for details on this file - -# TODO: Clean up stages after https://github.com/dart-lang/mono_repo/issues/149 -# and https://github.com/dart-lang/mono_repo/issues/150 +# See with https://github.com/google/mono_repo.dart for details on this file +self_validate: true travis: stages: - - name: analyze_and_format - if: 'true' - - name: unit_test - if: 'true' - - name: build - if: 'true' + - analyze_and_format + - unit_test + - build merge_stages: - analyze_and_format diff --git a/tool/mono_repo_self_validate.sh b/tool/mono_repo_self_validate.sh new file mode 100755 index 000000000..ec70a289c --- /dev/null +++ b/tool/mono_repo_self_validate.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Created with package:mono_repo v2.5.0 + +# Support built in commands on windows out of the box. +function pub { + if [[ $TRAVIS_OS_NAME == "windows" ]]; then + command pub.bat "$@" + else + command pub "$@" + fi +} + +set -v -e +pub global activate mono_repo 2.5.0 +pub global run mono_repo travis --validate diff --git a/tool/travis.sh b/tool/travis.sh index 31e8254c4..dc18fcf31 100755 --- a/tool/travis.sh +++ b/tool/travis.sh @@ -1,27 +1,27 @@ #!/bin/bash -# Created with package:mono_repo v2.3.0 +# Created with package:mono_repo v2.5.0 # Support built in commands on windows out of the box. function pub { - if [[ $TRAVIS_OS_NAME == "windows" ]]; then - command pub.bat "$@" - else - command pub "$@" - fi + if [[ $TRAVIS_OS_NAME == "windows" ]]; then + command pub.bat "$@" + else + command pub "$@" + fi } function dartfmt { - if [[ $TRAVIS_OS_NAME == "windows" ]]; then - command dartfmt.bat "$@" - else - command dartfmt "$@" - fi + if [[ $TRAVIS_OS_NAME == "windows" ]]; then + command dartfmt.bat "$@" + else + command dartfmt "$@" + fi } function dartanalyzer { - if [[ $TRAVIS_OS_NAME == "windows" ]]; then - command dartanalyzer.bat "$@" - else - command dartanalyzer "$@" - fi + if [[ $TRAVIS_OS_NAME == "windows" ]]; then + command dartanalyzer.bat "$@" + else + command dartanalyzer "$@" + fi } if [[ -z ${PKGS} ]]; then