Граф коммитов

6 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 74d83ca7e3
[dotnet] Differentiate between "OS version we support as TargetPlatformVersion" and "OS version we support or have supported". (#19882)
The `SdkSupportedTargetPlatformVersion` item group is used for (at least) two things:

1. Generate the `_OR_GREATER` preprocessing symbols:

bfd2919bc4/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.BeforeCommon.targets (L230-L237)

2. Validate the TargetPlatformVersion:

bfd2919bc4/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets (L233-L246)

The problem is that these two uses aren't equivalent.

Take for example the following scenario:

We release bindings for iOS 10, and a library developer takes advantage of the
bindings for the new iOS version, while at the same time supporting
multi-targeting to older platforms:

```csharp
    #if IOS10_0_OR_GREATER
        UseNewApi ();
    #else
        UseOldApi ();
    #endif
```

Time passes, iOS 11 comes out, and we stop shipping bindings specifically for
iOS 10 (the APIs themselves would be included in the bindings for iOS 11). The
code above should continue to work, but iOS 10 is not a valid
TargetPlatformVersion anymore. However, with the current situation there's no
way to express this, because the moment we remove the "10.0" version from
SdkSupportedTargetPlatformVersion, the IOS10_0_OR_GREATER define isn't
generated anymore.

We discussed this in a meeting internally, and the suggestion that came up was
to use metadata to handle this situation, and we've decided to add the
"DefineConstantsOnly=true" metadata to items in
SdkSupportedTargetPlatformVersion that are "OS versions we support or have
supported", but not "OS versions we support as TargetPlatformVersion".

Note: we're adding this to .NET 8, but .NET will not understand the new
metadata until .NET 9, which means this won't be a breaking change until .NET
9.

In a different PR I'll add logic to warn if a project uses a
TargetPlatformVersion that is no longer valid (so that people will start
getting a warning in .NET 8 instead of getting surprised by a build error in
.NET 9).

Ref: https://github.com/dotnet/sdk/issues/38016
2024-01-23 19:17:25 +01:00
Rolf Bjarne Kvinge 744902f014
Simplify argument logic in the C# scripts. (#19805)
When passing -s to the csharp binary, the remaining arguments passed to the
script will be available in the global 'Args' variable.

This way makes it easier to consume arguments in the script, since we won't
have to call Environment.GetCommandLineArgs () and then manually skip the
arguments to the native executable (which would be: the path to mono, the path
to the csharp binary, and the '-s' argument if applicable).
2024-01-15 16:51:36 +01:00
Rolf Bjarne Kvinge fa65fc4bcf
[versions-check.csharp] Improve this script a bit (#10323)
* Pass -s to csharp to tell it the rest of the arguments are the script and its arguments.

    Fixes these warnings printed to the terminal:

        warning CS2002: Source file `7.0' specified multiple times
        warning CS2002: Source file `10.15' specified multiple times

* Add an exception handler and return 1 if there are any exceptions.
2021-01-11 10:47:57 +01:00
Rolf Bjarne Kvinge 42687be5d5 [tools] OS Versions are messy in Mac Catalyst 😡
In some places we have to provide the macOS version, and in other places the
iOS version. Add a map and the corresponding code to convert between the two,
and use them when needed.
2020-12-03 10:43:19 +01:00
Vincent Dondain 445877c159 [Versions-ios.plist] watchOS started at 1.0 (#1328)
- The WatchKit App on a watchOS 1 project has a version of 1.0 (the IDE needs that).
- We still have a watchOS 1 template.
- Use MIN_WATCH_OS_VERSION instead of MIN_WATCHOS_SDK_VERSION.
- iOS com.apple.watchkit is 8.2 not 8.0
- Added watchOS com.apple.watchkit (2.0).
- Fixed typo in versions-check.csharp.
2016-12-13 10:52:58 +01:00
Rolf Bjarne Kvinge 3a771eaf09 Add and ship file that lists the SDK versions XI/XM supports. (#1162)
* Add and ship file that lists the SDK versions XI supports.

Add and ship a file that lists the SDK versions of the various SDKs XI supports.

Also list the minimum SDK version for each extension.

And add a script that verifies that the current SDK version is in this file,
which should ensure every SDK version bump ends up in the file.

* [mtouch] Remove generated file from source control.

* [SdkVersions] Remove versions not in master yet.

* [SdkVersions] Improve detection script to verify that versions are between min and max, and that both min and max are in the list.

* Move things around a bit and add macOS support.

* Update Versions-mac.plist.in with extension info
2016-11-22 14:41:50 +01:00