Commit Graph

94956 Commits

Author SHA1 Message Date
Artem Kobzar d9c5f100db [K/JS] Use intrinsics instead of new functions in IR backend. 2022-09-19 13:04:16 +00:00
Yahor Berdnikau e94c1ea0ed Update Kotlin repo for bootstrap update
^KT-27301 Fixed
2022-09-19 12:30:42 +02:00
Yahor Berdnikau e606018372 Fix deprecations in functional tests
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau 47dee4b88c Fix MPP tests
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau 62a3978e6e Drop unused test
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau c81f1259c3 Update KotlinNativeArtifact usages
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau f949bb1fa1 Update KotlinNativeLinkArtifactTask task to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau 8de0cbf28e Update KotlinNativeCompile task to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau 564ed0d181 KotlinNativeLink task now uses compiler options
Now KotlinNativeLink task does not extend AbstractKotlinNativeCompile
task as Link task is tool type task that should use
CompilerCommonToolOptions.

^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau c7064a5edf Move KotlinNativeLink task into separate file
Allows easier to work with class when code completion is slow.

^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau cf3855a396 KotlinNativeCompilerArgBuilder now uses compiler options
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau c8472fb837 Add workaround for external plugin modifying options on common task execution
Currently know problematic place is in 'common-configuration.gradle.kts'
 setting '-Xklib-relative-path-base'. This is done in task doFirst{}
 action to avoid remote build cache misses due to absolute path usage.

^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau 5121db6e2c Update KotlinCompileCommon task to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau ad62262f51 Add workaround for external plugin modifying options on JS task execution
Currently know problematic place is in 'common-configuration.gradle.kts'
 setting '-Xklib-relative-path-base'. This is done in task doFirst{}
 action to avoid remote build cache misses due to absolute path usage.

^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau 9de0fe48f3 Unify approach in Kotlin/JS tasks configuration.
Move tasks configuration into JS tasks configurators.
Introduce enhancedFreeCompilerArgs workaround when freeCompilerArgs
are modified based on existing values.
Introduce workaround for 'destinationDirectory' input when it
content are depenends on multiple other task inputs.

^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau 4881e32e44 Update KotlinJsDce task to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau 6de55d5246 Update Kotlin2JsCompile task to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau 228fff555d Update Kotlin Java toolchain code to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau 732ba96667 Add workaround for external plugin modifying options on task execution
Currently, known plugins doing that are 'kotlin-dsl' and AGP with
compose enabled. They are setting freeCompilerArgs in KotlinCompile
.doFirst task action. At this point compilerOptions.freeCompilerArgs are
 finalized and Gradle doesn't allow further modification.

^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau 6a6bcda298 Register BuildReportsService as task completion listener
This will trigger service instantiation on configuration cache reuse
even when all tasks are up-to-date.

^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau b2f03f6224 Update KotlinCompile task to use compiler options
For Android extension temporary solution via KotlinJvmOptions is
provided.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 0c189de77f Update KotlinCompilation hierarchy to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 9e55946754 Update implementations of KotlinCompilationData to use Compiler*Options
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau cb6ba1487b Update CompilationDetails to use Compiler*Options
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 4977858fc8 Update DefaultLanguageSettings to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau a3ac5b91f6 Update Gradle plugin api to use compiler options
Binary compatible. Source incompatible via adding new methods to
interfaces.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 286d0d56af Introduce Kotlin compiler options with Gradle Properties API types
Old one is deprecated and delegates to new options. All new options
are marked with task input types, so they could be used as `@Nested`
input.

Generated options are using specific types in generated
compiler options. This should simplify code completion and provide
meaningful hints to user.

At this point repository compilation will fail.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 28dd3d4e71 Generate Gradle compiler types into separate project
This will allow to use them on the DSL generation.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 5eebcf8c77 Generate Js runtime diagnostic mode type
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau c1ed683ed8 Generate Js source map embed mode type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 626bd34319 Generate JS module kind type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 14f45b48b3 Generate JS main function execution mode type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 7772ab00cd Generate JvmTarget Gradle DSL object
This is generated based on JvmTarget compiler type without exposing
compiler internals.

^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 37c66837ee Make 'generateGradleOptions' task visible
Makes all generate* tasks easier to discover.

^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 6842842827 Generate KotlinVersion Gradle DSL object
To avoid exposing compiler internal types inside Gradle DSL public api.

ApiVersion and LanguageVersion in terms of compiler api is almost the
same. Actually ApiVersion is generated based on LanguageVersion. To
reduce user confusion what enum to use and what is the difference
- in Gradle DSL they are now exposed as single enum - KotlinVersion.

Mark KotlinVersion with DeprecationLevel.ERROR if related
LanguageVersion is unsupported and with DeprecationLevel.WARNING if
related LanguageVersion is deprecated.

^KT-27301 In Progress
2022-09-19 12:30:34 +02:00
Artem Kobzar a368fc37c7 [K/JS] Make interface subtyping faster and lighter. 2022-09-19 10:26:11 +00:00
Hung Nguyen 03f83ff339 New IC: Include inline property accessors in class/package members
Problem: ClasspathChangesComputer (a core component of the new IC) uses
the existing inline function analysis from the old IC
(IncrementalJvmCache.InlineFunctionsMap). If an inline property accessor
has changed, the inline function analysis will report the name of the
property accessor, not the name of the property.
ClasspathChangesComputer doesn't see the property accessor's name in the
list of class/package members, so it will throw an exception.

Solution: There are 2 options:
  1. If an inline property accessor has changed, the inline function
     analysis can report the name of the property instead of the
     property accessor.
  2. ClasspathChangesComputer can include property accessors in the list
     of class/package members.

In this commit, we will choose option 2 as it is simpler.

Test: New KotlinOnlyClasspathChangesComputerTest.testPropertyAccessors

Small cleanup - PLS SQUASH INTO PREVIOUS COMMIT

  - Address review
  - Fix failed tests
  - Add some trivial changes

^KT-53871 Fixed
2022-09-19 11:50:08 +02:00
Sebastian Sellmair 2ba7c7b8a9 [Gradle][MPP] MPP/AGP compatibility: Bump maxSupportedVersion to 7.3
^KT-54071 Verification Pending
2022-09-19 06:22:32 +00:00
Hung Nguyen def886cd31 Clean up fall-back logic in IncrementalCompilerRunner
Make it clear that there 3 distinct cases:
   1. Incremental compilation completed with an ExitCode.
   2. Incremental compilation was not possible for some valid reason
      (e.g., for a clean build), and we will perform non-incremental
      compilation.
   3. Incremental compilation failed with an exception.
      In this case, we will:
        - Print a warning with a stack trace
        - Ask the user to file a bug
        - Collect rebuild reason enum for analytics
           + TODO: Collect the stack trace too
        - Fall back to non-incremental compilation

Test: Existing BaseIncrementalCompilationMultiProjectIT.testFailureHandling_UserError,
      Updated BaseIncrementalCompilationMultiProjectIT.testFailureHandling_ToolError

^KT-53015: In progress
2022-09-19 07:33:16 +03:00
Abduqodiri Qurbonzoda 57bbc335f4 Fix stdlib docs generator after adding new enums 2022-09-18 22:49:02 +00:00
Abduqodiri Qurbonzoda f38654740e Use Path.deleteRecursively() in the Path.cleanupRecursively() test util 2022-09-18 22:49:02 +00:00
Abduqodiri Qurbonzoda 90189f9c39 Provide Path.copyToRecursively() and Path.deleteRecursively() #KT-52928 2022-09-18 22:49:01 +00:00
Abduqodiri Qurbonzoda 7271de2642 Test Path.copyTo when source and target paths are the same file 2022-09-18 22:49:01 +00:00
Abduqodiri Qurbonzoda 6fde3391d3 Test that Path.copyTo() does not follow symlink in destination 2022-09-18 22:49:01 +00:00
Abduqodiri Qurbonzoda 6ddb0326bb Test that Path.copyTo() copies the source file access permissions 2022-09-18 22:49:01 +00:00
Abduqodiri Qurbonzoda f0da420b1f Move Path.tryCreateSymbolicLinkTo to AbstractPathTest.kt 2022-09-18 22:49:00 +00:00
Andrey Uskov 81d6fea0c4 Enable new incremental compilation in Kotlin project 2022-09-18 16:14:32 +00:00
Jinseong Jeon dd7fc7f4ae AA FIR: avoid unsafe argument retrieval during const evaluation 2022-09-18 17:22:02 +02:00
Sergey Bogolepov 0b4a4ca42b [K/N] AArch64 watchOS target 2022-09-18 08:58:21 +00:00
Ilya Gorbunov 75e1effbc5 Make Optional extensions stable since 1.8
KT-51907, KT-53277
2022-09-17 22:52:46 +00:00