[Fuchsia] Remove the legacy tools/fuchsia/target_api_level file (flutter/engine#51497)

After https://github.com/flutter/buildroot/pull/839, the fuchsia_target_api_level becomes a variable in `build/config/fuchsia/gn_configs.gni`, so the target_api_level file and the related gn-args are obsolete and can be removed.

Since this change will also bring e9c4eebe21 in, add @jason-simmons as one of the reviewers.

Bug: http://b/40935282

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
zijiehe@
2024-03-19 10:36:14 -07:00
committed by GitHub
parent 37c82da210
commit 1b0240f093
6 changed files with 28 additions and 13 deletions

2
DEPS
View File

@@ -289,7 +289,7 @@ allowed_hosts = [
]
deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'a22a4ea15e0b9cbba9200014f90fcea16ecb896a',
'src': 'https://github.com/flutter/buildroot.git' + '@' + 'bce07474ce354afc8ea6bb1b695cc86ef376260d',
'src/flutter/third_party/depot_tools':
Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '580b4ff3f5cd0dcaa2eacda28cefe0f45320e8f7',

View File

@@ -405,6 +405,10 @@
"name": "run_tests test",
"script": "flutter/testing/fuchsia/run_tests_test.py"
},
{
"name": "build_fuchsia_artifacts test",
"script": "flutter/tools/fuchsia/build_fuchsia_artifacts_test.py"
},
{
"name": "x64 emulator based debug tests",
"language": "python3",

View File

@@ -178,10 +178,12 @@ def CopyToBucket(src, dst, product=False):
def ReadTargetAPILevel():
filename = os.path.join(os.path.dirname(__file__), 'target_api_level')
filename = os.path.join(os.path.dirname(__file__), '../../build/config/fuchsia/gn_configs.gni')
with open(filename) as f:
api_level = f.read().rstrip('\n')
return api_level
for line in f:
if line.startswith('fuchsia_target_api_level'):
return line.split('=')[-1].strip()
assert False, 'No fuchsia_target_api_level found in //flutter/build/config/fuchsia/gn_configs.gni'
def CopyVulkanDepsToBucket(src, dst, arch):

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env vpython3
import unittest
import build_fuchsia_artifacts
class BuildFuchsiaArtifactsTest(unittest.TestCase):
def test_read_fuchsia_target_api_level(self):
# It's expected to update this test each time the fuchsia_target_api_level
# in //flutter/build/config/fuchsia/gn_configs.gni is changed, so it won't
# accidentally publishing the artifacts with a wrong api level suffix.
self.assertEqual(build_fuchsia_artifacts.ReadTargetAPILevel(), '16')
if __name__ == '__main__':
unittest.main()

View File

@@ -768,12 +768,6 @@ def to_gn_args(args):
if args.target_os == 'fuchsia':
gn_args['gn_configs_path'] = '//flutter/build/config/fuchsia/gn_configs.gni'
gn_args['fuchsia_gn_sdk'] = '//flutter/tools/fuchsia/gn-sdk'
if args.fuchsia_target_api_level is not None:
gn_args['fuchsia_target_api_level'] = args.fuchsia_target_api_level
elif args.target_os == 'fuchsia':
# Read the default target api level from a file so we can update it with a roller
with open(os.path.join(os.path.dirname(__file__), 'fuchsia/target_api_level')) as file:
gn_args['fuchsia_target_api_level'] = int(file.read().strip())
# Flags for Dart features:
if args.use_mallinfo2:
@@ -1222,8 +1216,6 @@ def parse_args(args):
)
parser.add_argument('--no-prebuilt-dart-sdk', dest='prebuilt_dart_sdk', action='store_false')
parser.add_argument('--fuchsia-target-api-level', dest='fuchsia_target_api_level')
# Flags for Dart features.
parser.add_argument(
'--use-mallinfo2',