Skip to content

Commit 4521dba

Browse files
committed
Updated commands.
1 parent f29d5d0 commit 4521dba

File tree

4 files changed

+31
-43
lines changed

4 files changed

+31
-43
lines changed

generic_enum/tool/actions.sh

+6-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/bash --
2-
# Adapted from https://github.com/google/built_value.dart/blob/main/tool/presubmit
3-
# BSD-3 Clause License file: https://github.com/google/built_value.dart/blob/main/LICENSE
42

53
# Colour definitions:
64
BLUE='\033[1;34m'
@@ -16,28 +14,26 @@ set -e
1614
echo
1715
echo -e "${BLUE}=== Resolving dependencies $PWD...${RESET}"
1816
echo
19-
pub get
20-
pub upgrade
17+
dart pub get
18+
dart pub upgrade
2119

2220
echo
2321
echo -e "${PURPLE}=== Checking Source Code Formatting${RESET} $PWD..."
2422
echo
2523
# Overwrite files with formatted content: -w
2624
# Dry run: -n
27-
dartfmt -w $(find bin lib test -name \*.dart 2>/dev/null)
25+
dart format lib test
2826

2927
echo
3028
echo -e "${YELLOW}=== Analyzing $PWD...${RESET}"
3129
echo
32-
dartanalyzer \
30+
dart analyze \
3331
--fatal-warnings \
34-
--fatal-infos \
35-
--packages="$PWD/.packages" \
36-
$(find bin lib test -name \*.dart 2>/dev/null)
32+
--fatal-infos
3733

3834
echo
3935
echo -e "${GREEN}=== Testing $PWD...${RESET}"
4036
echo
4137
# Only run if directory test exists:
4238
grep -q test pubspec.yaml && \
43-
pub run test
39+
dart test

generic_enum_builder/tool/actions.sh

+7-10
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,28 @@ echo -e "${BLUE}=== Resolving Dependencies $PWD...${RESET}"
2323
echo
2424

2525
# Make sure .dart_tool/package_config.json exists.
26-
pub get
26+
dart pub get
2727

2828
# Upgrade packages.
29-
pub upgrade
29+
dart pub upgrade
3030

3131
echo
3232
echo -e "${PURPLE}=== Checking Source Code Formatting${RESET} $PWD..."
3333
echo
34-
# Overwrite files with formatted content: -w
35-
# Dry run: -n
36-
dartfmt -w $(find bin lib test -name \*.dart 2>/dev/null)
34+
dart format lib test
3735

3836
# Analyze dart files
3937
echo
4038
echo -e "${YELLOW}=== Analyzing $PWD...${RESET}"
4139
echo
4240

43-
dartanalyzer \
41+
dart analyze \
4442
--fatal-warnings \
45-
--fatal-infos \
46-
--packages="$PWD/.packages" \
47-
$(find bin lib example test -name \*.dart 2>/dev/null)
43+
--fatal-infos
44+
4845

4946
# Running tests
5047
echo
5148
echo -e "${CYAN}=== Testing $PWD...${RESET}"
5249
echo
53-
pub run test
50+
dart test

generic_enum_example/tool/actions.sh

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/bin/bash --
2-
# Adapted from https://github.com/google/built_value.dart/blob/master/tool/presubmit
3-
# BSD-3 Clause License file: https://github.com/google/built_value.dart/blob/master/LICENSE
42

5-
# Travis script for:
6-
# generic_enum_example
3+
# Actions script for:
4+
# generic_enum_example
75

86
# Colour definitions:
97
BLUE='\033[1;34m'
@@ -19,34 +17,34 @@ set -e
1917
echo
2018
echo -e "${BLUE}=== Resolving dependencies $PWD...${RESET}"
2119
echo
22-
pub get
23-
pub upgrade
20+
dart pub get
21+
dart pub upgrade
2422

2523
echo
2624
echo -e "${CYAN}=== Building $PWD...${RESET}"
2725
echo
2826

2927
rm -rf .dart_tool/build/
3028
grep -q build_runner pubspec.yaml && \
31-
pub run build_runner build \
29+
dart run build_runner build \
3230
--delete-conflicting-outputs \
33-
--fail-on-severe
34-
35-
31+
--fail-on-severe \
32+
--verbose
3633
echo
3734
echo -e "${PURPLE}=== Checking Source Code Formatting${RESET} $PWD..."
3835
echo
39-
# Overwrite files with formatted content: -w
40-
# Dry run: -n
41-
dartfmt -w $(find bin lib test -name \*.dart 2>/dev/null)
36+
dart format lib
4237

4338
echo
4439
echo -e "${YELLOW}=== Analyzing $PWD...${RESET}"
4540
echo
46-
dartanalyzer \
41+
dart analyze \
4742
--fatal-warnings \
48-
--fatal-infos \
49-
--packages="$PWD/.packages" \
50-
$(find bin lib test -name \*.dart 2>/dev/null)
43+
--fatal-infos
5144

5245
# No test to be run.
46+
47+
echo
48+
echo -e "${GREEN}=== Sync Generated Source Code${RESET} $PWD..."
49+
echo
50+
cp lib/*.dart ../generic_enum/test/src

tool/actions.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@
44
set -e
55

66
# Folders to be processed
7-
folders="generic_enum generic_enum_builder \
8-
generic_enum_example"
7+
folders="generic_enum_builder \
8+
generic_enum_example \
9+
generic_enum"
910

1011
library_folder=$PWD
1112

1213
for folder in $folders; do
13-
1414
cd "$library_folder/$folder"
15-
1615
echo $(pwd)
17-
1816
# Check if local script exist before executing it.
1917
if [ -f tool/actions.sh ]; then
2018
./tool/actions.sh
2119
fi
22-
2320
done

0 commit comments

Comments
 (0)