This was our previous convention:
/// Fiddle with the thing.
/*System 0.0.2*/
public func foo()
/// Fiddle with the thing.
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
public func foo()
/// Fiddle with the thing.
/*System 0.0.2*/@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func foo()
Unfortunately, regular comments in between a declaration and its
preceding doc comments interfere with documentation tools.
Change things to the style below instead:
/// Fiddle with the thing.
@available(/*System 0.0.2*/macOS 10, *)
public func foo()
/// Fiddle with the thing.
@available(/*SwiftSystem 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/macOS 10, *)
public func foo()
/// Fiddle with the thing.
@available(/*SwiftSystem 0.0.2*/macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
public func foo()
Unfortunately, `@available(*)` isn’t valid syntax, so we have to
add a dummy “macOS 10” version spec. It should have no actual effect.
By running this script, we can expand comments of the form
```
/*System 0.0.1*/
```
Into either a longer comment that includes the associated OS versions numbers,
```
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
```
or, when the `--attribute` option is used, into an actual `@available` attribute:
```
/*System 0.0.1*/@available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)
```
The script can be run repeatedly to switch between these two forms, as needed.