keepLocallyUnsupportedTargets

abstract val keepLocallyUnsupportedTargets: Property<Boolean>

Determines whether to include the declarations for targets which are not supported by the host in the generated dump. A target is not supported by the host in two cases:

  • Cross-compilation is disabled and some targets can't be compiled on the host machine.

  • C-interop is being used, and some targets can't be compiled on the host machine.

These declarations are taken from the reference dump, if available.

If possible, unsupported targets are supplemented with common declarations that are already present in the supported targets.

However, this does not provide a complete guarantee, so it should be used with caution. This mode is intended to improve the "local" development experience only, and it is crucial to double-check ABI dumps on a host supporting the corresponding compilation targets.

If the option is set to false and the compiler does not support some of the Kotlin targets used in the current project, the dump generation fails with an error.

Example

There are two targets in the project iosX64, androidNativeX64 and linuxX64. The current dump contains the my.Utils class which is present in all targets. The my.IosUtils class is only present in iosX64.

Suppose we make these changes:

  • Added my.Utils2 in all targets

  • Added my.LinuxUtils in linuxX64

  • Added my.NonAppleUtils in linuxX64 and androidNativeX64

  • Added my.IosUtils2 in iosX64

On a host that lacks iosX64 support, when this mode is enabled, there are these changes in the dump:

  • my.Utils stays present in all targets of the new dump (correct inference)

  • my.IosUtils stays present in iosX64 target of the new dump (correct inference)

  • my.Utils2 are present in all targets of the new dump (correct inference)

  • my.LinuxUtils are present in linuxX64 target of the new dump (correct inference)

  • my.NonAppleUtils are present in all targets of the new dump (incorrect inference - because usually if it is added to everything, then there is a high chance that the symbol is added to an unsupported target)

  • my.IosUtils2 aren't be present in iosX64 targets of the new dump (incorrect inference - because we can't compile the target and see what appeared individually in it)

Default value: true

Since

2.4.0