Compare commits

..

235 Commits

Author SHA1 Message Date
Raluca Sauciuc
be42b8094b Expand the fix from commit 6c274cecff to cover AndroidX
Android Studio users who migrated to AndroidX are running into the
databinding deadlock again: https://issuetracker.google.com/111788726
2018-09-14 19:58:20 +03:00
Yan Zhulanow
44ecfb2fb8 Android Extensions: Check the backing 'virtualFile' validity before calling 'findFile()' (EA-124028) 2018-08-29 17:10:01 +03:00
Alexey Sedunov
5c26b0ea6f Misc: Fix bug introduced after compatibility-related changes 2018-08-22 12:35:22 +03:00
Vyacheslav Gerasimov
feb5a3040f as33c4: Add missing GooglePluginUpdateVerifier 2018-08-21 15:40:07 +03:00
Alexander Udalov
31c113e7ee Add ChangeLog for 1.2.61 2018-08-17 17:48:41 +02:00
Sergey Rostov
b520c72efe Revert "Use separate files for JS and JVM global cache in JPS"
This reverts commit c411521
2018-08-16 12:30:13 +03:00
Alexey Tsvetkov
c411521b7e Use separate files for JS and JVM global cache in JPS
#KT-26072 fixed
2018-08-16 11:26:03 +03:00
Sergey Rostov
3a54e120b5 Kotlin facet UI, JS: Hide "Enable incremental compilation (experimental)".
This option is project-wide only, so it should be visible only in project settings.
#KT-26095 Fixed.
2018-08-16 10:48:26 +03:00
Pavel V. Talanov
386e9b6f6c Run/test line markers: aggregate results across implementing modules
#KT-20363 Fixed
2018-08-15 12:51:01 +02:00
Nicolay Mitropolsky
46f1e271bf Uast: KotlinUAnnotation.uastAnchor uses nameReferenceElement as javaPsi
because `nameReferenceElement` is not-null in LightAnnotations, but `referenceNameElement` violates `javaPsi` contract

(cherry picked from commit cd047b9605)
2018-08-14 20:19:07 +03:00
Nicolay Mitropolsky
923f51cd01 KtLightPsiJavaCodeReferenceElement reference getting made lazy (KT-26036, EA-125884)
Collecting references from contributors could be expensive and even recursive (EA-125884)

(cherry picked from commit 9db2b6ffba)
2018-08-14 20:18:56 +03:00
Nicolay Mitropolsky
1f6ecc2f42 KtLightPsiJavaCodeReferenceElement delegate made nullable (KT-26036, EA-124029)
(cherry picked from commit 2ba2d360c2)
2018-08-14 20:18:40 +03:00
Yan Zhulanow
5133ac21f8 Kapt: Ignore annotation-processing-gradle compiler plugin we got from Gradle (KT-24714)
Cause it's built for the shaded Kotlin compiler and won't work with JPS.
2018-08-13 03:05:17 +03:00
Yan Zhulanow
b09f3a36c4 Parcelize: Fix infinite recursive loop for zero-parameter Parcelable classes (KT-25839) 2018-08-13 03:02:49 +03:00
Alexander Udalov
c9d4aab352 Run classifier usage checkers on function types
(cherry picked from commit fe2251bfca)
2018-08-07 13:59:55 +02:00
Natalia Selezneva
ca34e2085e Wraps syncPublisher() call in KotlinCompilerSettings in a dispose check
Fix ConfigureKotlinTest
2018-08-07 11:15:08 +03:00
Alexey Sedunov
10ce84990b Minor: Fix compilation in AS3.3 bunch 2018-08-03 20:13:54 +03:00
Nikolay Krasko
cbe3d00dfe Render flexible types with enhancement as enhanced in IDE (KT-25622)
Main targets for the fix is completion, parameters info, inlay hints and
override/implement.

Other IDE functions might be affected.

 #KT-24911 Fixed
 #KT-25616 Fixed
 #KT-25622 Fixed
2018-08-03 16:09:11 +03:00
Nikolay Krasko
403ae3f837 Option for rendering types with enhancement 2018-08-03 16:09:10 +03:00
Nikolay Krasko
db12e36ec5 Extend list of annotations ignored in parameter info (KT-24911, KT-25622)
#KT-24911 Fixed
2018-08-03 16:09:09 +03:00
Nikolay Krasko
503d911601 Skip main file while configuring extra files in parameter info test 2018-08-03 16:09:08 +03:00
Nikolay Krasko
fdfaeae21f Allow kotlin extra files in parameter info tests 2018-08-03 16:09:07 +03:00
Alexey Sedunov
375c785694 Misc: Add bunch files to fix compatibility with AS3.3C4 2018-08-03 15:28:14 +03:00
Alexey Tsvetkov
4c9eb5ef1c JS IC: track lookups from libraries
Otherwise we don't track lookups from other modules

    #KT-25540 fixed
2018-08-02 18:07:49 +03:00
Alexander Udalov
80763879ef Update ChangeLog for 1.2.60
Remove a not very interesting feature
2018-08-01 18:56:49 +02:00
Alexander Udalov
aa83ea22f3 Update ChangeLog for 1.2.60 2018-08-01 13:24:31 +02:00
Pavel V. Talanov
d8cddb29ef Do not throw on using kotlin resolve via light classes in dumb mode
Fix an exception when kotlin resolve was invoked when searching
    for tests while indexing (probably many other cases)
Does not actually fix the behaviour, the test will not be found
    resulting in undesired behaviour
Full-blown infrastructure for resolving Kotlin in dumb mode is needed
    to fix the behaviour

 #KT-24979 Fixed
2018-07-27 20:51:07 +02:00
Alexander Udalov
4d3cf043d8 Add ChangeLog for 1.2.60 2018-07-26 19:39:37 +02:00
Vyacheslav Gerasimov
2b2c6a68db as33c4: Update build range for AS 3.3 plugin to match C4 and further releases 2018-07-25 16:15:37 +03:00
Vyacheslav Gerasimov
ddea4a8458 as32: Update build range for AS 3.2 plugin to match RC1 and further releases 2018-07-25 16:15:34 +03:00
Vyacheslav Gerasimov
2ae0d752d1 as33c4: Remove accidentally commited KotlinCompilerVersion.java 2018-07-24 18:27:23 +03:00
Vyacheslav Gerasimov
f787a414ff Update build range for AS 3.3 plugin to match only AS 3.3 C3 2018-07-24 14:51:59 +03:00
Vyacheslav Gerasimov
5d3663316a Update build range for AS 3.2 plugin to match next AS 3.2 releases 2018-07-24 14:51:16 +03:00
Vyacheslav Gerasimov
eb5767bad5 as33c4: Remove registration of AndroidGradleOrderEnumerationHandler from gradle-java.xml 2018-07-24 13:07:03 +03:00
Vyacheslav Gerasimov
b5d3ed2bbe as33c4: Fix compatibility with AS 3.3 C4 2018-07-24 11:43:58 +03:00
Vyacheslav Gerasimov
2df5edb7d0 as33c4: Remove KotlinExplicitMovementProvider.kt
compilation fails against git4idea bundled in AS, wrong version probably
2018-07-24 11:43:58 +03:00
Vyacheslav Gerasimov
82eb0bcfd4 as33c4: Update versions for AS 3.3 C4 2018-07-24 11:43:58 +03:00
Vyacheslav Gerasimov
9f98e596c3 as33c4: *TEMP* Build against AS 3.3 C4 2018-07-24 11:43:58 +03:00
Vyacheslav Gerasimov
a1c1c42924 Add as33c4 bunch derived from 182 2018-07-24 11:43:58 +03:00
Nikolay Krasko
c62e788936 Show popup about too old bundled compiler in Gradle and Maven (KT-25546) 2018-07-24 03:42:02 +03:00
Alexey Tsvetkov
9a04e1938c Minor: fix 173 patchset 2018-07-23 23:12:17 +03:00
Alexey Tsvetkov
95af90e281 Minor: fix 172 patchset 2018-07-23 23:11:25 +03:00
Alexey Tsvetkov
add6664045 Report info message when JS IC is enabled in JPS 2018-07-23 15:45:22 +03:00
Alexey Tsvetkov
1f6d7d9873 Add setting to enable JS IC for JPS
#KT-25565 fixed
2018-07-23 15:45:17 +03:00
Alexey Tsvetkov
8007d78401 Use separate system properties to control IC for JVM and JS
Also this commit effectively disables JS IC by default

     #KT-25563 fixed
2018-07-23 15:45:11 +03:00
Yan Zhulanow
d303b4cb13 PrePush hook (temporary): Do nothing on a download failure 2018-07-20 22:16:23 +03:00
Yan Zhulanow
621acd3457 Kapt: Fix "Unknown option: infoAsWarnings" (#KT-25396)
(cherry picked from commit 02ee3aef3f)
2018-07-20 22:13:42 +03:00
Yan Zhulanow
418389a125 Kapt: Do not add JDK jars if the 'no-jdk' option is set (KT-25258)
(cherry picked from commit 1eb69a6960)
2018-07-20 22:13:26 +03:00
Dmitry Savvinov
f403b99d34 Deprecate visibility of static members inherited from Java
Now they are not visible by short name through companion objects, just
like classifiers in KT-21515

^KT-25333 In progress
2018-07-19 13:36:29 +03:00
Ilya Chernikov
51da66fb39 Do not throw on incompatible cli scripting plugin
More reliably fixes #KT-24946, #KT-24438 and alike
2018-07-18 15:08:12 +02:00
Nicolay Mitropolsky
2cb03f9097 Uast: implicit receiver for local function calls (KT-25524)
(cherry picked from commit a616f6cca9)
2018-07-18 14:09:13 +03:00
Nicolay Mitropolsky
cf07348abe Uast: implicit receiver for function variables calls (KT-25524)
(cherry picked from commit 5212728a82)
2018-07-18 14:08:26 +03:00
Denis Zharkov
8caf1ae593 Fix test data after 89d99e3989 2018-07-18 12:26:36 +03:00
Nikolay Krasko
94ac895de2 Stop reporting "using default platform" messages to log (KT-15300)
#KT-15300 Fixed

(cherry picked from commit 752cdedfe2)
2018-07-17 21:13:25 +03:00
Pavel V. Talanov
27f15a74b0 Do not try inexact resolve on scripts
Script light psi depends on script definition
    which is costly to compute correctly

 #KT-25395 Fixed
2018-07-17 13:42:06 +02:00
Dmitry Savvinov
fe26547cd7 Make warning about usage of -XX-flags less scary 2018-07-17 12:09:05 +03:00
Denis Zharkov
1960587512 Refine diagnostics for nullability migration warnings
#KT-24911 Fixed
2018-07-16 10:50:31 +03:00
Nicolay Mitropolsky
8d1690ca00 lightAnnotations: check element validity before resolving call
(cherry picked from commit 3c71761cf3)
2018-07-13 20:24:22 +03:00
Nicolay Mitropolsky
ca04d5933c lightAnnotations: proper parents for KtLightAnnotationsValues
(cherry picked from commit cedc6821c3)
2018-07-13 20:22:58 +03:00
Alexander Udalov
b0991596fe Minor, improve wording in exception message
(cherry picked from commit dec003af71)
2018-07-13 18:46:32 +02:00
Alexander Udalov
c4ec46b3c5 Fix regression in reflection on looking up equals/hashCode/toString in interface
Caused by 4266e50be8 and 8ccbbf71ec. Previously it worked because we
used hardcoded signatures of equals/hashCode/toString and always looked
them up in java.lang.Object

 #KT-25404 Fixed

(cherry picked from commit 66b383349f)
2018-07-13 18:46:30 +02:00
Natalia Selezneva
c1fe8f31f0 Add quickfix to adding kotlin-script-runtime.jar to classpath
(cherry picked from commit e395a32734)
^KT-25402 Fixed
2018-07-12 14:01:47 +03:00
Natalia Selezneva
52af70f887 Fix deadlock in ScriptTemplatesFromCompilerSettingsProvider
(cherry picked from commit d241c092e2)
^KT-25373 Fixed
2018-07-11 16:27:40 +03:00
Alexey Sedunov
290805100c Misc: Make LibraryEffectiveKindProvider cache an instance property
(cherry picked from commit fc93f00c7b)
2018-07-11 15:14:29 +03:00
Ilya Gorbunov
4f54b01820 Fix incorrect parameter order in TestNG asserter
#KT-25351 Fixed

(cherry picked from commit 5e5b9e5)
2018-07-10 19:18:17 +03:00
Natalia Selezneva
cb9692834e Fix AbstractScriptConfigurationTest
Add dependency on script runtime for module.
Provide default test script template thought template-classpath.
2018-07-10 16:47:07 +02:00
Natalia Selezneva
56f2e469fc Add LightProjectDescriptor with script-runtime dependency. Use it in PsiChecker tests. 2018-07-10 16:46:50 +02:00
Natalia Selezneva
37374f5617 Fix testdata fo IdeaModuleInfoTest: for script in module IdeaModuleInfo is created instead of ScriptModuleInfo.ForFile 2018-07-10 16:46:34 +02:00
Nicolay Mitropolsky
bd18a115a7 172: KotlinUastApiTest.kt compilation fix 2018-07-10 09:03:43 +03:00
Ilya Gorbunov
35170f5b3f Report more diagnostics when JDK8PlatformImplementations can't be cast to base type
#EA-120914 - CCE: PlatformImplementationsKt.<clinit>

(cherry picked from commit b7d3382)
2018-07-09 22:35:54 +03:00
Ilya Gorbunov
42d4597480 Fix overflow in empty progressions' last element
#KT-24204 Fixed

(cherry picked from commit 35beb96)
2018-07-09 22:35:42 +03:00
Ilya Gorbunov
92f008db5e Add failing tests for overflow in empty progressions KT-24204
(cherry picked from commit be8cb94)
2018-07-09 22:35:30 +03:00
Nicolay Mitropolsky
19fe1a57ee Uast: ULambdaExpression returns proper functionalInterfaceType for SamAdapterExtensionFunctionDescriptor (KT-25297)
(cherry picked from commit dd0e3cd135)
2018-07-09 19:44:38 +03:00
Nicolay Mitropolsky
0eaebcaf9e Uast: properly handling explicit SAM (KT-25297)
(cherry picked from commit 2c7687195c)
2018-07-09 19:44:19 +03:00
Nicolay Mitropolsky
43d195f3e2 Uast: create KotlinULambdaExpression for in-place lambdas (KT-25297)
and provide appropriate functionalInterface

(cherry picked from commit 38e2d474b7)
2018-07-09 19:44:06 +03:00
Mikhael Bogdanov
34fc43ae02 Generate sam wrappers in inlined lambda in same way as in inline function
#KT-24825 Fixed

(cherry picked from commit 66e68fbb53)
2018-07-09 15:54:03 +02:00
Ilya Chernikov
42fc117900 Fix script templates tests after updating definitions selection logic 2018-07-09 15:40:35 +02:00
Ilya Chernikov
bcb74bf5bb Fix testdata 2018-07-09 15:40:35 +02:00
Ilya Chernikov
679d49b8f2 Drop support of KOTLIN_HOME environment variable in the command-line compiler
it is proved to be fragile and seems unnecessary at the moment
2018-07-09 15:40:35 +02:00
Ilya Chernikov
e8377e6b22 Fixes after review 2018-07-09 15:40:35 +02:00
Ilya Chernikov
2a04236902 Fix configurations chaining in the script compiler 2018-07-09 15:40:35 +02:00
Ilya Chernikov
5de77d1404 Take path to scripting plugin libs only from compiler jar path...
ignoring all "kotlin home" settings, since we need to load a compatible
plugin. Fixes #KT-24946
2018-07-09 15:40:35 +02:00
Ilya Chernikov
c860d8b0d6 Allow multiple same jsr305 options in the command-line
do not report duplicate jsr305 entries if options are the same
2018-07-09 15:40:35 +02:00
Ilya Chernikov
f8f3cd435a Add kts to supported file extensions to the DirtySourceFilesHolder as well
allows jps to compile scripts along with sources,
finally fixes #KT-22611
2018-07-09 15:40:35 +02:00
Ilya Chernikov
2a70d61a9f Drop half-backed support of "dynamic" annotations on scripts...
leaving it in the history so it could be restored and finished, if needed
2018-07-09 15:40:35 +02:00
Ilya Chernikov
be5a711e78 Add script constructor annotations inheritance 2018-07-09 15:40:35 +02:00
Ilya Chernikov
b69b9e2a9f Add script class annotations generation from the base class 2018-07-09 15:40:35 +02:00
Ilya Chernikov
956514c87e Refactor script definitions loading and discovery:
Improve logic, code reuse and readability
Add support for more corner cases
Improve reporting
Add definitions loading test
2018-07-09 15:40:35 +02:00
Ilya Chernikov
7e833239e8 Fix list of script definitions recognized by the asm-based loading:
fix of the previous fix to #KT-24926
2018-07-09 15:40:35 +02:00
Ilya Chernikov
6fdbae2aa4 Fix explicit custom scripting definitions choice logic:
add standard script def after custom defs are processed
2018-07-09 15:40:35 +02:00
Ilya Chernikov
47d62d9019 Improve automatic scripting plugin picking logic 2018-07-09 15:40:35 +02:00
Ilya Chernikov
16d0ec4980 Fix script definition discovery logic:
for cases when directory-based dependencies are passed and directories
with resources are different from directories with classes
Significant refactoring to make code prettier
2018-07-09 15:40:35 +02:00
Ilya Chernikov
d479f0ebd5 Fix default configuration refinement in scripts 2018-07-09 15:40:35 +02:00
Ilya Chernikov
0b42d17c83 Return script instance from the evaluation in the basic jvm evaluator 2018-07-09 15:40:35 +02:00
Pavel Talanov
7b5c88ed7c Implement support for static resolving to scripts in source roots in IDEA 2018-07-09 15:40:35 +02:00
Ilya Chernikov
b0fb1d85ff Create proper constructor in script descriptor
allows to resolve calls to scripts in compiler (but not in the IDE yet)
Some refactorings on the way
2018-07-09 15:40:35 +02:00
Alexey Tsvetkov
5859c5ec25 Test for KT-25051 2018-07-09 16:31:45 +03:00
Alexey Tsvetkov
d24b7b0a62 Remove redundant test
`testMultiModuleICNonAndroidModuleIsChanged` already tested
android and non-android change
2018-07-09 16:31:45 +03:00
Alexey Tsvetkov
85fe6508f6 Register kotlin_module as output of all files
Previously kotlin_module was registered as output
only for files containing top-level declarations
2018-07-09 16:31:45 +03:00
Alexey Tsvetkov
a6d7485f37 Always generate kotlin_module
#KT-25133 fixed
    #KT-25051 fixed
2018-07-09 16:31:45 +03:00
Yan Zhulanow
f50b00a3d6 Minor: Do not report stack traces about PCE to the debug log 2018-07-09 15:37:13 +03:00
Yan Zhulanow
349d703232 Minor: Move safeSourceName to utils, make it a function 2018-07-09 15:37:13 +03:00
Yan Zhulanow
26eb425bdb Kapt: Do not add imports for overloaded callables (#KT-25071) 2018-07-09 15:37:13 +03:00
Yan Zhulanow
1507ce4081 Minor: Fix the "Could not find installation home path" terminal warning 2018-07-09 15:37:12 +03:00
Yan Zhulanow
9edd9847a6 Debugger: Check if the class instance is not yet collected before usage (EA-118758) 2018-07-09 15:37:12 +03:00
Yan Zhulanow
2950465277 Evaluator: Support when expressions (EA-119639) 2018-07-09 15:37:12 +03:00
Yan Zhulanow
66c564ec7a Debugger: Add a missing read action (EA-119592) 2018-07-09 15:37:12 +03:00
Yan Zhulanow
f92588ce9c Check if the stackFrame we use is valid (EA-120312)
Unfortunately, the 'isValid' is a private field in StackFrameImpl so we have to catch an exception with an empty catch block.
2018-07-09 15:37:12 +03:00
Yan Zhulanow
3325a13974 Add a number of runReadAction() in debugger (EA-120985) 2018-07-09 15:37:12 +03:00
Yan Zhulanow
559282b6da Uast: Do not try to evaluate error values (EA-121947) 2018-07-09 15:37:12 +03:00
Yan Zhulanow
67c1b4918f Eval4J: Do not report certain kinds of exceptions to EA 2018-07-09 15:37:12 +03:00
Yan Zhulanow
9c00f62c6d Minor: Fix exception message 2018-07-09 15:37:11 +03:00
Yan Zhulanow
93afdb29ef Evaluator: Do not report division by zero (EA-122365) 2018-07-09 15:37:11 +03:00
Yan Zhulanow
6512ed882f Debugger: Add a missing read action (EA-123238) 2018-07-09 15:37:11 +03:00
Yan Zhulanow
195b35e638 Kapt: Ensure we collect .java files from the unique directories (#KT-24963) 2018-07-09 15:37:11 +03:00
Yan Zhulanow
41439dd708 Pill: Allow '18x-SNAPSHOT' versions 2018-07-09 15:37:11 +03:00
Yan Zhulanow
0368b4be03 Debugger: Exclude inline callable usages inside itself (EA-117459) 2018-07-09 15:37:11 +03:00
Yan Zhulanow
d871511a18 Kapt: Allow to disable info->warning mapping in logger (#KT-24985) 2018-07-09 15:37:11 +03:00
Yan Zhulanow
89863a712f as32: Kapt: 'kapt.kotlin.generated' is not marked as source root in Android Studio (#KT-24449) 2018-07-09 15:37:11 +03:00
Yan Zhulanow
b9867d3091 Remove Gradle(Java) Kotlin configurator in Android modules (#KT-17946) 2018-07-09 15:37:10 +03:00
Yan Zhulanow
eb056eb469 Uast: Move all IDE-related code to uast-idea, get rid of the 'idea' dependency
Uast is used in the CLI version of Android Lint so 'uast-kotlin' should run correctly even without IDE.
2018-07-09 15:37:10 +03:00
Yan Zhulanow
3adcb27b24 Kapt: Allow to disable warning for 'annotationProcessor' dependencies (#KT-24883) 2018-07-09 15:37:10 +03:00
Yan Zhulanow
2d4b8f57f7 Pill: Support Android Studio bunches in "IDEA" run configuration 2018-07-09 15:37:10 +03:00
Yan Zhulanow
76f294fc0f Extract refactoring: Make an extracted function 'inline' if any of its type parameters are reified (#KT-23983) 2018-07-09 15:37:10 +03:00
Yan Zhulanow
57d08e74c9 Minor: Fix test data for Parcelize annotation checker 2018-07-09 15:37:10 +03:00
Yan Zhulanow
0c5b8caa43 Parcelize: Recognize '@IgnoredOnParcel' with @get: use-site annotation target 2018-07-09 15:37:10 +03:00
Yan Zhulanow
e679d60fd4 Parcelize: Generate non-final 'writeToParcel()' and 'describeContents()' (#KT-24720) 2018-07-09 15:37:09 +03:00
Yan Zhulanow
f8862690eb Parcelize: Fix Parcelize box tests 2018-07-09 15:37:09 +03:00
Yan Zhulanow
b2fd7d06da Parcelize: Check @IgnoredOnParcel annotation usage (#KT-24459) 2018-07-09 15:37:09 +03:00
Yan Zhulanow
39d1eaeb2c Parcelize: Serialize primitive arrays correctly when the custom parceler is provided.
This fixes failing 'customSerializerBoxing' test.
2018-07-09 15:37:09 +03:00
Yan Zhulanow
11ebc67b9b Parcelize: Always map primitive array element types as boxed types for Array<T> (#KT-23808) 2018-07-09 15:37:09 +03:00
Yan Zhulanow
94f5d0419a Parcelize: Support objects and enums (#KT-22576) 2018-07-09 15:37:09 +03:00
Alexander Podkhalyuzin
fe92eeb6ca Do not stop recursive visitor with return
#KT-23627 Fixed

(cherry picked from commit 04fd4ef9de)
2018-07-09 15:32:17 +03:00
Natalia Selezneva
b21b425d7e Run script dependencies update on editor focus change
(cherry picked from commit 4b1ce15619)

^KT-24588 Fixed
2018-07-06 12:01:50 +03:00
Sergey Rostov
20820baa48 Fix StringIndexOutOfBoundsException in KotlinConsoleFilterProvider.kt (EA-118757)
(cherry picked from commit 7408504356)
2018-07-06 11:46:54 +03:00
Denis Zharkov
2bae870b43 Optimize KotlinPropertyAccessorsReferenceSearcher for case of no kt-files
Property names by accessors can be computed without resolving
java descriptors

 #KT-11477 Fixed
 #KT-23844 Fixed
2018-07-06 10:29:56 +03:00
Denis Zharkov
c7a3be0083 Optimize SyntheticJavaPropertyDescriptor.Companion::findByGetterOrSetter
Do not force getContributedDescriptors call when we need to request
at most three names
2018-07-06 10:28:16 +03:00
Denis Zharkov
8e824defaf Reformat SyntheticJavaPropertiesScope.kt 2018-07-06 10:28:08 +03:00
Denis Zharkov
0765850907 Load Java overrides of Kotlin suspend functions as suspend, too
There's still some blind spots:
- Covariant overrides in Java (KT-25036)
- Current implementation assumes that when language version is 1.3 every suspend function
reference only release-coroutines-package Continuation
(we need to check if it's a correct statement)

 #KT-24848 Fixed
 #KT-25036 Open
2018-07-06 10:26:52 +03:00
Denis Zharkov
3f2fabb655 Minor. Reformat LazyJavaClassMemberScope.kt 2018-07-06 10:26:48 +03:00
Denis Zharkov
0bbe975baa Add postfix template for listOf/setOf/etc
#KT-25239 Fixed
2018-07-06 10:16:34 +03:00
Denis Zharkov
f07eb3121a Minor. Reformat org.jetbrains.kotlin.idea.codeInsight.postfix 2018-07-06 10:16:34 +03:00
Denis Zharkov
c880337f3e Implement quickfix wrapping elements in collection literal calls
#KT-25238 Fixed
2018-07-06 10:16:34 +03:00
Alexey Tsvetkov
96d2896831 Temporarily ignore Kapt3WorkersAndroid32IT 2018-07-05 18:23:20 +03:00
Alexey Tsvetkov
c1083a103e Allow overriding default Gradle version per test class 2018-07-05 18:23:16 +03:00
Alexey Tsvetkov
31b987cf27 Add SDK jars to compile classpath for Kapt Workers task 2018-07-05 18:23:13 +03:00
Alexey Tsvetkov
26141ab16c Close kapt context 2018-07-05 18:23:10 +03:00
Alexey Tsvetkov
d97e98f4a8 Test kapt with workers 2018-07-05 18:23:07 +03:00
Alexey Tsvetkov
6e9bcf3929 Update android tools versions in Gradle plugin tests 2018-07-05 18:23:04 +03:00
Alexey Tsvetkov
eaf4d2a5ac Remove projectDir input from KaptWithoutKotlincTask
It is redundant since the task would be restarted when project dir changes,
because paths of sources would also change
2018-07-05 18:23:01 +03:00
Alexey Tsvetkov
c402630348 Fix getting plugin version for kotlinKaptWorkerDependencies configuration
Previously the configuration would not work for non-android projects,
because it looked only at KotlinAndroidPluginWrapper for plugin version
2018-07-05 18:22:58 +03:00
Alexey Tsvetkov
67334ae9e9 Create kotlinKaptWorkerDependencies only once
#KT-25124 fixed
2018-07-05 18:22:54 +03:00
Alexey Tsvetkov
fa10c32ffa Do not load annotation processors when generating stubs
#KT-25131 fixed
2018-07-05 18:22:51 +03:00
Alexey Tsvetkov
78a25c33fd Fix compilation of plugin projects in JPS
#KT-25218 fixed
2018-07-05 18:22:47 +03:00
Nicolay Mitropolsky
c49df7fee6 Uast: converting Unit to void on type mapping (KT-25249)
(cherry picked from commit 5d9807ac36)
2018-07-05 17:06:03 +03:00
Nikolay Krasko
4ae13e29fb Show kotlin internal information only in internal builds 2018-07-05 16:23:54 +03:00
Alexander Udalov
c4ea50b357 Retain optional expected annotations when compiling platform code
After this change, optional expected annotations will be compiled to
physical class files on JVM, and stored to metadata on other platforms,
to allow their usages from dependent platform modules. For example:

    @OptionalExpectation
    expect annotation class A

When compiling this code on JVM, A.class will be produced as if the
class A did neither have the 'expect' modifier, nor had it been
annotated with OptionalExpectation. Note that if there's no actual
annotation class for A, then usages (which can only be usages as
annotation entries) are simply skipped.

Class A will be public from Kotlin's point of view (since it should
be possible to use it in Kotlin sources), but _package-private_ in Java
to disallow its usages outside of the declaring module.

 #KT-18882 Fixed
 #KT-24617 Fixed

(cherry picked from commit 1951d38f40)
2018-07-05 14:34:46 +02:00
Alexander Udalov
0df72aaf15 Pass BindingContext to CodegenUtil.getActualDeclarations
Will be used in a subsequent commit. Also rename getActualDeclarations
-> getDeclarationsToGenerate

(cherry picked from commit 4e217b180a)
2018-07-05 14:34:40 +02:00
Ilya Chernikov
a6718a6086 Add 1.2.51 issues to changelog
(cherry picked from commit db73ed1d0c)
2018-07-05 13:09:38 +02:00
Alexey Sedunov
bdc02571c7 JS: Fix detection of run configuration with preconfigured Mocha
#KT-25253 Fixed

(cherry picked from commit 2efd467c42)
2018-07-04 18:22:03 +03:00
Alexey Sedunov
acbd5e7fae Misc: Fix SOE due to wrong overloaded method call
#KT-25247 Fixed

(cherry picked from commit 5f69eebe66)
2018-07-03 22:14:02 +03:00
Yan Zhulanow
8efd490c5c as33: Remove AndroidGradleOrderEnumerationHandler (should be moved to the Android plugin) 2018-07-03 16:15:48 +03:00
Alexey Sedunov
ea32314468 Search Everywhere: Recover original behavior for non-functions
#KT-25189 Fixed

(cherry picked from commit 03ed4e39e3)
2018-07-02 22:50:42 +03:00
Alexey Sedunov
c2251e8ca9 Test Support: KT-22306
Do not show run markers in JS modules when no relevant run configurations are available

 #KT-22306 Fixed

(cherry picked from commit b52b07ec79)
2018-07-02 22:50:13 +03:00
Alexey Sedunov
bb97b70373 Rename: Fix processing of references to synthetic Java properties
Fixes for non-master-bunch plugin.xml

(cherry picked from commit 3e91346240)
2018-07-02 22:49:53 +03:00
Vyacheslav Gerasimov
2c3e02bc8c UAST: Fix possible TypeCastException when creating KotlinUNamedExpression
(cherry picked from commit a829251690)
2018-07-02 21:44:52 +03:00
Vyacheslav Gerasimov
ffd673bbda Check if module disposed when getting modules with kotlin files
(cherry picked from commit 23ee463053)
2018-07-02 21:44:44 +03:00
Vyacheslav Gerasimov
34b04d8ec4 Reformat ConfigureKotlinInProjectUtils
(cherry picked from commit 16b4d25c1d)
2018-07-02 21:44:37 +03:00
Vyacheslav Gerasimov
e1b7142454 UAST: Do not log PCE in DeclarationDescriptor.toSource
(cherry picked from commit 62c0d37d45)
2018-07-02 21:44:29 +03:00
Yan Zhulanow
70230564fb Add support for Android Studio 3.3 Canary 1 2018-07-02 21:16:09 +03:00
Yan Zhulanow
371ee9f1f7 Minor: Make plugin.xml and build files more consistent with the main bunch 2018-07-02 21:16:08 +03:00
Yan Zhulanow
20d5c78e5d Make source set empty for Android modules of deleting the resulting JAR files in 'ideaPlugin' task 2018-07-02 21:07:58 +03:00
Raluca Sauciuc
1a25aefc94 as33: Android dependency reversal
(cherry picked from commit be781f4f462f74ca0efcc91b5c07a5b3756ba5b2)
2018-07-02 21:07:58 +03:00
Alexander Udalov
b021fea545 Improve reflection error message when function/property is not found 2018-07-02 19:05:05 +02:00
Alexander Udalov
b20b34224d Load all resources in RuntimePackagePartProvider; optimize code
The issue was reproducible when the same package is present in different
modules with the same -module-name (which is a popular case of src/test
roots in simple IDEA projects). The problem was in the fact that several
resource files containing package name mapping with the same name were
present in the classpath, but RuntimePackagePartProvider only considered
the first one. The fix is to use getResources instead of
getResourceAsStream and handle each returned resource.

Also, optimize internal representation to store the mapping in the form
which is the most convenient for findPackageParts, which should be
faster than registerModule because in theory, it's called more often.

 #KT-21973 Fixed
 #KT-24651
2018-07-02 19:05:05 +02:00
Alexander Udalov
42caa688de Remove obsolete BuiltInFunction and mapIntrinsicFunctionSignature
This is now fully covered by the JVM signature mapping, introduced in
the previous commit. The change in KDeclarationContainerImpl.methodOwner
is needed because primitive classes have no methods on JVM; and when
we're looking for "Int.equals", we'll now look it up in the Class object
for java.lang.Integer, not for the primitive int.
2018-07-02 19:05:05 +02:00
Alexander Udalov
a8f31de2f5 Use manual type mapping in reflection for members from built-ins
There are cases when members deserialized from JVM classes have no JVM
signature in the proto. For example, if a member is inherited from a
built-in class (such as Map.getOrDefault in some Map implementations),
or if a member is synthesized in the compiler front-end and back-end
separately (such as enum values/valueOf). In these cases, we'll use the
naive type mapping to try to recover the signature.

 #KT-16616 Fixed
 #KT-17542 Fixed
2018-07-02 19:05:05 +02:00
Alexander Udalov
f6488f7c4a Reformat module reflection.jvm, fix inspections/warnings 2018-07-02 19:04:07 +02:00
Alexander Udalov
34677658b3 Catch SecurityException when reading system property in BitEncoding
This does not fix KT-15167 though because the exception from KT-20575 is
thrown shortly afterwards

 #KT-15167
2018-07-02 19:04:06 +02:00
Alexander Udalov
fca612bcf8 Improve diagnostic for missing BuiltInsLoader implementation
Also initialize it lazily to avoid wrapping the exception into
ExceptionInInitializerError

 #KT-20575
2018-07-02 19:04:06 +02:00
Alexander Udalov
d2908c3894 Do not serialize constructors for anonymous objects
The only client of this data is reflection, and since anonymous objects
do not have constructors in the source code, they shouldn't in
reflection as well

 #KT-20442 Fixed
2018-07-02 19:04:06 +02:00
Alexander Udalov
00c292fe77 Do not create primary constructor for enum entry synthetic class
The change in DescriptorSerializer is needed so that serialized protos
of enum entry classes which are resolved in sources
(LazyClassDescriptor) and are deserialized from binaries
(EnumEntrySyntheticClassDescriptor) are the same. There are tests on
incremental compilation in JS that check that the serialized proto is
exactly the same after rebuild and after an incremental build.

 #KT-22048 Fixed
2018-07-02 19:04:06 +02:00
Alexey Sedunov
899de0eb0f Misc: Configure stdlib in failing tests
(cherry picked from commit 22d7427)
2018-07-02 19:11:47 +03:00
Alexey Sedunov
d4c2b33c39 Misc: Fix test assertion
(cherry picked from commit 65dad5e)
2018-07-02 19:11:47 +03:00
Vyacheslav Gerasimov
60c4308186 Allow plugin installation on Android Studio 3.2 Beta 2 2018-06-29 22:13:10 +03:00
Alexey Sedunov
e3e7eaec7b Misc: Restore utility functions misplaced in a previous commit
(cherry picked from commit a63aa5b)
2018-06-29 20:29:24 +03:00
Alexey Sedunov
feeedf7c02 Configuration: Use soft references to keep library kind cache
#KT-24943 Fixed

(cherry picked from commit 76ac65f)
2018-06-29 20:29:00 +03:00
Alexey Sedunov
c08aefbf80 PSI: Do not delete package directive for file in default package
#KT-24968 Fixed

(cherry picked from commit 60583e5)
2018-06-29 20:28:43 +03:00
Alexey Sedunov
4d141fbd6c Misc: Add "refactoring exit" message
This allows executing mandatory code at the end of particular refactoring.
Also this fixes memory leak due to listener not being disposed

 #KT-17235 Fixed

(cherry picked from commit e2a632e)
2018-06-29 20:28:27 +03:00
Alexey Sedunov
2dac33d3d1 Introduce Parameter: Fix exceptions caused by write actions in dialogs
#KT-24992 Fixed

(cherry picked from commit ba2f287)
2018-06-29 20:28:06 +03:00
Alexey Sedunov
02869ab0c7 Extract Function: Make compliant with PublicApiImplicitTypeInspection
(cherry picked from commit ed597e2)
2018-06-29 20:27:45 +03:00
Alexey Sedunov
a007784439 Misc: Use KtToken to represent visibility in ExtractableCodeDescriptor
(cherry picked from commit 633c67e)
2018-06-29 20:26:42 +03:00
Alexey Sedunov
c3b3ad53b2 Search Everywhere: Update renderer to reflect changes in IDEA
#KT-24812 Fixed

(cherry picked from commit 8374501)
2018-06-29 20:24:53 +03:00
Alexey Sedunov
e1e0a61572 Search Everywhere: Use Kotlin renderer for Kotlin elements only
(cherry picked from commit 31d248c)
2018-06-29 20:24:35 +03:00
Alexey Sedunov
79681ce425 Extract Interface: Fix type import when converting parameter to property
#KT-18736 Fixed

(cherry picked from commit bede2e1)
2018-06-29 20:24:09 +03:00
Alexey Sedunov
8fa29e4857 Extract Superclass: Report private members used in abstracted members
#KT-16284 Fixed

(cherry picked from commit 9b7450c)
2018-06-29 20:23:38 +03:00
Alexey Sedunov
0e04e74d7f Extract Superclass: Fix visibility lifting when moving to interface
#KT-16281 Fixed

(cherry picked from commit bd88e02)
2018-06-29 20:23:22 +03:00
Alexey Sedunov
e1286f221f Extract Superclass: Allow extraction to existing file
#KT-15351 Fixed

(cherry picked from commit b0e0460)
2018-06-29 20:23:06 +03:00
Alexey Sedunov
7380d1e3a1 Extract Superclass: Run refactoring inside of transaction
#KT-18555 Fixed

(cherry picked from commit 5ef54a2)
2018-06-29 20:22:46 +03:00
Nicolay Mitropolsky
a620a94d7b 182: IDEA sdk set to 182.3458.5
(cherry picked from commit 80f022c3d5)
2018-06-29 16:45:43 +03:00
Mikhail Glukhikh
c4e6cb3232 Add actual: handle (incorrect) case with expect function with body
So #KT-23326 Fixed

(cherry picked from commit fdc0335b4a)
2018-06-29 15:21:07 +03:00
Mikhail Glukhikh
ef32ee409a Add actual: handle parameters with val/var as compatible with property
So #KT-23762 Fixed

(cherry picked from commit 0fb183e302)
2018-06-29 15:20:52 +03:00
Mikhail Glukhikh
68c6c79be9 Add actual: handle primary & secondary constructors as compatible
So #KT-23686 Fixed

(cherry picked from commit dd0b267531)
2018-06-29 15:20:13 +03:00
Mikhail Glukhikh
ba0f3277c5 Reformat: AddActualFix
(cherry picked from commit 082c3e6767)
2018-06-29 15:19:59 +03:00
Mikhail Glukhikh
d254acc980 Create actual: do not generate default parameter values
So #KT-23105 Fixed

(cherry picked from commit 16c6d63b10)
2018-06-29 15:19:46 +03:00
Mikhail Glukhikh
1f4d43da55 Safe delete: add dialog asking about expect / actual declarations
Related to KT-15666

(cherry picked from commit b13e4535f5)
2018-06-29 15:19:26 +03:00
Mikhail Glukhikh
e5dc807427 Safe delete: when invoking on actual, delete expect & actual neighbors
So #KT-15666 Fixed

(cherry picked from commit aac71bf904)
2018-06-29 15:19:11 +03:00
Mikhail Glukhikh
536e0583a4 Safe delete: when invoking on expect, delete also relevant actual
Partial fix of KT-15666

(cherry picked from commit 50e70e4638)
2018-06-29 15:18:57 +03:00
Mikhail Glukhikh
4830afe183 Safe delete: search for actual declarations more accurately
(cherry picked from commit 465d5c077e)
2018-06-29 15:18:43 +03:00
Mikhail Glukhikh
26e6c8ed16 Cleanup: KotlinSafeDeleteProcessor
(cherry picked from commit 5bdaef4983)
2018-06-29 15:18:28 +03:00
Nicolay Mitropolsky
b5350da727 Uast: fix for creating an UClass for invalid object-literals (EA-122644, KT-20056)
(cherry picked from commit 698096f13e)
2018-06-28 10:42:22 +03:00
Lucas Smaira
c576bc8fba Find Kotlin class with alternative resolve enabled
Kotlin run configurations are failing non-deterministically in Android
Studio due to not finding the class while in dumb mode (while AS invokes
Gradle build or in indexing after that).

Fix that by finding class in KotlinRunConfiguration with alternative
resolve enabled.

(cherry picked from commit 5820656aae)
2018-06-27 16:50:21 +03:00
Nikolay Krasko
87eb155795 as32: Minor: use full sentences for reasons
(cherry picked from commit 8ea19eda73)
2018-06-27 16:32:08 +03:00
Nikolay Krasko
80a94a7efb as32: Use full sentences for reasons
(cherry picked from commit 17d4961760)
2018-06-27 16:31:59 +03:00
Nikolay Krasko
1457cfd8a8 Move isEap and isDev utility functions to idea module
(cherry picked from commit 099f3f3ddf)
2018-06-27 16:31:49 +03:00
Nikolay Krasko
d874ed4869 Make disabled verification visible in UI
(cherry picked from commit 54bb09a5fb)
2018-06-27 16:31:39 +03:00
Sergey Igushkin
214463e6f7 Fix Android ap option providers as Kapt task nested inputs
1) Exclude the providers arguments from the kapt inputs, as the values
may contain absolute paths, may be output properties etc. The providers
should correctly annotate their inputs.

2) Fix the options passed to kapt as 'value=option' (leading to all the
options collapse into one with the null key), use 'key=option' instead
to make Kapt pass them as '-Aoption'.

Issue #KT-23866 Fixed
Issue #KT-25027 Fixed

(cherry picked from commit dbd72ae53b)
2018-06-27 14:04:04 +03:00
Nicolay Mitropolsky
f8e171c9f5 Uast: proper identifiers for KotlinUBinaryExpression (KT-25092)
(cherry picked from commit bef3d4ace2)
2018-06-27 11:31:18 +03:00
Nikolay Krasko
08a544b1a2 Fobid installation for Android Studio 3.3 2018-06-26 17:51:34 +03:00
Mikhail Glukhikh
cff73d5309 Unused symbol: don't suggest actual declaration used in another platform
Related to KT-17512
Related to KT-15666

(cherry picked from commit eb92b7ed7f)
2018-06-26 15:59:13 +03:00
Mikhail Glukhikh
2c37746a28 Do not mark kotlin.test.Test annotated declarations as unused
So #KT-20523 Fixed

(cherry picked from commit 30327aa9cc)
2018-06-26 15:58:55 +03:00
Mikhail Glukhikh
e5de325629 Unused symbol: remove forced "used" from actual declarations
Now we really check whether actual declaration has usages
(in expect or actual code) or not
Related to KT-17512
Related to KT-15666

(cherry picked from commit 7e0e7dc983)
2018-06-26 15:58:40 +03:00
Mikhail Glukhikh
a2e33996a6 Implement search from expect element in KotlinReferenceSearcher
So mostly #KT-17512 Fixed

(cherry picked from commit e885e54233)
2018-06-26 15:58:25 +03:00
Mikhail Glukhikh
0ce12e4b17 Find property usages dialog: rename all check-boxes as in other dialogs
(cherry picked from commit 97d158d833)
2018-06-26 15:58:11 +03:00
Mikhail Glukhikh
01ae6515b1 Add find usages option: search expected
(cherry picked from commit abbfea357a)
2018-06-26 15:57:58 +03:00
Mikhail Glukhikh
62206740f5 KotlinFindMemberUsagesHandler: get rid of deprecation
(cherry picked from commit 69e420991a)
2018-06-26 15:57:44 +03:00
Mikhail Glukhikh
a27e2b0d1e Cleanup: KotlinReferenceSearcher
(cherry picked from commit 0a36edcf20)
2018-06-26 15:57:30 +03:00
Mikhail Glukhikh
68c5f701d5 Cleanup: findUsagesOptions
(cherry picked from commit ea7db42af6)
2018-06-26 15:57:16 +03:00
Mikhail Glukhikh
569a0a63d8 Cleanup: KotlinFindMemberUsagesHandler
(cherry picked from commit a46e4f3142)
2018-06-26 15:57:03 +03:00
Mikhail Glukhikh
67ac21fca6 Test for KT-17512 (yet with incorrect results)
(cherry picked from commit cc2869988f)
2018-06-26 15:56:49 +03:00
Mikhail Zarechenskiy
5dcd4c86e1 Fix internal compiler error on importing invisible fake reference
Note that this is not relevant for LOCAL/INHERITED visibilities:
  - for LOCAL visibility it's impossible to have a qualifier
  - INHERITED is an intermediate visibility, we enhance it later
    (see resolveUnknownVisibilityForMember)

 #KT-20356 Fixed
2018-06-26 15:39:32 +03:00
Yan Zhulanow
019e2212b8 Android Extensions, minor: Fix a compilation problem 2018-06-25 17:47:55 +03:00
Raluca Sauciuc
b135fd279d Android Extensions: make synthetic import resolution more resilient
In commit ec0abb0 (Fix EA-79206: Process only valid layout.xml...) we
started to drop layouts with invalid PsiFiles during resolution of
(synthetic) package fragments.

In Android Studio we run into invalid files quite often, and it seems
to be caused by a race with some invokeLater'ed code from android-ndk;
this has the side effect of now showing all the corresponding symbols
as unresolved, and the imports themselves are suggested for removal.

As a temporary fix I propose we try again to get a valid PsiFile.

Bug: https://issuetracker.google.com/78547457
(cherry picked from commit 3e8789225bd653caaedeca7f761a6442d48214b0)
2018-06-25 14:11:58 +03:00
Raluca Sauciuc
4e95d27f7b Recognize Instant Apps plugin
Tested with sample project and Studio 3.2 Canary 18:
https://github.com/googlesamples/android-instant-apps/tree/master/hello-kotlin

(cherry picked from commit 528d66d5840cc8f584270c516e85da1a632df8b8)
2018-06-25 14:11:58 +03:00
Yan Zhulanow
c9751c2eeb Revert "Android Extensions: Allow to access library project resources in Gradle setup (#KT-22430)"
This reverts commit a70707b
2018-06-25 14:11:58 +03:00
68104 changed files with 775342 additions and 3140186 deletions

10
.bunch
View File

@@ -1,2 +1,8 @@
202
as42
181
173
172_173
as31_173
as32
182
as33_as32
as33c4_182

4
.gitattributes vendored
View File

@@ -1,8 +1,4 @@
**/testData/** linguist-vendored
*Generated.java linguist-generated=true
* text=auto
* eol=lf
*.png binary
*.jar binary
compiler/cli/bin/* eol=lf
compiler/cli/bin/*.bat eol=crlf

14
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,14 @@
Many thanks for your contribution, we genuinely appreciate it.
Make sure that you can say "YES" to each point in this short checklist:
- You do not have merge commits in PR
- You made a few changes
- You provided the link to related issue from YouTrack
- You can describe changes made in PR
- You made changes related to only one issue
- You are ready to defend your changes on code review
- You didn't touch what you don't understand
- You ran the build locally, and verified new functionality
- You ran related tests locally, and it passed
Thank you for your contribution!

43
.gitignore vendored
View File

@@ -1,9 +1,8 @@
.DS_Store
.idea/shelf
/confluence/target
/dependencies/repo
/android.tests.dependencies
/dependencies/android.tests.dependencies
/confluence/target
/dependencies
/dist
/local
/gh-pages
@@ -16,9 +15,12 @@ workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/out/
/js/js.translator/testData/out-min/
/js/js.translator/testData/out-pir/
.gradle/
build/
!**/src/**/build
@@ -27,43 +29,12 @@ build/
!**/testData/**/*.iml
.idea/libraries/Gradle*.xml
.idea/libraries/Maven*.xml
.idea/artifacts/PILL_*.xml
.idea/artifacts/KotlinPlugin.xml
.idea/artifacts
.idea/modules
.idea/runConfigurations/JPS_*.xml
.idea/runConfigurations/PILL_*.xml
.idea/runConfigurations/_FP_*.xml
.idea/runConfigurations/_MT_*.xml
.idea/libraries
.idea/modules.xml
.idea/gradle.xml
.idea/compiler.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
.idea/artifacts/dist_auto_*
.idea/artifacts/dist.xml
.idea/artifacts/ideaPlugin.xml
.idea/artifacts/kotlinc.xml
.idea/artifacts/kotlin_compiler_jar.xml
.idea/artifacts/kotlin_plugin_jar.xml
.idea/artifacts/kotlin_jps_plugin_jar.xml
.idea/artifacts/kotlin_daemon_client_jar.xml
.idea/artifacts/kotlin_imports_dumper_compiler_plugin_jar.xml
.idea/artifacts/kotlin_main_kts_jar.xml
.idea/artifacts/kotlin_compiler_client_embeddable_jar.xml
.idea/artifacts/kotlin_reflect_jar.xml
.idea/artifacts/kotlin_stdlib_js_ir_*
.idea/artifacts/kotlin_test_js_ir_*
.idea/artifacts/kotlin_stdlib_wasm_*
.idea/jarRepositories.xml
.idea/csv-plugin.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-js-runner/lib/
local.properties
buildSrcTmp/
distTmp/
outTmp/
/test.output
/kotlin-native/dist

8
.idea/ant.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AntConfiguration">
<buildFile url="file://$PROJECT_DIR$/libraries/build-docs.xml">
<maximumHeapSize value="1024" />
</buildFile>
</component>
</project>

View File

@@ -1,8 +0,0 @@
<component name="ArtifactManager">
<artifact build-on-make="true" name="dist_root">
<output-path>$PROJECT_DIR$/dist</output-path>
<root id="root">
<element id="artifact" artifact-name="dist" />
</root>
</artifact>
</component>

View File

@@ -1,8 +0,0 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlinx.cli-jvm-1.5.255-SNAPSHOT">
<output-path>$PROJECT_DIR$/kotlin-native/endorsedLibraries/kotlinx.cli/build/libs</output-path>
<root id="archive" name="kotlinx.cli-jvm-1.5.255-SNAPSHOT.jar">
<element id="module-output" name="kotlin.kotlin-native.endorsedLibraries.kotlinx.cli.jvmMain" />
</root>
</artifact>
</component>

289
.idea/codeStyleSettings.xml generated Normal file
View File

@@ -0,0 +1,289 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</value>
</option>
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="PREFER_LONGER_NAMES" value="false" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value>
<package name="java.awt" withSubpackages="false" static="false" />
<package name="javax.tools" withSubpackages="true" static="false" />
<package name="javax.swing" withSubpackages="false" static="false" />
</value>
</option>
<option name="STATIC_METHODS_ORDER_WEIGHT" value="5" />
<option name="METHODS_ORDER_WEIGHT" value="4" />
<option name="RIGHT_MARGIN" value="140" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CFML">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="CoffeeScript">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="GSP">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Groovy">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="Scala">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>

View File

@@ -1,7 +1,50 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</value>
</option>
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="RIGHT_MARGIN" value="140" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<GroovyCodeStyleSettings>
<option name="STATIC_METHODS_ORDER_WEIGHT" value="5" />
<option name="METHODS_ORDER_WEIGHT" value="4" />
</GroovyCodeStyleSettings>
<JavaCodeStyleSettings>
<option name="PREFER_LONGER_NAMES" value="false" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
@@ -18,10 +61,90 @@
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="72" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CFML">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
</codeStyleSettings>
<codeStyleSettings language="CoffeeScript">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="GSP">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Groovy">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="5" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
@@ -62,17 +185,88 @@
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
<indentOptions>
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="PROTO">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Scala">
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
<option name="FIELD_ANNOTATION_WRAP" value="0" />
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="WHILE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="DOWHILE_BRACE_FORCE" value="1" />
<option name="WHILE_BRACE_FORCE" value="1" />
<option name="FOR_BRACE_FORCE" value="1" />
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="8" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="kotlin">

View File

@@ -1,7 +1,7 @@
<component name="CopyrightManager">
<copyright>
<option name="allowReplaceRegexp" value="JetBrains" />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. and Kotlin Programming Language contributors.&#10;Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file." />
<option name="notice" value="Copyright 2010-&amp;#36;today.year JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license &#10;that can be found in the license/LICENSE.txt file." />
<option name="myName" value="apache" />
</copyright>
</component>

View File

@@ -1,18 +1,8 @@
<component name="ProjectDictionaryState">
<dictionary name="4u7">
<words>
<w>bintray</w>
<w>cacheability</w>
<w>cacheable</w>
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>
<w>jdks</w>
<w>protobuf</w>
<w>redirector</w>
<w>remapper</w>
<w>sonatype</w>
<w>unpresent</w>
</words>
</dictionary>
</component>

View File

@@ -7,10 +7,9 @@
<w>fqname</w>
<w>goto</w>
<w>gradle</w>
<w>infos</w>
<w>intrinsics</w>
<w>kdoc</w>
<w>lateinit</w>
<w>kompiler</w>
<w>memoize</w>
<w>memoized</w>
<w>multiline</w>
@@ -19,15 +18,11 @@
<w>preloader</w>
<w>preloading</w>
<w>preprocess</w>
<w>proximities</w>
<w>redeclarations</w>
<w>reparsed</w>
<w>smap</w>
<w>subclassed</w>
<w>subgraph</w>
<w>substep</w>
<w>tailrec</w>
<w>typealias</w>
</words>
</dictionary>
</component>

View File

@@ -1,20 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="dmitriy.dolovov">
<words>
<w>cinterop</w>
<w>commonizable</w>
<w>commonization</w>
<w>commonize</w>
<w>commonized</w>
<w>commonizer</w>
<w>commonizers</w>
<w>commonizes</w>
<w>commonizing</w>
<w>interop</w>
<w>jetbrains</w>
<w>konan</w>
<w>kotlinx</w>
<w>macos</w>
</words>
</dictionary>
</component>

View File

@@ -7,7 +7,6 @@
<w>experimentality</w>
<w>insn</w>
<w>liveness</w>
<w>parameterless</w>
</words>
</dictionary>
</component>
</component>

View File

@@ -1,9 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="sebastiansellmair">
<words>
<w>cinterops</w>
<w>interops</w>
<w>klibrary</w>
</words>
</dictionary>
</component>

View File

@@ -1,7 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="sergey.igushkin">
<words>
<w>klib</w>
</words>
</dictionary>
</component>

View File

@@ -1,9 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="skuzmich">
<words>
<w>anyref</w>
<w>ushr</w>
<w>wasm</w>
</words>
</dictionary>
</component>

View File

@@ -1,27 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="svyatoslav.kuzmich">
<words>
<w>anyfunc</w>
<w>copysign</w>
<w>eqref</w>
<w>exnref</w>
<w>externref</w>
<w>funcref</w>
<w>jetbrains</w>
<w>kotlinx</w>
<w>ktor</w>
<w>optref</w>
<w>popcnt</w>
<w>rotl</w>
<w>rotr</w>
<w>simd</w>
<w>sqrt</w>
<w>testsuite</w>
<w>uninstantiable</w>
<w>unlinkable</w>
<w>vtable</w>
<w>wabt</w>
<w>xopt</w>
</words>
</dictionary>
</component>

View File

@@ -1,25 +1,12 @@
<component name="ProjectDictionaryState">
<dictionary name="yan">
<words>
<w>debuggee</w>
<w>deserializes</w>
<w>destructured</w>
<w>hacky</w>
<w>impls</w>
<w>inlined</w>
<w>kapt</w>
<w>kotlinc</w>
<w>mutators</w>
<w>parcelable</w>
<w>parceler</w>
<w>parcelers</w>
<w>parcelize</w>
<w>repl</w>
<w>testdata</w>
<w>uast</w>
<w>unbox</w>
<w>unboxed</w>
<w>unmute</w>
</words>
</dictionary>
</component>

3
.idea/encodings.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="file://$PROJECT_DIR$/libraries" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/examples/browser-example-with-library" charset="UTF-8" />
@@ -14,7 +14,6 @@
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-plugin-test" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-sam-with-receiver" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-maven-serialization" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/kotlin-osgi-bundle" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/libraries/tools/maven-archetypes/kotlin-archetype-js" charset="UTF-8" />

BIN
.idea/icon.png generated

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -21,6 +21,7 @@
</inspection_tool>
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CStyleArrayDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastConflictsWithInstanceof" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastToIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ChainedEquality" enabled="false" level="WARNING" enabled_by_default="true" />
@@ -54,6 +55,9 @@
<inspection_tool class="DoubleCheckedLocking" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreOnVolatileVariables" value="true" />
</inspection_tool>
<inspection_tool class="DuplicateCondition" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreSideEffectConditions" value="true" />
</inspection_tool>
<inspection_tool class="EmptyStatementBody" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_reportEmptyBlocks" value="false" />
</inspection_tool>
@@ -75,7 +79,6 @@
<option name="m_ignoreLoopsWithoutConditions" value="false" />
</inspection_tool>
<inspection_tool class="ForLoopThatDoesntUseLoopVariable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
@@ -98,9 +101,21 @@
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
<Problem reference="org.jetbrains.plugins.gradle.util.GradleConstants#KOTLIN_DSL_SCRIPT_EXTENSION" reason="Absent in 172. Please inline." />
<Problem reference="com.intellij.psi.impl.compiled.ClsClassImpl#getQualifiedName" reason="Nullable in 173, platform in 172. Use qualifiedNameEx instead." />
<Problem reference="com.intellij.internal.statistic.utils.StatisticsUtilKt#getEnumUsage" reason="Absent in 172. Use org.jetbrains.kotlin.idea.util.compat.statistic.StatisticKt.getEnumUsage instead." />
<Problem reference="com.intellij.internal.statistic.utils.StatisticsUtilKt#getBooleanUsage" reason="Absent in 172 Use org.jetbrains.kotlin.idea.util.compat.statistic.StatisticKt.getBooleanUsage instead." />
<Problem reference="com.intellij.internal.statistic.AbstractProjectsUsagesCollector" reason="Absent in 172. Use org.jetbrains.kotlin.idea.util.compat.statistic.AbstractProjectsUsagesCollector instead." />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Not null starting from 181. Use getProgressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
<Problem reference="org.jetbrains.org.objectweb.asm.Opcodes#V9" reason="Absent in 172 branch. Use V1_9 while 172 is supported." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettings#getSoftMargins" reason="Absent in 172." />
<Problem reference="com.intellij.util.xmlb.XmlSerializer#serializeInto(java.lang.Object, org.jdom.Element)" reason="Absent in 172." />
<Problem reference="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
<Problem reference="com.intellij.psi.util.PsiUtil#canBeOverridden" reason="Absent in 172. Use org.jetbrains.kotlin.idea.core.util.compat.psi.canBeOverridden() instead." />
</list>
</option>
</inspection_tool>
@@ -253,10 +268,6 @@
<option name="ignoreObjectMethods" value="true" />
<option name="ignoreAnonymousClassMethods" value="false" />
</inspection_tool>
<inspection_tool class="MissingRecentApi" enabled="true" level="ERROR" enabled_by_default="true">
<option name="sinceBuildString" value="183.3284" />
<option name="untilBuildString" value="192.SNAPSHOT" />
</inspection_tool>
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledEquals" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledHashcode" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -285,8 +296,15 @@
<inspection_tool class="PackageDirectoryMismatch" enabled="true" level="WARNING" enabled_by_default="false">
<scope name="all except testData" level="WARNING" enabled="true" />
</inspection_tool>
<inspection_tool class="PackageName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="namePattern" value="[a-z_][a-z\d_]*(\.[a-z_][a-zA-Z\d_]*)*" />
<inspection_tool class="ProblematicAPIUsage" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
</list>
</option>
</inspection_tool>
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -294,20 +312,23 @@
<option name="fromVersion" value="2.4" />
<option name="toVersion" value="3.1" />
</inspection_tool>
<inspection_tool class="Reformat" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="processChangedFilesOnly" value="true" />
</inspection_tool>
<inspection_tool class="Reformat" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="ReplaceAssignmentWithOperatorAssignment" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreLazyOperators" value="true" />
<option name="ignoreObscureOperators" value="true" />
</inspection_tool>
<inspection_tool class="SSBasedInspection" enabled="true" level="WARNING" enabled_by_default="true">
<searchConfiguration name="SwingUtilities.invokeLater" text="SwingUtilities.invokeLater($runnable$)" recursive="false" caseInsensitive="false" type="JAVA">
<constraint name="Instance" regexp="SwingUtilities" minCount="0" target="true" within="" contains="" />
<constraint name="MethodCall" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
<constraint name="runnable" within="" contains="" />
</searchConfiguration>
<replaceConfiguration name="DirectCallOfDispose" text="$Instance$.dispose()" recursive="false" caseInsensitive="false" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="Disposer.dispose($Instance$)">
<constraint name="Instance" regexp="super" nameOfExprType="Disposable" withinHierarchy="true" exprTypeWithinHierarchy="true" minCount="0" negateName="true" within="" contains="" />
<constraint name="MethodCall" target="true" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
</replaceConfiguration>
<replaceConfiguration name="new Object[0]" text="new Object[0]" recursive="false" caseInsensitive="true" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="com.intellij.util.ArrayUtil.EMPTY_OBJECT_ARRAY" />
@@ -371,7 +392,6 @@
</inspection_tool>
<inspection_tool class="StringEquality" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="StringEqualsEmptyString" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="StringOperationCanBeSimplifiedMerged" />
<inspection_tool class="SwitchStatementWithConfusingDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SynchronizeOnThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SystemOutErr" enabled="true" level="WARNING" enabled_by_default="true">
@@ -423,21 +443,6 @@
<inspection_tool class="UnnecessaryLabelOnContinueStatement" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnnecessaryQualifierForThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessaryUnboxing" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="UnstableApiUsage" enabled="true" level="WARNING" enabled_by_default="true">
<option name="unstableApiAnnotations">
<set>
<option value="com.google.common.annotations.Beta" />
<option value="io.reactivex.annotations.Beta" />
<option value="io.reactivex.annotations.Experimental" />
<option value="org.apache.http.annotation.Beta" />
<option value="org.jetbrains.annotations.ApiStatus.Experimental" />
<option value="org.jetbrains.annotations.ApiStatus.Internal" />
<option value="org.jetbrains.annotations.ApiStatus.ScheduledForRemoval" />
<option value="rx.annotations.Beta" />
<option value="rx.annotations.Experimental" />
</set>
</option>
</inspection_tool>
<inspection_tool class="UseOfPropertiesAsHashtable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UtilityClassWithPublicConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="VolatileLongOrDoubleField" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -453,4 +458,4 @@
<option name="ignoreNonEmtpyLoops" value="false" />
</inspection_tool>
</profile>
</component>
</component>

View File

@@ -1,6 +1,7 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="idea.default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

63
.idea/misc.xml generated
View File

@@ -6,29 +6,48 @@
</properties>
</component>
<component name="EntryPointsManager">
<list size="3">
<list size="1">
<item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
<item index="1" class="java.lang.String" itemvalue="org.gradle.api.tasks.TaskAction" />
<item index="2" class="java.lang.String" itemvalue="org.gradle.api.tasks.options.Option" />
</list>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="FrameworkDetectionExcludesConfiguration">
<file type="web" url="file://$PROJECT_DIR$" />
<component name="FacetAutodetectingManager">
<autodetection-disabled>
<facet-type id="Python">
<modules>
<module name="Jet" />
</modules>
</facet-type>
</autodetection-disabled>
</component>
<component name="IdProvider" IDEtalkID="71A301FF1940049D6D82F12C40F1E1D5" />
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="JavadocGenerationManager">
<option name="OUTPUT_DIRECTORY" />
<option name="OPTION_SCOPE" value="protected" />
<option name="OPTION_HIERARCHY" value="true" />
<option name="OPTION_NAVIGATOR" value="true" />
<option name="OPTION_INDEX" value="true" />
<option name="OPTION_SEPARATE_INDEX" value="true" />
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
<option name="OPTION_DEPRECATED_LIST" value="true" />
<option name="OTHER_OPTIONS" value="" />
<option name="HEAP_SIZE" />
<option name="LOCALE" />
<option name="OPEN_IN_BROWSER" value="true" />
</component>
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/libraries/pom.xml" />
</list>
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
<option name="myNullables">
<value>
<list size="14">
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
@@ -38,17 +57,12 @@
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="9" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
<item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.Nullable" />
<item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="14">
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="javax.validation.constraints.NotNull" />
@@ -58,11 +72,6 @@
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="9" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
<item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.NonNull" />
<item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.NonNull" />
</list>
</value>
</option>
@@ -70,12 +79,9 @@
<component name="ProjectResources">
<default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PsiViewerSettings">
<option name="splitDividerLocation" value="35" />
</component>
<component name="SuppressABINotification">
<option name="modulesWithSuppressedNotConfigured">
<set>
@@ -92,7 +98,4 @@
<option name="autoscroll" value="false" />
<option name="showOnlyWarnings" value="false" />
</component>
<component name="intellij-api-watcher-check-current-project">
<option name="shouldCheckCurrentProject" value="true" />
</component>
</project>

171
.idea/projectCodeStyle.xml generated Normal file
View File

@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<ADDITIONAL_INDENT_OPTIONS fileType="css">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="groovy">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="gsp">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="haml">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="js">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="jsp">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="php">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="py">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="sass">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="scala">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="sql">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="xml">
<option name="INDENT_SIZE" value="4" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<ADDITIONAL_INDENT_OPTIONS fileType="yml">
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="8" />
<option name="TAB_SIZE" value="4" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</ADDITIONAL_INDENT_OPTIONS>
<codeStyleSettings language="JAVA">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="5" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions />
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="PHP">
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="IF_BRACE_FORCE" value="1" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</component>
</project>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate All Tests" type="GradleRunConfiguration" factoryName="Gradle" folderName="Generators">
<configuration default="false" name="Generate All Tests" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -10,9 +10,8 @@
</option>
<option name="taskNames">
<list>
<option value=":compiler:tests-for-compiler-generator:generateTests" />
<option value=":compiler:generateTests" />
<option value=":compiler:tests-java8:generateTests" />
<option value=":compiler:tests-against-klib:generateTests" />
<option value=":js:js.tests:generateTests" />
<option value=":core:descriptors.runtime:generateTests" />
</list>
@@ -22,4 +21,4 @@
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
</component>
</component>

View File

@@ -1,24 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate FIR Checker Components and FIR/IDE Diagnostics" type="GradleRunConfiguration" factoryName="Gradle" folderName="Generators">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":compiler:fir:checkers:generateCheckersComponents" />
<option value=":idea:idea-frontend-fir:generateCode" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -1,21 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate FIR tree" type="GradleRunConfiguration" factoryName="Gradle" folderName="Generators">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/compiler/fir/tree" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="generateTree" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate standard library sources" type="GradleRunConfiguration" factoryName="Gradle" folderName="Stdlib">
<configuration default="false" name="Generate standard library sources" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/libraries/tools/kotlin-stdlib-gen" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA" type="GradleRunConfiguration" factoryName="Gradle" singleton="true" folderName="IDEA">
<configuration default="false" name="IDEA" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA Ultimate" type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<configuration default="false" name="IDEA Ultimate" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA Ultimate (No ProcessCanceledException) " type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<configuration default="false" name="IDEA Ultimate (No ProcessCanceledException) " type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<configuration default="false" name="IDEA (No ProcessCanceledException)" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@@ -17,4 +17,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,19 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="IDEA (Not Internal)" type="GradleRunConfiguration" factoryName="Gradle" folderName="IDEA">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-Pidea.is.internal=false" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
</configuration>
</component>

View File

@@ -1,25 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: Commonizer" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--tests &quot;org.jetbrains.kotlin.gradle.CommonizerHierarchicalIT&quot; --tests &quot;org.jetbrains.kotlin.gradle.CommonizerIT&quot; --tests &quot;org.jetbrains.kotlin.commonizer.**&quot;" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":native:kotlin-klib-commonizer-api:test" />
<option value=":native:kotlin-klib-commonizer:test" />
<option value=":kotlin-gradle-plugin-integration-tests:test" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>false</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -1,20 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: KMM" type="GradleRunConfiguration" factoryName="Gradle" folderName="Tests">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="kmmTest" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method v="2" />
</configuration>
</component>

View File

@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: public API binary compatibility validator, overwrite results" type="GradleRunConfiguration" factoryName="Gradle" folderName="Stdlib">
<configuration default="false" name="Test: public API binary compatibility validator, overwrite results" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/libraries/tools/binary-compatibility-validator" />
@@ -18,4 +18,4 @@
</ExternalSystemSettings>
<method />
</configuration>
</component>
</component>

View File

@@ -1,22 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Test: stdlib-js public kotlin api test, overwrite results" type="GradleRunConfiguration" factoryName="Gradle" folderName="Stdlib">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--tests &quot;org.jetbrains.kotlin.js.test.ApiTest&quot; -Poverwrite.output=true --parallel" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":js:js.tests:cleanTest" />
<option value=":js:js.tests:test" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>false</GradleScriptDebugEnabled>
<method v="2" />
</configuration>
</component>

View File

@@ -1,13 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="run IR test in node.js" type="js.build_tools.npm">
<package-json value="$PROJECT_DIR$/js/js.translator/testData/package.json" />
<command value="run" />
<scripts>
<script value="runIrTestInNode" />
</scripts>
<arguments value="$FilePath$" />
<node-interpreter value="project" />
<envs />
<method v="2" />
</configuration>
</component>

View File

@@ -1,3 +1,3 @@
<component name="DependencyValidationManager">
<scope name="Apply copyright" pattern="!file[*]:*//testData//*&amp;&amp;!file[*]:testData//*&amp;&amp;!file[*]:*.gradle.kts&amp;&amp;!file[*]:*.gradle&amp;&amp;!file[group:kotlin-ultimate]:*/&amp;&amp;!file[kotlin.libraries]:stdlib/api//*" />
<scope name="Apply copyright" pattern="!file[*]:*//testData//*&amp;&amp;!file[*]:testData//*&amp;&amp;!file[*]:*.gradle.kts&amp;&amp;!file[*]:*.gradle" />
</component>

6
.idea/upsource.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UpsourceSharedProjectSettings">
<option name="upsourceUrl" value="https://upsource.jetbrains.com/" />
</component>
</project>

11
.idea/vcs.xml generated
View File

@@ -1,13 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CommitMessageInspectionProfile">
<profile version="1.0">
<inspection_tool class="BodyLimit" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrazieCommit" enabled="true" level="TYPO" enabled_by_default="true" />
<inspection_tool class="SubjectBodySeparation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<component name="IssueNavigationConfiguration">
<option name="links">
<list>
@@ -33,4 +25,5 @@
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
</project>

View File

@@ -1,4 +0,0 @@
## Code of Conduct
This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it.

File diff suppressed because it is too large Load Diff

144
ReadMe.md
View File

@@ -1,38 +1,24 @@
[![official project](https://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_KotlinPublic_Compiler.svg)](https://teamcity.jetbrains.com/buildConfiguration/Kotlin_KotlinPublic_Compiler?branch=%3Cdefault%3E&buildTypeTab=overview&mode=builds)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
[![Revved up by Gradle Enterprise](https://img.shields.io/badge/Revved%20up%20by-Gradle%20Enterprise-06A0CE?logo=Gradle&labelColor=02303A)](https://ge.jetbrains.com/scans?search.rootProjectNames=Kotlin)
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
<a href="http://slack.kotlinlang.org/"><img src="http://slack.kotlinlang.org/badge.svg" height="20"></a>
[![TeamCity (simple build status)](https://img.shields.io/teamcity/http/teamcity.jetbrains.com/s/Kotlin_dev_Compiler.svg)](https://teamcity.jetbrains.com/viewType.html?buildTypeId=Kotlin_dev_Compiler&branch_Kotlin_dev=%3Cdefault%3E&tab=buildTypeStatusDiv)
[![Maven Central](https://img.shields.io/maven-central/v/org.jetbrains.kotlin/kotlin-maven-plugin.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.jetbrains.kotlin%22)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
# Kotlin Programming Language
Welcome to [Kotlin](https://kotlinlang.org/)!
It is an open-source, statically typed programming language supported and developed by [JetBrains](https://www.jetbrains.com/) and open-source contributors.
Some handy links:
Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Kotlin Site](https://kotlinlang.org/)
* [Getting Started Guide](https://kotlinlang.org/docs/tutorials/getting-started.html)
* [Try Kotlin](https://play.kotlinlang.org/)
* [Try Kotlin](https://try.kotlinlang.org/)
* [Kotlin Standard Library](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
* [Issue Tracker](https://youtrack.jetbrains.com/issues/KT)
* [Forum](https://discuss.kotlinlang.org/)
* [Kotlin Blog](https://blog.jetbrains.com/kotlin/)
* [Subscribe to Kotlin YouTube channel](https://www.youtube.com/channel/UCP7uiEZIqci43m22KDl0sNw)
* [Follow Kotlin on Twitter](https://twitter.com/kotlin)
* [Public Slack channel](https://slack.kotlinlang.org/)
* [Public Slack channel](http://slack.kotlinlang.org/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Kotlin Multiplatform capabilities
Support for multiplatform programming is one of Kotlins key benefits. It reduces time spent writing and maintaining the same code for [different platforms](https://kotlinlang.org/docs/reference/mpp-supported-platforms.html) while retaining the flexibility and benefits of native programming.
* [Kotlin Multiplatform Mobile](https://kotlinlang.org/lp/mobile/) for sharing code between Android and iOS
* [Getting Started with Kotlin Multiplatform Mobile Guide](https://kotlinlang.org/docs/mobile/create-first-app.html)
* [Kotlin Multiplatform Benefits](https://kotlinlang.org/docs/reference/multiplatform.html)
* [Share code on all platforms](https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html#share-code-on-all-platforms)
* [Share code on similar platforms](https://kotlinlang.org/docs/reference/mpp-share-on-platforms.html#share-code-on-similar-platforms)
## Editing Kotlin
* [Kotlin IntelliJ IDEA Plugin](https://kotlinlang.org/docs/tutorials/getting-started.html)
@@ -52,20 +38,11 @@ In order to build Kotlin distribution you need to have:
JDK_18="path to JDK 1.8"
JDK_9="path to JDK 9"
For local development, if you're not working on bytecode generation or the standard library, it's OK to have only JDK 1.8 and JDK 9 installed, and to point `JDK_16` and `JDK_17` environment variables to your JDK 1.8 installation.
For local development, if you're not working on bytecode generation or the standard library, it's OK to have only JDK 1.8 and JDK 9 installed, and to point JDK_16 and JDK_17 environment variables to your JDK 1.8 installation.
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties) to setup `JDK_*` variables.
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties) to setup JDK_* variables.
Note: The JDK 6 for MacOS is not available on Oracle's site. You can install it by
```bash
$ brew tap homebrew/cask-versions
$ brew install --cask java6
```
On Windows you might need to add long paths setting to the repo:
git config core.longpaths true
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
## Building
@@ -93,7 +70,7 @@ command line parameters on the first run:
- `clean` - clean build results
- `dist` - assembles the compiler distribution into `dist/kotlinc/` folder
- `ideaPlugin` - assembles the Kotlin IDEA plugin distribution into `dist/artifacts/ideaPlugin/Kotlin/` folder
- `ideaPlugin` - assembles the Kotlin IDEA plugin distribution into `dist/artifacts/Kotlin` folder
- `install` - build and install all public artifacts into local maven repository
- `runIde` - build IDEA plugin and run IDEA with it
- `coreLibsTest` - build and run stdlib, reflect and kotlin-test tests
@@ -101,77 +78,92 @@ command line parameters on the first run:
- `compilerTest` - build and run all compiler tests
- `ideaPluginTest` - build and run all IDEA plugin tests
To reproduce TeamCity build use `-Pteamcity=true` flag. Local builds don't run proguard and have jar compression disabled by default.
**OPTIONAL:** Some artifacts, mainly Maven plugin ones, are built separately with Maven.
Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
To build Kotlin/Native, see
[kotlin-native/README.md](kotlin-native/README.md#building-from-source).
### Building for different versions of IntelliJ IDEA and Android Studio
Kotlin plugin is intended to work with several recent versions of IntelliJ IDEA and Android Studio. Each platform is allowed to have a different set of features and might provide a slightly different API. Instead of using several parallel Git branches, the project stores everything in a single branch, but files may have counterparts with version extensions (\*.as32, \*.172, \*.181). The primary file is expected to be replaced with its counterpart when targeting a non-default platform.
Kotlin plugin is indented to work with several recent versions of IntelliJ IDEA and Android Studio. Each platform is allowed to have a different set of features and might provide a slightly different API. Instead of using several parallel Git branches, project stores everything in a single branch, but files may have counterparts with version extensions (\*.as32, \*.172, \*.181). The primary file is expected to be replaced with its counterpart when targeting non-default platform.
A More detailed description of this scheme can be found at https://github.com/JetBrains/bunches/blob/master/ReadMe.md.
More detailed description of this scheme can be found at https://github.com/JetBrains/bunches/blob/master/ReadMe.md.
Usually, there's no need to care about multiple platforms as all features are enabled everywhere by default. Additional counterparts should be created if there's an expected difference in behavior or an incompatible API usage is required **and** there's no reasonable workaround to save source compatibility. Kotlin plugin contains a pre-commit check that shows a warning if a file has been updated without its counterparts.
Development for some particular platform is possible after 'switching' that can be done with the [Bunch Tool](https://github.com/JetBrains/bunches/releases) from the command line.
Development for some particular platform is possible after 'switching' that can be done with [Bunch Tool](https://github.com/JetBrains/bunches/releases) from the command line.
```sh
cd kotlin-project-dir
# switching to IntelliJ Idea 2019.1
bunch switch 191
# switching to IntelliJ Idea 2018.2
bunch switch . 182
```
## <a name="working-in-idea"></a> Working with the project in IntelliJ IDEA
Working with the Kotlin project requires at least IntelliJ IDEA 2019.1. You can download IntelliJ IDEA 2019.1 [here](https://www.jetbrains.com/idea/download).
Working with the Kotlin project requires IntelliJ IDEA 2017.3. You can download IntelliJ IDEA 2017.3 [here](https://www.jetbrains.com/idea/download).
After cloning the project, to import the project in IntelliJ choose the project directory in the Open project dialog. Then, after project opened, select
`File` -> `New` -> `Module from Existing Sources...` in the menu, and select `build.gradle.kts` file in the project's root folder.
To import the project in Intellij choose project directory in Open project dialog. Then, after project opened, Select
`File` -> `New...` -> `Module from Existing Sources` in the menu, and select `build.gradle.kts` file in the project's root folder.
In the import dialog, select `use default gradle wrapper`.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` and choose `Gradle Test Runner` in the Gradle runner settings after importing the project.
To be able to run tests from IntelliJ easily, check `Delegate IDE build/run actions to Gradle` and choose `Gradle Test Runner` in the Gradle runner settings.
At this time, you can use the latest released `1.3.x` version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use `Tools` -> `Kotlin` -> `Configure Kotlin Plugin Updates`.
At this time, you can use the latest released 1.2.x version of the Kotlin plugin for working with the code. To make sure you have the latest version installed, use Tools | Kotlin | Configure Kotlin Plugin Updates and press "Check for updates now".
### Compiling and running
From this root project there are Run/Debug Configurations for running `IDEA` or the `Generate Compiler Tests` for example; so if you want to try out the latest and greatest IDEA plugin
From this root project there are Run/Debug Configurations for running IDEA or the Compiler Tests for example; so if you want to try out the latest and greatest IDEA plugin
* `VCS` -> `Git` -> `Pull`
* Run the `IDEA` run configuration in the project
* A child IntelliJ IDEA with the Kotlin plugin will then startup
* VCS -> Git -> Pull
* Run the "IDEA" run configuration in the project
* a child IntelliJ IDEA with the Kotlin plugin will then startup
### Dependency verification
### Including into composite build
We have a [dependencies verification](https://docs.gradle.org/current/userguide/dependency_verification.html) feature enabled in the
repository for all Gradle builds. Gradle will check hashes (md5 and sha256) of used dependencies and will fail builds with
`Dependency verification failed` errors when local artifacts are absent or have different hashes listed in the
[verification-metadata.xml](https://github.com/JetBrains/kotlin/blob/master/gradle/verification-metadata.xml) file.
To include kotlin compiler into [composite build](https://docs.gradle.org/current/userguide/composite_builds.html) you need to define `dependencySubstitution` for `kotlin-compiler` module in `settings.gradle`
It's expected that `verification-metadata.xml` should only be updated with the commits that modify the build. There are some tips how
to perform such updates:
- Use auto-generation for getting an initial list of new hashes (verify updates relate to you changes).
`./gradlew -M sha256,md5 help`
*(any other task may be used instead of `help`)*
- Consider removing old versions from the file if you are updating dependencies.
- Leave meaningful `origin` attribute (instead of `Generated by Gradle`) if you did some manual verification of the artifact.
- Always do manual verification if several hashes are needed and a new `also-trust` tag has to be added.
- If youre adding a dependency with OS mentioning in an artifact name (`darwin`, `mac`, `osx`, `linux`, `windows`), remember to add
counterparts for other platforms.
# License
Kotlin is distributed under the terms of the Apache License (Version 2.0). See [license folder](license/README.md) for details.
```
includeBuild('/path/to/kotlin') {
dependencySubstitution {
substitute module('org.jetbrains.kotlin:kotlin-compiler') with project(':include:kotlin-compiler')
}
}
```
# Contributing
Please be sure to review Kotlin's [contributing guidelines](docs/contributing.md) to learn how to help the project.
We love contributions! There's [lots to do on Kotlin](https://youtrack.jetbrains.com/issues/KT) and on the
[standard library](https://youtrack.jetbrains.com/issues/KT?q=%23Kotlin%20%23Unresolved%20and%20(links:%20KT-2554,%20KT-4089%20or%20%23Libraries)) so why not chat with us
about what you're interested in doing? Please join the #kontributors channel in [our Slack chat](http://slack.kotlinlang.org/)
and let us know about your plans.
If you want to find some issues to start off with, try [this query](https://youtrack.jetbrains.com/issues/KT?q=tag:%20%7BUp%20For%20Grabs%7D%20%23Unresolved) which should find all Kotlin issues that marked as "up-for-grabs".
Currently only committers can assign issues to themselves so just add a comment if you're starting work on it.
A nice gentle way to contribute would be to review the [standard library docs](https://kotlinlang.org/api/latest/jvm/stdlib/index.html)
and find classes or functions which are not documented very well and submit a patch.
In particular it'd be great if all functions included a nice example of how to use it such as for the
[`hashMapOf()`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/hash-map-of.html) function.
This is implemented using the [`@sample`](https://github.com/JetBrains/kotlin/blob/1.1.0/libraries/stdlib/src/kotlin/collections/Maps.kt#L91)
macro to include code from a test function. The benefits of this approach are twofold; First, the API's documentation is improved via beneficial examples that help new users and second, the code coverage is increased.
Also the [JavaScript translation](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) could really use your help. See the [JavaScript contribution section](https://github.com/JetBrains/kotlin/blob/master/js/ReadMe.md) for more details.
Some of the code in the standard library is created by generating code from templates. See the [README](libraries/stdlib/ReadMe.md) in the stdlib section for how to run the code generator. The existing templates can be used as examples for creating new ones.
## Submitting patches
The best way to submit a patch is to [fork the project on github](https://help.github.com/articles/fork-a-repo/) then send us a
[pull request](https://help.github.com/articles/creating-a-pull-request/) via [github](https://github.com).
If you create your own fork, it might help to enable rebase by default
when you pull by executing
``` bash
git config --global pull.rebase true
```
This will avoid your local repo having too many merge commits
which will help keep your pull request simple and easy to apply.

View File

@@ -8,7 +8,7 @@ plugins {
dependencies {
compile(commonDep("org.apache.ant", "ant"))
compile(project(":kotlin-preloader"))
compile(kotlinStdlib())
compile(projectDist(":kotlin-stdlib"))
}
sourceSets {
@@ -17,5 +17,9 @@ sourceSets {
}
runtimeJar {
manifest.attributes["Class-Path"] = "$compilerManifestClassPath kotlin-preloader.jar"
from("$projectDir/src") { include("**/*.xml") }
manifest.attributes.put("Class-Path", "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar kotlin-preloader.jar")
}
dist()

View File

@@ -16,24 +16,18 @@
package org.jetbrains.kotlin.ant
import org.apache.tools.ant.BuildException
import org.apache.tools.ant.taskdefs.Execute
import org.apache.tools.ant.taskdefs.Redirector
import org.apache.tools.ant.types.*
import org.apache.tools.ant.types.Path
import org.apache.tools.ant.types.Reference
import java.io.File.pathSeparator
import java.io.File.separator
class Kotlin2JvmTask : KotlinCompilerBaseTask() {
override val compilerFqName = "org.jetbrains.kotlin.cli.jvm.K2JVMCompiler"
var includeRuntime: Boolean = false
var includeRuntime: Boolean = true
var moduleName: String? = null
var noReflect: Boolean = false
private val cmdl = CommandlineJava()
var fork: Boolean = false
private var compileClasspath: Path? = null
fun setClasspath(classpath: Path) {
@@ -79,47 +73,4 @@ class Kotlin2JvmTask : KotlinCompilerBaseTask() {
if (noReflect) args.add("-no-reflect")
if (includeRuntime) args.add("-include-runtime")
}
override fun execute() {
if (!fork)
super.execute()
else {
exec()
}
}
private fun exec() {
val javaHome = System.getProperty("java.home")
val javaBin = javaHome + separator + "bin" + separator + "java"
val redirector = Redirector(this)
fillArguments()
val command = ArrayList<String>()
command.add(javaBin)
command.addAll(cmdl.vmCommand.arguments) // jvm args
command.add("-Dorg.jetbrains.kotlin.cliMessageRenderer=FullPath") // same MessageRenderer as non-forking mode
command.add("-cp")
command.add(KotlinAntTaskUtil.compilerJar.canonicalPath)
command.add(compilerFqName)
command.addAll(args) // compiler args
// streamHandler: used to handle the input and output streams of the subprocess.
// watchdog: a watchdog for the subprocess or <code>null</code> to disable a timeout for the subprocess.
// TODO: support timeout for the subprocess
val exe = Execute(redirector.createHandler(), null)
exe.setAntRun(getProject())
exe.commandline = command.toTypedArray()
log("Executing command: ${command.joinToString(" ")}", LogLevel.DEBUG.level)
log("Compiling ${src!!.list().toList()} => [${output!!.canonicalPath}]")
val exitCode = exe.execute()
redirector.complete()
if (failOnError && exitCode != 0) {
throw BuildException("Compile failed; see the compiler error output for details.")
}
}
fun createJvmarg(): Commandline.Argument {
return cmdl.createVmArgument()
}
}

View File

@@ -38,7 +38,7 @@ internal object KotlinAntTaskUtil {
}
val compilerJar: File by jar("kotlin-compiler.jar")
val runtimeJar: File by jar("kotlin-stdlib.jar")
val runtimeJar: File by jar("kotlin-runtime.jar")
val reflectJar: File by jar("kotlin-reflect.jar")
private fun jar(name: String) = lazy {

View File

@@ -129,7 +129,7 @@ class KotlinCompilerAdapter : Javac13() {
}
companion object {
private val KOTLIN_EXTENSIONS = listOf("kt", "kts")
private val KOTLIN_EXTENSIONS = Arrays.asList("kt", "kts")
private fun filterOutKotlinSources(files: Array<File>): Array<File> {
return files.filterNot {

View File

@@ -80,7 +80,7 @@ abstract class KotlinCompilerBaseTask : Task() {
fillSpecificArguments()
}
override fun execute() {
final override fun execute() {
fillArguments()
val compilerClass = KotlinAntTaskUtil.getOrCreateClassLoader().loadClass(compilerFqName)

View File

@@ -1,115 +0,0 @@
import kotlinx.benchmark.gradle.benchmark
val benchmarks_version = "0.3.0"
plugins {
java
kotlin("jvm")
id("org.jetbrains.kotlinx.benchmark") version "0.3.0"
}
dependencies {
compile(kotlinStdlib())
compile(project(":compiler:frontend"))
compile(projectTests(":compiler:tests-common"))
compile(project(":compiler:cli"))
compile(intellijCoreDep()) { includeJars("intellij-core") }
compile(jpsStandalone()) { includeJars("jps-model") }
compile(intellijPluginDep("java"))
compile(intellijDep()) { includeIntellijCoreJarDependencies(project) }
compile("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:$benchmarks_version")
}
sourceSets {
"main" { projectDefault() }
}
benchmark {
configurations {
named("main") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("size", 1000)
}
register("fir") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("isIR", true)
param("size", 1000)
include("CommonCallsBenchmark")
include("ControlFlowAnalysisBenchmark")
//include("InferenceBaselineCallsBenchmark")
}
register("ni") {
warmups = 10
iterations = 10
iterationTime = 1
iterationTimeUnit = "sec"
param("useNI", true)
param("isIR", false)
param("size", 1000)
include("InferenceBaselineCallsBenchmark")
include("InferenceExplicitArgumentsCallsBenchmark")
include("InferenceForInApplicableCandidate")
include("InferenceFromArgumentCallsBenchmark")
include("InferenceFromReturnTypeCallsBenchmark")
}
}
targets {
register("main")
}
}
tasks.matching { it is Zip && it.name == "mainBenchmarkJar" }.configureEach {
this as Zip
isZip64 = true
archiveFileName.set("benchmarks.jar")
}
val benchmarkTasks = listOf("mainBenchmark", "mainFirBenchmark", "mainNiBenchmark")
tasks.matching { it is JavaExec && it.name in benchmarkTasks }.configureEach {
this as JavaExec
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
}
tasks.register<JavaExec>("runBenchmark") {
// jmhArgs example: -PjmhArgs='CommonCalls -p size=500 -p isIR=true -p useNI=true -f 1'
val jmhArgs = if (project.hasProperty("jmhArgs")) project.property("jmhArgs").toString() else ""
val resultFilePath = "$buildDir/benchmarks/jmh-result.json"
val ideaHome = intellijRootDir().canonicalPath
val benchmarkJarPath = "$buildDir/benchmarks/main/jars/benchmarks.jar"
args = mutableListOf("-Didea.home.path=$ideaHome", benchmarkJarPath, "-rf", "json", "-rff", resultFilePath) + jmhArgs.split("\\s".toRegex())
main = "-jar"
doLast {
if (project.kotlinBuildProperties.isTeamcityBuild) {
val jsonArray = com.google.gson.JsonParser.parseString(File(resultFilePath).readText()).asJsonArray
jsonArray.forEach {
val benchmark = it.asJsonObject
// remove unnecessary name parts from string like this "org.jetbrains.kotlin.benchmarks.CommonCallsBenchmark.benchmark"
val name = benchmark["benchmark"].asString.removeSuffix(".benchmark").let {
val indexOfLastDot = it.indexOfLast { it == '.' }
it.removeRange(0..indexOfLastDot)
}
val params = benchmark["params"].asJsonObject
val isIR = if (params.has("isIR")) params["isIR"].asString else "false"
val useNI = if (params.has("useNI")) params["useNI"].asString else "false"
val size = params["size"].asString
val score = "%.3f".format(benchmark["primaryMetric"].asJsonObject["score"].asString.toFloat())
val irPostfix = if (isIR.toBoolean()) " isIR=true" else ""
val niPostfix = if (useNI.toBoolean() && !isIR.toBoolean()) " isNI=true" else ""
println("""##teamcity[buildStatisticValue key='$name size=$size${irPostfix}$niPostfix' value='$score']""")
}
}
}
}

View File

@@ -1,19 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.Param
import org.openjdk.jmh.annotations.Scope
import org.openjdk.jmh.annotations.State
@State(Scope.Benchmark)
abstract class AbstractInferenceBenchmark : AbstractSimpleFileBenchmark() {
@Param("true", "false")
private var useNI: Boolean = false
override val useNewInference: Boolean
get() = useNI
}

View File

@@ -1,169 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import com.intellij.openapi.Disposable
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.CharsetToolkit
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.PsiFileFactory
import com.intellij.psi.impl.PsiFileFactoryImpl
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.testFramework.LightVirtualFile
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.jvm.compiler.*
import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.context.SimpleGlobalContext
import org.jetbrains.kotlin.context.withModule
import org.jetbrains.kotlin.context.withProject
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.fir.builder.RawFirBuilder
import org.jetbrains.kotlin.fir.createSessionForTests
import org.jetbrains.kotlin.fir.java.FirJavaElementFinder
import org.jetbrains.kotlin.fir.resolve.firProvider
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirProviderImpl
import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveProcessor
import org.jetbrains.kotlin.idea.KotlinLanguage
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.storage.ExceptionTracker
import org.jetbrains.kotlin.storage.LockBasedStorageManager
import org.jetbrains.kotlin.storage.StorageManager
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.io.File
private fun createFile(shortName: String, text: String, project: Project): KtFile {
val virtualFile = object : LightVirtualFile(shortName, KotlinLanguage.INSTANCE, text) {
override fun getPath(): String {
//TODO: patch LightVirtualFile
return "/" + name
}
}
virtualFile.charset = CharsetToolkit.UTF8_CHARSET
val factory = PsiFileFactory.getInstance(project) as PsiFileFactoryImpl
return factory.trySetupPsiForFile(virtualFile, KotlinLanguage.INSTANCE, true, false) as KtFile
}
private val JDK_PATH = File("${System.getProperty("java.home")!!}/lib/rt.jar")
private val RUNTIME_JAR = File(System.getProperty("kotlin.runtime.path") ?: "dist/kotlinc/lib/kotlin-runtime.jar")
private val LANGUAGE_FEATURE_SETTINGS =
LanguageVersionSettingsImpl(
LanguageVersion.KOTLIN_1_3, ApiVersion.KOTLIN_1_3,
specificFeatures = mapOf(LanguageFeature.NewInference to LanguageFeature.State.ENABLED)
)
private fun newConfiguration(useNewInference: Boolean): CompilerConfiguration {
val configuration = CompilerConfiguration()
configuration.put(CommonConfigurationKeys.MODULE_NAME, "benchmark")
configuration.put(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, "../compiler/cli/cli-common/resources")
configuration.addJvmClasspathRoot(JDK_PATH)
configuration.addJvmClasspathRoot(RUNTIME_JAR)
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
val newInferenceState = if (useNewInference) LanguageFeature.State.ENABLED else LanguageFeature.State.DISABLED
configuration.languageVersionSettings = LanguageVersionSettingsImpl(
LanguageVersion.KOTLIN_1_3, ApiVersion.KOTLIN_1_3,
specificFeatures = mapOf(
LanguageFeature.NewInference to newInferenceState
)
)
return configuration
}
@State(Scope.Benchmark)
abstract class AbstractSimpleFileBenchmark {
private var myDisposable: Disposable = Disposable { }
private lateinit var env: KotlinCoreEnvironment
private lateinit var file: KtFile
@Param("true", "false")
protected var isIR: Boolean = false
protected open val useNewInference get() = isIR
@Setup(Level.Trial)
fun setUp() {
if (isIR && !useNewInference) error("Invalid configuration")
env = KotlinCoreEnvironment.createForTests(
myDisposable,
newConfiguration(useNewInference),
EnvironmentConfigFiles.JVM_CONFIG_FILES
)
if (isIR) {
PsiElementFinder.EP.getPoint(env.project).unregisterExtension(JavaElementFinder::class.java)
}
file = createFile(
"test.kt",
buildText(),
env.project
)
}
protected fun analyzeGreenFile(bh: Blackhole) {
if (isIR) {
analyzeGreenFileIr(bh)
} else {
analyzeGreenFileFrontend(bh)
}
}
private fun analyzeGreenFileFrontend(bh: Blackhole) {
val tracker = ExceptionTracker()
val storageManager: StorageManager =
LockBasedStorageManager.createWithExceptionHandling("benchmarks", tracker)
val context = SimpleGlobalContext(storageManager, tracker)
val module =
ModuleDescriptorImpl(
Name.special("<benchmark>"), storageManager,
JvmBuiltIns(storageManager, JvmBuiltIns.Kind.FROM_DEPENDENCIES)
)
val moduleContext = context.withProject(env.project).withModule(module)
val result = TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
moduleContext.project,
listOf(file),
NoScopeRecordCliBindingTrace(),
env.configuration,
{ scope -> JvmPackagePartProvider(LANGUAGE_FEATURE_SETTINGS, scope) }
)
assert(result.bindingContext.diagnostics.none { it.severity == Severity.ERROR })
bh.consume(result.shouldGenerateCode)
}
private fun analyzeGreenFileIr(bh: Blackhole) {
val scope = GlobalSearchScope.filesScope(env.project, listOf(file.virtualFile))
.uniteWith(TopDownAnalyzerFacadeForJVM.AllJavaSourcesInProjectScope(env.project))
val session = createSessionForTests(env, scope)
val firProvider = session.firProvider as FirProviderImpl
val builder = RawFirBuilder(session, firProvider.kotlinScopeProvider)
val totalTransformer = FirTotalResolveProcessor(session)
val firFile = builder.buildFirFile(file).also(firProvider::recordFile)
totalTransformer.process(listOf(firFile))
bh.consume(firFile.hashCode())
env.project.extensionArea
.getExtensionPoint<PsiElementFinder>(PsiElementFinder.EP.name)
.unregisterExtension(FirJavaElementFinder::class.java)
}
protected abstract fun buildText(): String
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class CommonCallsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "10", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(): Int = 1
|
|fun bar() {
|${(1..size).joinToString("\n") { " foo()" }}
|}
""".trimMargin()
}

View File

@@ -1,42 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ComplexDataFlowBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|
|fun bar(x: Any?) {
| var y = x
|${(1..size).joinToString("\n") {
"""
|if (x is String) {
| y = x
|}
|y = 1
""".trimMargin()
}}
|}
""".trimMargin()
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ControlFlowAnalysisBenchmark : AbstractSimpleFileBenchmark() {
@Param("1000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
buildString {
appendLine("fun test() {")
for (i in 0 until size) {
appendLine("for (i$i in 0..10) { ")
}
for (i in 0 until size) {
appendLine("}")
}
appendLine("}")
}
}

View File

@@ -1,47 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ControlFlowOperators : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|var isTrue = true
|var s = ""
|fun bar() {
|${(1..size).joinToString("\n") {
"""
|var x$it: String
|
|when (s) {
| "A" -> { x$it = "1" }
| "B" -> { x$it = "2" }
| else -> { x$it = "3" }
|}
|
|while (isTrue) {
| x$it.hashCode()
|}
""".trimMargin()
}}
|}
""".trimMargin()
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceBaselineCallsBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(x: Int): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceExplicitArgumentsCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: T): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo<Int>(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceForInApplicableCandidate : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 1
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T : Comparable<T>> foo(x: MutableList<T>) {}
|fun <T> foo(x: MutableList<T>, y: (T, T) -> Int) {}
|fun bar(x: MutableList<Any>) {
|${(1..size).joinToString("\n") { " foo(x) { a, b -> 1 }" }}
|}
""".trimMargin()
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceFromArgumentCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: T): Int = 1
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class InferenceFromReturnTypeCallsBenchmark : AbstractInferenceBenchmark() {
@Param("1", "10", "100", "1000", "5000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun <T> foo(x: Int): T = null!!
|fun expectsInt(x: Int) {}
|fun bar(v: Int) {
|${(1..size).map { " expectsInt(foo(v))" }.joinToString("\n")}
|}
""".trimMargin()
}

View File

@@ -1,33 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class IntArrayPlusBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
//@Fork(jvmArgsAppend = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"])
fun benchmark(bh: Blackhole) {
if (!isIR) error("Doesn't make sense to run it on old frontend on buildserver")
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar(x: IntArray, y: IntArray) {
|${(1..size).joinToString("\n") { " x + y" }}
|}
""".trimMargin()
}

View File

@@ -1,50 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ManyImplicitReceiversBenchmark : AbstractSimpleFileBenchmark() {
@Param("1", "10", "50")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText(): String {
return buildString {
appendLine("inline fun <T, R> with(receiver: T, block: T.() -> R): R = block()")
for (i in 1..size) {
appendLine("interface A$i {")
appendLine(" fun foo$i()")
appendLine("}")
appendLine()
}
appendLine()
append("fun test(")
append((1..size).joinToString(", ") { "a$it: A$it" })
appendLine(" {")
for (i in 1..size) {
appendLine("with(a$i) {")
}
for (i in 1..size) {
appendLine("foo$i()")
}
for (i in 1..size) {
appendLine("}")
}
appendLine("}")
}
}
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ManyValsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar() {
|${(1..size).joinToString("\n") { " val x$it: Int = 1" }}
|}
""".trimMargin()
}

View File

@@ -1,31 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class ManyVarsBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun bar() {
|${(1..size).joinToString("\n") { " var x$it: Int = 1" }}
|}
""".trimMargin()
}

View File

@@ -1,49 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark() {
@Param("9", "10", "11", "12", "13", "14")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText(): String = buildString {
appendLine(
"""
class A {
operator fun <T : Number> plus(other: (Int) -> T): A = this
operator fun <T : CharSequence> plusAssign(other: (String) -> T) {}
}
""".trimIndent()
)
appendLine("fun test() {")
appendLine("var a = A()")
for (i in 1..size) {
appendLine("a += {")
}
for (i in 1..size) {
appendLine(
"""
it.inc()
1
}
""".trimIndent()
)
}
appendLine()
}
}

View File

@@ -1,35 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.benchmarks
import org.openjdk.jmh.annotations.*
import org.openjdk.jmh.infra.Blackhole
import java.util.concurrent.TimeUnit
@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@State(Scope.Benchmark)
open class SimpleDataFlowBenchmark : AbstractSimpleFileBenchmark(){
@Param("1", "100", "1000", "3000", "5000", "7000", "10000")
private var size: Int = 0
@Benchmark
fun benchmark(bh: Blackhole) {
analyzeGreenFile(bh)
}
override fun buildText() =
"""
|fun foo(x: Int): Int = 1
|var x = 1
|fun bar(v: Int) {
|${(1..size).joinToString("\n") { " x = foo(v)" }}
|}
""".trimMargin()
}

View File

@@ -1,3 +1,4 @@
description = "Kotlin Build Common"
plugins {
@@ -7,26 +8,23 @@ plugins {
dependencies {
compileOnly(project(":core:util.runtime"))
compileOnly(project(":compiler:backend.common.jvm"))
compileOnly(project(":compiler:util"))
compileOnly(project(":compiler:cli-common"))
compileOnly(project(":compiler:frontend.java"))
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.config"))
compileOnly(project(":kotlin-util-klib-metadata"))
compileOnly(project(":js:js.frontend"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "util") }
compileOnly(project(":kotlin-reflect-api"))
testCompileOnly(project(":compiler:cli-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(kotlinStdlib())
Platform[193].orLower {
testCompileOnly(intellijDep()) { includeJars("openapi", rootProject = rootProject) }
}
testRuntime(project(":kotlin-reflect"))
testCompile(projectDist(":kotlin-stdlib"))
testCompileOnly(intellijDep()) { includeJars("openapi") }
testRuntime(projectDist(":kotlin-reflect"))
}
sourceSets {
@@ -34,12 +32,12 @@ sourceSets {
"test" { projectDefault() }
}
publish()
runtimeJar()
sourcesJar()
javadocJar()
testsJar()
projectTest(parallel = true)
projectTest()
publish()

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
@@ -9,7 +9,6 @@ import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.config.LanguageVersion
import org.jetbrains.kotlin.config.isPreRelease
import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion
import kotlin.reflect.KClass
interface BuildMetaInfo {
@@ -17,6 +16,9 @@ interface BuildMetaInfo {
val compilerBuildVersion: String
val languageVersionString: String
val apiVersionString: String
val coroutinesEnable: Boolean
val coroutinesWarn: Boolean
val coroutinesError: Boolean
val multiplatformEnable: Boolean
val metadataVersionMajor: Int
val metadataVersionMinor: Int
@@ -32,11 +34,13 @@ abstract class BuildMetaInfoFactory<T : BuildMetaInfo>(private val metaInfoClass
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
multiplatformVersion: Int
): T
fun create(args: CommonCompilerArguments): T {
@@ -47,17 +51,16 @@ abstract class BuildMetaInfoFactory<T : BuildMetaInfo>(private val metaInfoClass
compilerBuildVersion = KotlinCompilerVersion.VERSION,
languageVersionString = languageVersion.versionString,
apiVersionString = args.apiVersion ?: languageVersion.versionString,
coroutinesEnable = args.coroutinesState == CommonCompilerArguments.ENABLE,
coroutinesWarn = args.coroutinesState == CommonCompilerArguments.WARN,
coroutinesError = args.coroutinesState == CommonCompilerArguments.ERROR,
multiplatformEnable = args.multiPlatform,
ownVersion = OWN_VERSION,
coroutinesVersion = COROUTINES_VERSION,
multiplatformVersion = MULTIPLATFORM_VERSION,
metadataVersionArray = args.metadataVersion?.let((BinaryVersion)::parseVersionArray)
multiplatformVersion = MULTIPLATFORM_VERSION
)
}
fun serializeToString(args: CommonCompilerArguments): String =
serializeToString(create(args))
fun serializeToString(info: T): String =
serializeToPlainText(info, metaInfoClass)
@@ -69,4 +72,4 @@ abstract class BuildMetaInfoFactory<T : BuildMetaInfo>(private val metaInfoClass
const val COROUTINES_VERSION: Int = 0
const val MULTIPLATFORM_VERSION: Int = 0
}
}
}

View File

@@ -1,11 +1,12 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
import org.jetbrains.kotlin.utils.JsMetadataVersion
/**
* If you want to add a new field, check its type is supported by [serializeToPlainText], [deserializeFromPlainText]
@@ -15,6 +16,9 @@ data class CommonBuildMetaInfo(
override val compilerBuildVersion: String,
override val languageVersionString: String,
override val apiVersionString: String,
override val coroutinesEnable: Boolean,
override val coroutinesWarn: Boolean,
override val coroutinesError: Boolean,
override val multiplatformEnable: Boolean,
override val metadataVersionMajor: Int,
override val metadataVersionMinor: Int,
@@ -29,26 +33,28 @@ data class CommonBuildMetaInfo(
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
): CommonBuildMetaInfo {
val metadataVersion = metadataVersionArray?.let(::JvmMetadataVersion) ?: JvmMetadataVersion.INSTANCE
return CommonBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = metadataVersion.major,
metadataVersionMinor = metadataVersion.minor,
metadataVersionPatch = metadataVersion.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
multiplatformVersion: Int
) = CommonBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
coroutinesEnable = coroutinesEnable,
coroutinesWarn = coroutinesWarn,
coroutinesError = coroutinesError,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = JvmMetadataVersion.INSTANCE.major,
metadataVersionMinor = JvmMetadataVersion.INSTANCE.minor,
metadataVersionPatch = JvmMetadataVersion.INSTANCE.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
}
}

View File

@@ -1,12 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
import java.io.Serializable
enum class ExecutionStrategy : Serializable {
DAEMON, IN_PROCESS, OUT_OF_PROCESS
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
@@ -15,6 +15,9 @@ data class JsBuildMetaInfo(
override val compilerBuildVersion: String,
override val languageVersionString: String,
override val apiVersionString: String,
override val coroutinesEnable: Boolean,
override val coroutinesWarn: Boolean,
override val coroutinesError: Boolean,
override val multiplatformEnable: Boolean,
override val metadataVersionMajor: Int,
override val metadataVersionMinor: Int,
@@ -29,26 +32,28 @@ data class JsBuildMetaInfo(
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
): JsBuildMetaInfo {
val metadataVersion = metadataVersionArray?.let(::JsMetadataVersion) ?: JsMetadataVersion.INSTANCE
return JsBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = metadataVersion.major,
metadataVersionMinor = metadataVersion.minor,
metadataVersionPatch = metadataVersion.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
multiplatformVersion: Int
) = JsBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
coroutinesEnable = coroutinesEnable,
coroutinesWarn = coroutinesWarn,
coroutinesError = coroutinesError,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = JsMetadataVersion.INSTANCE.major,
metadataVersionMinor = JsMetadataVersion.INSTANCE.minor,
metadataVersionPatch = JsMetadataVersion.INSTANCE.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
}
}

View File

@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.build
import org.jetbrains.kotlin.load.kotlin.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
/**
@@ -27,6 +27,9 @@ data class JvmBuildMetaInfo(
override val compilerBuildVersion: String,
override val languageVersionString: String,
override val apiVersionString: String,
override val coroutinesEnable: Boolean,
override val coroutinesWarn: Boolean,
override val coroutinesError: Boolean,
override val multiplatformEnable: Boolean,
override val metadataVersionMajor: Int,
override val metadataVersionMinor: Int,
@@ -44,29 +47,31 @@ data class JvmBuildMetaInfo(
compilerBuildVersion: String,
languageVersionString: String,
apiVersionString: String,
coroutinesEnable: Boolean,
coroutinesWarn: Boolean,
coroutinesError: Boolean,
multiplatformEnable: Boolean,
ownVersion: Int,
coroutinesVersion: Int,
multiplatformVersion: Int,
metadataVersionArray: IntArray?
): JvmBuildMetaInfo {
val metadataVersion = metadataVersionArray?.let(::JvmMetadataVersion) ?: JvmMetadataVersion.INSTANCE
return JvmBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = metadataVersion.major,
metadataVersionMinor = metadataVersion.minor,
metadataVersionPatch = metadataVersion.patch,
bytecodeVersionMajor = JvmBytecodeBinaryVersion.INSTANCE.major,
bytecodeVersionMinor = JvmBytecodeBinaryVersion.INSTANCE.minor,
bytecodeVersionPatch = JvmBytecodeBinaryVersion.INSTANCE.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
multiplatformVersion: Int
) = JvmBuildMetaInfo(
isEAP = isEAP,
compilerBuildVersion = compilerBuildVersion,
languageVersionString = languageVersionString,
apiVersionString = apiVersionString,
coroutinesEnable = coroutinesEnable,
coroutinesWarn = coroutinesWarn,
coroutinesError = coroutinesError,
multiplatformEnable = multiplatformEnable,
metadataVersionMajor = JvmMetadataVersion.INSTANCE.major,
metadataVersionMinor = JvmMetadataVersion.INSTANCE.minor,
metadataVersionPatch = JvmMetadataVersion.INSTANCE.patch,
bytecodeVersionMajor = JvmBytecodeBinaryVersion.INSTANCE.major,
bytecodeVersionMinor = JvmBytecodeBinaryVersion.INSTANCE.minor,
bytecodeVersionPatch = JvmBytecodeBinaryVersion.INSTANCE.patch,
ownVersion = ownVersion,
coroutinesVersion = coroutinesVersion,
multiplatformVersion = multiplatformVersion
)
}
}

View File

@@ -22,17 +22,13 @@ import org.jetbrains.kotlin.utils.sure
import java.io.File
open class GeneratedFile(
sourceFiles: Collection<File>,
val sourceFiles: Collection<File>,
val outputFile: File
) {
val sourceFiles = sourceFiles.sortedBy { it.path }
)
override fun toString(): String = "${this::class.java.simpleName}: $outputFile"
}
class GeneratedJvmClass(
sourceFiles: Collection<File>,
outputFile: File
class GeneratedJvmClass (
sourceFiles: Collection<File>,
outputFile: File
) : GeneratedFile(sourceFiles, outputFile) {
val outputClass = LocalFileKotlinClass.create(outputFile).sure {
"Couldn't load KotlinClass from $outputFile; it may happen because class doesn't have valid Kotlin annotations"

View File

@@ -1,24 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report
import org.jetbrains.kotlin.build.report.metrics.BuildMetricsReporter
import org.jetbrains.kotlin.build.report.metrics.RemoteBuildMetricsReporter
open class BuildReporter(
protected open val icReporter: ICReporter,
protected open val buildMetricsReporter: BuildMetricsReporter
) : ICReporter by icReporter, BuildMetricsReporter by buildMetricsReporter
class RemoteBuildReporter(
override val icReporter: RemoteICReporter,
override val buildMetricsReporter: RemoteBuildMetricsReporter
) : BuildReporter(icReporter, buildMetricsReporter), RemoteReporter {
override fun flush() {
icReporter.flush()
buildMetricsReporter.flush()
}
}

View File

@@ -1,21 +0,0 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report
import org.jetbrains.kotlin.cli.common.ExitCode
import java.io.File
interface ICReporter {
fun report(message: () -> String)
fun reportVerbose(message: () -> String)
fun reportCompileIteration(incremental: Boolean, sourceFiles: Collection<File>, exitCode: ExitCode)
fun reportMarkDirtyClass(affectedFiles: Iterable<File>, classFqName: String)
fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String)
fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String)
}

View File

@@ -1,36 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report
import java.io.File
abstract class ICReporterBase(private val pathsBase: File? = null) : ICReporter {
override fun reportMarkDirtyClass(affectedFiles: Iterable<File>, classFqName: String) {
reportMarkDirty(affectedFiles, "dirty class $classFqName")
}
override fun reportMarkDirtyMember(affectedFiles: Iterable<File>, scope: String, name: String) {
reportMarkDirty(affectedFiles, "dirty member $scope#$name")
}
override fun reportMarkDirty(affectedFiles: Iterable<File>, reason: String) {
affectedFiles.forEach { file ->
reportVerbose { "${pathsAsString(file)} is marked dirty: $reason" }
}
}
protected fun relativizeIfPossible(files: Iterable<File>): List<File> =
files.map { it.relativeOrCanonical() }
protected fun pathsAsString(files: Iterable<File>): String =
relativizeIfPossible(files).map { it.path }.sorted().joinToString()
protected fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
protected fun File.relativeOrCanonical(): File =
pathsBase?.let { relativeToOrNull(it) } ?: canonicalFile
}

View File

@@ -1,9 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report
interface RemoteICReporter : ICReporter,
RemoteReporter

View File

@@ -1,11 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report
interface RemoteReporter {
fun flush()
}

View File

@@ -1,37 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
import java.io.Serializable
enum class BuildAttributeKind : Serializable {
REBUILD_REASON;
companion object {
const val serialVersionUID = 0L
}
}
enum class BuildAttribute(val kind: BuildAttributeKind) : Serializable {
NO_BUILD_HISTORY(BuildAttributeKind.REBUILD_REASON),
CACHE_CORRUPTION(BuildAttributeKind.REBUILD_REASON),
UNKNOWN_CHANGES_IN_GRADLE_INPUTS(BuildAttributeKind.REBUILD_REASON),
JAVA_CHANGE_UNTRACKED_FILE_IS_REMOVED(BuildAttributeKind.REBUILD_REASON),
JAVA_CHANGE_UNEXPECTED_PSI(BuildAttributeKind.REBUILD_REASON),
JAVA_CHANGE_UNKNOWN_QUALIFIER(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_REMOVED_ENTRY(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_HISTORY_IS_NOT_FOUND(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_HISTORY_CANNOT_BE_READ(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_HISTORY_NO_KNOWN_BUILDS(BuildAttributeKind.REBUILD_REASON),
DEP_CHANGE_NON_INCREMENTAL_BUILD_IN_DEP(BuildAttributeKind.REBUILD_REASON),
IN_PROCESS_EXECUTION(BuildAttributeKind.REBUILD_REASON),
OUT_OF_PROCESS_EXECUTION(BuildAttributeKind.REBUILD_REASON),
IC_IS_NOT_ENABLED(BuildAttributeKind.REBUILD_REASON);
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -1,30 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
import java.io.Serializable
import java.util.*
class BuildAttributes : Serializable {
private val myAttributes =
EnumMap<BuildAttribute, Int>(
BuildAttribute::class.java
)
fun add(attr: BuildAttribute, count: Int = 1) {
myAttributes[attr] = myAttributes.getOrDefault(attr, 0) + count
}
fun addAll(other: BuildAttributes) {
other.myAttributes.forEach { (attr, n) -> add(attr, n) }
}
fun asMap(): Map<BuildAttribute, Int> = myAttributes
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -1,22 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
import java.io.Serializable
data class BuildMetrics(
val buildTimes: BuildTimes = BuildTimes(),
val buildAttributes: BuildAttributes = BuildAttributes()
) : Serializable {
fun addAll(other: BuildMetrics) {
buildTimes.addAll(other.buildTimes)
buildAttributes.addAll(other.buildAttributes)
}
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -1,28 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
interface BuildMetricsReporter {
fun startMeasure(metric: BuildTime, startNs: Long)
fun endMeasure(metric: BuildTime, endNs: Long)
fun addAttribute(attribute: BuildAttribute)
fun getMetrics(): BuildMetrics
fun addMetrics(metrics: BuildMetrics?)
}
inline fun <T> BuildMetricsReporter.measure(metric: BuildTime, fn: () -> T): T {
val start = System.nanoTime()
startMeasure(metric, start)
try {
return fn()
} finally {
val end = System.nanoTime()
endMeasure(metric, end)
}
}

View File

@@ -1,47 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
import java.util.*
class BuildMetricsReporterImpl : BuildMetricsReporter {
private val myBuildTimeStartNs: EnumMap<BuildTime, Long> =
EnumMap(
BuildTime::class.java
)
private val myBuildTimes = BuildTimes()
private val myBuildAttributes = BuildAttributes()
override fun startMeasure(metric: BuildTime, startNs: Long) {
if (metric in myBuildTimeStartNs) {
error("$metric was restarted before it finished")
}
myBuildTimeStartNs[metric] = startNs
}
override fun endMeasure(metric: BuildTime, endNs: Long) {
val startNs = myBuildTimeStartNs.remove(metric) ?: error("$metric finished before it started")
val durationNs = endNs - startNs
myBuildTimes.add(metric, durationNs)
}
override fun addAttribute(attribute: BuildAttribute) {
myBuildAttributes.add(attribute)
}
override fun getMetrics(): BuildMetrics =
BuildMetrics(
buildTimes = myBuildTimes,
buildAttributes = myBuildAttributes
)
override fun addMetrics(metrics: BuildMetrics?) {
if (metrics == null) return
myBuildAttributes.addAll(metrics.buildAttributes)
myBuildTimes.addAll(metrics.buildTimes)
}
}

View File

@@ -1,43 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
import java.io.Serializable
@Suppress("Reformat")
enum class BuildTime(val parent: BuildTime? = null) : Serializable {
GRADLE_TASK,
CLEAR_OUTPUT(GRADLE_TASK),
BACKUP_OUTPUT(GRADLE_TASK),
RESTORE_OUTPUT_FROM_BACKUP(GRADLE_TASK),
CONNECT_TO_DAEMON(GRADLE_TASK),
CLEAR_JAR_CACHE(GRADLE_TASK),
RUN_COMPILER(GRADLE_TASK),
NON_INCREMENTAL_COMPILATION_IN_PROCESS(RUN_COMPILER),
NON_INCREMENTAL_COMPILATION_OUT_OF_PROCESS(RUN_COMPILER),
NON_INCREMENTAL_COMPILATION_DAEMON(RUN_COMPILER),
INCREMENTAL_COMPILATION(RUN_COMPILER),
IC_CALCULATE_INITIAL_DIRTY_SET(INCREMENTAL_COMPILATION),
IC_ANALYZE_CHANGES_IN_DEPENDENCIES(IC_CALCULATE_INITIAL_DIRTY_SET),
IC_FIND_HISTORY_FILES(IC_ANALYZE_CHANGES_IN_DEPENDENCIES),
IC_ANALYZE_HISTORY_FILES(IC_ANALYZE_CHANGES_IN_DEPENDENCIES),
IC_ANALYZE_CHANGES_IN_JAVA_SOURCES(IC_CALCULATE_INITIAL_DIRTY_SET),
IC_ANALYZE_CHANGES_IN_ANDROID_LAYOUTS(IC_CALCULATE_INITIAL_DIRTY_SET),
IC_DETECT_REMOVED_CLASSES(IC_CALCULATE_INITIAL_DIRTY_SET),
CLEAR_OUTPUT_ON_REBUILD(INCREMENTAL_COMPILATION),
IC_UPDATE_CACHES(INCREMENTAL_COMPILATION),
INCREMENTAL_ITERATION(INCREMENTAL_COMPILATION),
NON_INCREMENTAL_ITERATION(INCREMENTAL_COMPILATION),
IC_WRITE_HISTORY_FILE(INCREMENTAL_COMPILATION);
companion object {
const val serialVersionUID = 0L
val children by lazy {
values().filter { it.parent != null }.groupBy { it.parent }
}
}
}

View File

@@ -1,29 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
import java.io.Serializable
import java.util.*
class BuildTimes : Serializable {
private val myBuildTimes = EnumMap<BuildTime, Long>(BuildTime::class.java)
fun addAll(other: BuildTimes) {
for ((bt, timeNs) in other.myBuildTimes) {
add(bt, timeNs)
}
}
fun add(buildTime: BuildTime, timeNs: Long) {
myBuildTimes[buildTime] = myBuildTimes.getOrDefault(buildTime, 0) + timeNs
}
fun asMap(): Map<BuildTime, Long> = myBuildTimes
companion object {
const val serialVersionUID = 0L
}
}

View File

@@ -1,25 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
object DoNothingBuildMetricsReporter : BuildMetricsReporter {
override fun startMeasure(metric: BuildTime, startNs: Long) {
}
override fun endMeasure(metric: BuildTime, endNs: Long) {
}
override fun addAttribute(attribute: BuildAttribute) {
}
override fun getMetrics(): BuildMetrics =
BuildMetrics(
BuildTimes(),
BuildAttributes()
)
override fun addMetrics(metrics: BuildMetrics?) {}
}

View File

@@ -1,11 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build.report.metrics
import org.jetbrains.kotlin.build.report.RemoteReporter
interface RemoteBuildMetricsReporter : BuildMetricsReporter,
RemoteReporter

View File

@@ -1,9 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.build
val DEFAULT_KOTLIN_SOURCE_FILES_EXTENSIONS = listOf("kt", "kts")

View File

@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.compilerRunner;
import kotlin.collections.CollectionsKt;
import com.intellij.util.containers.ContainerUtil;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.reflect.KClass;
import kotlin.reflect.KProperty1;
@@ -24,53 +24,29 @@ import kotlin.reflect.KVisibility;
import kotlin.reflect.full.KClasses;
import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.InternalArgument;
import org.jetbrains.kotlin.cli.common.arguments.ParseCommandLineArgumentsKt;
import org.jetbrains.kotlin.idea.ExplicitDefaultSubstitutor;
import org.jetbrains.kotlin.idea.ExplicitDefaultSubstitutorsKt;
import org.jetbrains.kotlin.utils.StringsKt;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Type;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
public class ArgumentUtils {
private ArgumentUtils() {
}
private ArgumentUtils() {}
@NotNull
public static List<String> convertArgumentsToStringList(@NotNull CommonToolArguments arguments)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<String> convertedArguments = convertArgumentsToStringListInternal(arguments);
Map<KClass<? extends CommonToolArguments>, Collection<ExplicitDefaultSubstitutor>> defaultSubstitutorsMap =
ExplicitDefaultSubstitutorsKt.getDefaultSubstitutors();
KClass<? extends CommonToolArguments> argumentsKClass = JvmClassMappingKt.getKotlinClass(arguments.getClass());
Collection<ExplicitDefaultSubstitutor> defaultSubstitutors = defaultSubstitutorsMap.get(argumentsKClass);
if (defaultSubstitutors != null) {
for (ExplicitDefaultSubstitutor substitutor : defaultSubstitutors) {
if (substitutor.isSubstitutable(convertedArguments)) convertedArguments.addAll(substitutor.getNewSubstitution());
}
}
return convertedArguments;
}
@NotNull
public static List<String> convertArgumentsToStringListNoDefaults(@NotNull CommonToolArguments arguments)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
return convertArgumentsToStringListInternal(arguments);
}
private static List<String> convertArgumentsToStringListInternal(@NotNull CommonToolArguments arguments)
throws InstantiationException, IllegalAccessException, InvocationTargetException {
List<String> result = new ArrayList<>();
Class<? extends CommonToolArguments> argumentsClass = arguments.getClass();
convertArgumentsToStringList(arguments, argumentsClass.newInstance(), JvmClassMappingKt.getKotlinClass(argumentsClass), result);
result.addAll(arguments.getFreeArgs());
result.addAll(CollectionsKt.map(arguments.getInternalArguments(), InternalArgument::getStringRepresentation));
result.addAll(arguments.getInternalArguments());
return result;
}
@@ -82,7 +58,7 @@ public class ArgumentUtils {
@NotNull List<String> result
) throws IllegalAccessException, InstantiationException, InvocationTargetException {
for (KProperty1 property : KClasses.getMemberProperties(clazz)) {
Argument argument = findInstance(property.getAnnotations(), Argument.class);
Argument argument = ContainerUtil.findInstance(property.getAnnotations(), Argument.class);
if (argument == null) continue;
if (property.getVisibility() != KVisibility.PUBLIC) continue;
@@ -112,14 +88,4 @@ public class ArgumentUtils {
}
}
}
@Nullable
private static <T> T findInstance(Iterable<? super T> iterable, Class<T> clazz) {
for (Object item : iterable) {
if (clazz.isInstance(item)) {
return clazz.cast(item);
}
}
return null;
}
}

View File

@@ -16,7 +16,7 @@
package org.jetbrains.kotlin.compilerRunner
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.common.messages.OutputMessageUtil
@@ -25,7 +25,7 @@ class MessageCollectorToOutputItemsCollectorAdapter(
private val delegate: MessageCollector,
private val outputCollector: OutputItemsCollector
) : MessageCollector by delegate {
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageSourceLocation?) {
override fun report(severity: CompilerMessageSeverity, message: String, location: CompilerMessageLocation?) {
// TODO: consider adding some other way of passing input -> output mapping from compiler, e.g. dedicated service
OutputMessageUtil.parseOutputMessage(message)?.let {
outputCollector.add(it.sourceFiles, it.outputFile)

View File

@@ -16,15 +16,15 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class OutputItemsCollectorImpl implements OutputItemsCollector {
private final List<SimpleOutputItem> outputs = new ArrayList<>();
private final List<SimpleOutputItem> outputs = ContainerUtil.newArrayList();
@Override
public void add(Collection<File> sourceFiles, File outputFile) {

View File

@@ -1,46 +0,0 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea
import org.jetbrains.kotlin.cli.common.arguments.Argument
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
import org.jetbrains.kotlin.config.JvmTarget
import kotlin.reflect.KClass
import kotlin.reflect.KProperty1
import kotlin.reflect.full.findAnnotation
val defaultSubstitutors: Map<KClass<out CommonToolArguments>, Collection<ExplicitDefaultSubstitutor>> =
mapOf(K2JVMCompilerArguments::class to listOf(JvmTargetDefaultSubstitutor))
sealed class ExplicitDefaultSubstitutor {
abstract val substitutedProperty: KProperty1<out CommonToolArguments, String?>
abstract val oldSubstitution: List<String>
abstract val newSubstitution: List<String>
abstract fun isSubstitutable(args: List<String>): Boolean
protected val argument: Argument by lazy {
substitutedProperty.findAnnotation() ?: error("Property \"${substitutedProperty.name}\" has no Argument annotation")
}
}
object JvmTargetDefaultSubstitutor : ExplicitDefaultSubstitutor() {
override val substitutedProperty
get() = K2JVMCompilerArguments::jvmTarget
private val oldDefault: String
get() = JvmTarget.JVM_1_6.description
private val newDefault: String
get() = JvmTarget.JVM_1_8.description
private fun prepareSubstitution(default: String): List<String> = listOf(argument.value, default)
override val oldSubstitution: List<String>
get() = prepareSubstitution(oldDefault)
override val newSubstitution: List<String>
get() = prepareSubstitution(newDefault)
override fun isSubstitutable(args: List<String>): Boolean = argument.value !in args
}

View File

@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.incremental
import com.intellij.util.io.EnumeratorStringDescriptor
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.Flags
import org.jetbrains.kotlin.metadata.deserialization.NameResolver
import org.jetbrains.kotlin.metadata.deserialization.TypeTable
import org.jetbrains.kotlin.metadata.deserialization.supertypes
@@ -35,77 +34,59 @@ interface IncrementalCacheCommon {
val thisWithDependentCaches: Iterable<AbstractIncrementalCache<*>>
fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName>
fun getSubtypesOf(className: FqName): Sequence<FqName>
fun getSupertypesOf(className: FqName): Sequence<FqName>
fun getSourceFileIfClass(fqName: FqName): File?
fun markDirty(removedAndCompiledSources: Collection<File>)
fun clearCacheForRemovedClasses(changesCollector: ChangesCollector)
fun getComplementaryFilesRecursive(dirtyFiles: Collection<File>): Collection<File>
fun updateComplementaryFiles(dirtyFiles: Collection<File>, expectActualTracker: ExpectActualTrackerImpl)
fun clearComplementaryFilesMapping(dirtyFiles: Collection<File>): Collection<File>
fun registerComplementaryFiles(expectActualTracker: ExpectActualTrackerImpl)
fun dump(): String
fun isSealed(className: FqName): Boolean?
}
/**
* Incremental cache common for JVM and JS for specifit ClassName type
*/
abstract class AbstractIncrementalCache<ClassName>(
workingDir: File,
protected val pathConverter: FileToPathConverter
) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
companion object {
private val CLASS_ATTRIBUTES = "class-attributes"
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
private val CLASS_FQ_NAME_TO_SOURCE = "class-fq-name-to-source"
private val COMPLEMENTARY_FILES = "complementary-files"
@JvmStatic
protected val SOURCE_TO_CLASSES = "source-to-classes"
@JvmStatic
protected val DIRTY_OUTPUT_CLASSES = "dirty-output-classes"
@JvmStatic protected val SOURCE_TO_CLASSES = "source-to-classes"
@JvmStatic protected val DIRTY_OUTPUT_CLASSES = "dirty-output-classes"
}
private val dependents = arrayListOf<AbstractIncrementalCache<ClassName>>()
fun addDependentCache(cache: AbstractIncrementalCache<ClassName>) {
dependents.add(cache)
}
override val thisWithDependentCaches: Iterable<AbstractIncrementalCache<ClassName>> by lazy {
val result = arrayListOf(this)
result.addAll(dependents)
result
}
internal val classAttributesMap = registerMap(ClassAttributesMap(CLASS_ATTRIBUTES.storageFile))
private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile, pathConverter))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
internal abstract val sourceToClassesMap: AbstractSourceToOutputMap<ClassName>
internal abstract val dirtyOutputClassesMap: AbstractDirtyClassesMap<ClassName>
/**
* A file X is a complementary to a file Y if they contain corresponding expect/actual declarations.
* Complementary files should be compiled together during IC so the compiler does not complain
* about missing parts.
* TODO: provide a better solution (maintain an index of expect/actual declarations akin to IncrementalPackagePartProvider)
*/
private val complementaryFilesMap = registerMap(ComplementarySourceFilesMap(COMPLEMENTARY_FILES.storageFile, pathConverter))
private val complementaryFilesMap = registerMap(FilesMap(COMPLEMENTARY_FILES.storageFile))
override fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName> =
files.flatMapTo(HashSet()) { sourceToClassesMap.getFqNames(it) }
override fun getSubtypesOf(className: FqName): Sequence<FqName> =
subtypesMap[className].asSequence()
override fun getSupertypesOf(className: FqName): Sequence<FqName> {
return supertypesMap[className].asSequence()
}
override fun isSealed(className: FqName): Boolean? {
return classAttributesMap[className]?.isSealed
}
subtypesMap[className].asSequence()
override fun getSourceFileIfClass(fqName: FqName): File? =
classFqNameToSourceMap[fqName]
classFqNameToSourceMap[fqName]
override fun markDirty(removedAndCompiledSources: Collection<File>) {
for (sourceFile in removedAndCompiledSources) {
@@ -121,8 +102,8 @@ abstract class AbstractIncrementalCache<ClassName>(
protected fun addToClassStorage(proto: ProtoBuf.Class, nameResolver: NameResolver, srcFile: File) {
val supertypes = proto.supertypes(TypeTable(proto.typeTable))
val parents = supertypes.map { nameResolver.getClassId(it.className).asSingleFqName() }
.filter { it.asString() != "kotlin.Any" }
.toSet()
.filter { it.asString() != "kotlin.Any" }
.toSet()
val child = nameResolver.getClassId(proto.fqName).asSingleFqName()
parents.forEach { subtypesMap.add(it, child) }
@@ -132,7 +113,6 @@ abstract class AbstractIncrementalCache<ClassName>(
supertypesMap[child] = parents
classFqNameToSourceMap[child] = srcFile
classAttributesMap[child] = ICClassesAttributes(ProtoBuf.Modality.SEALED == Flags.MODALITY.get(proto.flags))
}
protected fun removeAllFromClassStorage(removedClasses: Collection<FqName>, changesCollector: ChangesCollector) {
@@ -167,23 +147,16 @@ abstract class AbstractIncrementalCache<ClassName>(
}
}
removedFqNames.forEach {
classFqNameToSourceMap.remove(it)
classAttributesMap.remove(it)
}
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
protected class ClassFqNameToSourceMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
protected class ClassFqNameToSourceMap(storageFile: File) : BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = pathConverter.toPath(sourceFile)
storage[fqName.asString()] = sourceFile.canonicalPath
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(pathConverter::toFile)
storage[fqName.asString()]?.let(::File)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())
@@ -192,24 +165,18 @@ abstract class AbstractIncrementalCache<ClassName>(
override fun dumpValue(value: String) = value
}
override fun getComplementaryFilesRecursive(dirtyFiles: Collection<File>): Collection<File> {
override fun clearComplementaryFilesMapping(dirtyFiles: Collection<File>): Collection<File> {
val complementaryFiles = HashSet<File>()
val filesQueue = ArrayDeque(dirtyFiles)
while (filesQueue.isNotEmpty()) {
val file = filesQueue.pollFirst()
complementaryFilesMap[file].forEach {
if (complementaryFiles.add(it)) filesQueue.add(it)
}
complementaryFilesMap.remove(file).filterTo(filesQueue) { complementaryFiles.add(it) }
}
complementaryFiles.removeAll(dirtyFiles)
return complementaryFiles
}
override fun updateComplementaryFiles(dirtyFiles: Collection<File>, expectActualTracker: ExpectActualTrackerImpl) {
dirtyFiles.forEach {
complementaryFilesMap.remove(it)
}
override fun registerComplementaryFiles(expectActualTracker: ExpectActualTrackerImpl) {
val actualToExpect = hashMapOf<File, MutableSet<File>>()
for ((expect, actuals) in expectActualTracker.expectToActualMap) {
for (actual in actuals) {

View File

@@ -0,0 +1,111 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.incremental
import org.jetbrains.annotations.TestOnly
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmBytecodeBinaryVersion
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
import java.io.File
import java.io.IOException
private val NORMAL_VERSION = 9
private val DATA_CONTAINER_VERSION = 3
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
class CacheVersion(
private val ownVersion: Int,
private val versionFile: File,
private val whenVersionChanged: CacheVersion.Action,
private val whenTurnedOn: CacheVersion.Action,
private val whenTurnedOff: CacheVersion.Action,
private val isEnabled: Boolean
) {
private val actualVersion: Int?
get() = try {
versionFile.readText().toInt()
}
catch (e: NumberFormatException) {
null
}
catch (e: IOException) {
null
}
private val expectedVersion: Int
get() {
val metadata = JvmMetadataVersion.INSTANCE
val bytecode = JvmBytecodeBinaryVersion.INSTANCE
return ownVersion * 1000000 +
bytecode.major * 10000 + bytecode.minor * 100 +
metadata.major * 1000 + metadata.minor
}
fun checkVersion(): Action =
when (versionFile.exists() to isEnabled) {
true to true -> if (actualVersion != expectedVersion) whenVersionChanged else Action.DO_NOTHING
false to true -> whenTurnedOn
true to false -> whenTurnedOff
else -> Action.DO_NOTHING
}
fun saveIfNeeded() {
if (!isEnabled) return
if (!versionFile.parentFile.exists()) {
versionFile.parentFile.mkdirs()
}
versionFile.writeText(expectedVersion.toString())
}
fun clean() {
versionFile.delete()
}
@get:TestOnly
val formatVersionFile: File
get() = versionFile
// Order of entries is important, because actions are sorted in KotlinBuilder::checkVersions
enum class Action {
REBUILD_ALL_KOTLIN,
REBUILD_CHUNK,
CLEAN_NORMAL_CACHES,
CLEAN_DATA_CONTAINER,
DO_NOTHING
}
}
fun normalCacheVersion(dataRoot: File, enabled: Boolean): CacheVersion =
CacheVersion(ownVersion = NORMAL_VERSION,
versionFile = File(dataRoot, NORMAL_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOn = CacheVersion.Action.REBUILD_CHUNK,
whenTurnedOff = CacheVersion.Action.CLEAN_NORMAL_CACHES,
isEnabled = enabled)
fun dataContainerCacheVersion(dataRoot: File, enabled: Boolean): CacheVersion =
CacheVersion(ownVersion = DATA_CONTAINER_VERSION,
versionFile = File(dataRoot, DATA_CONTAINER_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOn = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOff = CacheVersion.Action.CLEAN_DATA_CONTAINER,
isEnabled = enabled)

View File

@@ -19,14 +19,12 @@ package org.jetbrains.kotlin.incremental
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.Flags
import org.jetbrains.kotlin.metadata.deserialization.NameResolver
import org.jetbrains.kotlin.metadata.deserialization.supertypes
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.protobuf.MessageLite
import org.jetbrains.kotlin.serialization.deserialization.getClassId
class ChangesCollector {
private val removedMembers = hashMapOf<FqName, MutableSet<String>>()
private val changedParents = hashMapOf<FqName, MutableSet<FqName>>()
private val changedMembers = hashMapOf<FqName, MutableSet<String>>()
private val areSubclassesAffected = hashMapOf<FqName, Boolean>()
@@ -49,10 +47,6 @@ class ChangesCollector {
changes.add(ChangeInfo.SignatureChanged(fqName, areSubclassesAffected))
}
for ((fqName, changedParents) in changedParents) {
changes.add(ChangeInfo.ParentsChanged(fqName, changedParents))
}
return changes
}
@@ -85,12 +79,12 @@ class ChangesCollector {
}
if (oldData == null) {
newData!!.collectAll(isRemoved = false, isAdded = true, collectAllMembersForNewClass = collectAllMembersForNewClass)
newData!!.collectAll(isRemoved = false, collectAllMembersForNewClass = collectAllMembersForNewClass)
return
}
if (newData == null) {
oldData.collectAll(isRemoved = true, isAdded = false)
oldData.collectAll(isRemoved = true)
return
}
@@ -104,7 +98,6 @@ class ChangesCollector {
collectSignature(oldData, diff.areSubclassesAffected)
}
collectChangedMembers(fqName, diff.changedMembersNames)
addChangedParents(fqName, diff.changedSupertypes)
}
is PackagePartProtoData -> {
collectSignature(oldData, areSubclassesAffected = true)
@@ -128,11 +121,10 @@ class ChangesCollector {
private fun <T> T.getNonPrivateNames(nameResolver: NameResolver, vararg members: T.() -> List<MessageLite>): Set<String> =
members.flatMap { this.it().filterNot { it.isPrivate }.names(nameResolver) }.toSet()
//TODO remember all sealed parent classes
private fun ProtoData.collectAll(isRemoved: Boolean, isAdded: Boolean, collectAllMembersForNewClass: Boolean = false) =
private fun ProtoData.collectAll(isRemoved: Boolean, collectAllMembersForNewClass: Boolean = false) =
when (this) {
is PackagePartProtoData -> collectAllFromPackage(isRemoved)
is ClassProtoData -> collectAllFromClass(isRemoved, isAdded, collectAllMembersForNewClass)
is ClassProtoData -> collectAllFromClass(isRemoved, collectAllMembersForNewClass)
}
private fun PackagePartProtoData.collectAllFromPackage(isRemoved: Boolean) {
@@ -151,7 +143,7 @@ class ChangesCollector {
}
}
private fun ClassProtoData.collectAllFromClass(isRemoved: Boolean, isAdded: Boolean, collectAllMembersForNewClass: Boolean = false) {
private fun ClassProtoData.collectAllFromClass(isRemoved: Boolean, collectAllMembersForNewClass: Boolean = false) {
val classFqName = nameResolver.getClassId(proto.fqName).asSingleFqName()
val kind = Flags.CLASS_KIND.get(proto.flags)
@@ -170,23 +162,6 @@ class ChangesCollector {
collectSignature(classFqName, areSubclassesAffected = true)
}
if (isRemoved || isAdded) {
collectChangedParents(classFqName, proto.supertypeList)
}
}
private fun addChangedParents(fqName: FqName, parents: Collection<FqName>) {
if (parents.isNotEmpty()) {
changedParents.getOrPut(fqName) { HashSet() }.addAll(parents)
}
}
private fun ClassProtoData.collectChangedParents(fqName: FqName, parents: Collection<ProtoBuf.Type>) {
val changedParentsFqNames = parents.map { type ->
nameResolver.getClassId(type.className).asSingleFqName()
}
addChangedParents(fqName, changedParentsFqNames)
}
private fun ClassProtoData.getNonPrivateMemberNames(): Set<String> {

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental

Some files were not shown because too many files have changed in this diff Show More