Repository navigation
Commit e210443
authored
[flutter_tools] Deprecate --build and --no-build flags on flutter run (flutter#191358)
## Description
This PR formally deprecates the \`--build\` and \`--no-build\` flags on
\`flutter run\` in favor of \`--use-application-binary\`, aligning
\`flutter run\` with \`flutter drive\` (which previously deprecated
\`--build\`).
### Context & Changes
* In 2019 ([flutter#37735](flutter#37735)),
\`flutter run\` stopped handling the \`build\` flag when
\`--use-application-binary\` was added, but the flag definition was
unintentionally left on \`argParser\`, causing it to remain in
\`--help\` as a silent no-op.
* Rather than restoring implicit build-skipping behavior (which
introduces ambiguity regarding which derived artifact to run across
build flavors, split APKs, and schemes), we deprecate \`--[no-]build\`
and direct users to \`--use-application-binary\`.
* Hides \`--build\` from standard \`flutter run -h\` output (\`hide:
!verboseHelp\`).
* Emits a deprecation warning when \`--build\` or \`--no-build\` is
passed.
* Adds hermetic unit tests in \`run_test.dart\` for the deprecation
warnings.
## Related Issues
Fixes flutter#68529
## Tests
- Added hermetic unit tests in
\`packages/flutter_tools/test/commands.shard/hermetic/run_test.dart\`
verifying warning triggers and default execution.
- Verified \`packages/flutter_tools/test/general.shard/args_test.dart\`
passes.1 parent 3512ebe commit e210443
2 files changed
Lines changed: 94 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
492 | | - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
493 | 500 | | |
494 | 501 | | |
495 | 502 | | |
| |||
751 | 758 | | |
752 | 759 | | |
753 | 760 | | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
754 | 775 | | |
755 | 776 | | |
756 | 777 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1913 | 1913 | | |
1914 | 1914 | | |
1915 | 1915 | | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
1916 | 1988 | | |
1917 | 1989 | | |
1918 | 1990 | | |
| |||
0 commit comments