-
Notifications
You must be signed in to change notification settings - Fork 60
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
[ffigen] Add external-versions.*.max #1988
Conversation
PR HealthBreaking changes ✔️
Changelog Entry ❗
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with
API leaks
|
Package | Leaked API symbols |
---|---|
objective_c | _Version |
This check can be disabled by tagging the PR with skip-leaking-check
.
License Headers ✔️
// 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.
Files |
---|
no missing headers |
All source files should start with a license header.
Unrelated files missing license headers
Files |
---|
pkgs/jni/lib/src/third_party/generated_bindings.dart |
pkgs/objective_c/lib/src/ns_input_stream.dart |
// to the other platforms. | ||
if (minVer == null) { | ||
Availability? availability; | ||
for (final (plat, ver) in [(ios, iosVer), (macos, macosVer)]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much more characters to write platform
and version
and it follows the dart style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Add a
max
field to theexternal-versions
config, and extend the API versioning checks to check the max version vs the version that the API was introduced. Also, if an API is available in some versions, but not all of them, generate documentation describing the versions.The main changes are in api_availability.dart. Instead of just returning a bool for whether the API is available, we now return an
Availability
enum, to also represent partial availability.The version check itself has also become more complicated, since we're now checking the overlap of two ranges, instead of just checking one version vs a range. Broadly speaking, if
apiMin <= configMin && apiMax >= configMax
, the API isAvailability.all
, and ifapiMin <= confMax && apiMax > confMin
then the API isAvailability.some
, otherwise it'sAvailability.none
. There are a bunch of other edge cases to deal with, but that's the main logic.Details
unavailable
flag to their AST nodes, and use it in some of the transformers to get this behavior.getCursorDocComment
a bit to handle the versioning documentation.makeDartDoc
is already null aware, so removed someif (dartDoc != null)
checks.Fixes #1422