Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fuchsia] use the api-level from gn-sdk #54740

Merged
merged 9 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions build/config/fuchsia/gn_configs.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ declare_args() {
# TODO(zijiehe): Remove the override and move it into declare_args once the one
# in //build/config/sdk.gni being removed. - b/40935282

# The target API level for this repository. Embedders should override this
# value to specify the API level the packages produced from this repository
# should be targeting, e.g. in their top-level //.gn file. A value of -1
# means that no API level will be passed to the tools that consumes it.
fuchsia_target_api_level = 22

# The SDK manifest file. This is useful to include as a dependency
# for some targets in order to cause a rebuild when the version of the
# SDK is changed.
Expand Down
5 changes: 3 additions & 2 deletions tools/fuchsia/build_fuchsia_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,13 @@ def CopyToBucket(src, dst, product=False):


def ReadTargetAPILevel():
filename = os.path.join(os.path.dirname(__file__), '../../build/config/fuchsia/gn_configs.gni')
filename = os.path.join(os.path.dirname(__file__), 'gn-sdk/src/gn_configs.gni')
with open(filename) as f:
for line in f:
line = line.strip()
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'
assert False, 'No fuchsia_target_api_level found in ' + filename


def CopyVulkanDepsToBucket(src, dst, arch):
Expand Down
5 changes: 1 addition & 4 deletions tools/fuchsia/build_fuchsia_artifacts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
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 we don't
# accidentally publish the artifacts with an incorrect api level suffix.
self.assertEqual(build_fuchsia_artifacts.ReadTargetAPILevel(), '22')
self.assertGreater(int(build_fuchsia_artifacts.ReadTargetAPILevel()), 21)


if __name__ == '__main__':
Expand Down