Compare commits

..

1316 Commits

Author SHA1 Message Date
Pavel Punegov
6222705beb Move kotlin.native.Throws to common stdlib and rename to NativeThrows.
Move native concurrent annotations to subpackage
2019-02-21 19:51:54 +03:00
Dmitry Petrov
c248dd29c2 IR: declaration builders, initial iteration, use in some JVM lowerings 2019-02-21 16:03:11 +03:00
Kirill Shmakov
1846ec83e1 Return app name of the main folder
Better fix for KT-29804 aligned with KT-30003

KT-29804
KT-30003
2019-02-21 14:43:34 +03:00
Dmitry Gridin
147521d6cb Add intention to introduce import alias
#KT-16118 Fixed
 #KT-30007 Fixed
2019-02-21 12:25:09 +03:00
Dmitry Gridin
6bf119b262 Refactoring 2019-02-21 12:25:08 +03:00
Dmitriy Novozhilov
d58ee133a2 Fix type constraints of empty lambda (KT-28654 fix) 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
2ba33c3b8a Fix testdata broken in 46bd5ba 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
10b7baf69a Add test for KT-28654 2019-02-21 12:04:23 +03:00
Dmitriy Novozhilov
f186c83b15 KT-25383 fix 2019-02-21 12:04:23 +03:00
Ilya Gorbunov
7b55e72583 Remove dead teardown code for builtins uninvalidation in tests
VirtualFile.isStdLibFile always returns false, therefore unInvalidateFile is never executed

See also commit 358e64fdb
2019-02-20 19:14:31 +03:00
Natalia Selezneva
254374c619 Use ModuleInfo in VirtualFileFinder to add script dependencies in search scope
Otherwise it prevent to inline functions from those dependencies during scratch compilation
2019-02-20 18:36:38 +03:00
Natalia Selezneva
f3c828a17d Get platform for scripts from script definition
Introduce 'platform' property in KotlinScripDefinition (should have a value which exists in TargetPlatform.ALL_KINDS)

^KT-27684 Fixed
2019-02-20 15:59:44 +03:00
Shagen Ogandzhanian
0188cd5330 Publish npm artifacts over encrypted connection
https://youtrack.jetbrains.com/issue/KT-29988
2019-02-20 13:22:25 +01:00
LepilkinaElena
39bdc1cc2c Change short form of flag name to full one for cinterop tool (#2117) 2019-02-20 15:14:08 +03:00
Alexander Udalov
946acd2416 Minor, ignore test for JVM_IR
It started to fail with AssertionError in inlineOnly.kt after
d267f1e875 because "$annotations" methods have annotations from the
corresponding property (which can include InlineOnly), but are never
inline. The test will be unmuted as soon as we stop using wrapped
descriptors in the IR backend to determine access flags which should be
generated on a declaration in the bytecode
2019-02-20 10:56:14 +01:00
Ilya Matveev
588236391e Build: Fix Kotlin/Native composite build 2019-02-20 12:14:17 +03:00
Igor Chevdar
1d0fdd7976 [IR] Some fixes to wrapped descriptors 2019-02-20 10:39:30 +05:00
Yaroslav Russkih
9ac52fad17 Use https everywhere - documentation and samples 2019-02-19 21:35:36 +01:00
Yaroslav Russkih
028a311949 Use https everywhere - tests and test data 2019-02-19 21:35:36 +01:00
Yaroslav Russkih
7135f1972a Use https everywhere - production code 2019-02-19 21:35:36 +01:00
Vyacheslav Gerasimov
7d5158c439 Build: Fix internal api usage in DistModelBuilder
MapFileTree interface changed in gradle 5.1
2019-02-19 20:06:24 +03:00
Vyacheslav Gerasimov
f8266a5109 Build: Update gradle version to 5.1 2019-02-19 20:06:24 +03:00
Alexander Udalov
d267f1e875 JVM IR: generate synthetic $annotations methods for properties 2019-02-19 17:25:47 +01:00
Alexander Udalov
c92c50aa98 JVM IR: generate JVM signatures of companion object properties 2019-02-19 16:37:47 +01:00
Alexander Udalov
c357967c2c JVM IR: generate Kotlin metadata
Introduce MetadataSource as a way to store the original descriptor for
any element (before any lowerings) and maintain it until the end of the
codegen where it's used in generating the metadata. Note that JVM
signatures written to the metadata are formed from the _resulting_
generated elements, not by mapping the original descriptors.

Some corner cases are not supported yet, namely properties declared in
companion objects, synthetic methods for property annotations,
JvmPackageName, etc.

 #KT-29119 Fixed
2019-02-19 16:37:47 +01:00
Alexander Udalov
3d1858a8c5 Refactor and rename CodegenUtil.getDeclarationsToGenerate
Move logic regarding expect classes to the only relevant call site at
PackageCodegenImpl, and return the list of members to remove code
duplication at remaining call sites
2019-02-19 16:37:46 +01:00
Alexander Udalov
4487c7a988 JVM IR: rename private fields for properties with same name
This is needed to get rid of the code that appends "$companion" to
properties moved from companion, because it caused inconsistencies in
the ABI and in JVM signatures stored in the metadata
2019-02-19 16:37:46 +01:00
Nikolay Krasko
b4571fd548 Minor: cleanup tests in org.jetbrains.kotlin.idea.navigation 2019-02-19 18:27:50 +03:00
Toshiaki Kameyama
80e1fc2ace Navigation to implementation / overriding method: do not show method of inline class twice
#KT-28661 Fixed
#KT-26924 Fixed
2019-02-19 18:27:50 +03:00
Ilmir Usmanov
aa9ce7b2e9 Minor. Update test data 2019-02-19 18:09:23 +03:00
Mads Ager
057bdb3954 Generate better code for branches based on comparisons.
For comparison intrinsics and for instanceof checks, make
it possible to get the the stack value produced and branch
on that directly instead of materializing a boolean to
branch on from it.

That reduces code such as

```
    IF_CMPEQ L1
    CONST_0
    GOTO L2
L1: CONST_1
L2: IFEQ L3
```

to just one IF_CMP instruction.
2019-02-19 15:46:52 +01:00
Leonid Startsev
7d2c59fb70 Fix missing optionality of property when generating descriptor in Native 2019-02-19 15:52:04 +03:00
Leonid Startsev
8b16801f0d Insert correct offsets in a lot of places in IR
Use correct type arguments when invoking a generic functions
Fix missing parent in initializer
2019-02-19 15:52:04 +03:00
Leonid Startsev
66272bfa74 Fix impossibility to make @Optional field in a class hierarchy on JS 2019-02-19 15:52:04 +03:00
Leonid Startsev
18667a5a34 Add validator for unique serial names 2019-02-19 15:52:04 +03:00
Leonid Startsev
36e1d6668b Make write$Self a static function 2019-02-19 15:52:04 +03:00
Leonid Startsev
7c942af13d Add synthetic companion with .serializer() getter even if default serializer is overridden. (kotlinx.serialization/228) 2019-02-19 15:52:04 +03:00
Leonid Startsev
1e440efc01 Ban primitive arrays in JVM codegen too (fixes kotlinx.serialization/260) 2019-02-19 15:52:04 +03:00
Leonid Startsev
5231ef9966 Don't generate writeSelf/internal constructor if corresponding serialize/deserialize aren't auto-generated 2019-02-19 15:52:04 +03:00
Leonid Startsev
a6651fd6f9 Call superclass deserialization constructor if superclass is also internal serializable or no-arg ctor of non-serializable class on Native and JS 2019-02-19 15:52:04 +03:00
Leonid Startsev
e02cfcb8ea Replace @Optional with @Required 2019-02-19 15:52:04 +03:00
Leonid Startsev
04706f4473 Support classes with more than 32 serializable properties
Via increasing count of int bit masks in synthetic constructor
2019-02-19 15:52:04 +03:00
Leonid Startsev
08f983ef52 Semantic change:
Now properties with default values are @Optional by default, and properties without backing fields are @Transient by default.
2019-02-19 15:52:04 +03:00
Leonid Startsev
cca03e9586 Make enums and interfaces not serializable internally. However, they
still can be serialized using custom companion object.
Fixes https://github.com/Kotlin/kotlinx.serialization/issues/138 and https://github.com/Kotlin/kotlinx.serialization/issues/304
2019-02-19 15:52:04 +03:00
Nikolay Krasko
c41d6c427d Fix flaky navigation tests by refreshing file system before find 2019-02-19 15:42:32 +03:00
Mads Ager
e9ec8e2cee JVM_IR: Do not generate annotations on $default methods. 2019-02-19 13:23:42 +01:00
Mikhael Bogdanov
19d2bac2f8 Temporary disable test in IR 2019-02-19 13:05:05 +01:00
Toshiaki Kameyama
8cdf901538 Keyword completion: do not suggest const except inside top level or object
#KT-23026 Fixed
#KT-29840 Fixed
2019-02-19 14:57:44 +03:00
Mikhail Glukhikh
7d809bc1d5 Fix 181 compilation (AbstractFirResolveWithSessionTestCase)
We could fix it better, but anyway FIR & its tests aren't important
for this branch
2019-02-19 14:33:47 +03:00
Mikhail Glukhikh
7952249cd9 FIR: prevent SDK leak error in total kotlin IDE test
Related to KT-24077
2019-02-19 14:12:43 +03:00
Mikhail Glukhikh
2bc22fc2a6 FIR: fix Gradle configurator exception in total IDE test 2019-02-19 14:12:26 +03:00
Simon Ogorodnik
a6297f5f2f Refactor FIR total resolve in IDE test fixing various problems
Related to KT-24077
2019-02-19 14:11:43 +03:00
Simon Ogorodnik
5cef869d36 FIR: add symbol provider for IDE #KT-24097 Fixed
Functions & properties aren't yet supported
2019-02-19 14:11:11 +03:00
Mikhail Glukhikh
12ee81358c FIR: Add total resolve test in IDE mode (related to KT-24077) 2019-02-19 14:02:01 +03:00
Toshiaki Kameyama
779d536605 Redundant getter: fix false positive for 'external' getter
#KT-29416 Fixed
2019-02-19 13:03:11 +03:00
Mikhael Bogdanov
3b57ceeafe Don't generate annotations on $default methods
#KT-29965 Fixed
2019-02-19 10:51:37 +01:00
Mikhael Bogdanov
a020170a92 Report missed INLINE_FROM_HIGHER_PLATFORM diagnostic for derived class
Inline function descriptor in derived class represented as FAKE_OVERRIDE.
 So we should find it in base class declaration
 (not interface cause inline function can't be virtual, but always final)
 and then check class version.

 #KT-29402 Fixed
2019-02-19 10:51:36 +01:00
Mikhael Bogdanov
b03065b2ba Minor. Reformat 2019-02-19 10:51:35 +01:00
Kirill Shmakov
b844e587ed Fix KT-29804: rename app -> main
#KT-29804 Fixed
Reviewed at KOTLIN-CR-2735
2019-02-19 12:14:34 +03:00
Sergey Rostov
db8f423880 JPS Build, update artifacts: fix js stdlib, remove stdlib-jdk7 and 8 2019-02-19 11:39:53 +03:00
hisaaki.sioiri
f1cc7cecce Escaping quotes in live-templates (KT-2387)
#KT-2387 Fixed
2019-02-19 11:18:13 +03:00
Toshiaki Kameyama
7149d4cd1c Group by file structure: show groups on text search (KT-28838)
#KT-28838 Fixed
2019-02-19 11:18:13 +03:00
Stanislav Erokhin
76f2430e7c Code of Conduct for Kotlin project 2019-02-19 11:04:37 +03:00
Toshiaki Kameyama
5f7dee4194 Convert to scope function: enable on single function call
#KT-29099 Fixed
2019-02-19 10:41:20 +03:00
Dmitry Petrov
e1fdf0aa43 KT-29959 fix IR generation for 'd.m = e' 2019-02-19 09:59:42 +03:00
Mikhail Glukhikh
7f9b3a98b4 Fix corner cases (no expression, not resolved label) in raw FIR builder 2019-02-19 09:54:39 +03:00
Mikhail Glukhikh
552b137852 FIR: get rid of fictitious function symbols 2019-02-19 09:54:37 +03:00
Mikhail Glukhikh
74d89b1be2 JavaSymbolProvider: support different kinds of literals in annotations
Constants, enum entries, class references, arrays are covered here
Related to KT-29218
2019-02-19 09:54:34 +03:00
Mikhail Glukhikh
f8e165dbe4 Integrate nullability into cone types, add & use FIR flexible type
FIR fake overrides are rendered now more precisely to test this process
2019-02-19 09:54:32 +03:00
Mikhail Glukhikh
3d77f3d129 Fix rendering of ConeClassErrorType
This commit fixes total kotlin resolve test
2019-02-19 09:54:30 +03:00
Simon Ogorodnik
9ebefa3ba6 FIR: make FunctionType class-like, refactor built-ins resolution
This breaks total kotlin resolve test because of incorrect rendering
of ConeClassErrorType (we are trying to read its symbol)
2019-02-19 09:54:28 +03:00
Simon Ogorodnik
3edd82b602 FIR: make JavaSymbolProvider return error-type on not found symbols 2019-02-19 09:54:26 +03:00
Simon Ogorodnik
5afb0a6f4a FIR rename: FirType -> FirTypeRef and related 2019-02-19 09:54:24 +03:00
Mikhail Glukhikh
1c76a612f9 FIR rename: isNullable -> isMarkedNullable 2019-02-19 09:54:21 +03:00
Simon Ogorodnik
3a237416c9 Implement FIR loading for Java (classes, supertypes, parameters, funs)
Properties aren't implemented yet
FIR symbol provider functions return more specialized types now
Related to KT-28918, KT-29636, KT-29218

#KT-28788 Fixed
2019-02-19 09:54:20 +03:00
Mikhail Glukhikh
4ea3df53cc Implement FIR loading for libraries (classes, supertypes, parameters)
Members aren't implemented yet
Related to KT-28788, KT-28918
2019-02-19 09:54:18 +03:00
Mikhail Glukhikh
0bef9f2afe Rename in FIR provider: getSymbolByFqName -> getClassLikeSymbolByFqName 2019-02-19 09:54:17 +03:00
Simon Ogorodnik
bd769f8fd7 Add multiplatform test with substitution, fix deep supertypes
This commit fixes ambiguity problems introduced before
in MPP tests with deep supertypes

#KT-29636 Fixed
2019-02-19 09:54:16 +03:00
Simon Ogorodnik
0e3fecf614 Implement fake override mapping for functions
Related to KT-29636
2019-02-19 09:53:33 +03:00
Mikhail Glukhikh
1f5e89cd32 Disable JavaElementFinder in FIR tests to avoid old FE 2019-02-19 09:52:20 +03:00
Simon Ogorodnik
840750ee40 Implement basic use-site scopes and override mapping
This commit also introduces separate scope processors:
processFunctionsByName and processPropertiesByName, in addition to
existing processClassifiersByName

Ad-hock call resolver starts to discover ambiguities, which leads
to some ambiguity problems in MPP tests with deep supertype hierarchy

Related to KT-29636
2019-02-19 09:52:20 +03:00
Mikhail Glukhikh
6ea2abfc46 FIR override resolve: lookup also interfaces 2019-02-19 09:52:20 +03:00
Mikhail Glukhikh
b3c8e83c58 FIR: make override resolve in use-site session (and module)
Related to KT-24078
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
84b3a17e2b Type resolve transformer: reorder tower scope
This commit prioritizes inner scopes above outer scopes
(before this commit, inner scopes had lowest priority).
NB: really it's not precise enough too,
because explicit importing scope should have higher priority
than inner scopes.
Also fixes problem with total Kotlin resolve test introduced
in previous commit.
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
bec62acf5b FIR: introduce callable member symbols & initial member scopes
Initial member scopes cover top-level, class-level, and  supers

Ad-hock version of call resolve was introduced to test them
NB: after this commit, total Kotlin resolve test cannot finish
because of scope problems in type resolve transformer

Related to KT-24078
#KT-24083 Fixed
2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
95678a4d64 Extract FirAbstractTreeTransformer and *WithSuperTypes 2019-02-19 09:52:19 +03:00
Mikhail Glukhikh
0e179f6b44 Extract FirAbstractProviderBasedScope & fix potential KNPE 2019-02-19 09:52:19 +03:00
Dmitriy Dolovov
83cb2cb99e CIDR: Patch LLDB pretty printers for K/N < 1.1.1
Issue #KT-29625 Fixed
2019-02-19 10:49:08 +07:00
Ilya Gorbunov
ce577ac06b Minor: remove redundant imports in sample 2019-02-18 21:09:18 +03:00
Kevin Peek
565727e302 KT-20357 - Add sample for Regex.findAll() 2019-02-18 21:05:46 +03:00
Kirill Shmakov
a8777a8bb3 Add forgoten file 2019-02-18 20:57:28 +03:00
Kirill Shmakov
478c18f194 Move data of handmade test from auto-generated tests data dir
KT-29187
2019-02-18 20:36:26 +03:00
Vyacheslav Gerasimov
2bec617446 Build: Fix npmInstall task inputs validation problem
NpmInstall task adds $nodeModulesDir/package.json to input and fails validation with:
 "File '.../package.json' specified for property '$1' does not exist."
2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
333eb9701c Build: Fix JPS importer (DistModelBuilder) for Gradle 5.0 2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
3d0cd57e31 Build: Drop testDistProjects, root :dist task was already in list 2019-02-18 20:00:05 +03:00
Vyacheslav Gerasimov
a4cfd37203 Minor: Reformat dependencies.kt 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
294ba51d0b Build: Drop obsolete dependency handlers 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
25128f07f2 Build: Reformat artifacts.kt & fix some warnings, drop some dead code 2019-02-18 19:59:37 +03:00
Vyacheslav Gerasimov
14d9ec9fb2 Build: Use javadocJar helper to specify artifact explicitly
Creating javadocJar task for every project produces lots of unnecessary
tasks, some project don't even have code. Jar task without outDir
property set fails idea import with gradle 5.0+
2019-02-18 19:59:36 +03:00
Vyacheslav Gerasimov
e09802289d Build: Workaround SOE in kotlin-stdlib-common-sources
Probably gradle bug
2019-02-18 19:58:57 +03:00
Sergey Igushkin
2a14301c75 Fix Gradle plugin build with Gradle 5.0
* Due to 'improved POM support' introduced in 5.0, runtime dependencies
of the `compileOnly 'com.android.tools.build:gradle:...'` dependency
were no more transitively available. Add them manually;

* Add `!!` to usages of `resourcesDir`, which became nullable;

* Replace the dropped `classesDir` method usages with reflection;
2019-02-18 19:58:57 +03:00
Vyacheslav Gerasimov
e8f1e2d022 Build: Use latest version of build-scan plugin 2019-02-18 19:58:57 +03:00
Vyacheslav Gerasimov
7e1f64b712 Build: Fix generateVisitors task outputs 2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
d32f6fb382 Build: Fix compatibility with shadow plugin
Apply java-base plugin since shadow task requires sourcesets
2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
df9ca1b6d9 Build: Update shadow plugin version to 4.0.3 2019-02-18 19:58:56 +03:00
Vyacheslav Gerasimov
f2bf33fe2a Build: Update gradle version to 5.0 2019-02-18 19:58:56 +03:00
Ilya Gorbunov
5cc2215338 Extend compileOnly configuration from builtins
to avoid adding builtins configuration to classpath manually
2019-02-18 19:30:24 +03:00
Ilya Gorbunov
441e7cc15d Always use singleFile when passing a configuration as a zipTree parameter 2019-02-18 19:30:24 +03:00
Ilya Gorbunov
6bcd112062 Drop obsolete artifact kotlin-runtime
Remove suppresses used to compile some parts of stdlib
as a non-multiplatform project.
2019-02-18 19:20:30 +03:00
Ilya Gorbunov
8ed2facc8c Remove integration test involving kotlin-stdlib-jre7/8 2019-02-18 18:45:20 +03:00
Ilya Gorbunov
811566bbe0 Drop obsolete artifacts kotlin-stdlib-jre7/8 2019-02-18 18:44:35 +03:00
Dmitry N. Petrov
4e05c2305e Merge pull request #2121 from jimgoog/mutable-origin
Make IrDeclaration.origin mutable
2019-02-18 16:48:50 +03:00
Toshiaki Kameyama
8e61a13809 Move lambda argument out of parentheses: fix false negative when function type is type parameter
#KT-26979 Fixed
2019-02-18 16:48:11 +03:00
Toshiaki Kameyama
b4789b95ef Rename: fix renaming of label by label reference in loop
#KT-29796 Fixed
2019-02-18 15:12:39 +03:00
Nicolay Mitropolsky
76bdfddfea Making KotlinAnnotatedElementsSearcher able to search for parameters (KT-27794) 2019-02-18 14:08:09 +03:00
Simon Ogorodnik
2b9cf06c3f Enable debug log for PerModulePackageService only in J2K 2019-02-18 13:42:12 +03:00
Nikolay Krasko
9a99f832e5 Fix blinking parameter info popup for nested places (KT-29574)
#KT-29574 Fixed
2019-02-18 13:25:45 +03:00
Nikolay Krasko
5f7815bd54 Attempt to fix invalid element exception at suppress intention (EA-135693) 2019-02-18 13:25:44 +03:00
Nikolay Krasko
8a97cd3a15 Fix PIEAE on getting current editor (EA-135969) 2019-02-18 13:25:44 +03:00
Nikolay Krasko
16ff522cd3 Check element disposed before getting component in migration (EA-134713)
Check if it can reduce the exceptions rate and check for deeper exceptions.
2019-02-18 13:25:44 +03:00
Dmitriy Novozhilov
d1b7c0f683 Fix testdata for try/catch inference and DFA 2019-02-18 12:43:42 +03:00
Dmitriy Novozhilov
8fc7b4436b Revert "Temporary fix to compile project with the snapshot compiler"
This reverts commit acb83f1a
2019-02-18 12:43:42 +03:00
Dmitriy Novozhilov
5d0074bda5 Fix bug in try/catch resolution in NI
Bug was presented in a236ad5
2019-02-18 12:43:42 +03:00
Ilmir Usmanov
1e4b7e1ef1 Put $assertionDisabled field into inline-site's class
The generated code is more inline with java, and we avoid the error of
accessing package-private field outside of the package.
However, this changes semantics a bit. Now, a user should set assertion
status of inline-site's package, instead of inline function's one.
 #KT-28317: Fixed
2019-02-18 12:39:03 +03:00
Mikhail Zarechenskiy
acb83f1af1 Temporary fix to compile project with the snapshot compiler
The problem is in NI and can relate to a236ad5686
2019-02-18 11:45:02 +03:00
Dmitriy Dolovov
45f028d353 CIDR: Avoid Java errors during KTS analysis in CIDR
There is no Java support in CIDR. Therefore:
- analyze KTS in CIDR using Common platform
- disable error highlighting for KTS in CIDR

Issue #KT-29953 Fixed
2019-02-18 11:27:31 +07:00
Dmitriy Novozhilov
a4d6f72ad1 Split testdata of #KT-25432 and #KT-29767 2019-02-17 13:03:01 +03:00
Dmitriy Novozhilov
49a42f9434 Fix #KT-28999. Prohibit type parameters on anonymous objects 2019-02-17 13:02:22 +03:00
Dmitriy Novozhilov
11e5ddf9ae Add test for #KT-28999 2019-02-17 13:02:22 +03:00
Dmitriy Novozhilov
4a298d1413 NI: introduce new data flow analysis for try/catch (#KT-28370) 2019-02-17 12:51:25 +03:00
Dmitriy Novozhilov
a236ad5686 NI: resolve try catch as synthetic function call (#KT-25435 fixed) 2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
4e64b07727 Add some tests for inference and DFA of try/catch/finally 2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
8d3271cc68 Refactor if expressions resolving
Context without expected type became redundant after synthetic
  call resolving was added for inference of `if` expression type

`isStatement` flag removed, because it was effectively unused
2019-02-17 12:46:11 +03:00
Dmitriy Novozhilov
1a1375240b Minor: reformat PSICallResolver according to codestyle 2019-02-17 12:46:11 +03:00
Andrey Uskov
a106085e67 Update kotlin gradle plugin used in import tests 2019-02-17 12:42:31 +03:00
Andrey Uskov
b5e6752656 Migrate import tests of composite MPP build to new version of MPP 2019-02-17 12:42:15 +03:00
Andrey Uskov
ed87a4a00d Add memory leak detection in import tests 2019-02-17 12:41:21 +03:00
Andrey Uskov
3a27192241 Remove dependency on dev version of gradle plugin in import tests 2019-02-17 12:41:04 +03:00
Andrey Uskov
ec9ee8ce40 Remove platform 173 in build script bunch 2019-02-17 12:40:50 +03:00
Andrey Uskov
6dee81f653 Cleanup Kotlin SDK in MavenImportingTestCase 2019-02-17 12:39:23 +03:00
Andrey Uskov
7890037d90 Move KotlinSdkCreationChecker to idea-test-framework module 2019-02-17 12:38:59 +03:00
Andrey Uskov
ec08d0bc27 Minor. Get rid of KotlinMavenImporter bunch 2019-02-17 12:30:29 +03:00
Andrey Uskov
b3593e87c0 Create Kotlin SDK for non-MPP JS projects
#KT-29467 Fixed
2019-02-17 12:30:06 +03:00
Andrey Uskov
8063c6511c Create Kotlin SDK on reopen project for native platform
#KT-29464 Fixed
2019-02-17 12:29:42 +03:00
Andrey Uskov
9a5fe43468 Create Kotlin SDK action moved to pooled thread
#KT-29551 Fixed
2019-02-17 12:29:24 +03:00
Andrey Uskov
59bcd608a1 Minor. Remove useless code related to IJ 173 and AS 3.1 in build scripts 2019-02-17 12:29:01 +03:00
Andrey Uskov
52be952fb7 Refactor gradle importing tests. Add possibility to test various
versions of gradle kotlin plugin
2019-02-17 12:28:19 +03:00
Andrey Uskov
5c82daf7a1 Improve bunches of GradleImportingTestCase 2019-02-17 12:27:33 +03:00
Jim S
47d63fc9be Make IrDeclaration.origin mutable 2019-02-16 09:55:03 -08:00
Yan Zhulanow
a7ea252973 Refactoring: Split KotlinCoreEnvironment setup functions for Android Lint 2019-02-15 21:23:27 +03:00
Yan Zhulanow
1fbf51ea13 Kapt: Ignore imports for enum entries on import conversion (KT-28220) 2019-02-15 21:23:27 +03:00
Yan Zhulanow
87cad2af02 Kapt: Fix "no interface expected here" in class implementing interface with secondary constructor (KT-27506) 2019-02-15 21:23:27 +03:00
Yan Zhulanow
a9eaf1c345 Pill: Rename Pill configurations, make its name not capital 2019-02-15 21:23:27 +03:00
Yan Zhulanow
770a2e3f2d Attach expect sources to all source set tasks (KT-26977)
If kapt is enabled, there are several Kotlin compilation tasks for one source set (stub generator + compile). We should attach the expect sources to all of them.
2019-02-15 21:23:26 +03:00
Yan Zhulanow
1c824655d4 Kapt: Fix supertype conversion for DefaultImpls (KT-28306) 2019-02-15 21:23:26 +03:00
Ting-Yuan Huang
3a768060ca Skip annotation processing when there's no AP specified
This also fixes KT-29302 where stub generation is skipped while the
subsequent annotation processing phase anticipates the generated stubs.

This patch addresses cases where kapt.use.worker.api=true. The cases
where kapt.use.worker.api=false are handled in the same place of stub
generation.
2019-02-15 21:23:25 +03:00
Yan Zhulanow
53fa647d41 Revert "Kapt: Do not treat initially empty configurations specially (KT-27404)" (KT-29481)
This partially reverts commit 2cb2141e07.
2019-02-15 21:23:25 +03:00
Yan Zhulanow
0444203b9b Ignore non-jar files in ServiceLoaderLite (KT-29513) 2019-02-15 21:23:25 +03:00
Yan Zhulanow
15a316ff90 Fix keyword completion for code fragments (KT-28680) 2019-02-15 21:23:25 +03:00
Yan Zhulanow
088b89b534 Pill: Add a dependency to backend.ir, fix JPS build 2019-02-15 21:23:25 +03:00
Alexander Udalov
f2bf81e799 Fix UOE when using Java annotation with infinity/NaN as default value
The root problem is the fact that ConstantExpressionEvaluator returns
null for values such as infinity and NaN loaded from cls psi (see
IDEA-207252). This commit simply reverts a part of 8ab9226805 where we
started to compute default values more often than needed. In
LazyJavaClassMemberScope, we only need to check whether or not there
_is_ a default value, not compute its value.

 #KT-29792 Fixed
2019-02-15 19:13:53 +01:00
Alexander Udalov
b2cdf2dc74 Simplify AnnotationSplitter creation and target set computation 2019-02-15 17:53:27 +01:00
Alexander Udalov
4692247897 Do not check backing field presence in AnnotationSplitter
This code can be invoked early, during body resolution and before the
fact that a property has backing field (which is only known for certain
after body resolution, because an implicit 'field' identifier may be
used). Since split annotations are cached until the end of the program,
they may end up on incorrect elements in the bytecode (or disappear
completely) as in KT-29507 or KT-28182.

Because the FIELD target has the lowest priority among implicit
annotation targets (see TARGET_PRIORITIES), it's safe to always assume
that FIELD is a valid target when splitting annotations. This only
changes the way annotations are split in case of incorrect code, as
changes in test data show.

 #KT-28182 Fixed
 #KT-29507 Fixed
2019-02-15 17:53:27 +01:00
Kirill Shmakov
5595a2dd1b Add highlighting for exceptions stacktrace on Mac
KT-29817
Review: KOTLIN-CR-2722
2019-02-15 18:33:14 +03:00
Dmitry Petrov
08de82db85 Added tests for KT-29833 2019-02-15 16:25:16 +03:00
Dmitry Petrov
4c3d0cd9d7 KT-29861 startOffset/endOffset for 'valueOf' function of enum class 2019-02-15 16:25:16 +03:00
Dmitry Petrov
1b0d410a6f KT-29862 startOffset of class declaration
NB startOffset of primary class constructor declaration should still
point to the 'class' keyword (because of debugger requirements).
2019-02-15 16:25:16 +03:00
Natalia Selezneva
92a160e6c3 Fix navigation to buildSrc from scripts
buildSrc folder should be placed under project dir (root or included project)
^KT-29707 Fixed
2019-02-15 16:06:55 +03:00
Natalia Selezneva
830973a93c Fix "Multiple Script Definitions" notification for settings.gradle.kts
^KT-29832 Fixed
2019-02-15 16:06:55 +03:00
Natalia Selezneva
d8080f205c Always scan root for script templates in background
^KT-29893 Fixed

Provide AsyncScriptDefinitionsContributor.
Show a notification if the highlighting for script is requested when not all script templates are loaded
2019-02-15 16:06:54 +03:00
Natalia Selezneva
00cd6a698d Do not run multiple script dependencies updates if dependencies weren't saved yet
^KT-29770 Fixed
2019-02-15 16:06:54 +03:00
Natalia Selezneva
8918a83fb4 Unify cache size for script dependencies 2019-02-15 16:06:54 +03:00
Natalia Selezneva
abc2dbba39 Minor: fix typo in package name 2019-02-15 16:06:54 +03:00
Natalia Selezneva
889396ec27 Cache 10 + 5 scripts in KotlinCacheService
This may be useful for find usages (and inspections that uses it) of declaration from buildSrc which may be used in several scripts
2019-02-15 16:06:54 +03:00
Natalia Selezneva
74909c4d09 Do not run unused symbol inspection if declaration in used in more than 3 scripts 2019-02-15 16:06:53 +03:00
Ilya Chernikov
c29332e290 Regenerate tests 2019-02-15 13:15:47 +01:00
Toshiaki Kameyama
cd13648906 Object literal can be converted to lambda: report if "return" is only one and is in the last statement
#KT-29763 Fixed
2019-02-15 13:52:19 +03:00
Ilya Matveev
7c3c21790b Fix subplugin options for K/N 2019-02-15 13:37:16 +03:00
Nicolay Mitropolsky
2678ada5ae 191: AbstractModelBuilderTest: addExtraProjectModelClasses was removed in platform 2019-02-15 11:39:54 +03:00
Dmitriy Dolovov
375697c413 User friendly presentation of KLIBs in IDEA
Missed fixes in 181 bunch
2019-02-15 15:32:22 +07:00
Dmitriy Dolovov
05323f8a30 CIDR: Avoid exception in JavaDocumentationProvider
as there is no Java support in CIDR
2019-02-15 11:12:28 +07:00
Nicolay Mitropolsky
a29bf61d05 191: fix for KotlinUastReferencesTest reference target assertion added in 191 2019-02-14 20:44:17 +03:00
Ilmir Usmanov
d269ff8ac8 Update test data 2019-02-14 18:33:20 +03:00
Ilmir Usmanov
19d2262cf1 Generate call of throwOnFailure instead of manual check
whether coroutine is resumed with exception.
 #KT-28015 Fixed
2019-02-14 18:33:17 +03:00
Nikolay Krasko
7c83d5df93 Move queue back to class instance after bad refactoring in search package
Relevant commit: 7f1e7cc461
2019-02-14 18:26:55 +03:00
Dmitry Gridin
33954c7632 Add inspection to move the variable declaration into when
#KT-29001 Fixed
2019-02-14 17:45:53 +03:00
Nikolay Krasko
7abe9333c8 Minor: remove deprecated usages of PsiSearchHelper.SERVICE 2019-02-14 17:23:49 +03:00
Nikolay Krasko
7f1e7cc461 Minor: reformat and cleanup org.jetbrains.kotlin.idea.search package 2019-02-14 17:23:49 +03:00
Nikolay Krasko
16c79b562e Minor: cleanup warnings in KotlinFunctionParameterInfoHandler.kt 2019-02-14 17:23:49 +03:00
Nicolay Mitropolsky
a3bd70a76e KotlinDeclarationSearcher: return backing fields for parameters (KT-29034) 2019-02-14 17:12:17 +03:00
Dmitry Petrov
6aff53204f psi2ir: support dynamic infix calls ('foo bar 42' is 'foo.bar(42)') 2019-02-14 16:03:11 +03:00
Dmitry Petrov
740d5ec468 Mute some tests in JS_IR after adding basic dynamic expressions support 2019-02-14 16:03:11 +03:00
Dmitry Petrov
77cbd10f9c psi2ir: don't generate temporaries in dynamic array augmented assignment
In constructs such as 'd[i] += x', where both indexed get and indexed
set are dynamic calls, it's safe to generate augmented assignment body
directly, without temporary variables for array ('d') and index ('i').
Note that corresponding IntermediateValue's are OnceExpressionValue's,
which would throw an exception if this assumption is violated.
2019-02-14 16:03:11 +03:00
Dmitry Petrov
580eb6fcac JS_IR: support dynamic expressions in block decomposition 2019-02-14 16:03:11 +03:00
Dmitry Petrov
03c35a4f44 JS_IR: support dynamic expressions in JS tree generation 2019-02-14 16:03:11 +03:00
Dmitry Petrov
4cee8c6f00 Minor: fix IrDynamicOperatorExpressionImpl double dispatch methods 2019-02-14 16:03:11 +03:00
Dmitry Petrov
5b4b22a8b6 psi2ir: additional tests for dynamic expressions: '?:', '!!' 2019-02-14 16:03:11 +03:00
Dmitry Petrov
83b2fed5be psi2ir: minor: drop unused import 2019-02-14 16:03:11 +03:00
Dmitry Petrov
6889e470d1 psi2ir: minor: move array access generation code 2019-02-14 16:03:11 +03:00
Dmitry Petrov
50269d3a5c psi2ir: minor: simplify code for dynamic array element assignment 2019-02-14 16:03:11 +03:00
Dmitry Petrov
cf29dce4c2 pri2ir: dynamic unary & binary expressions
NB1 Not every dynamic unary or binary expression is translated to
dynamic operator expressions literally. For example, assignments and
increments can have safe calls in LHS, which require some extra logic.

NB2 There are some open design questions left regarding how dynamic
expressions should actually be translated.
2019-02-14 16:03:11 +03:00
Dmitry Petrov
82701de87b psi2ir: minor: drop some unused params/imports 2019-02-14 16:03:11 +03:00
Dmitry Petrov
fbbe4f6e92 psi2ir: dynamic array element get/set 2019-02-14 16:03:11 +03:00
Dmitry Petrov
9a2bd5f4e6 psi2ir: dynamic member simple assignment/augmented assignment/++/-- 2019-02-14 16:03:11 +03:00
Dmitry Petrov
fc76d0970b psi2ir: Implicit casts with 'dynamic' 2019-02-14 16:03:11 +03:00
Dmitry Petrov
3c8f52b436 psi2ir: simple dynamic member calls 2019-02-14 16:03:11 +03:00
Dmitry Petrov
ddb1ea2047 psi2ir: dynamic member access ('d.x', 'd?.x') 2019-02-14 16:03:11 +03:00
Dmitry Petrov
6e7ccfbfff Introduce IrDynamicExpression and children
Dynamic expressions are represented as either operator expressions -
e.g., `d1 + d2`, `d[e]`, `d(e1, e2, e3)`, `d += e` -
where "operator" is a one of the known operators,
or as member reference expressions - e.g., `d.memberName` - where
member name is some arbitrary name (unresolved at compile-time and
represented as String).
2019-02-14 16:03:11 +03:00
Anton Bannykh
f8dc6763bd JS: minor review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
4e298ae5cb JS: Inlined local declarations should be positioned after imports 2019-02-14 15:14:28 +03:00
Anton Bannykh
0bfd332580 JS: improve a test (review fix) 2019-02-14 15:14:28 +03:00
Anton Bannykh
9ad1d8d054 JS: improve inline suspend function declaration splitter 2019-02-14 15:14:28 +03:00
Anton Bannykh
4b39e2df12 JS: (review fix) Header -> InlineData 2019-02-14 15:14:28 +03:00
Anton Bannykh
0fa87e3baa JS: advance IC version 2019-02-14 15:14:28 +03:00
Anton Bannykh
5c1664ebf8 JS: collect label definitions, not some of their usages 2019-02-14 15:14:28 +03:00
Anton Bannykh
b7bea3242e JS: fix fragment info loading
The very first fragment didn't got processed, thus inline cycle
reporter was not failing tests
2019-02-14 15:14:28 +03:00
Anton Bannykh
370194796e JS: fix synthethic name bindings for the inlined local declarations
TODO add synthetic order-based namebindings for inlined local
declarations AFTER all post-processings. This would be a more robust
approach imho
2019-02-14 15:14:28 +03:00
Anton Bannykh
32de99fe32 JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
8f68c47225 JS: support inline function definitions without wrappers
Apparently function literals are translated without hiding the local declarations
in the wrapFunction call.

Which makes sense. Apart from the fact that it would also make
sense to do the same for private inline functions and function
literals inside other inline functions.
2019-02-14 15:14:28 +03:00
Anton Bannykh
6e74c4ce71 JS: switch off the validator until class translation is fixed 2019-02-14 15:14:28 +03:00
Anton Bannykh
0daa6675bd JS: comments, review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
1c67e4cf21 JS: simplify and fix the AST visitor code. 2019-02-14 15:14:28 +03:00
Anton Bannykh
11265f1424 JS: review fixes (renamings, etc.) 2019-02-14 15:14:28 +03:00
Anton Bannykh
990ee849e2 JS: test local declaration deduplication with name clash; fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh
60aa6e4971 JS: a cross-module local declaration fake override test;
Also describe an alternative, more robust approach in a TODO comment
2019-02-14 15:14:28 +03:00
Anton Bannykh
b4b406af99 JS: explain what validateJsAst does; enable validation in non-incremental tests 2019-02-14 15:14:28 +03:00
Anton Bannykh
a35fc4fa3c JS: use string table for module names and inline function tags 2019-02-14 15:14:28 +03:00
Anton Bannykh
d7499363bc JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh
44dedf3a64 JS: minor refactoring 2019-02-14 15:14:28 +03:00
Anton Bannykh
396ec20788 JS: add constructor binding and inlining test 2019-02-14 15:14:28 +03:00
Anton Bannykh
92401f0561 JS: fix primary constructor name tag generation 2019-02-14 15:14:28 +03:00
Anton Bannykh
36fd4d24fb JS: move label renaming to new fragment post-processing
Also remove metadata renaming from the global passes
2019-02-14 15:14:28 +03:00
Anton Bannykh
6921d4d128 JS: minor 2019-02-14 15:14:28 +03:00
Anton Bannykh
2022a9c887 JS: fix inheriting fake overrides in inlined object literals 2019-02-14 15:14:28 +03:00
Anton Bannykh
9716abcc12 JS: inline private properties 2019-02-14 15:14:28 +03:00
Anton Bannykh
50aeeee462 JS: fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh
21cbc7b018 JS: add incremental test for local declarations change 2019-02-14 15:14:28 +03:00
Anton Bannykh
299a45ccbf JS: validate AST when serializing to IC cache 2019-02-14 15:14:28 +03:00
Anton Bannykh
e4b081e1bf JS: fix inline cycle reporting 2019-02-14 15:14:28 +03:00
Anton Bannykh
b5b770c804 JS: line number fix 2019-02-14 15:14:28 +03:00
Anton Bannykh
47a219eeff JS: refactorings & cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh
e76f80cbc6 JS: prevent duplicate imports inside inline function definition 2019-02-14 15:14:28 +03:00
Anton Bannykh
13844bd08e JS: FunctionReader cleanup 2019-02-14 15:14:28 +03:00
Anton Bannykh
6d5ef2d324 JS: fix long constants importing 2019-02-14 15:14:28 +03:00
Anton Bannykh
cd0fd569b4 JS: visit tests and main in import remover; update line numbers 2019-02-14 15:14:28 +03:00
Anton Bannykh
52b705e7ae JS: Fix local aliases
Local aliases can be copied as-is to a different fragment now. Before this change we would have had to extract the local alias tag (if any) from the source fragment and add to the destination fragment name bindings.
2019-02-14 15:14:28 +03:00
Anton Bannykh
3a258ad08a JS: fix module references in case of @JsModule annotation 2019-02-14 15:14:28 +03:00
Anton Bannykh
a1649e9e4d JS: fix import cleaner
The tag generated during the source file translation could differ from
the tag generated based on the import statement (e.g. "intrinsic:..."
during generation becomes "'Kotlin'...." later on).

This means that the same function imported from the start and imported
during inlining has different tags. Which makes duplicate import removal
trickier. The best solution would be to make sure the tag generation
algorithms are consistent.

Current solution: rewrite the tags in terms of the Inliner tag
generation algorithm right after the source file translation.

Also it seems that some `var` statements we treated as imports, even
though they were not. Supported this behavior for now.

TODO: Get rid of these workaround
2019-02-14 15:14:28 +03:00
Anton Bannykh
c1fbeeb7d9 JS: fix bugs 2019-02-14 15:14:28 +03:00
Anton Bannykh
a30c7fbee1 JS: Support imported wrapper serialization 2019-02-14 15:14:28 +03:00
Anton Bannykh
75668826d3 JS: simplification in process 2019-02-14 15:14:28 +03:00
Anton Bannykh
2cbdc7ecb0 JS: store whole JsImportedModule's in the module local alias
Module references were stored as plain JsName's. When inlining a function
from one fragment to another, those references should be re-interpreted
in terms of the destination fragment. Storing the whole module information
makes that much easier.
2019-02-14 15:14:28 +03:00
Anton Bannykh
a0ff581a2f JS: refactoring 2019-02-14 15:14:28 +03:00
Anton Bannykh
6d26bf9622 JS: don't load binary AST unless required by the inliner 2019-02-14 15:14:28 +03:00
Anton Bannykh
c83b6d46cc JS: split JsInliner 2019-02-14 15:14:28 +03:00
Anton Bannykh
c65383fa3f JS: postpone JS AST merging 2019-02-14 15:14:28 +03:00
Anton Bannykh
ec276dbea4 JS: convert JsInliner to Kotlin 2019-02-14 15:14:28 +03:00
Anton Bannykh
039625bb7e JS: convert K2JSTranslator to Kotlin 2019-02-14 15:14:28 +03:00
Anton Bannykh
1052ec898c JS: review fixes (mostly tests) 2019-02-14 15:14:28 +03:00
Anton Bannykh
3529114913 JS: incremental translation of tests and main fun invocation 2019-02-14 15:14:28 +03:00
Anton Bannykh
0397af79b4 JS: convert from java to kotlin JsProgramFragment 2019-02-14 15:14:28 +03:00
Toshiaki Kameyama
d583c1be58 Can be replaced with binary operator: do not suggest when receiver or argument is floating point type
#KT-28596 Fixed
2019-02-14 15:10:26 +03:00
Nicolay Mitropolsky
48619a49ed RenameKotlinPropertyProcessor made not update the property before all references are updated (KT-27602)
because otherwise language independent bean property references couldn't properly handle rename in some cases.

Groovy references were also affected by this bug because they weren't able to resolve to original property
2019-02-14 13:27:06 +03:00
victor.petukhov
2bcdadf17f Add positive diagnostic tests for smartcasts from nullability condition using if expression 2019-02-14 13:11:14 +03:00
Dmitriy Dolovov
75250cf1a0 User friendly presentation of KLIBs in IDEA
Adds friendly names for KLIBs imported as file dependencies from Gradle project.

Issue #KT-29613 Fixed
Issue #KT-29783 Fixed
2019-02-14 16:55:45 +07:00
victor.petukhov
06b5a42d0d Improve test exceptions fixation:
- exceptions is analyzed if it's specified explicitly only,
- compute test case number for diagnostic tests in which an exception is thrown.
2019-02-14 12:31:43 +03:00
victor.petukhov
317da3d481 Add NOTE and UNSPECIFIED BEHAVIOUR fields to spec tests 2019-02-14 12:31:43 +03:00
victor.petukhov
ec8a6cbe9c Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:43 +03:00
victor.petukhov
acd6d354dc Support several spec places to which tests are linked and require specify spec version for each test 2019-02-14 12:31:43 +03:00
victor.petukhov
cb5f497cbe Alphabetical sort wrapped intersection types for rendered diagnostics 2019-02-14 12:31:42 +03:00
victor.petukhov
30762a450a Wrap diagnostic parameters to double quotes and split by comma instead of semicolon 2019-02-14 12:31:42 +03:00
victor.petukhov
46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
victor.petukhov
fad59e200c Code stylistic improvements in BaseDiagnosticTest 2019-02-14 12:31:42 +03:00
victor.petukhov
b354518a41 Add lazy debug diagnostic DEBUG_INFO_EXPRESSION_TYPE 2019-02-14 12:31:42 +03:00
victor.petukhov
f92232f015 Decompose and rewrite CheckerTestUtil to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov
9e06e1eec0 Move and rename into .kt files around CheckerTestUtil for rewrite to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov
8a9c7a69f3 Move checkType directives for tests to separate folder 2019-02-14 12:31:42 +03:00
Ilmir Usmanov
440cccae73 Loosen tail call check
Check that any source of ARETURN is inside a suspension point, not all
of them.
 #KT-27190 Fixed
2019-02-14 12:21:44 +03:00
Sergey Rostov
cc62c971e7 JPS Build: update artifacts for IDEA 2019.1 module names 2019-02-14 10:32:28 +03:00
Dmitriy Dolovov
3df5123d0d CIDR: New way of building CLion and AppCode plugins
- Move `prepare/cidr-plugin`, `prepare/clion-plugin` and `prepare/appcode-plugin` modules from `kotlin` to `kotlin-ultimate` project
- Move `versions.clion.*` and `versions.appcode.*` properties from `kotlin` to `kotlin-ultimate` project
- Drop `cidr183` bunch in `kotlin` project
- Drop useless `cidrPluginDir`, `clionPluginDir`, `clionSandboxDir`, `appcodePluginDir`, `appcodeSandboxDir` Gradle properties in `kotlin` project
- Drop `cidrPlugin` Gradle task in `kotlin` project
- Total: Add ability to build `kotlin-ultimate` both as part of multi-project build with `kotlin` project, and as a standalone build
2019-02-14 12:28:57 +07:00
Alexey Tsvetkov
d5507734e8 Fix maven plugin after IC build reports were introduced to Gradle 2019-02-13 22:04:07 +03:00
Anton Yalyshev
b8d9b563a9 inlined field for better look 2019-02-13 21:48:18 +03:00
Anton Yalyshev
2ccc79b536 Adapted statistics logging to new FUS API. Removed Context usage. 2019-02-13 21:48:18 +03:00
Anton Yalyshev
77d7b8fa1d Plugin util seems better for getting plugin version 2019-02-13 21:47:04 +03:00
Anton Yalyshev
586d2a548b attr. name was changed in FUS API 2019-02-13 21:47:04 +03:00
sashache
7e9f8df43a Allow IDE plugin for 2019.1 platform to run with IDEA 2019.2. 2019-02-13 21:30:57 +03:00
Yan Zhulanow
9729932fe4 191: Update Android plugin changes to AS33 (KT-29847) 2019-02-13 16:35:46 +03:00
Alexander Podkhalyuzin
a2d702c2a7 Fixed 182 patchsets 2019-02-13 16:31:25 +03:00
Denis Zharkov
abad408d7b Do not implicitly propagate deprecations originated in Java
^KT-29604 Fixed
2019-02-13 16:21:05 +03:00
Alexander Podkhalyuzin
2f546d1003 Test for multline todo comments support to Kotlin 2019-02-13 15:59:14 +03:00
Alexander Podkhalyuzin
6c2af0741a Added multline todo comments support to Kotlin
#KT-26950 Fixed
2019-02-13 15:34:00 +03:00
Nikolay Krasko
0d1460ac04 Add "Hard wrap at" and "Wrap on typing" to UI (KT-28905)
#KT-28905 Fixed
2019-02-13 13:56:34 +03:00
Nikolay Krasko
9c47fc6d4d Don't auto close simple long template entry if it's already finished (KT-11143)
#KT-11143 Fixed
2019-02-13 13:56:34 +03:00
Nikolay Krasko
9fe82524e5 Rename in wrapping settings: method -> function (KT-29304) 2019-02-13 13:56:34 +03:00
Ilya Gorbunov
f50820045a Allow setting seed only once, as it is set from superclass constructor
Add tests for Java<->Kotlin Random wrappers.

#KT-29520 Fixed
2019-02-13 00:21:22 +03:00
Ilya Chernikov
4d0261fc45 Fix parsing tests 2019-02-12 21:02:56 +01:00
Alexey Tsvetkov
37e74e0949 Add debugKotlinDaemon shortcut to Gradle tests 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
560a9d6ae6 Add smoke test 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
690f6fdd32 Print build overview 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
7084fd8966 Do not print tasks info when no Kotlin task was run 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
dbdc7a5b07 Add verbose mode to build reports
#KT-12700

Verbose mode can be enabled by adding `kotlin.build.report.verbose=true`
to `gradle.properties` file.
2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
01c23510c7 Print recompilation reasons in build report 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
47bb938b94 Adjust build report verbosity 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
98ef00b957 Add build reports for diagnosing build problems in Gradle
#KT-12700 Fixed

To turn build reports, add 'kotlin.build.report.enable=true' to
gradle.properties file
(or pass it in CLI via`-Pkotlin.build.report.enable=true`).
By default build reports are created in
`rootProject/build/reports/kotlin-build`.
Build report dir can be customized via `kotlin.build.report.dir`
property.
2019-02-12 22:10:11 +03:00
Alexey Tsvetkov
8fc8b95d83 Move TaskLoggers to org.jetbrains.kotlin.gradle.plugin.internal.state 2019-02-12 22:10:11 +03:00
Svyatoslav Kuzmich
d0e7fb7af3 [JS IR BE] Copy Runtime IR after inline preparation passes 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
74ee64fcf1 [JS IR] Workaround: don't try to use generated js files for secondary modules 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
cfde97a7a0 [JS IR BE] Support nested external classes 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
0ff23544fc [JS IR BE] Initial support for mudule wrapper generation 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
d8b1d09566 [JS IR BE] Support codegen for external objects and properties 2019-02-12 18:45:35 +03:00
Svyatoslav Kuzmich
53d15ea27c [JS IR BE] Fix arrays type checks 2019-02-12 18:45:34 +03:00
Vyacheslav Karpukhin
9d4e161324 Updated AppCode dependency 2019-02-12 16:27:07 +01:00
Pavel Punegov
52055ecc94 Add classifier for the artifact to be resolved correctly 2019-02-12 16:01:45 +03:00
Dmitry Gridin
5089df2441 Fix convert unary operator to function call
#KT-25501 Fixed
2019-02-12 11:57:40 +03:00
Kirill Shmakov
e341286fb1 Bump gradle version in template projects
#KT-28522 supposed to be fixed with this
2019-02-11 15:53:24 +03:00
Sergey Rostov
70ffb14d0a JPS Build: update artifacts 2019-02-11 15:18:43 +03:00
Toshiaki Kameyama
4113d06767 Add "Change type to mutable collection" quick fix for NO_SET_METHOD
#KT-29193 Fixed
2019-02-11 10:17:51 +03:00
Toshiaki Kameyama
52c2547d95 Create extension function '.set' quick fix: do not suggest for read-only collestions
# KT-29193 Fixed
2019-02-11 10:17:51 +03:00
Toshiaki Kameyama
d6e21b1c21 Convert to secondary constructor: do not suggest when property has val/var and no name
#KT-29056 Fixed
2019-02-11 10:04:33 +03:00
Ilya Chernikov
dab97ac936 Use KotlinPaths to access jars 2019-02-10 13:35:59 +01:00
Ilya Chernikov
66107d430e Fix maven plugin after moving scripting to the compiler plugin 2019-02-10 13:35:58 +01:00
Ilya Chernikov
d0e78b95c3 Introduce classpath for compiler with scripting in KotlinPaths, fix JSR-223 for Idea 2019-02-10 13:35:58 +01:00
Ilya Chernikov
4c751cdd52 Refactor KotlinPaths - make it easier to extend and keep track of supported entities 2019-02-10 13:34:28 +01:00
Ilya Chernikov
b0c86647ed Convert KotlinPaths to kotlin 2019-02-10 13:33:22 +01:00
Ilya Chernikov
d1da1dd410 Rename .java to .kt 2019-02-10 13:33:22 +01:00
Ilya Chernikov
c6a24c03e4 Move CliScriptDefinition provider to the plugin too, fix tests 2019-02-10 13:33:22 +01:00
Ilya Chernikov
731df8d3cc Proper handling of the scripting compiler plugin in JSR-223 with daemon 2019-02-10 13:33:21 +01:00
Ilya Chernikov
df0b648cea Add scripting configuration to daemon repl, fix and add tests 2019-02-10 13:33:21 +01:00
Ilya Chernikov
be95acd897 Load scripting plugin explicitly in repl tests and JSR-223 2019-02-10 13:33:21 +01:00
Ilya Chernikov
2f52df0640 Initialize scripting plugin in other tests 2019-02-10 13:31:57 +01:00
Ilya Chernikov
5ef6ad916f Apply scripting compiler plugin to the jvm scripting host compiler 2019-02-10 13:31:57 +01:00
Ilya Chernikov
2c02ee3d29 Rename test files to scripts to trigger proper scripting initialization
fix generation config accordingly
2019-02-10 13:31:57 +01:00
Ilya Chernikov
2b67dbe8dd Initialize scripting in tests if script is passed as a source 2019-02-10 13:31:56 +01:00
Ilya Chernikov
89fc7eba95 Make script infrastructure providers optional 2019-02-10 13:31:56 +01:00
Ilya Chernikov
0732b48701 Move script related configuration to the plugin 2019-02-10 13:31:55 +01:00
Ilya Chernikov
dafb2a7519 Drop unused classes and references 2019-02-10 13:31:55 +01:00
Toshiaki Kameyama
6f7830a4b2 Make public: reformat after removing primary constructor visibility modifier
#KT-29444 Fixed
2019-02-09 02:56:14 +03:00
Alexander Udalov
c2968b6a68 Minor, use kotlin.Pair in JvmSerializationBindings.FIELD_FOR_PROPERTY 2019-02-07 23:33:29 +01:00
Alexander Udalov
23298af5a4 Implement fillInStackTrace and others in TestsError
This fixes exception stack traces in some compiler tests. Also provide
explicit return types to get rid of platform type inspections
2019-02-07 23:33:29 +01:00
Alexander Udalov
ce7d8a6874 JVM IR: replace unnecessary property accessor calls with field access
Split the ConstAndJvmFieldPropertiesLowering into two: ConstLowering
which replaces const vals with their values, and
PropertiesToFieldsLowering which removes unnecessary property accessors
(such as for JvmField or private properties with default accessors) and
replaces calls to those accessors with field access
2019-02-07 23:32:32 +01:00
Alexander Udalov
1c143310ac JVM IR: coerce call result to expected expression type
The boundWithSerializableReceiver.kt test is muted since property
references are not yet supported in the JVM IR backend. Previously it
passed by accident
2019-02-07 21:26:00 +01:00
Alexander Udalov
8b395589be JVM IR: fix incorrect IR types in inner and enum class lowerings
In InnerClassesLowering, the type of the "outer$0" expression should be
the outer class, not the inner class. In EnumClassLowering, the type of
the enum entry is the type of its class or the type of the enum class,
but not the type of initialierExpression which is always Unit
2019-02-07 21:25:59 +01:00
Alexander Udalov
4bfa98144b JVM IR: fix compound access to JvmField properties 2019-02-07 21:23:02 +01:00
Alexander Udalov
5c807266f6 JVM IR: fix origin of file class in FileClassLowering
IrDeclarationOrigin.FILE_CLASS is used in CallableReferenceLowering to
generate correct declaration owner.

Many reflection tests start to fail with this commit because they are
now treating callable references to top level declarations as Kotlin
symbols and fail because there's no JVM signature for them; this is
fixed in subsequent commits (previously, they worked because without
Kotlin metadata, these files were treated as Java classes)
2019-02-07 21:23:02 +01:00
Alexander Udalov
8ae03b54d9 JVM IR: generate correct .kotlin_module files 2019-02-07 21:23:02 +01:00
Alexander Udalov
aa0882a74f Refactor .kotlin_module-writing code, simplify PackagePartRegistry 2019-02-07 21:23:01 +01:00
Alexander Udalov
be74f36acc Add module backend.jvm to kotlin-compiler.jar JPS artifact 2019-02-07 21:23:00 +01:00
Alexander Udalov
246346367c Minor, don't use experimental coroutines in kotlinp test 2019-02-07 21:23:00 +01:00
Mikhael Bogdanov
4dc304b24e Move IrBytecodeText tests to ir package 2019-02-07 16:14:20 +01:00
Mads Ager
b902da55d5 JVM_IR: Block with nothing type do not generate values on the stack. 2019-02-07 16:05:16 +01:00
Denis Zharkov
b37aeb8f14 Remove accidentally committed test data bunch for as33 2019-02-07 16:24:23 +03:00
Vyacheslav Karpukhin
ec2dacf9a2 AppCode: minor refactoring in the build script 2019-02-07 13:21:26 +01:00
Mikhael Bogdanov
267925ef14 Update bootstrap to 1.3.30-dev-1419 2019-02-07 11:55:02 +01:00
Mikhael Bogdanov
6aaa601239 Add tests for obsolete issues
#KT-21085 Obsolete
 #KT-13846 Obsolete
2019-02-07 11:39:48 +01:00
Mikhael Bogdanov
6d24d50df6 Remove obsolete test 2019-02-07 11:39:48 +01:00
Dmitriy Novozhilov
c5c43d89d3 Fix testdata of #KT-28598 2019-02-07 13:27:05 +03:00
Dmitriy Novozhilov
3f4df6160c Minor: reformat NewCapturedType.kt according to code style 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
9129210cfe Move changes from dfb379d under new language feature (#KT-28672)
Changes from that commit are breaking, and should be pass throw LC
2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
cf25cab773 Add test for #KT-28598 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
6878abe8b4 Add test for #KT-25432 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
93de13d931 Fix behaviour of NI in testData
After one of previous commits (my or Mikhail Zarechenskiy) that test
  was broken and it's behaviour was not fixed. That test's behaviour
  is strange (why at one case we have `UNREACHABLE_CODE` and haven't
  at other) and needs further investigation
2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
b9c5b63d69 Fix #KT-28993 2019-02-07 12:12:34 +03:00
Dmitriy Novozhilov
c60bce88c2 Add test for #KT-28993 2019-02-07 12:12:34 +03:00
kirill.shmakov
4b1e5e8005 Resolve #KT-26865 and related issues
CLITool.exec is used in konanc to perform compilation of native project.
Due to some internal limitation, this function runs in separate process.

After this change, there will be a possibility to choose MessageRenderer
used in CLITool.exec via system property
org.jetbrains.kotlin.cliMessageRenderer.

Reviewed at KOTLIN-CR-2698.
2019-02-07 11:29:16 +03:00
Denis Zharkov
2518ddd87d Fix test data for 181/as33 2019-02-07 11:25:25 +03:00
Ilya Matveev
25bc88f33d Fix K/N framework naming in test 2019-02-06 18:21:42 +03:00
Ilya Matveev
ecbadcdf6f Use project.container instead of WrapUtil
In Gradle 5.2 the 'WrapUtil.toNamedDomainObjectSet' method
was removed. This patches replaces usage of this method
with call of the 'Project.container' method.

Issue #KT-29725 Fixed
2019-02-06 18:21:42 +03:00
Denis Zharkov
1a630773cf Fix parent and containingFile for throws-reference list
Otherwise, exception is thrown during type inference
because default implementations effectively return null

^KT-29287 Fixed
2019-02-06 16:26:28 +03:00
Mikhail Glukhikh
f040eaff27 FIR expressions: perform some names refactoring
FirAccess -> FirQualifiedAccess
FirAccessExpression -> FirQualifiedExpression
FirPropertyAssignment -> FirVariableAssignment
Introduce lValue & rValue in FirAssignment
Introduce separate indexes in FirArraySetCall
2019-02-06 11:59:06 +03:00
Mikhail Glukhikh
8ea4500ab4 Add test for PSI consistency #KT-24080 Fixed
This test checks that we handled all PSI elements properly
2019-02-06 11:59:03 +03:00
Mikhail Glukhikh
5e6ccb4b10 FIR total kotlin test: calculate also KtExpression/Declaration number 2019-02-06 11:59:02 +03:00
Mikhail Glukhikh
8dce8c1549 Make correct traverse in both FIR consistency tests 2019-02-06 11:59:01 +03:00
Mikhail Glukhikh
db2fb86c8e Raw FIR: implement expression trees & conversions from PSI
Testing: total kotlin test controls no stubs in FIR in non-stub-mode
#KT-29002 Fixed
2019-02-06 11:58:59 +03:00
Mikhail Glukhikh
aa97175d40 FIR generator: support type parameters with bounds for interfaces
This commits also reorders bridge visit functions
2019-02-06 11:58:58 +03:00
Toshiaki Kameyama
fa1f3871c0 Add "Redundant 'requireNotNull' or 'checkNotNull' call" inspection
#KT-29113 Fixed
2019-02-06 11:10:27 +03:00
Mikhail Glukhikh
c234683770 Fix changelog for 1.3.21 2019-02-06 11:03:13 +03:00
Mikhail Glukhikh
df0e2dd50a Fix for canBeResolvedViaImport: check isExtension earlier
This commit fixes mistake in d202e96e and fixes broken tests
Related to KT-29713
2019-02-06 10:59:53 +03:00
Georgy Bronnikov
ab1e334847 Reorganize phaser 2019-02-06 07:26:18 +03:00
Nikolay Krasko
89c5549b0a Refactoring: extract urls to separate class and remove long strings 2019-02-06 03:17:25 +03:00
shiraji
d3895c519c Display Quick Documentation for reserved words
#KT-9934 Fixed
2019-02-06 03:17:24 +03:00
Mikhail Glukhikh
53607ba8d4 Add changelog for 1.3.21 2019-02-05 20:02:58 +03:00
Mikhael Bogdanov
0ce4c9bf00 Upgrade proguard to 6.0.3 to avoid corrupted stack maps 2019-02-05 16:14:51 +01:00
Mikhael Bogdanov
b2606735c5 Properly capture local delegated properties in object constructor
#KT-23117 Fixed
2019-02-05 16:14:51 +01:00
Mikhael Bogdanov
9ab6062295 Properly capture extension receiver for array convention expressions in object constructor
#KT-19389 Fixed
2019-02-05 16:14:50 +01:00
Ilya Chernikov
3943bd1b15 Make toString for repl return function types nicer, drop obsolete isFunctionType 2019-02-05 16:13:06 +01:00
Ilya Chernikov
b7e1dd96b2 Supply proper classloader to the evaluator, add another test for function type
and some minor refactoring
2019-02-05 16:13:06 +01:00
Nikolay Krasko
aac9a3e953 Update since to 183.3283.2 as we already use API from it
Thanks to "Usage of Intellij API not available in older IDEs" inspection.
2019-02-05 16:54:34 +03:00
Nikolay Krasko
22a46d96c1 Update copyright in test module 2019-02-05 16:54:34 +03:00
Timo Obereder
ff4279762e Fix comment placement on if/else in if or when condition #KT-28224 Fixed 2019-02-05 14:07:28 +03:00
Mikhael Bogdanov
520679a2b4 Regenerate JS tests 2019-02-05 11:55:42 +01:00
Mikhail Glukhikh
d202e96ea1 Extract and use for inline KtSimpleNameExpression.canBeResolvedViaImport
Related to KT-29486
#KT-29713 Fixed
2019-02-05 13:32:33 +03:00
Mikhail Glukhikh
cccc6bf315 Redundant enum constructor invocation inspection: minor rename 2019-02-05 12:57:14 +03:00
Toshiaki Kameyama
7cba11ff28 Can be private: don't report if it's used in inline property
#KT-29085 Fixed
2019-02-05 11:34:08 +03:00
Toshiaki Kameyama
2a7eb2fb0e Redundant lambda arrow: do not report on nested lambda
#KT-29093 Fixed
2019-02-05 11:27:41 +03:00
Toshiaki Kameyama
bf7f7c81b1 Redundant explict type: do not report for aliased types
#KT-29128 Fixed
2019-02-05 11:24:32 +03:00
Toshiaki Kameyama
25952036af Reformat RedundantExplicitTypeInspection 2019-02-05 11:24:32 +03:00
Toshiaki Kameyama
b9d8466fc0 Replace rangeTo with until: fix false negative with parenthesized expression
#KT-29153 Fixed
2019-02-05 11:22:59 +03:00
Toshiaki Kameyama
c183f0285d Reformat ReplaceRangeToWithUntilInspection 2019-02-05 11:22:59 +03:00
Toshiaki Kameyama
9c468ef2aa Convert member to extension: preserve visibility
#KT-29248 Fixed
2019-02-05 11:22:02 +03:00
Toshiaki Kameyama
e8a8bc89c9 Add "Redundant enum constructor invocation" inspection
#KT-29321 Fixed
2019-02-05 11:16:01 +03:00
Mads Ager
542d3c3532 JVM_IR: Fix stack underflow for unit coercion of when expressions.
Code such as

```
val b = getBoolean()
if (b) 4
else if (b) 5
```

didn't generate a value on the stack always and therefore would
have control-flow paths leading to a pop instruction with nothing
on the stack.

Change-Id: I09d059f361e56a41880006e3f4e51e9acdbd167d
2019-02-05 08:52:18 +01:00
Mark Punzalan
e91a16556c JVM_IR: Do not add redundant field initializers.
Initializers are "set field" expressions and are considered redundant
when they are:
1. In the primary constructor; and
2. Set the field to `0`, `false`, or `null`; and
3. Have a `null` origin. I.e., not in an initializer block or
constructor body, and therefore the field could not have been set by a
prior expression.
2019-02-05 08:44:33 +01:00
kirill.shmakov
9e8972f1f9 Correct typo in comments 2019-02-04 14:30:37 +03:00
Mikhael Bogdanov
53aca0069c Update bootstrap version to 1.3.30-dev-1297 2019-02-04 09:04:44 +01:00
Kirill Shmakov
aafb8473e9 Correct typo 2019-02-04 10:00:43 +03:00
kirill.shmakov
566dac8599 Correct suppress directive 2019-02-04 09:48:03 +03:00
Nikolay Krasko
a75da632a6 Revert extension function in IndexUtils and better testing 2019-02-03 17:32:05 +03:00
Nikolay Krasko
c89bee624a Minor: remove DocumentAdapter usage 2019-02-03 17:32:05 +03:00
Nikolay Krasko
b8bbe10086 Support global inspections in tests (KT-29549)
#KT-29549 Fixed
2019-02-03 17:32:05 +03:00
Nikolay Krasko
56d56ab842 Make package name inspection global (KT-29549)
Report same package only once.

 #KT-29549 Fixed
2019-02-03 17:32:04 +03:00
Nikolay Krasko
6ee78fb629 Refactoring: extract name verifier code to settings class 2019-02-03 17:32:04 +03:00
Ilmir Usmanov
39de3c2ab1 Fix test data on JVM_IR BE 2019-02-01 21:45:44 +03:00
Ilmir Usmanov
20e4efaeab Fix test data 2019-02-01 17:33:49 +03:00
Vadim Brilyantov
4d68e08ab7 Change 191 idea version to 191.4738.6 2019-02-01 16:47:04 +03:00
Vadim Brilyantov
6a657714ec Move usage statistics to idea source root 2019-02-01 16:47:03 +03:00
Vadim Brilyantov
032a784d0b Implement statistics for the new API for intellij 191 2019-02-01 16:47:02 +03:00
Alexander Podkhalyuzin
495030ad9b Back to png icons in Android Studio
It's not support 16px @2x.svg icons yet, we need to wait for AS 3.4

#KT-29533 Fixed
2019-02-01 16:41:21 +03:00
kirill.shmakov
6c8b3d03fd Add syntax highlighting for *.def files 2019-02-01 16:34:00 +03:00
Alexander Udalov
8b286faa6a Workaround issue with unsupported report-cdata-event in XMLInputFactory on IBM JDK
#KT-29596 Fixed
2019-02-01 14:27:43 +01:00
Mikhail Glukhikh
bef0249347 UAST: do not analyze KtPsiFactory-created files #KT-29486 Fixed 2019-02-01 13:26:17 +03:00
Toshiaki Kameyama
bd467f39d6 Convert to scope function: Also convert call expression
#KT-28698 Fixed
2019-02-01 12:13:05 +03:00
Toshiaki Kameyama
f15c8f78fa Convert to scope function: refactor 2019-02-01 12:13:05 +03:00
Dmitriy Novozhilov
0501a108c0 Fix tests in DiagnosticsTestWithStdLibGenerated with NI 2019-02-01 11:40:20 +03:00
Toshiaki Kameyama
98810ba750 Add intention to replace snake-case test function name with a space-separated
#KT-27143 Fixed
2019-02-01 11:07:00 +03:00
Pavel V. Talanov
5226ea5cda Add missing bunch files
#KT-27769 Fixed
2019-01-31 17:38:05 +01:00
Ilya Gorbunov
bd2e00ae99 Exclude kotlin.native internal package from modular kotlin-stdlib
Otherwise jlink fails to consume this library due to Java keyword in
package name.

#KT-29612
2019-01-31 19:18:55 +03:00
Ilya Gorbunov
9c7a785d78 Add an integration test of using modular artifacts with jlink in JDK9
Setup maven plugin integration test execution with JDK9 as java home.
2019-01-31 19:18:55 +03:00
Toshiaki Kameyama
804e03379d Remove unused function parameter: do not propose for property setter parameter
#KT-29606 Fixed
2019-01-31 18:56:59 +03:00
Igor Chevdar
5b0d1bb6e4 Unmuted passing tests 2019-01-31 18:19:41 +03:00
Igor Chevdar
c257af31f4 Added test 2019-01-31 18:19:41 +03:00
Igor Chevdar
0ca28914a5 Minor changes in default arguments lowering
Calls to a function with default args can be not only
from function bodies, but for example from initializers
2019-01-31 18:19:40 +03:00
Igor Chevdar
9d84576021 Hack to help lowerings communisation in K/N
The hack breaks dependency LocalDeclarationsLowering —> CallableReferenceLowering
2019-01-31 18:19:40 +03:00
Igor Chevdar
07a576ec79 Supported enums in LocalDeclarationsLowering 2019-01-31 18:19:40 +03:00
Igor Chevdar
414899b482 Fixed copy/paste 2019-01-31 18:19:40 +03:00
Igor Chevdar
c765bd74d7 Made LateInitLowering the same in K/N as in other BEs 2019-01-31 18:19:39 +03:00
Alexander Udalov
db487a622a Add -Xsanitize-parentheses to workaround ASM 6.1 issue in frame computation
#KT-29475 Fixed
2019-01-31 15:47:43 +01:00
Dmitriy Novozhilov
dfb379d999 Expand Effect System with receiver values (#KT-28672)
Add some classes to hierarchy of `ESValue`:
- `ESReceiver` -- representation of receiver
  of lambda function
- `ESDataFlow` and `ESDataFlowReceiver` -- little refactoring of entities
  that holds information for DFA (description in comments in code).

Also add kdoc to classes of `ESValue` hierarchy
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
932e0234e7 Add testdata for issue #KT-28672 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
ba71bbde6a Extract InvocationKind class into separate file 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
44ae7a19e6 Reformat ContractSerializer.kt according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
b86ea7621c Cleanup code in PseudocodeTraverser 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
0e8c43f8c0 Generify key type parameter of ControlFlowInfo
Previously only `VariableDescriptor` was key of `ControlFlowInfo`.
Now it's generic parameter `K: Any`, so there is a possibility of using
  different object's inside CFA
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
efe891bb47 Remove duplicate of typealiases for javaslang collections 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
68d2cbf91f Extract classes used in control flow analysis of variable into variable package 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
1dd7365e9f Reformat some classes in org.jetbrains.kotlin.cfg according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
fa79f7bf30 Reformat ControlFlowProcessor according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
80835fe6ea Add ability to configure environment in AbstractLoadJavaTest
There is two methods added into `AbstractLoadJavaTest`:
- `configureEnvironment(KotlinCoreEnvironment environment)` allow to
  configure environment that will be used two compilation of source test
  data and loading generated `.class` files (e.g. you can register extensions)
- `getExtraClasspath()` allow to add custom libraries to classpath of
  compiler

Similar methods exists in `AbstractDiagnosticsTest`
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
68d7e51d32 Support test directive for rendering full diagnostic messages
New `RENDER_DIAGNOSTICS_MESSAGES` directive forces test system render
full messages for all diagnostics that found in test file
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
2866bd84a1 Reformat BaseDiagnosticTest according to code style 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov
047f9abaf7 Make order of rendered diagnostics more stable
There was a bug that sometimes diagnostics on the same element with
same names but with different parameters had been reshuffled.
2019-01-31 17:25:13 +03:00
Tor Norbye
a42406f2aa KT-29586: Add android.annotation annotations
KT-29586 Fixed
2019-01-31 17:12:56 +03:00
Pavel V. Talanov
f1f2d5b4d3 Change dsl marker gutter icon to use different colors
#KT-27769 Fixed
2019-01-31 14:06:10 +01:00
Ilya Matveev
6b14271931 Declare K/N platform libraries as files instead of modules
Earlier the K/N platform libraries were looked for in a local ivy
repository created on basis of a K/N compiler distribution. Such
an approach allowed correctly showing such dependencies in
IDEA using the "group:name:version" format (e.g.
"Kotlin/Native:Accounts:ios_arm64:1.1.1"). But it caused looking
for there libraries in all other declared repositories too
making IDE import slower (see KT-28128).

This patch declares these dependencies as files and gets rid of
the local repo to avoid this problem. The downside of this change
is less informative output in the IDE:
"Kotlin/Native:Accounts:ios_arm64:1.1.1" -> "Accounts".

Issue #KT-28128 Fixed
2019-01-31 19:32:26 +07:00
Ilya Matveev
88d35cb798 Don't embed bitcode for ios simulator 2019-01-31 19:32:26 +07:00
Sergey Igushkin
c5ce32653d Fix POM not rewritten correctly with custom artifact IDs (KT-29485)
When the plugin rewrites a POM, it establishes the mapping of the
original Maven coordinates to the modified ones. As one of the steps,
this requires finding the original Maven coordinates to rewrite – these
should be exactly the coordinates that Gradle writes to the POM.

In MPP, these are the coordinates of the 'root' (Gradle module metadata)
publication. If those are modified in the publication, the plugin relies
on delegating to the publication in the root module's SotwareComponent
(the only reasonable fallback is the project's name, and in this case
it obviously doesn't match the Maven artifact ID that was modified).

In 1.3.20, the publication delegate was never assigned. To fix the
issue, it is enough to correctly assign the publication delegate for the
root module's SoftwareComponent.

Issue #KT-29485 Fixed
2019-01-31 15:18:15 +03:00
Sergey Igushkin
55cc5e84fc Fix publishing dependencies of Android libraries (KT-29476)
* Add the extendsFrom relation between the Kotlin MPP compilation's
  configurations (`*Api`, `*Implementation`, `*RuntimeOnly`) and
  the Android variant's `*Elements` configurations, as those
  dependencies currently are not added to the Android source sets and
  are thus missing from the published dependencies.

* Fix a `this is KotlinCompilationToRunnableFiles` check that
  mistakenly referenced the Project receiver of `whenEvaluated { ... }`

Issue #KT-29476 Fixed
2019-01-31 15:16:06 +03:00
Nikolay Krasko
64b2527e31 Revert allowing upper case letters in packages (KT-27900) 2019-01-31 13:40:37 +03:00
Nikolay Krasko
726e18333d Fix infinite recursion during indexing types (EA-86494) 2019-01-31 12:39:08 +03:00
Nikolay Krasko
d95189281d Regenerate AddImportTestGenerated 2019-01-31 12:39:08 +03:00
Dmitry Savvinov
4694a7963b Allow actuals with more permissive visibility
Allow non-virtual expects to have actuals with more permissive
visibility.

^KT-19664 Fixed
2019-01-31 12:29:27 +03:00
Dmitry Savvinov
0338753c11 Add test on actual with more permissive visibility
Currently the behaviour is undesired, see KT-19664. The next commit
fixes it.
2019-01-31 12:26:58 +03:00
Mikhael Bogdanov
a122cba862 Switch Kotlin project to jvm-target 1.8
#KT-29405
2019-01-31 07:43:05 +01:00
Georgy Bronnikov
3e9c290a3a Remove references to invisible fakes from IR backend 2019-01-31 07:55:39 +03:00
Georgy Bronnikov
ee43b5f1e9 IR. Do not generate invisible fakes 2019-01-31 07:55:39 +03:00
Leonid Startsev
8eeb9d4faa [kx.serialization] Fix serializer resolving for file-level annotations:
Instantiating ContextSerializer for primitives with boxing (fixes https://github.com/Kotlin/kotlinx.serialization/issues/349)
Unwrap nullable type when looking for general-defined serializer (fixes https://github.com/Kotlin/kotlinx.serialization/issues/351)

Add lost java collection types and fix annotation name (fixes https://github.com/Kotlin/kotlinx.serialization/issues/343)
2019-01-30 19:42:08 +03:00
Mikhail Zarechenskiy
738271aba6 Refactoring: rename CheckArguments -> CheckArgumentsInParenthesis 2019-01-30 14:56:33 +03:00
Mikhail Zarechenskiy
6705803d83 [NI] Fix coercion to Unit for lambdas with empty labeled return 2019-01-30 14:56:31 +03:00
Mikhail Zarechenskiy
147d7844bc [NI] Dont' add trivial constraints with Nothing from incorporation
#KT-24490 Fixed
 #KT-26816 Fixed
2019-01-30 13:48:33 +03:00
Mikhail Zarechenskiy
662e2287cc [NI] Discriminate resulting type Nothing(?) at fixation stage 2019-01-30 13:48:28 +03:00
Mikhail Zarechenskiy
0b0e335cdd [NI] Discriminate constraints with Nothing(?) lower bounds 2019-01-30 13:44:48 +03:00
Nicolay Mitropolsky
dcbd441814 Uast: aligning bunches after moving all convert* methods to KotlinConverter in 191 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
b45172a7f8 191: Uast: support convertToAlternatives for KtFile 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
4df72b4f79 191: Uast: refactoring: all convert* methods were moved to KotlinConverter 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
28e19ed8c7 191: Uast: AlternativesRenderLogTest introduced 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
8ad06314f0 191: Uast: support convertToAlternatives for KtClassOrObject 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
9e2358e8ff 191: Uast: support convertToAlternatives for KtParameter 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
f4c51dc6d0 191: Uast: support convertToAlternatives for KtProperty 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
114c3be632 191: Uast: KtParameter can be converted to field 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
529d0b8326 191: Uast: initial support for multiple required types 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
731956db71 191: Uast: UInjectionHost moved under flag kotlin.uast.force.uinjectionhost (KT-27283) 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
9ecd69760b 191: Revert KotlinStringTemplateUPolyadicExpression implement UInjectionHost testdata changes 2019-01-30 12:42:37 +03:00
Nicolay Mitropolsky
56dfde0428 191: Uast: making KotlinStringTemplateUPolyadicExpression implement UInjectionHost (KT-27283) 2019-01-30 12:35:17 +03:00
victor.petukhov
6f04deff0e Remove old grammar files
The new grammar is located in the Kotlin spec repo: https://github.com/JetBrains/kotlin-spec/tree/spec-rework/src/grammar
2019-01-30 11:48:01 +03:00
kenji tomita
cbf6aa4ac3 Fix #KT-29567 "Remove empty class body" is a poor name for inspection text 2019-01-30 09:53:16 +03:00
Nikolay Krasko
52c46811ff Enable JPS test runner for new JPS build (KT-29368)
#KT-29368 Fixed
2019-01-30 01:13:23 +03:00
Svyatoslav Kuzmich
c9e2ed4e1f Undo unnecessary changes to stdlib
Partially revert "[stdlib] Reduce usage of extension functions"
2019-01-29 19:06:32 +03:00
Svyatoslav Kuzmich
0ef4194770 [JS IR BE] Support String companion object 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
24ab36616e [JS] Fix runtime file order in runIrTestInNode.js 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
b239c80531 [JS IR BE] Add a few kotlin.test stubs to IR runtime 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
b49ec3edb8 Disable generation of 1.2 coroutine tests for JS_IR
Add directive DONT_TARGET_EXACT_BACKEND.
This directive is needed to exclude JS_IR backned but keep "compatible"
JS backend.
2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich
ab3eb06a62 [JS IR BE] Fix lowering Long comprising operators 2019-01-29 19:06:31 +03:00
Mikhail Zarechenskiy
5bcd974944 Temporary remove failing test for new inference about SAM conversions
Currently, it's easier to remove test completely rather than mute it
 somehow as it throws exception at compile-time

 #KT-29561 Open
2019-01-29 17:24:49 +03:00
Ilya Chernikov
f125600af1 Restore returning of functional types from repl eval
add tests for the broken case as well for the return value representation
#KT-29490 fixed
2019-01-29 15:05:37 +01:00
Mads Ager
52464fd103 JVM_IR: do not generate line number info for temporary loads.
Loads from compiler-introduces temporary variables to do not
correspond to loads in user code.
2019-01-29 14:25:17 +01:00
Anton Bannykh
b1f6a05aa0 JS: fix incremental suspend inline test (KT-29360 fixed) 2019-01-29 13:16:39 +03:00
Anton Bannykh
5c7072ec44 JS: add incremental suspend inline test 2019-01-29 13:16:39 +03:00
Nicolay Mitropolsky
aa88e579a6 Uast: checking that element is valid before running into resolve
probably will fix EA-134193
2019-01-29 11:05:27 +03:00
Dmitriy Dolovov
e59a5de314 CLion: New version 2018.3.3 (183.5153.40) 2019-01-29 09:23:50 +07:00
Alexey Tsvetkov
1103ca3a38 Fix logging in workers
Setting `forkMode` to `ForkMode.NEVER` switches
`isolationMode` to `IsolationMode.CLASSLOADER`.
Classloader isolation mode prevented passing task's
logger to the unit of work.
Also it might resulted in multiple daemon instances starting
in parallel.

This change removes setting `forMode` (it was unnecessary).
Also a logger is used for the fallback message instead of printing it
to stderr. An assertion is added to tests, ensuring that
the fallback does not happen.

    #KT-29394 Fixed
2019-01-28 21:33:22 +03:00
Mads Ager
bb0cd92da0 JVM_IR: Fix codegeneration for missing branches.
This used to generate an ACONST_NULL instruction leading to incorrect
stack height for code such as:

```
if (condition) else 32
```
2019-01-28 15:41:48 +01:00
Alexander Udalov
37a149b218 Allow to specify builtInsModule for DefaultBuiltIns
Similarly to JvmBuiltIns, this will be needed to load built-ins from
compilation dependencies rather than the compiler class loader
2019-01-28 15:18:53 +01:00
Alexander Udalov
f2bf0dc236 Drop unneeded synthetic package fragment construction from KotlinBuiltIns
Instead use package views of builtInsModule
2019-01-28 15:18:52 +01:00
Alexander Udalov
e19c6ce23c Use KotlinBuiltIns.getBuiltInsPackageScope instead of getBuiltInsPackageFragment
In general case, the module where built-ins are looked up
(builtInsModule) can have multiple package fragments corresponding to
the package "kotlin". Remove the misleading method
getBuiltInsPackageFragment along with its implementation details and use
the package view's scope instead (by changing
KotlinBuiltIns.getBuiltInsPackageScope), since it'll iterate over all
fragments accessible in the module and its dependencies.

The only difference between scopes of package fragment and package view
is that the latter also contains package views for subpackages, which is
why the change in BuiltInsReferenceResolverTest is necessary
2019-01-28 15:18:52 +01:00
Alexander Udalov
a419112c25 Refactor class lookup methods in KotlinBuiltIns
Remove external usages of get*Nullable methods, inline/remove other
methods to simplify the API facade
2019-01-28 15:18:52 +01:00
Alexander Udalov
aa8938cc1b Minor, cleanup KotlinBuiltIns
Remove unused code, fix inspections
2019-01-28 15:18:52 +01:00
Alexander Udalov
4a7bd9467c Remove obsolete BuiltInsInitializer
JvmBuiltIns do not use it for a long time already and work fine. It
seems that other implementations do not need it either
2019-01-28 15:18:52 +01:00
Alexander Udalov
6cd3d9f19a Do not use DefaultBuiltIns.Instance in ESConstant
Add ESComponents and ESConstants to encapsulate usages of built-ins in
different functors and operators
2019-01-28 15:18:52 +01:00
Alexander Udalov
9516d6e89b Do not use DefaultBuiltIns in contracts
Default built-ins represent built-ins loaded from the compiler jar via
class loader, and they may not be equivalent to the built-ins present in
the standard library that is used in compilation dependencies, in case
the compiler and stdlib versions do not match. Use built-ins from the
given module instead.

This commit deals with more-or-less obvious usages of DefaultBuiltIns;
next commits refactor the ESConstant values and related code to support
injected built-ins
2019-01-28 15:18:52 +01:00
Alexander Udalov
7561502956 Refactor AndFunctor/OrFunction: do not use strictPartition
Instead use a filter with a simple check. This seems to be slightly
better both for readability (`strictPartition` gave an impression that
two its parameters were related in some way, but they were totally
independent) and for performance (do not create unnecessary objects,
instead decompose the existing objects and check their structure)
2019-01-28 15:18:52 +01:00
Alexander Udalov
07931451b1 Add utilities to check if ESValue is boolean/wildcard constant 2019-01-28 15:18:51 +01:00
Alexander Udalov
cf19fa832c Add utility to check if effect is ESReturns
Somewhat simplify related code in AbstractBinaryFunctor and
AbstractUnaryFunctor
2019-01-28 15:18:51 +01:00
Vadim Brilyantov
de22c133c7 Fix redundant statistics extensions in plugin-common.xml 2019-01-28 17:17:46 +03:00
Mikhail Glukhikh
04bd5139d5 Don't suggest "return type is..." inspections for anonymous functions
#KT-29290 Fixed
2019-01-28 16:03:55 +03:00
Ilya Chernikov
4f9e844735 Improve standard libs search logic for script compilation:
- refactor appropriate functions to accept optional classloader (not used yet)
- try to load from thread context classloader first
- fallback to marker class classloader in the appropriate function
2019-01-28 13:15:36 +01:00
Ilya Chernikov
95d782b6ca Implement diagnostics for ignored compiler arguments on script compilation 2019-01-28 13:15:36 +01:00
Ilya Chernikov
7ee9801c5f Implement additional compiler arguments support in scripts 2019-01-28 13:15:36 +01:00
Ilya Chernikov
04b04ea0ee Refactor compiler arguments to configuration conversion:
extract into independent functions, rearrange logic
2019-01-28 13:15:36 +01:00
Ilya Chernikov
298aaf999e [minor] fix function name typo 2019-01-28 13:15:36 +01:00
Ilya Chernikov
d5d60cbc6b Convert CliCompiler class to Kotlin 2019-01-28 13:15:35 +01:00
Ilya Chernikov
025d2d1b66 Rename .java to .kt 2019-01-28 13:15:35 +01:00
Sergey Rostov
f5b7b5990f Build: fix PILL for JPS build. 2019-01-28 13:43:09 +03:00
Sergey Rostov
30cc70d4c3 JPS build: move idea configuration to separate script 2019-01-28 13:43:09 +03:00
Sergey Rostov
46d616641f JPS build workarounds for gradle import 2019-01-28 13:43:08 +03:00
Sergey Rostov
ca47247e5d Build: got rid of useBootstrapStdlib flag (replaced with jpsBuild flag) 2019-01-28 13:43:08 +03:00
Sergey Rostov
82e56f9cdd Build: fail on attempt to include anntations.jar from intellij 2019-01-28 13:43:08 +03:00
Sergey Rostov
f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Sergey Rostov
78630fec41 Build: add annotations-13.0.jar to compilerManifestClassPath
This is required since intellijCore/annotations.jar was removed from
koltin-compiler.jar
2019-01-28 13:43:08 +03:00
Sergey Rostov
0f2fb4ff82 Build: remove intellijCore/annotations.jar usages 2019-01-28 13:43:08 +03:00
Sergey Rostov
c716ef112e Got rid of @TestOnly usages on fields 2019-01-28 13:43:08 +03:00
Sergey Rostov
efa3201a68 JPS build: add dependencies to stdlib 2019-01-28 13:43:08 +03:00
Sergey Rostov
e8e2a5b047 Build: update pill comments in build scripts to distinguish from JPS 2019-01-28 13:43:07 +03:00
Sergey Rostov
2dad03f817 JPS Build: Temporary solution for creating IDEA artifacts settings
This script traverses all Gradle copy task, build virtual files model
and generates IDEA artifacts configuration based on this. Unfortunately
this is not fully working and needs manual fixing, so the actual artifacts
configurations are commited by hand for now. By the way, this script also
visits copy task's internals which leads that Gradle generates
manifests in `build` folders during IDEA import. This files are referenced
in artifacts configurations. So, despite the fact that artifacts
configurations created by this script is not used, we need to run them
to generate required manifests.

This solution will be replaced with DSL that produces both Gradle
copy tasks and IDEA artifacts configuration which is coming soon.
2019-01-28 13:43:07 +03:00
Sergey Rostov
d81f9dc24d JPS build: artifacts 2019-01-28 13:43:07 +03:00
Sergey Rostov
9fa8a80c6c JPS build: add JUnit run configuration and defaults
#KT-29335 Fixed
#KT-29211 Fixed
2019-01-28 13:43:07 +03:00
Sergey Rostov
f2fd28e84f JPS build: add idea settings to build.gradle.kts
#KT-29323 Fixed
2019-01-28 13:43:07 +03:00
Sergey Rostov
21ae6e272d Build utils: Kotlin DSL for idea-ext plugin 2019-01-28 13:43:07 +03:00
Sergey Rostov
12cfd6396d JPS build flag: exclude java9 when jps build enabled 2019-01-28 13:43:07 +03:00
Sergey Rostov
1031edc933 JPS build flag: exclude modules that we are currently cannot compile with jps 2019-01-28 13:43:07 +03:00
Nikolay Krasko
4b3ff05af4 Fix several problems with bunch file synchronize in plugin-common
Drop plugin-common bunches.
2019-01-28 13:30:29 +03:00
Vyacheslav Gerasimov
b78627f572 Build: Merge sources to single jar (idea can't handle multiple) 2019-01-28 01:27:53 +03:00
Svyatoslav Kuzmich
75328f26ea [JS IR BE] Add missing KJS_WITH_FULL_RUNTIME to some tests
+ ranges test generator
2019-01-27 01:14:51 +03:00
Mikhael Bogdanov
ac7517dd76 Minor. Reformat 2019-01-26 08:26:50 +01:00
Mikhael Bogdanov
f2a51d3b80 Support reflection tests on Android 2019-01-26 08:26:49 +01:00
Burak Eregar
91980c5293 KT-27869: Make Java to Kotlin dialog show yes/no button according to it's question
* Change `showOkCancelDialog` to `showYesNoDialog`
 #KT-27869 Fixed
2019-01-25 18:53:35 +03:00
Nicolay Mitropolsky
ef48373109 191: Update intellijSdk=191.4212.41 2019-01-25 18:34:49 +03:00
Mikhail Glukhikh
10b6ab949e Explanation for BaseTransformedType 2019-01-25 18:05:09 +03:00
Mikhail Glukhikh
dbdc57769b Explanation for VisitedSupertype 2019-01-25 18:05:09 +03:00
Simon Ogorodnik
dcd41bd26f FIR: Add test for total kotlin resolve #KT-24077 Fixed 2019-01-25 18:05:08 +03:00
Mikhail Glukhikh
619bddfdbc FIR: handle recursion in super-types correctly
Related to KT-24077
2019-01-25 18:05:08 +03:00
Alexander Udalov
a2f4efbc2a Report error on state in multi-file class with -Xmultifile-parts-inherit
Simplify MultifileClassPartCodegen, remove related tests and change some
tests to use const val instead of val because backing fields for const
properties are stored in the facade, not parts

 #KT-23701 Fixed
2019-01-25 15:57:13 +01:00
Alexander Udalov
6b5a16884c Refactor inheritMultifileParts to be a JVM analysis flag
Instead of a JVMConfigurationKeys key. This will allow to use it in a
checker in 'frontend.java'
2019-01-25 15:57:13 +01:00
Roman Artemev
f3758771c9 Update tests 2019-01-25 17:17:16 +03:00
Roman Artemev
fd9a72b627 [JS IR BE] Fix traits super calls 2019-01-25 17:17:16 +03:00
Dmitriy Novozhilov
af964d56c7 Fix testdata with new inference after fix in 65e6e21 2019-01-25 15:59:57 +03:00
Alexander Podkhalyuzin
4f4099796d Use 16px logo instead of 13px for run configurations 2019-01-25 14:33:13 +03:00
Alexander Podkhalyuzin
63cec94dbc Cleanup after review 2019-01-25 14:33:13 +03:00
Alexander Podkhalyuzin
4c674ae27a Updated icons to svg version. 2019-01-25 14:33:13 +03:00
Toshiaki Kameyama
fe006cf342 Boolean literal arguments: do not report in batch (offline) mode with INFORMATION severity
#KT-29494 Fixed
2019-01-25 14:25:38 +03:00
Max Medvedev
6f95030fe4 Don't perform potentially long operation in FindImplicitNothingAction#update
#KT-29457 fixed
2019-01-25 12:49:17 +03:00
Alexander Udalov
38fd2b9ed6 Fix reflection-related codegen tests on JDK 9+
In JDK 9, Class.simpleName changed behavior for local/anonymous Kotlin
classes (see KT-23072), this is why we now check for both variants of
the name in tests. Also, the format of annotation arguments changed a
little, where float parameters no longer have the trailing "f", and
class literals are rendered with ".class" at the end
2019-01-25 10:14:25 +01:00
Nicolay Mitropolsky
795f9d83e1 191: Uast: implementation of UReferenceExpression.referenceNameElement (KT-29025) 2019-01-25 11:13:43 +03:00
Nicolay Mitropolsky
a3ea7bcd3b Uast: property resolve arrayOf in nested annotations (KT-29434) 2019-01-25 11:10:59 +03:00
Toshiaki Kameyama
4ffeff5e6c Redundant lambda arrow: do not report on type parameter
#KT-28131 Fixed
2019-01-25 10:53:04 +03:00
Svyatoslav Kuzmich
8fbf1ed683 [JS IR BE] Unmute tests 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
2818d3767e [JS IR BE] Covert Char into inline class 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
a5f537adc5 [JS IR BE] Implement *Array.plus(Collection<>) in typed Kotlin without dynamic helper 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
8c89ffbe2d [JS IR BE] Load builtins from code to runtime
Bypass builtins deserialization mechanism in legacy JS backend and load
bultins direcly as kotlin code.

This way we won't have separated IR declarations for Enum, Char, Long

Some "native" builtins are implemented in libraries/stdlib/js/irRuntime/builtins/
Other builtins are moved by MoveExternalDeclarationsToSeparatePlace and
used only in compile-time
2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich
7e263fd68e Allow primitive types to be vararg elements disregarding their inline class status 2019-01-24 18:58:51 +03:00
Nikolay Krasko
80f1efaddc Dispose range markers in UI thread to prevent race condition at getting range (KT-28870)
#KT-28870 Fixed
2019-01-24 17:05:56 +03:00
Nikolay Krasko
f19f38a4db Rework "lambda return expression" hint (KT-28870)
Move the hint to the end of the line, to avoid breaking indentation.

Also use `EditorLinePainter` API for painting to prevent problems with
typing at the line end, when caret is placed after the hint
(See IDEA-204702 for implementing such hints in platform).

 #KT-28870 Fixed
2019-01-24 17:05:55 +03:00
Nikolay Krasko
547357baa1 Don't check intentions without categories for description presence 2019-01-24 17:05:55 +03:00
Nikolay Krasko
a41dcd2af2 Fix NPE in coverage (EA-134461) 2019-01-24 17:05:55 +03:00
Svyatoslav Kuzmich
29eb3c745c [JS IR BE] Support two versions of test runtime: full and reduced 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
a40448aebc [JS IR BE] Use unsigned types lowering lazily 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
eea7e85d3a [stdlib] Reduce usage of extension functions 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich
aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Felix Guo
185d0c6165 Remove unnecessary constructor keyword intention (KT-29143)
#KT-29143 Fixed
2019-01-24 14:32:21 +03:00
Roman Artemev
c10eadfa77 Add 1.3.20 Changelog 2019-01-24 14:12:09 +03:00
Alexander Podkhalyuzin
5aa7216c13 Rewritten resolving conflicting imports on adding new import with star action (KT-18503)
#KT-18503 Fixed
2019-01-24 11:40:25 +03:00
Nikolay Krasko
ed5051a5e3 Fix exception in imports folding when there're two imports lists (KT-29455)
Probably caused by modifications of the recovery for import lists
65e6e21d0f

 #KT-29455 Fixed
2019-01-24 11:23:47 +03:00
Nikolay Krasko
92a50b2880 Minor: explicitly use FULL mode for resolve, tests are falling otherwise 2019-01-24 11:23:46 +03:00
Nikolay Krasko
a0b8980d77 Show lambda exist points when cursor is at the correspondent call (KT-29381)
#KT-29381 Fixed
2019-01-24 11:23:46 +03:00
Mikhail Glukhikh
5ec7643b5a Fix two QF tests (new add underscores action, KT-28953) 2019-01-24 11:00:59 +03:00
Toshiaki Kameyama
7cad0052d9 "Add parameter to constructor": fix for enum entry
#KT-28995 Fixed
#KT-29051 Fixed
#KT-29052 Fixed
2019-01-24 11:00:59 +03:00
Dmitriy Novozhilov
2c74796b0b Fix detecting upper bounds of generics of typealiases constructors in NI 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
21f0557502 Fix compatibility of CapturedTypeConstructor and NewCapturedTypeConstructor
Now both of those classes implements one interface with `TypeProjection`
  property. That allows old captured type approximator use new captured types.

That change fixes tests related to diagnostics:
- SETTER_PROJECTED_OUT
- DEBUG_INFO_UNRESOLVED_WITH_TARGET
- UNRESOLVED_REFERENCE_WRONG_RECEIVER

Also `typeProjection` property renamed to `projection` according to naming in NI.
2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
42b333f6fd Update some testdata according to new inference behaviour 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
667f5032b6 Minor: reformat CapturedTypeConstructor.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
53432eaf99 Minor: reformat CapturedTypeApproximation.kt according to code style 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
2da3366a47 Fix PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL diagnostic in new inference 2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
090c2998d2 Add running additional receiver checkers in new inference
That commit fix next diagnostics:

* RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS
* NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS (partially, see #KT-29367)
2019-01-24 10:53:58 +03:00
Dmitriy Novozhilov
7f48897e21 Add NON_VARARG_SPREAD and SPREAD_OF_NULLABLE diagnostics to new inference 2019-01-24 10:53:58 +03:00
Toshiaki Kameyama
622fd8d8cf Add intention to add/remove underscores in numeric literal
#KT-28953 Fixed
2019-01-24 09:52:21 +03:00
Toshiaki Kameyama
225a6ea288 Convert parameter to receiver: don't remove 'override' and 'vararg' when function has 'vararg' parameter
#KT-28851 Fixed
2019-01-24 09:49:53 +03:00
Toshiaki Kameyama
de7adf55ff Non-canonical modifiers order: do not highlight annotation
#KT-29238 Fixed
2019-01-24 09:47:54 +03:00
Toshiaki Kameyama
0075e90042 Convert to lambda: report at INFORMATION level if anonymous object super type does not match function parameter type exactly
#KT-28081 Fixed
2019-01-24 09:42:16 +03:00
Toshiaki Kameyama
3649e61c2f Boolean literal arguments: do not report for varargs parameters
#KT-29469 Fixed
2019-01-24 09:40:21 +03:00
Alexey Tsvetkov
8672d2adc0 Remove call to await after kapt work is submitted
Await blocks parallel execution within a project.
Since there are no actions in the task after
`await()`, it is safe to delete the call.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
5a6df10522 Measure time spent on backing up and restoring outputs 2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
beabbb95db Enable assertions for Kotlin daemon in Gradle tests 2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
9176f9b254 Fix clearing IC caches on rebuild
Previously IC caches in Gradle were not cleared correctly on rebuild,
because only `clean` method was called, but `flush` and `close`
were not.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
7dcdba7e1a Restore outputs when Kotlin task fails
#KT-12295 Fixed

Gradle forces non-incremetnal builds,
when a task failed, but its outputs were changed.
This is an issue for Kotlin incremental compilation,
because it also forces all dependent modules to be rebuilt.
This change fixes the issue by reading all output and
restoring it on a compile error/exception.
This change does not affect non-incremental builds.
2019-01-23 23:30:28 +03:00
Alexey Tsvetkov
467090bd9e Don't override task action in KaptGenerateStubsTask 2019-01-23 23:30:28 +03:00
Mikhail Glukhikh
f782f26c4f ClassClsStubBuilder: do not report errors for nested stubs
We log differently case with obfuscated library (KT-29427)
and regular case (KT-9618 and others)

#KT-29427 Fixed
#KT-9618 Fixed
2019-01-23 18:42:58 +03:00
Denis Zharkov
ae9cd4aa55 Require JVM_TARGET=1.8 in test that depends on the method from JDK8 2019-01-23 18:25:10 +03:00
Mads Ager
fb6eafddf1 JVM_IR: Generate better code for null checks.
Simplify ifs when branches have condition true/false.

Simplify blocks containing only a variable declaration
and a variable get of the same variable. Simplify to
just the condition.

Do not introduce temporary variables for constants for
null checks. Constants have no side-effects and can be
reloaded freely instead of going through a local.

This simplifies code such as "42.toLong()!!" so that the
resulting code has no branches and uses no locals. The
simplifications happen as follows:

```
block
  temp = 42.toLong()
  when
    (temp == null) throw NPE
    (true) load temp

---> null test simplification

block
  temp = 42.toLong()
  when
    (false) throw NPE
    (true) load temp

---> when simplification

block
  temp = 42.toLong()
  load temp

---> block simplification

42.toLong()
```
2019-01-23 15:11:14 +01:00
Vadim Brilyantov
d8309f3bd7 Remove statistics extension points for 182 and 191 bunches 2019-01-23 10:49:56 +03:00
Natalia Selezneva
85bd729715 Fix NPE starting IDE Repl Console
consoleView field is initialized in initAndRun inside invokeLaterIfNeeded call.
This may cause NPE in setupGutters if consoleView isn't initialized yet
^KT-29400 Fixed
2019-01-23 10:39:18 +03:00
Nikolay Krasko
0548454581 Minor: clean warnings in KotlinTypedHandler 2019-01-22 17:07:58 +03:00
Nikolay Krasko
5587af95de Auto-close {}` before identifiers in string only after typed '$' (KT-11143)
#KT-11143 Fixed
2019-01-22 17:07:58 +03:00
Yaroslav Ulanovych
30c2b26339 Do not insert closing brace for string template between open brace and identifier (KT-11143)
#KT-11143 Fixed
2019-01-22 17:07:57 +03:00
Nicolay Mitropolsky
44926df47e DelegatingProgressIndicator.setModalityProgress param made nullable in 191 2019-01-22 16:22:04 +03:00
Dmitry Petrov
ae8a90f7b4 KT-29144 Interface companion object field should always be ACC_PUBLIC 2019-01-22 15:05:51 +03:00
Dmitry Petrov
129ea49d64 Use effective modality for enum class in JVM_IR 2019-01-22 10:52:54 +03:00
Dmitry Petrov
360bfcaf6a KT-29340 Provide effective modality for enum class in IR
* if enum class has abstract members, then it is ABSTRACT
* otherwise, if enum class has entries with members, then it is OPEN
* otherwise, it is FINAL.
2019-01-22 10:52:54 +03:00
Denis Zharkov
efdb4e1d5d Fix assertion caused by wrong equality of DescriptorBasedFunctionHandleForJvm
In case of the same class defined in different modules they contain
different descriptors instances in their scope that might lead
to failing assertion in findConcreteSuperDeclaration
because there are overridden from different modules

It might happen even in the compiler because of different built-in modules
defined for sources-module and for dependencies' one

^KT-29320 Fixed
2019-01-22 09:48:42 +03:00
Vyacheslav Gerasimov
168d2d8cce Add more accept android sdk license hashes 2019-01-22 00:16:24 +03:00
Alexey Tsvetkov
12e481192a Don't use project root as working directory for Kotlin daemon
On windows using a project's root
as a working directory for the daemon
seems to prevent removing the directory
when the daemon runs.

Different projects may share an instance of the daemon,
so the issue will be present only in a project
which started the daemon.
2019-01-21 22:42:55 +03:00
Vyacheslav Gerasimov
f58acbeef5 Build: implement useBootstrapStdlib flag
Excludes stdlib projects from build and uses bootstrap stdlib artifacts

 #KT-29205
2019-01-21 21:09:40 +03:00
Vyacheslav Gerasimov
9973446e02 Update bootstrap to 1.3.30-dev-991 2019-01-21 21:09:40 +03:00
Alexander Udalov
4daee6d282 Extract JVM IR backend module out of compiler/backend
The old backend does not depend on IR modules anymore
2019-01-21 19:06:41 +01:00
Yan Zhulanow
ad974137b8 Remove Android Extensions from the default JPS classpath 2019-01-21 18:50:11 +03:00
Vyacheslav Gerasimov
f30a14ff0f as34: Set until-build to 183.* to support AS 3.4 Beta 2 2019-01-21 18:05:52 +03:00
Vyacheslav Gerasimov
082217a2bd Build: Publish internal maven artifact for jvm-minimal-for-test
#KT-29204
2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
1ba80adc7f Build: Publish internal maven artifact for builtins
#KT-29204
2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
46d9d5456f Build: Change builtins artifact configuration to default 2019-01-21 17:01:43 +03:00
Vyacheslav Gerasimov
0d8c779190 Build: Change builtins serialization task output directory to local 2019-01-21 17:01:43 +03:00
Mikhail Glukhikh
8201756a4c Use correct project for settings.gradle manipulations #KT-29333 Fixed
Otherwise we get an error "Element from alien project".
See details in added comment.
2019-01-21 14:30:44 +03:00
Mikhael Bogdanov
f10c9206e2 Minor. Fix test data 2019-01-21 12:12:34 +01:00
Mikhael Bogdanov
b763104ca0 Fix package name to fix android tests 2019-01-21 11:21:16 +01:00
Dmitry Petrov
202e992ae3 psi2ir: handle 'this' as reference to a super companion object
In super class constructor arguments, 'this' can be resolved
as a reference to a companion object of a superclass.
This breaks an assumption in psi2ir that 'this' can only refer to some
receiver from the current scope.

If 'this' refers to an 'object' (including 'companion obejct'),
and we are not inside the corresponding class scope,
then 'this' represents a reference to a singleton instance "by name"
(represented as IrGetObjectValue).
2019-01-21 10:56:02 +03:00
Nicolay Mitropolsky
9c8188002d 191: ProjectScopeStatsReporters.kt: adding KotlinMavenTargetTrigger and KotlinJPSTargetTrigger to the bunch 2019-01-19 12:06:42 +03:00
Mads Ager
690b8e0ac9 JVM_IR: Optimize null checks.
Introduce lowering to remove null checks for primitive type
expressions and replace them with true/false. Side-effects
are preserved.

Generate ifnull/ifnonnull instructions for null checks instead
of materializing a null literal for an equality check.
2019-01-19 09:43:43 +01:00
Vadim Brilyantov
f5312f42c5 Collect Maven and JPS targets 2019-01-19 02:37:09 +03:00
Vyacheslav Gerasimov
04b705ef2c 183: Set until-build to 183.*
We have separate plugin for 191 now
2019-01-18 22:52:57 +03:00
Vyacheslav Gerasimov
ff34078663 191: Temporary drop ProjectScopeStatsReporters (apis heavily refactored) 2019-01-18 21:52:45 +03:00
Ilya Chernikov
877dd7ee47 Change default jvmTarget for scripts compilation via jvmhost to 1.8
#KT-29319 fixed
2019-01-18 18:17:47 +01:00
Ilya Chernikov
a6c90f13c2 Implement test for #KT-29301, #KT-29296 and #KT-29293 2019-01-18 18:17:46 +01:00
Ilya Chernikov
5fffeda534 Keep ivy resolvers in the main-kts.jar
#KT-29301 fixed
2019-01-18 18:17:45 +01:00
Ilya Chernikov
2bb5e8f51f Implement and use helpers for economical classpath update in script configs 2019-01-18 18:17:45 +01:00
Ilya Chernikov
c7e5ad861c Allow explicit nulls for props with default, allow null as base classloader for evaluation
and use proper default evaluation configuration if not supplied explicitly;
also add reset method to the properties builder and containsKey method to
the properties collection
#KT-29296 fixed
2019-01-18 18:17:44 +01:00
Ilya Chernikov
086c4fd5b9 Add stdlib, etc. to the script dependencies on compilation
#KT-29293 fixed
2019-01-18 18:17:44 +01:00
Vyacheslav Gerasimov
cf5657e916 as34: Limit AS 3.4 until-build to be lesser than AS 3.5 2019-01-18 20:09:10 +03:00
Vyacheslav Gerasimov
b2db027ded Add constant for AS 3.5 to IdeCompatibilityDsl 2019-01-18 20:09:10 +03:00
Vyacheslav Gerasimov
7aee03a2b0 as35: Set since build to AS 3.5 C1 build number 2019-01-18 20:09:09 +03:00
Vyacheslav Gerasimov
9a4a4d0c14 as35: Add bunch files for AS 3.5 2019-01-18 20:09:09 +03:00
Nikolay Krasko
ad3114aa5f Allow generate closed start tags and do not reorder specific tags 2019-01-18 19:42:44 +03:00
Nikolay Krasko
3548d25095 Introduce wrapper for EditorFactoryListener to warn about compatibility issues 2019-01-18 19:42:43 +03:00
Nikolay Krasko
74bc440e44 Remove all that left from 173 branch 2019-01-18 19:42:43 +03:00
Nikolay Krasko
046a0e059c Always add last version of idea for which change is needed to BUNCH
BUNCH directive should contain last idea IDEA version this change is
meant for.
2019-01-18 19:42:43 +03:00
Alexander Podkhalyuzin
36b2640ab7 Removed usages to deprecated API, which is going to be removed in 2019.1 2019-01-18 17:17:30 +03:00
Natalia Selezneva
76b06cd747 Scratch: associate inlay with preceding text
This allow to avoid some unintentional movements of caret after inserting scratch output
2019-01-18 16:04:53 +03:00
Natalia Selezneva
290ae16235 Scratch: implement interactive mode
^KT-27955 Fixed
2019-01-18 16:04:53 +03:00
Max Medvedev
9b0b3971e4 Wrong position of type hint while renaming Kotlin variable
#KT-19558 fixed
2019-01-18 14:31:46 +03:00
Max Medvedev
a9362d844a Implemented "Complete statement" for completion
#KT-18663 fixed
2019-01-18 14:28:49 +03:00
Ilmir Usmanov
e8c52e0a8f Do not mark fake inliner variables as alive
This prevents them from spilling.
 #KT-29317 Fixed
2019-01-18 13:45:20 +03:00
Ilmir Usmanov
7e4e1b9a4d Add regression test
#KT-29327
2019-01-18 13:44:07 +03:00
Ilmir Usmanov
dc6bb4cd08 Revert "Simplify tail-call optimisation check"
This reverts commit a5bcd3495e.

 #KT-27190: Open
 #KT-29327: Fixed
2019-01-18 13:44:05 +03:00
Mikhael Bogdanov
8fb2633bf4 Minor. Patch test to avoid failing in Native 2019-01-18 09:52:56 +01:00
Anton Yalyshev
a4386cf28a Merge remote-tracking branch 'origin/master' 2019-01-18 11:14:17 +03:00
Andrey Uskov
2659011440 Fix compilation of GradleImportingTestCase in bunches 2019-01-18 00:45:20 +03:00
Georgy Bronnikov
c3352d5fdb Unmute several tests, mute one 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
7df0cffac9 Move declaration origins to IrDeclarationOrigin.kt 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
bccb451afd Add isSyntheic flag to IrDeclarationOrigin 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
ec0842c0f4 Remove descriptors from CallableReferenceLowering 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
67ab8624c3 Add DeepCopyIrTreeWithDescriptors 2019-01-17 23:46:26 +03:00
Georgy Bronnikov
da0a823992 Remove descriptors from LocalDeclarationslowering 2019-01-17 23:46:26 +03:00
Vyacheslav Gerasimov
b525146009 Build: Switch to prebuilt protobuf-lite from teamcity repo
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
1efd859909 Exclude protobuf-relocated build directory in CodeConformanceTest
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
c7ab69829e Build: Convert protobuf to includable build with maven publication
#KT-29202
2019-01-17 20:45:11 +03:00
Vyacheslav Gerasimov
6a3e5c4c94 Build: Move protobuf projects to subdirectory
#KT-29202
2019-01-17 20:45:11 +03:00
Ilya Gorbunov
0ac85ad715 Document that sorting is stable in each platform
#KT-12473 Fixed
2019-01-17 18:38:37 +03:00
Ilya Gorbunov
56672c2564 Ensure stable sorting in MutableList.sort/sortWith
MutableList.sortWith now works correctly in JS_IR backend too

#KT-12473
2019-01-17 18:38:23 +03:00
Andrey Uskov
7191624a92 Fix compilation of KotlinGradleProjectResolverExtension in bunches 2019-01-17 17:20:43 +03:00
Denis Zharkov
82537cdc8b Add recovery for missing comma between arguments
^KT-13497 Fixed
2019-01-17 14:58:01 +03:00
Denis Zharkov
37614254d7 Fix test on unused import suppression
Before the fix for KT-7185, the file looked like:
package suppression
@file:Suppress("UnusedImport")

import java.io.* // unused

And it was parsed incorrectly, because @file: annotations
should come before package directive
But after fix, import directives started being parsed that lead
to wrong unused import (because suppression wasn't parsed still)
2019-01-17 14:56:42 +03:00
Denis Zharkov
db53c4bea4 Add test for obsolete recovery case (semi-finished extension)
^KT-7405 Obsolete
2019-01-17 14:56:42 +03:00
Denis Zharkov
65e6e21d0f Add recovery for import lists in the middle of the file
Note, that it only works for top-level declarations

^KT-7185 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
e6710b6fa2 Add recovery for value parameter without type or name
The case for KT-7237 belongs to /NoGTInTypeArguments test
It was fixed implicitly: before it recovery was working but the name for
the next parameter was attached to type argument list.
After that change, parameter without name gets parsed correctly (with an
error of course)

^KT-13731 Fixed
^KT-7237 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
5437a0e478 Add recovery for enum declaration without 'class' keyword
^KT-13703 Fixed
2019-01-17 14:56:42 +03:00
Denis Zharkov
1688fed0b7 Minor. Rename PropertyParsingMode -> DeclarationParsingMode 2019-01-17 14:56:42 +03:00
Denis Zharkov
8b3ffee183 Minor. Rename defaultDetected -> companionDetected 2019-01-17 14:56:42 +03:00
Denis Zharkov
ee75b8c7e5 Minor. Extract KotlinParsing::parseCommonDeclaration 2019-01-17 14:56:42 +03:00
Dmitry Petrov
c1de845d29 Generate switch instruction for 'when' with unsigned subject 2019-01-17 13:49:39 +03:00
Dmitriy Dolovov
3c2d026128 CIDR: Always relax upper limit of product version in K/N plugin for non-public CIDR builds
Issue #KT-29338:fixed
2019-01-17 17:30:16 +07:00
Andrey Uskov
618a7c3747 Improve logging in gradle import tests 2019-01-17 13:20:58 +03:00
Andrey Uskov
5302470f6b Fix "testUnresolvedDependency"
This fix is work-around fixing incompatibility issue between gradle
tooling api bundled in IDEA and gradle tooling api in gradle 4.x.
When null messages were logged it resulted in the following error:
"java.io.StreamCorruptedException: invalid stream header: ED000573"
2019-01-17 13:20:28 +03:00
Dmitry Savvinov
e483f83666 Make 'is'-operator more stupid
Consider following expression: 'call() is Foo'. Suppose that we know
something about the 'call()', e.g. 'returns(foo) -> <condition>'

Previously, we've tried to re-use knowledge about 'call()', constructing
some smart clause, like 'returns(true) -> foo is Foo && <condition>'.

The conceptual error here is that *we can't* argue that <condition>
holds. Imagine that 'call()' actually has unspecified 'returns(foo2) ->
<!condition>', and 'foo2 is Foo' also holds. Then we would get
'returns(true) -> foo2 is Foo && <condition>' <=> 'returns(true) ->
<condition>' for the whole call, which is not correct.

More concrete example would be something like:
'if (!x.isNullOrEmpty() is Boolean)'

^KT-27241 Fixed
2019-01-17 12:47:27 +03:00
Dmitry Savvinov
04ff2a3ee7 Add test on isNullOrEmpty-like contract
Currently, behavior is undesired, see KT-27241
2019-01-17 12:47:27 +03:00
Anton Yalyshev
fe746bd505 drop 182 support, as context info works from 183 2019-01-17 12:43:20 +03:00
Anton Yalyshev
23b0f27f3b moved PluginVersion from collector instance to context for each trigger() 2019-01-17 12:43:18 +03:00
Anton Yalyshev
124ab5a896 added Kotlin plugin version Collector 2019-01-17 12:42:41 +03:00
Andrey Uskov
48d832298b Compile Kotlin project with "-Xjvm-default=compatibility" flag
#KT-29073 Fixed
2019-01-17 12:40:10 +03:00
Andrey Uskov
7da8c41f3f Remove build script bunches in idea/idea-maven 2019-01-17 12:40:09 +03:00
Andrey Uskov
99de00362e Fix NSME during reimport of maven project
#KT-29251 Fixed
2019-01-17 12:40:08 +03:00
Andrey Uskov
68347e89cf Remove build script bunch for 191. The -Xjvm-default flag should be set in the whole project 2019-01-17 12:39:11 +03:00
Anton Yalyshev
53f07536f9 Merge remote-tracking branch 'origin/master' 2019-01-17 11:12:32 +03:00
Mikhail Glukhikh
40b88d874e Fix broken test (KT-18715) 2019-01-17 10:41:31 +03:00
Anton Yalyshev
ebeff1e0d8 Merge remote-tracking branch 'origin/rr/ayalyshev/stat-refactorings-fixes' into rr/ayalyshev/stat-refactorings-fixes
# Conflicts:
#	idea/src/org/jetbrains/kotlin/idea/refactoring/rename/RenameKotlinFileProcessor.kt.173
2019-01-16 22:31:58 +03:00
Anton Yalyshev
30df986f93 removed unused collectors 2019-01-16 22:26:51 +03:00
Anton Yalyshev
e434733341 removed trigger() calls when refactoring is performed automatically or recursively 2019-01-16 22:26:50 +03:00
Anton Yalyshev
70d6020025 Removed second override as findReferences(element: PsiElement) is called anyway. It duplicates trigger(). 2019-01-16 22:26:50 +03:00
Ilmir Usmanov
2ec1222cd1 Fix test data 2019-01-16 20:40:33 +03:00
Ilmir Usmanov
76e9b574cd Put default value to vars iff they are not boxed
#KT-24672 Fixed
2019-01-16 20:40:29 +03:00
Svyatoslav Kuzmich
62322dec5c Regenerate and unmute tests 2019-01-16 16:37:52 +03:00
Mikhail Glukhikh
7908663687 Fix part of tests broken by a71bb709 (too many line breaks were added) 2019-01-16 16:07:41 +03:00
Alexey Tsvetkov
b6102c52b9 Fix kotlin-serialization plugins build scripts
1. There is no need to specify repositories.
2. We don't use 'org.jetbrains.kotlin:gradle-api:1.6' anymore.
3. kotlin-serialization-unshaded does not need dependencies,
because it does not contain source code (it simply packages jar).
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
3a91db836a Minor: remove workaround for KT-24915 from tests
The issue was fixed in AGP 3.2.0-beta02
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
c59c5361d1 Test KAPT with AGP 3.1.0 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
d1cd98cf8b Minor: remove repositories blocks from subprojects of databinding test
Repositories are set in top-level build.gradle file
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
a59be05792 Fix testDatabinding with AGP 3.0.x
AGP 3.0.x requires explicit 'kapt' dependency on databinding compiler.
Also databinding v2 (enabled by default in AGP 3.2.0) generates different
java classes.
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
3b806dca68 Drop support for gradle 4.0
#KT-29275 Fixed
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
9de66c4165 Fix Gradle JS test with Gradle 4.0+ 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
4110eb3587 Fix AGP version checks in kapt android tests 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
6782d8c5c8 Use class instead of string to hold AGP version in tests 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
ca79efdeec Remove unused methods from Gradle plugin 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
e9abd69fc0 Drop support for Android Gradle plugin 2.x
#KT-27886 Fixed
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov
b51461b5c5 Drop support for Gradle 3.x
#KT-27885 Fixed
2019-01-16 15:57:32 +03:00
Svyatoslav Kuzmich
c92a6f9ca2 [JS IR BE] Unmute inlineClasses tests 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich
befc371f6a [JS IR BE] Fix bridges construction function handle 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich
912f0a267f [JS IR BE] Use return type in function signature for inline classes
Bridge function should be created when return type of override function
is specialised to unboxed inline class. Thus return type should be used in
function signature.

Non-inline-class return types are not added to signature for interop and
infrastructure reasons ("toString" would become "toString_ret$kotlin_String")
2019-01-16 12:11:27 +03:00
Svyatoslav Kuzmich
ebdbe7ec30 [JS IR BE] Fix fake override functions resolve
Use signature of function 'target' (a real function that will
be called instad of fake override) to make boxing/unboxing decision for
return value and type parameters on call site.
2019-01-16 12:11:27 +03:00
Dmitry Petrov
08abf5f2a2 Specialize unsigned range and progression iterator calls 2019-01-16 11:00:23 +03:00
Dmitry Petrov
723e739960 Minor: convert ProgressionIteratorBasicValue to Kotlin 2019-01-16 11:00:23 +03:00
Felix Guo
a71bb70901 KT-18715: don't swallow comments for if->elvis
Adds a CommentSaver to the IfThenToElvis intention that will save and
restore comments when converting an if expression to elvis expression.
2019-01-16 09:41:06 +03:00
Alexander Udalov
05c25342ad Make CommonToolArguments.nullable
#KT-28974 Fixed
2019-01-15 17:21:43 +01:00
Nicolay Mitropolsky
9559346199 191: Uast: implementation of UMethod.returnTypeReference (KT-29012) 2019-01-15 18:51:50 +03:00
Nicolay Mitropolsky
630b39d6b0 191: Uast: compiling with -Xjvm-default=compatibility 2019-01-15 18:51:49 +03:00
Nicolay Mitropolsky
f4d585f836 Uast: removing unused KotlinUComponentQualifiedReferenceExpression 2019-01-15 17:22:07 +03:00
Nicolay Mitropolsky
c139901889 Uast: all Kotlin versions of org.jetbrains.uast.test.* moved to org.jetbrains.uast.test.*.kotlin
To avoid having same class names in Kotlin and IDEA
2019-01-15 17:22:04 +03:00
Sergey Igushkin
3d208c31c8 Run Gradle integration tests against Gradle 5.1.1 2019-01-15 15:50:15 +03:00
Alexander Gorshenev
2775153c1a Got rid of an unecessary explicit cast. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
606c622e61 Removed unnecessary nullability marks. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
1e6240730b Added a TODO statement on special treatment of properties in deserializer. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
f10e826b52 Less eagerly fail on the boundary between deserializer and DeclarationStubGenerator. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
884e6e15e9 Added a comment for separate treatment of properties in IrDeserializer interface. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
32c2e841f2 Reversed DumpIrTree.kt fix for now, as it breaks tests comparing textual IR representation. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
1ba4770800 A little fix to allow Wrapped and non-Wrapped descriptors to coexist. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev
cea32bd4e3 Minor changes in preparation for IR deserialization. 2019-01-15 14:54:27 +03:00
Mikhail Zarechenskiy
01ab4965b1 [NI] Support SAM conversions in backend for special expressions 2019-01-15 13:14:41 +03:00
Mikhail Zarechenskiy
bcc720f1db [NI] Run arguments checker before outer call checker
This is needed because arguments checker updates unsubstituted and
 non-denotable types (type variables, IntegerValueType...)

 #KT-28718 Fixed
2019-01-15 13:14:41 +03:00
Nikolay Krasko
55498450d1 Minor: extract function without manager parameter 2019-01-15 12:49:48 +03:00
Nikolay Krasko
4e9c8cee70 Drop bunch code by introduction wrapper for PopupChooserBuilder 2019-01-15 12:49:48 +03:00
Denis Zharkov
3707812fc2 Revert "Temporary remove some tests after a fix for KT-24937"
This reverts commit ddb4e8b128.
2019-01-15 12:35:12 +03:00
Ilya Matveev
ac1b4cf6b2 Allow setting test binary linker options using a test compilation
#KT-29254 Fixed
2019-01-15 12:07:55 +07:00
Vyacheslav Gerasimov
2157c777b3 Remove obsolete bunch fixes for 173 & as31 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov
b1f25874d8 Remove warnings from incompatible api inspection 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov
13d87e8eae Remove as31 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov
818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov
96c21297b6 Remove 173 and AS 3.1 from .bunch 2019-01-14 21:29:02 +03:00
Yan Zhulanow
e4087b5a7a Fix testJavacIsLoadedOnce() kapt integration test 2019-01-14 17:41:09 +03:00
Max Medvedev
99ffcda5fc Type hints: don't show hint for qualified constructor calls or enum cases
#KT-29196 fixed
2019-01-14 17:23:45 +03:00
Denis Zharkov
2a156fe90c Do not check target when generating bridges with default impl
In many other places, e.g. org.jetbrains.kotlin.codegen.ClassBodyCodegen#generateDelegatesToDefaultImpl
we implicitly assume that whenever we use a default interface method
our target is 1.8

But here, we don't and it might lead to exception in org.jetbrains.kotlin.backend.common.bridges.BridgesKt#findConcreteSuperDeclaration
when actual target is 1.6 and we extend some AbstractMap implementation
with JDK8 (i.e., with @PlatformDependent getOrDefault)
2019-01-14 14:54:18 +03:00
Denis Zharkov
5ec93f2718 Avoid assertion in bridges-generation for light classes
^KT-11656
2019-01-14 14:54:18 +03:00
Denis Zharkov
e0ff7281b4 Minor. Introduce FunctionHandle::mightBeIncorrectCode 2019-01-14 14:54:18 +03:00
Denis Zharkov
cd51658976 Replace JvmTarget with GenerationState in DescriptorBasedFunctionHandleForJvm 2019-01-14 14:54:18 +03:00
Denis Zharkov
254380d418 Generate special bridges for removeAt/getOrDefault
In case we extending some Map specialization with non-trivial type arguments,
e.g. Map<String, String> from Kotlin point-of-view it has
"remove(String, String)" signature while in Java it's "remove(Object, Object)".

So, we generate an override "remove(String, String)" in first Kotlin class of the hierarchy,
which body delegates to "super.remove(Object, Object)"

Also, we generate a final override for "remove(Object, Object)" to allow
for Java inheritors choose only the version with String while overriding.

The main idea of the fix is to make mayBeUsedAsSuperImplementation
return true in case of PlatformDependent annotations.
Otherwise, we weren't able to choose the impl from the java.util.Map
as a delegate in our bridge.

Another part of the fix is overriding `isDeclaration`:
it was necessary because otherwise bridge-generation algorithm
was assuming that there's already an actual declaration
in the first sub-class (TestMap) in the test and we need to
delegate to the latter instead of the method from the interface

^KT-26069 Fixed
2019-01-14 14:54:18 +03:00
Denis Zharkov
949214c10b Refactor bridges generation for JVM
Make a separate subclass for DescriptorBasedFunctionHandle
to allow customize the behavior without complex abstract concepts
like `areDeclarationAndDefinitionSame`
2019-01-14 14:54:18 +03:00
Denis Zharkov
5cc242e878 Refactor FunctionHandle::isInterfaceDeclaration
- Give it more clear name mayBeUsedAsSuperImplementation
  because defining if it can be used as super-implementation
  this is what it used for
- The meaning is negated, so it's needed to negate its usages and impls
- Also, reuse it in findSuperImplementationForStubDelegation
2019-01-14 14:54:18 +03:00
Denis Zharkov
9736975d52 Minor. Reformat builtinSpecialBridges.kt 2019-01-14 14:54:18 +03:00
Dmitry Petrov
9973d59643 Use java.lang.Long.divideUnsigned/remainderUnsigned in Java 1.8+
#KT-24876
2019-01-14 14:17:52 +03:00
Dmitry Petrov
a344feff5c Convert IntrinsicsMap to Kotlin 2019-01-14 14:17:52 +03:00
Dmitry Savvinov
a4d1a8f60a Get rid of FUNCTOR slice, use lazy value in ContractDecription instead
Functor is an imperative representation of function's contract (contrary
to ContractDescription, which is a declarative one). ContractDescription
is convenient when we deal with sources of contracts declarations
(binaries, source), while Functors are convenient for analyzing code
with contracts.

It means that we have to convert ContractDescription into Functor when
we start working with contracts. This computation isn't trivial, and
Functor and ContractDescription are in 1-1 correspondence, so we would
like to cache Functor for each ContractDescription somewhere.

We used to do this in binding trace, in slice FUNCTOR.

Now, it turns out that this approach causes "Rewrite at slice"
exception, see KT-28847. We won't go into details of why that happens
here, you can see the issue comments for details (but be prepared for the
very long and nitty-gritty story)

This commit removes the problematic slice and introduces another
approach, where Functor is attached to the ContractDescription, computed
lazily and cached here.

^KT-28847 Fixed
2019-01-14 11:11:03 +03:00
Dmitry Savvinov
594a6588f9 Add test on rewrite at slice FUNCTOR 2019-01-14 11:10:37 +03:00
Dmitry Savvinov
0b1ff1a457 Minor: improve rendering of Traces in debugger
- add toString for ObservableBindingTrace (for debugging)
- add toString for LockProtectedTrace (for debugging)
- extract anonymous AbstractFilteringTrace to EffectFilteringTrace
2019-01-14 11:10:37 +03:00
Dmitry Savvinov
69fff12384 Drop LockBasedStorageManager.defaultDebugName, use meaningful name everywhere
Also, drop `createDelegatingWithSameLock` as it was unused
2019-01-14 11:10:37 +03:00
Alexander Podkhalyuzin
893479bd5e Implemented KotlinResolveScopeEnlarger for modules
Before that we had dependency to iml file, which is incorrect
2019-01-14 10:53:41 +03:00
Ting-Yuan Huang
72e351a0e3 Allow specifying isolation mode for KAPT workers
There are a few isolation modes for Gradle workers. KAPT uses 2 of them.

IsolationMode.NONE is the default. It runs workers in Gradle daemon and
is more memory efficient.

IsolationMode.PROCESS forks workers into individual processes. This
keeps some resource leaking annotation processors from affecting the
rest of compilation.

Users can specify kapt.workers.isolation=process, if they need to use
some annotation processor that are known to be resource leaking.
2019-01-11 23:48:09 +03:00
Ilya Gorbunov
a26aa30714 Change implementations of contentEquals and minOf/maxOf for Native
To conform to the behavior in other platforms.
2019-01-11 21:49:19 +03:00
Ilya Gorbunov
a951805218 Refactor: introduce PrimitiveType.isFloatingPoint 2019-01-11 21:49:19 +03:00
Ilya Gorbunov
23950042f6 Clarify how elements of arrays are compared by contentEquals function
Add clarification only for the particular group of overloads including
 arrays of object and floating point numbers.

#KT-22942 Fixed
2019-01-11 21:04:03 +03:00
Ilya Gorbunov
ef278ea030 Improve Any.equals/hashCode docs
- add code formatting
- remove 'reference' adjective, as Kotlin doesn't distinguish primitives from reference types
- add the requirement of inequality to null
- replace inaccurate note with a link to the reference (relates to KT-26604)

#KT-14866
2019-01-11 21:03:19 +03:00
Ilya Gorbunov
51eb21d44b Provide stable sorting when JS engine sorting doesn't look stable
#KT-12473
2019-01-11 20:53:29 +03:00
Ilya Gorbunov
7c3c454654 Remove specialization of toTypedArray for LongArray and BooleanArray in JS
The default implementation for primitive arrays returns an array of correct type.

#KT-29187 Fixed
2019-01-11 20:53:29 +03:00
Sergey Igushkin
8bc7ac32f3 Fixes for review KOTLIN-CR-2599
* Move source artifacts to KotlinVariant classes (since joint Android
 variants may have multiple source artifacts, make it a set)

* Change lowerSpinalCaseName to dashSeparatedName (doesn't transform
 the strings to lower case inside)

* Don't transform the project name to lower case (in the future, it may
 be reasonable to stop transforming the target and component names, too)
 Still transform the target names and the component names.
 Currently, this is the way we don't break existing publications and may
 still reconsider this in the future.

* Add a workaround for a list of GString's assigned to
 publishLibraryVariants

* Check for Android library variants existence in a more strict way,
 report existing variants that are not library variants.
2019-01-11 20:32:38 +03:00
Sergey Igushkin
7e6527ca65 Properly setup localToProject attribute in jvmWithJava (KT-29035)
A dependency on a multiplatform module with a jvmWithJava target failed
to resolve because the 'apiElements' and 'runtimeElements'
configurations didn't have the attribute 'localToProject' set to
'public'.

Those configurations need to have have the attribute set as per the
fix of KT-28795, but it doesn't happen.

Issue #KT-29035 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
0abd044800 Expose 'allKotlinSourceSets' in KotlinCompilation (KT-28749)
As KotlinCompilation only contains the directly added source sets in its
`kotlinSourceSets` property, we need to provide a convenient way to
collect the whole source sets hierarchy for a compilation.

We added internal `allKotlinSourceSets` some time ago, and it seems
reasonable to expose it as public API.

Issue #KT-28749 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
0cf95f84cb Link the 'api' configuration to 'apiElements' (KT-28355)
As we introduced the 'api' configurations for Kotlin source sets, the
Java plugin did not link these configurations to its 'apiElements', and
those dependencies would only get published with the 'runtime' scope
through the 'implementation' configuration.

To fix this, manually specify that 'apiElements' extendsFrom 'api'.

Issue #KT-28355 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
82f13b90e6 Fix transitive dependencies overriding default Kotlin version (KT-28820)
In Gradle 5.0, the 'prefer' function semantics has changed, and now a
transitive dependency version wins over the 'preferred' one. Instead,
'require' has been introduced in 5.0 with the old semantics.

Our users expect that the default Kotlin dependency version will be
at least as new as the plugin version, so we now need to use 'require'
with Gradle 5.0+

Issue KT-28820 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
f9c45c30a2 Always rewrite dependencies in POMs when publishing an MPP (KT-28482)
As non-Gradle consumers and Gradle consumers with metadata disabled
cannot read Gradle metadata, in POMs (the only source of dependencies
for the consumers mentioned above), we should publish the dependencies
on modules with metadata as the target artifact IDs rather than the root
MPP module ID (e.g. 'foo-jvm' rather than 'foo').

To do that, we rewrite the POMs of the publications even when Gradle
metadata is enabled. Note: in the POMs, a project dependency is already
written in the form of the artifact ID of the root Kotlin software
component, so it complicates the dependencies rewriting a little.

To rewrite third-party dependencies, we detect dependencies that
resolved to no artifact and have a single child in the Gradle
dependencies graph of the resolved configuration – this is what a
dependency looks like which was redirected to another module via
'available-at'.

Issue #KT-28482 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
2fd524f1c0 Fix failure when creating a compilation in afterEvaluate (KT-28896)
To configure a compilation's sources, we run an action in
`whenEvaluated { ... }`, expecting that the compilation's task already
exists. This was not true with compilations created from a user build
script or a 3rd-party plugin in `afterEvaluate { ... }`.

Fix this by expecting that a task may possibly not exist at that point,
and also using `whenEvaluated { ... }` instead of
`afterEvaluate { ... }` in several places that are executed for each new
compilation as a workaround for
https://github.com/gradle/gradle/issues/1135.

Issue #KT-28896 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
de5e86ae9f Publish Android variants from multiplatform projects
Also update the code for rewriting the dependencies, as Android variants
have their dependencies configurations formed a bit differently, and
also introduce the logic for choosing the right component by the
configuration name the dependency resolves to.

Issue #KT-27535 Fixed
2019-01-11 20:32:37 +03:00
Sergey Igushkin
9a2dce7ea5 Restructure source JARs logic, move it to components management
Move the logic of attaching a source JAR to a publication to the
components management part, as building a source JAR will be done
differently for Android.
2019-01-11 20:32:36 +03:00
Sergey Igushkin
d211bd53c9 Allow a target to have multiple publications, restructure the code
Instead of exposing a single `component` in a target, allow it to have a
set of `components`, then create a Maven publication for each of the
components.

Move `createUsageContexts` to private API since a target that has
multiple publications may need to create the usage contexts for those
publications differently.

Move some of the components technical stuff to interfaces
`DelegatedToPublication` and
`ComponentWithCoordinatesDelegatedToPublication` in order to reuse it
later for Android's components.
2019-01-11 20:32:36 +03:00
Sergey Igushkin
a6b55cc5d7 refactor: Support creating AndroidProjectHandler from outside the plugin 2019-01-11 20:32:36 +03:00
Roman Artemev
d35b20f764 [JS IR BE] Implement private members lowering to extract private methods from class and transform them into static function
* fix kotlin.Long
 * update tests
2019-01-11 20:28:04 +03:00
Roman Artemev
75996b1c8e [JS IR BE] Fix class generator 2019-01-11 20:28:04 +03:00
Roman Artemev
23fc950ae6 [JS IR BE] Fix suspend function lowering 2019-01-11 20:28:04 +03:00
Ilya Gorbunov
fcef876c7e Update copyright in generated stdlib sources 2019-01-11 19:23:12 +03:00
Andrey Uskov
da6de11c15 Disable GradleFacetImportTest for AS33 and AS34 2019-01-11 18:51:21 +03:00
Andrey Uskov
a9be8aac5a Create Kotlin SDK on load or import project with JS/Common modules
#KT-22590 Fixed
2019-01-11 18:48:24 +03:00
Andrey Uskov
a9df9b22e9 Fix scope detection for MPP projects
#KT-27718 Fixed
#KT-28626 Fixed
2019-01-11 18:47:20 +03:00
Ilya Gorbunov
de1d15aa9a Improve test coverage for contentEquals and minOf/maxOf 2019-01-11 17:41:52 +03:00
Pavel Punegov
dc8cb103c5 Replace class instantiation with object in JS tests 2019-01-11 17:38:58 +03:00
Pavel Punegov
1c4ecd287d DefaultAsserter object. Add function to replace constructor invoke. 2019-01-11 17:38:58 +03:00
Pavel Punegov
ac0f612781 Make kotlin.test asserter be ThreadLocal 2019-01-11 17:38:58 +03:00
Pavel Punegov
4b3693bf37 Exclude native annotations in JS IR tests 2019-01-11 17:38:58 +03:00
Pavel Punegov
122ec85bf0 Add ThreadLocal and SharedImmutable native annotations as OptionalExpectation
to kotlin.native.concurrent
2019-01-11 17:38:58 +03:00
Mikhael Bogdanov
2bdf68ad67 Delete dead code on last optimization step, otherwise ASM will split exception table on it.
ASM has logic that splits exception tables in MethodWriter.computeAllFrames:
     // Loop over all the basic blocks and visit the stack map frames that must be stored in the
     // StackMapTable attribute. Also replace unreachable code with NOP* ATHROW, and remove it from
     // exception handler ranges.
     ...
     firstHandler = Handler.removeRange(firstHandler, basicBlock, nextBasicBlock);
     ...
  https://gitlab.ow2.org/asm/asm/issues/317867

  #KT-28546 Fixed
2019-01-11 15:27:52 +01:00
Mikhael Bogdanov
306a982722 Temporary disable line numbers generation for default values from expect declarations
Proper SMAP support for default values from expect declarations is required.
 Default value in expect declaration could has line number that
 exceed line count in actual file that causes an error

  #KT-23739 Fixed
  #KT-29174 Open
2019-01-11 15:27:51 +01:00
Roman Artemev
c725f4ce32 [JS IR BE] Secondary constructors lowering refactoring
* make it per-file
2019-01-11 16:13:26 +03:00
Anton Yalyshev
e49c350550 removed unused collectors 2019-01-11 15:31:07 +03:00
Anton Yalyshev
4b5c5d77bc removed trigger() calls when refactoring is performed automatically or recursively 2019-01-11 15:31:07 +03:00
Anton Yalyshev
5672e0fb6e Removed second override as findReferences(element: PsiElement) is called anyway. It duplicates trigger(). 2019-01-11 15:31:07 +03:00
Mikhail Glukhikh
927b94a6e0 Regenerate FIR test 2019-01-11 15:14:14 +03:00
Mikhail Zarechenskiy
6361df28fe Fix dependency for Gradle integration tests module
After d5ebe2e6
2019-01-11 14:47:11 +03:00
Sergey Rostov
75e59fdc46 JPS: exclude source roots from other targets
Previously `findJavaRootDescriptor` was return source root for random
module. This cause build errors for mpp (same file may appear in
multiple source roots of common and platform modules)

#KT-28988 Fixed
2019-01-11 12:53:11 +03:00
Dmitry Savvinov
8a0057b387 Introduce specific version of NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY for KT-28061
In 1.3.0 there was introduced KT-28061 bug, which caused some of the
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY diagnostics to be lost (turning
"red" code into "green")

500dc11514 fixes the bug and returns
lost diagnostics back. This commit adds additional information for some
of the cases where diagnostics were list and then brought back (for the
user sanity).

The heuristic used for detecting cases which need additional information
is simple: if function has return in in-place called lambda, and
NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY should be reported, then we
enhance it with additional information.

^KT-28061 Fixed
2019-01-11 11:44:39 +03:00
Mikhail Glukhikh
4fd773a38b IDEA plugin: remove "Show FIR action" and fir-view without fir.enabled
#KT-28813 Fixed
(it's planned to include FIR in artifacts after 1.3.30)
2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
f0c9a3daa2 FIR: add default simple importing scope to support kotlin.ByteArray etc 2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
6e369e156d FIR: implements multi-module resolve, add tests #KT-24093 Fixed
This commit introduces FIR session provider, dependency provider,
library session + other infrastructure necessary for multi-module resolve
2019-01-11 09:55:40 +03:00
Mikhail Glukhikh
bc82f2f940 Use FirModuleBasedSession with module info, use platform default imports
In this commit, FIR sessions made bound to a particular module
2019-01-11 09:55:40 +03:00
Ilya Matveev
9ca07bc706 Fix linkTaskName getters of K/N compilations 2019-01-11 13:21:46 +07:00
Ilya Matveev
5eea0145b3 Support getting the default K/N test binary from a compilation
Fix for https://github.com/JetBrains/kotlin-native/issues/2487
2019-01-11 13:21:46 +07:00
Mikhail Zarechenskiy
d5ebe2e66a Reorganize dependencies around kotlin-compiler.jar
#KT-26807 Fixed
2019-01-11 00:14:23 +03:00
Ilya Gorbunov
30c769c19a Avoid hitting max argument limit in String(chars)
Rewrite CharArray to String conversions to appending chars one by one.

Refine parameter checking in String(chars, offset, length) to adhere to
the common exception contract and document it.

#KT-29003
2019-01-10 23:35:52 +03:00
Dmitry Petrov
b878626919 Intrinsify 'in' with unsigned ranges 2019-01-10 17:17:51 +03:00
Dmitry Petrov
e6e0e9976c Tests for for-in optimization with unsigned ranges 2019-01-10 17:17:51 +03:00
Dmitry Petrov
a2c618366b Tests for loops with possible index variable overflow 2019-01-10 17:17:51 +03:00
Dmitry Petrov
54cba32426 Support unsigned range and progression values in range intrinsics 2019-01-10 17:17:51 +03:00
Dmitry Petrov
68e2d8dcd9 Support unsigned integers in intrinsic range values 2019-01-10 17:17:51 +03:00
Dmitry Petrov
d22a31cb90 Use elementKotlinType in primitive number range intrinsics 2019-01-10 17:17:51 +03:00
Dmitry Petrov
5ae8df4d88 Use ComparisonGenerator for range element type in counter loops 2019-01-10 17:17:51 +03:00
Dmitry Petrov
4e48ce02f1 Minor: move RangeCodegenUtil to range package 2019-01-10 17:17:51 +03:00
Dmitry Petrov
fc94254320 Minor: refactor getRangeOrProgressionElementType + reformat 2019-01-10 17:17:51 +03:00
Dmitry Petrov
6414abb277 Minor: reformat & optimize imports 2019-01-10 17:17:51 +03:00
Igor Chevdar
e640f01b4e Fixed bug with IR parameter copying.
Constructors don't have their own type parameters
but rather inherit them from the parent.
2019-01-10 14:35:11 +03:00
Igor Chevdar
1bef26c80e [JS IR] Fixed bug with constructors type parameters 2019-01-10 14:35:11 +03:00
Igor Chevdar
5afa44edea Added a coroutine test 2019-01-10 14:35:11 +03:00
Igor Chevdar
1eaf2d2c42 Typo fix 2019-01-10 14:35:11 +03:00
Igor Chevdar
2c0f93b133 IR: Supported special coroutine intrinsic
See https://youtrack.jetbrains.com/issue/KT-26317 for details
2019-01-10 14:35:11 +03:00
Igor Chevdar
621a9bd1df Removed a Native specific lowering 2019-01-10 14:35:10 +03:00
Igor Chevdar
9fee03ca81 IR: Fixed some parents 2019-01-10 14:35:10 +03:00
Igor Chevdar
a78b80f8bf IR fixes to help symbolization of K/N 2019-01-10 14:35:10 +03:00
Roman Artemev
d363763420 Fix wrapped descriptors 2019-01-10 14:35:10 +03:00
Denis Zharkov
2b40ecfd29 Fix exception in ultra-light classes in case of complex mpp hierarchy
Without the introduced override, default implementation of isEquivalentTo
runs delegate computation of `another` that is illegal
for KtUltraLightClass

^KT-28912 Fixed
2019-01-10 14:11:20 +03:00
denisgaebler
be881442da One more fix for MinGW path in K/N runner 2019-01-10 17:29:34 +07:00
Ilya Chernikov
02f2c941c8 Add import support to main-kts, with test 2019-01-10 10:59:32 +01:00
Ilya Chernikov
4571e273a4 Add shared script instances support, fix and refactor evaluation accordingly
also fix arguments order in the evaluator
2019-01-10 10:59:32 +01:00
Ilya Chernikov
7bb4233e17 Add mapping function for transformations with ResultsWithDiagnostics
also improve chaining helpers
2019-01-10 10:59:32 +01:00
Ilya Chernikov
01f2a21192 [minor] add comment to the "Fix locking in script definition provider" commit 2019-01-10 10:59:32 +01:00
Ilya Chernikov
e5febddaf7 [minor] fix scripting test on windows 2019-01-10 10:59:32 +01:00
denisgaebler
1ca2e4fdba Update JavaSdkUtil.java
Added path for IBM JDK on platform z/OS
2019-01-10 12:46:05 +03:00
Anton Yalyshev
c809cfd800 Merge branch 'rr/ayalyshev/KT-29062' 2019-01-10 12:05:53 +03:00
Mikhail Glukhikh
7095182e2d FIR: support suspend functions #KT-24084 Fixed 2019-01-10 10:51:28 +03:00
Mikhail Glukhikh
7aba441234 FIR tree: support const expressions (adds IR dependency) #KT-24023 Fixed
Also support generic tree elements in FIR visitor generator
2019-01-10 10:51:08 +03:00
Mikhail Glukhikh
18ea86cfb4 Remove parentheses: add semicolon before lambda if necessary
In 2010b175, it was suggested just not to suggest parentheses removal.
However, it contradicts with behaviour of "Replace contains" which
adds semicolon before lambda in this case. So in this commit I made
behaviour of remove parentheses the same.

This commit reverts production part of 2010b175
Fixes failing test of "replace contains"
2019-01-10 10:45:46 +03:00
Sergey Rostov
62222460b6 JPS build, workarounds for idea importing: fix runtime classpath 2019-01-10 08:50:41 +03:00
Sergey Rostov
5cda676c9f JPS: Print components of CacheVersion, add tests 2019-01-10 08:50:39 +03:00
Sergey Rostov
b3985d2735 JPS: remove cache version from test data 2019-01-10 08:50:38 +03:00
Andrey Uskov
b6aed5b98a Change task creation with task registration in Kotlin plugin
#KT-27657 Fixed
2019-01-10 01:41:21 +03:00
Yan Zhulanow
7d660834e1 Fix 'CommandLineProcessor' extension point calling, switch it to using ServiceLoaderLite 2019-01-09 21:54:52 +03:00
Yan Zhulanow
34818b0bbe Remove JPS support for Android Extensions 2019-01-09 21:54:52 +03:00
Alexander Udalov
cca6ba38be Add tests for obsolete codegen issues
#KT-16790 Obsolete
 #KT-16858 Obsolete
 #KT-17441 Obsolete
2019-01-09 19:18:54 +01:00
Mikhael Bogdanov
0bb97cf590 Add test for Obsolete issue
#KT-12208 Obsolete
2019-01-09 16:00:03 +01:00
Ilya Matveev
dcaa56bc0b Fix MinGW path in Kotlin/Native runner 2019-01-09 20:43:29 +07:00
Anton Yalyshev
ef8bbafeff Checked null condition for JPanel createDestinationRootPanel() #KT-29062 Fixed 2019-01-09 13:04:23 +03:00
Anton Yalyshev
bec07ae7d9 createFileFromTemplate() call from ExtractSuperRefactoring doesn't affect statistics trigger anymore 2019-01-09 12:29:15 +03:00
Anton Yalyshev
a893a26585 Added statistics for Scratches to new_file_templates collector 2019-01-09 12:29:15 +03:00
Anton Yalyshev
6510c17804 Added statistics collector for new_file_templates and set trigger to createFileFromTemplate 2019-01-09 12:29:14 +03:00
Mikhael Bogdanov
f7ce8c18c6 Add tests for Obsolete issues
#KT-18977 Obsolete
2019-01-09 10:20:54 +01:00
Toshiaki Kameyama
f389c31d8e Replace with binary operator: don't highlight when receiver is dynamic type
#KT-28773 Fixed
2019-01-09 12:17:40 +03:00
Toshiaki Kameyama
2010b1756e Remove unnecessary parentheses: don't suggest when parentheses are for lambda 2019-01-09 12:16:01 +03:00
Toshiaki Kameyama
05d8932fa6 Remove useless cast: don't remove parentheses for lambda
#KT-28641 Fixed
2019-01-09 12:16:01 +03:00
Toshiaki Kameyama
d02867a831 Add "Wrap with array literal" quick fix for annotation parameters
#KT-28969 Fixed
2019-01-09 12:12:27 +03:00
Toshiaki Kameyama
53b0aa5813 "Wrap element with arrayOf() call": don't suggest for annotation parameters
#KT-28969 Fixed
2019-01-09 12:12:27 +03:00
Nicolay Mitropolsky
41b6bcf8c3 Converting object literal to class allows to choose a name (KT-19254) 2019-01-09 11:12:47 +03:00
Alexander Udalov
a9afee77d7 Add tests for obsolete codegen issues
#KT-8203 Obsolete
 #KT-15950 Obsolete
2019-01-08 20:43:46 +01:00
Mikhael Bogdanov
9a059809bf Add test for Obsolete issues
#KT-15956 Obsolete
 #KT-15751 Obsolete
 #KT-16417 Obsolete
 #KT-21787 Obsolete
2019-01-08 13:52:47 +01:00
Mikhael Bogdanov
6a19e45e27 Avoid ConcurrentModificationException
#KT-26384 Fixed
2019-01-08 13:52:46 +01:00
Mikhael Bogdanov
8ce7112123 New tests for TYPE_USE annotations in enums and inner classes
Main test data  (testName.txt) a not totally valid cause of IDEA-205039.
 Javac test data (testName.javac.txt) a not valid
 cause of type annotations support absence.
 Runtime tests are disabled cause reflection support absence.
2019-01-08 13:52:45 +01:00
Mads Ager
57489febf0 JVM IR: simplify chains of negations in if conditions.
Introduce lowering phase that turns !!exp -> exp for the boolean
'not' builtin. This makes sure that code such as

```
if (!!!!!booleanValue) {
    doStuff()
}
```

generates only one branch.
2019-01-08 12:09:23 +01:00
Mikhael Bogdanov
90c787e102 Minor. Reformat code 2019-01-07 15:49:27 +01:00
Mikhael Bogdanov
cfc21ffa56 Test for obsolete KT-16496
#KT-16496 Obsolete
2019-01-07 15:49:26 +01:00
Nikolay Krasko
c968a362f6 Fix test data after file rename 2019-01-06 01:08:25 +03:00
Toshiaki Kameyama
827e04ae3e Keyword completion: add "class/interface/object + filename" completion for top level (KT-28394)
#KT-28394 Fixed
2019-01-05 19:06:22 +03:00
Toshiaki Kameyama
ed9d53acaa Keyword completion: do not add braces after 'companion object' (KT-27915)
^KT-27915 Fixed
2019-01-05 19:00:25 +03:00
Toshiaki Kameyama
18ed031e7e Fix completion for back-ticked name (KT-19863, KT-19864)
^KT-19863 Fixed
^KT-19864 Fixed
2019-01-05 18:52:26 +03:00
Mads Ager
864b90f8c0 JVM_IR: Do not materialize negated boolean for branches.
Instead, flip the branch targets. This generates java byte code
such as:

   L2
    IFNE L3
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L4
   L3

instead of:

   L2
    IFNE L3
    ICONST_1
    GOTO L4
   L3
    ICONST_0
   L4
    IFEQ L5
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L6
   L5
2019-01-03 08:21:31 +01:00
Mikhael Bogdanov
02d9c526e2 Proper resort variables on inlining lowered ir closures
Original problem is that lowered ir closures doesn't meet inliner expectations
 about captured variable position in inlining method.
 E.g.: Call 'foo(valueParam) { capturedParam }' to
  inline function 'foo' with declaration

      inline fun foo(valueParam: Foo, inlineParamWithCaptured: Bar.() ->) ....

 is reorganized through inlining to equivalent call foo(valueParam, capturedParam1, cp2 ...).
 But lowered closure for lambda parameter has totally different parameters order:

     fun loweredLambda$x(extensionReceiver, captured1, cp2..., valueParam1, vp2...)

 So before inlining lowered closure should be transformed to

     fun loweredLambda$x(extensionReceiver, valueParam1, vp2..., captured1, cp2..)

 #KT-28547 Fixed
2019-01-03 07:57:36 +01:00
Mikhael Bogdanov
fcf8ea44b2 Update copyright in generated FIR related stuff 2019-01-03 07:45:16 +01:00
Mikhael Bogdanov
dfee1787e5 Regenerate builtins 2019-01-02 14:47:48 +01:00
Mikhael Bogdanov
e963c52c80 Update copyright in generated non-compiler tests 2019-01-02 13:34:03 +01:00
Mikhael Bogdanov
e0bcba5c0e Add test for obsolete KT-17431 issue
#KT-17431 Obsolete
2019-01-02 12:37:07 +01:00
Mikhael Bogdanov
cf47bc0130 Update copyright in generated compiler tests 2019-01-02 12:37:06 +01:00
Mikhael Bogdanov
6bf70a5dd2 Properly find invoke method on default lambda inlining
In general case parameter type could differ from actual default lambda type.
  E.g.: fun inlineFun(s: (Child) -> Base = { a: Base -> a as Child}),
  where type of default lambda is '(Base) -> Child'.
  In such case we should find somehow actual invoke method in bytecode knowing
  only name, number of parameters and that's actual invoke is non-synthetic
  regardless of bridge one.

  #KT-21946 Fixed
2019-01-02 12:37:06 +01:00
Toshiaki Kameyama
3040a2b145 Add quickfix for RETURN_TYPE_MISMATCH_ON_OVERRIDE
#KT-27972 Fixed
2018-12-29 10:41:14 +03:00
Vyacheslav Gerasimov
683ed4eb95 Build: Add asm-7 sources
#KT-29044 Fixed
2018-12-28 21:18:33 +03:00
Vyacheslav Gerasimov
ad85707a2d Build: move buildscripts & versions from root directory to ./gradle
javaInstrumentation.gradle.kts
report.gradle.kts
versions.gradle.kts
and all versions.properties
2018-12-28 21:18:33 +03:00
Nikita Katkov
4db9174b4d Error on calling suspend functions inside Lock.withLock body
See SuspensionPointInsideCriticalSectionChecker
2018-12-28 19:56:26 +03:00
Ilmir Usmanov
1d52fb2e26 Fix test data 2018-12-28 19:51:59 +03:00
Vyacheslav Gerasimov
343560c533 181: Fix QuickFixTestGenerated$TypeMismatch.testParamTypeLambdaMismatch 2018-12-28 19:01:39 +03:00
Nicolay Mitropolsky
19108d8821 InterpolatedStringInjectorProcessor in functional-style 2018-12-28 15:12:54 +03:00
Ilmir Usmanov
8a01da6ec6 Support val initialization in non-inline function with EXACTLY_ONCE effect
by generating a box for the value.
 #KT-26126 Fixed
2018-12-28 15:09:11 +03:00
Ilmir Usmanov
a52f430d8f Put default value (null or zero) to slot for uninitialized values
This way range of the variable is correct in LVT.
 #KT-24672 Fixed
2018-12-28 15:09:07 +03:00
Alexander Udalov
8ab9226805 Fix loading default Java annotation values in actual typealias from binary classes
#KT-22704 Fixed
2018-12-28 13:02:15 +01:00
Alexander Udalov
3fee84b966 Use fast .class file reading implementation in boxAgainstJava tests
Since these tests compile Kotlin code against compiled Java code, it's
only reasonable to use the same .class file reading implementation as is
used in production for the same purpose
2018-12-28 12:53:10 +01:00
Ilmir Usmanov
871134cff8 Update test data
#KT-28309
2018-12-28 14:18:39 +03:00
Ilmir Usmanov
666fec41b9 Do not spill fake variables
#KT-28309
2018-12-28 14:18:39 +03:00
Ilmir Usmanov
ab472793ed Add continuation parameter of suspend lambda's invoke to frame map
thus it will not overlap with $i$a and $i$f fake variables.
 #KT-28309
2018-12-28 14:18:38 +03:00
Ilmir Usmanov
a107b5d6b6 Set type of inliner's fake variable slots to int by storing 0
Otherwise, D8 drops the whole LVT.
 #KT-28309 Fixed
2018-12-28 14:18:37 +03:00
Nicolay Mitropolsky
55404ea00d 191: Making MockExternalAnnotationsManager not throwing exceptions in non action-required cases 2018-12-28 11:56:08 +03:00
Nicolay Mitropolsky
5d2002c742 Fixes to be compatible with IDEA 191 2018-12-28 11:54:30 +03:00
Simon Ogorodnik
cfb446df9e Move FIR tests to fir modules 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh
95af0268b8 FIR: add transformer consistency test 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh
cdc536b147 Add visitor consistency test 2018-12-27 21:32:21 +03:00
Mikhail Glukhikh
5716bda15d Raw FIR builder: add performance test to build FIR for all Kotlin
#KT-24086 Fixed
2018-12-27 21:32:21 +03:00
goodsauce
72be9ef738 #KT-27670 Add quick fix: wrap expression in a lambda if compatible functional type is required (#2010) 2018-12-27 20:12:10 +03:00
Mikhail Glukhikh
ed8d9be483 Fix EA-125880 2018-12-27 20:10:05 +03:00
Mikhail Glukhikh
8de2ff2163 Improve expect / actual markers on one line
Before this commit, only one-line enums and annotation classes were
considered. Now we can have enum header on one line and
some entries on another lines, and it still works.
Same with primary constructor parameters.

#KT-22637 Fixed
2018-12-27 19:45:28 +03:00
Mikhail Glukhikh
cdef811c55 Do not report "redundant arrow" with parameters without expected type
#KT-29049 Fixed
Part of KT-29005
2018-12-27 19:21:34 +03:00
Nicolay Mitropolsky
ebd6caaa71 Light-annotations: fix for reading class-literal varargs (KT-29027, IDEA-204252) 2018-12-27 16:04:05 +03:00
Alexander Udalov
bcb220b919 Minor, uncomment previously non-working code in test data 2018-12-27 13:12:38 +01:00
Dmitriy Dolovov
af4c2b8030 Fix: Rebuild common or native module with Delegate to gradle does nothing
Issues #KT-27295:fixed, #KT-27296:fixed
2018-12-27 18:24:43 +07:00
Nikolay Krasko
3b0cb2258a Notify about incompatible methods in ExtensionPointName 2018-12-26 21:10:03 +03:00
Nikolay Krasko
5a40fc8679 Add UI options for comments generation (KT-5590)
#KT-5590 Fixed
2018-12-26 21:10:03 +03:00
Nikolay Krasko
3eb4895acf Refactoring: rewrite without local any values 2018-12-26 21:09:28 +03:00
Nikolay Krasko
b232386d9d Fix losing suffix in multiline literals with interpolation (KT-29013)
Element was looped in internal loop, but this was missing in add suffix
check.
2018-12-26 21:09:28 +03:00
Vadim Brilyantov
6d8439e9fb add kotlinTarget field to non-mpp kotlin gradle model 2018-12-26 20:09:14 +03:00
Vadim Brilyantov
7e41384a60 add more precise target reporting with presets
fix report message to be more useful
2018-12-26 20:09:13 +03:00
Vadim Brilyantov
7e374e0f5a fix target statistics: report target_platform_id istead of target_name 2018-12-26 20:09:11 +03:00
Ilya Gorbunov
743d0f4917 Refactor kotlin-stdlib-gen
- Make targetsToGenerate Collection to accept set in addition to list
- Unify generated file name schema to '_<source name><platform suffix>.kt'
2018-12-26 19:53:11 +03:00
Ilya Gorbunov
5584b435dc Provide implementation templates for Native platform 2018-12-26 19:52:50 +03:00
Ilya Gorbunov
f05efd58de Support Native target platform in kotlin-stdlib-gen
- Allow to select target platform and target directory to generate source for
- Put copyright profile to resources to have it in the resulting jar
- Output error for missing bodies, but do not stop generation on the first error
2018-12-26 19:52:49 +03:00
kenji tomita
7b43d5c972 Add inspection for converting !collection.isEmpty() -> isNotEmpty()
#KT-27556 Fixed
2018-12-26 19:25:14 +03:00
Toshiaki Kameyama
538a746df9 Introduce "Function with = { ... }" inspection
#KT-17119 Fixed
2018-12-26 19:14:06 +03:00
Toshiaki Kameyama
301b3aad06 Condition of 'if' expression is constant: report enum entries comparison
#KT-28803 Fixed
2018-12-26 19:04:22 +03:00
Leonid Startsev
662c1b6d4a Make serialization plugin for Maven consistent with all other plugins:
Use correct import handler because old one was not working in IDE
Change maven artifact id to match pattern from other plugins
2018-12-26 18:53:53 +03:00
Mikhail Glukhikh
8420fceb8c Support '.toType()' and literal fixes related to unsigned type mismatch
#KT-26836 Fixed
2018-12-26 18:21:49 +03:00
Mikhail Glukhikh
73b6148407 Do not suggest cast for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
Related to KT-27590
2018-12-26 18:21:49 +03:00
Mikhail Glukhikh
d7ce79cc76 Suggest quick-fixes for SIGNED_CONSTANT_CONVERTED_TO_UNSIGNED
#KT-27590 Fixed
2018-12-26 18:21:49 +03:00
Ilya Gorbunov
9289a2c573 Remove redundant clause from 'until' function docs 2018-12-26 17:54:56 +03:00
Natalia Selezneva
022b21efa0 Scratch: move 'Make module' checkbox closer to modules combobox
^KT-28910
2018-12-26 16:56:49 +03:00
Natalia Selezneva
404c3ea57b Set scratch file extension using API for IDEA 182 or higher 2018-12-26 16:56:49 +03:00
Natalia Selezneva
6eff314b9d Script tests: check that script is highlighted 2018-12-26 16:56:49 +03:00
Natalia Selezneva
d389c9fd85 Refactoring: move scratch options to ScratchFile from ScratchPanel 2018-12-26 16:56:49 +03:00
Natalia Selezneva
a408711f37 Scratch: do not show error message when scratch execution is cancelled by user 2018-12-26 16:56:49 +03:00
Natalia Selezneva
2fbbf2400d Refactoring: unify methods to report errors in scratches 2018-12-26 16:56:48 +03:00
Natalia Selezneva
2f32c6e164 Refactoring: move test output handler to separate class 2018-12-26 16:56:48 +03:00
Natalia Selezneva
392e69c690 Refactoring: add composite output handler to avoid multiple forEach calls 2018-12-26 16:56:48 +03:00
Natalia Selezneva
2511f70bd9 Scratch: implement stop action
^KT-28643 Fixed
2018-12-26 16:56:48 +03:00
Natalia Selezneva
d403514cee Scratch: get scratch panel from selected editor
CommonDataKeys.EDITOR key isn't present for some events (for example when user click on isRepl checkbox on scratch panel or there isn't any file open in the editor)
^KT-28045 Fixed
2018-12-26 16:56:47 +03:00
Natalia Selezneva
59a32ff94d Refactoring: use output handlers to make action enabled or disabled 2018-12-26 16:56:47 +03:00
Vyacheslav Gerasimov
38d836dece Build: Don't instrument NotNulls during form instrumentation 2018-12-26 16:39:24 +03:00
Vyacheslav Gerasimov
f40635c2d2 Reformat instrument.kt 2018-12-26 16:39:23 +03:00
Nikolay Krasko
571ee4a1fe Don't ruin indentation for comments inside expression declarations (KT-23295)
#KT-23295 Fixed
2018-12-26 15:39:40 +03:00
Nikolay Krasko
36a6c0881c Check file is valid before executing toPsiFile (EA-133882) 2018-12-26 15:39:40 +03:00
Nikolay Krasko
3e55b6e9f5 Consider qualified name is null if some part is null (EA-126499) 2018-12-26 15:39:39 +03:00
Andrey Uskov
62c5972eca Minor refactoring in MoveKotlinDeclarationsHandler during unique container calculation 2018-12-26 15:31:44 +03:00
Mikhail Glukhikh
c0c9841e62 Switch laziness OFF in script light classes tests
Laziness works no more in this tests after dummyContextProvider is removed
for script light classes (see fix of KT-25395).

However, now 2/2 script light classes tests still fail in IDE mode,
because after fix of KT-26505 IDE light classes do not see
ScriptTemplateWithArgs as super-class
2018-12-26 15:11:26 +03:00
Max Medvedev
2621c7fc9e Appcode/CLion: fix a couple of boolean property usages 2018-12-26 14:32:02 +03:00
Mikhail Glukhikh
a9147ff446 More tests for KT-28997, fix isLocal for anonymous object in script 2018-12-26 12:53:25 +03:00
Mikhail Glukhikh
661ac711c0 Fix light class generation for local classes in scripts
Before this commit, we used script context for all classes
defined in script. However, for local classes in scripts it's mistake,
and now we generate them as usual, despite of the fact we are in script.

#KT-28997 Fixed
2018-12-26 12:53:24 +03:00
Sergey Rostov
883970fadb Add explicit dependencies to nullable annotations 2018-12-26 09:07:06 +03:00
Sergey Rostov
423653d225 JPS build: workarounds for idea importing 2018-12-26 09:02:44 +03:00
Sergey Rostov
ea0cf659b0 AbstractMultiPlatformIntegrationTest: search stdlib-common in dist 2018-12-26 08:43:00 +03:00
Sergey Rostov
c6b4117fb9 ScriptGenTest: search classes in JPS from native IDEA gradle import output too 2018-12-26 08:43:00 +03:00
Sergey Rostov
8d8d6ece88 kotlin-ant: move resources to separate folder 2018-12-26 08:43:00 +03:00
Sergey Rostov
74271cfecd JPS: Use module name from compiler arguments (JVM) 2018-12-26 08:43:00 +03:00
Ilya Gorbunov
37e706ef12 Remove fixed default values of org.gradle.* properties
To allow overriding them with local host gradle.properties, for example to enable locally 'org.gradle.parallel=true'.
2018-12-26 05:17:08 +03:00
Ilya Gorbunov
7f8263ec4e Fix gradle default encoding to UTF-8
To avoid platform-dependent filtering charset in copy tasks.
2018-12-26 05:17:08 +03:00
Ilya Gorbunov
6a9ceb2af7 Add more convenient aggregate tasks for core libraries
Add 'coreLibs*' aggregate tasks for 'clean', 'assemble', 'install'
and 'dist' tasks of core libs projects.
Remove '-jre7/8' libs from the list of core libs.
2018-12-25 19:34:25 +03:00
Andrey Uskov
bc71a7605a Fix KNPE in introduce when expression (EA-118718) 2018-12-25 19:27:02 +03:00
Andrey Uskov
69613d25f0 Fix KNPE during enable unsupported feature (EA-129025) 2018-12-25 19:26:14 +03:00
Andrey Uskov
467d5a3cf0 Fix KNPE during move nested class to upper level (EA-128165) 2018-12-25 19:25:47 +03:00
Andrey Uskov
9ec8ec4f3d Fix KNPE during lookup items calculation (EA-130318) 2018-12-25 19:25:27 +03:00
Andrey Uskov
95caabf22f Fix KNPE in introduce new variable (EA-131176) 2018-12-25 19:25:06 +03:00
Andrey Uskov
710baf969f Fix KNPE during adding new parameter to constructor (EA-125789) 2018-12-25 19:24:37 +03:00
Andrey Uskov
d4e5620b9c Fix KNPE in FacetSettings (EA-132084) 2018-12-25 19:22:25 +03:00
Andrey Uskov
1ec63c16f8 Fix KNPE in Introduce new variable (EA-132675) 2018-12-25 19:22:08 +03:00
Andrey Uskov
7dcb9db8cb Fix KNPE during language level calculation (EA-132679) 2018-12-25 19:21:29 +03:00
Andrey Uskov
c24520e2bd Fix KNPE in build template (EA-133006) 2018-12-25 19:21:03 +03:00
victor.petukhov
04fa6e8ab4 Add tests for local variables with type parameters (KT-8341) 2018-12-25 17:51:05 +03:00
victor.petukhov
a72515d822 Add tests for constructors of annotation classes with JvmOverloads (KT-25702) 2018-12-25 17:50:55 +03:00
Simon Ogorodnik
ea24a3c602 KT-28898: Optimize type-alias extensions and type-alias expansions lookup
#KT-28898 Fixed
2018-12-25 16:49:47 +03:00
Natalia Selezneva
9dc57567e4 Kotlin code fragments in markdown should have script definition because they are parsed as scripts 2018-12-25 15:32:27 +03:00
Natalia Selezneva
4e6fb84bae Create one instance of StandardIdeScriptDefinition per project
ScriptModuleInfo for scripts outside source roots in compared by virtualFile and script definition.
So when we use ScriptDefinitionsManaged.getDefaultScriptDefinition we shouldn't create a new one on each call

EA-132810 - assert: DiagnoseUnknownModuleInfoReporter.report
2018-12-25 15:32:26 +03:00
Natalia Selezneva
ba2f211384 Remove ScriptModificationListener from 183 branch
Since 183 changes in .gradle.kts files are tracked correctly by platform and notification 'Gradle project needs to be imported' is shown when those files are modified
2018-12-25 15:32:26 +03:00
Natalia Selezneva
6042a3a0f7 Scripts: fix NPE during accessing ScriptDependenciesCache
Getting value from SLRUMap needs write lock, because it can move value from one queue to another
EA-105195 Fixed
2018-12-25 15:32:26 +03:00
Natalia Selezneva
8ceae8bd6d Fix 'Invalid file' exception during script dependencies update
Fix EA-125840 - assert: FileManagerImpl.findFile
2018-12-25 15:32:25 +03:00
Natalia Selezneva
816a8d74a2 Fix order of initialization of project language version in ConfigureKotlinTest
Project.getLanguageVersion with contextModule == null returns latest stable version.
But Module.getLanguageVersion save it's version to project setting if useProjectSettings checkbox is selected.
So Project.getLanguageVersion can return different versions before and after invocation Module.getLanguageVersion
2018-12-25 15:32:25 +03:00
Dmitriy Dolovov
073c02c0f5 CIDR: Ability to relax upper limit of product version in K/N plugin
Issue #KT-29006:fixed
2018-12-25 18:54:21 +07:00
Dmitry Petrov
61ebe6a9aa Minor: add non-intrinsified cases for javaObjectType/javaPrimitiveType 2018-12-25 13:23:48 +03:00
Toshiaki Kameyama
d00236d366 "Remove redundant backticks": Fix false positive for underscore
#KT-28592 Fixed
2018-12-25 10:37:18 +03:00
Mikhail Zarechenskiy
84222afe2f Fix exception when expected type is subtype of a function type
#KT-28984 Fixed
 #EA-132850 Fixed
2018-12-24 19:41:51 +03:00
Simon Ogorodnik
68c65a5014 KT-25156: Fix stack overflow on top level destructuring with lambda init
Support destructuring in additional resolve pass (resolveToElements)
 #KT-25156 Fixed
2018-12-24 18:29:48 +03:00
Simon Ogorodnik
fefd2bf427 KT-23268: Highlight destructuring declaration entries as properties
#KT-23268 Fixed
2018-12-24 18:29:47 +03:00
Dmitry Petrov
a4897641d4 Minor: mute some tests in JS/JS_IR 2018-12-24 16:10:35 +03:00
Dmitry Petrov
6768ae02c3 Support inline classes in javaObjectType/javaPrimitiveType
#KT-28290 Fixed Target versions 1.3.30
2018-12-24 16:10:31 +03:00
Dmitry Petrov
5abbf3562b Unbox possibly null inline class value mapped to primitive type 2018-12-24 16:09:48 +03:00
Dmitry Petrov
2f6c4a0472 Use original method signature to call accessor for hidden constructor
#KT-28855 Fixed Target versions 1.3.30
2018-12-24 16:09:44 +03:00
Ilmir Usmanov
10f0a2f660 Obtain correct captured suspend local function
if we call the function inside, for example, lambda.
 #KT-28844 Fixed
2018-12-24 15:58:10 +03:00
Mikhael Bogdanov
ac5f5bd453 Get rid of jvm specific code in some tests 2018-12-24 13:40:40 +01:00
Mikhail Glukhikh
7d51be17c8 Extract 'PsiElement.hasJavaResolutionFacade()' (related to KT-28199) 2018-12-24 15:00:57 +03:00
Mikhail Glukhikh
d599bb160f Launch constructor delegation search only for elements from a file
This should fix EA-133791
2018-12-24 14:58:25 +03:00
Mikhail Glukhikh
399ec5c961 Launch convention method reference search only for elements from a file
#KT-28199 Fixed
2018-12-24 14:57:53 +03:00
Mikhail Zarechenskiy
e4a4d1169e Prohibit JvmOverloads on constructors of annotation classes
In LV >= 1.4 & -progressive

 #KT-25702 Fixed
2018-12-24 12:48:00 +03:00
Mikhail Zarechenskiy
958aeff94b Prohibit type parameters for local variables in LV >= 1.4 & -progressive
#KT-8341 Fixed
2018-12-24 12:47:58 +03:00
Mikhail Zarechenskiy
e509649132 Fix mapping of platform inline class types
For the inline class:
 ```
 inline class IC(val x: Int)
 ```

 Type (IC..IC?) should be mapped to the wrapper `IC`
 because it can hold object and also because it does so for primitives

 #KT-28983 Fixed
2018-12-24 12:32:22 +03:00
Dmitriy Dolovov
7c9ca99388 CLion: New version 2018.3.2 (183.4886.39) 2018-12-24 11:35:10 +07:00
Max Medvedev
ef49e792b0 AppCode/CLion: patch java plugin xmls in AppCode as well 2018-12-21 23:43:17 +03:00
Bernhard Posselt
19906f13ea Update Maps.kt 2018-12-21 22:01:01 +03:00
Bernhard Posselt
300f68e0d8 Add documentation on how merging works for toMap() for Iterables, Arrays and Sequences 2018-12-21 22:01:01 +03:00
Mads Ager
48bd99730d Suppress final failure which relies on line numbers. 2018-12-21 16:20:45 +01:00
Mads Ager
3a11322506 Enable bytecode text tests for the JVM_IR backend. 2018-12-21 16:20:45 +01:00
Mikhael Bogdanov
d1efac617d Get rid of reduntant jvm parts in tests 2018-12-21 16:09:12 +01:00
Mikhael Bogdanov
f59b6a350f Specify JVM target backend for other java related tests 2018-12-21 16:09:11 +01:00
Mikhael Bogdanov
d76cb32781 Specify JVM target backend for test with java type inheritance 2018-12-21 16:09:11 +01:00
Mikhael Bogdanov
3c048d7f57 Specify JVM target backend for test with casts to jvm types 2018-12-21 16:09:10 +01:00
Mikhael Bogdanov
3e6f8db975 Specify JVM target backend for test with 'import kotlin.reflect.jvm' 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov
a75d57a20b Remove redundant jvm reflection import 2018-12-21 16:09:09 +01:00
Mikhael Bogdanov
a2904b8e53 Regenerate test data 2018-12-21 16:09:08 +01:00
Mikhael Bogdanov
f4e532e449 Specify JVM target backend for test with '@JvmXXX' annotations 2018-12-21 16:09:07 +01:00
Mikhael Bogdanov
a8a1bfca72 Specify JVM target backend for test with '// File: *.java' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov
3ef06c1e44 Specify JVM target backend for test with 'import java...' 2018-12-21 16:09:06 +01:00
Mikhael Bogdanov
f36519d4f5 Specify JVM target backend for test with '.javaClass' usage 2018-12-21 16:09:05 +01:00
Mikhael Bogdanov
1217d3591b Specify JVM target backend for test with '::class.java' usage 2018-12-21 16:09:04 +01:00
Mikhael Bogdanov
a2e4553040 Minor. Remove obsolete supressions 2018-12-21 16:09:04 +01:00
Ilya Chernikov
c4b3580c31 Implement script filename extensions discovery via artifact transforms
to avoid using never-up-to-date task and make discovery cacheable and
checkable for up-to-dateness
#KT-28469 fixed
2018-12-21 15:44:48 +01:00
Ilya Chernikov
a3217982f7 Fix script filename extension discovery from asm-readed class
and improve diagnostics on definition loading failure
2018-12-21 15:44:28 +01:00
Ilya Gorbunov
7c7c11e916 Fix current Kotlin version to avoid changing it in local builds 2018-12-21 17:21:50 +03:00
Shagen Ogandzhanian
6dd69ea3d6 Support named constructors in idl-backed code generation
this resolves https://youtrack.jetbrains.com/issue/KT-27361
2018-12-21 14:53:59 +01:00
Ilya Gorbunov
68f898153c Fix link to sealed classes doc page
#KT-28829 Fixed
2018-12-21 16:25:43 +03:00
Marcin Moskala
686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Marcin Moskala
33961acb8d Fix typos in spec-docs 2018-12-21 16:06:51 +03:00
Nikolay Krasko
5d08df1bf7 Remove ignore roots added by IdeaOpenApiClassFinder
Fixed in newer IDEA build.
2018-12-21 16:06:51 +03:00
Nikolay Krasko
9dd40cb904 Extract contributing guide for better GitHub integration 2018-12-21 16:06:51 +03:00
Nikolay Krasko
58b7277ea8 Update to 183.4886.37 2018-12-21 16:06:51 +03:00
Nikolay Krasko
f03a3945c5 Rethrow IndexNotReady exceptions without modifications 2018-12-21 16:06:50 +03:00
Ilya Gorbunov
614139755c Minor: fix Random companion reference in docs
Random's companion is named 'Default' rather than 'Companion'
2018-12-21 14:17:25 +03:00
Ilya Chernikov
71729f8e8f [minor] use psi original file if virtual file is not available...
for script dependencies, fixes completion tests
2018-12-20 17:09:24 +01:00
Ilya Chernikov
44ea2bf1d4 Introduce script names and location ids, use them in diagnostics and...
for virtual file names. Also fix compiled script serialization.
2018-12-20 17:09:23 +01:00
Ilya Chernikov
77095cb895 [minor] add missing dependency 2018-12-20 17:09:22 +01:00
Ilya Chernikov
e4f245d15a Implement script dependencies collection tests 2018-12-20 17:09:22 +01:00
Ilya Chernikov
48965fb64a [minor] refactor scripting tests: extract cli testdata into separate dir, remove annotation 2018-12-20 17:09:21 +01:00
Ilya Chernikov
c165666d94 Refactor core env: extract script compilation dependencies collection 2018-12-20 17:09:20 +01:00
Ilya Chernikov
8529ed314c [minor] fix compilation - avoid proguarding of addToStdLib.kt 2018-12-20 17:09:20 +01:00
Ilya Chernikov
1e74ab5a62 Implement import test, fix import support in compiler and evaluator 2018-12-20 17:09:19 +01:00
Ilya Chernikov
fce68102bd Implement imported scripts evaluation and construction 2018-12-20 17:09:18 +01:00
Ilya Chernikov
19a969a521 Implement script import support in the compiler 2018-12-20 17:09:17 +01:00
Ilya Chernikov
729ebcac9b Implement simple "add to compilation" functionality for scripts
(incomplete import - scripts added to the compilation but not yet
imported into scope)
Base functionality needed for #KT-27960
2018-12-20 17:09:16 +01:00
Dmitry Petrov
57c12476d7 Provide parent reference for temporary variables immediately 2018-12-20 15:57:31 +03:00
Mikhael Bogdanov
4e53e7d663 Inline OPTIMIZATION_ASM_API_VERSION constant 2018-12-20 12:55:12 +01:00
Mikhael Bogdanov
026ac1bee6 Inline API constant 2018-12-20 12:55:11 +01:00
Mikhael Bogdanov
f900d598c7 Inline ABI_EXTENSION_ASM_API_VERSION 2018-12-20 12:55:10 +01:00
Mikhael Bogdanov
87d99907f6 Remove redundant proguard option
Removed option is covered by
 -keep class org.jetbrains.org.objectweb.asm.Opcodes { *; }
2018-12-20 12:55:09 +01:00
Mikhael Bogdanov
c19c979b7d Use last asm api for visitor construction 2018-12-20 12:55:09 +01:00
Mikhael Bogdanov
c2837cf7d9 Switch buildSrc to ASM7 Jetbrains ASM 2018-12-20 12:55:08 +01:00
Mikhael Bogdanov
2072d7806f Switch kotlinp to ASM7 Jetbrains ASM 2018-12-20 12:55:07 +01:00
Alexander Udalov
f5ff3d2fa9 Remove directives that have no effect from bytecode text tests
All bytecode text tests are run with stdlib in the classpath and only
for JVM backend, therefore directives WITH_RUNTIME, TARGET_BACKEND,
IGNORE_BACKEND are not needed
2018-12-20 12:53:24 +01:00
Alexander Udalov
00caa23307 Do not support LANGUAGE_VERSION directive in codegen tests
Test data of crossinline_1_2.txt has changed because now we do not
automatically enable 1.2 (with _all_ of its features) when we're
executing a common coroutines test with old coroutines; and so the
NewCapturedReceiverFieldNamingConvention language feature (which is
introduced in 1.3) is now enabled in this test
2018-12-20 12:53:24 +01:00
Alexander Udalov
77c87fa6c9 Remove API_VERSION 1.3 from compiler tests
So that these tests will now check behavior on the latest API version
2018-12-20 12:53:23 +01:00
Alexander Udalov
37e1b486f4 Minor, remove obsolete API_VERSION directives 2018-12-20 12:53:23 +01:00
Alexander Udalov
d58cf4a83a Minor, fix language versions in two diagnostic tests on coroutines 2018-12-20 12:53:23 +01:00
Alexander Udalov
a0a70dd60d Remove LANGUAGE_VERSION from compileKotlinAgainstKotlin tests
Support test directives not at the beginning of the test file for
multi-file tests where separate files need separate language features
2018-12-20 12:53:23 +01:00
Alexander Udalov
ec2dd58165 Remove LANGUAGE_VERSION from codegen tests on coroutines
Use `// !LANGUAGE: -ReleaseCoroutines` instead in tests which require
old (1.2) coroutines, and nothing in tests which require new coroutines
because master is already 1.3. Also remove superfluous API_VERSION and
other directives which have no effect anymore. Do not include runtime
automatically with `WITH_COROUTINES`/`COMMON_COROUTINES_TEST` in box
tests; require `WITH_RUNTIME` for that (majority of tests already had it
anyway), but remove it from bytecode text tests where runtime is always
added automatically. Fix the coroutine package selection code in
KotlinTestUtils and update the bunch files correspondingly.

Disable tests in `box/coroutines/noStdLib` on JVM: despite the name,
these tests were launched with stdlib because of the code in
CodegenTestCase, and they do not work without it because at least
CoroutineUtil.kt requires stdlib to compile correctly
2018-12-20 12:53:23 +01:00
Alexander Udalov
5b58eb8491 Remove LANGUAGE_VERSION from non-coroutine codegen tests
Most of these tests used this directive as a way to opt in to a new
language feature, and most of those features are already stable for a
long time, so no opt-in is needed. Some other tests used the directive
to opt out from a language feature, replace those by the `LANGUAGE`
directive. One test used the directive to test behavior that actually
depended on the API version; use `API_VERSION` directive there instead.
2018-12-20 12:53:23 +01:00
Alexander Udalov
e3c381a298 Remove API_VERSION 1.3 from tests on JvmDefault
So that these tests will now check behavior on the latest API version
2018-12-20 12:53:23 +01:00
Alexander Udalov
9b6a52ccba Remove LANGUAGE_VERSION from boxInline tests 2018-12-20 12:53:22 +01:00
Alexander Udalov
0871a3cc4d Use API_VERSION instead of LANGUAGE_VERSION in IEEE754 tests
See `ExpressionCodegen.genEqualsForExpressionsPreferIeee754Arithmetic`:
the behavior here actually depends on the API version, not any language
feature
2018-12-20 12:53:22 +01:00
Alexander Udalov
83528a75be Minor, fix typo in IEEE754 bytecode text tests
The runtime function in kotlin.jvm.internal.Intrinsics is called
"areEqual", not "areEquals"
2018-12-20 12:53:22 +01:00
Andrey Uskov
250eee48a1 Fix reimport of Kotlin projects created via wizard
#KT-27941 Fixed
2018-12-20 13:56:41 +03:00
Ilya Matveev
e520c98182 Fix K/N test for windows: rename target usage 2018-12-20 10:24:48 +03:00
Vyacheslav Gerasimov
95a3b337c6 Build: add instrumentation to all JavaCompile tasks 2018-12-19 20:59:34 +03:00
Vyacheslav Gerasimov
9ad899fb01 Fix splitExportedSuspendInlineFunctionDeclarations usages, argument must not be null 2018-12-19 20:43:15 +03:00
Mikhail Glukhikh
93882736ed OverrideMemberChooserObject refactoring: introduce MemberGenerateMode 2018-12-19 19:56:16 +03:00
Mikhail Glukhikh
ca3d758fba Create expect/actual class: fix inline class generation
#KT-28744 Fixed
#KT-28745 Fixed
2018-12-19 19:55:56 +03:00
Mikhail Glukhikh
d3a5b0dcd6 MPP JVM/JS wizard: fix classpath of 'run' task #KT-28869 Fixed 2018-12-19 19:55:40 +03:00
Mikhail Glukhikh
55666f3f03 MPP wizard tests: use 1.3.20-eap-25 2018-12-19 19:55:27 +03:00
Dmitry Petrov
e5d946a96c Parent for thisReceiver of IrLazyClass is the corresponding class
Fixes issue in Kotlin/Native.
2018-12-19 15:48:07 +03:00
Ilya Matveev
c5783c5abd Fix native binary tests for Windows 2018-12-19 19:20:04 +07:00
Toshiaki Kameyama
c248fa71c8 Add ConvertToAlsoIntention to plugin-common.xml 2018-12-19 15:10:34 +03:00
Dmitry Petrov
85f55dec9a Support SAM conversion in psi2ir
SAM conversion takes a function value (function type or a subtype),
and produces a SAM interface value.
2018-12-19 10:58:34 +03:00
Dmitriy Dolovov
2c327564d5 CIDR: Better detection when running in CIDR-based IDE
- Drop unnecessary bunch files for `KotlinFacetType` and `KotlinFacetTypeImpl`
- Use cached val `isRunningInCidrIde` to check if the code is running under CIDR
2018-12-19 11:20:54 +07:00
Vyacheslav Gerasimov
38efc7e823 Remove useless bunch for KaptWithKotlincTask 2018-12-18 21:58:32 +03:00
Alexander Udalov
c1ef89df2c Make anonymous classes for callable references synthetic
#KT-28453 Fixed
2018-12-18 17:48:19 +01:00
Shagen Ogandzhanian
ca4521d57d Support ClipboardEvent in definitions generated from idl 2018-12-18 15:07:34 +01:00
Pavel Punegov
d90a92ae06 Add stdlib to composite build of Kotlin + Kotlin/Native 2018-12-18 16:06:17 +03:00
Roman Artemev
e436e7cf61 [JS IR BE] Support call super with default parameters 2018-12-18 15:55:09 +03:00
Alexey Tsvetkov
df69e25d56 Refactor: move logging code to org.jetbrains.kotlin.gradle.logging 2018-12-18 15:23:13 +03:00
Alexey Tsvetkov
c87c5f11aa Report compiler messages from daemon in Gradle thread
#KT-28836 fixed

RMI messages are reported from RMI threads.
When Gradle logger is used from non-Gradle thread,
messages are not grouped in command-line
and they are not shown in build scans.
To fix this, we store all messages from Kotlin daemon
in a buffer, then report them from a Gradle thread.
2018-12-18 15:23:13 +03:00
Alexey Tsvetkov
78d9cd1277 Use task's logger where appropriate
KT-28836

Using project's logger prevents messages
from showing in task's output (in command-line and build scans)
2018-12-18 15:23:13 +03:00
Roman Artemev
256317da15 [IR BE] Fix SharedVariableLowering
* make it able to detect shared vars under any declaration kind, not only IrFunction
 * Add & update tests
2018-12-18 15:19:17 +03:00
Vadim Brilyantov
04395366fa add stats collertors extensions to plugin-common_xml 2018-12-18 15:06:21 +03:00
Ilya Matveev
eed41ea405 Add a klib export method consuming a configure action 2018-12-18 18:34:56 +07:00
Ilya Matveev
b668a896ba Don't create run tasks for non-host targets 2018-12-18 18:34:56 +07:00
Ilya Matveev
0a253ef30a Change executable of a run task when binary's baseName is changed 2018-12-18 18:34:56 +07:00
Ilya Matveev
7b1552f3d6 Add tests for new binaries DSL 2018-12-18 18:34:55 +07:00
Ilya Matveev
833e9a90a2 Update Kotlin/Native: 1.1.0-rc1-5227 2018-12-18 18:34:55 +07:00
Ilya Matveev
6f6764a42f Fix existing MPP tests 2018-12-18 18:34:55 +07:00
Ilya Matveev
2a889ef350 Don't hardcode a toolchain path for K/N on Windows 2018-12-18 18:34:55 +07:00
Ilya Matveev
1748eef4cd Fix error message about incorrect kotlin.native.home property 2018-12-18 18:34:55 +07:00
Ilya Matveev
9592a14367 Support aggregate tasks to build binaries per compilation 2018-12-18 18:34:55 +07:00
Ilya Matveev
ad3aac6f90 Support free compiler args for binaries 2018-12-18 18:34:55 +07:00
Ilya Matveev
89c1170e5d Allow changing base name for a Kotlin/Native binary 2018-12-18 18:34:54 +07:00
Ilya Matveev
a28902d358 Support bitcode embedding for frameworks 2018-12-18 18:34:54 +07:00
Ilya Matveev
c963da7761 Support -Xexport-library for K/N in the MPP plugin 2018-12-18 18:34:54 +07:00
Ilya Matveev
0bcb253e53 Provide aggregate link tasks 2018-12-18 18:34:54 +07:00
Ilya Matveev
ea21662bed Provide an extended DSL for final native binaries
In 1.3.0 only basic settings for final native binaries (e.g.
executables or frameworks) are available. They allow a user to
specify what kinds of binaries should be produced from one or another
compilation but they don't allow specifying different options for
different binaries or creating more than 2 (debug and release)
binaries of the same kind (e.g. executable) from the same
compilation. Also link tasks for these binaries are created after
project evaluation thus they are inaccessible for a user outside
of an afterEvaluate block.

This patch adds an extended binary DSL allowing a user to declare
binaries independently from compilations and to specify different
options (e.g. linker arguments) for different binaries. Also
link tasks for binaries declared in this DSL are created at a
configuration time so user can access them outside of an
afterEvaluate block.

Also this patch adds creating run tasks for all executables
declared in the buildscript (KT-28106)

Initial DSL methods for binaries declaration are still supported.

Kotlin DSL example is the following:

kotlin {
    macosX64 {
        binaries {
            // Create debug and release executable with
            // a name prefix 'Foo'.
            // Two domain objects will be created:
            // fooDebugExecutable and fooReleaseExecutable
            executable("Foo", listOf(RELEASE, DEBUG)) {
                compilation = compilations["foo"]
                entryPoint = "foo.main"
                linkerOpts.add("-Llib/path")
                println(runTask.name)
            }

            // Name prefix and build types are optional.
            // debugFramework and releaseFramework are created here.
            framework()
        }
    }
}
2018-12-18 18:34:54 +07:00
Shagen Ogandzhanian
44af5b783f Introduce TrackEvent, MediaStreamTrackEvent-related IDL definitions 2018-12-18 12:19:12 +01:00
Georgy Bronnikov
3b16fa6af9 Do not generate interface delegation for default parameter stubs 2018-12-18 13:57:23 +03:00
Mikhail Zarechenskiy
c924a6efe8 Fix unbound class literals for inline classes
#KT-28361 Fixed
2018-12-18 11:35:36 +03:00
Mikhail Glukhikh
8f821c9ef5 Merge pull request #2033 from t-kameyama/KT-28699
KT-28699 Add "Convert to also" intention
2018-12-18 09:37:34 +03:00
Denis Zharkov
5052623c0b Minor. Add a comment to KtLightElement::givenAnnotations 2018-12-18 09:31:13 +03:00
Denis Zharkov
e0975df1c0 Create annotation arguments in ultra-light classes via PsiElementFactory 2018-12-18 09:31:13 +03:00
Denis Zharkov
5c083d798e Restrict search scope for KtUltraLightParameter
^KT-28365 Fixed
2018-12-18 09:31:13 +03:00
Denis Zharkov
859223baa2 Fix throws-list for case of kotlin.Throwable in ultra-light classes 2018-12-18 09:31:13 +03:00
Denis Zharkov
b16bfad079 Do not generate no-arg constructor for sealed ultra-light class 2018-12-18 09:31:13 +03:00
Denis Zharkov
2f8b214e76 Support annotation based on descriptor in ultra-light classes
It helps to generate properly the annotations for delegates
Also note in test, that annotations in Base class have really weird
text of arguments and also don't have names
2018-12-18 09:31:13 +03:00
Denis Zharkov
63907b1a6b Minor. Introduce typeMapper val into UltraLightSupport
To avoid multiple creation
2018-12-18 09:31:13 +03:00
Toshiaki Kameyama
f2cf3a8e7b Replace with binary operator: don't suggest for non-operator function
#KT-12273 Fixed
2018-12-18 09:30:38 +03:00
Toshiaki Kameyama
ea0f9d124d Split property declaration: don't add parentheses for anonymous function
#KT-7593 Fixed
2018-12-18 09:28:57 +03:00
Toshiaki Kameyama
6a4c6eacd7 Add "Convert to also" intention
#KT-28699 Fixed
2018-12-18 12:21:56 +09:00
Shagen Ogandzhanian
c1f75d2324 Introduce idl definition for SVGMaskElement 2018-12-17 16:11:22 +01:00
Vyacheslav Gerasimov
7155c5c0be 173: Remove obsolete bunch file for idea-gradle/build.gradle.kts 2018-12-17 16:17:20 +03:00
Sergey Igushkin
67e82a54e5 Fix Gradle 5.0 deprecation warnings:
* DefaultSourceDirectorySet constructor is deprecated -> objects()
* IvyRepository.layout('pattern') { } is deprecated -> patternLayout { }

Issue #KT-26808 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin
557fb07f44 Fix the localToProject attribute schema for Gradle 4.10.2+
In Gradle 4.10.2, a change was made in the attributes disambiguation
process: if some of the candidates have a single attribute value and
others don't have that attribute (i.e. have a null value), the
disambiguation rule for that attribute doesn't get called.
Effectively, null values are excluded from disambiguation, but still may
cause ambiguity (sic!)

See: https://github.com/gradle/gradle/issues/6747#issuecomment-445921139

This change affected our attribute `localToProject` that we use to
disambiguate the deprecated but still consumable configurations like
`compile`, `runtime`, `testCompile`, `testRuntime` from those
configurations which should have priority during project dependency
resolution: the `*Element` ones. Our scheme marked the former
configurations with the attribute and the latter were not marked, with
a disambiguation rule that preferred null values.

To fix this logic with Gradle 4.10.2, we instead mark both kinds of
configurations with the attribute, which now has a value 'public'
that is preferred by the rule over the other values. We also make sure
that the attribute doesn't leak into the published Gradle metadata, as
it is only needed for project-to-project dependencies resolution.

Issue #KT-28795 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin
2349aaf488 Workaround for ConcurrentModificationException in KotlinModelBuilder
In Gradle 5.0, iterating over the `.withType<...>()` result below
caused a ConcurrentModificationException. Workaround that by first
collecting the items into a list.
2018-12-17 16:09:56 +03:00
Sergey Igushkin
d7522e2283 Fix some tests for Gradle 5.0 and update some dependency versions
* Introduce GradleVersionRequired.InRange and thus prevent older
tests (e.g. Android 2.3.0) from running with newer Gradle versions

* Add a task outputs pattern suitable for Gradle 5.0

* Run some of the Android tests with AGP 3.1.0 (and Gradle 4.4) instead
of 3.0.0 to ensure compatibility with Gradle 5.0

* Update test projects according to Gradle 5.0 dropped deprecated
features: classesDir, left-shift operator, default org.gradle.util.*
imports

* Fix a Gradle test after Gradle 5.0 changed `publishing` behavior to
run the closure eagerly rather than after evaluation
2018-12-17 16:09:56 +03:00
Sergey Igushkin
5f21ced26b Advance test Gradle version to 5.0 2018-12-17 16:09:56 +03:00
Vyacheslav Gerasimov
e422eb56b2 173: Fix test compilation for AS 3.1 2018-12-17 15:57:06 +03:00
Alexey Tsvetkov
2196d81322 Enable JS IC by default
#KT-28842 Fixed
2018-12-17 15:46:11 +03:00
Alexey Tsvetkov
ce9150f2b2 Add project property to disable AP discovery in compile classpath
AP discovery in compile classpath can be disabled in all subprojects
by adding "kapt.include.compile.classpath = false" to 'gradle.properties' file.

KT-24530

The setting can be overrided per project by using KAPT DSL
in a 'build.gradle' file:
```
kapt {
    includeCompileClasspath = false
}
```
2018-12-17 15:41:34 +03:00
Vadim Brilyantov
7fb43144d4 fix KotlinVersion and set it to be 1_3_0 2018-12-17 15:07:10 +03:00
Mikhael Bogdanov
1a0c3dfaa6 Use last ASM version to read binaries
#KT-28798 Fixed
2018-12-17 12:18:52 +01:00
Alexey Tsvetkov
0ea7716eb1 Test that javac is loaded once when worker is reused 2018-12-16 04:28:44 +03:00
Ting-Yuan Huang
6c627fa5c1 Cache classloaders for tools.jar and kapt in Gradle workers
#KT-28852 fixed

The loaders and hence some classes were repeatedly loaded and
jit-compiled everytime when KaptExecution were dispatched. Those
classes, like JavaCompiler, can be very large and therefore created a
significant overhead. In some projects, the overhead accounted for more
than 40% of total CPU time of annotation processing.

This change tries to cache the classloaders so that they won't be
reloaded and re-jitted.
2018-12-16 04:28:44 +03:00
Alexey Tsvetkov
1ba6d5361b Run in-process compiler in separate thread
The compiler uses thread local values,
so when the compiler runs Gradle's thread,
it leaks classes preventing
a compiler's classloader from being collected.

    #KT-28037 fixed
2018-12-15 23:39:06 +03:00
Alexey Tsvetkov
a6fca47871 Minor: remove unused util 2018-12-15 23:39:06 +03:00
Alexey Tsvetkov
cab32f0e43 Print stacktrace to Gradle logger instead of writing directly to stderr 2018-12-15 23:39:06 +03:00
Vadim Brilyantov
bc08c966a8 fix RenameKotlinFileProcessor for 173 bunch 2018-12-14 20:20:57 +03:00
Vadim Brilyantov
1fcf8a5587 add 173 bunch for build_gradle_kts of usage-statistics 2018-12-14 20:19:23 +03:00
Vadim Brilyantov
fb12de8ff6 fix stats reporters (dummies) Rename Handlers for 181 bunch files
fix bunch files again

fix RenameBackingFieldReferenceHandler for 181 bunch

fix RenameKotlinImplicitLambdaParameter for 181 bunch
2018-12-14 20:19:22 +03:00
Vadim Brilyantov
65982bbee8 disable statistics for 181 as FUS is only available since 182 2018-12-14 20:19:22 +03:00
Vadim Brilyantov
15fec50a0f remove intensions and quickfixes triggers (already present in Idea) 2018-12-14 20:19:20 +03:00
Vadim Brilyantov
93d93cd40e fix report kotlin targets for android case 2018-12-14 20:19:19 +03:00
Vadim Brilyantov
df5ec5c218 report stats for pullUp/pushDown refactorings
tmp
2018-12-14 20:19:19 +03:00
Vadim Brilyantov
37239cbcd7 report stats for all renaming refactorings 2018-12-14 20:19:18 +03:00
Vadim Brilyantov
00f630b31d add target reporting 2018-12-14 20:19:17 +03:00
Vadim Brilyantov
c307d07b47 fix build for idea plugin with usage statistics 2018-12-14 20:19:16 +03:00
Vadim Brilyantov
ae9f16d964 trigger intentions, inspections and some of rename refactorings 2018-12-14 20:19:15 +03:00
Vadim Brilyantov
1b716ea2ee create usage-statistics module 2018-12-14 20:19:14 +03:00
Shagen Ogandzhanian
714b4f25c0 Introduce better typing for on[event-name] attributes from idl
see https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2548
2018-12-14 13:17:41 +01:00
victor.petukhov
8c0ad321e2 Add black box tests for objects inheritance problem (KT-25289) 2018-12-14 14:36:17 +03:00
victor.petukhov
fc381e25c8 Remove diagnostic tags from black box spec tests for annotations 2018-12-14 14:36:17 +03:00
victor.petukhov
f3774b8e19 Add black box spec tests validation 2018-12-14 14:36:16 +03:00
Denis Zharkov
a422db91b2 Transform KotlinClassFinder::findKotlinClass to extension 2018-12-13 20:38:25 +03:00
Denis Zharkov
f153d97f40 Avoid multiple subsequent reading of the same class-file in front-end
^KT-23466 Fixed
2018-12-13 20:38:24 +03:00
Denis Zharkov
bc61e5a3bc Minor. Reformat BinaryJavaClass 2018-12-13 20:37:46 +03:00
Denis Zharkov
e59d9bf9e4 Convert JavaClassFinder.java to kotlin 2018-12-13 20:37:46 +03:00
Denis Zharkov
9ddee565e0 Convert JavaClassFinder.java to kotlin: rename file 2018-12-13 20:37:46 +03:00
Denis Zharkov
0a70a957e9 Minor. Reformat LazyJavaPackageScope.kt 2018-12-13 20:37:46 +03:00
Ilya Chernikov
77a4505ec2 [minor] get rid of obsolete "environment" wording 2018-12-13 18:00:12 +01:00
Ilya Chernikov
0b9770f8d1 Refactor scripting - rename env vars to provided properties everywhere 2018-12-13 18:00:12 +01:00
Ilya Chernikov
9e5d04b836 Add generic interfaces to dependency resolvers 2018-12-13 18:00:11 +01:00
Ilya Chernikov
e0a542234f Add script config refinement before compilation into API 2018-12-13 18:00:10 +01:00
Ilya Chernikov
3fe324bbb4 Add UrlScriptSource 2018-12-13 18:00:08 +01:00
Ilya Chernikov
fb929c290d [minor] copy utility fun to reduce dependencies 2018-12-13 18:00:08 +01:00
Ilya Chernikov
5602bcf9e1 Fix vararg argument mapping for generic args convertor 2018-12-13 18:00:07 +01:00
Ivan Gavrilovic
6b20ef0208 Complete Java usage tracker if analysis extension finishes (KT-27487)
In cases when kapt compiler plugin runs in stubs generation mode,
Java usage tracker was not completed. This caused issues with
the incremental compilation if Java files changed.

E.g. if a constant defined in Java source file changed, stubs
would not be recompiled because the Java usage tracker would
not report changed type. This commit fixes that issue.
2018-12-13 17:12:08 +03:00
Pavel V. Talanov
dec2da8247 dumbUtils: remove console spam 2018-12-13 14:35:05 +01:00
Pavel V. Talanov
1d7a74bfcd Minor: fix exception message 2018-12-13 14:35:04 +01:00
Alexander Udalov
8c74312cf6 Fix isInitialized for companion lateinit properties
Instead of trying to access a missing field `Foo.foo`, call the
synthetic accessor `Foo.access$getFoo$cp` which, as per previous commit,
no longer contains the lateinit assertion

 #KT-21862 Fixed
2018-12-13 14:12:33 +01:00
Alexander Udalov
43413fcc44 Move lateinit assertion for companion property to companion object
Previously, for a property named `x` in the companion object of a class
named `Foo`, we generated:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x` and lateinit
  assertion
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`

Now, we generate:
- `Foo.access$getX$cp`, consisting of `GETFIELD Foo.x`
- `Foo.Companion.getX`, consisting of `INVOKEVIRTUAL Foo.access$getX$cp`
  and lateinit assertion

The reason is that this way we can avoid generating another accessor and
reuse `Foo.access$getX$cp` in case `isInitialized` is called on a
lateinit property from companion.

For private properties, getX is not generated, but instead the assertion
is generated on each access to the field (which can be improved, see
KT-28331). The same happens for access to non-private properties from
inside the same context where they're declared.

 #KT-21862 In Progress
2018-12-13 14:12:33 +01:00
Alexander Udalov
8617365983 Minor, reformat & fix warnings in intermediateValueForProperty 2018-12-13 14:12:32 +01:00
Alexey Tsvetkov
8aa069a774 Make AbstractJvmAbiContentTest system independent 2018-12-13 15:39:39 +03:00
Alexey Tsvetkov
7953a9154c Register classpath as inputs of SmartJavaExec tasks 2018-12-13 15:39:39 +03:00
Alexander Udalov
bbc7edf9d1 Fix incorrect character replacement in ClassName.jvmInternalName
#KT-28682 Fixed
2018-12-13 13:23:45 +01:00
victor.petukhov
725832a281 Fix incomplete printing of exceptions (of the all types) in tests 2018-12-13 12:50:10 +03:00
Nikolay Krasko
0a8e29838f Add file comparison feature to surround with tests 2018-12-13 12:36:02 +03:00
Nikolay Krasko
0482fe9414 Move check with selection tags to base check 2018-12-13 12:36:02 +03:00
shiraji
06dad5f45b Surround with try/catch should generate more Kotlin-style code (KT-5435)
#KT-5435 Fixed
2018-12-13 12:36:02 +03:00
Nikolay Krasko
c7c51a3d6b Refactoring: drop MoveDeclarationsOutHelper object 2018-12-13 12:36:02 +03:00
Nikolay Krasko
8dd02126d9 Convert MoveDeclarationsOutHelper to Kotlin and minor improvements 2018-12-13 12:36:02 +03:00
Nikolay Krasko
eda1f1f3a0 Convert MoveDeclarationsOutHelper to Kotlin - rename 2018-12-13 12:36:02 +03:00
Nikolay Krasko
5fb90a8a81 Better caret position after Insert curly braces around variable (KT-28739)
Introduce helper class and move caret to it's original position.

 #KT-28739 Fixed
2018-12-13 12:36:01 +03:00
Nikolay Krasko
44a36e70ec Exit when property has no name (EA-129932) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
aada1e4c1b Do not try to run reformat inspection on read-only file (EA-126979) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
fc4971aa98 Minor: log instead of asserting error (EA-126493) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
a5724293b0 Diagnostic null value in operations node (EA-126606) 2018-12-13 12:36:01 +03:00
Nikolay Krasko
7c23564bc5 Minor: fix nullability warnings and extract method 2018-12-13 12:36:00 +03:00
Nikolay Krasko
1d3d86023e Log NPE from getting operation reference in binary expression (EA-129499) 2018-12-13 12:36:00 +03:00
Andrey Uskov
ffb277d978 Fix KT-28626, KT-27263, KT-27718 in Idea 191 2018-12-12 19:04:56 +03:00
Andrey Uskov
595e75e059 Fix build in bunch 191 2018-12-12 19:04:15 +03:00
Vyacheslav Gerasimov
201522c6c8 as31: Fix KaptWithKotlincTask compilation 2018-12-12 17:58:29 +03:00
Vyacheslav Gerasimov
b942f00409 as31: set intellijUltimateEnabled flag 2018-12-12 17:58:29 +03:00
victor.petukhov
ee0fa2220e Fix incomplete printing of runtime exceptions in box tests 2018-12-12 17:44:05 +03:00
Mikhail Zarechenskiy
1d69f35f27 Revert "[NI] Take into account captured types for type depth computation"
This reverts commit 383c2d1bff.

 It seems this commit causes problems with bootstraping, so it'll be
 investigated and refined later
2018-12-12 17:41:30 +03:00
Leonid Startsev
fdf4f02dde Declare real external symbols for overriden by synthetic function
instead of unbound

Unbound symbols were throwing an exception on attempt to analyze them
in the other parts of compiler and are generally incorrect
2018-12-12 17:26:01 +03:00
Mikhail Glukhikh
a15b47c93c Add "Ambiguous context due to scope receiver in suspend fun" inspection
#KT-28696 Fixed
2018-12-12 17:10:37 +03:00
Shagen Ogandzhanian
44da3c89b7 Introduce PointerEvent-related definitions
* Resolves https://youtrack.jetbrains.com/issue/KT-23932
 * Backed by review https://upsource.jetbrains.com/kotlin/branch/KT-23932-POINTER-EVENT-FROM-REMOTE-IDL
2018-12-12 14:53:18 +01:00
Shagen Ogandzhanian
2d49268a0b Support float initializers in fun params generated from idl definitions 2018-12-12 14:12:27 +01:00
Mikhail Glukhikh
42fa6ce6f0 Refactor "change type to mutable" in suspicious collection reassignment
Related to KT-20626
2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
b17ee60c6f Change description of boolean argument/augmented assignment inspections 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
13b09f532c Boolean literal arguments: check previous arg, fix all args in a row 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
235b50d86e Boolean literal arguments: do not highlight with single boolean argument 2018-12-12 15:56:12 +03:00
Mikhail Glukhikh
d31e0b9632 Boolean literal arguments: don't report on a call, just on an element 2018-12-12 15:56:12 +03:00
Toshiaki Kameyama
0d7116aa5d Introduce "Boolean literal arguments" inspection #KT-2029 Fixed 2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
aa9e48b9b6 Augmented list assignment inspection: add "replace with ordinary" fix
Relates to KT-20626
2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
ed8305995e Don't highlight "replace with +=" for read-only collections
Related to KT-20626
2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
c560aada3d Add "Suspicious collection reassignment" inspection #KT-20626 Fixed 2018-12-12 15:56:11 +03:00
Mikhail Glukhikh
3e936f64bf Introduce KtReferenceSearch to use LocalSearchScope, when possible
This fixes a set of problems in J2K tests in 183
#KT-28368 Fixed
2018-12-12 15:56:10 +03:00
Yan Zhulanow
ef08110354 Evaluator: Render inline class values using its toString() implementation (KT-27414) 2018-12-12 21:40:46 +09:00
Yan Zhulanow
425467ca99 Kapt: Switch to more appropriate way of converting URIs to Files 2018-12-12 21:40:46 +09:00
Yan Zhulanow
eb28ce3007 Fix Android Lint tests (182 bunch only) 2018-12-12 21:40:45 +09:00
Yan Zhulanow
f5bb9d5866 Remove Lint tests for annotation argument API check.
Looks like newer Lint API checker ignores type usage in annotations, so these tests are no more needed.
2018-12-12 21:40:45 +09:00
Yan Zhulanow
aa5f1cefd0 Fix testSimple() for "Remove Parcelable" action 2018-12-12 21:40:45 +09:00
Yan Zhulanow
648fb2ef0b AllOpen: Update test data (enum constructors are now private) 2018-12-12 21:40:45 +09:00
Yan Zhulanow
9ec321b918 Update debugger test data, fix the current behavior 2018-12-12 21:40:45 +09:00
Yan Zhulanow
1734726d50 Remove a magic constant from 'KotlinLambdaMethodFilter' 2018-12-12 21:40:45 +09:00
Yan Zhulanow
a6ba7e6e87 Revert "Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282)"
This reverts commit 6c868701
2018-12-12 21:40:45 +09:00
Yan Zhulanow
79bb609e1e Uast: Update test data (enum constructors are now private) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
0dda7bd7ca NoArg: Update test data (enum constructors are now private) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
a090541108 Kapt: Update test data (stub converter tests) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
1963571be3 Add missing 'disallowRootAccess()' to debugger and stub tests 2018-12-12 21:40:44 +09:00
Yan Zhulanow
dd49d35320 Fix backend tests after changing format of synthetic variables for inline functions 2018-12-12 21:40:44 +09:00
Yan Zhulanow
e6643ef2b7 Fix quick evaluation for array expressions (KT-13268) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
4b4d8dd660 Fix breakpoints for the same inline function nested calls (KT-22366)
This commit changes the format of the synthetic local variables for inline functions.
2018-12-12 21:40:44 +09:00
Yan Zhulanow
ae4f05cf62 Remove unneeded usage of the blocking invokeInManagerThread() (KT-24282) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
e12af0e2d1 Fix evaluation for captured inline classes (KT-28487) 2018-12-12 21:40:44 +09:00
Yan Zhulanow
27ea02929a Fix evaluation for static interface methods declared in Java (KT-23585) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
3d7b503cd6 Fix source mapping for stepping into package facades from libraries (KT-28028) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
3c8714696d Add a LookupLocation to 'getSyntheticExtensionProperties()', use it in 'DebuggerFieldSyntheticScopeProvider' 2018-12-12 21:40:43 +09:00
Yan Zhulanow
dc34f11f50 Evaluate: Enable 'foo_field' convention only for Jvm/Common code 2018-12-12 21:40:43 +09:00
Yan Zhulanow
8334769eb0 Refactoring: Replace 'ParametersDescriptor' with a simple 'List' 2018-12-12 21:40:43 +09:00
Yan Zhulanow
c88d8a5e0d Evaluate: Support synthetic 'field' variable evaluation (KT-28342) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
60d2490c45 Minor: Move changeSuperToMagicAccessor() function to its single use site, J2K it 2018-12-12 21:40:43 +09:00
Yan Zhulanow
9498eb8d4d Kapt: Preserve 'getJarPathForClass()' (used in kapt-cli) 2018-12-12 21:40:43 +09:00
Yan Zhulanow
ada71ce3cd Evaluate: Use '<name>_field' syntax for field value evaluation (KT-14075) 2018-12-12 21:40:42 +09:00
Yan Zhulanow
c2f33c0dfd Provide a default implementation for 'SyntheticScope' 2018-12-12 21:40:42 +09:00
Denis Zharkov
a83f0e5fb7 Add diagnostic for calling ConcurrentHashMap::contains by convention
^KT-18053 Fixed
2018-12-12 15:37:50 +03:00
Simon Ogorodnik
f8e7c8856a PerModulePackageCache: Process events where whole psi file was added 2018-12-12 15:28:16 +03:00
Simon Ogorodnik
1f6fde4bc2 KT-20706: Fix auto-popup completion after digit in KDoc
#KT-20706 Fixed
2018-12-12 15:27:20 +03:00
Alexander Podkhalyuzin
c607b8e556 Removed unnecessary warning
#KT-28360 Fixed
2018-12-12 14:34:04 +03:00
Mikhail Glukhikh
3889bb05d6 Do not modify highlighting settings for non-Kotlin files #KT-28716 Fixed 2018-12-12 14:20:06 +03:00
Alexey Tsvetkov
01fbcfad23 Minor: replace UsefulTestCase with KtUsefulTestCase
For some reason assertSameLinesWithFile from UsefulTestCase
fails with exception on TeamCity, whereas the one KtUsefulTestCase
does not
2018-12-12 02:53:13 +03:00
Alexey Tsvetkov
7c767e0789 Exclude InsnList from proguard
It is used by jvm-abi-gen plugin
2018-12-12 02:52:07 +03:00
Shagen Ogandzhanian
03966985a1 Add mininal test suite to idl2k, remove deprecated ANTLRFileStream 2018-12-11 22:46:01 +01:00
Alexey Tsvetkov
57f8f216d1 Exclude local variables and try catch blocks of non-inline functions from ABI 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
495cfec9e9 Check descriptor visibility before excluding method from ABI class 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
34d96dff28 Minor: rename const according to style guide 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
b87058b532 Attempt to fix ABI tests on TC
Locally they work fine
2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
09dbf427ee Disable removing private/synthetic/local classes temporarily 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
96f3c67b3b Report output classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
05c5196aaa Reuse BytecodeListingTextCollectingVisitor in tests 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
497df17eb7 Reuse TransformationMethodVisitor in ABI gen plugin 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
82eb7c17e6 Convert TransformationMethodVisitor: step 2 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
56b72c96eb Convert TransformationMethodVisitor: step 1 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
50d8fe611c Minor fixes after review 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
d54ce2da6f Exclude nested classes of private classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
64380f55d2 Report locations of errors in ABI classes tests 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
9dd09151f0 Add tests for compilation against abi classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
8992ee6280 Add tests for non-compatible ABI changes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
5891617674 Exclude clinit from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
519211036d Exclude synthetic classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
fe047a0092 Minor: extract function 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
f231817559 Delay I/O when transforming ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
d74185a74d Remove unused cosntant pool entries from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
3a29b337a0 Exclude private typealiases from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
1f5ca7274d Exclude local and private classes from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
7c2f7cab9a Exclude non-inline method bodies from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
903f6bc79b Exclude private members from ABI classes 2018-12-11 22:48:53 +03:00
Alexey Tsvetkov
33faa00184 Add plugin for JVM ABI classes generation
#KT-25128 Fixed

ABI class generation is implemented as a compiler plugin.
Command-line usage:
1. Add a path to 'jvm-abi-gen.jar' to the plguin classpath argument
(`-Xplugin`). By default the jar is located at
'kotlinc/lib/jvm-abi-gen.jar' in the kotlinc distribution archive.
2. Specify an output directory for ABI classes via
`-Pplugin:org.jetbrains.kotlin.jvm.abi:outputDir=<DIR>`.
2018-12-11 22:48:53 +03:00
Mikhail Glukhikh
7fcd29843e Fix JS compilation for branch 181 2018-12-11 22:14:44 +03:00
Mikhail Glukhikh
588e94b917 File rename: TargetPlatform.kt -> PlatformConfiguratorBase.kt
Made to match file content better
2018-12-11 22:07:41 +03:00
Simon Ogorodnik
e3aed04d96 Extract module info & target platform to separate frontend.common 2018-12-11 22:07:41 +03:00
Vyacheslav Gerasimov
cd614b5bf8 Build: fix missing dx sources 2018-12-11 21:59:52 +03:00
Vyacheslav Gerasimov
02fbdc54d9 Build: Fix up-to-date for :kotlin-compiler-client-embeddable:shadowJar
The task was never up-to-date because default jar and shadowJar tasks overwritten each other's output

 #KT-28656 Fixed
2018-12-11 18:11:53 +03:00
Ilya Chernikov
abc13589c8 Fix locking in script definition provider
fixes possible parallel modifications on definitions loading, e.g.
as in https://github.com/shyiko/ktlint/issues/287
2018-12-11 15:20:08 +01:00
Mikhail Glukhikh
b143a1c8f7 For each parameter not used: handle char sequences correctly
An enhancement for KT-27209
2018-12-11 16:42:04 +03:00
Mikhail Glukhikh
833f564f0e Disable extract actions on non-JVM classes #KT-28476 Fixed 2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
11909a86a8 For each parameter not used: introduce "replace with repeat"
An enhancement for KT-27209
2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
e06c995516 For each parameter not used: cleanup 2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
9aa1d1495b Redundant arrow: don't report on forEach call with underscore
#KT-27209 Fixed
2018-12-11 16:42:03 +03:00
Mikhail Glukhikh
c8c485d27e Redundant arrow: support removing of 'it ->' #KT-28631 Fixed 2018-12-11 16:42:03 +03:00
Denis Zharkov
92150d847a Unwrap InvocationTargetException in dependency injection
^KT-28348 Fixed
2018-12-11 16:12:28 +03:00
Denis Zharkov
957e7cd5f3 Optimize searching constructor delegation calls
^KT-28755 Fixed
2018-12-11 16:12:28 +03:00
Denis Zharkov
9e07b0d31a Minor. Reformat usagesSearch/utils.kt 2018-12-11 16:12:28 +03:00
Roman Artemev
2b436b493c Move test from js to common part 2018-12-11 16:11:01 +03:00
Alexey Tsvetkov
b6c975739c Deprecate AP discovery in compile configurations in Gradle
#KT-24368 Fixed
2018-12-11 16:08:16 +03:00
Alexey Tsvetkov
d6459e6c49 Add option to disable AP discovery in compile classpath
#KT-24530 Fixed

To disable discovery and enable avoidance for kapt tasks,
use "kapt.includeCompileClasspath = false"
2018-12-11 16:08:16 +03:00
Simon Ogorodnik
445c85f829 Support overriding module/library/sdk for particular light PsiClass
To support light R classes
2018-12-11 15:46:11 +03:00
Ilmir Usmanov
7f9e91eabe Use File.pathSeparator instead of : 2018-12-11 15:08:34 +03:00
Dmitry Petrov
08d1c47ac3 KT-14227 Intrinsify MutableMap.set
This fixes the most common (and rather annoying) bug in augmented
assignment desugaring with collection element receiver.

Fix is somewhat hackish: introduce an intrinsic for MutableMap.set,
thus bypassing discrepancies in 'get' and 'set' call generation.
Fixing it properly requires design decisions for corner cases where
ad hoc augmented assignment desugaring with collection element receiver
"accidentally" works, producing identical objects and vararg arrays for
arguments of 'get' and 'set'.
2018-12-11 12:43:03 +03:00
Yan Zhulanow
9a98a4525b ServiceLoaderLite: Support paths with spaces (KT-28527) 2018-12-11 17:45:46 +09:00
Mikhail Zarechenskiy
e8a8318ead [NI] Fix input/output types for callable reference atom
Input and output types are crucial for type variable fixation order and
 analysis of postponed arguments (callable references, lambdas).

 Specifically, if there is non-fixed type variable inside input types of
 a callable reference, then we'll postpone resolution for such callable
 reference.

 Initial example with the expected type `KMutableProperty1<*, F>` caused
 problems because input types were computed incorrectly (while there
 aren't input types here)

 #KT-25431 Fixed
2018-12-11 11:33:29 +03:00
Mikhail Zarechenskiy
6ebbb6eae3 [NI] Fix not-null smartcast on intersection of nullable types
#KT-28670 Fixed
2018-12-11 11:29:59 +03:00
Mikhail Zarechenskiy
383c2d1bff [NI] Take into account captured types for type depth computation
It's needed to estimate the count of steps for type approximation algorithm.
 After the estimated count of steps, we consider such type recursive and this
 algorithm returns some default value

 #KT-28598 Fixed
2018-12-11 11:29:55 +03:00
Denis Zharkov
ddb4e8b128 Temporary remove some tests after a fix for KT-24937
Otherwise, our project is failed to be indexed
2018-12-11 09:45:39 +03:00
Denis Zharkov
5992896d76 Relax assertion in parser for a recovery case with annotations
^KT-24937 Fixed
2018-12-11 09:45:14 +03:00
Nicolay Mitropolsky
3727fabb0f AddConstModifierFix and AddReifiedToTypeParameterOfFunctionFix updated to implement invokeImpl 2018-12-11 08:46:02 +03:00
Dmitry Batkovich
654f728c12 AddModifierFix and RemoveModifierFix made extend KotlinCrossLanguageQuickFixAction 2018-12-11 08:46:02 +03:00
Georgy Bronnikov
2b0ec8abe3 Update tests 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
5dd9cfca4d Repair after merge 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
a695e21e44 Introduce IrLazyProperty 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
f4a189fe82 Change order of arguments in IrValueParameter.copyTo 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
c018109bca React to review comments 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
c9343c89bc Mark java external declarations in IrFunction.origin 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
1764423860 JVM_IR. Mostly remove descriptors from InterfaceDelegationLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
cbc46fe6e4 JVM_IR. Mostly remove descriptors from InterfaceLowering
Descriptors are only used to generate a new method name via a call to
KotlinTypeMapper.
2018-12-10 17:26:55 +03:00
Georgy Bronnikov
55b65546fa IR. Take care of type parameters for calls in DefaultArgumentStubGenerator 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
bba711a189 JVM_IR. Remove descriptors from ConstAndJvmFieldPropertiesLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
41da078de5 IR. Create IrAnonymousInitializerSymbolImpl using a class symbol 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
481bef9799 JVM_IR. Copy annotations properly in MoveCompanionObjectFieldsLowering 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
a5fea34f12 Remove some dead code 2018-12-10 17:26:55 +03:00
Georgy Bronnikov
bf4f552478 IR. Remove descriptors from KCallableNamePropertyLowering 2018-12-10 17:26:55 +03:00
Simon Ogorodnik
33f937c923 Remove property with @JvmDefault to make test pass
In sake of #KT-28708
2018-12-10 16:08:54 +03:00
Simon Ogorodnik
2165cfe91d JavaAgainstKotlinBinaries: Allow specifying extra compiler options 2018-12-10 16:08:53 +03:00
Simon Ogorodnik
bd774766f1 Add test debug logging for PerModulePackageCacheService 2018-12-10 16:08:52 +03:00
Simon Ogorodnik
e3b181e412 Restore processing of delete events 2018-12-10 16:08:51 +03:00
Dmitry Petrov
8ede477f99 KT-28585 Fix boxing for values of captured vars of inline class type 2018-12-10 14:57:09 +03:00
Dmitry Petrov
45035d3e11 KT-28405 Fix toString for inline classes with underlying arrays 2018-12-10 14:57:09 +03:00
Dmitry Savvinov
500dc11514 Fix missed returned expression if the last expression was condition jump
See ticket comments for the detailed description

^KT-28061 Fixed
2018-12-10 13:38:43 +03:00
Dmitry Savvinov
c9e87bf353 Add test on in-place lambda with return + safecall
Currently, diagnostics behavior is undesired. The next commit fixes it

^KT-28061 In Progress
2018-12-10 13:38:43 +03:00
Nicolay Mitropolsky
b918786336 Uast: enabling multiresolve by default 2018-12-10 13:26:25 +03:00
Toshiaki Kameyama
07ffac72cf Assign backing field: don't add empty line
#KT-28694 Fixed
2018-12-10 12:06:55 +03:00
7256 changed files with 110021 additions and 137590 deletions

4
.bunch
View File

@@ -1,10 +1,8 @@
183
182
181_182
173_181_182
as31_173_181_182
as32_181_182
as33_182
as34
as35_as34
191
cidr183

4
.gitignore vendored
View File

@@ -29,13 +29,15 @@ build/
!**/testData/**/*.iml
.idea/libraries/Gradle*.xml
.idea/libraries/Maven*.xml
.idea/artifacts
.idea/artifacts/PILL_*.xml
.idea/modules
.idea/runConfigurations/JPS_*.xml
.idea/runConfigurations/PILL_*.xml
.idea/libraries
.idea/modules.xml
.idea/gradle.xml
.idea/compiler.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
.idea/artifacts/dist_auto_*
kotlin-ultimate/

27
.idea/artifacts/dist.xml generated Normal file
View File

@@ -0,0 +1,27 @@
<component name="ArtifactManager">
<artifact build-on-make="true" name="dist">
<output-path>$PROJECT_DIR$/dist</output-path>
<root id="root">
<element id="directory" name="artifacts">
<element id="directory" name="ideaPlugin">
<element id="artifact" artifact-name="ideaPlugin" />
</element>
</element>
<element id="file-copy" path="$PROJECT_DIR$/build/build.txt" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-minimal-for-test/1.3.30-dev-1419/3fc425e5a7e1979aad08d0f420f07c19c9c36d63/kotlin-stdlib-minimal-for-test-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-minimal-for-test.jar" />
<element id="directory" name="common">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.30-dev-1419/1edc4fbedf02e815e3d277c47640c9c79b5df72e/kotlin-stdlib-common-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-common.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.30-dev-1419/f83bc827e5ac23a35f2700edd716971ae9e50100/kotlin-stdlib-common-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-common-sources.jar" />
</element>
<element id="directory" name="js">
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.30-dev-1419/4dd9f2176adacefa49984a277b71d7a1645ceda2/kotlin-stdlib-js-1.3.30-dev-1419.jar" path-in-jar="/" />
</element>
<element id="directory" name="maven">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/561605d51586e253a15097d3f1d386fb6758fdd4/kotlin-stdlib-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-sources.jar" />
</element>
<element id="directory" name="kotlinc">
<element id="artifact" artifact-name="kotlinc" />
</element>
</root>
</artifact>
</component>

215
.idea/artifacts/ideaPlugin.xml generated Normal file
View File

@@ -0,0 +1,215 @@
<component name="ArtifactManager">
<artifact name="ideaPlugin">
<output-path>$PROJECT_DIR$/out/artifacts/ideaPlugin</output-path>
<root id="root">
<element id="directory" name="Kotlin">
<element id="directory" name="lib">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang/2.0.6/415b0d40db4890849270c2a5cb50050fc6ee7636/javaslang-2.0.6.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-jdk8/1.0.1/ee52dcd51dbdd3f94271cab32c76ce820adfe024/kotlinx-coroutines-jdk8-1.0.1.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/markdown/0.1.25/f22b57c632b83433112102c9da9a0f8edf946091/markdown-0.1.25.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang-match/2.0.6/d57a666939103b659813de52102d3ff0baa8ad5f/javaslang-match-2.0.6.jar" />
<element id="archive" name="allopen-ide-plugin.jar">
<element id="module-output" name="kotlin.allopen-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/allopen/allopen-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-lint.jar">
<element id="module-output" name="kotlin.plugins.lint.main" />
<element id="module-output" name="kotlin.plugins.uast-kotlin.main" />
<element id="module-output" name="kotlin.plugins.uast-kotlin-idea.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/android-lint/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-ide.jar">
<element id="module-output" name="kotlin.idea.idea-android.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-android/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-output-parser-ide.jar">
<element id="module-output" name="kotlin.idea.idea-android-output-parser.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-android/idea-android-output-parser/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="idea-git.jar">
<element id="module-output" name="kotlin.idea.idea-git.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-git/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="jps-common-ide.jar">
<element id="module-output" name="kotlin.idea.idea-jps-common.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-jps-common/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="jvm-ide.jar">
<element id="module-output" name="kotlin.idea.idea-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="maven-ide.jar">
<element id="module-output" name="kotlin.idea.idea-maven.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/idea-maven/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-gradle-tooling.jar">
<element id="module-output" name="kotlin.idea.kotlin-gradle-tooling.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/idea/kotlin-gradle-tooling/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="j2k.jar">
<element id="module-output" name="kotlin.j2k.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/j2k/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-allopen-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-allopen-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/allopen/allopen-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-noarg-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-noarg-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/noarg/noarg-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-sam-with-receiver-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-sam-with-receiver-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-util.jar">
<element id="module-output" name="kotlin.kotlin-script-util.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-script-util/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-common.jar">
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/common/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-common-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/scripting/common/src" />
<element id="directory" name="main">
<element id="directory" name="kotlin" />
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/common/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-compiler.jar">
<element id="module-output" name="kotlin.kotlin-scripting-compiler.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-idea.jar">
<element id="module-output" name="kotlin.kotlin-scripting-idea.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-idea/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-intellij.jar">
<element id="module-output" name="kotlin.kotlin-scripting-intellij.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/intellij/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-jvm.jar">
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-jvm-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/src" />
<element id="directory" name="main">
<element id="directory" name="kotlin" />
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlinx-serialization-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlinx-serialization-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kotlin-serialization/kotlin-serialization-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlinx-serialization-ide-plugin.jar">
<element id="module-output" name="kotlin.kotlinx-serialization-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kotlin-serialization/kotlin-serialization-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="noarg-ide-plugin.jar">
<element id="module-output" name="kotlin.noarg-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/noarg/noarg-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-compiler.jar">
<element id="module-output" name="kotlin.plugins.android-extensions-compiler.main" />
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-ide.jar">
<element id="module-output" name="kotlin.plugins.android-extensions-ide.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-idea/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kapt3-idea.jar">
<element id="module-output" name="kotlin.plugins.kapt3-idea.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-idea/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime.jar">
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="sam-with-receiver-ide-plugin.jar">
<element id="module-output" name="kotlin.sam-with-receiver-ide-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-ide/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="directory" name="jps">
<element id="artifact" artifact-name="kotlin-jps-plugin.jar" />
</element>
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.30-dev-1419/285fde038cb28087a51aee95919d428a2511b443/kotlin-stdlib-jdk8-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk8.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.30-dev-1419/72c0c2470715b0aa18d5624c4fa9db0345b6c09f/kotlin-stdlib-jdk7-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk7.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/c4bca00118a72c8d59fbe3d2c6621e0d79f12095/kotlin-stdlib-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib.jar" />
<element id="artifact" artifact-name="kotlin-reflect.jar" />
<element id="artifact" artifact-name="kotlin-compiler-client-embeddable.jar" />
<element id="artifact" artifact-name="kotlin-plugin.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.30-dev-1419/1edc4fbedf02e815e3d277c47640c9c79b5df72e/kotlin-stdlib-common-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-common.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
<element id="artifact" artifact-name="kotlin-daemon-client.jar" />
</element>
<element id="directory" name="kotlinc">
<element id="artifact" artifact-name="kotlinc" />
</element>
</element>
</root>
</artifact>
</component>

View File

@@ -0,0 +1,29 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-compiler-client-embeddable.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_compiler_client_embeddable_jar</output-path>
<root id="archive" name="kotlin-compiler-client-embeddable.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/compiler-client-embeddable/build/tmp/shadowJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.kotlin-compiler-client-embeddable.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
</root>
</artifact>
</component>

72
.idea/artifacts/kotlin_compiler_jar.xml generated Normal file
View File

@@ -0,0 +1,72 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-compiler.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_compiler_jar</output-path>
<root id="archive" name="kotlin-compiler.jar">
<element id="directory" name="META-INF">
<element id="directory" name="extensions">
<element id="file-copy" path="$PROJECT_DIR$/idea/resources/META-INF/extensions/compiler.xml" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/prepare/compiler/build/tmp/packCompiler/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/builtins/1.3.30-dev-1419/d204f62db9ed29f42e939e0e62c4ee933863e05b/builtins-1.3.30-dev-1419.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/asm-all-7.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/guava-25.1-jre.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij-core/intellij-core.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.fusesource.jansi/jansi/1.16/b1aaf0028852164ab6b4057192ccd0ba7dedd3a5/jansi-1.16.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij-core/java-compatibility-1.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang/2.0.6/415b0d40db4890849270c2a5cb50050fc6ee7636/javaslang-2.0.6.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/io.javaslang/javaslang-match/2.0.6/d57a666939103b659813de52102d3ff0baa8ad5f/javaslang-match-2.0.6.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/jdom.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jline/jline/3.3.1/d8a30137fe4ee2246b71b3915baac767d348c5bb/jline-3.3.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/jna-platform.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/jna.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/jps-standalone/jps-model.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/1.3.9/40719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf/jsr305-1.3.9.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/log4j.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/lz4-1.3.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/oro-2.0.8.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/picocontainer-1.2.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-relocated/2.6.1/9a9536949348fae596f4878243dffd0ed351993d/protobuf-relocated-2.6.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/streamex-0.6.7.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.backend-common.main" />
<element id="module-output" name="kotlin.compiler.backend.js.main" />
<element id="module-output" name="kotlin.compiler.backend.jvm.main" />
<element id="module-output" name="kotlin.compiler.backend.main" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.cli.main" />
<element id="module-output" name="kotlin.compiler.main" />
<element id="module-output" name="kotlin.compiler.container.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.compiler.daemon.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.compiler.frontend.java.main" />
<element id="module-output" name="kotlin.compiler.frontend.script.main" />
<element id="module-output" name="kotlin.compiler.frontend.main" />
<element id="module-output" name="kotlin.compiler.incremental-compilation-impl.main" />
<element id="module-output" name="kotlin.compiler.ir.backend.common.main" />
<element id="module-output" name="kotlin.compiler.ir.psi2ir.main" />
<element id="module-output" name="kotlin.compiler.ir.tree.main" />
<element id="module-output" name="kotlin.js.js.ast.main" />
<element id="module-output" name="kotlin.js.js.dce.main" />
<element id="module-output" name="kotlin.js.js.frontend.main" />
<element id="module-output" name="kotlin.js.js.parser.main" />
<element id="module-output" name="kotlin.js.js.serializer.main" />
<element id="module-output" name="kotlin.js.js.translator.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.compiler.light-classes.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.compiler.plugin-api.main" />
<element id="module-output" name="kotlin.compiler.psi.main" />
<element id="module-output" name="kotlin.compiler.resolution.main" />
<element id="module-output" name="kotlin.compiler.serialization.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="module-output" name="kotlin.compiler.frontend.common.main" />
</root>
</artifact>
</component>

View File

@@ -0,0 +1,27 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-daemon-client.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_daemon_client_jar</output-path>
<root id="archive" name="kotlin-daemon-client.jar">
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/daemon/daemon-client/build/tmp/shadowJar/MANIFEST.MF" />
</element>
</root>
</artifact>
</component>

View File

@@ -0,0 +1,12 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-imports-dumper-compiler-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_imports_dumper_compiler_plugin_jar</output-path>
<root id="archive" name="kotlin-imports-dumper-compiler-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/imports-dumper/build/tmp/jar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-serialization-runtime/0.4.2/e343c68c9fa77a190225484c1e03b1485fbb5f1f/kotlinx-serialization-runtime-0.4.2.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.kotlin-imports-dumper-compiler-plugin.main" />
</root>
</artifact>
</component>

View File

@@ -0,0 +1,38 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-jps-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_jps_plugin_jar</output-path>
<root id="archive" name="kotlin-jps-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/jps-plugin/build/tmp/jar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform/0.14/48341d68b4456bea76ca952b6d38b877881350f7/native-platform-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libcpp/0.14/b45561900830d676e9e0040561e68abe86fbc10e/native-platform-freebsd-amd64-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-amd64-libstdcpp/0.14/bcc4e58ef4db56052fe9512d2d1265f11dc9242f/native-platform-freebsd-amd64-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libcpp/0.14/50b15724c82808c2b7fefd9b0b7c6dd977623f35/native-platform-freebsd-i386-libcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-freebsd-i386-libstdcpp/0.14/d98be0a75890523a6a70dc93795101145828a5da/native-platform-freebsd-i386-libstdcpp-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64/0.14/d0ac539a32015e91e309c20e493d220aae88811b/native-platform-linux-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses5/0.14/6dece223855317a75c371fb72d826582893351c6/native-platform-linux-amd64-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-amd64-ncurses6/0.14/8effac668ad781893fc33fd86f993c5de559d355/native-platform-linux-amd64-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386/0.14/6576c08a9a514a6ae5623e6f8da04502cac23bde/native-platform-linux-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses5/0.14/80ec77af683abeaa58ed11b9c2cad2d02837e55f/native-platform-linux-i386-ncurses5-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-linux-i386-ncurses6/0.14/615dea7e75ca704bba1de9b671652283a9743894/native-platform-linux-i386-ncurses6-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-amd64/0.14/5e5c113c32c0bac5cf2dcd3a59e4b021023d86a1/native-platform-osx-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-osx-i386/0.14/fd86b7eedbf5a0df003cf946f0b0c80c06c103ee/native-platform-osx-i386-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-amd64/0.14/bdf519fab10700fadc9953526a07e8104fad1d07/native-platform-windows-amd64-0.14.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/net.rubygrapefruit/native-platform-windows-i386/0.14/65b00e123554f42ecd0da054a747033be5da608d/native-platform-windows-i386-0.14.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.idea.idea-jps-common.main" />
<element id="module-output" name="kotlin.jps-plugin.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.kotlin-compiler-runner.main" />
<element id="module-output" name="kotlin.kotlin-daemon-client.main" />
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
</root>
</artifact>
</component>

17
.idea/artifacts/kotlin_main_kts_jar.xml generated Normal file
View File

@@ -0,0 +1,17 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-main-kts.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_main_kts_jar</output-path>
<root id="archive" name="kotlin-main-kts.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-main-kts/build/tmp/packJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache.ivy/ivy/2.4.0/5abe4c24bbe992a9ac07ca563d5bd3e8d569e9ed/ivy-2.4.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core/1.0.1/f33e8dab753f33d1bbb07cca664fd6f13d993d7e/kotlinx-coroutines-core-1.0.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.kotlin-main-kts.main" />
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="module-output" name="kotlin.kotlin-script-util.main" />
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
</root>
</artifact>
</component>

57
.idea/artifacts/kotlin_plugin_jar.xml generated Normal file
View File

@@ -0,0 +1,57 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-plugin.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_plugin_jar</output-path>
<root id="archive" name="kotlin-plugin.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/prepare/idea-plugin/build/tmp/shadowJar/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/builtins/1.3.30-dev-1419/d204f62db9ed29f42e939e0e62c4ee933863e05b/builtins-1.3.30-dev-1419.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-relocated/2.6.1/9a9536949348fae596f4878243dffd0ed351993d/protobuf-relocated-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.plugins.annotation-based-compiler-plugins-ide-support.main" />
<element id="module-output" name="kotlin.compiler.backend-common.main" />
<element id="module-output" name="kotlin.compiler.backend.main" />
<element id="module-output" name="kotlin.compiler.backend.jvm.main" />
<element id="module-output" name="kotlin.compiler.cli-common.main" />
<element id="module-output" name="kotlin.compiler.container.main" />
<element id="module-output" name="kotlin.compiler.daemon-common.main" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.eval4j.main" />
<element id="module-output" name="kotlin.idea.fir-view.main" />
<element id="module-output" name="kotlin.compiler.frontend.java.main" />
<element id="module-output" name="kotlin.compiler.frontend.script.main" />
<element id="module-output" name="kotlin.compiler.frontend.main" />
<element id="module-output" name="kotlin.idea.ide-common.main" />
<element id="module-output" name="kotlin.idea.idea-core.main" />
<element id="module-output" name="kotlin.idea.formatter.main" />
<element id="module-output" name="kotlin.idea.idea-gradle-native.main" />
<element id="module-output" name="kotlin.idea.idea-gradle.main" />
<element id="module-output" name="kotlin.idea.idea-native.main" />
<element id="module-output" name="kotlin.idea.main" />
<element id="module-output" name="kotlin.compiler.ir.backend.common.main" />
<element id="module-output" name="kotlin.compiler.ir.psi2ir.main" />
<element id="module-output" name="kotlin.compiler.ir.tree.main" />
<element id="module-output" name="kotlin.js.js.ast.main" />
<element id="module-output" name="kotlin.js.js.frontend.main" />
<element id="module-output" name="kotlin.js.js.parser.main" />
<element id="module-output" name="kotlin.js.js.serializer.main" />
<element id="module-output" name="kotlin.js.js.translator.main" />
<element id="module-output" name="kotlin.kotlin-build-common.main" />
<element id="module-output" name="kotlin.kotlin-native.kotlin-native-library-reader.main" />
<element id="module-output" name="kotlin.kotlin-native.kotlin-native-utils.main" />
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="module-output" name="kotlin.compiler.light-classes.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.compiler.plugin-api.main" />
<element id="module-output" name="kotlin.compiler.psi.main" />
<element id="module-output" name="kotlin.compiler.resolution.main" />
<element id="module-output" name="kotlin.compiler.serialization.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
<element id="module-output" name="kotlin.compiler.util.main" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
<element id="module-output" name="kotlin.compiler.frontend.common.main" />
</root>
</artifact>
</component>

21
.idea/artifacts/kotlin_reflect_jar.xml generated Normal file
View File

@@ -0,0 +1,21 @@
<component name="ArtifactManager">
<artifact type="jar" name="kotlin-reflect.jar">
<output-path>$PROJECT_DIR$/out/artifacts/kotlin_reflect_jar</output-path>
<root id="archive" name="kotlin-reflect.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/reflect/build/tmp/result/MANIFEST.MF" />
</element>
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.inject/javax.inject/1/6975da39a7040257bd51d21a231b76c915872d38/javax.inject-1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/protobuf-lite/2.6.1/9af39e6d6cbd4404d06ae2ae63505b6247e6760b/protobuf-lite-2.6.1.jar" path-in-jar="/" />
<element id="module-output" name="kotlin.core.descriptors.jvm.main" />
<element id="module-output" name="kotlin.core.descriptors.runtime.main" />
<element id="module-output" name="kotlin.core.descriptors.main" />
<element id="module-output" name="kotlin.core.deserialization.main" />
<element id="module-output" name="kotlin.kotlin-reflect-api.main" />
<element id="module-output" name="kotlin.kotlin-reflect.main" />
<element id="module-output" name="kotlin.core.metadata.jvm.main" />
<element id="module-output" name="kotlin.core.metadata.main" />
<element id="module-output" name="kotlin.core.util.runtime.main" />
</root>
</artifact>
</component>

252
.idea/artifacts/kotlinc.xml generated Normal file
View File

@@ -0,0 +1,252 @@
<component name="ArtifactManager">
<artifact name="kotlinc">
<output-path>$PROJECT_DIR$/out/artifacts/kotlinc</output-path>
<root id="root">
<element id="directory" name="bin">
<element id="dir-copy" path="$PROJECT_DIR$/compiler/cli/bin" />
</element>
<element id="directory" name="lib">
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar" />
<element id="file-copy" path="$PROJECT_DIR$/buildSrc/prepare-deps/intellij-sdk/build/repo/kotlin.build.custom.deps/183.5153.4/intellij/lib/trove4j.jar" />
<element id="archive" name="allopen-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-allopen-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/allopen/allopen-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-runtime.jar">
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-runtime.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-cli.main" />
<element id="module-output" name="kotlin.kotlin-annotation-processing-base.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing-cli.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing-cli.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotation-processing-runtime.jar">
<element id="module-output" name="kotlin.kotlin-annotation-processing-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kapt3/kapt3-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-android.jar">
<element id="module-output" name="kotlin.kotlin-annotations-android.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-android/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-jvm.jar">
<element id="module-output" name="kotlin.kotlin-annotations-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-annotations-jvm-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/src" />
<element id="directory" name="main">
<element id="directory" name="resources" />
<element id="directory" name="kotlin" />
<element id="directory" name="java" />
</element>
<element id="directory" name="test">
<element id="directory" name="resources" />
</element>
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/kotlin-annotations-jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-ant.jar">
<element id="module-output" name="kotlin.kotlin-ant.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/ant/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="noarg-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-noarg-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/noarg/noarg-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-preloader.jar">
<element id="module-output" name="kotlin.kotlin-preloader.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/preloader/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-reflect-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors.jvm/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/descriptors.runtime/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/deserialization/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/util.runtime/src" />
<element id="dir-copy" path="$PROJECT_DIR$/core/reflection.jvm/src" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/reflect/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-runner.jar">
<element id="module-output" name="kotlin.kotlin-runner.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/compiler/cli/cli-runner/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="sam-with-receiver-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-sam-with-receiver-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/sam-with-receiver/sam-with-receiver-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime.jar">
<element id="module-output" name="kotlin.kotlin-script-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-script-runtime-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/core/script.runtime/src" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/script-runtime/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-common.jar">
<element id="module-output" name="kotlin.kotlin-scripting-common.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/common/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-compiler.jar">
<element id="module-output" name="kotlin.kotlin-scripting-compiler.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-cli/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-jvm.jar">
<element id="module-output" name="kotlin.kotlin-scripting-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/scripting/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-source-sections-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlin-source-sections-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/source-sections/source-sections-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-js.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-js.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-js-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/js/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-junit.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit5.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-junit5.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-junit5-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/junit5/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-jvm.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/jvm/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-testng.jar">
<element id="module-output" name="kotlin.kotlin-test.kotlin-test-testng.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-test-testng-sources.jar">
<element id="dir-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/src/main/kotlin" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/kotlin.test/testng/build/tmp/sourcesJar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlinx-serialization-compiler-plugin.jar">
<element id="module-output" name="kotlin.kotlinx-serialization-compiler-plugin.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/kotlin-serialization/kotlin-serialization-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="mutability-annotations-compat.jar">
<element id="module-output" name="kotlin.libraries.tools.mutability-annotations-compat.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/libraries/tools/mutability-annotations-compat/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="android-extensions-compiler.jar">
<element id="module-output" name="kotlin.plugins.android-extensions-compiler.main" />
<element id="module-output" name="kotlin.kotlin-android-extensions-runtime.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/android-extensions/android-extensions-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.30-dev-1419/285fde038cb28087a51aee95919d428a2511b443/kotlin-stdlib-jdk8-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk8.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.30-dev-1419/72c0c2470715b0aa18d5624c4fa9db0345b6c09f/kotlin-stdlib-jdk7-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-jdk7.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/c4bca00118a72c8d59fbe3d2c6621e0d79f12095/kotlin-stdlib-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk7/1.3.30-dev-1419/e2746fab1a3723c30250a10362be8c12e3d2bdd/kotlin-stdlib-jdk7-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-jdk7-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.30-dev-1419/40b256e6fd67b3217ac2aefcb70c4bf2f5d76f4f/kotlin-stdlib-jdk8-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-jdk8-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.30-dev-1419/cc7460047507b64f44b9e156dbcaa3079fc43594/kotlin-stdlib-js-1.3.30-dev-1419-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.30-dev-1419/4dd9f2176adacefa49984a277b71d7a1645ceda2/kotlin-stdlib-js-1.3.30-dev-1419.jar" output-file-name="kotlin-stdlib-js.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.30-dev-1419/561605d51586e253a15097d3f1d386fb6758fdd4/kotlin-stdlib-1.3.30-dev-1419-sources.jar" output-file-name="kotlin-stdlib-sources.jar" />
<element id="artifact" artifact-name="kotlin-compiler.jar" />
<element id="artifact" artifact-name="kotlin-reflect.jar" />
<element id="artifact" artifact-name="kotlin-daemon-client.jar" />
<element id="artifact" artifact-name="kotlin-main-kts.jar" />
<element id="artifact" artifact-name="kotlin-imports-dumper-compiler-plugin.jar" />
<element id="archive" name="jvm-abi-gen.jar">
<element id="module-output" name="kotlin.plugins.jvm-abi-gen.main" />
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/plugins/jvm-abi-gen/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
</element>
<element id="directory" name="license">
<element id="dir-copy" path="$PROJECT_DIR$/license" />
</element>
<element id="file-copy" path="$PROJECT_DIR$/bootstrap/build.txt" />
</root>
</artifact>
</component>

View File

@@ -3,6 +3,8 @@
<words>
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>
<w>protobuf</w>
<w>redirector</w>
</words>
</dictionary>

View File

@@ -10,6 +10,7 @@
<w>infos</w>
<w>intrinsics</w>
<w>kdoc</w>
<w>lateinit</w>
<w>memoize</w>
<w>memoized</w>
<w>multiline</w>
@@ -23,6 +24,7 @@
<w>subclassed</w>
<w>subgraph</w>
<w>substep</w>
<w>tailrec</w>
</words>
</dictionary>
</component>

View File

@@ -98,17 +98,9 @@
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<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="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.codeStyle.CommonCodeStyleSettings#copyFrom" reason="Absent in 173. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettingsManager#copy" reason="Removed since 181. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.notification.NotificationAction#createSimple" reason="Absent in 173." />
<Problem reference="com.intellij.notification.NotificationAction#create" reason="Absent in 173." />
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<Problem reference="com.intellij.execution.JavaRunConfigurationExtensionManager#getInstance" reason="Can't be used in Kotlin, because method was replaced with property after J2K in 183. Use JavaRunConfigurationExtensionManagerUtil instead." />
<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.util.JdomKt#element" reason="Removed in 191" />
<Problem reference="com.intellij.execution.configurations.RunConfigurationBase" reason="Generalized in 183. Use RunConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.LocatableConfigurationBase" reason="Generalized in 183. Use LocatableConfigurationBaseAny instead in signatures." />
<Problem reference="com.intellij.execution.configurations.ModuleBasedConfiguration" reason="Generalized in 183. Use ModuleBasedConfigurationElement instead." />
@@ -116,6 +108,19 @@
<Problem reference="com.intellij.testFramework.codeInsight.hierarchy.HierarchyViewTestFixture" reason="Absent in &lt;= 181. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
<Problem reference="org.jetbrains.kotlin.test.HierarchyViewTestFixtureCompat" reason="Do not use the wrapper for 181 directly. Use org.jetbrains.kotlin.test.HierarchyViewTestFixture instead." />
<Problem reference="com.intellij.psi.codeStyle.CodeStyleSettingsProvider" reason="Additional method is introduced in 183 instead of deprecated one. Use CodeStyleSettingsProviderCompat instead." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getExtensionList()" reason="Absent in 182 and before." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#extensions()" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#hasAnyExtensions" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getExtensionList(com.intellij.openapi.extensions.AreaInstance)" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#extensions(com.intellij.openapi.extensions.AreaInstance)" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#getPoint" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.extensions.ExtensionPointName#findExtensionOrFail" reason="Absent in 182." />
<Problem reference="com.intellij.openapi.ui.popup.PopupChooserBuilder#PopupChooserBuilder(javax.swing.JList)" reason="Generified in 182. Use PopupChooserBuilderWrapper instead." />
<Problem reference="com.intellij.openapi.editor.event.EditorFactoryListener" reason="Default implementations were added in 183. Use EditorFactoryListenerWrapper for inheritance instead." />
<Problem reference="com.intellij.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
<Problem reference="com.intellij.openapi.diagnostic.LoggerKt#debugOrInfoIfTestMode" reason="Absent in 182." />
<Problem reference="com.intellij.psi.search.PsiSearchHelper#getInstance" reason="Absent in 181. Use psiSearchHelperInstance() instead." />
<Problem reference="com.intellij.psi.search.PsiSearchHelper.SERVICE" reason="Deprecated since 182. Use psiSearchHelperInstance() instead." />
</list>
</option>
</inspection_tool>

4
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,4 @@
## 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

View File

@@ -1,7 +1,7 @@
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
[![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_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)
[![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)
# Kotlin Programming Language
@@ -15,7 +15,7 @@ Welcome to [Kotlin](https://kotlinlang.org/)! Some handy links:
* [Forum](https://discuss.kotlinlang.org/)
* [Kotlin Blog](https://blog.jetbrains.com/kotlin/)
* [Follow Kotlin on Twitter](https://twitter.com/kotlin)
* [Public Slack channel](http://slack.kotlinlang.org/)
* [Public Slack channel](https://slack.kotlinlang.org/)
* [TeamCity CI build](https://teamcity.jetbrains.com/project.html?tab=projectOverview&projectId=Kotlin)
## Editing Kotlin
@@ -83,7 +83,7 @@ Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
### Building for different versions of IntelliJ IDEA and Android Studio
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.
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, 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.
More detailed description of this scheme can be found at https://github.com/JetBrains/bunches/blob/master/ReadMe.md.
@@ -133,49 +133,4 @@ includeBuild('/path/to/kotlin') {
# Contributing
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%20and%20State:%20Open) which should find all open Kotlin issues that are 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.
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.
Also the [JavaScript back-end](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.
If you want to contribute a new language feature, it is important to discuss it through a [KEEP](https://github.com/Kotlin/KEEP) first and get an approval from the language designers. This way you'll make sure your work will be in line with the overall language evolution plan and no other design decisions or considerations will block its acceptance.
## Submitting patches
The best way to submit a patch is to [fork the project on GitHub](https://help.github.com/articles/fork-a-repo/) and 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.
## Checklist
Before submitting the pull request, make sure that you can say "YES" to each point in this short checklist:
- You provided the link to the related issue(s) from YouTrack
- You made a reasonable amount of changes related only to the provided issues
- You can explain changes made in the pull request
- You ran the build locally and verified new functionality
- You ran related tests locally and they passed
- You do not have merge commits in the pull request
Please be sure to review Kotlin's [contributing guidelines](docs/contributing.md) to learn how to help the project.

View File

@@ -8,7 +8,7 @@ plugins {
dependencies {
compile(commonDep("org.apache.ant", "ant"))
compile(project(":kotlin-preloader"))
compile(project(":kotlin-stdlib"))
compile(kotlinStdlib())
}
sourceSets {
@@ -17,7 +17,6 @@ sourceSets {
}
runtimeJar {
from("$projectDir/src") { include("**/*.xml") }
manifest.attributes.put("Class-Path", "$compilerManifestClassPath kotlin-preloader.jar")
}

View File

@@ -14,14 +14,14 @@ dependencies {
compileOnly(project(":js:js.serializer"))
compileOnly(project(":js:js.frontend"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
compileOnly(intellijDep()) { includeJars("annotations", "asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(intellijDep()) { includeJars("asm-all", "trove4j", "util", rootProject = rootProject) }
compileOnly(project(":kotlin-reflect-api"))
testCompileOnly(project(":compiler:cli-common"))
testCompile(projectTests(":compiler:tests-common"))
testCompile(commonDep("junit:junit"))
testCompile(protobufFull())
testCompile(project(":kotlin-stdlib"))
testCompile(kotlinStdlib())
testCompileOnly(intellijDep()) { includeJars("openapi") }
testRuntime(project(":kotlin-reflect"))

View File

@@ -1,17 +1,6 @@
/*
* Copyright 2010-2016 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.
* Copyright 2010-2019 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
@@ -21,14 +10,10 @@ import java.io.File
interface ICReporter {
fun report(message: () -> String)
fun reportVerbose(message: () -> String)
// used in Gradle plugin
@Suppress("unused")
fun reportCompileIteration(sourceFiles: Collection<File>, exitCode: ExitCode) {}
fun pathsAsString(files: Iterable<File>): String =
files.joinToString { it.canonicalPath }
fun pathsAsString(vararg files: File): String =
pathsAsString(files.toList())
}
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

@@ -0,0 +1,36 @@
/*
* Copyright 2010-2019 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
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

@@ -72,7 +72,7 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
for ((srcFile, data) in translatedFiles) {
dirtySources.remove(srcFile)
val (binaryMetadata, binaryAst) = data
val (binaryMetadata, binaryAst, inlineData) = data
val oldProtoMap = translationResults[srcFile]?.metadata?.let { getProtoData(srcFile, it) } ?: emptyMap()
val newProtoMap = getProtoData(srcFile, binaryMetadata)
@@ -89,7 +89,7 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
changesCollector.collectProtoChanges(oldProtoMap[classId], newProtoMap[classId])
}
translationResults.put(srcFile, binaryMetadata, binaryAst)
translationResults.put(srcFile, binaryMetadata, binaryAst, inlineData)
}
for ((srcFile, inlineDeclarations) in incrementalResults.inlineFunctions) {
@@ -130,6 +130,9 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
output.writeInt(value.binaryAst.size)
output.write(value.binaryAst)
output.writeInt(value.inlineData.size)
output.write(value.inlineData)
}
override fun read(input: DataInput): TranslationResultValue {
@@ -141,16 +144,20 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
val binaryAst = ByteArray(binaryAstSize)
input.readFully(binaryAst)
return TranslationResultValue(metadata = metadata, binaryAst = binaryAst)
val inlineDataSize = input.readInt()
val inlineData = ByteArray(inlineDataSize)
input.readFully(inlineData)
return TranslationResultValue(metadata = metadata, binaryAst = binaryAst, inlineData = inlineData)
}
}
private class TranslationResultMap(storageFile: File) : BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
override fun dumpValue(value: TranslationResultValue): String =
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}"
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
fun put(file: File, newMetadata: ByteArray, newBinaryAst: ByteArray) {
storage[file.canonicalPath] = TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst)
fun put(file: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[file.canonicalPath] = TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
}
operator fun get(file: File): TranslationResultValue? =

View File

@@ -350,7 +350,7 @@ open class IncrementalJvmCache(
private fun getConstantsMap(bytes: ByteArray): Map<String, Any> {
val result = HashMap<String, Any>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
val staticFinal = Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_PRIVATE
if (value != null && access and staticFinal == Opcodes.ACC_STATIC or Opcodes.ACC_FINAL) {
@@ -470,7 +470,7 @@ open class IncrementalJvmCache(
val result = HashMap<String, Long>()
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.ASM5) {
ClassReader(bytes).accept(object : ClassVisitor(Opcodes.API_VERSION) {
override fun visitMethod(
access: Int,
name: String,
@@ -478,9 +478,9 @@ open class IncrementalJvmCache(
signature: String?,
exceptions: Array<out String>?
): MethodVisitor? {
val dummyClassWriter = ClassWriter(Opcodes.ASM5)
val dummyClassWriter = ClassWriter(Opcodes.API_VERSION)
return object : MethodVisitor(Opcodes.ASM5, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
return object : MethodVisitor(Opcodes.API_VERSION, dummyClassWriter.visitMethod(0, name, desc, null, exceptions)) {
override fun visitEnd() {
val jvmName = name + desc
if (jvmName !in inlineFunctions) return

View File

@@ -31,8 +31,10 @@ import org.jetbrains.kotlin.modules.TargetId
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.CompilationCanceledStatus
import org.jetbrains.kotlin.synthetic.SAM_LOOKUP_NAME
import org.jetbrains.kotlin.utils.addToStdlib.flattenTo
import java.io.File
import java.util.*
import kotlin.collections.HashSet
const val DELETE_MODULE_FILE_PROPERTY = "kotlin.delete.module.file.after.build"
@@ -130,7 +132,7 @@ fun ChangesCollector.getDirtyData(
val dirtyClassesFqNames = HashSet<FqName>()
for (change in changes()) {
reporter.report { "Process $change" }
reporter.reportVerbose { "Process $change" }
if (change is ChangeInfo.SignatureChanged) {
val fqNames = if (!change.areSubclassesAffected) listOf(change.fqName) else withSubtypes(change.fqName, caches)
@@ -143,8 +145,7 @@ fun ChangesCollector.getDirtyData(
val name = classFqName.shortName().identifier
dirtyLookupSymbols.add(LookupSymbol(name, scope))
}
}
else if (change is ChangeInfo.MembersChanged) {
} else if (change is ChangeInfo.MembersChanged) {
val fqNames = withSubtypes(change.fqName, caches)
// need to recompile subtypes because changed member might break override
dirtyClassesFqNames.addAll(fqNames)
@@ -161,16 +162,16 @@ fun ChangesCollector.getDirtyData(
}
fun mapLookupSymbolsToFiles(
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
lookupStorage: LookupStorage,
lookupSymbols: Iterable<LookupSymbol>,
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
for (lookup in lookupSymbols) {
val affectedFiles = lookupStorage.get(lookup).map(::File).filter { it !in excludes }
reporter.report { "${lookup.scope}#${lookup.name} caused recompilation of: ${reporter.pathsAsString(affectedFiles)}" }
reporter.reportMarkDirtyMember(affectedFiles, scope = lookup.scope, name = lookup.name)
dirtyFiles.addAll(affectedFiles)
}
@@ -183,19 +184,22 @@ fun mapClassesFqNamesToFiles(
reporter: ICReporter,
excludes: Set<File> = emptySet()
): Set<File> {
val dirtyFiles = HashSet<File>()
val fqNameToAffectedFiles = HashMap<FqName, MutableSet<File>>()
for (cache in caches) {
for (dirtyClassFqName in classesFqNames) {
val srcFile = cache.getSourceFileIfClass(dirtyClassFqName)
for (classFqName in classesFqNames) {
val srcFile = cache.getSourceFileIfClass(classFqName)
if (srcFile == null || srcFile in excludes || srcFile.isJavaFile()) continue
reporter.report { ("Class $dirtyClassFqName caused recompilation of: ${reporter.pathsAsString(srcFile)}") }
dirtyFiles.add(srcFile)
fqNameToAffectedFiles.getOrPut(classFqName) { HashSet() }.add(srcFile)
}
}
return dirtyFiles
for ((classFqName, affectedFiles) in fqNameToAffectedFiles) {
reporter.reportMarkDirtyClass(affectedFiles, classFqName.asString())
}
return fqNameToAffectedFiles.values.flattenTo(HashSet())
}
fun withSubtypes(

View File

@@ -1,19 +1,16 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import java.util.*
import java.io.File
import org.gradle.api.tasks.bundling.Jar
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.gradle.api.file.FileCollection
import org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
import proguard.gradle.ProGuardTask
import org.gradle.kotlin.dsl.*
buildscript {
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.20-dev-1708", onlySuccessBootstrap = false))
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.30-dev-1419", onlySuccessBootstrap = false))
repositories.withRedirector(project) {
bootstrapKotlinRepo?.let(::maven)
@@ -30,15 +27,21 @@ buildscript {
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:5.3.3")
classpath("net.sf.proguard:proguard-gradle:6.0.3")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
// a workaround to add another one buildSrc with Cidr-specific tools to Gradle classpath
if (findProperty("cidrPluginsEnabled")?.toString()?.toBoolean() == true) {
classpath("org.jetbrains.kotlin.ultimate:buildSrc:1.0")
}
}
}
plugins {
`build-scan` version "1.15"
`build-scan`
idea
id("jps-compatible")
id("org.jetbrains.gradle.plugin.idea-ext")
}
pill {
@@ -75,19 +78,7 @@ allprojects {
extra["kotlin_root"] = rootDir
val cidrKotlinPlugin by configurations.creating
val appcodeKotlinPlugin by configurations.creating
val clionKotlinPlugin by configurations.creating
val includeCidr by extra(project.getBooleanProperty("cidrPluginsEnabled") ?: false)
dependencies {
if (includeCidr) {
cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
appcodeKotlinPlugin(project(":prepare:appcode-plugin", "runtimeJar"))
clionKotlinPlugin(project(":prepare:clion-plugin", "runtimeJar"))
}
}
val jpsBootstrap by configurations.creating
val commonBuildDir = File(rootDir, "build")
val distDir by extra("$rootDir/dist")
@@ -96,13 +87,9 @@ val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
val clionSandboxDir = "$commonLocalDataDir/clionSandbox"
val appcodeSandboxDir = "$commonLocalDataDir/appcodeSandbox"
val ideaPluginDir = "$distDir/artifacts/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$distDir/artifacts/ideaUltimatePlugin/Kotlin"
val cidrPluginDir = "$distDir/artifacts/cidrPlugin/Kotlin"
val appcodePluginDir = "$distDir/artifacts/appcodePlugin/Kotlin"
val clionPluginDir = "$distDir/artifacts/clionPlugin/Kotlin"
val artifactsDir = "$distDir/artifacts"
val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$artifactsDir/ideaUltimatePlugin/Kotlin"
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
@@ -110,13 +97,8 @@ extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
extra["clionSandboxDir"] = project.file(ideaSandboxDir)
extra["appcodeSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["cidrPluginDir"] = project.file(cidrPluginDir)
extra["appcodePluginDir"] = project.file(appcodePluginDir)
extra["clionPluginDir"] = project.file(clionPluginDir)
extra["isSonatypeRelease"] = false
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
@@ -146,12 +128,15 @@ fun checkJDK() {
}
rootProject.apply {
from(rootProject.file("versions.gradle.kts"))
from(rootProject.file("report.gradle.kts"))
from(rootProject.file("gradle/versions.gradle.kts"))
from(rootProject.file("gradle/report.gradle.kts"))
from(rootProject.file("gradle/javaInstrumentation.gradle.kts"))
from(rootProject.file("gradle/jps.gradle.kts"))
}
IdeVersionConfigurator.setCurrentIde(this)
extra["versions.protobuf-java"] = "2.6.1"
extra["versions.protobuf"] = "2.6.1"
extra["versions.javax.inject"] = "1"
extra["versions.jsr305"] = "1.3.9"
extra["versions.jansi"] = "1.16"
@@ -182,8 +167,7 @@ extra["intellijUltimateEnabled"] = intellijUltimateEnabled
extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf("annotations",
if (Platform[191].orHigher()) "asm-all-7.0" else "asm-all",
listOf(if (Platform[191].orHigher()) "asm-all-7.0" else "asm-all",
"guava",
"jdom",
"jna",
@@ -211,6 +195,7 @@ extra["compilerModules"] = arrayOf(
emptyArray()
},
":compiler:frontend",
":compiler:frontend.common",
":compiler:frontend.java",
":compiler:frontend.script",
":compiler:cli-common",
@@ -219,6 +204,7 @@ extra["compilerModules"] = arrayOf(
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:backend-common",
":compiler:backend",
@@ -246,8 +232,6 @@ val coreLibProjects = listOf(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
@@ -320,6 +304,7 @@ allprojects {
mirrorRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
jcenter()
maven(protobufRepo)
}
configureJvmProject(javaHome!!, jvmTarget!!)
@@ -327,6 +312,7 @@ allprojects {
val commonCompilerArgs = listOfNotNull(
"-Xallow-kotlin-package",
"-Xread-deserialized-contracts",
"-Xjvm-default=compatibility",
"-Xprogressive".takeIf { hasProperty("test.progressive.mode") } // TODO: change to "-progressive" after bootstrap
)
@@ -352,10 +338,6 @@ allprojects {
enabled = false
}
task<Jar>("javadocJar") {
classifier = "javadoc"
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
@@ -445,11 +427,13 @@ tasks {
create("cleanupArtifacts") {
doLast {
delete(ideaPluginDir)
delete(ideaUltimatePluginDir)
delete(cidrPluginDir)
delete(appcodePluginDir)
delete(clionPluginDir)
delete(artifactsDir)
}
}
listOf("clean", "assemble", "install", "dist").forEach { taskName ->
create("coreLibs${taskName.capitalize()}") {
coreLibProjects.forEach { projectName -> dependsOn("$projectName:$taskName") }
}
}
@@ -544,6 +528,7 @@ tasks {
create("idea-plugin-additional-tests") {
dependsOn("dist")
dependsOn(":idea:idea-gradle:test",
":idea:idea-gradle-native:test",
":idea:idea-maven:test",
":j2k:test",
":eval4j:test")
@@ -653,66 +638,6 @@ val zipPlugin by task<Zip> {
}
}
fun cidrPlugin(product: String, pluginDir: String) = tasks.creating(Copy::class.java) {
if (!includeCidr) {
throw GradleException("CIDR plugins require 'cidrPluginsEnabled' property turned on")
}
val prepareCidrPlugin = getTasksByName("cidrPlugin", true)
val prepareCurrentPlugin = (getTasksByName(product.toLowerCase() + "Plugin", true) - this)
prepareCurrentPlugin.forEach { it.mustRunAfter(prepareCidrPlugin) }
dependsOn(ideaPlugin)
dependsOn(prepareCidrPlugin)
dependsOn(prepareCurrentPlugin)
into(pluginDir)
from(ideaPluginDir) {
exclude("lib/kotlin-plugin.jar")
exclude("lib/android-lint.jar")
exclude("lib/android-ide.jar")
exclude("lib/android-output-parser-ide.jar")
exclude("lib/android-extensions-ide.jar")
exclude("lib/android-extensions-compiler.jar")
exclude("lib/kapt3-idea.jar")
exclude("lib/jps-ide.jar")
exclude("lib/jps/**")
exclude("kotlinc/**")
exclude("lib/maven-ide.jar")
}
from(cidrKotlinPlugin) { into("lib") }
from(configurations[product.toLowerCase() + "KotlinPlugin"]) { into("lib") }
}
fun zipCidrPlugin(product: String, productVersion: String) = tasks.creating(Zip::class.java) {
// Note: "cidrPluginVersion" has different format and semantics from "pluginVersion" used in IJ and AS plugins.
val cidrPluginVersion = project.findProperty("cidrPluginVersion") as String? ?: "beta-1"
val destPath = project.findProperty("pluginZipPath") as String?
?: "$distDir/artifacts/kotlin-plugin-$kotlinVersion-$product-$cidrPluginVersion-$productVersion.zip"
val destFile = File(destPath)
destinationDir = destFile.parentFile
archiveName = destFile.name
from(tasks[product.toLowerCase() + "Plugin"])
into("Kotlin")
setExecutablePermissions()
doLast {
logger.lifecycle("Plugin artifacts packed to $archivePath")
}
}
if (includeCidr) {
val appcodePlugin by cidrPlugin("AppCode", appcodePluginDir)
val appcodeVersion = extra["versions.appcode"] as String
val zipAppCodePlugin by zipCidrPlugin("AppCode", appcodeVersion)
val clionPlugin by cidrPlugin("CLion", clionPluginDir)
val clionVersion = extra["versions.clion"] as String
val zipCLionPlugin by zipCidrPlugin("CLion", clionVersion)
}
configure<IdeaModel> {
module {
excludeDirs = files(
@@ -745,6 +670,7 @@ fun Project.configureJvmProject(javaHome: String, javaVersion: String) {
tasks.withType<KotlinCompile> {
kotlinOptions.jdkHome = javaHome
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.freeCompilerArgs += "-Xjvm-default=compatibility"
}
tasks.withType<Test> {
@@ -797,4 +723,4 @@ allprojects {
repositories.redirect()
}
}
}
}

View File

@@ -4,7 +4,7 @@ buildscript {
val buildSrcKotlinVersion: String by extra(findProperty("buildSrc.kotlin.version")?.toString() ?: embeddedKotlinVersion)
val buildSrcKotlinRepo: String? by extra(findProperty("buildSrc.kotlin.repo") as String?)
extra["versions.shadow"] = "2.0.2"
extra["versions.shadow"] = "4.0.3"
extra["versions.native-platform"] = "0.14"
repositories {
@@ -59,7 +59,7 @@ fun Project.getBooleanProperty(name: String): Boolean? = this.findProperty(name)
}
rootProject.apply {
from(rootProject.file("../versions.gradle.kts"))
from(rootProject.file("../gradle/versions.gradle.kts"))
}
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
@@ -78,6 +78,7 @@ extra["customDepsOrg"] = "kotlin.build.custom.deps"
repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
maven("https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies/")
}
extra["buildSrcKotlinRepo"]?.let {
@@ -85,6 +86,8 @@ repositories {
}
jcenter()
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
maven("https://plugins.gradle.org/m2/")
}
dependencies {
@@ -94,7 +97,9 @@ dependencies {
compile("com.jakewharton.dex:dex-method-list:3.0.0")
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.ow2.asm:asm-all:6.0_BETA")
compile("org.jetbrains.intellij.deps:asm-all:7.0")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.4.2")
}
samWithReceiver {

View File

@@ -1,7 +1,4 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true

View File

@@ -1,11 +0,0 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
cacheRedirectorEnabled=true
#buildSrc.kotlin.repo=https://jcenter.bintray.com
#buildSrc.kotlin.version=1.1.50
intellijUltimateEnabled=false

View File

@@ -1,7 +1,4 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true

View File

@@ -1,7 +1,4 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true

View File

@@ -1,7 +1,4 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
cacheRedirectorEnabled=true

View File

@@ -92,8 +92,23 @@ val prepareIvyXml by tasks.creating {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, dxModuleName, dxRevision))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
addArtifact(FileBasedIvyArtifact(File(dxRepoModuleDir, "dx.jar"), DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)).also { it.conf = "default" })
addArtifact(FileBasedIvyArtifact(File(dxRepoModuleDir, "dx-sources.jar"), DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)).also { it.conf = "sources" })
addArtifact(
FileBasedIvyArtifact(
File(dxRepoModuleDir, "dx.jar"),
DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)
).also {
it.conf = "default"
})
addArtifact(
FileBasedIvyArtifact(
File(dxRepoModuleDir, "dx-sources.jar"),
DefaultIvyPublicationIdentity(customDepsOrg, "dx", dxRevision)
).also {
it.conf = "sources"
it.classifier = "sources"
})
writeTo(ivyFile)
}
}

View File

@@ -12,6 +12,7 @@ val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?
val intellijUltimateEnabled: Boolean by rootProject.extra
val intellijReleaseType: String by rootProject.extra
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
val intellijSeparateSdks: Boolean by rootProject.extra
@@ -64,10 +65,12 @@ repositories {
if (cacheRedirectorEnabled) {
maven("https://cache-redirector.jetbrains.com/www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://cache-redirector.jetbrains.com/plugins.jetbrains.com/maven")
maven("https://cache-redirector.jetbrains.com/jetbrains.bintray.com/intellij-third-party-dependencies/")
}
maven("https://www.jetbrains.com/intellij-repository/$intellijReleaseType")
maven("https://plugins.jetbrains.com/maven")
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
}
val intellij by configurations.creating
@@ -95,6 +98,11 @@ dependencies {
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
}
}
if (asmVersion != null) {
sources("org.jetbrains.intellij.deps:asm-all:$asmVersion:sources@jar")
}
sources("com.jetbrains.intellij.idea:ideaIC:$intellijVersion:sources@jar")
`jps-standalone`("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
`jps-build-test`("com.jetbrains.intellij.idea:jps-build-test:$intellijVersion")
@@ -152,16 +160,20 @@ val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
val copyIntellijSdkSources by tasks.creating(Copy::class.java) {
from(sources)
into(File(repoDir, sources.name))
val mergeSources by tasks.creating(Jar::class.java) {
dependsOn(sources)
from(provider { sources.map(::zipTree) })
destinationDir = File(repoDir, sources.name)
baseName = "intellij"
classifier = "sources"
version = intellijVersion
}
val copyJpsBuildTest by tasks.creating { configureExtractFromConfigurationTask(`jps-build-test`) { it.singleFile } }
val unzipNodeJSPlugin by tasks.creating { configureExtractFromConfigurationTask(`plugins-NodeJS`) { zipTree(it.singleFile) } }
fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection, baseDir: File, sourcesJar: File?) {
fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection, baseDir: File, vararg sourcesJar: File) {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
@@ -175,12 +187,12 @@ fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection,
)
}
}
if (sourcesJar != null) {
val sourcesArtifactName = sourcesJar.name.substringBefore("-")
sourcesJar.forEach {
val sourcesArtifactName = it.name.substringBeforeLast("-").substringBeforeLast("-")
addArtifact(
FileBasedIvyArtifact(sourcesJar, DefaultIvyPublicationIdentity(customDepsOrg, sourcesArtifactName, intellijVersion)).also {
it.conf = "sources"
it.classifier = "sources"
FileBasedIvyArtifact(it, DefaultIvyPublicationIdentity(customDepsOrg, sourcesArtifactName, intellijVersion)).also { artifact ->
artifact.conf = "sources"
artifact.classifier = "sources"
}
)
}
@@ -189,7 +201,7 @@ fun writeIvyXml(moduleName: String, fileName: String, jarFiles: FileCollection,
}
val prepareIvyXmls by tasks.creating {
dependsOn(unzipIntellijCore, unzipJpsStandalone, copyIntellijSdkSources, copyJpsBuildTest)
dependsOn(unzipIntellijCore, unzipJpsStandalone, mergeSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellij.name)
val intellijUltimateSdkDir = File(repoDir, intellijUltimate.name)
@@ -220,7 +232,7 @@ val prepareIvyXmls by tasks.creating {
}
doFirst {
val sourcesFile = if (sources.isEmpty) null else File(repoDir, "${sources.name}/${sources.singleFile.name}")
val sources = File(repoDir, sources.name).listFiles()
if (installIntellijCommunity) {
val libDir = File(intellijSdkDir, "lib")
@@ -230,10 +242,10 @@ val prepareIvyXmls by tasks.creating {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
*sources)
File(intellijSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellij.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
File(intellijSdkDir, "plugins").listFiles { file: File -> file.isDirectory }.forEach {
writeIvyXml(it.name, "intellij.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), *sources)
}
}
@@ -245,20 +257,20 @@ val prepareIvyXmls by tasks.creating {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
sourcesFile)
*sources)
File(intellijUltimateSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
writeIvyXml(it.name, "intellijUltimate.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), sourcesFile)
writeIvyXml(it.name, "intellijUltimate.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), *sources)
}
}
flatDeps.forEach {
writeIvyXml(it.name, it.name, files("$repoDir/${it.name}"), File(repoDir, it.name), sourcesFile)
writeIvyXml(it.name, it.name, files("$repoDir/${it.name}"), File(repoDir, it.name), *sources)
}
if (intellijUltimateEnabled) {
val nodeJsBaseDir = "${`plugins-NodeJS`.name}/NodeJS/lib"
writeIvyXml("NodeJS", `plugins-NodeJS`.name, files("$repoDir/$nodeJsBaseDir"), File(repoDir, nodeJsBaseDir), sourcesFile)
writeIvyXml("NodeJS", `plugins-NodeJS`.name, files("$repoDir/$nodeJsBaseDir"), File(repoDir, nodeJsBaseDir), *sources)
}
}
}

View File

@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
}
enum class Platform : CompatibilityPredicate {
P173, P181, P182, P183, P191;
P181, P182, P183, P191;
val version: Int = name.drop(1).toInt()
@@ -41,16 +41,15 @@ enum class Platform : CompatibilityPredicate {
}
enum class Ide(val platform: Platform) : CompatibilityPredicate {
IJ173(Platform.P173),
IJ181(Platform.P181),
IJ182(Platform.P182),
IJ183(Platform.P183),
IJ191(Platform.P191),
AS31(Platform.P173),
AS32(Platform.P181),
AS33(Platform.P182),
AS34(Platform.P183);
AS34(Platform.P183),
AS35(Platform.P183);
val kind = Kind.values().first { it.shortName == name.take(2) }
val version = name.dropWhile { !it.isDigit() }.toInt()

View File

@@ -1,39 +1,23 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.*
import org.gradle.api.artifacts.*
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.UnknownDomainObjectException
import org.gradle.api.artifacts.ConfigurablePublishArtifact
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.artifacts.publish.ArchivePublishArtifact
import org.gradle.api.plugins.BasePluginConvention
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.Upload
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.*
import java.io.File
// can be used now only for the non-published projects, due to conflicts in the "archives" config
// TODO: fix the problem above
fun Project.classesDirsArtifact(): FileCollection {
task("uploadArchives") {
// hides rule-based task with the same name, which appears to be broken in this project
}
val classesDirsCfg = configurations.getOrCreate("classes-dirs")
val classesDirs = mainSourceSet.output.classesDirs
val classesTask = tasks["classes"]
afterEvaluate {
classesDirs.files.forEach {
addArtifact(classesDirsCfg, classesTask, it)
}
}
return classesDirs
}
private const val MAGIC_DO_NOT_CHANGE_TEST_JAR_TASK_NAME = "testJar"
@@ -71,10 +55,11 @@ fun Project.runtimeJarArtifactBy(task: Task, artifactRef: Any, body: Configurabl
}
}
fun<T: Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
extra["runtimeJarTask"] = task
tasks.findByName("jar")?.let { defaultJarTask ->
configurations.getOrCreate("archives").artifacts.removeAll { (it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false }
configurations.getOrCreate("archives")
.artifacts.removeAll { (it as? ArchivePublishArtifact)?.archiveTask?.let { it == defaultJarTask } ?: false }
}
return task.apply {
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
@@ -87,36 +72,35 @@ fun<T: Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
fun Project.runtimeJar(body: Jar.() -> Unit = {}): Jar = runtimeJar(getOrCreateTask("jar", body), { })
fun Project.sourcesJar(sourceSet: String? = "main", body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("sourcesJar") {
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "sources"
try {
if (sourceSet != null) {
project.pluginManager.withPlugin("java-base") {
from(project.javaPluginConvention().sourceSets[sourceSet].allSource)
}
getOrCreateTask("sourcesJar") {
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "sources"
try {
if (sourceSet != null) {
project.pluginManager.withPlugin("java-base") {
from(project.javaPluginConvention().sourceSets[sourceSet].allSource)
}
} catch (e: UnknownDomainObjectException) {
// skip default sources location
}
body()
project.addArtifact("archives", this, this)
} catch (e: UnknownDomainObjectException) {
// skip default sources location
}
body()
project.addArtifact("archives", this, this)
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar =
getOrCreateTask("javadocJar") {
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
classifier = "javadoc"
tasks.findByName("javadoc")?.let{ it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
project.addArtifact("archives", this, this)
}
fun Project.javadocJar(body: Jar.() -> Unit = {}): Jar = getOrCreateTask("javadocJar") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
classifier = "javadoc"
tasks.findByName("javadoc")?.let { it as Javadoc }?.takeIf { it.enabled }?.let {
dependsOn(it)
from(it.destinationDir)
}
body()
project.addArtifact("archives", this, this)
}
fun Project.standardPublicJars(): Unit {
fun Project.standardPublicJars() {
runtimeJar()
sourcesJar()
javadocJar()
@@ -156,10 +140,12 @@ fun Project.ideaPlugin(subdir: String = "lib"): Copy = ideaPlugin(subdir) {
}
}
fun Project.dist(targetDir: File? = null,
targetName: String? = null,
fromTask: Task? = null,
body: AbstractCopyTask.() -> Unit = {}): AbstractCopyTask {
fun Project.dist(
targetDir: File? = null,
targetName: String? = null,
fromTask: Task? = null,
body: AbstractCopyTask.() -> Unit = {}
): AbstractCopyTask {
val distJarCfg = configurations.getOrCreate("distJar")
val distLibDir: File by rootProject.extra
val distJarName = targetName ?: (the<BasePluginConvention>().archivesBaseName + ".jar")
@@ -206,7 +192,7 @@ fun Project.addArtifact(configuration: Configuration, task: Task, artifactRef: A
}
fun Project.addArtifact(configurationName: String, task: Task, artifactRef: Any, body: ConfigurablePublishArtifact.() -> Unit = {}) =
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
addArtifact(configurations.getOrCreate(configurationName), task, artifactRef, body)
fun Project.cleanArtifacts() {
configurations["archives"].artifacts.let { artifacts ->

View File

@@ -28,13 +28,18 @@ fun Project.commonDep(group: String, artifact: String, vararg suffixesAndClassif
}
fun Project.commonVer(group: String, artifact: String) =
when {
rootProject.extra.has("versions.$artifact") -> rootProject.extra["versions.$artifact"]
rootProject.extra.has("versions.$group") -> rootProject.extra["versions.$group"]
else -> throw GradleException("Neither versions.$artifact nor versions.$group is defined in the root project's extra")
}
when {
rootProject.extra.has("versions.$artifact") -> rootProject.extra["versions.$artifact"]
rootProject.extra.has("versions.$group") -> rootProject.extra["versions.$group"]
else -> throw GradleException("Neither versions.$artifact nor versions.$group is defined in the root project's extra")
}
fun Project.preloadedDeps(vararg artifactBaseNames: String, baseDir: File = File(rootDir, "dependencies"), subdir: String? = null, optional: Boolean = false): ConfigurableFileCollection {
fun Project.preloadedDeps(
vararg artifactBaseNames: String,
baseDir: File = File(rootDir, "dependencies"),
subdir: String? = null,
optional: Boolean = false
): ConfigurableFileCollection {
val dir = if (subdir != null) File(baseDir, subdir) else baseDir
if (!dir.exists() || !dir.isDirectory) {
if (optional) return files()
@@ -42,9 +47,17 @@ fun Project.preloadedDeps(vararg artifactBaseNames: String, baseDir: File = File
}
val matchingFiles = dir.listFiles { file -> artifactBaseNames.any { file.matchMaybeVersionedArtifact(it) } }
if (matchingFiles == null || matchingFiles.size < artifactBaseNames.size) {
throw GradleException("Not all matching artifacts '${artifactBaseNames.joinToString()}' found in the '$dir' " +
"(missing: ${artifactBaseNames.filterNot { request -> matchingFiles.any { it.matchMaybeVersionedArtifact(request) } }.joinToString()};" +
" found: ${matchingFiles?.joinToString { it.name }})")
throw GradleException(
"Not all matching artifacts '${artifactBaseNames.joinToString()}' found in the '$dir' " +
"(missing: ${artifactBaseNames.filterNot { request ->
matchingFiles.any {
it.matchMaybeVersionedArtifact(
request
)
}
}.joinToString()};" +
" found: ${matchingFiles?.joinToString { it.name }})"
)
}
return files(*matchingFiles.map { it.canonicalPath }.toTypedArray())
}
@@ -57,21 +70,28 @@ fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir:
fun Project.kotlinDep(artifactBaseName: String, version: String): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:$version"
@Deprecated("Depend on the default configuration instead", ReplaceWith("project(name)"))
fun DependencyHandler.projectDist(name: String): ProjectDependency = project(name)
val Project.useBootstrapStdlib: Boolean get() =
findProperty("jpsBuild")?.toString() == "true"
fun Project.kotlinStdlib(suffix: String? = null): Any {
return if (useBootstrapStdlib)
kotlinDep(listOfNotNull("stdlib", suffix).joinToString("-"), bootstrapKotlinVersion)
else
dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"))
}
fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
fun DependencyHandler.projectArchives(name: String): ProjectDependency = project(name, configuration = "archives")
fun DependencyHandler.projectClasses(name: String): ProjectDependency = project(name, configuration = "classes-dirs")
val protobufLiteProject = ":custom-dependencies:protobuf-lite"
val protobufRelocatedProject = ":custom-dependencies:protobuf-relocated"
fun DependencyHandler.protobufLite(): ProjectDependency =
project(protobufLiteProject, configuration = "default").apply { isTransitive = false }
val protobufLiteTask = "$protobufLiteProject:prepare"
val Project.protobufVersion: String get() = findProperty("versions.protobuf") as String
fun DependencyHandler.protobufFull(): ProjectDependency =
project(protobufRelocatedProject, configuration = "default").apply { isTransitive = false }
val Project.protobufRepo: String
get() =
"https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_Protobuf),status:SUCCESS,pinned:true,tag:$protobufVersion/artifacts/content/internal/repo/"
fun Project.protobufLite(): String = "org.jetbrains.kotlin:protobuf-lite:$protobufVersion"
fun Project.protobufFull(): String = "org.jetbrains.kotlin:protobuf-relocated:$protobufVersion"
fun File.matchMaybeVersionedArtifact(baseName: String) = name.matches(baseName.toMaybeVersionedJarRegex())
@@ -94,7 +114,6 @@ private fun String.toMaybeVersionedJarRegex(): Regex {
}
fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = File(this.property("JDK_18") as String)): File? =
paths.map { File(jdkHome, it) }.firstOrNull { it.exists() }.also {
if (it == null)
@@ -105,7 +124,7 @@ fun Project.toolsJar(jdkHome: File = File(this.property("JDK_18") as String)): F
firstFromJavaHomeThatExists("lib/tools.jar", jdkHome = jdkHome)
val compilerManifestClassPath
get() = "kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"
get() = "annotations-13.0.jar kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"
object EmbeddedComponents {
val CONFIGURATION_NAME = "embeddedComponents"
@@ -127,26 +146,3 @@ fun AbstractCopyTask.fromEmbeddedComponents() {
}
}
}
// TODO: it seems incomplete, find and add missing dependencies
val testDistProjects = listOf(
"", // for root project
":kotlin-stdlib:jvm-minimal-for-test",
":kotlin-compiler",
":kotlin-script-runtime",
":kotlin-stdlib",
":kotlin-stdlib-jre7",
":kotlin-stdlib-jre8",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-stdlib-js",
":kotlin-reflect",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-js",
":kotlin-preloader",
":plugins:android-extensions-compiler",
":kotlin-ant",
":kotlin-annotations-jvm",
":kotlin-annotations-android"
)

View File

@@ -0,0 +1,136 @@
/*
* 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 idea
import groovy.lang.Closure
import org.gradle.api.Action
import org.gradle.api.Transformer
import org.gradle.api.file.ContentFilterable
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.FileCopyDetails
import org.gradle.api.file.RelativePath
import java.io.File
import java.io.FilterReader
import java.io.InputStream
import java.io.OutputStream
class DistCopyDetailsMock(val context: DistModelBuildContext, srcName: String) : FileCopyDetails {
private var relativePath = RelativePath(true, srcName)
lateinit var lastAction: Action<in FileCopyDetails>
class E : Exception() {
// skip stack trace filling
override fun fillInStackTrace(): Throwable = this
}
fun logUnsupported(methodName: String): Nothing {
context.logUnsupported("COPY ACTION FileCopyDetails mock: $methodName", lastAction)
throw E()
}
override fun setDuplicatesStrategy(strategy: DuplicatesStrategy) {
logUnsupported("setDuplicatesStrategy")
}
override fun getSourcePath(): String {
logUnsupported("getSourcePath")
}
override fun getName(): String {
logUnsupported("getName")
}
override fun getSize(): Long {
logUnsupported("getSize")
}
override fun getRelativePath(): RelativePath = relativePath
override fun getRelativeSourcePath(): RelativePath {
logUnsupported("getRelativeSourcePath")
}
override fun expand(properties: MutableMap<String, *>): ContentFilterable {
logUnsupported("expand")
}
override fun getMode(): Int {
logUnsupported("getMode")
}
override fun getSourceName(): String {
logUnsupported("getSourceName")
}
override fun filter(properties: MutableMap<String, *>, filterType: Class<out FilterReader>): ContentFilterable {
logUnsupported("filter")
}
override fun filter(filterType: Class<out FilterReader>): ContentFilterable {
logUnsupported("filter")
}
override fun filter(closure: Closure<*>): ContentFilterable {
logUnsupported("filter")
}
override fun filter(transformer: Transformer<String, String>): ContentFilterable {
logUnsupported("filter")
}
override fun getFile(): File {
logUnsupported("getFile")
}
override fun setMode(mode: Int) {
logUnsupported("setMode")
}
override fun copyTo(output: OutputStream) {
logUnsupported("copyTo")
}
override fun copyTo(target: File): Boolean {
logUnsupported("copyTo")
}
override fun open(): InputStream {
logUnsupported("open")
}
override fun setRelativePath(path: RelativePath) {
relativePath = path
}
override fun getPath(): String {
logUnsupported("getPath")
}
override fun isDirectory(): Boolean {
logUnsupported("isDirectory")
}
override fun getDuplicatesStrategy(): DuplicatesStrategy {
logUnsupported("getDuplicatesStrategy")
}
override fun setName(name: String) {
logUnsupported("setName")
}
override fun getLastModified(): Long {
logUnsupported("getLastModified")
}
override fun setPath(path: String) {
logUnsupported("setPath")
}
override fun exclude() {
logUnsupported("exclude")
}
}

View File

@@ -0,0 +1,96 @@
package org.jetbrains.kotlin.buildUtils.idea
import org.gradle.api.Action
import org.gradle.api.file.FileCopyDetails
import java.io.File
import java.io.PrintWriter
class DistVFile(
val parent: DistVFile?,
val name: String,
val file: File = File(parent!!.file, name)
) {
val child = mutableMapOf<String, DistVFile>()
val contents = mutableSetOf<DistContentElement>()
override fun toString(): String = name
val hasContents: Boolean = file.exists() || contents.isNotEmpty()
fun relativePath(path: String): DistVFile {
val pathComponents = path.split(File.separatorChar)
return pathComponents.fold(this) { parent: DistVFile, childName: String ->
try {
parent.getOrCreateChild(childName)
} catch (t: Throwable) {
throw Exception("Error while processing path `$path`, components: `$pathComponents`, element: `$childName`", t)
}
}
}
fun getOrCreateChild(name: String): DistVFile = child.getOrPut(name) {
DistVFile(this, name)
}
fun addContents(contents: DistContentElement) {
this.contents.add(contents)
}
fun removeAll(matcher: (String) -> Boolean) {
child.keys.filter(matcher).forEach {
child.remove(it)
}
}
fun printTree(p: PrintWriter, depth: String = "") {
p.println("$depth${file.path} ${if (file.exists()) "EXISTED" else ""}:")
contents.forEach {
p.println("$depth $it")
}
child.values.forEach {
it.printTree(p, "$depth ")
}
}
}
sealed class DistContentElement()
class DistCopy(
target: DistVFile,
val src: DistVFile,
val customTargetName: String? = null,
val copyActions: Collection<Action<in FileCopyDetails>> = listOf()
) : DistContentElement() {
init {
target.addContents(this)
}
override fun toString(): String =
"COPY OF ${src.file}" +
if (customTargetName != null) " -> $customTargetName" else ""
}
class DistModuleOutput(parent: DistVFile, val projectId: String) : DistContentElement() {
init {
parent.addContents(this)
}
override fun toString(): String = "COMPILE OUTPUT $projectId"
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as DistModuleOutput
if (projectId != other.projectId) return false
return true
}
override fun hashCode(): Int {
return projectId.hashCode()
}
}

View File

@@ -0,0 +1,76 @@
package idea
import org.gradle.api.Action
import org.gradle.api.file.FileCopyDetails
import org.jetbrains.kotlin.buildUtils.idea.DistVFile
import org.jetbrains.kotlin.buildUtils.idea.logger
/**
* Used for logging and nesting properties
*/
class DistModelBuildContext(
val parent: DistModelBuildContext?,
val kind: String,
val title: String,
val report: Appendable? = parent?.report,
val shade: Boolean = parent?.shade ?: false
) {
val logEnabled = false
val allCopyActions = mutableSetOf<Action<in FileCopyDetails>>()
var destination: DistVFile? = parent?.destination // todo: don't nest destination between tasks visiting
val logPrefix: String = if (parent != null) "${parent.logPrefix}-" else ""
init {
report?.appendln(toString())
if (parent != null) {
allCopyActions.addAll(parent.allCopyActions)
}
}
fun log(kind: String, title: String = "", print: Boolean = false) {
if (logEnabled) {
report?.appendln("$logPrefix- $kind $title")
if (print) {
logger.error("$kind $title, while visiting:")
var p = this
while (p.parent != null) {
logger.error(" - ${p.kind} ${p.title}")
p = p.parent!!
}
}
}
}
fun logUnsupported(kind: String, obj: Any? = null) {
val objInfo = if (obj != null) {
val javaClass = obj.javaClass
val superclass = javaClass.superclass as Class<*>
"$obj [$javaClass extends $superclass implements ${javaClass.interfaces.map { it.canonicalName }}]"
} else ""
log("UNSUPPORTED $kind", objInfo, true)
}
override fun toString() = "$logPrefix $kind $title"
inline fun child(
kind: String,
title: String = "",
shade: Boolean = false,
body: (DistModelBuildContext) -> Unit = {}
): DistModelBuildContext {
val result = DistModelBuildContext(this, kind, title, shade = shade)
body(result)
return result
}
fun addCopyActions(allCopyActions: Collection<Action<in FileCopyDetails>>) {
allCopyActions.forEach {
log("COPY ACTION", "$it")
}
this.allCopyActions.addAll(allCopyActions)
}
}

View File

@@ -0,0 +1,315 @@
/*
* 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.buildUtils.idea
import IntelliJInstrumentCodeTask
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import idea.DistCopyDetailsMock
import idea.DistModelBuildContext
import org.codehaus.groovy.runtime.GStringImpl
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.file.FileCollection
import org.gradle.api.file.FileVisitDetails
import org.gradle.api.file.FileVisitor
import org.gradle.api.file.SourceDirectorySet
import org.gradle.api.internal.file.*
import org.gradle.api.internal.file.archive.ZipFileTree
import org.gradle.api.internal.file.collections.*
import org.gradle.api.internal.file.copy.CopySpecInternal
import org.gradle.api.internal.file.copy.DefaultCopySpec
import org.gradle.api.internal.file.copy.DestinationRootCopySpec
import org.gradle.api.internal.file.copy.SingleParentCopySpec
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.Copy
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.api.tasks.Sync
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.api.tasks.util.PatternSet
import org.gradle.internal.file.PathToFileResolver
import org.gradle.jvm.tasks.Jar
import java.io.File
import java.io.PrintWriter
import java.util.concurrent.Callable
open class DistModelBuilder(val rootProject: Project, pw: PrintWriter) {
val rootCtx = DistModelBuildContext(null, "ROOT", "dist", pw)
val visited = mutableMapOf<Task, DistModelBuildContext>()
val vfsRoot = DistVFile(null, "<root>", File(""))
val refs = mutableSetOf<DistVFile>()
fun visitInstrumentTask(it: IntelliJInstrumentCodeTask): DistModelBuildContext = visited.getOrPut(it) {
val ctx = rootCtx.child("INSTRUMENT", it.path)
ctx.setDest(it.output!!.path)
processSourcePath(it.originalClassesDirs, ctx)
val dest = ctx.destination
if (dest != null) {
DistModuleOutput(dest, it.project.path)
}
ctx
}
fun visitCompileTask(it: AbstractCompile): DistModelBuildContext = visited.getOrPut(it) {
val ctx = rootCtx.child("COMPILE", it.path)
ctx.setDest(it.destinationDir.path)
val dest = ctx.destination
if (dest != null) DistModuleOutput(dest, it.project.path)
else ctx.logUnsupported("Cannot add contents: destination is unknown", it)
ctx
}
fun visitCopyTask(
copy: AbstractCopyTask,
shade: Boolean = false
): DistModelBuildContext = visited.getOrPut(copy) {
val context = rootCtx.child("COPY", copy.path, shade)
val rootSpec = copy.rootSpec
when (copy) {
is Copy -> context.setDest(copy.destinationDir.path)
is Sync -> context.setDest(copy.destinationDir.path)
is AbstractArchiveTask -> context.setDest(copy.archivePath.path)
}
when (copy) {
is ShadowJar -> copy.configurations.forEach {
processSourcePath(it, context)
}
}
processCopySpec(rootSpec, context)
context
}
fun processCopySpec(spec: CopySpecInternal, ctx: DistModelBuildContext) {
spec.children.forEach {
when (it) {
is DestinationRootCopySpec -> ctx.child("DESTINATION ROOT COPY SPEC") { newCtx ->
newCtx.setDest(getRelativePath(it.destinationDir.path))
processCopySpec(it, newCtx)
}
is DefaultCopySpec -> ctx.child("DEFAULT COPY SPEC") { newCtx ->
val buildRootResolver = it.buildRootResolver()
ctx.addCopyActions(buildRootResolver.allCopyActions)
newCtx.setDest(buildRootResolver.destPath.getFile(ctx.destination!!.file).path)
processCopySpec(it, newCtx)
it.includes
newCtx.child("SINGE PARENT COPY SPEC") { child ->
it.sourcePaths.forEach {
processSourcePath(it, child)
}
}
}
is SingleParentCopySpec -> ctx.child("OTHER SINGE PARENT COPY SPEC") { child ->
it.sourcePaths.forEach {
processSourcePath(it, child)
}
}
is CopySpecInternal -> processCopySpec(it, ctx)
else -> ctx.logUnsupported("CopySpec", spec)
}
}
}
fun processSourcePath(sourcePath: Any?, ctx: DistModelBuildContext) {
when {
sourcePath == null -> Unit
sourcePath is Jar -> ctx.child("JAR") { child ->
child.addCopyOf(sourcePath.archivePath.path)
}
sourcePath is SourceSetOutput -> ctx.child("COMPILE") { child ->
sourcePath.classesDirs.files.forEach {
child.addCopyOf(it.path)
}
}
sourcePath is Configuration -> {
ctx.child("CONFIGURATION") { child ->
sourcePath.resolve().forEach {
child.addCopyOf(it.path)
}
}
}
sourcePath is SourceDirectorySet -> {
ctx.child("SOURCES") { child ->
sourcePath.srcDirs.forEach {
child.addCopyOf(it.path)
}
}
}
sourcePath is MinimalFileSet -> ctx.child("MINIMAL FILE SET (${sourcePath.javaClass.simpleName})") { child ->
sourcePath.files.forEach {
processSourcePath(it, child)
}
}
sourcePath is MinimalFileTree -> ctx.child("MINIMAL FILE TREE (${sourcePath.javaClass.simpleName})") { child ->
sourcePath.visit(object : FileVisitor {
override fun visitDir(dirDetails: FileVisitDetails) {
processSourcePath(dirDetails.file, child)
}
override fun visitFile(fileDetails: FileVisitDetails) {
processSourcePath(fileDetails.file, child)
}
})
}
sourcePath is FileTreeAdapter && sourcePath.tree is GeneratedSingletonFileTree -> ctx.child("FILE TREE ADAPTER OF MAP FILE TREE (${sourcePath.javaClass.simpleName})") { child ->
sourcePath.visitContents(object : FileCollectionResolveContext {
override fun add(element: Any): FileCollectionResolveContext {
processSourcePath(element, child)
return this
}
override fun newContext(): ResolvableFileCollectionResolveContext {
error("not supported")
}
override fun push(fileResolver: PathToFileResolver): FileCollectionResolveContext {
return this
}
})
}
sourcePath is CompositeFileCollection -> ctx.child("COMPOSITE FILE COLLECTION") { child ->
sourcePath.visitLeafCollections(object : FileCollectionLeafVisitor {
override fun visitFileTree(file: File, patternSet: PatternSet) {
child.child("FILE TREE") {
it.addCopyOf(file.path)
}
}
override fun visitGenericFileTree(fileTree: FileTreeInternal) {
child.child("TREE") {
processSourcePath(fileTree, it)
}
}
override fun visitCollection(fileCollection: FileCollectionInternal) {
processSourcePath(fileCollection, child)
}
})
}
sourcePath is FileTreeAdapter && sourcePath.tree is ZipFileTree -> ctx.child("ZIP FILE TREE ADAPTER") { child ->
val tree = sourcePath.tree
val field = tree.javaClass.declaredFields.find { it.name == "zipFile" }!!
field.isAccessible = true
val zipFile = field.get(tree) as File
child.addCopyOf(zipFile.path)
}
sourcePath is FileTreeInternal -> ctx.child("FILE TREE INTERNAL") { child ->
// todo: preserve or warn about filtering
sourcePath.visitTreeOrBackingFile(object : FileVisitor {
override fun visitFile(fileDetails: FileVisitDetails) {
child.addCopyOf(fileDetails.file.path)
}
override fun visitDir(dirDetails: FileVisitDetails) {
child.addCopyOf(dirDetails.file.path)
}
})
}
sourcePath is FileCollection -> ctx.child("OTHER FILE COLLECTION (${sourcePath.javaClass})") { child ->
try {
sourcePath.files.forEach {
child.addCopyOf(it.path)
}
} catch (t: Throwable) {
child.logUnsupported("FILE COLLECTION (${t.message})", sourcePath)
}
}
sourcePath is String || sourcePath is GStringImpl -> ctx.child("STRING") { child ->
child.addCopyOf(sourcePath.toString())
}
sourcePath is Callable<*> -> ctx.child("CALLABLE") { child ->
processSourcePath(sourcePath.call(), child)
}
sourcePath is Collection<*> -> ctx.child("COLLECTION") { child ->
sourcePath.forEach {
processSourcePath(it, child)
}
}
sourcePath is Copy -> ctx.child("COPY OUTPUT") { child ->
val src = visitCopyTask(sourcePath).destination
if (src != null) child.addCopyOf(src)
// else it is added to `it`, because destination is inhereted by context
}
sourcePath is File -> ctx.child("FILE ${sourcePath.path}") { child ->
child.addCopyOf(sourcePath.path)
}
else -> ctx.logUnsupported("SOURCE PATH", sourcePath)
}
}
inline fun DistModelBuildContext.addCopyOf(
src: String,
body: (src: DistVFile, target: DistVFile) -> Unit = { _, _ -> Unit }
) {
addCopyOf(requirePath(src), body)
}
fun DistModelBuildContext.transformName(srcName: String): String? {
val detailsMock = DistCopyDetailsMock(this, srcName)
allCopyActions.forEach {
detailsMock.lastAction = it
try {
it.execute(detailsMock)
} catch (t: DistCopyDetailsMock.E) {
// skip
}
}
val name1 = detailsMock.relativePath.lastName
return if (name1.endsWith(".jar")) transformJarName(name1) else name1
}
// todo: investigate why allCopyActions not working
open fun transformJarName(name: String): String = name
inline fun DistModelBuildContext.addCopyOf(
src: DistVFile,
body: (src: DistVFile, target: DistVFile) -> Unit = { _, _ -> Unit }
) {
val destination = destination
if (destination != null) {
body(src, destination)
val customTargetName = transformName(src.name)
DistCopy(destination, src, customTargetName)
log("+DistCopy", "${getRelativePath(src.file.path)} -> ${getRelativePath(destination.file.path)}/$customTargetName")
} else logUnsupported("Cannot add copy of `$src`: destination is unknown")
}
fun DistModelBuildContext.setDest(path: String) {
destination = vfsRoot.relativePath(path)
log("INTO", getRelativePath(path))
}
fun checkRefs() {
refs.forEach {
if (!it.hasContents && it.contents.isEmpty() && it.file.path.contains("${File.pathSeparator}build${File.pathSeparator}")) {
logger.error("UNRESOLVED ${it.file}")
it.contents.forEach {
logger.error("+ ${it}")
}
}
}
}
fun getRelativePath(path: String) = path.replace(rootProject.projectDir.path, "$")
fun requirePath(targetPath: String): DistVFile {
val target = vfsRoot.relativePath(targetPath)
if (!File(targetPath).exists()) refs.add(target)
return target
}
}

View File

@@ -0,0 +1,67 @@
/*
* 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.buildUtils.idea
class DistModelFlattener() {
val stack = mutableSetOf<DistVFile>()
val common = mutableSetOf<DistVFile>()
fun DistVFile.flatten(): DistVFile {
val new = DistVFile(parent, name, file)
copyFlattenedContentsTo(new)
return new
}
private fun DistVFile.copyFlattenedContentsTo(new: DistVFile, inJar: Boolean = false) {
if (!stack.add(this)) {
return
}
try {
contents.forEach {
if (!shouldSkip(new, it)) {
when (it) {
is DistCopy -> {
val srcName = it.customTargetName ?: it.src.name
if (it.src.file.exists()) {
DistCopy(new, it.src, srcName)
}
if (!inJar && srcName.endsWith(".jar")) {
val newChild = new.getOrCreateChild(srcName)
it.src.copyFlattenedContentsTo(newChild, inJar = true)
} else {
it.src.copyFlattenedContentsTo(new, inJar)
}
}
is DistModuleOutput -> DistModuleOutput(new, it.projectId)
}
}
}
child.values.forEach { oldChild ->
if (inJar) {
val newChild =
if (oldChild.name.endsWith(".jar")) new
else new.getOrCreateChild(oldChild.name)
oldChild.copyFlattenedContentsTo(newChild, inJar = true)
} else {
val newChild = new.getOrCreateChild(oldChild.name)
oldChild.copyFlattenedContentsTo(newChild)
}
}
} finally {
stack.remove(this)
}
}
private fun shouldSkip(
new: DistVFile,
content: DistContentElement
) =
new.name == "kotlin-jps-plugin.jar" && content is DistCopy && content.customTargetName == "kotlin-compiler-runner.jar"
}

View File

@@ -0,0 +1,61 @@
/*
* 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.buildUtils.idea
import org.gradle.api.Project
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.gradle.ext.ArtifactType
import org.jetbrains.gradle.ext.RecursiveArtifact
class DistModelIdeaArtifactBuilder(val rootProject: Project) {
fun RecursiveArtifact.addFiles(vFile: DistVFile, inJar: Boolean = false) {
val files = mutableSetOf<String>()
vFile.contents.forEach {
when (it) {
is DistCopy -> {
val file = it.src.file
when {
inJar && file.name.endsWith(".jar") -> extractedDirectory(file.path)
file.isDirectory -> {
files.add(file.name)
directoryContent(file.path)
}
else -> {
files.add(file.name)
file(file.path)
}
}
}
is DistModuleOutput -> {
val name = it.ideaModuleName
if (name.result != null) moduleOutput(name.result + "_main")
else logger.warn("Cannot find idea module name for project `${it.projectId}`: ${name.error}")
}
}
}
vFile.child.values.forEach {
if (it.name !in files) {
when {
it.name.endsWith(".jar") -> archive(it.name).addFiles(it, true)
else -> directory(it.name).addFiles(it, inJar)
}
}
}
}
class Result<T: Any>(val result: T? = null, val error: String? = null)
val DistModuleOutput.ideaModuleName: Result<String>
get() {
val findProject = rootProject.findProject(projectId) ?: return Result(error = "cannot find gradle project $projectId")
val idea = findProject.extensions?.findByName("idea") as? IdeaModel ?: return Result(error = "cannot find idea model for gradle project $projectId")
val name = idea.module?.name ?: return Result(error = "idea model for project $projectId has no module name")
return Result(name)
}
}

View File

@@ -0,0 +1,130 @@
/*
* 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.buildUtils.idea
import IntelliJInstrumentCodeTask
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.tasks.AbstractCopyTask
import org.gradle.api.tasks.compile.AbstractCompile
import org.jetbrains.gradle.ext.TopLevelArtifact
import org.slf4j.LoggerFactory
import java.io.File
/**
* Temporary solution for configuring IDEA artifacts based on Gradle copy tasks configurations.
* This should be replaced with DSL that produces both Gradle copy tasks and IDEA artifacts configuration.
*
* TODO: remove this package when DSL described above will be implemented
*/
fun generateIdeArtifacts(rootProject: Project, artifactsFactory: NamedDomainObjectContainer<TopLevelArtifact>) {
val reportsDir = File(path(rootProject.buildDir.path, "reports", "idea-artifacts-cfg"))
reportsDir.mkdirs()
val projectDir = rootProject.projectDir
File(reportsDir, "01-visitor.report.txt").printWriter().use { visitorReport ->
val modelBuilder = object : DistModelBuilder(rootProject, visitorReport) {
// todo: investigate why allCopyActions not working
override fun transformJarName(name: String): String {
val name1 = name.replace(Regex("-${java.util.regex.Pattern.quote(rootProject.version.toString())}"), "")
val name2 = when (name1) {
"kotlin-runtime-common.jar" -> "kotlin-runtime.jar"
"kotlin-compiler-before-proguard.jar" -> "kotlin-compiler.jar"
"kotlin-main-kts-before-proguard.jar" -> "kotlin-main-kts.jar"
"kotlin-allopen-compiler-plugin.jar" -> "allopen-compiler-plugin.jar"
"kotlin-noarg-compiler-plugin.jar" -> "noarg-compiler-plugin.jar"
"kotlin-sam-with-receiver-compiler-plugin.jar" -> "sam-with-receiver-compiler-plugin.jar"
"kotlin-android-extensions-runtime.jar" -> "android-extensions-runtime.jar"
else -> name1
}
val name3 = name2.removePrefix("dist-")
return name3
}
}
fun visitAllTasks(project: Project) {
project.tasks.forEach {
try {
when {
it is AbstractCopyTask -> modelBuilder.visitCopyTask(it)
it is AbstractCompile -> modelBuilder.visitCompileTask(it)
it is IntelliJInstrumentCodeTask -> modelBuilder.visitInstrumentTask(it)
it.name == "stripMetadata" -> {
modelBuilder.rootCtx.log(
"STRIP METADATA",
"${it.inputs.files.singleFile} -> ${it.outputs.files.singleFile}"
)
DistCopy(
modelBuilder.requirePath(it.outputs.files.singleFile.path),
modelBuilder.requirePath(it.inputs.files.singleFile.path)
)
}
}
} catch (t: Throwable) {
logger.error("Error while visiting `$it`", t)
}
}
project.subprojects.forEach {
visitAllTasks(it)
}
}
visitAllTasks(rootProject)
// proguard
DistCopy(
target = modelBuilder.requirePath(
path(
projectDir.path,
"libraries",
"reflect",
"build",
"libs",
"kotlin-reflect-proguard.jar"
)
),
src = modelBuilder.requirePath(path(projectDir.path, "libraries", "reflect", "build", "libs", "kotlin-reflect-shadow.jar"))
)
File(reportsDir, "02-vfs.txt").printWriter().use {
modelBuilder.vfsRoot.printTree(it)
}
modelBuilder.checkRefs()
with(DistModelFlattener()) {
with(DistModelIdeaArtifactBuilder(rootProject)) {
File(reportsDir, "03-flattened-vfs.txt").printWriter().use { report ->
fun getFlattenned(vfsPath: String): DistVFile =
modelBuilder.vfsRoot.relativePath(path(projectDir.path, vfsPath))
.flatten()
val all = getFlattenned("dist")
all.child["artifacts"]
?.removeAll { it != "ideaPlugin" }
all.child["artifacts"]
?.child?.get("ideaPlugin")
?.child?.get("Kotlin")
?.removeAll { it != "kotlinc" && it != "lib" }
all.removeAll { it.endsWith(".zip") }
all.printTree(report)
val dist = artifactsFactory.create("dist_auto_reference_dont_use")
dist.addFiles(all)
}
}
}
}
}
private fun path(vararg components: String) = components.joinToString(File.separator)
internal val logger = LoggerFactory.getLogger("ide-artifacts")

View File

@@ -0,0 +1,40 @@
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.ideaExt
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.plugins.ExtensionAware
import org.gradle.kotlin.dsl.configure
import org.gradle.plugins.ide.idea.model.IdeaProject
import org.jetbrains.gradle.ext.*
/*
* Copyright 2010-2019 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.
*/
fun org.gradle.api.Project.idea(configure: org.gradle.plugins.ide.idea.model.IdeaModel.() -> Unit): Unit =
(this as org.gradle.api.plugins.ExtensionAware).extensions.configure("idea", configure)
fun IdeaProject.settings(block: ProjectSettings.() -> Unit) =
(this@settings as ExtensionAware).extensions.configure(block)
fun ProjectSettings.compiler(block: IdeaCompilerConfiguration.() -> Unit) =
(this@compiler as ExtensionAware).extensions.configure(block)
fun ProjectSettings.delegateActions(block: ActionDelegationConfig.() -> Unit) =
(this@delegateActions as ExtensionAware).extensions.configure(block)
fun ProjectSettings.runConfigurations(block: DefaultRunConfigurationContainer.() -> Unit) =
(this@runConfigurations as ExtensionAware).extensions.configure("runConfigurations", block)
inline fun <reified T: RunConfiguration> DefaultRunConfigurationContainer.defaults(noinline block: T.() -> Unit) =
defaults(T::class.java, block)
fun DefaultRunConfigurationContainer.junit(name: String, block: JUnit.() -> Unit) =
create(name, JUnit::class.java, block)
fun DefaultRunConfigurationContainer.application(name: String, block: Application.() -> Unit) =
create(name, Application::class.java, block)
fun ProjectSettings.ideArtifacts(block: NamedDomainObjectContainer<org.jetbrains.gradle.ext.TopLevelArtifact>.() -> Unit) =
(this@ideArtifacts as ExtensionAware).extensions.configure("ideArtifacts", block)

View File

@@ -1,4 +1,4 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
@file:Suppress("unused")
/*
* Copyright 2010-2017 JetBrains s.r.o.
@@ -23,13 +23,12 @@ import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.ConventionTask
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.kotlin.dsl.*
import java.io.File
fun Project.configureInstrumentation() {
fun Project.configureFormInstrumentation() {
plugins.matching { it::class.java.canonicalName.startsWith("org.jetbrains.kotlin.gradle.plugin") }.all {
// When we change the output classes directory, Gradle will automatically configure
// the test compile tasks to use the instrumented classes. Normally this is fine,
@@ -46,8 +45,8 @@ fun Project.configureInstrumentation() {
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
}
}
@@ -68,7 +67,8 @@ fun Project.configureInstrumentation() {
logger.info("Saving old sources dir for project ${project.name}")
val instrumentedClassesDir = File(project.buildDir, "classes/${sourceSetParam.name}-instrumented")
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask = project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
val instrumentTask =
project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
@@ -100,6 +100,9 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
@Input
var originalClassesDirs: FileCollection? = null
@get:Input
var instrumentNotNull: Boolean = false
@get:InputFiles
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })
@@ -109,21 +112,30 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
@TaskAction
fun instrumentClasses() {
logger.info("input files are: ${originalClassesDirs?.joinToString("; ", transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)" }"})}")
logger.info(
"input files are: ${originalClassesDirs?.joinToString(
"; ",
transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)"}" })}"
)
output.deleteRecursively()
copyOriginalClasses()
val classpath = instrumentationClasspath!!
ant.withGroovyBuilder {
"taskdef"("name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions")
"taskdef"(
"name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions"
)
}
logger.info("Compiling forms and instrumenting code with nullability preconditions")
val instrumentNotNull = prepareNotNullInstrumenting(classpath.asPath)
if (instrumentNotNull) {
prepareNotNullInstrumenting(classpath.asPath)
}
instrumentCode(sourceDirs, instrumentNotNull)
}
@@ -134,14 +146,15 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
}
}
private fun prepareNotNullInstrumenting(classpath: String): Boolean {
private fun prepareNotNullInstrumenting(classpath: String) {
ant.withGroovyBuilder {
"typedef"("name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS)
"typedef"(
"name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS
)
}
return true
}
private fun instrumentCode(srcDirs: FileCollection, instrumentNotNull: Boolean) {
@@ -149,20 +162,22 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
// Instrumentation needs to have access to sources of forms for inclusion
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
val instrumentationClasspath =
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}
logger.info("Running instrumentIdeaExtensions with srcdir=${srcDirs.asPath}}, destdir=$output and classpath=$instrumentationClasspath")
ant.withGroovyBuilder {
"instrumentIdeaExtensions"("srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull) {
"instrumentIdeaExtensions"(
"srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull
) {
if (instrumentNotNull) {
ant.withGroovyBuilder {
"skip"("pattern" to "kotlin/Metadata")

View File

@@ -1,4 +1,4 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
@file:Suppress("unused")
/*
* Copyright 2010-2017 JetBrains s.r.o.
@@ -23,13 +23,12 @@ import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.FileCollection
import org.gradle.api.internal.ConventionTask
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.kotlin.dsl.*
import java.io.File
fun Project.configureInstrumentation() {
fun Project.configureFormInstrumentation() {
plugins.matching { it::class.java.canonicalName.startsWith("org.jetbrains.kotlin.gradle.plugin") }.all {
// When we change the output classes directory, Gradle will automatically configure
// the test compile tasks to use the instrumented classes. Normally this is fine,
@@ -46,8 +45,8 @@ fun Project.configureInstrumentation() {
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
}
}
@@ -68,7 +67,8 @@ fun Project.configureInstrumentation() {
logger.info("Saving old sources dir for project ${project.name}")
val instrumentedClassesDir = File(project.buildDir, "classes/${sourceSetParam.name}-instrumented")
(sourceSetParam.output.classesDirs as ConfigurableFileCollection).setFrom(instrumentedClassesDir)
val instrumentTask = project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
val instrumentTask =
project.tasks.create(sourceSetParam.getTaskName("instrument", "classes"), IntelliJInstrumentCodeTask::class.java)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
@@ -100,6 +100,9 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
@Input
var originalClassesDirs: FileCollection? = null
@get:Input
var instrumentNotNull: Boolean = false
@get:InputFiles
val sourceDirs: FileCollection
get() = project.files(sourceSet!!.allSource.srcDirs.filter { !sourceSet!!.resources.contains(it) && it.exists() })
@@ -109,21 +112,30 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
@TaskAction
fun instrumentClasses() {
logger.info("input files are: ${originalClassesDirs?.joinToString("; ", transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)" }"})}")
logger.info(
"input files are: ${originalClassesDirs?.joinToString(
"; ",
transform = { "'${it.name}'${if (it.exists()) "" else " (does not exists)"}" })}"
)
output.deleteRecursively()
copyOriginalClasses()
val classpath = instrumentationClasspath!!
ant.withGroovyBuilder {
"taskdef"("name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions")
"taskdef"(
"name" to "instrumentIdeaExtensions",
"classpath" to classpath.asPath,
"loaderref" to LOADER_REF,
"classname" to "com.intellij.ant.InstrumentIdeaExtensions"
)
}
logger.info("Compiling forms and instrumenting code with nullability preconditions")
val instrumentNotNull = prepareNotNullInstrumenting(classpath.asPath)
if (instrumentNotNull) {
prepareNotNullInstrumenting(classpath.asPath)
}
instrumentCode(sourceDirs, instrumentNotNull)
}
@@ -134,14 +146,15 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
}
}
private fun prepareNotNullInstrumenting(classpath: String): Boolean {
private fun prepareNotNullInstrumenting(classpath: String) {
ant.withGroovyBuilder {
"typedef"("name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS)
"typedef"(
"name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS
)
}
return true
}
private fun instrumentCode(srcDirs: FileCollection, instrumentNotNull: Boolean) {
@@ -149,20 +162,22 @@ open class IntelliJInstrumentCodeTask : ConventionTask() {
// Instrumentation needs to have access to sources of forms for inclusion
val depSourceDirectorySets = project.configurations["compile"].dependencies.withType(ProjectDependency::class.java)
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
.map { p -> p.dependencyProject.mainSourceSet.allSource.sourceDirectories }
val instrumentationClasspath =
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}
depSourceDirectorySets.fold(sourceSet!!.compileClasspath) { acc, v -> acc + v }.asPath.also {
logger.info("Using following dependency source dirs: $it")
}
logger.info("Running instrumentIdeaExtensions with srcdir=${srcDirs.asPath}}, destdir=$output and classpath=$instrumentationClasspath")
ant.withGroovyBuilder {
"instrumentIdeaExtensions"("srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull) {
"instrumentIdeaExtensions"(
"srcdir" to srcDirs.asPath,
"destdir" to output,
"classpath" to instrumentationClasspath,
"includeantruntime" to false,
"instrumentNotNull" to instrumentNotNull
) {
if (instrumentNotNull) {
ant.withGroovyBuilder {
"skip"("pattern" to "kotlin/Metadata")

View File

@@ -69,6 +69,9 @@ fun Project.intellijUltimatePluginDep(plugin: String) = intellijDep(plugin)
fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = null) {
names.forEach {
var baseName = it.removeSuffix(".jar")
if (baseName == "annotations") {
error("Don't use anntations.jar from intellij. Kotlin stdlib already has this annotations.")
}
if (rootProject != null && rootProject.extra.has("ignore.jar.$baseName")) {
return@forEach
}

View File

@@ -151,7 +151,8 @@ class JpsCompatiblePlugin : Plugin<Project> {
val files = render(jpsProject)
removeExistingIdeaLibrariesAndModules()
removeJpsRunConfigurations()
removeJpsAndPillRunConfigurations()
removeAllArtifactConfigurations()
copyRunConfigurations()
setOptionsForDefaultJunitRunConfiguration(rootProject)
@@ -163,7 +164,8 @@ class JpsCompatiblePlugin : Plugin<Project> {
initEnvironment(project)
removeExistingIdeaLibrariesAndModules()
removeJpsRunConfigurations()
removeJpsAndPillRunConfigurations()
removeAllArtifactConfigurations()
}
private fun removeExistingIdeaLibrariesAndModules() {
@@ -171,10 +173,17 @@ class JpsCompatiblePlugin : Plugin<Project> {
File(projectDir, ".idea/modules").deleteRecursively()
}
private fun removeJpsRunConfigurations() {
private fun removeJpsAndPillRunConfigurations() {
File(projectDir, ".idea/runConfigurations")
.walk()
.filter { it.name.startsWith("JPS_") && it.extension.toLowerCase() == "xml" }
.filter { (it.name.startsWith("JPS_") || it.name.startsWith("Pill_")) && it.extension.toLowerCase() == "xml" }
.forEach { it.delete() }
}
private fun removeAllArtifactConfigurations() {
File(projectDir, ".idea/artifacts")
.walk()
.filter { it.extension.toLowerCase() == "xml" }
.forEach { it.delete() }
}
@@ -263,7 +272,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
addOrReplaceOptionValue("idea.home.path", platformDirProjectRelative)
addOrReplaceOptionValue("ideaSdk.androidPlugin.path", platformDirProjectRelative + "/plugins/android/lib")
addOrReplaceOptionValue("robolectric.classpath", robolectricClasspath)
addOrReplaceOptionValue("use.pill", "true")
addOrReplaceOptionValue("use.jps", "true")
val isAndroidStudioBunch = project.findProperty("versions.androidStudioRelease") != null
addOrReplaceOptionValue("idea.platform.prefix", if (isAndroidStudioBunch) "AndroidStudio" else null)

View File

@@ -1,7 +1,7 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.logging.Logger
import org.objectweb.asm.*
import org.jetbrains.org.objectweb.asm.*
import java.io.BufferedOutputStream
import java.io.File
import java.io.FileOutputStream
@@ -23,7 +23,7 @@ fun stripMetadata(logger: Logger, classNamePattern: String, inFile: File, outFil
var changed = false
val classWriter = ClassWriter(0)
val classVisitor = object : ClassVisitor(Opcodes.ASM5, classWriter) {
val classVisitor = object : ClassVisitor(Opcodes.API_VERSION, classWriter) {
override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? {
if (Type.getType(desc).internalName == "kotlin/Metadata") {
changed = true

View File

@@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] All Compiler Tests" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration">
<toRun type="JUnit" name="[JPS] Compiler Tests" />
<toRun type="JUnit" name="[JPS] JS Backend Tests" />
<toRun type="JUnit" name="[JPS] Java 8 Tests" />
<method />
</configuration>
</component>

View File

@@ -1,37 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] All IDEA Plugin Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="idea.test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,35 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Compiler Tests" type="JUnit" factoryName="JUnit">
<module name="compiler.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,8 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Generate All Tests" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.pill.generateAllTests.Main" />
<module name="generate-all-tests.test" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<method />
</configuration>
</component>

View File

@@ -1,41 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] IDEA" type="Application" factoryName="Application" singleton="true">
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="idea-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
</method>
</configuration>
</component>

View File

@@ -1,41 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="idea-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
</method>
</configuration>
</component>

View File

@@ -1,28 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] JS Backend Tests" type="JUnit" factoryName="JUnit">
<module name="js.tests.test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.js.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true -Duse.pill=true -Dkotlin.js.skipMinificationTest=false" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,35 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] JVM Backend Tests" type="JUnit" factoryName="JUnit">
<module name="compiler.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -1,26 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Java 8 Tests" type="JUnit" factoryName="JUnit">
<module name="tests-java8.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Dkotlin.colors.enabled=false -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<method />
</configuration>
</component>

View File

@@ -1,21 +0,0 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[JPS] Refresh JPS Model" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<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="pill" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[PILL] All Compiler Tests" type="CompoundRunConfigurationType" factoryName="Compound Run Configuration">
<toRun type="JUnit" name="[Pill] Compiler Tests" />
<toRun type="JUnit" name="[Pill] JS Backend Tests" />
<toRun type="JUnit" name="[Pill] Java 8 Tests" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,37 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] All IDEA Plugin Tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<module name="idea.test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,35 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] Compiler Tests" type="JUnit" factoryName="JUnit">
<module name="compiler.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] Generate All Tests" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="org.jetbrains.kotlin.pill.generateAllTests.Main" />
<module name="generate-all-tests.test" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,41 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] IDEA" type="Application" factoryName="Application" singleton="true">
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="idea-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
</method>
</configuration>
</component>

View File

@@ -0,0 +1,41 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] IDEA (No ProcessCanceledException)" type="Application" factoryName="Application" singleton="true">
<log_file alias="idea.log" path="$PROJECT_DIR$/ideaSDK/system-idea/log/idea.log" />
<option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
<module name="idea-runner" />
<option name="VM_PARAMETERS" value="-Xmx1250m -XX:ReservedCodeCacheSize=240m -XX:+HeapDumpOnOutOfMemoryError -ea -Didea.is.internal=true -Didea.debug.mode=true -Didea.system.path=$PROJECT_DIR$/local/ideaSandbox -Didea.config.path=$PROJECT_DIR$/local/ideaSandbox/config -Dapple.laf.useScreenMenuBar=true -Dapple.awt.graphics.UseQuartz=true -Dsun.io.useCanonCaches=false -Dplugin.path=$PROJECT_DIR$/out/artifacts/Kotlin -Didea.ProcessCanceledException=disabled $ADDITIONAL_IDEA_ARGS$" />
<option name="WORKING_DIRECTORY" value="file://$IDEA_HOME_PATH$" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel">
<option name="bootstrapPath" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="useBootstrapDefaults" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="JavaRebel Debug">
<option name="bootstrapPath" />
<option name="debugPort" value="" />
<option name="jrebelArgs" value="" />
<option name="loggingEnabled" value="false" />
<option name="transport" value="0" />
<option name="useBootstrapDefaults" value="true" />
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Profile " />
<ConfigurationWrapper RunnerId="Run" />
<method>
<option name="BuildArtifacts" enabled="true">
<artifact name="KotlinPlugin" />
</option>
</method>
</configuration>
</component>

View File

@@ -0,0 +1,28 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] JS Backend Tests" type="JUnit" factoryName="JUnit">
<module name="js.tests.test" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.js.test" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1250m -XX:+UseCodeCacheFlushing -Djna.nosys=true -Duse.pill=true -Dkotlin.js.skipMinificationTest=false" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,35 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] JVM Backend Tests" type="JUnit" factoryName="JUnit">
<module name="compiler.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin.codegen" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="" />
<option name="TRANSPORT" value="0" />
<option name="LOCAL" value="true" />
</RunnerSettings>
<RunnerSettings RunnerId="Profile " />
<RunnerSettings RunnerId="Run" />
<ConfigurationWrapper RunnerId="Debug" />
<ConfigurationWrapper RunnerId="Run" />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,26 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] Java 8 Tests" type="JUnit" factoryName="JUnit">
<module name="tests-java8.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="ALTERNATIVE_JRE_PATH" value="1.8" />
<option name="PACKAGE_NAME" value="org.jetbrains.kotlin" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="VM_PARAMETERS" value="-ea -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCodeCacheFlushing -XX:ReservedCodeCacheSize=128m -Djna.nosys=true -Duse.pill=true -Dkotlin.colors.enabled=false -Didea.home.path=$IDEA_HOME_PATH$" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
<method />
</configuration>
</component>

View File

@@ -0,0 +1,21 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] Refresh PILL Model" type="GradleRunConfiguration" factoryName="Gradle" singleton="true">
<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="pill" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<method />
</configuration>
</component>

View File

@@ -83,5 +83,5 @@ dependencies {
androidTestImplementation 'junit:junit:4.12'
implementation 'com.android.support:multidex:1.0.3'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestCompile fileTree(dir: 'libs/test', include: ['*.jar'])
androidTestImplementation fileTree(dir: 'libs/test', include: ['*.jar'])
}

View File

@@ -11,7 +11,7 @@ dependencies {
compile(project(":compiler:cli"))
compile(project(":compiler:frontend"))
compile(project(":compiler:backend"))
compile(project(":kotlin-stdlib"))
compile(kotlinStdlib())
compile(project(":kotlin-reflect"))
compile(projectTests(":compiler:tests-common"))
compile(commonDep("junit:junit"))
@@ -34,7 +34,7 @@ sourceSets {
}
projectTest {
dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray())
dependsOn(":dist")
doFirst {
environment("kotlin.tests.android.timeout", "45")
}

View File

@@ -21,7 +21,6 @@ import org.jetbrains.kotlin.codegen.CodegenTestCase
import org.jetbrains.kotlin.load.kotlin.PackagePartClassUtils
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.test.KotlinTestUtils
import java.io.File
import java.util.regex.Pattern
@@ -31,8 +30,10 @@ private val packagePattern = Pattern.compile("(?m)^\\s*package[ |\t]+([\\w|\\.]*
private val importPattern = Pattern.compile("import[ |\t]([\\w|]*\\.)")
private data class OldPackageAndNew(val oldFqName: FqName, val newFqName: FqName)
internal fun patchFiles(
file: File,
testFile: File,
testFiles: List<CodegenTestCase.TestFile>,
filesHolder: CodegenTestsOnAndroidGenerator.FilesWriter
): FqName? {
@@ -43,33 +44,63 @@ internal fun patchFiles(
val ktFiles = testFiles.filter { it.name.endsWith(".kt") }
if (ktFiles.isEmpty()) return null
val newPackagePrefix = file.path.replace("\\\\|-|\\.|/".toRegex(), "_")
val newPackagePrefix = testFile.path.replace("\\\\|-|\\.|/".toRegex(), "_")
val oldPackage = Ref<FqName>()
val isSingle = testFiles.size == 1
val resultFiles = testFiles.map {
val fileName = if (isSingle) it.name else file.name.substringBeforeLast(".kt") + "/" + it.name
val fileName = if (isSingle) it.name else testFile.name.substringBeforeLast(".kt") + "/" + it.name
TestClassInfo(
fileName,
changePackage(newPackagePrefix, it.content, oldPackage),
oldPackage.get(),
getGeneratedClassName(File(fileName), it.content, newPackagePrefix, oldPackage.get())
fileName,
changePackage(newPackagePrefix, it.content, oldPackage),
oldPackage.get(),
getGeneratedClassName(File(fileName), it.content, newPackagePrefix, oldPackage.get())
)
}
val packages =
resultFiles.map { OldPackageAndNew(it.oldPackage, it.newClassId.parent()) }.sortedByDescending { it.oldFqName.asString().length }
/*replace all Class.forName*/
resultFiles.forEach {
file ->
file.content = resultFiles.fold(file.content) { r, param ->
patchClassForName(param.newClassId, param.oldPackage, r)
//If files contain any val or var declaration with same name as any package name
// then use old conservative renaming scheme, otherwise use aggressive one
// with old package renaming to new one (except some cases for default package)
// Example for conservative switch:
// package foo
// ...
// val foo = ....
// class A(val foo ...)
// fun foo()= { var foo ...}
val conservativeRenameScheme = resultFiles.any { file ->
packages.any {
if (it.oldFqName.isRoot || !it.oldFqName.parent().isRoot) false
else file.content.contains("(val|var)\\s+${it.oldFqName.asString()}[^A-Za-z0-9_.]".toRegex())
}
}
/*patch imports and self imports*/
resultFiles.forEach {
file ->
if (!conservativeRenameScheme) {
/*replace all packages*/
resultFiles.forEach { file ->
file.content = packages.fold(file.content) { r, param ->
patchPackages(param.newFqName, param.oldFqName, r)
}
}
} else {
//patch imports
resultFiles.forEach { file ->
file.content = packages.fold(file.content) { r, param ->
r.patchImports(param.oldFqName, param.newFqName)
}
}
}
/*replace all Class.forName*/
resultFiles.forEach { file ->
file.content = resultFiles.fold(file.content) { r, param ->
r.patchImports(param.oldPackage, param.newPackage)
}.patchSelfImports(file.newPackage)
patchClassForName(param.newClassId, param.oldPackage, r, conservativeRenameScheme)
}
}
//patch self imports
resultFiles.forEach { file ->
file.content = file.content.patchSelfImports(file.newPackage)
}
resultFiles.forEach { resultFile ->
@@ -80,7 +111,7 @@ internal fun patchFiles(
val boxFiles = resultFiles.filter { hasBoxMethod(it.content) }
if (boxFiles.size != 1) {
println("Several box methods in $file")
println("Several box methods in $testFile")
}
return boxFiles.last().newClassId
}
@@ -100,16 +131,14 @@ private fun changePackage(newPackagePrefix: String, text: String, oldPackage: Re
val oldPackageName = matcher.toMatchResult().group(1)
oldPackage.set(FqName(oldPackageName))
return matcher.replaceAll("package $newPackagePrefix.$oldPackageName")
}
else {
} else {
oldPackage.set(FqName.ROOT)
val packageDirective = "package $newPackagePrefix;\n"
if (text.contains("@file:")) {
val index = text.lastIndexOf("@file:")
val packageDirectiveIndex = text.indexOf("\n", index)
return text.substring(0, packageDirectiveIndex + 1) + packageDirective + text.substring(packageDirectiveIndex + 1)
}
else {
} else {
return packageDirective + text
}
}
@@ -132,8 +161,21 @@ private fun getGeneratedClassName(file: File, text: String, newPackagePrefix: St
return PackagePartClassUtils.getPackagePartFqName(packageFqName, file.name)
}
private fun patchClassForName(className: FqName, oldPackage: FqName, text: String): String {
return text.replace(("Class\\.forName\\(\"" + oldPackage.child(className.shortName()).asString() + "\"\\)").toRegex(), "Class.forName(\"" + className.asString() + "\")")
private fun patchClassForName(className: FqName, oldPackage: FqName, text: String, conservativeRenameSchemeheme: Boolean): String {
if (!conservativeRenameSchemeheme && !oldPackage.isRoot) return text
return text.replace(
("Class\\.forName\\(\"" + oldPackage.child(className.shortName()).asString()).toRegex(),
"Class.forName(\"" + className.asString()
)
}
private fun patchPackages(newPackage: FqName, oldPackage: FqName, text: String): String {
if (oldPackage.isRoot) return text
val regexp = "([^A-Za-z0-9.])" + (oldPackage.asString() + ".").replace(".", "\\.")
return text.replace(
regexp.toRegex(), "$1" + newPackage.asString() + "."
)
}
private fun String.patchImports(oldPackage: FqName, newPackage: FqName): String {
@@ -150,7 +192,10 @@ private fun String.patchSelfImports(newPackage: FqName): String {
val possibleSelfImport = matcher.toMatchResult().group(1)
val classOrObjectPattern = Pattern.compile("[\\s|^](class|object)\\s$possibleSelfImport[\\s|\\(|{|;|:]")
if (classOrObjectPattern.matcher(newText).find()) {
newText = newText.replace("import " + possibleSelfImport, "import " + newPackage.child(Name.identifier(possibleSelfImport)).asString())
newText = newText.replace(
"import $possibleSelfImport",
"import " + newPackage.child(Name.identifier(possibleSelfImport)).asString()
)
}
}
return newText

View File

@@ -33,62 +33,25 @@ public class SpecialFiles {
private static void fillExcludedFiles() {
// Reflection
excludedFiles.add("enclosing");
excludedFiles.add("noReflectAtRuntime");
excludedFiles.add("methodsFromAny");
excludedFiles.add("genericProperty.kt");
excludedFiles.add("kt3238.kt");
excludedFiles.add("kt1482_2279.kt");
excludedFiles.add("extensionMethod.kt");
excludedFiles.add("functionNtoStringNoReflect.kt");
excludedFiles.add("innerGeneric.kt");
excludedFiles.add("simpleCreateType.kt");
excludedFiles.add("equalsHashCodeToString.kt");
excludedFiles.add("arrayOfKClasses.kt");
excludedFiles.add("enumKClassAnnotation.kt");
excludedFiles.add("primitivesAndArrays.kt");
excludedFiles.add("getDelegateWithoutReflection.kt");
excludedFiles.add("parameterAnnotationInDefaultImpls.kt");
excludedFiles.add("kt17091.kt");
excludedFiles.add("kt17091_2.kt");
excludedFiles.add("kt17091_3.kt");
excludedFiles.add("kt22906.kt");
excludedFiles.add("kt10259.kt");
excludedFiles.add("simpleClassLiteral.kt");
// Reflection is used to check full class name
excludedFiles.add("native");
//UnsatisfiedLinkError
excludedFiles.add("nativePropertyAccessors.kt");
excludedFiles.add("topLevel.kt");
//Test with no reflection at runtime
excludedFiles.add("noReflectAtRuntime");
excludedFiles.add("functionNtoStringNoReflect.kt");
excludedFiles.add("getDelegateWithoutReflection.kt");
// "IOOBE: Invalid index 4, size is 4" for java.lang.reflect.ParameterizedType on Android
excludedFiles.add("innerGenericTypeArgument.kt");
// Cannot change package name
excludedFiles.add("nestedInPackage.kt");
excludedFiles.add("packageQualifiedMethod.kt");
excludedFiles.add("classObjectToString.kt");
excludedFiles.add("assertionStackTrace.kt");
excludedFiles.add("anonymousObjectReifiedSupertype.kt");
excludedFiles.add("innerAnonymousObject.kt");
excludedFiles.add("nestedReifiedSignature.kt");
excludedFiles.add("recursiveInnerAnonymousObject.kt");
excludedFiles.add("approximateCapturedTypes.kt");
excludedFiles.add("classForEnumEntry.kt");
excludedFiles.add("kt10143.kt");
excludedFiles.add("internalTopLevelOtherPackage.kt");
excludedFiles.add("noPrivateDelegation.kt");
excludedFiles.add("platformTypeAssertionStackTrace.kt");
excludedFiles.add("packages.kt");
excludedFiles.add("kt10259.kt");
excludedFiles.add("kt11081.kt");
excludedFiles.add("kt6990.kt");
excludedFiles.add("mainInFiles.kt");
excludedFiles.add("noClassForSimpleEnum.kt");
excludedFiles.add("simpleClassLiteral.kt");
excludedFiles.add("jvmName.kt");
excludedFiles.add("qualifiedName.kt");
excludedFiles.add("topLevelProperty.kt");
excludedFiles.add("typeParameters.kt");
excludedFiles.add("kt13133.kt");
excludedFiles.add("genericOverriddenFunction.kt");
excludedFiles.add("genericOverriddenProperty.kt");
excludedFiles.add("genericProperty.kt");
// StackOverflow with StringBuilder (escape())
excludedFiles.add("kt684.kt");
@@ -96,18 +59,6 @@ public class SpecialFiles {
// Wrong enclosing info or signature after package renaming
excludedFiles.add("enclosingInfo");
excludedFiles.add("signature");
excludedFiles.add("genericBackingFieldSignature.kt");
excludedFiles.add("genericMethodSignature.kt");
excludedFiles.add("kt11121.kt");
excludedFiles.add("kt5112.kt");
// Different format of inner signature on Android and JVM
excludedFiles.add("signatureOfDeepGenericInner.kt");
excludedFiles.add("signatureOfDeepInner.kt");
excludedFiles.add("signatureOfDeepInnerLastGeneric.kt");
excludedFiles.add("signatureOfGenericInnerGenericOuter.kt");
excludedFiles.add("signatureOfGenericInnerSimpleOuter.kt");
excludedFiles.add("signatureOfSimpleInnerSimpleOuter.kt");
// Some classes are not visible on android
excludedFiles.add("classpath.kt");
@@ -120,8 +71,6 @@ public class SpecialFiles {
// Additional nested class in 'Thread' class on Android
excludedFiles.add("nestedClasses.kt");
// No 'modifiers' field in 'java.lang.reflect.Field' class
excludedFiles.add("kt12200Const.kt");
// KT-8120
excludedFiles.add("closureOfInnerLocalClass.kt");

View File

@@ -4,8 +4,6 @@ plugins {
id("jps-compatible")
}
jvmTarget = "1.6"
dependencies {
compile(project(":core:descriptors"))
compile(project(":core:descriptors.jvm"))

View File

@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.bindingContextUtil.isUsedAsExpression
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.checkers.ExpectedActualDeclarationChecker
import org.jetbrains.kotlin.resolve.multiplatform.ExpectedActualResolver
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.DFS
@@ -169,23 +168,19 @@ object CodegenUtil {
}
/**
* Returns declarations in the given [file] which should be generated by the back-end. This includes all declarations
* minus all expected declarations (except annotation classes annotated with @OptionalExpectation).
* Returns functions, properties and type aliases in the given [file] which should be generated by the back-end.
*/
@JvmStatic
fun getDeclarationsToGenerate(file: KtFile, bindingContext: BindingContext): List<KtDeclaration> =
file.declarations.filter(fun(declaration: KtDeclaration): Boolean {
if (!declaration.hasExpectModifier()) return true
fun getMemberDeclarationsToGenerate(file: KtFile): List<KtDeclaration> =
file.declarations.filter { declaration ->
!declaration.hasExpectModifier() && (declaration is KtNamedFunction || declaration is KtProperty || declaration is KtTypeAlias)
}
if (declaration is KtClass) {
val descriptor = bindingContext.get(BindingContext.CLASS, declaration)
if (descriptor != null && ExpectedActualDeclarationChecker.shouldGenerateExpectClass(descriptor)) {
return true
}
}
return false
})
@JvmStatic
fun getMemberDescriptorsToGenerate(file: KtFile, bindingContext: BindingContext): List<MemberDescriptor> =
getMemberDeclarationsToGenerate(file).mapNotNull { declaration ->
bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration) as MemberDescriptor?
}
@JvmStatic
fun findExpectedFunctionForActual(descriptor: FunctionDescriptor): FunctionDescriptor? {

View File

@@ -27,9 +27,11 @@ interface FunctionHandle {
* class ones (see [findConcreteSuperDeclaration] method in bridges.kt).
* Note that interface methods with body compiled to jvm 8 target are assumed to be non-abstract in bridges method calculation
* (more details in [DescriptorBasedFunctionHandle.isBodyOwner] comment).*/
val isInterfaceDeclaration: Boolean
val mayBeUsedAsSuperImplementation: Boolean
fun getOverridden(): Iterable<FunctionHandle>
val mightBeIncorrectCode: Boolean get() = false
}
data class Bridge<out Signature>(
@@ -54,7 +56,7 @@ fun <Function : FunctionHandle, Signature> generateBridges(
// into some of the super-classes and will be inherited in this class
if (fake && function.getOverridden().none { it.isAbstract }) return setOf()
val implementation = findConcreteSuperDeclaration(function)
val implementation = findConcreteSuperDeclaration(function) ?: return setOf()
val bridgesToGenerate = findAllReachableDeclarations(function).mapTo(LinkedHashSet<Signature>(), signature)
@@ -92,7 +94,7 @@ fun <Function : FunctionHandle> findAllReachableDeclarations(function: Function)
* Given a concrete function, finds an implementation (a concrete declaration) of this function in the supertypes.
* The implementation is guaranteed to exist because if it wouldn't, the given function would've been abstract
*/
fun <Function : FunctionHandle> findConcreteSuperDeclaration(function: Function): Function {
fun <Function : FunctionHandle> findConcreteSuperDeclaration(function: Function): Function? {
require(!function.isAbstract, { "Only concrete functions have implementations: $function" })
if (function.isDeclaration) return function
@@ -114,9 +116,13 @@ fun <Function : FunctionHandle> findConcreteSuperDeclaration(function: Function)
}
result.removeAll(toRemove)
val concreteRelevantDeclarations = result.filter { !it.isAbstract && !it.isInterfaceDeclaration }
val concreteRelevantDeclarations = result.filter { !it.isAbstract && it.mayBeUsedAsSuperImplementation }
if (concreteRelevantDeclarations.size != 1) {
error("Concrete fake override $function should have exactly one concrete super-declaration: $concreteRelevantDeclarations")
if (!function.mightBeIncorrectCode) {
error("Concrete fake override $function should have exactly one concrete super-declaration: $concreteRelevantDeclarations")
} else {
return null
}
}
return concreteRelevantDeclarations[0]

View File

@@ -25,10 +25,9 @@ import org.jetbrains.kotlin.resolve.calls.callResolverUtil.isOrOverridesSynthesi
fun <Signature> generateBridgesForFunctionDescriptor(
descriptor: FunctionDescriptor,
signature: (FunctionDescriptor) -> Signature,
areDeclarationAndDefinitionSame: (CallableMemberDescriptor) -> Boolean
signature: (FunctionDescriptor) -> Signature
): Set<Bridge<Signature>> {
return generateBridges(DescriptorBasedFunctionHandle(descriptor, areDeclarationAndDefinitionSame), { signature(it.descriptor) })
return generateBridges(DescriptorBasedFunctionHandle(descriptor), { signature(it.descriptor) })
}
/**
@@ -48,34 +47,26 @@ fun <Signature> generateBridgesForFunctionDescriptor(
* can generate a bridge near an implementation (of course, in case it has a super-declaration with a different signature). Ultimately this
* eases the process of determining what bridges are already generated in our supertypes and need to be inherited, not regenerated.
*/
class DescriptorBasedFunctionHandle(
val descriptor: FunctionDescriptor,
/*
To generate proper bridges for non-abstract function
we should know if the function declaration and its definition in the target platform are the same or not.
For JS and @JvmDefault JVM members they are placed in interface classes and
we need generate bridge for such function ('isAbstract' will return false).
For non-@JvmDefault function, its body is generated in a separate place (DefaultImpls) and
the method in the interface is abstract so we must not generate bridges for such cases.
*/
areDeclarationAndDefinitionSame: (CallableMemberDescriptor) -> Boolean
) : FunctionHandle {
private val overridden = descriptor.overriddenDescriptors.map {
DescriptorBasedFunctionHandle(
it.original,
areDeclarationAndDefinitionSame
)
open class DescriptorBasedFunctionHandle(val descriptor: FunctionDescriptor) : FunctionHandle {
private val _overridden by lazy(LazyThreadSafetyMode.NONE) {
descriptor.overriddenDescriptors.map {
createHandleForOverridden(
it.original
)
}
}
protected open fun createHandleForOverridden(overridden: FunctionDescriptor) = DescriptorBasedFunctionHandle(overridden)
override val isDeclaration: Boolean = descriptor.kind.isReal || findInterfaceImplementation(descriptor) != null
override val isAbstract: Boolean =
descriptor.modality == Modality.ABSTRACT || !areDeclarationAndDefinitionSame(descriptor)
descriptor.modality == Modality.ABSTRACT
override val isInterfaceDeclaration: Boolean
get() = DescriptorUtils.isInterface(descriptor.containingDeclaration)
override val mayBeUsedAsSuperImplementation: Boolean =
!DescriptorUtils.isInterface(descriptor.containingDeclaration)
override fun getOverridden() = overridden
override fun getOverridden() = _overridden
override fun hashCode(): Int {
return descriptor.hashCode()

View File

@@ -1,29 +1,21 @@
plugins {
kotlin("jvm")
id("jps-compatible")
}
jvmTarget = "1.6"
dependencies {
compile(project(":kotlin-annotations-jvm"))
compile(project(":compiler:util"))
compile(project(":compiler:backend-common"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:ir.tree"))
compile(project(":compiler:ir.psi2ir"))
compile(project(":compiler:ir.backend.common"))
compile(project(":compiler:serialization"))
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "annotations", "asm-all", rootProject = rootProject) }
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", rootProject = rootProject) }
}
sourceSets {
"main" {
projectDefault()
java.srcDir("../ir/backend.jvm/src")
}
"test" {}
}

View File

@@ -31,8 +31,8 @@ import java.util.List;
import static org.jetbrains.kotlin.codegen.inline.InlineCodegenUtilsKt.GENERATE_SMAP;
public abstract class AbstractClassBuilder implements ClassBuilder {
protected static final MethodVisitor EMPTY_METHOD_VISITOR = new MethodVisitor(Opcodes.ASM5) {};
protected static final FieldVisitor EMPTY_FIELD_VISITOR = new FieldVisitor(Opcodes.ASM5) {};
protected static final MethodVisitor EMPTY_METHOD_VISITOR = new MethodVisitor(Opcodes.API_VERSION) {};
protected static final FieldVisitor EMPTY_FIELD_VISITOR = new FieldVisitor(Opcodes.API_VERSION) {};
private String thisName;

View File

@@ -72,7 +72,7 @@ public abstract class AnnotationCodegen {
new JvmFlagAnnotation(JvmAnnotationUtilKt.SYNCHRONIZED_ANNOTATION_FQ_NAME.asString(), Opcodes.ACC_SYNCHRONIZED)
);
private static final AnnotationVisitor NO_ANNOTATION_VISITOR = new AnnotationVisitor(Opcodes.ASM5) {
private static final AnnotationVisitor NO_ANNOTATION_VISITOR = new AnnotationVisitor(Opcodes.API_VERSION) {
@Override
public AnnotationVisitor visitAnnotation(String name, @NotNull String desc) {
return safe(super.visitAnnotation(name, desc));

View File

@@ -435,6 +435,11 @@ public class AsmUtil {
return InlineUtil.isInlineOrContainingInline(descriptor.getContainingDeclaration()) ? ACC_PUBLIC : NO_FLAG_PACKAGE_PRIVATE;
}
public static int getSyntheticAccessFlagForLambdaClass(@NotNull ClassDescriptor descriptor) {
return descriptor instanceof SyntheticClassDescriptorForLambda &&
((SyntheticClassDescriptorForLambda) descriptor).isCallableReference() ? ACC_SYNTHETIC : 0;
}
public static int calculateInnerClassAccessFlags(@NotNull ClassDescriptor innerClass) {
int visibility =
innerClass instanceof SyntheticClassDescriptorForLambda
@@ -443,6 +448,7 @@ public class AsmUtil {
? ACC_PUBLIC
: getVisibilityAccessFlag(innerClass);
return visibility |
getSyntheticAccessFlagForLambdaClass(innerClass) |
innerAccessFlagsForModalityAndKind(innerClass) |
(innerClass.isInner() ? 0 : ACC_STATIC);
}
@@ -629,7 +635,6 @@ public class AsmUtil {
}
public static void genClosureFields(List<Pair<String, Type>> allFields, ClassBuilder builder) {
//noinspection PointlessBitwiseExpression
int access = NO_FLAG_PACKAGE_PRIVATE | ACC_SYNTHETIC | ACC_FINAL;
for (Pair<String, Type> field : allFields) {
builder.newField(JvmDeclarationOrigin.NO_ORIGIN, access, field.first, field.second.getDescriptor(), null, null);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* Copyright 2010-2019 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.
*/
@@ -21,12 +21,14 @@ import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin
import org.jetbrains.org.objectweb.asm.Label
import org.jetbrains.org.objectweb.asm.MethodVisitor
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
import org.jetbrains.org.objectweb.asm.tree.FieldInsnNode
import org.jetbrains.org.objectweb.asm.tree.MethodNode
val assertionsDisabledFieldName = "\$assertionsDisabled"
const val ASSERTIONS_DISABLED_FIELD_NAME = "\$assertionsDisabled"
private const val ALWAYS_ENABLED_ASSERT_FUNCTION_NAME = "alwaysEnabledAssert"
private const val LAMBDA_INTERNAL_NAME = "kotlin/jvm/functions/Function0"
private const val ASSERTION_ERROR_INTERNAL_NAME = "java/lang/AssertionError"
@@ -43,6 +45,9 @@ private fun FunctionDescriptor.isBuiltinAlwaysEnabledAssertWithoutLambda() =
fun FunctionDescriptor.isBuiltinAlwaysEnabledAssert() =
this.isBuiltinAlwaysEnabledAssertWithLambda() || this.isBuiltinAlwaysEnabledAssertWithoutLambda()
fun FieldInsnNode.isCheckAssertionsStatus() =
opcode == Opcodes.GETSTATIC && name == ASSERTIONS_DISABLED_FIELD_NAME && desc == Type.BOOLEAN_TYPE.descriptor
fun createMethodNodeForAlwaysEnabledAssert(
functionDescriptor: FunctionDescriptor,
typeMapper: KotlinTypeMapper
@@ -53,7 +58,7 @@ fun createMethodNodeForAlwaysEnabledAssert(
val node =
org.jetbrains.org.objectweb.asm.tree.MethodNode(
Opcodes.ASM5,
Opcodes.API_VERSION,
Opcodes.ACC_STATIC,
"fake",
typeMapper.mapAsmMethod(functionDescriptor).descriptor, null, null
@@ -131,17 +136,16 @@ private fun inlineAlwaysInlineAssert(resolvedCall: ResolvedCall<*>, codegen: Exp
)
}
fun generateAssertionsDisabledFieldInitialization(parentCodegen: MemberCodegen<*>) {
parentCodegen.v.newField(
JvmDeclarationOrigin.NO_ORIGIN, Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_SYNTHETIC, assertionsDisabledFieldName,
fun generateAssertionsDisabledFieldInitialization(classBuilder: ClassBuilder, clInitBuilder: MethodVisitor) {
classBuilder.newField(
JvmDeclarationOrigin.NO_ORIGIN, Opcodes.ACC_STATIC or Opcodes.ACC_FINAL or Opcodes.ACC_SYNTHETIC, ASSERTIONS_DISABLED_FIELD_NAME,
"Z", null, null
)
val clInitCodegen = parentCodegen.createOrGetClInitCodegen()
MemberCodegen.markLineNumberForElement(parentCodegen.element.psiOrParent, clInitCodegen.v)
val thenLabel = Label()
val elseLabel = Label()
with(clInitCodegen.v) {
aconst(Type.getObjectType(parentCodegen.v.thisName))
with(InstructionAdapter(clInitBuilder)) {
mark(Label())
aconst(Type.getObjectType(classBuilder.thisName))
invokevirtual("java/lang/Class", "desiredAssertionStatus", "()Z", false)
ifne(thenLabel)
iconst(1)
@@ -151,7 +155,7 @@ fun generateAssertionsDisabledFieldInitialization(parentCodegen: MemberCodegen<*
iconst(0)
mark(elseLabel)
putstatic(parentCodegen.v.thisName, assertionsDisabledFieldName, "Z")
putstatic(classBuilder.thisName, ASSERTIONS_DISABLED_FIELD_NAME, "Z")
}
}

View File

@@ -24,7 +24,6 @@ import org.jetbrains.org.objectweb.asm.util.TraceClassVisitor;
import java.io.PrintWriter;
import java.io.StringWriter;
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
public class ClassBuilderFactories {
@NotNull
public static ClassBuilderFactory THROW_EXCEPTION = new ClassBuilderFactory() {

View File

@@ -23,17 +23,20 @@ public class ClassBuilderMode {
public final boolean generateMetadata;
public final boolean generateSourceRetentionAnnotations;
public final boolean generateMultiFileFacadePartClasses;
public final boolean mightBeIncorrectCode;
private ClassBuilderMode(
boolean generateBodies,
boolean generateMetadata,
boolean generateSourceRetentionAnnotations,
boolean generateMultiFileFacadePartClasses
boolean generateMultiFileFacadePartClasses,
boolean mightBeIncorrectCode
) {
this.generateBodies = generateBodies;
this.generateMetadata = generateMetadata;
this.generateSourceRetentionAnnotations = generateSourceRetentionAnnotations;
this.generateMultiFileFacadePartClasses = generateMultiFileFacadePartClasses;
this.mightBeIncorrectCode = mightBeIncorrectCode;
}
/**
@@ -43,7 +46,8 @@ public class ClassBuilderMode {
/* bodies = */ true,
/* metadata = */ true,
/* sourceRetention = */ false,
/* generateMultiFileFacadePartClasses = */ true);
/* generateMultiFileFacadePartClasses = */ true,
/* mightBeIncorrectCode = */ false);
/**
* ABI for compilation (non-private signatures + inline function bodies)
@@ -52,7 +56,8 @@ public class ClassBuilderMode {
/* bodies = */ true,
/* metadata = */ true,
/* sourceRetention = */ false,
/* generateMultiFileFacadePartClasses = */ true);
/* generateMultiFileFacadePartClasses = */ true,
/* mightBeIncorrectCode = */ false);
/**
* Generating light classes: Only function signatures
@@ -61,7 +66,8 @@ public class ClassBuilderMode {
/* bodies = */ false,
/* metadata = */ false,
/* sourceRetention = */ true,
/* generateMultiFileFacadePartClasses = */ false);
/* generateMultiFileFacadePartClasses = */ false,
/* mightBeIncorrectCode = */ true);
/**
* Function signatures + metadata (to support incremental compilation with kapt)
@@ -70,12 +76,18 @@ public class ClassBuilderMode {
/* bodies = */ false,
/* metadata = */ true,
/* sourceRetention = */ true,
/* generateMultiFileFacadePartClasses = */ true);
/* generateMultiFileFacadePartClasses = */ true,
/* mightBeIncorrectCode = */ true);
@TestOnly
public final static ClassBuilderMode LIGHT_ANALYSIS_FOR_TESTS = new ClassBuilderMode(
private final static ClassBuilderMode LIGHT_ANALYSIS_FOR_TESTS = new ClassBuilderMode(
/* bodies = */ false,
/* metadata = */ true,
/* sourceRetention = */ false,
/* generateMultiFileFacadePartClasses = */ true);
/* generateMultiFileFacadePartClasses = */ true,
/* mightBeIncorrectCode = */ true);
@TestOnly
public static ClassBuilderMode getLightAnalysisForTests() {
return LIGHT_ANALYSIS_FOR_TESTS;
}
}

View File

@@ -49,7 +49,7 @@ import org.jetbrains.kotlin.serialization.StringTableImpl;
import org.jetbrains.org.objectweb.asm.Type;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.getMappingFileName;
@@ -62,7 +62,7 @@ public class ClassFileFactory implements OutputFileCollection {
private boolean isDone = false;
private final Set<File> sourceFiles = new HashSet<>();
private final Map<String, PackageParts> partsGroupedByPackage = new LinkedHashMap<>();
private final PackagePartRegistry packagePartRegistry = new PackagePartRegistry();
public ClassFileFactory(@NotNull GenerationState state, @NotNull ClassBuilderFactory builderFactory) {
this.state = state;
@@ -73,6 +73,11 @@ public class ClassFileFactory implements OutputFileCollection {
return state;
}
@NotNull
public PackagePartRegistry getPackagePartRegistry() {
return packagePartRegistry;
}
@NotNull
public ClassBuilder newVisitor(
@NotNull JvmDeclarationOrigin origin,
@@ -110,7 +115,7 @@ public class ClassFileFactory implements OutputFileCollection {
JvmModuleProtoBuf.Module.Builder builder = JvmModuleProtoBuf.Module.newBuilder();
String outputFilePath = getMappingFileName(state.getModuleName());
for (PackageParts part : ClassFileUtilsKt.addCompiledPartsAndSort(partsGroupedByPackage.values(), state)) {
for (PackageParts part : ClassFileUtilsKt.addCompiledPartsAndSort(packagePartRegistry.getParts().values(), state)) {
part.addTo(builder);
}
@@ -133,12 +138,7 @@ public class ClassFileFactory implements OutputFileCollection {
@Override
public String asText(ClassBuilderFactory factory) {
try {
return new String(asBytes(factory), "UTF-8");
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
return new String(asBytes(factory), StandardCharsets.UTF_8);
}
});
}
@@ -239,22 +239,14 @@ public class ClassFileFactory implements OutputFileCollection {
public PackageCodegen forPackage(@NotNull FqName fqName, @NotNull Collection<KtFile> files) {
assert !isDone : "Already done!";
registerSourceFiles(files);
return state.getCodegenFactory().createPackageCodegen(state, files, fqName, buildNewPackagePartRegistry(fqName));
return state.getCodegenFactory().createPackageCodegen(state, files, fqName);
}
@NotNull
public MultifileClassCodegen forMultifileClass(@NotNull FqName facadeFqName, @NotNull Collection<KtFile> files) {
assert !isDone : "Already done!";
registerSourceFiles(files);
return state.getCodegenFactory().createMultifileClassCodegen(state, files, facadeFqName, buildNewPackagePartRegistry(facadeFqName.parent()));
}
private PackagePartRegistry buildNewPackagePartRegistry(@NotNull FqName packageFqName) {
String packageFqNameAsString = packageFqName.asString();
return (partInternalName, facadeInternalName) -> {
PackageParts packageParts = partsGroupedByPackage.computeIfAbsent(packageFqNameAsString, PackageParts::new);
packageParts.addPart(partInternalName, facadeInternalName);
};
return state.getCodegenFactory().createMultifileClassCodegen(state, files, facadeFqName);
}
private void registerSourceFiles(Collection<KtFile> files) {

View File

@@ -142,13 +142,14 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
sw.writeInterfaceEnd();
}
v.defineClass(element,
state.getClassFileVersion(),
ACC_FINAL | ACC_SUPER | visibilityFlag,
asmType.getInternalName(),
sw.makeJavaGenericSignature(),
superClassAsmType.getInternalName(),
superInterfaceAsmTypes
v.defineClass(
element,
state.getClassFileVersion(),
ACC_FINAL | ACC_SUPER | visibilityFlag | getSyntheticAccessFlagForLambdaClass(classDescriptor),
asmType.getInternalName(),
sw.makeJavaGenericSignature(),
superClassAsmType.getInternalName(),
superInterfaceAsmTypes
);
initDefaultSourceMappingIfNeeded(context, this, state);

View File

@@ -26,8 +26,10 @@ import org.jetbrains.kotlin.psi.KtFile
interface CodegenFactory {
fun generateModule(state: GenerationState, files: Collection<KtFile?>, errorHandler: CompilationErrorHandler)
fun createPackageCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName, registry: PackagePartRegistry): PackageCodegen
fun createMultifileClassCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName, registry: PackagePartRegistry): MultifileClassCodegen
fun createPackageCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName): PackageCodegen
fun createMultifileClassCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName): MultifileClassCodegen
companion object {
fun doCheckCancelled(state: GenerationState) {
@@ -69,11 +71,11 @@ object DefaultCodegenFactory : CodegenFactory {
}
}
override fun createPackageCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName, registry: PackagePartRegistry) =
PackageCodegenImpl(state, files, fqName, registry)
override fun createPackageCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName) =
PackageCodegenImpl(state, files, fqName)
override fun createMultifileClassCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName, registry: PackagePartRegistry) =
MultifileClassCodegenImpl(state, files, fqName, registry)
override fun createMultifileClassCodegen(state: GenerationState, files: Collection<KtFile>, fqName: FqName) =
MultifileClassCodegenImpl(state, files, fqName)
private fun generateMultifileClass(
state: GenerationState,
@@ -96,5 +98,4 @@ object DefaultCodegenFactory : CodegenFactory {
val codegen = state.factory.forPackage(packageFqName, jetFiles)
codegen.generate(errorHandler)
}
}
}

View File

@@ -716,13 +716,11 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
if (stackElement instanceof FinallyBlockStackElement) {
FinallyBlockStackElement finallyBlockStackElement = (FinallyBlockStackElement) stackElement;
//noinspection ConstantConditions
genFinallyBlockOrGoto(finallyBlockStackElement, null, afterBreakContinueLabel);
}
else if (stackElement instanceof LoopBlockStackElement) {
LoopBlockStackElement loopBlockStackElement = (LoopBlockStackElement) stackElement;
KtSimpleNameExpression labelElement = expression.getTargetLabel();
//noinspection ConstantConditions
if (labelElement == null ||
loopBlockStackElement.targetLabel != null &&
labelElement.getReferencedName().equals(loopBlockStackElement.targetLabel.getReferencedName())) {
@@ -2280,7 +2278,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
// Constructors with inline class type value parameters should always be called using an accessor.
// NB this will require accessors even if the constructor itself is in a different module.
return new AccessorForConstructorDescriptor(
(ClassConstructorDescriptor) descriptor,
(ClassConstructorDescriptor) descriptor.getOriginal(),
descriptor.getContainingDeclaration(),
getSuperCallTarget(resolvedCall.getCall()),
AccessorKind.NORMAL

View File

@@ -9,13 +9,11 @@ import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.psi.PsiElement;
import com.intellij.util.ArrayUtil;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.backend.common.CodegenUtil;
import org.jetbrains.kotlin.backend.common.bridges.Bridge;
import org.jetbrains.kotlin.backend.common.bridges.ImplKt;
import org.jetbrains.kotlin.codegen.binding.CodegenBinding;
import org.jetbrains.kotlin.codegen.context.*;
import org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenUtilKt;
@@ -25,7 +23,6 @@ import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
import org.jetbrains.kotlin.codegen.state.TypeMapperUtilsKt;
import org.jetbrains.kotlin.config.JvmDefaultMode;
import org.jetbrains.kotlin.config.JvmTarget;
import org.jetbrains.kotlin.config.LanguageFeature;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.annotations.Annotated;
@@ -92,15 +89,6 @@ public class FunctionCodegen {
private final ClassBuilder v;
private final MemberCodegen<?> memberCodegen;
private final Function1<CallableMemberDescriptor, Boolean> DECLARATION_AND_DEFINITION_CHECKER = new Function1<CallableMemberDescriptor, Boolean>() {
@Override
public Boolean invoke(CallableMemberDescriptor descriptor) {
return !isInterface(descriptor.getContainingDeclaration()) ||
(state.getTarget() != JvmTarget.JVM_1_6 &&
hasJvmDefaultAnnotation(descriptor));
}
};
public FunctionCodegen(
@NotNull CodegenContext owner,
@NotNull ClassBuilder v,
@@ -671,8 +659,6 @@ public class FunctionCodegen {
genNotNullAssertionsForParameters(new InstructionAdapter(mv), parentCodegen.state, functionDescriptor, frameMap);
}
parentCodegen.beforeMethodBody(mv);
methodEnd = new Label();
context.setMethodEndLabel(methodEnd);
strategy.generateBody(mv, frameMap, signature, context, parentCodegen);
@@ -1069,14 +1055,14 @@ public class FunctionCodegen {
private boolean hasSpecialBridgeMethod(@NotNull FunctionDescriptor descriptor) {
if (SpecialBuiltinMembers.getOverriddenBuiltinReflectingJvmDescriptor(descriptor) == null) return false;
return !BuiltinSpecialBridgesUtil.generateBridgesForBuiltinSpecial(
descriptor, typeMapper::mapAsmMethod, DECLARATION_AND_DEFINITION_CHECKER
descriptor, typeMapper::mapAsmMethod, state
).isEmpty();
}
public void generateBridges(@NotNull FunctionDescriptor descriptor) {
if (descriptor instanceof ConstructorDescriptor) return;
if (owner.getContextKind() == OwnerKind.DEFAULT_IMPLS) return;
if (!DECLARATION_AND_DEFINITION_CHECKER.invoke(descriptor)) return;
if (JvmBridgesImplKt.isAbstractOnJvmIgnoringActualModality(descriptor)) return;
// equals(Any?), hashCode(), toString() never need bridges
if (isMethodOfAny(descriptor)) return;
@@ -1086,7 +1072,7 @@ public class FunctionCodegen {
Set<Bridge<Method>> bridgesToGenerate;
if (!isSpecial) {
bridgesToGenerate =
ImplKt.generateBridgesForFunctionDescriptor(descriptor, typeMapper::mapAsmMethod, DECLARATION_AND_DEFINITION_CHECKER);
JvmBridgesImplKt.generateBridgesForFunctionDescriptorForJvm(descriptor, typeMapper::mapAsmMethod, state);
if (!bridgesToGenerate.isEmpty()) {
PsiElement origin = descriptor.getKind() == DECLARATION ? getSourceFromDescriptor(descriptor) : null;
boolean isSpecialBridge =
@@ -1099,7 +1085,7 @@ public class FunctionCodegen {
}
else {
Set<BridgeForBuiltinSpecial<Method>> specials = BuiltinSpecialBridgesUtil.generateBridgesForBuiltinSpecial(
descriptor, typeMapper::mapAsmMethod, DECLARATION_AND_DEFINITION_CHECKER
descriptor, typeMapper::mapAsmMethod, state
);
if (!specials.isEmpty()) {
@@ -1222,10 +1208,6 @@ public class FunctionCodegen {
getThrownExceptions(functionDescriptor, typeMapper)
);
// Only method annotations are copied to the $default method. Parameter annotations are not copied until there are valid use cases;
// enum constructors have two additional synthetic parameters which somewhat complicate this task
AnnotationCodegen.forMethod(mv, memberCodegen, state).genAnnotations(functionDescriptor, defaultMethod.getReturnType());
if (!state.getClassBuilderMode().generateBodies) {
if (this.owner instanceof MultifileClassFacadeContext)
endVisit(mv, "default method delegation", getSourceFromDescriptor(functionDescriptor));

View File

@@ -67,8 +67,11 @@ import static org.jetbrains.kotlin.codegen.CodegenUtilKt.isGenericToArray;
import static org.jetbrains.kotlin.codegen.CodegenUtilKt.isNonGenericToArray;
import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.*;
import static org.jetbrains.kotlin.codegen.binding.CodegenBinding.enumEntryNeedSubclass;
import static org.jetbrains.kotlin.codegen.binding.CodegenBinding.getDelegatedLocalVariableMetadata;
import static org.jetbrains.kotlin.codegen.inline.InlineCodegenUtils2Kt.initDefaultSourceMappingIfNeeded;
import static org.jetbrains.kotlin.load.java.JvmAbi.*;
import static org.jetbrains.kotlin.resolve.BindingContext.INDEXED_LVALUE_GET;
import static org.jetbrains.kotlin.resolve.BindingContext.INDEXED_LVALUE_SET;
import static org.jetbrains.kotlin.resolve.BindingContextUtils.getNotNull;
import static org.jetbrains.kotlin.resolve.DescriptorToSourceUtils.descriptorToDeclaration;
import static org.jetbrains.kotlin.resolve.DescriptorUtils.*;
@@ -795,16 +798,14 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
!properVisibilityForCompanionObjectInstanceField &&
(hasPrivateOrProtectedProperVisibility || hasPackagePrivateProperVisibility ||
isNonIntrinsicPrivateCompanionObjectInInterface(companionObjectDescriptor));
boolean doNotGeneratePublic =
properVisibilityForCompanionObjectInstanceField && hasPrivateOrProtectedProperVisibility;
int fieldAccessFlags;
if (doNotGeneratePublic) {
fieldAccessFlags = ACC_STATIC | ACC_FINAL;
boolean fieldIsForcedToBePublic =
JvmCodegenUtil.isJvmInterface(descriptor) ||
!properVisibilityForCompanionObjectInstanceField;
int fieldAccessFlags = ACC_STATIC | ACC_FINAL;
if (fieldIsForcedToBePublic) {
fieldAccessFlags |= ACC_PUBLIC;
}
else {
fieldAccessFlags = ACC_PUBLIC | ACC_STATIC | ACC_FINAL;
}
if (properVisibilityForCompanionObjectInstanceField) {
fieldAccessFlags |= properFieldVisibilityFlag;
}
if (fieldShouldBeDeprecated) {
@@ -975,7 +976,12 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
ClassDescriptor classDescriptor = ((ConstructorDescriptor) containingDeclaration).getConstructedClass();
if (classDescriptor == ImplementationBodyCodegen.this.descriptor) return;
}
lookupInContext(descriptor);
if (lookupInContext(descriptor)) {
if (isDelegatedLocalVariable(descriptor)) {
VariableDescriptor metadata = getDelegatedLocalVariableMetadata((VariableDescriptor) descriptor, bindingContext);
lookupInContext(metadata);
}
}
}
}
@@ -998,8 +1004,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
}
}
private void lookupInContext(@NotNull DeclarationDescriptor toLookup) {
context.lookupInContext(toLookup, StackValue.LOCAL_0, state, true);
private boolean lookupInContext(@NotNull DeclarationDescriptor toLookup) {
return context.lookupInContext(toLookup, StackValue.LOCAL_0, state, true) != null;
}
@Override
@@ -1023,6 +1029,22 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
public void visitSuperExpression(@NotNull KtSuperExpression expression) {
lookupInContext(ExpressionCodegen.getSuperCallLabelTarget(context, expression));
}
@Override
public void visitArrayAccessExpression(@NotNull KtArrayAccessExpression expression) {
ResolvedCall<FunctionDescriptor> resolvedGetCall = bindingContext.get(INDEXED_LVALUE_GET, expression);
if (resolvedGetCall != null) {
ReceiverValue receiver = resolvedGetCall.getDispatchReceiver();
lookupReceiver(receiver);
}
ResolvedCall<FunctionDescriptor> resolvedSetCall = bindingContext.get(INDEXED_LVALUE_SET, expression);
if (resolvedSetCall != null) {
ReceiverValue receiver = resolvedSetCall.getDispatchReceiver();
lookupReceiver(receiver);
}
super.visitArrayAccessExpression(expression);
}
};
for (KtDeclaration declaration : myClass.getDeclarations()) {

View File

@@ -0,0 +1,10 @@
/*
* Copyright 2010-2019 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.codegen
interface IrExpressionLambda {
val isExtensionLambda: Boolean
}

View File

@@ -0,0 +1,82 @@
/*
* 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.codegen
import org.jetbrains.kotlin.backend.common.bridges.*
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.jvm.annotations.hasJvmDefaultAnnotation
import org.jetbrains.kotlin.resolve.jvm.annotations.hasPlatformDependentAnnotation
class DescriptorBasedFunctionHandleForJvm(
descriptor: FunctionDescriptor,
private val state: GenerationState
) : DescriptorBasedFunctionHandle(descriptor) {
override fun createHandleForOverridden(overridden: FunctionDescriptor) =
DescriptorBasedFunctionHandleForJvm(overridden, state)
/*
For @JvmDefault JVM members they are placed in interface classes and
we need generate bridge for such function ('isAbstract' will return false).
For non-@JvmDefault interfaces function, its body is generated in a separate place (DefaultImpls) and
the method in the interface is abstract so we must not generate bridges for such cases.
*/
override val isAbstract: Boolean = super.isAbstract || isAbstractOnJvmIgnoringActualModality(descriptor)
override val mayBeUsedAsSuperImplementation: Boolean =
super.mayBeUsedAsSuperImplementation || descriptor.isJvmDefaultOrPlatformDependent()
private val asmMethod by lazy(LazyThreadSafetyMode.NONE) {
state.typeMapper.mapAsmMethod(descriptor)
}
override val isDeclaration: Boolean =
descriptor.kind.isReal || needToGenerateDelegationToDefaultImpls(descriptor)
override val mightBeIncorrectCode: Boolean
get() = state.classBuilderMode.mightBeIncorrectCode
override fun hashCode(): Int = descriptor.containerEntityForEqualityAndHashCode().hashCode() + 31 * asmMethod.hashCode()
override fun equals(other: Any?): Boolean {
if (other !is DescriptorBasedFunctionHandleForJvm) return false
return asmMethod == other.asmMethod &&
descriptor.containerEntityForEqualityAndHashCode() == other.descriptor.containerEntityForEqualityAndHashCode()
}
}
private fun FunctionDescriptor.containerEntityForEqualityAndHashCode(): Any =
(containingDeclaration as? ClassDescriptor)?.typeConstructor ?: containingDeclaration
private fun CallableMemberDescriptor.isJvmDefaultOrPlatformDependent() =
hasJvmDefaultAnnotation() || hasPlatformDependentAnnotation()
private fun needToGenerateDelegationToDefaultImpls(descriptor: FunctionDescriptor): Boolean {
if (findInterfaceImplementation(descriptor) == null) return false
val overriddenFromInterface = findImplementationFromInterface(descriptor) ?: return false
return !overriddenFromInterface.isJvmDefaultOrPlatformDependent()
}
/**
* @return return true for interface method not annotated with @JvmDefault or @PlatformDependent
*/
fun isAbstractOnJvmIgnoringActualModality(descriptor: FunctionDescriptor): Boolean {
if (!DescriptorUtils.isInterface(descriptor.containingDeclaration)) return false
return !descriptor.isJvmDefaultOrPlatformDependent()
}
fun <Signature> generateBridgesForFunctionDescriptorForJvm(
descriptor: FunctionDescriptor,
signature: (FunctionDescriptor) -> Signature,
state: GenerationState
): Set<Bridge<Signature>> {
return generateBridges(DescriptorBasedFunctionHandleForJvm(descriptor, state)) { signature(it.descriptor) }
}

View File

@@ -20,6 +20,8 @@ import org.jetbrains.kotlin.codegen.context.MethodContext;
import org.jetbrains.kotlin.codegen.context.RootContext;
import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
import org.jetbrains.kotlin.config.JvmAnalysisFlags;
import org.jetbrains.kotlin.config.LanguageVersionSettings;
import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.descriptors.impl.AnonymousFunctionDescriptor;
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor;
@@ -51,7 +53,6 @@ import java.io.File;
import static org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenUtilKt.SUSPEND_FUNCTION_CREATE_METHOD_NAME;
import static org.jetbrains.kotlin.descriptors.ClassKind.ANNOTATION_CLASS;
import static org.jetbrains.kotlin.descriptors.ClassKind.INTERFACE;
import static org.jetbrains.kotlin.descriptors.Modality.ABSTRACT;
import static org.jetbrains.kotlin.descriptors.Modality.FINAL;
import static org.jetbrains.kotlin.resolve.BindingContext.DELEGATED_PROPERTY_CALL;
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isCompanionObject;
@@ -147,14 +148,6 @@ public class JvmCodegenUtil {
}
}
public static boolean hasAbstractMembers(@NotNull ClassDescriptor classDescriptor) {
return CollectionsKt.any(
DescriptorUtils.getAllDescriptors(classDescriptor.getDefaultType().getMemberScope()),
descriptor -> descriptor instanceof CallableMemberDescriptor &&
((CallableMemberDescriptor) descriptor).getModality() == ABSTRACT
);
}
public static boolean isConstOrHasJvmFieldAnnotation(@NotNull PropertyDescriptor propertyDescriptor) {
return propertyDescriptor.isConst() || hasJvmFieldAnnotation(propertyDescriptor);
}
@@ -389,4 +382,13 @@ public class JvmCodegenUtil {
public static boolean isPolymorphicSignature(@NotNull FunctionDescriptor descriptor) {
return descriptor.getAnnotations().hasAnnotation(new FqName("java.lang.invoke.MethodHandle.PolymorphicSignature"));
}
@NotNull
public static String sanitizeNameIfNeeded(@NotNull String name, @NotNull LanguageVersionSettings languageVersionSettings) {
if (languageVersionSettings.getFlag(JvmAnalysisFlags.getSanitizeParentheses())) {
return name.replace("(", "$_").replace(")", "$_");
}
return name;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* Copyright 2010-2019 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.
*/
@@ -455,17 +455,13 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
if (clInit == null) {
DeclarationDescriptor contextDescriptor = context.getContextDescriptor();
SimpleFunctionDescriptorImpl clInitDescriptor = createClInitFunctionDescriptor(contextDescriptor);
MethodVisitor mv = createClInitMethodVisitor(contextDescriptor);
MethodVisitor mv =
v.newMethod(JvmDeclarationOriginKt.OtherOrigin(contextDescriptor), ACC_STATIC, "<clinit>", "()V", null, null);
clInit = new ExpressionCodegen(mv, new FrameMap(), Type.VOID_TYPE, context.intoFunction(clInitDescriptor), state, this);
}
return clInit;
}
@NotNull
public MethodVisitor createClInitMethodVisitor(@NotNull DeclarationDescriptor contextDescriptor) {
return v.newMethod(JvmDeclarationOriginKt.OtherOrigin(contextDescriptor), ACC_STATIC, "<clinit>", "()V", null, null);
}
@NotNull
private SimpleFunctionDescriptorImpl createClInitFunctionDescriptor(@NotNull DeclarationDescriptor descriptor) {
SimpleFunctionDescriptorImpl clInit = SimpleFunctionDescriptorImpl.create(descriptor, Annotations.Companion.getEMPTY(),
@@ -496,9 +492,6 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
}
}
public void beforeMethodBody(@NotNull MethodVisitor mv) {
}
// Requires public access, because it is used by serialization plugin to generate initializer in synthetic constructor
public void initializeProperty(@NotNull ExpressionCodegen codegen, @NotNull KtProperty property) {
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) bindingContext.get(VARIABLE, property);
@@ -929,7 +922,7 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
public void generateAssertField() {
if (jvmAssertFieldGenerated) return;
AssertCodegenUtilKt.generateAssertionsDisabledFieldInitialization(this);
AssertCodegenUtilKt.generateAssertionsDisabledFieldInitialization(v, createOrGetClInitCodegen().v);
jvmAssertFieldGenerated = true;
}

View File

@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.codegen.context.FieldOwnerContext
import org.jetbrains.kotlin.codegen.context.MethodContext
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.config.JvmAnalysisFlags
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.diagnostics.DiagnosticUtils
import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil
@@ -33,7 +34,10 @@ import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackageFragmentProvider
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtScript
import org.jetbrains.kotlin.psi.KtTypeAlias
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.MemberComparator
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
@@ -57,10 +61,9 @@ interface MultifileClassCodegen {
}
class MultifileClassCodegenImpl(
private val state: GenerationState,
private val files: Collection<KtFile>,
private val facadeFqName: FqName,
private val packagePartRegistry: PackagePartRegistry
private val state: GenerationState,
private val files: Collection<KtFile>,
private val facadeFqName: FqName
) : MultifileClassCodegen {
private val facadeClassType = AsmUtil.asmTypeByFqNameWithoutInnerClasses(facadeFqName)
@@ -80,12 +83,12 @@ class MultifileClassCodegenImpl(
.filterIsInstance<DeserializedCallableMemberDescriptor>()
private val shouldGeneratePartHierarchy =
state.inheritMultifileParts
state.languageVersionSettings.getFlag(JvmAnalysisFlags.inheritMultifileParts)
private val partInternalNamesSorted = run {
val partInternalNamesSet = hashSetOf<String>()
for (file in files) {
if (file.hasDeclarationsForPartClass(state.bindingContext)) {
if (file.hasDeclarationsForPartClass()) {
partInternalNamesSet.add(JvmFileClassUtil.getFileClassInternalName(file))
}
}
@@ -122,7 +125,7 @@ class MultifileClassCodegenImpl(
val singleSourceFile =
if (previouslyCompiledCallables.isEmpty())
files.singleOrNull { it.hasDeclarationsForPartClass(state.bindingContext) }
files.singleOrNull { it.hasDeclarationsForPartClass() }
else
null
@@ -209,11 +212,9 @@ class MultifileClassCodegenImpl(
generateNonPartClassDeclarations(file, partContext)
if (!state.generateDeclaredClassFilter.shouldGeneratePackagePart(file) ||
!file.hasDeclarationsForPartClass(state.bindingContext)
) return
if (!state.generateDeclaredClassFilter.shouldGeneratePackagePart(file) || !file.hasDeclarationsForPartClass()) return
packagePartRegistry.addPart(partType.internalName, facadeClassType.internalName)
state.factory.packagePartRegistry.addPart(packageFragment.fqName, partType.internalName, facadeClassType.internalName)
val builder = state.factory.newVisitor(MultifileClassPart(file, packageFragment), partType, file)
@@ -245,26 +246,18 @@ class MultifileClassCodegenImpl(
private fun addDelegateGenerationTasksForDeclarationsInFile(file: KtFile, packageFragment: PackageFragmentDescriptor, partType: Type) {
val facadeContext = state.rootContext.intoMultifileClass(packageFragment, facadeClassType, partType)
val memberCodegen = createCodegenForDelegatesInMultifileFacade(facadeContext)
for (declaration in CodegenUtil.getDeclarationsToGenerate(file, state.bindingContext)) {
if (shouldGenerateInFacade(declaration)) {
val descriptor = state.bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration)
if (descriptor !is MemberDescriptor) {
throw AssertionError("Expected callable member, was " + descriptor + " for " + declaration.text)
}
addDelegateGenerationTaskIfNeeded(descriptor, { memberCodegen.genSimpleMember(declaration) })
for (declaration in CodegenUtil.getMemberDeclarationsToGenerate(file)) {
// In light classes, we intentionally do not analyze type aliases, since they're metadata-only
if (declaration is KtTypeAlias && !state.classBuilderMode.generateMetadata) continue
val descriptor = state.bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration)
if (descriptor !is MemberDescriptor) {
throw AssertionError("Expected callable member, was " + descriptor + " for " + declaration.text)
}
addDelegateGenerationTaskIfNeeded(descriptor) { memberCodegen.genSimpleMember(declaration) }
}
}
private fun shouldGenerateInFacade(declaration: KtDeclaration): Boolean {
if (declaration is KtNamedFunction || declaration is KtProperty) return true
// In light classes, we intentionally do not analyze type aliases, since they're metadata-only
if (declaration is KtTypeAlias && state.classBuilderMode.generateMetadata) return true
return false
}
private fun shouldGenerateInFacade(descriptor: MemberDescriptor): Boolean {
if (Visibilities.isPrivate(descriptor.visibility)) return false
if (AsmUtil.getVisibilityAccessFlag(descriptor) == Opcodes.ACC_PRIVATE) return false
@@ -386,8 +379,8 @@ class MultifileClassCodegenImpl(
return fragments.firstOrNull()
}
private fun KtFile.hasDeclarationsForPartClass(bindingContext: BindingContext) =
CodegenUtil.getDeclarationsToGenerate(this, bindingContext).any { it is KtProperty || it is KtFunction || it is KtTypeAlias }
private fun KtFile.hasDeclarationsForPartClass() =
CodegenUtil.getMemberDeclarationsToGenerate(this).isNotEmpty()
private fun getCompiledPackageFragment(
facadeFqName: FqName, state: GenerationState

View File

@@ -20,21 +20,13 @@ import com.intellij.util.ArrayUtil
import org.jetbrains.kotlin.backend.common.CodegenUtil
import org.jetbrains.kotlin.codegen.context.MultifileClassPartContext
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor
import org.jetbrains.kotlin.load.java.JvmAnnotationNames
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtNamedFunction
import org.jetbrains.kotlin.psi.KtProperty
import org.jetbrains.kotlin.psi.KtTypeAlias
import org.jetbrains.kotlin.resolve.jvm.diagnostics.MultifileClass
import org.jetbrains.kotlin.resolve.jvm.diagnostics.OtherOrigin
import org.jetbrains.org.objectweb.asm.MethodVisitor
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode
import org.jetbrains.org.objectweb.asm.tree.MethodInsnNode
class MultifileClassPartCodegen(
v: ClassBuilder,
@@ -47,31 +39,13 @@ class MultifileClassPartCodegen(
) : MemberCodegen<KtFile>(state, null, partContext, file, v) {
private val partType = partContext.filePartType
private val facadeClassType = partContext.multifileClassType
private val staticInitClassType = Type.getObjectType(partType.internalName + STATIC_INIT_CLASS_SUFFIX)
private val partClassAttributes =
if (shouldGeneratePartHierarchy)
OPEN_PART_CLASS_ATTRIBUTES
else
FINAL_PART_CLASS_ATTRIBUTES
private fun ClassBuilder.newSpecialMethod(originDescriptor: DeclarationDescriptor, name: String) =
newMethod(OtherOrigin(originDescriptor), Opcodes.ACC_STATIC, name, "()V", null, null)
private val staticInitClassBuilder = ClassBuilderOnDemand {
state.factory.newVisitor(MultifileClass(file, packageFragment), staticInitClassType, file).apply {
defineClass(file, state.classFileVersion, STATE_INITIALIZER_CLASS_ATTRIBUTES,
staticInitClassType.internalName, null, "java/lang/Object", ArrayUtil.EMPTY_STRING_ARRAY)
visitSource(file.name, null)
init {
if (shouldGeneratePartHierarchy && file.declarations.any { it is KtProperty && shouldInitializeProperty(it) }) {
throw AssertionError("State is not allowed in multi-file classes with -Xmultifile-parts-inherit")
}
}
private val requiresDeferredStaticInitialization =
shouldGeneratePartHierarchy && file.declarations.any {
it is KtProperty && shouldInitializeProperty(it)
}
override fun generate() {
if (!state.classBuilderMode.generateMultiFileFacadePartClasses) return
@@ -91,51 +65,23 @@ class MultifileClassPartCodegen(
visitEnd()
}
}
if (requiresDeferredStaticInitialization) {
staticInitClassBuilder.apply {
newField(OtherOrigin(packageFragment), Opcodes.ACC_STATIC or Opcodes.ACC_PRIVATE or Opcodes.ACC_VOLATILE,
CLINIT_SYNC_NAME, "I", null, null)
newSpecialMethod(packageFragment, CLINIT_TRIGGER_NAME).apply {
if (generateBodies) {
visitCode()
visitFieldInsn(Opcodes.GETSTATIC, staticInitClassType.internalName, CLINIT_SYNC_NAME, "I")
visitInsn(Opcodes.RETURN)
visitMaxs(1, 0)
}
visitEnd()
}
newSpecialMethod(packageFragment, "<clinit>").apply {
if (generateBodies) {
visitCode()
visitMethodInsn(Opcodes.INVOKESTATIC, partType.internalName, DEFERRED_PART_CLINIT_NAME, "()V", false)
visitInsn(Opcodes.ICONST_0)
visitFieldInsn(Opcodes.PUTSTATIC, staticInitClassType.internalName, CLINIT_SYNC_NAME, "I")
visitInsn(Opcodes.RETURN)
visitMaxs(1, 0)
}
visitEnd()
}
writeSyntheticClassMetadata(this, state)
}
}
}
override fun generateDeclaration() {
v.defineClass(element, state.classFileVersion, partClassAttributes, partType.internalName, null, superClassInternalName, ArrayUtil.EMPTY_STRING_ARRAY)
val access = if (shouldGeneratePartHierarchy) 0 else Opcodes.ACC_SYNTHETIC or Opcodes.ACC_FINAL
v.defineClass(
element, state.classFileVersion, access or Opcodes.ACC_SUPER, partType.internalName, null, superClassInternalName,
ArrayUtil.EMPTY_STRING_ARRAY
)
v.visitSource(element.name, null)
generatePropertyMetadataArrayFieldIfNeeded(partType)
}
override fun generateBody() {
for (declaration in CodegenUtil.getDeclarationsToGenerate(element, state.bindingContext)) {
if (declaration is KtNamedFunction || declaration is KtProperty || declaration is KtTypeAlias) {
genSimpleMember(declaration)
}
for (declaration in CodegenUtil.getMemberDeclarationsToGenerate(element)) {
genSimpleMember(declaration)
}
if (state.classBuilderMode.generateBodies) {
@@ -143,20 +89,6 @@ class MultifileClassPartCodegen(
}
}
override fun createClInitMethodVisitor(contextDescriptor: DeclarationDescriptor): MethodVisitor =
if (requiresDeferredStaticInitialization)
v.newSpecialMethod(contextDescriptor, DEFERRED_PART_CLINIT_NAME)
else
super.createClInitMethodVisitor(contextDescriptor)
override fun done() {
super.done()
if (staticInitClassBuilder.isComputed) {
staticInitClassBuilder.done()
}
}
override fun generateKotlinMetadataAnnotation() {
val (serializer, packageProto) = PackagePartCodegen.serializePackagePartMembers(this, partType)
@@ -171,28 +103,4 @@ class MultifileClassPartCodegen(
override fun generateSyntheticPartsAfterBody() {
generateSyntheticAccessors()
}
override fun beforeMethodBody(mv: MethodVisitor) {
if (requiresDeferredStaticInitialization) {
mv.visitMethodInsn(Opcodes.INVOKESTATIC, staticInitClassType.internalName, CLINIT_TRIGGER_NAME, "()V", false)
}
}
companion object {
private val OPEN_PART_CLASS_ATTRIBUTES = Opcodes.ACC_SUPER
private val FINAL_PART_CLASS_ATTRIBUTES = Opcodes.ACC_SYNTHETIC or Opcodes.ACC_SUPER or Opcodes.ACC_FINAL
private val STATE_INITIALIZER_CLASS_ATTRIBUTES = Opcodes.ACC_SYNTHETIC or Opcodes.ACC_SUPER or Opcodes.ACC_FINAL
private val STATIC_INIT_CLASS_SUFFIX = "__Clinit"
private val CLINIT_TRIGGER_NAME = "\$\$clinitTrigger"
private val CLINIT_SYNC_NAME = "\$\$clinitSync"
private val DEFERRED_PART_CLINIT_NAME = "\$\$clinit"
@JvmStatic fun isStaticInitTrigger(insn: AbstractInsnNode) =
insn.opcode == Opcodes.INVOKESTATIC
&& insn is MethodInsnNode
&& insn.owner.endsWith(STATIC_INIT_CLASS_SUFFIX)
&& insn.name == CLINIT_TRIGGER_NAME
&& insn.desc == "()V"
}
}

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