Files
sdk/pubspec.yaml
T
Daco Harkes 94894b1796 [dartdev] dart install
This CL adds three new commands to `dart`:

```
Global
  install     Install a Dart CLI tool for global use.
  installed   List globally installed Dart CLI tools.
  uninstall   Remove a globally installed Dart CLI tool.
```

These commands are intended to replace `dart pub global` subcommands
while adding support for `hook/build.dart` and building packages in
AOT instead of running them with JIT.

Internal design doc: http://go/dart-install-cli.

Implementation details:
* The source of truth is the state of the file system. These commands
  write and read directories, files, and symlinks.
* App bundles and symlinks are placed in `DART_DATA_HOME` as per
  http://go/dart-data-home.
* On Unix systems we use symlinks and on Windows batchfiles to place
  executables in the bin directory that point to an application
  bundle. (These OS differences have been encapsulated in a single
  class.)
* On Windows, when an application is running, trying to re-install it
  will fail.

Test coverage:
* Installing from hosted, git, and local paths.
* Installing a package with hooks.
* Installing a package with hooks and user-defines.
* Surfacing build hook failures during install.
* Installing packages with conflicting executables names. This tests
  `--overwrite` flag behavior.
* Installing a new or the same version, this should simply succeed.
* A warning is shown if the bin directory is not on the `PATH`.
* Running an installed app reports the correct exit code on exit.
* Listing all installed versions, including the versions not on
  the`PATH`.
* Uninstalling, which uninstalls all versions.
* Re-installing while it is running.
* Uninstalling while it is running.

Out of scope for initial version:
* Saving the SDK version (to display in `dart installed`).
* Short-circuiting if re-installing an exactly installed version.

Bug: https://github.com/dart-lang/sdk/issues/60889
Change-Id: I8f3a60d26e013957ce6fd7f52e564bcaaff30509
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-arm64-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/441581
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Goderbauer <goderbauer@google.com>
2025-08-13 01:33:59 -07:00

321 lines
9.4 KiB
YAML

# Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# This file defines pub workspace for the sdk enabling a common resolution.
name: _
publish_to: none
environment:
# This constraint decides the language-version for all dart code in the
# repository that doesn't have its own package. Mainly the code in `tests/`.
#
# It needs to be updated before testing language features introduced in the
# next language version.
sdk: ^3.10.0-0
# These are the packages that are contained in the SDK.
workspace:
- pkg/analysis_server
- pkg/analysis_server_client
- pkg/analysis_server_plugin
- pkg/analyzer
- pkg/analyzer_cli
- pkg/analyzer_plugin
- pkg/analyzer_testing
- pkg/analyzer_utilities
- pkg/async_helper
- pkg/bisect_dart
- pkg/build_integration
- pkg/compiler
- pkg/dart2bytecode
- pkg/dart2js_info
- pkg/dart2js_runtime_metrics
- pkg/dart2js_tools
- pkg/dart2native
- pkg/dart2wasm
- pkg/dartdev
- pkg/dart_data_home
- pkg/dart_internal
- pkg/dart_service_protocol_shared
- pkg/dds
- pkg/dds_service_extensions
- pkg/dev_compiler
- pkg/dtd
- pkg/dtd_impl
- pkg/dynamic_modules
- pkg/expect
- pkg/_fe_analyzer_shared
- pkg/front_end
- pkg/frontend_server
- pkg/heap_snapshot
- pkg/js
- pkg/js_ast
- pkg/_js_interop_checks
- pkg/js_runtime
- pkg/js_shared
- pkg/kernel
- pkg/linter
- pkg/meta
- pkg/mmap
- pkg/modular_test
- pkg/native_stack_traces
- pkg/node_preamble
- pkg/record_use
- pkg/reload_test
- pkg/scrape
- pkg/server_plugin
- pkg/shell_arg_splitter
- pkg/smith
- pkg/sourcemap_testing
- pkg/status_file
- pkg/telemetry
- pkg/testing
- pkg/test_runner
- pkg/vm
- pkg/vm_service
- pkg/vm_service_interface
- pkg/vm_service_protos
- pkg/vm_snapshot_analysis
- pkg/wasm_builder
- runtime/tests/vm/dart
- runtime/tools
- runtime/tools/profiling
- samples/ffi/http
- samples/ffi/httpIG
- tests/ffi
# dap and language_server_protocol are checked in to and
# developed in the SDK repo, though they are located in `third_party/`.
- third_party/pkg/dap
- third_party/pkg/language_server_protocol
- tools/package_deps
- tools/verify_docs
- tools
- utils
# All third_party packages are retrieved via the DEPS-file and overridden here.
dependency_overrides:
analysis_config:
path: third_party/pkg/webdev/_analysis_config
args:
path: third_party/pkg/core/pkgs/args
async:
path: third_party/pkg/core/pkgs/async
bazel_worker:
path: third_party/pkg/tools/pkgs/bazel_worker
benchmark_harness:
path: third_party/pkg/tools/pkgs/benchmark_harness
boolean_selector:
path: third_party/pkg/tools/pkgs/boolean_selector
browser_launcher:
path: third_party/pkg/tools/pkgs/browser_launcher
checks:
path: third_party/pkg/test/pkgs/checks
cli_config:
path: third_party/pkg/tools/pkgs/cli_config
cli_util:
path: third_party/pkg/tools/pkgs/cli_util
clock:
path: third_party/pkg/tools/pkgs/clock
code_assets:
path: third_party/pkg/native/pkgs/code_assets
collection:
path: third_party/pkg/core/pkgs/collection
convert:
path: third_party/pkg/core/pkgs/convert
corpus:
path: third_party/pkg/ecosystem/pkgs/corpus
coverage:
path: third_party/pkg/tools/pkgs/coverage
crypto:
path: third_party/pkg/core/pkgs/crypto
csslib:
path: third_party/pkg/tools/pkgs/csslib
dart_flutter_team_lints:
path: third_party/pkg/ecosystem/pkgs/dart_flutter_team_lints
dart_mcp:
path: third_party/pkg/ai/pkgs/dart_mcp
dart_mcp_server:
path: third_party/pkg/ai/pkgs/dart_mcp_server
dart_style:
path: third_party/pkg/dart_style
dartdoc:
path: third_party/pkg/dartdoc
data_assets:
path: third_party/pkg/native/pkgs/data_assets
extension_discovery:
path: third_party/pkg/tools/pkgs/extension_discovery
fake_async:
path: third_party/pkg/test/pkgs/fake_async
ffi:
path: third_party/pkg/native/pkgs/ffi
file:
path: third_party/pkg/tools/pkgs/file
file_testing:
path: third_party/pkg/tools/pkgs/file_testing
fixnum:
path: third_party/pkg/core/pkgs/fixnum
frontend_server_client:
path: third_party/pkg/webdev/frontend_server_client
glob:
path: third_party/pkg/tools/pkgs/glob
graphs:
path: third_party/pkg/tools/pkgs/graphs
hooks:
path: third_party/pkg/native/pkgs/hooks
hooks_runner:
path: third_party/pkg/native/pkgs/hooks_runner
html:
path: third_party/pkg/tools/pkgs/html
http:
path: third_party/pkg/http/pkgs/http
http2:
path: third_party/pkg/http/pkgs/http2
http_client_conformance_tests:
path: third_party/pkg/http/pkgs/http_client_conformance_tests
http_multi_server:
path: third_party/pkg/http/pkgs/http_multi_server
http_parser:
path: third_party/pkg/http/pkgs/http_parser
http_profile:
path: third_party/pkg/http/pkgs/http_profile
intl:
path: third_party/pkg/i18n/pkgs/intl
json_rpc_2:
path: third_party/pkg/tools/pkgs/json_rpc_2
leak_tracker:
path: third_party/pkg/leak_tracker/pkgs/leak_tracker
leak_tracker_testing:
path: third_party/pkg/leak_tracker/pkgs/leak_tracker_testing
lints:
path: third_party/pkg/core/pkgs/lints
logging:
path: third_party/pkg/core/pkgs/logging
markdown:
path: third_party/pkg/tools/pkgs/markdown
matcher:
path: third_party/pkg/test/pkgs/matcher
memory_usage:
path: third_party/pkg/leak_tracker/pkgs/memory_usage
mime:
path: third_party/pkg/tools/pkgs/mime
native_test_helpers:
path: third_party/pkg/native/pkgs/native_test_helpers
native_toolchain_c:
path: third_party/pkg/native/pkgs/native_toolchain_c
oauth2:
path: third_party/pkg/tools/pkgs/oauth2
os_detect:
path: third_party/pkg/core/pkgs/os_detect
package_config:
path: third_party/pkg/tools/pkgs/package_config
path:
path: third_party/pkg/core/pkgs/path
platform:
path: third_party/pkg/core/pkgs/platform
pool:
path: third_party/pkg/tools/pkgs/pool
protobuf:
path: third_party/pkg/protobuf/protobuf
process:
path: third_party/pkg/tools/pkgs/process
protobuf_benchmarks:
path: third_party/pkg/protobuf/benchmarks
protoc_plugin:
path: third_party/pkg/protobuf/protoc_plugin
pub:
path: third_party/pkg/pub
pub_formats:
path: third_party/pkg/native/pkgs/pub_formats
pub_semver:
path: third_party/pkg/tools/pkgs/pub_semver
regression_tests:
path: third_party/pkg/test/integration_tests/regression
shelf:
path: third_party/pkg/shelf/pkgs/shelf
shelf_packages_handler:
path: third_party/pkg/shelf/pkgs/shelf_packages_handler
shelf_proxy:
path: third_party/pkg/shelf/pkgs/shelf_proxy
shelf_static:
path: third_party/pkg/shelf/pkgs/shelf_static
shelf_test_handler:
path: third_party/pkg/shelf/pkgs/shelf_test_handler
shelf_web_socket:
path: third_party/pkg/shelf/pkgs/shelf_web_socket
source_map_stack_trace:
path: third_party/pkg/tools/pkgs/source_map_stack_trace
source_maps:
path: third_party/pkg/tools/pkgs/source_maps
source_span:
path: third_party/pkg/tools/pkgs/source_span
spawn_hybrid:
path: third_party/pkg/test/integration_tests/spawn_hybrid
sse:
path: third_party/pkg/tools/pkgs/sse
stack_trace:
path: third_party/pkg/tools/pkgs/stack_trace
stream_channel:
path: third_party/pkg/tools/pkgs/stream_channel
stream_transform:
path: third_party/pkg/tools/pkgs/stream_transform
string_scanner:
path: third_party/pkg/tools/pkgs/string_scanner
swift2objc:
path: third_party/pkg/native/pkgs/swift2objc
sync_http:
path: third_party/pkg/sync_http
tar:
path: third_party/pkg/tar
term_glyph:
path: third_party/pkg/tools/pkgs/term_glyph
test:
path: third_party/pkg/test/pkgs/test
test_api:
path: third_party/pkg/test/pkgs/test_api
test_core:
path: third_party/pkg/test/pkgs/test_core
test_descriptor:
path: third_party/pkg/test/pkgs/test_descriptor
test_process:
path: third_party/pkg/test/pkgs/test_process
test_reflective_loader:
path: third_party/pkg/tools/pkgs/test_reflective_loader
tool:
path: third_party/pkg/webdev/tool
typed_data:
path: third_party/pkg/core/pkgs/typed_data
unified_analytics:
path: third_party/pkg/tools/pkgs/unified_analytics
vector_math:
path: third_party/pkg/vector_math
wasm_tests:
path: third_party/pkg/test/integration_tests/wasm
watcher:
path: third_party/pkg/tools/pkgs/watcher
web:
path: third_party/pkg/web/web
web_socket:
path: third_party/pkg/http/pkgs/web_socket
web_socket_channel:
path: third_party/pkg/http/pkgs/web_socket_channel
webdriver:
path: third_party/pkg/webdriver
webkit_inspection_protocol:
path: third_party/pkg/webkit_inspection_protocol
yaml:
path: third_party/pkg/tools/pkgs/yaml
yaml_edit:
path: third_party/pkg/tools/pkgs/yaml_edit
io:
path: third_party/pkg/tools/pkgs/io
devtools_shared:
path: third_party/devtools/devtools_shared
# heapsnapshot has dependencies from outside the sdk, so cannot be part of
# the workspace. https://github.com/dart-lang/sdk/issues/50061
heapsnapshot:
path: runtime/tools/heapsnapshot
# observatory needs a migration to language version 3.6 before it can be
# included in the workspace. (If it is not deleted before)
observatory:
path: runtime/observatory