Skip to content

Commit

Permalink
Use CIPD to download prebuilt Dart SDKs (flutter#33345)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanderso authored May 17, 2022
1 parent e0b2485 commit 051eee8
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 312 deletions.
62 changes: 52 additions & 10 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,58 @@ deps = {

# WARNING: end of dart dependencies list that is cleaned up automatically - see create_updated_flutter_deps.py.

# Prebuilt Dart SDK of the same revision as the Dart SDK source checkout
'src/flutter/prebuilts/linux-x64/dart-sdk': {
'packages': [
{
'package': 'flutter/dart-sdk/linux-amd64',
'version': 'git_revision:'+Var('dart_revision')
}
],
'dep_type': 'cipd',
'condition': 'host_os == "linux"'
},
'src/flutter/prebuilts/linux-arm64/dart-sdk': {
'packages': [
{
'package': 'flutter/dart-sdk/linux-arm64',
'version': 'git_revision:'+Var('dart_revision')
}
],
'dep_type': 'cipd',
'condition': 'host_os == "linux"'
},
'src/flutter/prebuilts/macos-x64/dart-sdk': {
'packages': [
{
'package': 'flutter/dart-sdk/mac-amd64',
'version': 'git_revision:'+Var('dart_revision')
}
],
'dep_type': 'cipd',
'condition': 'host_os == "mac"'
},
'src/flutter/prebuilts/macos-arm64/dart-sdk': {
'packages': [
{
'package': 'flutter/dart-sdk/mac-arm64',
'version': 'git_revision:'+Var('dart_revision')
}
],
'dep_type': 'cipd',
'condition': 'host_os == "mac"'
},
'src/flutter/prebuilts/windows-x64/dart-sdk': {
'packages': [
{
'package': 'flutter/dart-sdk/windows-amd64',
'version': 'git_revision:'+Var('dart_revision')
}
],
'dep_type': 'cipd',
'condition': 'host_os == "win"'
},

'src/third_party/colorama/src':
Var('chromium_git') + '/external/colorama.git' + '@' + '799604a1041e9b3bc5d2789ecbd7e8db2e18e6b8',

Expand Down Expand Up @@ -680,16 +732,6 @@ hooks = [
'src/flutter/tools/pub_get_offline.py',
]
},
{
'name': 'Download prebuilt Dart SDK',
'pattern': '.',
'condition': 'download_dart_sdk',
'action': [
'python3',
'src/flutter/tools/download_dart_sdk.py',
'--fail-loudly',
]
},
{
'name': 'Download Fuchsia SDK',
'pattern': '.',
Expand Down
13 changes: 9 additions & 4 deletions build/archives/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,15 @@ zip_bundle("flutter_patched_sdk") {
# Flutter consumes the dart sdk as a prebuilt. Rather than regenerating
# the zip file we are just copying the original file to the artifacts location.
if (build_engine_artifacts && flutter_prebuilt_dart_sdk) {
copy("dart_sdk_archive") {
sources = [ prebuilt_dart_sdk_archive ]
outputs =
[ "$root_out_dir/zip_archives/dart-sdk-$full_target_platform_name.zip" ]
zip_bundle("dart_sdk_archive") {
deps = []
output = "dart-sdk-$full_target_platform_name.zip"
files = [
{
source = prebuilt_dart_sdk
destination = "dart-sdk"
},
]
}
}

Expand Down
5 changes: 0 additions & 5 deletions common/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ if (flutter_prebuilt_dart_sdk) {

_target_prebuilt_dart_sdk_config = "$_target_os_name-$target_cpu"
_host_prebuilt_dart_sdk_config = "$_host_os_name-$host_cpu"
_target_prebuilt_dart_sdk_archive = "//flutter/prebuilts/dartsdk-$_target_prebuilt_dart_sdk_config-release.zip"
_host_prebuilt_dart_sdk_archive =
"//flutter/prebuilts/dartsdk-$_host_prebuilt_dart_sdk_config-release.zip"

target_prebuilt_dart_sdk =
"//flutter/prebuilts/$_target_prebuilt_dart_sdk_config/dart-sdk"
Expand All @@ -127,11 +124,9 @@ if (flutter_prebuilt_dart_sdk) {
if (current_toolchain == host_toolchain || is_fuchsia) {
prebuilt_dart_sdk = host_prebuilt_dart_sdk
prebuilt_dart_sdk_config = _host_prebuilt_dart_sdk_config
prebuilt_dart_sdk_archive = _host_prebuilt_dart_sdk_archive
} else {
prebuilt_dart_sdk = target_prebuilt_dart_sdk
prebuilt_dart_sdk_config = _target_prebuilt_dart_sdk_config
prebuilt_dart_sdk_archive = _target_prebuilt_dart_sdk_archive
}
}

Expand Down
Loading

0 comments on commit 051eee8

Please sign in to comment.