Skip to content

Commit

Permalink
Move testing/litetest to pub workspaces. (flutter#54082)
Browse files Browse the repository at this point in the history
More incremental version of flutter#53997.
  • Loading branch information
matanlurey authored Jul 24, 2024
1 parent 48583fb commit bb2ff8b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 24 deletions.
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ environment:

# Declare all packages that are part of the workspace.
workspace:
- testing/litetest
- tools/engine_tool

# Declare all dependencies that are used by one or more packages.
Expand Down Expand Up @@ -145,8 +146,6 @@ dependency_overrides:
path: ./third_party/dart/pkg/expect
file:
path: ./third_party/dart/third_party/pkg/file/packages/file
litetest:
path: ./testing/litetest
logging:
path: ./third_party/dart/third_party/pkg/logging
meta:
Expand Down
1 change: 0 additions & 1 deletion shell/platform/fuchsia/dart-pkg/zircon/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ dart_library("zircon_lib") {
dart_library("zircon_tests_lib") {
testonly = true
package_name = "zircon_tests"
language_version = "2.12"
source_dir = "."
package_root = "test"

Expand Down
24 changes: 5 additions & 19 deletions testing/litetest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,15 @@
name: litetest
publish_to: none

# Do not add any dependencies that require more than what is provided in
# //third_party/dart/pkg or //third_party/dart/third_party/pkg.
# In particular, package:test is not usable here.

# If you do add packages here, make sure you can run `pub get --offline`, and
# check the .packages and .package_config to make sure all the paths are
# relative to this directory into //third_party/dart

# Required for workspace support.
environment:
sdk: '>=3.2.0-0 <4.0.0'
sdk: ^3.5.0-294.0.dev

# This package is managed as part of the engine workspace.
resolution: workspace

dependencies:
async_helper: any
expect: any
meta: any
smith: any

dependency_overrides:
async_helper:
path: ../../third_party/dart/pkg/async_helper
expect:
path: ../../third_party/dart/pkg/expect
meta:
path: ../../third_party/dart/pkg/meta
smith:
path: ../../third_party/dart/pkg/smith
9 changes: 7 additions & 2 deletions tools/fuchsia/dart/gen_dart_package_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,15 @@ def language_version_from_pubspec(pubspec):
if not parsed:
return DEFAULT_LANGUAGE_VERSION

# If a format like sdk: '>=a.b' or sdk: 'a.b' is found, we'll use a.b.
# If any format like:
# sdk: '>=a.b'
# sdk: '^a.b'
# sdk: 'a.b'
# ... is found, we 'a.b' as the language version.
#
# In all other cases we default to "2.8"
env_sdk = parsed.get('environment', {}).get('sdk', 'any')
match = re.search(r'^(>=)?((0|[1-9]\d*)\.(0|[1-9]\d*))', env_sdk)
match = re.search(r'^(>=|\^)?((0|[1-9]\d*)\.(0|[1-9]\d*))', env_sdk)
if match:
min_sdk_version = match.group(2)
else:
Expand Down

0 comments on commit bb2ff8b

Please sign in to comment.