Skip to content

Commit f6fc5d3

Browse files
authored
Enable mono_repo self-validate (#733)
1 parent 77111f2 commit f6fc5d3

File tree

4 files changed

+46
-25
lines changed

4 files changed

+46
-25
lines changed

.travis.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Created with package:mono_repo v2.3.0
1+
# Created with package:mono_repo v2.5.0
22
language: dart
33

44
# Custom configuration
@@ -8,56 +8,61 @@ branches:
88

99
jobs:
1010
include:
11+
- stage: mono_repo_self_validate
12+
name: mono_repo self validate
13+
os: linux
14+
script: tool/mono_repo_self_validate.sh
1115
- stage: analyzer_and_format
1216
name: "SDK: 2.7.0; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; TASKS: `dartanalyzer --fatal-warnings .`"
1317
dart: "2.7.0"
1418
os: linux
1519
env: PKGS="_test_yaml checked_yaml example json_annotation json_serializable"
16-
script: ./tool/travis.sh dartanalyzer_1
20+
script: tool/travis.sh dartanalyzer_1
1721
- stage: analyzer_and_format
1822
name: "SDK: dev; PKGS: _test_yaml, checked_yaml, example, json_annotation, json_serializable; TASKS: [`dartfmt -n --set-exit-if-changed .`, `dartanalyzer --fatal-warnings --fatal-infos .`]"
1923
dart: dev
2024
os: linux
2125
env: PKGS="_test_yaml checked_yaml example json_annotation json_serializable"
22-
script: ./tool/travis.sh dartfmt dartanalyzer_0
26+
script: tool/travis.sh dartfmt dartanalyzer_0
2327
- stage: unit_test
2428
name: "SDK: 2.7.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; TASKS: `pub run test`"
2529
dart: "2.7.0"
2630
os: linux
2731
env: PKGS="_test_yaml checked_yaml example json_serializable"
28-
script: ./tool/travis.sh test_0
32+
script: tool/travis.sh test_0
2933
- stage: unit_test
3034
name: "SDK: dev; PKGS: _test_yaml, checked_yaml, example, json_serializable; TASKS: `pub run test`"
3135
dart: dev
3236
os: linux
3337
env: PKGS="_test_yaml checked_yaml example json_serializable"
34-
script: ./tool/travis.sh test_0
38+
script: tool/travis.sh test_0
3539
- stage: unit_test
3640
name: "SDK: 2.7.0; PKG: json_serializable; TASKS: `pub run build_runner test --delete-conflicting-outputs -- -p chrome`"
3741
dart: "2.7.0"
3842
os: linux
3943
env: PKGS="json_serializable"
40-
script: ./tool/travis.sh command
44+
script: tool/travis.sh command
4145
- stage: unit_test
4246
name: "SDK: dev; PKG: json_serializable; TASKS: `pub run build_runner test --delete-conflicting-outputs -- -p chrome`"
4347
dart: dev
4448
os: linux
4549
env: PKGS="json_serializable"
46-
script: ./tool/travis.sh command
50+
script: tool/travis.sh command
4751
- stage: ensure_build
4852
name: "SDK: 2.7.0; PKGS: _test_yaml, checked_yaml, example, json_serializable; TASKS: `pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
4953
dart: "2.7.0"
5054
os: linux
5155
env: PKGS="_test_yaml checked_yaml example json_serializable"
52-
script: ./tool/travis.sh test_1
56+
script: tool/travis.sh test_1
5357
- stage: ensure_build
5458
name: "SDK: dev; PKGS: _test_yaml, checked_yaml, example, json_serializable; TASKS: `pub run test --run-skipped -t presubmit-only test/ensure_build_test.dart`"
5559
dart: dev
5660
os: linux
5761
env: PKGS="_test_yaml checked_yaml example json_serializable"
58-
script: ./tool/travis.sh test_1
62+
script: tool/travis.sh test_1
5963

6064
stages:
65+
- mono_repo_self_validate
6166
- analyzer_and_format
6267
- unit_test
6368
- ensure_build

mono_repo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# See https://github.com/google/mono_repo.dart for details on this file
2+
self_validate: true
23
travis:
34
branches:
45
only:

tool/mono_repo_self_validate.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# Created with package:mono_repo v2.5.0
3+
4+
# Support built in commands on windows out of the box.
5+
function pub {
6+
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
7+
command pub.bat "$@"
8+
else
9+
command pub "$@"
10+
fi
11+
}
12+
13+
set -v -e
14+
pub global activate mono_repo 2.5.0
15+
pub global run mono_repo travis --validate

tool/travis.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
#!/bin/bash
2-
# Created with package:mono_repo v2.3.0
2+
# Created with package:mono_repo v2.5.0
33

44
# Support built in commands on windows out of the box.
55
function pub {
6-
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
7-
command pub.bat "$@"
8-
else
9-
command pub "$@"
10-
fi
6+
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
7+
command pub.bat "$@"
8+
else
9+
command pub "$@"
10+
fi
1111
}
1212
function dartfmt {
13-
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
14-
command dartfmt.bat "$@"
15-
else
16-
command dartfmt "$@"
17-
fi
13+
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
14+
command dartfmt.bat "$@"
15+
else
16+
command dartfmt "$@"
17+
fi
1818
}
1919
function dartanalyzer {
20-
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
21-
command dartanalyzer.bat "$@"
22-
else
23-
command dartanalyzer "$@"
24-
fi
20+
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
21+
command dartanalyzer.bat "$@"
22+
else
23+
command dartanalyzer "$@"
24+
fi
2525
}
2626

2727
if [[ -z ${PKGS} ]]; then

0 commit comments

Comments
 (0)