Provide an inefficient default implementation and make it "@PublishedApi internal" so it can be safely merged as is.
Intrinsics will be added later in follow-up PRs, and then the implementation will be adjusted accordingly
Merge-request: KT-MR-10843
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
Modification registration seems to changed in Java 9. Now if the asked
capacity in `ensureCapacity` function is less than current capacity,
no modification is registered.
When signing is enabled it leads to error
```
Build file '/Users/Shared/Projects/kotlin/libraries/tools/kotlin-gradle-plugin-api/build.gradle.kts' line: 13
Cannot change dependencies of dependency configuration ':kotlin-gradle-plugin-api:commonApi' after it has been included in dependency resolution.
```
When running with
```
gradle :kotlin-test:publish -Psigning.gnupg.keyName=* -Psigning.gnupg.passphrase=* -PsigningRequired=true
```
Problem is reproducible only when singing is enabled.
Register dependencies between publication and signing tasks.
It looks like signing tasks have same output and need to be registered
in all publications.
Error:
* What went wrong:
Some problems were found with the configuration of task ':kotlin-annotation-processing-embeddable:publishMainPublicationToMavenLocal' (type 'PublishToMavenLocal').
- Gradle detected a problem with the following location: '/Users/Shared/Projects/kotlin/plugins/kapt3/kotlin-annotation-processing-embeddable/build/libs/kotlin-annotation-processing-embeddable-1.9.255-SNAPSHOT-sources.jar.asc'.
Reason: Task ':kotlin-annotation-processing-embeddable:publishMainPublicationToMavenLocal' uses this output of task ':kotlin-annotation-processing-embeddable:signGradleCompatPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Reproduce:
gradle :kotlin-annotation-processing-embeddable:publishToMavenLocal -Psigning.gnupg.keyName=* -Psigning.gnupg.passphrase=* -PsigningRequired=true
KTI-1282
Remove dependency to same javadoc jar in all publications as it produces
an implicit dependency to the same signing task. Use different javadoc
tasks instead.
Error:
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':kotlin-test:signCommonPublication' (type 'Sign').
- Gradle detected a problem with the following location: '/kotlin/libraries/kotlin.test/build/distributions/kotlin-test-1.9.20-dev-0000-javadoc.jar.asc'.
Reason: Task ':kotlin-test:publishAnnotationsCommonPublicationToMavenLocal' uses this output of task ':kotlin-test:signCommonPublication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Reproduce:
gradle :kotlin-test:publishToMavenLocal -Psigning.gnupg.keyName=***** -Psigning.gnupg.passphrase=**** -PsigningRequired=true
KTI-1282
Otherwise, e.g., if a local type is within an anonymous object, full
class id will include that anonymous object too, resulting in invalid
type signature for PsiType.
^KT-59533 Fixed
Embedding published version while using source one can lead to runtime errors like NoClassDefFound
if a new (not yet published) declaration was used in implementation.
Flag, Flag constants, Flags typealias, flagsOf() function, and
Flag accessors in nodes (such as KmClass.flags, KmClass.jvmFlags, KmProperty.setterFlags, etc)
#KT-59440
Introduce extensions for KmNodes to work with various modifiers instead of old Flags.SOMETHING.invoke(flags).
Provide Visibility, Modality, and Kind enums.
Introduce KmPropertyAccessorAttributes to replace KmProperty.getterFlags and KmProperty.setterFlags.
Deprecate nodes constructors which take flags but not flags itself (yet).
Adapt KotlinP to changes.
#KT-59440 Fixed
Two additional dependencies were added during 213 platform migration:
com.fasterxml:aalto-xml
org.codehaus.woodstox:stax2-api
Packages were not relocated and now might cause failures such as
```
Caused by: java.lang.NoSuchMethodError: 'void com.fasterxml.aalto.in.ReaderConfig.setXMLResolver(javax.xml.stream.XMLResolver)'
```
if proguard classes of kotlin-compiler-embeddable are registered early
in the classpath.
Without the fix, all libraries share the global scope for all project
libraries. JDK_HOME was used implicitly for things such as providing
Record support, but was not included as a test library/sdk.
KT-59637
Compilation crash must be handled separately in
`convertToConstantValues` method because we still want successfully
compile common code. All constants will be evaluated later on
fir2ir phase.
#KT-59362 Fixed
After the previous commit, IC does not recompile code related to CLI
arguments parsing (likely due to KT-57919), so the resulting dist
compiler doesn't work at all, and all related tests are failing. This
"useless" override tricks the IC to recompile the class and all its
subclasses.
The command line argument parser is using between 0.25s and 0.5s
(depending on platform) on finding annotated properties. This fix
replaces the slow kotlin reflection with java reflection, which is an
order of magnitude faster.
#KT-58183 Fixed