Compare commits

..

2714 Commits

Author SHA1 Message Date
Simon Ogorodnik
75ae076c61 Partially implement invoke resolution 2019-05-24 19:47:02 +03:00
Mikhail Glukhikh
420f5c0c12 Preliminary: invokes 2019-05-24 17:14:17 +03:00
Mikhail Glukhikh
735c2a1c92 Add simple test for FIR invoke result (does not work) 2019-05-24 14:36:09 +03:00
Mikhail Glukhikh
7c617718a7 ++ correctly handle overridden Kotlin properties 2019-05-24 14:07:39 +03:00
Mikhail Glukhikh
70a852f072 FIR: fix exception in ConeKotlinType.returnType 2019-05-24 13:12:20 +03:00
Mikhail Glukhikh
bce20ea3e1 Use abstract 'createErrorType' in TypeApproximator 2019-05-24 13:06:39 +03:00
Mikhail Glukhikh
d90749709e FIR Java: correctly handle overridden Kotlin properties in use-site scope 2019-05-24 12:55:36 +03:00
Mikhail Glukhikh
106ab769dd FIR Java: add default constructors 2019-05-24 11:51:55 +03:00
Mikhail Glukhikh
02c90d0690 FIR resolve: check number of parameters when handling Java accessors 2019-05-24 11:13:00 +03:00
Mikhail Glukhikh
0458f94cdc FIR lambda resolve: handle case with expected resolved type properly 2019-05-23 17:17:45 +03:00
Mikhail Glukhikh
6888499081 FIR resolve: do not launch overload conflict resolve for erroneous 2019-05-23 17:17:41 +03:00
Mikhail Glukhikh
ee6da3964a FIR resolve: fix type refs for anonymous functions 2019-05-23 16:12:48 +03:00
Mikhail Glukhikh
b312edad09 FIR resolve test with cast to 'Any' 2019-05-23 16:12:48 +03:00
Mikhail Glukhikh
e73dd86472 FIR resolve bench: count implicit built-in type refs as resolved 2019-05-23 14:20:08 +03:00
Mikhail Glukhikh
d046c4f94d FIR resolve: set implicit Unit type for block without result expression
This fixes most of "implicit error types"
2019-05-23 14:20:08 +03:00
Mikhail Glukhikh
bff89230a5 FIR resolve: record & check implicit extension receiver type properly 2019-05-23 14:20:00 +03:00
Mikhail Glukhikh
b4d4f91255 ++ fix test compilation 2019-05-23 14:19:58 +03:00
Mikhail Glukhikh
81faf01672 FIR tower resolve: add level with implicit extension receiver 2019-05-23 14:19:58 +03:00
Mikhail Glukhikh
3eebe73291 Add FIR resolve test (call extension from extension) 2019-05-23 14:19:57 +03:00
Mikhail Glukhikh
fa0dcddff8 More top-level FIR resolve tests (map, with) 2019-05-23 14:19:56 +03:00
Simon Ogorodnik
58d3178bea Suspend resolution sequence on first inapplicability report 2019-05-23 14:19:56 +03:00
Simon Ogorodnik
997d73b1ce Abstract fir modularized tests 2019-05-23 14:19:55 +03:00
Simon Ogorodnik
d72f04455b Report percents in FirResolveBench 2019-05-23 14:19:55 +03:00
Mikhail Glukhikh
b63d9b03af Consider function calls wrapped into argument in FIR resolve 2019-05-23 14:19:54 +03:00
Mikhail Glukhikh
4fdff4fbd3 Make flexible type data class to improve constraint comparison 2019-05-23 14:19:53 +03:00
Mikhail Glukhikh
f4d00b6574 FIR resolve (by semoro): support correct type inference for generic args
This commit fixes e.g. resolve of listOf() + listOf()
2019-05-23 14:19:53 +03:00
Mikhail Glukhikh
df1460c93b Add FIR resolve test for top-level 'plus' 2019-05-23 14:19:52 +03:00
Simon Ogorodnik
309dd87567 Questionable: disable data class copy function body
This commit is possible but requires copy body generation in BE IR
2019-05-23 14:19:52 +03:00
Simon Ogorodnik
79b713cc75 Store type for already resolved FIR references properly 2019-05-23 14:19:51 +03:00
Simon Ogorodnik
1cf60b8c37 Preliminary: set setter value-parameter type in FIR 2019-05-23 14:19:50 +03:00
Simon Ogorodnik
d0358a57c0 FIR resolve: make companion scope available inside class 2019-05-23 14:19:50 +03:00
Simon Ogorodnik
332cdbf5a7 [FIR] Support withNullability for captured type 2019-05-23 14:19:49 +03:00
Mikhail Glukhikh
bdfa82b010 (by semoro) Set resolved type for lambdas during FIR resolve 2019-05-23 14:19:48 +03:00
Mikhail Glukhikh
8b4c1f6b57 Raw FIR: set enum entry types to kotlin.Enum to avoid their resolve 2019-05-23 14:19:47 +03:00
Mikhail Glukhikh
eed465ae03 (BREAKS tests) Raw FIR: set val setter to null instead of default one 2019-05-23 14:19:46 +03:00
Mikhail Glukhikh
809b8a95b7 Fix FIR Java enhancement of java.util.Map & similar supertypes 2019-05-23 14:19:45 +03:00
Simon Ogorodnik
70ef431227 WIP: Qualifier resolver 2019-05-23 14:19:45 +03:00
Mikhail Glukhikh
c3eea13f78 ~~~ Preliminary: introduce a FIR inspection #KT-29895 Fixed ~~~
Yet we do not take modifications into account
2019-05-23 14:19:44 +03:00
Mikhail Glukhikh
bdf7f65f13 ~~~ IDEA: introduce initial FIR resolution API (declarations only) ~~~ 2019-05-23 14:19:43 +03:00
Simon Ogorodnik
2e1a8741cd ~~~ Use intersection of star projection type-param bounds instead of type 2019-05-23 14:19:43 +03:00
Simon Ogorodnik
fee05d20fe ~~~ Fix test 2019-05-23 14:19:42 +03:00
Mikhail Glukhikh
728459a504 Add IR for-in-range test 2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
139557e641 FIR2IR: support super-types & type parameters for external class 2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
a973a21ec6 FIR2IR: support assignments of local variables 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
68da1a97d1 Add fib test to FIR resolve tests 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
f3960c9482 Preliminary implementation of parts & facade in FIR-based compiler 2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
2bf80ff64e FIR: support copy functions in data classes 2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
d9261acdfc Raw FIR builder: extract 'generateComponentFunctions' for data class 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
672c172c99 [FIR] Make result type after safe-call nullable (for nullable receiver) 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
f7b6fec70c [FIR] Transform explicit receiver of QAE properly 2019-05-23 14:02:10 +03:00
Simon Ogorodnik
27a1ec3817 [FIR] Allow nullable receiver type in case of safe-calls 2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
b28207deca FIR2IR: support fields in Java FIR 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
6c313895df [FIR] Do not enhance java fields to firProperty 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
397aaa189e [FIR] Allow type-variables in general subtyping with cone context 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
20ba15a429 [FIR] Typing for annotation calls 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
c168c22fba Render property accessors in html fir dump 2019-05-23 14:02:09 +03:00
Simon Ogorodnik
9266a2cdba Add equals/hashCode to some FIR cone types 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
aa96837758 [FIR] Introduce unchecked not-null cast as internal operation for !!, ?: 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
b469eb293b [FIR] Typing for try-catch 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
30e097a1e0 Fix modifiers order and repeating in html fir dump 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
58fd62fd49 Fix try catch rendering in html fir dump 2019-05-23 14:02:08 +03:00
Simon Ogorodnik
9398addb9d Fix cycle avoidance in FIR implicit type resolve
This commit fixes the following case:
transformer visiting it twice before reporting cycle
fun foo() = foo()
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
26974788e9 FIR2IR converter: handle receivers and parents more correctly 2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
90009f002c Add FIR test for 'Exception' constructor resolve ambiguity (type alias) 2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
b72f3aa206 Remove code duplication in KotlinToJvmCompiler (old FE vs FE IR)
Related to KT-31265
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
05154d24d4 Select stub or real symbol for java.lang.Class in IR dependent on mode
This commit fixes some black-box IR tests broken by stub introduction
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
f4fdc66a34 Introduce experimental FIR compiler #KT-31265 Fixed
This commit also includes several FIR2IR fixes which helps FIR compiler
to produce normal results
2019-05-23 14:02:06 +03:00
Mikhail Glukhikh
892419c08a Generate stub java.lang.Class in IR JvmSymbols instead of scope reading
Before this commit, java.lang.Class was read via JvmBackendContext,
its module descriptor and its package member scope.
However, this works only for old FE with descriptors and
descriptor-based scopes available.
2019-05-23 14:02:06 +03:00
Ting-Yuan Huang
0aee2d0568 Fix signature generation for calls to enum and inner class constructors
The synthesized arguments caused the size of default value mask off by
one when it is close to the boundary of Int.SIZE, which in turn
resulted in wrong signature at call sites.
2019-05-23 12:29:57 +02:00
Ivan Gavrilovic
72fdc648ff If incremental KAPT is disabled, do not analyze classpath
When incremental apt mode in KAPT is disabled, do not analyze
classpath to determine the type of the annotation processors. Instead,
just mark them all as non-incremental.
2019-05-23 19:09:28 +09:00
Peter Xu
a639607821 Revert obsolete code introduced in KT-12402
The classes being filtered have been renamed months ago. The change
committed in KT-12402 is no longer relevant as the underlying issue has
been fixed.
2019-05-23 19:09:28 +09:00
Ivan Gavrilovic
b609fe529c Handle return result of dir creation/deletion in kapt
#KT-31322
2019-05-23 19:09:27 +09:00
Ivan Gavrilovic
f60bfc34c0 Remove generated sources and classes for full KAPT build
When running incremental annotation processing in KAPT,
even if incremental flag is enabled, and full rebuild should
be performed (e.g. in presence of dynamic non-incremental APs),
make sure generated sources and classes are removed.

 #KT-31322 fixed
2019-05-23 19:09:27 +09:00
Vladimir Krivosheev
757b4b3910 Do not use constructor injection for app level extension KotlinClassWithDelegatedPropertyRenderer (KT-31266) 2019-05-23 19:09:27 +09:00
Yan Zhulanow
a0778ad703 Revert "Kapt: Always use raw types for annotation parameter types (KT-30346)"
This reverts commit 66754e62
2019-05-23 19:09:27 +09:00
Yan Zhulanow
9a5bbcb00b Pill: Recognize 'embedded' configuration as 'compile' in JPS 2019-05-23 19:09:27 +09:00
Dmitriy Novozhilov
95544b0970 Add wrappers on KotlinType in EffectSystem
Also that commit removes usages of builtins inside
  effect system and starts refactoring of functor
  composition via composition instead of inheritance.

There are some changes in testdata related to inference of recursive
  functions with implicit return types.

After this commit they all are marked as unresolved. It happens because
  those functions have DeferredType as return type, and computing this
  type produces recursive exception, which provides “typechecker
  recursive problem” diagnostic.

Before this commit, function call was completed successfully, because
  call completer didn’t computed that type, and computation of DeferredType
  were triggered only in `DataFlowAnalyzer.checkType`.
Now, effect system tries to compute that type while wrapping KotlinTypes
  into ESTypes, and effect system itself is triggered in in call completer,
  so, call completion doesn’t finish and function call is marked as unresolved.

#KT-31364
2019-05-23 12:23:22 +03:00
Dmitriy Novozhilov
fb77e1f0bd [NI] Fix recursion in contract declaration analysis.
#KT-30410 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
8d5c61f3ab [NI] Return error type for unsupported descriptors in callable reference inference 2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
b4c8c79931 [NI] Add check for non-null argument type in arguments check
#KT-31461 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
b323298b0e [NI] Remove deep types in commosn super type for recursive types
#KT-30411 Fixed
2019-05-23 12:22:42 +03:00
Dmitriy Novozhilov
f54653eb2b [NI] Fix error type approximation in ILTApproximatorConfiguration
#KT-31441 Fixed
2019-05-23 12:22:42 +03:00
Sergey Rostov
6f9ef0d4b6 Gradle, js: fix js test frameworks DSL for groovy
#KT-31566 Fixed
2019-05-23 10:09:14 +03:00
Sergey Rostov
ebe3ccee8b Gradle, test reports: NewMultiplatformIT.testJavaSupportInJvmTargets
"check" task, now creates aggregate report for all gradle versions,
so this test is affected too
2019-05-23 10:09:13 +03:00
Sergey Rostov
348e29f24b Gradle, tests: introduce kotlin.tests.individualTaskReports
This property required for getting individual junit.xml files that is
currently used in test run assertions.
2019-05-23 10:09:13 +03:00
Sergey Rostov
22bc99f527 Gradle, js, single platform projects: create single test aggregator
Extract KotlinTestsRegistry service for customizing aggregated test tasks
naming.
2019-05-23 10:09:13 +03:00
Sergey Rostov
a5664207d5 Gradle, js, tests: always create a jsTest task for compatibility
This requires runnable aggregate test task even if there are not tests in it.
That, in turn, requires support aggregate test tasks hierarchy.
Also TestReport integrated in aggregate for all gradle versions (was for 5 only).

#KT-31527 Fixed
2019-05-23 10:09:13 +03:00
Sergey Rostov
78fe2fde33 Gradle, libWithTests test: check js tests running, add test results assertion 2019-05-23 10:09:13 +03:00
Sergey Rostov
709afdfa45 Gradle, testing test execution: support asserting reports from multiple tasks at once 2019-05-23 10:09:13 +03:00
Sergey Rostov
a13f1a5e67 Gradle, js, webpack: fix compatibility with older gradle version 2019-05-23 10:09:12 +03:00
Sergey Rostov
603fb8a53d Gradle, js, npm: try fixing project version to semver
JS package managers requires it.

#KT-31563 Fixed
2019-05-23 10:09:12 +03:00
Ilmir Usmanov
e7c78d8d7e Update bootstrap
Update reference public API. Before 266976ac1e
suspend inline functions with crossinline parameters were effectively
inline-only. Fixing it exposed suspendCoroutine as public API.
Update jps artifacts after bootstrap.
2019-05-23 09:28:31 +03:00
Ilya Kirillov
ff774f6249 New J2K: Run nj2k tests by default 2019-05-22 22:20:18 +03:00
Ilya Kirillov
9ccedc5bc4 New J2K: Fix wrong line separators on windows
It causes some inspections in post-processing to work not properly
2019-05-22 22:20:18 +03:00
Ilya Kirillov
f0012de6ea New J2K: add string method conversions 2019-05-22 22:20:18 +03:00
Ilya Kirillov
54432448e3 New J2K: correctly remove redundant property type in a case of nullable initializer 2019-05-22 22:20:17 +03:00
Ilya Kirillov
8f5c690cdd New J2K: do not convert var to val if super property is var 2019-05-22 22:20:17 +03:00
Ilya Kirillov
fa8a067c85 Fix losing flexible type enhancement in type substituting
It breaks `org.jetbrains.kotlin.nj2k.NewJavaToKotlinConverterSingleFileTestGenerated.ToArray#testToArray` test due to losing external nullability annotations
2019-05-22 22:20:17 +03:00
Ilya Kirillov
0a974cd419 New J2K: remove unused dependency from nj2k-services 2019-05-22 22:20:16 +03:00
Ilya Kirillov
c9decd5dc9 New J2K: correctly retrieve all type variables in printing 2019-05-22 22:20:16 +03:00
Ilya Kirillov
7db4958a17 New J2K: fix tests due to changes in inspections behaviour 2019-05-22 22:20:16 +03:00
Ilya Kirillov
37f8d72756 New J2K: make inner private constructors public when accessed 2019-05-22 22:20:16 +03:00
Ilya Kirillov
78fd56bdf0 New J2K: Fix running some post processings in incorrect thread
#KT-31234 fixed
2019-05-22 22:20:15 +03:00
Ilya Kirillov
90ab39f50f New J2K: Fix CCE in post processing
#KT-31217 fixed
2019-05-22 22:15:28 +03:00
Sergey Igushkin
8b150d2b07 Fix Android 3.3 Gradle integration tests running with low Gradle version 2019-05-22 18:11:18 +03:00
victor.petukhov
d4515031de Report warning about implicitly inferred nothing only for return position
^KT-31535 Fixed
2019-05-22 15:45:59 +03:00
Roman Artemev
72f7287ad2 [IR BE] Fix array constructor loop. Use index parameter as immutable value 2019-05-22 15:18:13 +03:00
Roman Artemev
dfa38f4a4d [JS IR BE] Fix state machine generation in case of composition of loops, inline functions and finally blocks
* lower finally blocks in any cases
 * do not optimize exit blocks for if-statements
2019-05-22 15:18:13 +03:00
Roman Artemev
9c7d47789c [JS IR BE] Implement type check for SuspendFunctionN 2019-05-22 15:18:13 +03:00
Steven Schäfer
9894c216c1 Fix test for static default methods in KotlinTypeMapper 2019-05-22 13:33:08 +02:00
Steven Schäfer
cf13293363 Use FQ names for string plus intrinsic in FlattenStringConcatenationLowering 2019-05-22 12:14:43 +02:00
Alexander Udalov
43bf962d79 Fix CLI test data on -XXLanguage arguments
We should use '\:' instead of ':' because the latter is replaced to the
path separator in AbstractCliTest.readArg which is ';' on Windows.
2019-05-22 08:48:37 +02:00
Alexander Udalov
d340f6dc62 Minor, simplify code in parseCommandLineArguments 2019-05-22 08:48:37 +02:00
Ilmir Usmanov
effbcdaf70 Do not generate $$forInline suffix for enclosing method
in OUTERCLASS field.

The inliner generates two versions of suspend functions/lambdas in
inline functions: with state-machine and without. The former is used
to call the function from Java or via reflection and have ordinary
name, while the latter is used by inliner and have $$forInline suffix.
The inliner throws the state-machine version away, duplicates
$$forInline version and then call state-machine generator.

If these suspend functions/lambdas are not going to be inlined,
$$forInline version is not generated. However, all objects, which are
used in these suspend functions/lambdas, have $$forInline version
written to OUTERCLASS field. This leads to errors by proguard.
Since they are used in both state-machine version and for-inline ones,
we can simply remove $$forInline suffix from OUTERCLASS field and this
fixes the issue.

 #KT-31242 Fixed
2019-05-21 21:09:36 +03:00
Svyatoslav Kuzmich
dd6bc100ed [JS IR BE] Don't detach assignment operator from receiver 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
5495da5241 [JS IR BE] Allow empty call arguments only for external functions 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
e9ceee388e [JS IR BE] Don't transform toString with extension receiver 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
3153a7dd7e [JS IR BE] Fix boolean and/or generation 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
b8bbcb3f93 [JS IR BE] Copy type metadata for Boolean, Char and Long varargs 2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
59617c97b4 [JS IR BE] Fix VarargLowering
- Enable empty vararg transformation for all IrFunctionAccessExpression
- Fix empty vararg boxing
- Refactor inline class boxing logic
- Fix types of generated expressions
2019-05-21 19:19:31 +03:00
Svyatoslav Kuzmich
f80b6ff947 [JS IR BE] Put file names into JsDoc 2019-05-21 19:19:31 +03:00
Sergey Igushkin
71bd88bdb3 Fix the AGP deprecation warning on usage of getPackageLibrary, KT-30784
Use the new API that returns the task provider, if available.

Issue #KT-30784 Fixed
2019-05-21 19:08:29 +03:00
Ilya Gorbunov
0a3ebb5780 Unmute tests for JVM_IR that pass after making assertFailsWith inline 2019-05-21 18:53:53 +03:00
Ilya Gorbunov
6632cf5b1d Add hidden methods to keep binary compatibility in kotlin-test for JVM 2019-05-21 18:53:52 +03:00
Ilya Gorbunov
22694fa6b0 Make assertFails(With) inline-only functions
So that the lambda passed to these functions can capture suspend
function calls.

#KT-31194 Fixed
2019-05-21 18:53:52 +03:00
pyos
6b2d874ccc JVM_IR: generate non-null assertions for arguments 2019-05-21 18:30:27 +03:00
Ilmir Usmanov
266976ac1e Fix Java interop of inline suspend functions with suspend parameters
In 1.3.31 I fixed Java interop for inline function with coroutines
(TL;DR: when we need a state machine, generate two methods: one with
normal name, and the other one with $$forInline suffix, for the inliner
to use, just like inline suspend functions), however, I forgot a case
with inline suspend function with inline suspend function parameter.
In this case, the compiler a generated two functions, as needed, but,
neither of them had a state-machine. This change adds the state-machine
for the method with normal name. Note, that suspend inline functions
with crossinline parameter, which are also supported by the change,
did not cause incorrect behaviour, since until now they were generated
as synthetic.

 #KT-31354 Fixed
2019-05-21 17:50:25 +03:00
Georgy Bronnikov
2b9e05e30f JVM_IR: copy-paste parameter name generation from descriptor-based code 2019-05-21 17:24:53 +03:00
Jiaxiang Chen
afcbd76c9e Implement stub methods generation for Kotlin Immutable Collection classes.
This change is to fill the gap between Kotlin Collection
classes(immutable) and Java Collection classes(mutable), to avoid
calling an unsupported operation like remove() on an immutable class in
jvm.
2019-05-21 17:20:20 +03:00
Elena Lepilkina
8c3cef97bd New shared version 2019-05-21 16:56:39 +03:00
Mikhail Glukhikh
0cf318918c Clean & fix tests in "replace manual range with indices / iteration"
Related to KT-14344
2019-05-21 13:34:29 +03:00
Natalia Selezneva
7c46338181 Drop ScriptBinariesScopeCache from plugin.xml because it was moved to ScriptDependenciesCache
^KT-31521 Fixed
2019-05-21 12:07:11 +03:00
Mikhael Bogdanov
007af75e1e Properly calculate call site file in JVM IR inliner 2019-05-21 07:42:16 +02:00
Mikhael Bogdanov
6ef3e9ea42 Minor. Code clean 2019-05-21 07:42:15 +02:00
Mikhael Bogdanov
c630df3e49 Simplify code 2019-05-21 07:42:14 +02:00
Mikhael Bogdanov
de62f0123b Minor. Apply minor TODOs 2019-05-21 07:42:14 +02:00
Mikhael Bogdanov
b8b2607a02 Minor. Clean up code 2019-05-21 07:42:13 +02:00
Igor Yakovlev
f044d654f0 Fix KotlinLintTest.parcel test
Added plugin classpath of android compiler extensions to module facet
2019-05-20 19:54:46 +03:00
Benjamin Orsini
3e39f26379 Add map() documentation sample
* docs: add map() sample
* docs: add samples for Map and CharSequence
* docs: add another sample for Maps.map()
2019-05-20 19:20:09 +03:00
pyos
08ea982688 Remove imports of javafx from Gradle build files 2019-05-20 17:31:28 +02:00
Vyacheslav Gerasimov
c2a2d80d4c Build: Minor cleanup & format root build.gradle.kts 2019-05-20 15:16:22 +03:00
Vyacheslav Gerasimov
40e9f48bd0 Build: Fix cache redirector configuration for all projects
Since we forcing project evaluation in root build script cache redirector
should be configured before we do so, otherwise `afterEvaluate` is not called
2019-05-20 15:16:22 +03:00
Vadim Brilyantov
d5be5bd96e Fix obsolete compiler classpath in SourceSectionsTest 2019-05-20 14:23:34 +03:00
Igor Yakovlev
611b6f36ce Remove redundant import from QuickFixMultiFileTestGenerated 2019-05-20 12:50:09 +03:00
Mikhail Glukhikh
b68e536e2a Add note about inspection highlighting range 2019-05-20 12:31:58 +03:00
KilianCallebaut
3451c60f93 Suggest to replace manual range with explicit indices or iterable
#KT-14344 Fixed
2019-05-20 12:24:52 +03:00
Alexander Udalov
8cda5cb849 Regenerate tests 2019-05-20 11:18:54 +02:00
Toshiaki Kameyama
2c424afefa Elvis -> if intention: don't produce boilerplate code for return/break/continue/throw in RHS
#KT-14369 Fixed
2019-05-20 11:15:41 +03:00
Natalia Selezneva
160de2dbe2 Do not load script dependencies if all script templates aren't loaded 2019-05-20 10:41:15 +03:00
Natalia Selezneva
58eca451c4 Sdk passed in script dependencies should be used during script resolve
PsiElementFinder doesn't find classes from sdks that aren't Project SDK, so when Script Sdk differs from it we need to additionally search classes in script sdk using KotlinScriptDependenciesClassFinder (as we do for classes from ScriptDependencies.classpath)

^KT-31152 Fixed
2019-05-20 10:41:15 +03:00
Natalia Selezneva
5bc7b61497 Refactoring: move ScriptBinariesScopeCache to ScriptDependenciesCache 2019-05-20 10:41:14 +03:00
Natalia Selezneva
c2717b3006 Filter out all non JavaSdk from script sdks 2019-05-20 10:41:14 +03:00
Natalia Selezneva
144ff8ae91 Refactoring: move method that find sdk for script to ScriptDependenciesManager 2019-05-20 10:41:14 +03:00
Natalia Selezneva
2f5deefd0a Scripts refactoring: move all scripts caches to ScriptDependenciesCache
Introduce base class for caches based on SLRUMap (with write lock) to avoid exceptions with concurrent map modifications
2019-05-20 10:41:13 +03:00
Natalia Selezneva
1ef4d987d1 Add debug log for script dependencies loading process 2019-05-20 10:41:13 +03:00
Sergey Rostov
6388cdc3b7 Gradle, js, npm: skip KotlinProjectExtensions from different class loaders 2019-05-20 09:55:37 +03:00
Sergey Rostov
9a90627b32 Gradle, js: fix supporting sub targets DSL in build.gradle.kts 2019-05-20 09:55:36 +03:00
Sergey Rostov
3a9f3525f1 Gradle, js, npm: skip old Kotlin2JsPlugin compilations 2019-05-20 09:55:36 +03:00
Sergey Rostov
7589d89a59 Gradle, js: create run task only when project evaluated
As it may be created after js target configuration by java application plugin
2019-05-20 09:55:36 +03:00
Sergey Rostov
15e0d6af92 Gradle, js, npm: fix case when resolver visits dependents projects first 2019-05-20 09:55:36 +03:00
Sergey Rostov
52f01ef43f Gradle, js: implement NpmSimpleLinker for cases when there are no npm dependencies 2019-05-20 09:55:36 +03:00
Sergey Rostov
75708dad87 Gradle, js: fix task input annotations 2019-05-20 09:55:36 +03:00
Sergey Rostov
48fd3b6b87 Gradle, tests: don't use gradle testing internals by default 2019-05-20 09:55:35 +03:00
Ting-Yuan Huang
75646f97a4 MoveCompanionObjectFields: copy constants into interfaces
Fields having const attribute in companion objects are observable in
Java and should be copied to outer interfaces.
2019-05-20 08:43:00 +02:00
Toshiaki Kameyama
6ff776ba65 Convert property to function: fix incorrectly conversion when property has explicit generic type
#KT-29192 Fixed
2019-05-19 14:57:25 +07:00
Toshiaki Kameyama
354f8f0bf1 Redundant 'suspend' modifier inspection: don't report when function has suspend operator invoke
#KT-25465 Fixed
2019-05-18 11:54:57 +03:00
Sergey Rostov
cf5577dfa6 Gradle, tests: fix cleanAllTests task name 2019-05-18 08:15:43 +03:00
Sergey Rostov
cec2e8c61a Gradle, js: update npm packages versions 2019-05-18 08:15:42 +03:00
Sergey Rostov
775ed2f9e5 Gradle: introduce "target" DSL function for single platform plugins 2019-05-18 08:15:42 +03:00
Sergey Rostov
b8fd4f56bb Gradle, js: introduce commonJs() dsl function 2019-05-18 08:15:42 +03:00
Sergey Rostov
83042afd5c Gradle, js, webpack: report progress
#KT-31013
2019-05-18 08:15:41 +03:00
Sergey Rostov
77dd806742 Gradle, js, yarn: split into workspaces and simple implementations
#KT-31018
	#KT-31017
2019-05-18 08:15:41 +03:00
Sergey Rostov
fab879bf33 Gradle, js, npm: store imported packages as yarn workspaces
#KT-30530
2019-05-18 08:15:41 +03:00
Sergey Rostov
64f997daa4 Gradle, tests: fix type in "prepend" 2019-05-18 08:15:40 +03:00
Sergey Rostov
68cb28d76f Gradle, js, karma: source maps support
#KT-31478
	#KT-31011
	#KT-30573
2019-05-18 08:15:40 +03:00
Sergey Rostov
9a6a2e14a5 Gradle, js, tests: don't add prefix if platform and/or sub target name is null 2019-05-18 08:15:39 +03:00
Sergey Rostov
5d8f2acf5f Gradle, js: create npm packages per compilation
#KT-30530
2019-05-18 08:15:39 +03:00
Sergey Rostov
b195d18d2d Gradle, js: resolve npm dependencies without task only during IDEA import
#KT-30530
2019-05-18 08:15:39 +03:00
Sergey Rostov
09e81ddd21 Gradle, js: create one npmResolve per build (share between subprojects)
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
8166cfb054 Gradle, js, npm: remove hoisted gradle node modules. Split results collection from shared cache.
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
eb3c701040 Gradle, js, npm: resolver between projects
#KT-30530
2019-05-18 08:15:38 +03:00
Sergey Rostov
5cfe117fd7 Gradle, js: use project.whenEvaluated instead of project.afterEvaluate 2019-05-18 08:15:37 +03:00
Sergey Rostov
2d51e2bca5 Gradle, js, dsl: use ConfigureUtil.configure for Groovy compatibility 2019-05-18 08:15:37 +03:00
Sergey Rostov
04a5b5a367 Gradle, js, krama: use web pack config directory
#KT-31011
2019-05-18 08:15:37 +03:00
Sergey Rostov
c2a6654194 Gradle, js: don't use any subtarget by default 2019-05-18 08:15:36 +03:00
Sergey Rostov
2a2f59ae1c Gradle, js, run: fix run dependencies on browserRun and nodeRun 2019-05-18 08:15:36 +03:00
Sergey Rostov
156d50646d Gradle, js, test: add basic @Input for test frameworks settings 2019-05-18 08:15:36 +03:00
Sergey Rostov
e435b9352a Gradle, js: aggregate jsTest task should work the same way as all tests aggregator
E.g: individual test tasks should not fail build, aggregate reports should be created.
Also this task should not be included in check (as all tests should be already executed
from the all tests aggregated task).
2019-05-18 08:15:35 +03:00
Sergey Rostov
26c2afd8d5 Gradle, js, karma: show output as progress 2019-05-18 08:15:35 +03:00
Sergey Rostov
c7d52331f7 Gradle, js, yarn: remove outdated warning about yarn workspaces
#KT-31018
	#KT-31017
2019-05-18 08:15:35 +03:00
Sergey Rostov
3ede15b2b2 Gradle, js: fixes for groovy dsl 2019-05-18 08:15:34 +03:00
Sergey Rostov
7e4eaa8210 Gradle, js, browser: best effort for parsing karma suite names
#KT-31011
2019-05-18 08:15:34 +03:00
Sergey Rostov
236dfa98b6 Gradle, js, browser: fix karma.conf.js writer
#KT-31011
2019-05-18 08:15:34 +03:00
Sergey Rostov
14d399e9ab Gradle, js, browser: fix run 2019-05-18 08:15:33 +03:00
Sergey Rostov
422ad763e4 Gradle, js: fix resolving required dependencies
#KT-31011
2019-05-18 08:15:33 +03:00
Sergey Rostov
9610c60b17 Gradle, nodeJs: fix tests 2019-05-18 08:15:33 +03:00
Sergey Rostov
a13a86a543 Gradle, js: revert to storing compile output inside node_modules
#KT-30530
Currently kotlin JS compiler generated `require('a.js')` for test -> main
dependencies. This is not worked in layout with compile output at project
work dir (will work if compiler will generate `require('a_test.js')`).
2019-05-18 08:15:32 +03:00
Sergey Rostov
b9f69ffe79 Gradle, js: extract NpmProjectModules to separate file
#KT-30530
2019-05-18 08:15:32 +03:00
Sergey Rostov
e2aafd5512 Gradle, js, node: fix source map support configuration
#KT-30573 Fixed
2019-05-18 08:15:31 +03:00
Sergey Rostov
1c3bb8529a Gradle, js: fix nodejs run target 2019-05-18 08:15:31 +03:00
Sergey Rostov
c8e8224005 Gradle, js: restore umd by default 2019-05-18 08:15:31 +03:00
Sergey Rostov
6229b8682e Gradle, js: fix karma.conf.js by wrapping config in function
#KT-31011
2019-05-18 08:15:30 +03:00
Sergey Rostov
8e2075ebcc Gradle, js: implement resolving node modules according to https://nodejs.org/api/modules.html
#KT-30530
2019-05-18 08:15:30 +03:00
Sergey Rostov
d08402a00c Gradle, js: fix requiredDependencies resolve 2019-05-18 08:15:30 +03:00
Sergey Rostov
1fe84c71e4 Gradle, js: fix NodeJsExec 2019-05-18 08:15:29 +03:00
Sergey Rostov
77959cc0af Gradle, js: use js compilation only after target configuration 2019-05-18 08:15:29 +03:00
Sergey Rostov
baf9ecd641 Gradle, JS: make KotlinWebpack.configDirectory optional
#KT-31013
2019-05-18 08:15:29 +03:00
Sergey Rostov
c0deea33bb Gradle, JS: resolve NPM dependencies inside task when possible
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
a69881850b Gradle, JS: introduce RequiresNpmDependencies
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
5ec501dce0 Gradle, JS: extract npm package constants
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Rostov
3797ec9255 Gradle, JS: introduce inner browser and nodejs inner targets
#KT-30747 Fixed
2019-05-18 08:15:27 +03:00
Sergey Rostov
066efc3732 Gradle, JS: nodejs target 2019-05-18 08:15:27 +03:00
Sergey Rostov
a609476245 Gradle, JS, webpack: source maps support
#KT-31013
2019-05-18 08:15:27 +03:00
Sergey Rostov
f28ff64e9f Gradle, JS: new nodejs project layout
#KT-30530
2019-05-18 08:15:26 +03:00
Sergey Rostov
eb7d09a562 Gradle, JS: webpack support
#KT-31013
2019-05-18 08:15:26 +03:00
Sergey Rostov
32ddc2318a Gradle, tests: clean should depend on cleanAllTests 2019-05-18 08:15:26 +03:00
Sergey Rostov
101c3588b3 Gradle, testsL fix ijListenTestTask 2019-05-18 08:15:25 +03:00
Sergey Rostov
312830ac4b Gradle, npm: resolve node_modules at parents, return local NodeJsExtension at NodeJsPlugin.apply 2019-05-18 08:15:25 +03:00
Sergey Rostov
4f4fc74b16 Gradle, yarn: get recursively resolved dependencies
#KT-31018 Fixed
	#KT-31016 Fixed
	#KT-31017 Fixed
2019-05-18 08:15:25 +03:00
Sergey Rostov
b96f26cc77 Gradle: improve tasks registration API, fix test tasks registration
Previously test tasks may be created inside other registration task
lambda which may be called lazily. This is illegal in Gradle.

Also let introduce Project.createOrRegisterTask on Project receiver
and reified type parameter.
2019-05-18 08:15:25 +03:00
Sergey Rostov
39ce257e64 Gradle: webpack
#KT-31013 Fixed
	#KT-31014 Fixed
2019-05-18 08:15:24 +03:00
Sergey Rostov
5372fcef69 Gradle, tests: remove "Task" suffix from KotlinTest tasks (as for jvm) 2019-05-18 08:15:24 +03:00
Sergey Rostov
3dae2739a4 Gradle, js: karma
#KT-31011 fixed
2019-05-18 08:15:24 +03:00
Sergey Rostov
92910ec3e9 Gradle, js: mocha
#KT-31010 Fixed
2019-05-18 08:15:23 +03:00
Sergey Rostov
4c2c8a1788 Gradle, npm: disable manageNodeModules by default
#KT-30530
2019-05-18 08:15:23 +03:00
Sergey Rostov
d82725718a Gradle, js: run tests using the new project-wide node_modules
#KT-30530
2019-05-18 08:15:23 +03:00
Sergey Rostov
a8799f5a8d Gradle: npm integration using yarn
#KT-31018 Fixed
2019-05-18 08:15:22 +03:00
Sergey Rostov
69f9e30e5a Gradle, Tests runner: update tests, fix tests on Windows 2019-05-18 08:15:22 +03:00
Sergey Rostov
9938b7fcd0 Gradle, Native: don't capture output if treatOutputAsStracktrace enabled
#KT-30529
2019-05-18 08:15:22 +03:00
Sergey Rostov
7830d204aa Gradle, tests: cleanAllTests task
#KT-29946
2019-05-18 08:15:21 +03:00
Sergey Rostov
8b16f182f6 Gradle, tests: show test results in IDE
#KT-29946
2019-05-18 08:15:21 +03:00
Sergey Rostov
125dc65178 Gradle: Kotlin/Native stack trace parser
#KT-30526
	#KT-30529
2019-05-18 08:15:21 +03:00
Sergey Rostov
0304f090e8 Gradle: JS stack trace parser
#KT-30526
2019-05-18 08:15:20 +03:00
Sergey Rostov
e013645d87 Gradle, test: allTests task, same class and method names for jvm, js and native
#KT-30691 Fixed
	#KT-31448 Fixed
2019-05-18 08:15:20 +03:00
Ilya Gorbunov
a83d301b50 Pack stdlib tests into a separate archive
So that kotlin-native could download stdlib tests and compiler test data
from different builds.
2019-05-18 04:41:29 +03:00
Nikolay Krasko
ef70e9db19 Don't use light classes for navigation element (KT-10215)
Place KotlinNavBarModelExtension before Java extension because it
substitutes non-java elements to files.

 #KT-10215 Fixed
2019-05-17 21:43:58 +03:00
Toshiaki Kameyama
0a4d21c51f Sort by class name in navigation bar (KT-10215)
#KT-10215 Fixed
2019-05-17 18:15:58 +03:00
Vadim Brilyantov
9052c5e529 Fix typo in new-daemon ignored tests that was leading to compile errors 2019-05-17 18:13:46 +03:00
Vadim Brilyantov
caaf847052 Mute all new-daemon tests 2019-05-17 15:51:53 +03:00
Vadim Brilyantov
01a05a5495 Move daemon jar from compiler 2019-05-17 15:51:52 +03:00
Vadim Brilyantov
ced973b707 Introduce new Kotlin Daemon without RMI abstraction 2019-05-17 15:51:51 +03:00
Igor Yakovlev
a3f718733d Fix of ConvertJavaInterfaceToClass test
Platform is trying to modify the class inheritance list during intension (see the test name above) action process but it cause a cross-language changes via PSI.
To make this possible LightClasses are supports this behaviour with a little support of it (inheritance list Add and inheritance list element Delete are supported).
It need's to be done for UL-classes in same way.
2019-05-17 14:48:47 +03:00
Toshiaki Kameyama
04638eea6b Remove braces intention: fix caret position
#KT-31443 Fixed
2019-05-17 11:18:44 +07:00
Steven Schäfer
90c3269502 Fix type parameters in WrappedClassConstructorDescriptor
IrConstructorCall gets type parameters from the class in addition to the
constructor declaration. This behavior is already implemented for
ClassConstructorDescriptorImpl, but was not implemented for
WrappedClassConstructorDescriptor, leading to missing type arguments for calls
to constructors generated in a lowering pass.
2019-05-16 20:26:18 +02:00
Roman Artemev
77c0e591af Set correct target backend 2019-05-16 19:27:41 +03:00
Roman Artemev
c352117eab [JS IR BE] Set correct runtime for JS IR BE tests 2019-05-16 19:27:41 +03:00
Roman Artemev
fabd306437 [JS IR BE] Fix varargs for inline arrays 2019-05-16 19:27:41 +03:00
Roman Artemev
600ad7e088 [JS IR BE] Fix KProperty access in case of both receivers 2019-05-16 19:27:41 +03:00
Roman Artemev
cd3fd60dd7 [JS BE] Extract backend specific code from shared stdlib sources 2019-05-16 19:27:41 +03:00
Roman Artemev
02d84bf061 [IR BE] Delegate coroutine naming strategy to platform part 2019-05-16 19:18:54 +03:00
Alexander Udalov
21d0beb94b Do not render stack traces and bytecode on muted failed tests locally
This was already disabled on buildserver with a35f368ce0, but makes
sense locally too because otherwise IntelliJ renders a lot of output
which takes lots of memory and slows down the test runner
2019-05-16 17:30:21 +02:00
Mads Ager
34cf5a19df JVM_IR: Support @JvmSynthetic annotations. 2019-05-16 17:07:22 +03:00
victor.petukhov
8bdc5f981e Actualize spec tests 2019-05-16 12:24:18 +03:00
Dmitriy Novozhilov
96a3831feb [NI] Add capturing receiver type for callable references
#KT-30292 Fixed
2019-05-16 10:50:30 +03:00
Steven Schäfer
f5a78213b2 Fix type of super 2019-05-16 07:58:45 +02:00
Alexey Tsvetkov
209a5d8464 Do not expose paths with placeholders in JS IC caches
#KT-31310 Fixed
2019-05-16 04:01:26 +03:00
Mads Ager
d2c372a4f7 JVM_IR: No EnclosingMethod attribute for member classes.
The comment in the code is correct that EnclosingMethod
attributes should only be generated for local and
anonymous classes. We were generating them for member
classes as well which leads to invalid class files.

With this change I had to mute one more tests. That is
because we lose the parent method and therefore we
see a class as a member class instead of a local class.
With the old descriptor based check that test still
passes.
2019-05-15 19:22:38 +02:00
Igor Yakovlev
79aa954682 Fix render of classpath log message for UL-classes 2019-05-15 18:48:53 +03:00
Elena Lepilkina
1c4ad193b3 Update kotlin-native-shared version 2019-05-15 16:07:54 +03:00
Mikhael Bogdanov
fe5a9f16a1 Minor. Remove obsolete workaround 2019-05-15 14:21:11 +02:00
Mikhael Bogdanov
812b766894 Remove hack with targets. Add target for most recent jdk 2019-05-15 14:21:11 +02:00
Alexander Udalov
a53fa0dfbf Minor, optimize newly added tests on unsigned intrinsics
Remove "JVM_TARGET: 1.6" directive from box tests and remove tests with
JVM target 1.8. By default, box tests are run with JVM target 1.6, and
there's an additional configuration `codegenTarget8Jvm8Test` that runs
all box tests with JVM target 1.8.

Also, remove box tests with JVM target 1.6. They aren't needed because
even if we manage to generate incorrect bytecode with target 1.6, the
corresponding box tests will catch that
2019-05-15 13:30:16 +02:00
pyos
f392b027fa JVM_IR: support references to Java fields 2019-05-15 13:29:48 +02:00
Alexander Udalov
e191eef10a Minor, refactor system properties in CodegenTestCase 2019-05-15 13:25:47 +02:00
Alexander Udalov
b602c08773 Remove javaFilesDir parameter of CodegenTestCase.doMultiFileTest
Create TestFile instances for .java sources similarly to .kt sources,
and write them to a temporary directory via writeJavaFiles in each test
where this is needed
2019-05-15 13:25:14 +02:00
Alexander Udalov
7fdb9c990e Reformat and cleanup most JVM codegen test classes 2019-05-15 13:25:14 +02:00
Svyatoslav Kuzmich
23a214710b [JS IR BE] Add Unit return type to function signature 2019-05-15 14:09:02 +03:00
Svyatoslav Kuzmich
e8933738ac [JS IR BE] Remove conservative unit materialization
Remove UnitMaterializationLowering
Remove Unit insertion in BridgeConstruction
Fix codegen for when expressions without else branch
2019-05-15 14:09:02 +03:00
Mikhael Bogdanov
c448def95f Add custom JDK tests on recent JDK avaliable in project 2019-05-15 12:55:14 +02:00
Mikhael Bogdanov
2f7f05c3bc Update proguard version 2019-05-15 12:55:13 +02:00
Dmitriy Novozhilov
07394bd6d3 [NI] Add test for KT-30300 with complex constraint system problem 2019-05-15 13:42:36 +03:00
Igor Yakovlev
e3ec501419 Fix realization of LightClass methods by KtLightClassForSourceDeclaration
#KT-31022 Fixed
2019-05-15 13:18:24 +03:00
Steven Schäfer
076f5e2ef9 Move jvm specific phases to JvmLower 2019-05-15 12:32:42 +03:00
Ilya Matveev
049269ba4f Gradle plugin: remove old native binary APIs
This patch removes APIs for native binary configuring
introduced in 1.3.0 and deprecated in 1.3.30.

Issue #KT-31229 Fixed
2019-05-15 13:12:01 +07:00
Ilya Gorbunov
18f9b20610 Remove internal visibility suppressions in kotlin.test
Internal visibility works fine in MPP, so they are no longer required.
2019-05-15 06:18:27 +03:00
Toshiaki Kameyama
fef0cc5d2b "Introduce 'when' subject" intention: suggest for "this" expression
#KT-12567 Fixed
2019-05-14 23:25:10 +03:00
Jake Wharton
aaf533df16 IR lowering for computing trimIndent/trimMargin on constants 2019-05-14 20:19:43 +02:00
Vyacheslav Gerasimov
d765bebcfc Build: Import embedded configuration as runtime in JPS build
This makes Idea import all embedded modules as transitive dependencies

 #KT-29548
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov
5782267d26 Build: Fix import of kotlin-reflect in JPS build
#KT-29548 Fixed
2019-05-14 18:07:17 +03:00
Vyacheslav Gerasimov
b9fe6875e3 Build: Minor cleanup kotlin-reflect 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
c672300da1 Build: Use embedded configuration in kotlin-reflect 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
a6e3a0f5c3 Build: Use embedded configuration in kotlin-main-kts project 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
9a4cf2d835 Build: Add accessor for embedded configuration 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
0babddfc00 Build: update idea-ext to v0.5 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
68f776ebb1 Build: add kotlinManifest.properties to kotlin-plugin.jar 2019-05-14 18:07:16 +03:00
Vyacheslav Gerasimov
346478a5d3 Build: configure jps artifacts in gradle.projectsEvaluated 2019-05-14 18:07:16 +03:00
Dmitry Gridin
eee8d0263d Fix "Unused import" for 'provideDelegate'
#KT-31319 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin
3914530fa8 Don't delete import from stdlib if alias exists and used
#KT-31414 Fixed
2019-05-14 21:01:21 +07:00
Dmitry Gridin
32298522dd Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-14 21:01:20 +07:00
Dmitry Gridin
23e51268ad Minor: refactoring AbstractImportsTest 2019-05-14 21:01:20 +07:00
Mikhael Bogdanov
8050e94c0d Minor. Remove obsolete code for emulator shutdown 2019-05-14 15:46:23 +02:00
Mikhael Bogdanov
53856daaa4 Add system property to filter android test execution 2019-05-14 15:46:22 +02:00
Mikhael Bogdanov
d3c0937c67 Run android test locally with X86 emulator 2019-05-14 15:46:21 +02:00
Svyatoslav Kuzmich
28406b6bc4 [JS IR BE] Enable unconditional validation 2019-05-14 16:23:43 +03:00
Svyatoslav Kuzmich
b07690fccf Phaser: Implement dumper and verifier as general actions 2019-05-14 16:23:43 +03:00
Svyatoslav Kuzmich
0702b88bf3 [IR BE] Update parents in ArrayConstructorLowering 2019-05-14 16:23:42 +03:00
Mikhail Glukhikh
2d5f41cfe3 Fix .inspection file for ConvertNaNEquality tests 2019-05-14 16:23:08 +03:00
Mads Ager
b1e8a7cfce JVM: Generate LVT entry for this in @JvmOverload methods.
This change also makes sure that no line numbers are generated
in the wrappers in the JVM_IR backend.

Change-Id: If6c37f8a20894455abddb526039df059e02015a3
2019-05-14 15:14:07 +02:00
Ilmir Usmanov
360e30c133 Remove redundant continuation classes and INNERCLASS nodes
#KT-31339 Fixed
2019-05-14 16:00:39 +03:00
Martin Petrov
ccf2941f4a Use spaces instead of tabs to indent -Xlist-phases.
In Terminal.app and xterm the output columns get misaligned when using tabs.
Tabbed output only renders correctly when `tabstop=1`.
2019-05-14 15:54:01 +03:00
Svyatoslav Kuzmich
91d16ee947 [CLI] Extract :compiler:cli-js from :compiler:cli 2019-05-14 15:49:50 +03:00
Mark Punzalan
7efc29df7e Split up generation of test data for codegen/box/ranges into signed and
unsigned ranges/progressions.

The tests pass in JVM_IR for signed, but fail for unsigned due to
inlining being broken. We can disable the JVM_IR tests for unsigned,
while keeping them enabled for signed, to get better test coverage in
the interim until inlining is fixed.
2019-05-14 14:26:15 +02:00
Yan Zhulanow
331891b0d7 Pill: Fix getSerializedCompilerArguments()
There is an other method that starts with 'getSerializedCompilerArguments' – serializedCompilerArgumentsIgnoreClasspathIssues().
Fix the clash by exact matching: the getSerializedCompilerArguments() is not internal anyway.
2019-05-14 12:25:54 +09:00
Igor Yakovlev
bf8cbfc6b5 Temporary ignore ConvertJavaInterfaceToClass test 2019-05-14 00:10:28 +03:00
Igor Yakovlev
d44f37d3d5 Fix misspelling of KtUltraLightMethodForSourceDeclaration 2019-05-13 19:56:04 +03:00
pyos
40696f65c3 JVM_IR: generate WhenMappings for enum ordinal subjects 2019-05-13 19:09:07 +03:00
pyos
fb194e982e Copy EnumWhenLowering from Kotlin/Native 2019-05-13 19:09:07 +03:00
Andrey Uskov
52315106e8 Create source sets for generated by kapt sources during import
#KT-30739 Fixed
2019-05-13 18:43:11 +03:00
Steven Schäfer
1e08b3c7da Simplify findLocalIndex in ExpressionCodegen 2019-05-13 18:34:00 +03:00
Steven Schäfer
b04dc69157 Access this through the dispatch parameter when available 2019-05-13 18:34:00 +03:00
Steven Schäfer
9b9236efcb Fix parameter indices in SyntheticAccessorLowering 2019-05-13 18:34:00 +03:00
Sergey Igushkin
be05095df5 Introduce Java support in JVM MPP targets (KT-26256)
Deprecate the `jvmWithJava` preset, add warning.

Add a function `withJava()` to JVM MPP targets which applies the 'java'
plugin and sets up the Kotlin & Java interoperation.

Issue #KT-26256 Fixed

Signed-off-by: Sergey Igushkin <hotkeytlt@gmail.com>
2019-05-13 16:25:09 +03:00
Igor Yakovlev
4625002efe Fix invalid test data for CommonIntentionActionsTest 2019-05-13 16:10:52 +03:00
Matthew Runo
39f576d75c Migrate RetentionPolicy arguments in deprecated Java quick-fix
#KT-29666 Fixed
2019-05-13 15:35:46 +03:00
Roman Artemev
db5396c1c2 [JS IR BE] Fix main function detector
- Do not consider extension functions as main candidate
2019-05-13 15:26:09 +03:00
Mikhael Bogdanov
c8564e9ade Update jpsBuild dependencies 2019-05-13 14:18:33 +02:00
Svyatoslav Kuzmich
bd3953c09f [JS IR BE] Turn on strict mode in generated code.
Fix multiple import of the same javascript module.
2019-05-13 13:41:11 +03:00
Svyatoslav Kuzmich
0f90aa5f80 [JS IR BE] BridgeConstruction: Fix init order of receivers and type parameters 2019-05-13 13:40:30 +03:00
Toshiaki Kameyama
14259ca9e0 Implicit Nothing? type: don't report when declaration overrides nullable nothing type
#KT-30481 Fixed
2019-05-13 13:00:50 +03:00
Toshiaki Kameyama
cf4471ba53 "Redundant 'requireNotNull' or 'checkNotNull' call": don't remove first argument if function is used as expression
#KT-31404 Fixed
2019-05-13 16:59:01 +07:00
Dereck Bridie
574178882a KT-26629 Inspection to replace equality check with NaN with isNaN call 2019-05-13 12:55:53 +03:00
Dmitry Gridin
07e908f15f Fix incorrect quickfix "Replace with Kotlin analog" for conversion to an extension
where the first argument is an expression with an operation
 #KT-31341 Fixed
2019-05-13 16:38:08 +07:00
Mikhail Glukhikh
b4a63794e5 Add name to argument: support old-style comment deletion 2019-05-13 12:33:52 +03:00
Mikhail Glukhikh
b0d294b50c Use candidate descriptor to determine parameter name stability in IDEA
#KT-31349 Fixed
2019-05-13 12:33:52 +03:00
Mikhail Glukhikh
d517276a06 Apply "unnamed boolean literal" to idea & J2K + other style fixes 2019-05-13 12:33:46 +03:00
Mikhail Glukhikh
955bfd6e7b Introduce "add parameter names to following arguments"
This commit also refactors relevant intentions & inspections,
like "add name to argument", "add names to call arguments",
"unnamed boolean literal argument"

#KT-30622 Fixed
2019-05-13 12:33:39 +03:00
LepilkinaElena
f26a4e06bd Test for compilerOpts in cinterop part of MPP plugin (#2300) 2019-05-13 12:05:33 +03:00
Igor Yakovlev
bb071263b0 Fix JVMStatic annotation for UL-properties 2019-05-13 11:21:12 +03:00
Igor Yakovlev
5da6d9d438 Update license agreement 2019-05-13 11:21:12 +03:00
Igor Yakovlev
0d31df7fb7 Fix invalid test data for static import quick fix 2019-05-13 11:21:12 +03:00
Igor Yakovlev
9870585eb8 Fix KotlinShortNamesCacheTest to not use clsDelegate 2019-05-13 11:21:12 +03:00
Igor Yakovlev
ab852750cc Fix testdata for find usages of properties 2019-05-13 11:21:12 +03:00
Igor Yakovlev
7608b11691 Fix testdata for abstract method implementing intention 2019-05-13 11:21:12 +03:00
Igor Yakovlev
48136d64cf KtUltraLightMethod now use null for MemberIndex 2019-05-13 11:21:12 +03:00
Igor Yakovlev
b485819a30 Move refactorings, fix annotations and fix cls-delegate tests 2019-05-13 11:21:11 +03:00
Igor Yakovlev
8e103b6559 Fix origin for TypeParameter + refactoring 2019-05-13 11:21:11 +03:00
Igor Yakovlev
f20ba9ddc2 Fix rename refactoring for UltraLightParameters 2019-05-13 11:21:11 +03:00
Igor Yakovlev
33126b273c Update StubTracker test data for completion tests 2019-05-13 11:21:11 +03:00
Igor Yakovlev
ab9e8c2d3a Add @get/@set JvmName support for properties 2019-05-13 11:21:11 +03:00
Denis Zharkov
1b5f72bd59 Enable ultra-light classes by default
^KT-29267 Fixed
2019-05-13 11:21:11 +03:00
Mads Ager
e8fbd42f7c JVM_IR: Support access flag jvm annotations on fields and methods. 2019-05-13 08:34:52 +02:00
Jiaxiang Chen
0020e953e1 Change order of line number geneartion for function call, and also force
line number generation after visiting inline functions.
2019-05-11 13:38:24 +02:00
max-kammerer
eeb1c0a0fc Merge pull request #2321 from neetopia/irLineNumberTestFix
Fix compareCustom function in IrLineNumberTest class, to exclude comment
2019-05-10 11:40:19 +02:00
Mikhael Bogdanov
021e94dced Fix maven test on parallel execution: don't miss to create dir 2019-05-10 11:37:18 +02:00
Steven Schäfer
570ee38256 Implement special cases for the hashCode intrinsic in JVM_IR 2019-05-10 09:40:57 +02:00
Ting-Yuan Huang
1c3b895fc0 Generate accessors for super calls if necessary
Current implementation of calls with super qualifier relies on
invokespecial, which has some more constraints than regular virtual
invocations. When those constraints aren't met, accessors are needed.
2019-05-10 08:57:37 +02:00
Mikhael Bogdanov
c90e6c1f18 Delete test temp root folders after test execution
Don't waste space on TeamCity
2019-05-10 08:12:03 +02:00
Mads Ager
99e7ae6b3f Fix typo in expectation files for command line tests.
The expectations contained ';' instead of ':' which makes two
CLI tests fail.
2019-05-09 16:57:29 +02:00
Mikhael Bogdanov
054febe57f Update bootstrap 2019-05-09 11:56:09 +02:00
pyos
4d9661890a Test reification of type parameters into Array(size, init)
(cherry picked from commit 6daa61ef5f)
2019-05-09 11:54:43 +02:00
pyos
3171129c3c JS_IR: remove traces of @kotlin.native.internal.InlineConstructor
This is a hack used by Kotlin/Native purely to implement Array
constructors. Since there's a lowering that does that, and inline
constructors are not part of the language (although they theoretically
could be), the code is redundant.

(cherry picked from commit a74fae246b)
2019-05-09 11:54:35 +02:00
pyos
08da078842 JVM_IR: implement IrReturnableBlock codegen
(cherry picked from commit 530ad368fe)
2019-05-09 11:54:26 +02:00
pyos
683f8417d3 Add a common JVM/JS lowering for Array(size, function)
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.

(cherry picked from commit 4a29e3cfcf)
2019-05-09 11:54:18 +02:00
max-kammerer
e74e0ea013 Revert "Add a common JVM/JS lowering for Array(size, function)"
This reverts commit 4a29e3cfcf.
2019-05-09 11:49:34 +02:00
max-kammerer
856a1649c6 Revert "JVM_IR: implement IrReturnableBlock codegen"
This reverts commit 530ad368fe.
2019-05-09 11:49:34 +02:00
max-kammerer
05d352769b Revert "JS_IR: remove traces of @kotlin.native.internal.InlineConstructor"
This reverts commit a74fae246b.
2019-05-09 11:49:34 +02:00
max-kammerer
8560459dc6 Revert "Test reification of type parameters into Array(size, init)"
This reverts commit 6daa61ef5f.
2019-05-09 11:49:34 +02:00
pyos
6daa61ef5f Test reification of type parameters into Array(size, init) 2019-05-09 08:03:18 +02:00
pyos
a74fae246b JS_IR: remove traces of @kotlin.native.internal.InlineConstructor
This is a hack used by Kotlin/Native purely to implement Array
constructors. Since there's a lowering that does that, and inline
constructors are not part of the language (although they theoretically
could be), the code is redundant.
2019-05-09 08:03:18 +02:00
pyos
530ad368fe JVM_IR: implement IrReturnableBlock codegen 2019-05-09 08:03:18 +02:00
pyos
4a29e3cfcf Add a common JVM/JS lowering for Array(size, function)
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.
2019-05-09 08:03:18 +02:00
Svyatoslav Kuzmich
f4bb1354c9 [JS IR BE] Support friend modules 2019-05-08 23:34:00 +03:00
Jiaxiang Chen
2c5ebf3ab2 Fix compareCustom function in IrLineNumberTest class, to exclude comment
lines that are not related for line number verification.

Unmute a test case should have been unmuted but shadowed by this bug.
2019-05-08 12:53:45 -07:00
Nikolay Krasko
ad02700200 Update to bootstrap 1.3.50-dev-2
Fix Compiler and all IDE plugins configuration struggling to build
stdlib because of circular dependency.

See 1.3.50-dev-2 build in https://teamcity.jetbrains.com/app/buildConfiguration/Kotlin_dev_CompilerAllPlugins?branch=%3Cdefault%3E&buildTypeTab=builds
2019-05-08 20:01:01 +03:00
Dmitriy Dolovov
ca9bff010b Fix: Make "cidrPluginsEnabled" Gradle parameter checks consistent
Also add logging.
2019-05-08 17:16:40 +03:00
Natalia Selezneva
e158875a14 Fix NPE in SLRUMap in ScriptDefinitionsManager
EA-138364 - NPE: LinkedHashMap$Entry.access$
2019-05-08 15:17:13 +03:00
Natalia Selezneva
2a2fe6b428 Do not provide 'add dependency' quick fix for unresolved references for non-project files
EA-126105 - NPE: JavaFileManagerImpl$LibSrcExcludingScope.<init> (KotlinAddOrderEntryActionFactory)
2019-05-08 15:17:12 +03:00
Natalia Selezneva
ba7d66eb4b Fix 'Invalid file' Exception during script definition search (EA-125840)
EA-125840 - assert: FileManagerImpl.findFile
2019-05-08 15:17:12 +03:00
Natalia Selezneva
836006b3f3 Do not use canonical paths in OutsidersPsiFileSupportUtils (EA-135551)
EA-135551 - IOE: OutsidersPsiFileSupportUtils$getOutsiderFileOrigin$.invoke
2019-05-08 15:17:11 +03:00
Natalia Selezneva
98235952ad Fix notification about highlighting for diff view in build.gradle.kts (KT-30638)
^KT-30638 Fixed
2019-05-08 15:17:11 +03:00
Natalia Selezneva
495d98f997 Fix highlighting for scripts in diff view (KT-30690)
^KT-30690 Fixed
2019-05-08 15:17:10 +03:00
Natalia Selezneva
88c6ecbbdf Minor: extract common parts 2019-05-08 15:17:09 +03:00
Natalia Selezneva
89bf7f991a Run indexes update after typing in script if needed 2019-05-08 15:17:09 +03:00
Natalia Selezneva
9e51f82248 Refactoring: add isApplicable method to ScriptDependenciesLoader 2019-05-08 15:17:08 +03:00
Natalia Selezneva
e990c61b55 Do not start script dependencies update if dependencies are already cached 2019-05-08 15:17:07 +03:00
Mikhail Zarechenskiy
516fccbe7b [NI] Complete call if return type contains only "good" type variables 2019-05-08 12:19:52 +03:00
Mikhail Zarechenskiy
61bd3a8d03 [NI] Complete call if return type has proper lower or equal constraints
There was a silly bug: equal constraint is actually a lower and an upper
 constraint, but we checked only presence of lower constraints.

 Test is important as here we have one equal constraint and should
 complete inner call `foo<Int>()` without propagating it to `bar` to
 avoid using `NoInfer` annotation multiple times
2019-05-08 12:19:50 +03:00
Mikhail Zarechenskiy
6c9394f0b2 [NI] Use original implicit receiver for DSL violation check
There is an inconsistency between old and new inference for storing
 receivers of resolved calls. In new inference, for captured types,
 receiver will be changed and to preserve behavior of the old inference,
 we use original one during important checks.
 This is more a workaround than a solution and should be revisited.

 #KT-31356 Fixed
 #KT-29948 Fixed
 #KT-31360 Fixed
2019-05-08 12:19:48 +03:00
Mikhail Zarechenskiy
c283e15425 [NI] Preserve annotations during type substitution
#KT-31346 Fixed
2019-05-08 11:26:20 +03:00
Ilya Gorbunov
2c26dc3af6 Add simplified overloads of String<->ByteArray/CharArray conversions
These overloads cover the most common cases of conversion of the entire
String or Byte/CharArray, avoiding extra index check and branching.

#KT-24810, KT-29265
2019-05-08 02:58:57 +03:00
Svyatoslav Kuzmich
f9c12db3b5 [JS IR] Unmute tests 2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
e3bcabeae3 [JS IR] stdlib: Fix bugs in Long.toString(radix) 2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
bc29a5b15c [JS IR] stdlib: port methods that use bit representation of numbers
- Port part of 'misc.js' from current backend to 'bitUtils.kt' in IR backend
- Enable toBits, toRawBits, fromBits extension function on Double and Float
- Enable Double.withSign
- Refactor getNumberHashCode using new utils
2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
362fbc8770 [JS IR] stdlib: Use comparator in CharArray.sort
CharArray is represented as a regular JS Array. Its default sort order is based
on string representation of elements.
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
179acf0789 [JS IR] stdlib: generate type-safe contentToString for primitive arrays
Avoid casting 'primitive' arrays to Array<*> because they fail on runtime
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
7687985442 [JS IR] Stdlib: use total-order comparasion for content equals 2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
3a506a372b [JS IR] stdlib: Use Nothing in return type of THROW helpers
Backend generated calls to those helpers inside expression which
resuleted in invalid type casts in IR (in dead code).
2019-05-07 21:48:50 +03:00
Nikolay Krasko
8c83beb086 Refactoring: drop unused AbstractKotlinReferenceContributor.kt 2019-05-07 16:12:25 +03:00
Nikolay Krasko
9b9bfe7ba3 Don't produce references for Kotlin block 2019-05-07 16:12:24 +03:00
Nikolay Krasko
78200dd38e Get Kotlin references through Kotlin contributors only (KT-31129)
Speed up getting references and protect Kotlin from slow
references contributors.

 #KT-31129 Fixed
2019-05-07 16:12:24 +03:00
Nikolay Krasko
b5918f4b5d Minor: move KotlinDefaultAnnotationMethodImplicitReferenceContributor.kt
Need this move to reference contributor from reference provider service.
2019-05-07 16:12:24 +03:00
Mikhail Zarechenskiy
3506c2047a Fix lint test: take into account diagnostic that is specific for NI 2019-05-07 15:56:15 +03:00
Mikhail Glukhikh
54411bd248 Simplifiable call: support case w/out receiver, add minor enhancements
Related to KT-30501
2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
8328af5694 Apply "library call could be simplified" to idea + other style fixes 2019-05-07 14:28:20 +03:00
Mikhail Glukhikh
e934eba6e4 Simplifiable call inspection: add filter -> filterIsInstance replacement
#KT-30501 Fixed
2019-05-07 14:28:18 +03:00
Mikhail Glukhikh
7f1643cfad Minor: simplify isCalling 2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
8913755e11 Simplifiable call inspection: add filter -> filterNotNull replacement
Related to KT-30501
2019-05-07 14:28:17 +03:00
Mikhail Glukhikh
4a5cbe0443 Replace "flatMap -> flatten" inspection with abstract "simplifiable call"
Related to KT-30501
2019-05-07 14:28:16 +03:00
Nicolay Mitropolsky
6101b5e6ba KotlinAnnotatedElementsSearcher made support Kotlin objects (KT-31332) 2019-05-07 09:26:00 +03:00
Svyatoslav Kuzmich
824c51e7f0 [JS IR] Add stdlib regression tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0de1242f68 [JS IR BE] Unmute passed tests 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
331625a9bb [JS IR BE] Lower kotlin.js.Json external interface methods 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6c9375196 [JS IR BE] Preserve package fqName when moving external declarations out
Create separate package fragment for each fqName of external declaration package
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
2741ecaaad [JS IR BE] Materialize Unit object during upcasts in AutoBoxingTransformer 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
58bed0f932 [JS IR BE] Fix types of in secondary ctor lowering
Type of IrDelegatingConstructorCall is 'kotlin.Unit'
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
d6761d323c [JS IR BE] Fix return targets inside state machine 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
feeb6e9862 [JS IR BE] Fix type for lowered cast expression
Safe cast result type is different from its type operand.
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
fc0a0f41d2 [JS IR BE] Fix: patch parents problems
* Patch parents for state machine builder
* Patch parents for declarations inside default value of actual parameter
2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
130d2d00c3 [JS IR BE] Fix unboxing empty inline class varargs 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
0aae760469 [JS IR BE] Fix block decomposition lowering for dynamic expressions 2019-05-06 19:34:25 +03:00
Svyatoslav Kuzmich
17178628fb [JS IR BE] Support bridges for special methods
Mostly reused from JVM IR lowering.
Shared logic moved to common backend module.
2019-05-06 19:34:25 +03:00
Mikhael Bogdanov
ec6904afd1 Minor. Fix test data 2019-05-06 17:34:02 +02:00
Mikhail Zarechenskiy
c1c464eeb5 Enable new type inference algorithm for IDE analysis
Note that this change doesn't affect compilation: if a project used
 old inference, then it'll continue to use it.

 To use old inference one can uncheck "Enable new type inference..."
 option in "Kotlin Compiler" tab
2019-05-06 18:19:25 +03:00
Mikhail Zarechenskiy
1fecd15355 [NI] Fix exception on capturing stub type from coroutine-inference
#KT-30853 Fixed
2019-05-06 18:05:02 +03:00
pyos
90f11211d3 JVM_IR: wrap performInline in enterIntoInlining/exitFromInliningOf 2019-05-06 16:23:28 +02:00
Mikhail Zarechenskiy
931bbd8cec [NI] Support ad-hoc implicit integer coercion for Kotlin/Native 2019-05-06 16:59:30 +03:00
Abduqodiri Qurbonzoda
c8a4fa58cd Implement String to/from ByteArray conversion (KT-24810) 2019-05-06 15:54:28 +03:00
Abduqodiri Qurbonzoda
81d2d3cb6a Implement String to/from CharArray conversion (KT-29265) 2019-05-06 15:54:28 +03:00
Mikhail Zarechenskiy
a3247b1b92 Add option to enable new inference only for IDE analysis
#KT-30453 Fixed
2019-05-06 14:36:05 +03:00
Dmitry Gridin
e857425b35 Fix 'optimizeImports' tests 2019-05-06 18:12:39 +07:00
Dmitry Gridin
75fb74b262 Fix runtime instance for AbstractJvmOptimizeImportsTest 2019-05-06 18:12:39 +07:00
Dmitry Gridin
ff26acacf9 Optimize Imports shouldn't delete imports with unresolved parts
#KT-10512 Fixed
2019-05-06 18:12:39 +07:00
Dmitry Gridin
87b559562f Run 'Optimize Import' on idea/tests and idea/src 2019-05-06 18:12:39 +07:00
Dmitry Gridin
96ed33e357 Optimize Imports should remove unused import alias
#KT-17375 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
7fe0503337 Unused import: support also imports as alias
#KT-12392 Fixed
2019-05-06 18:10:52 +07:00
Dmitry Gridin
9062a2fe72 Fix false positive "Unused import directive" for imports under several alias
#KT-30949 Fixed
2019-05-06 18:10:51 +07:00
Dmitry Gridin
c52abfda16 Minor: refactoring KotlinImportOptimizer, KotlinUnusedImportInspection, OptimizedmportsBuilder and AbstractOptimizeImportsTest 2019-05-06 18:10:51 +07:00
Mikhail Zarechenskiy
2f835ed66f Specify type arguments to fix compilation against bootstrap compiler 2019-05-06 14:00:19 +03:00
Mikhail Zarechenskiy
8446ea8a6b [NI] Avoid substituting type variables inside captured types
This fixes exception in CreateAnnotation#testAnnotationType test
2019-05-06 14:00:17 +03:00
Mikhail Zarechenskiy
e8e8f6f336 Don't forget to rollback configured compiler options in IDE tests 2019-05-06 13:59:33 +03:00
Mikhail Zarechenskiy
4ed5c5363f [NI] Update testdata after 03e5e55f 2019-05-06 13:59:32 +03:00
Mikhail Zarechenskiy
97a6b3436c Add diagnostics from NI for SAM with receiver tests 2019-05-06 13:59:30 +03:00
Mikhail Zarechenskiy
c95eddbbbe [IDE-NI-MIGRATE] Migrate few tests for new inference 2019-05-06 13:59:28 +03:00
Mikhail Zarechenskiy
c03dfd1522 [IDE-NI-MIGRATE] Migrate completion tests for new inference 2019-05-06 13:59:26 +03:00
Mikhail Zarechenskiy
d4d1648e1d [IDE-NI-MIGRATE] Migrate QuickFix tests for new inference 2019-05-06 13:59:24 +03:00
Mikhail Zarechenskiy
871925ba31 Fix compilation after rebase 2019-05-06 11:36:32 +03:00
Dmitriy Novozhilov
a79030aa0f [IDE-NI-MIGRATE] [BAD] Migrate testdata of MultiModuleSafeDelete tests
Bad tests in `MultiModuleSafeDeleteTestGenerated`:
- testByActualClassSecondaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassSecondaryConstructorParameter
- testByExpectClassSecondaryConstructorParameter_ExpectsAndActualsByExpectClassSecondaryConstructorParameter
- testByActualClassPrimaryConstructorPropertyLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorProperty
- testByActualClassPrimaryConstructorParameterLiftingToExpect_ExpectsAndActualsByActualClassPrimaryConstructorParameter
- testByExpectClassPrimaryConstructorParameter_ExpectsAndActualsByExpectClassPrimaryConstructorParameter
2019-05-06 11:36:30 +03:00
Dmitriy Novozhilov
b66bbdf7a6 [IDE-NI-MIGRATE] [BAD] Migrate testdata of Extraction tests
Bad tests:
- IntroduceTypeParameter.testDuplicates
- IntroduceTypeParameter.testNullableType
- IntroduceTypeParameter.testUserType
- IntroduceTypeParameter.testFunctionType
- IntroduceTypeParameter.testInClass
- ExtractFunction.TypeParameters.testNoVarianceInFun
- ExtractFunction.Parameters.CandidateTypes.testNonNullableTypes
- ExtractFunction.Parameters.CandidateTypes.testMultipleTypes
- ExtractFunction.ControlFlow.OutputValues.testGenericPair
- IntroduceVariable.ExplicateTypeArguments.testDeeperNestedCall
2019-05-06 11:36:28 +03:00
Dmitriy Novozhilov
656c8a4fa7 [IDE] Add configuring compiler arguments in Extension tests 2019-05-06 11:36:27 +03:00
Dmitriy Novozhilov
03c34691af [NI] Expand TYPE_INFERENCE_ERRORS with diagnostics from NI 2019-05-06 11:36:25 +03:00
Dmitriy Novozhilov
3d5593c70c [IDE-NI-MIGRATE] [BAD] Migrate testdata of Intention tests
Issues:
- #KT-31263

Bad tests:
- SamConversionToAnonymousObject.testSimple3
- ConvertReferenceToLambda.testIf1
- ConvertReferenceToLambda.testIf2
- ConvertReferenceToLambda.testIf3
- ConvertReferenceToLambda.testIf4
- ConvertReferenceToLambda.testWhen1
- ConvertReferenceToLambda.testWhen2
- ConvertReferenceToLambda.testWhen3
- ConvertReferenceToLambda.testWhen4
- ConvertLambdaToReference.testVarargFunction2
2019-05-06 11:36:23 +03:00
Dmitriy Novozhilov
1a085516b0 [IDE-NI] Fix detecting error types in InsertExplicitTypeArgumentsIntention 2019-05-06 11:36:21 +03:00
Dmitriy Novozhilov
e46f552a8d [NI] Update testdata in diagnostic tests 2019-05-06 11:36:20 +03:00
Dmitriy Novozhilov
ad1b8a6fb1 [NI] Add substitution of lambda return type in diagnostics 2019-05-06 11:36:18 +03:00
Dmitriy Novozhilov
b4dbf0f9a4 [NI] Fix inference for constraints with captured in projection 2019-05-06 11:36:16 +03:00
Dmitriy Novozhilov
8f22d43d01 Typo: fix function name in kotlinToResolvedCallTransformer 2019-05-06 11:36:15 +03:00
Dmitriy Novozhilov
d18c55a412 [NI] Fix reporting type mismatch on lambda parameters 2019-05-06 11:36:13 +03:00
Dmitriy Novozhilov
f7091dd1e9 [NI] Uncapture captured types in diagnostics 2019-05-06 11:36:11 +03:00
Dmitriy Novozhilov
e6deaf3315 [NI] Fix reporting UNSAFE_IMPLICIT_INVOKE_CALL diagnostic 2019-05-06 11:36:09 +03:00
Dmitriy Novozhilov
251a02f71d [NI] Fix recording type of lambda in trace 2019-05-06 11:36:08 +03:00
Dmitriy Novozhilov
233dd3ffba [IDEA] Approximate IntegerLiteralType on IDEA side 2019-05-06 11:36:06 +03:00
Dmitriy Novozhilov
f2bbae6a63 [NI] Fix resolving callable references with typealias in ths
#KT-31199 Fixed
2019-05-06 11:36:04 +03:00
Dmitriy Novozhilov
65380f4eb4 [NI] Remove captured type approximation in type arguments of resolved call 2019-05-06 11:36:02 +03:00
Dmitriy Novozhilov
421fda6e92 [NI] Fix reporting smartcasts on arguments of binary expression 2019-05-06 11:36:01 +03:00
Dmitriy Novozhilov
5715c32216 [IDE-NI-MIGRATE] [OK] Enable only OI on some IDEA tests that unrelevant in NI 2019-05-06 11:35:59 +03:00
Dmitriy Novozhilov
48e450684b [TEST] Add configuration of language features in AbstractDiagnosticMessageTest 2019-05-06 11:35:57 +03:00
Dmitriy Novozhilov
05aa36a858 [IDE-NI-MIGRATE] [BAD] Migrate testdata of LocalInspection tests 2019-05-06 11:35:55 +03:00
Dmitriy Novozhilov
17df843bf1 [NI] Fix getting source psi in UnusedLambdaExpressionBodyInspection 2019-05-06 11:35:54 +03:00
Dmitriy Novozhilov
6f51415b4d [NI] Fix determining return type of lambda in IDEA
UselessCallOnCollection tests fixed
2019-05-06 11:35:50 +03:00
Sergey Rostov
956f27cc2d Gradle, JS Test: temporary disable js tests configuration
Test configuration will be reworked with new DSL for browser and nodejs
configuration.
2019-05-05 22:32:23 +03:00
Mikhael Bogdanov
5698d923eb Update dependencies for Android box tests 2019-05-03 15:36:48 +02:00
Mikhael Bogdanov
6dbbf0bb72 Move server process creation to JDK 6 suite
It's allow to avoid problem with wrong inherited output
 (gradle instead of test process)
2019-05-02 13:46:27 +02:00
Georgy Bronnikov
bfe148efd5 IR: mostly remove descriptors from codegen 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
9923d956aa JVM_IR: rework IrIntrinsicMethods 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
98d309d03b IR: declaration builders for receiver parameters 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
ad70a68671 JVM_IR: correct some type parameter bugs 2019-05-01 20:08:20 +03:00
Georgy Bronnikov
3e6171aefc JVM_IR: redirect super calls to DefaultImpls where necessary 2019-05-01 11:47:44 +03:00
ilya-g
66fb47e715 Fix relative link in contributing guide 2019-05-01 07:59:15 +03:00
Ilya Gorbunov
5f2762ed20 Follow up: fix typos in coroutine docs 2019-05-01 05:40:35 +03:00
Svyatoslav Kuzmich
87415cb769 [JS IR] Help IDEA: Copy stdlib sources instead of sharing 2019-05-01 00:28:36 +03:00
Svyatoslav Kuzmich
54e6ee82ad Exclude :kotlin-stdlib-js-ir from coreLibProjects for local builds 2019-05-01 00:28:36 +03:00
Simon Ogorodnik
8a2b41c8cb Fix proguard 2019-04-30 19:28:17 +03:00
Mikhail Glukhikh
5262f0a53f Fir2Ir: apply major text data update after a bunch of resolve changes 2019-04-30 18:45:57 +03:00
Simon Ogorodnik
3e51cbc9dc FIR: move test to stdlib group thus fixing it 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
5b929b88e1 [FIR] Allow nullability mismatch in resolve 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
2111e56d2e FIR: introduce workaround to avoid type-aliases in ConeClassType 2019-04-30 18:45:56 +03:00
Simon Ogorodnik
c06d521e78 FIR: support star projection in CreateFreshTypeVariableSubstitutorStage
This commit fixes a small pack of tests failing at this point
2019-04-30 18:45:56 +03:00
Simon Ogorodnik
4bcba000fd FIR: pass name resolver to annotation deserializer separately 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
1bb4b32c91 Fir2Ir converter: fix exception on FirUnitExpression 2019-04-30 18:45:56 +03:00
Mikhail Glukhikh
f2ff103ed7 Fir2Ir converter: fix KNPE during use-site scope building for local 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
8cb16cc06a FIR provider: support getClassUseSiteMemberScope for type aliases 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
f457cb099f FIR deserializer: handle context in more correct way 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
1e653226ef FIR deserializer: don't create symbol in advance for class literals 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
a4b4db5589 FIR resolve: process situation with both implicit receivers properly 2019-04-30 18:45:55 +03:00
victor.petukhov
3636046e2d [FIR] Add test with potential recursive call in compiler FE on when with sealed class inside it (KT-18583) 2019-04-30 18:45:55 +03:00
Mikhail Glukhikh
d1d6b8b77a FIR Java: handle primitive arrays in annotations correctly 2019-04-30 18:45:54 +03:00
Mikhail Glukhikh
be18134270 FIR multi-module: minor test data fixes after resolve enhancements 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
77817cb750 Raw FIR: copy class type-parameters into constructors properly 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
9cef9e4056 Remove isMarkedNullable from FirResolvedTypeRef 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
458080ca8b Raw FIR: create resolved references for desugared temporary variables 2019-04-30 18:45:54 +03:00
Simon Ogorodnik
99994e6c41 FIR: provide super-type as the self-type for anonymous objects
This commit is a temporary approximation useful before we have
symbols for local classes & objects
2019-04-30 18:45:54 +03:00
Simon Ogorodnik
2f7ced2a8e FIR Java: bind overrides properly 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
d19a250cbe FIR: support proper overriding of generic functions 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
7b9f5293da FIR: resolve primary constructor parameters in initializers context 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
fa4ba82350 FIR: provide classifiers via class use-site scope 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
f99f06831c FIR resolve: support typing for get class 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
00ccea220e Raw FIR: allow implicit type of value parameter (helpful for lambda) 2019-04-30 18:45:53 +03:00
Simon Ogorodnik
9169071d60 FIR resolve: introduce draft version of the visibility checker 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
adf845b2fd FIR: provide resolved super-type as the type of enum entry reference 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
8e200d8113 Filter out self output directory from classpath in FIR modularized test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e521e66c74 FIR deserializer: provide proper type for enum entries 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
ca350e64c2 FIR deserializer: add proper container class id to nested class members 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
daf9f927d4 FIR: add property case to companion test 2019-04-30 18:45:52 +03:00
Simon Ogorodnik
e41a79fbe9 Unify building references to symbols in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
0c0f45791b Anchors instead of refs on declaration site in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
d28bb5bc70 Render value-parameter modifiers in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
efbf096879 Support ::class in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb19a586f4 Fold nullability flexible types in html fir dump 2019-04-30 18:45:51 +03:00
Simon Ogorodnik
3e69838f48 FIR Java: map classes to make java type-parameters have correct bounds
Really, this commit implements early J2K mapping for all Java types.
It's questionable and probably wrong at least for super-types,
because, for example, we cannot resolve spliterator() in classes
derived from java.lang.Iterable
2019-04-30 18:45:51 +03:00
Simon Ogorodnik
cb91c6b977 Add abbreviated types rendering to html fir dump 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
6a0e3371ae FIR: resolve conflicts on multiple inheritance of fun with same signature 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
84fbf4ec25 Partially cache scopes in FIR body resolve transformer 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
861ea6a30f Provide hashCode and equals for lookup tag based types 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ce0b482413 FIR resolve: add work-around to support enum entries 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
d22eab680e FIR: provide nested classes and objects via declared member scope 2019-04-30 18:45:50 +03:00
Simon Ogorodnik
ee73d21d32 Expand type-aliases in cone (FIR) type context 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
6f9f9fc087 FIR types: relax requirements around flexible types 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
0ae2f992fa Raw FIR: provide receiver to ++, -- operators 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
dc4ccf8d23 FIR resolve: make receiver completion run independent from outer call 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
adb135d036 Provide title to symbol references in html fir dump 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
c1a9fee7e1 Implement break, continue, init in html fir 2019-04-30 18:45:49 +03:00
Simon Ogorodnik
26119f0403 FIR: implement isDenotable on type constructor more accurately 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
21d002ab6f FIR: add function for copying type-parameters 2019-04-30 18:45:48 +03:00
Simon Ogorodnik
cec10dac85 FIR deserializer: remove cycle in annotations loading 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
e3e7eea3fe FIR: support (partially) type annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
48cd9e3251 FIR: support class annotations in JVM deserialized 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
a9db64989b FIR deserializer: support enum entries and their annotation usages 2019-04-30 18:45:48 +03:00
Mikhail Glukhikh
b839e50ee2 FIR: deserialize annotations (built-ins only, no enums & arrays yet)
Problems: enums aren't deserialized correctly; array aren't done at all;
Target annotation has no arguments in built-in for some reason.
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
092d10b1a8 FIR Java: fix creation & handling of type parameter symbols
Before this commit, we created type parameter symbols each time
when type parameter was referenced or created.
In this commit, we introduced class-bound Java type parameter stack
and use it to find referenced type parameter symbol.
So now they are created only when Java type parameter is created
2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
f8bb1d161a Fir Java: add type parameters to constructors and their return types 2019-04-30 18:45:47 +03:00
Mikhail Glukhikh
5bf489327d Minor fix of around flexible and not-null FIR types (by semoro) 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
c487c1443f FIR deserializer: provide type parameters for type-aliases 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
9d7d358836 FIR deserializer: support properties 2019-04-30 18:45:47 +03:00
Simon Ogorodnik
b02b090bdf FIR inference: implement simple constraint system properly 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
ddb08777d9 Link type parameters in html fir dump 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
4469fec57b Enable local functions in fir html dump 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
f9feeac5e1 Raw FIR: generate data-class component1, component2, ... functions 2019-04-30 18:45:46 +03:00
Mikhail Glukhikh
bb7dcd9945 FIR: protect importing scopes from empty names 2019-04-30 18:45:46 +03:00
Simon Ogorodnik
8324ee7272 FIR deserializer: support type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6ab38a583 FIR: resolve constructors via type-aliases 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
aa077b42e9 FIR deserializer: provide type-parameters for constructors 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
1512a6ba9a Support FirAnonymousObject in html fir dump 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
e6b9c41f3a FIR resolve: use proper argument mapping in FlatSignature for constructor 2019-04-30 18:45:45 +03:00
Simon Ogorodnik
d89913dc8d FIR: use type of last expression as type of branch, not type of block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fd279860f7 FIR resolve: provide unconditional typing for block 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
aa5f0fded5 FIR resolve: provide proper type for super reference 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
9dcf8f836a FIR: support varargs in resolve 2019-04-30 18:45:44 +03:00
Simon Ogorodnik
fa135bbab0 FIR resolve: properly count used arguments in overload conflict resolver 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
b4019b0cc1 FIR inference: use generic version of error type in type approximator 2019-04-30 18:45:44 +03:00
Mikhail Glukhikh
7d793f6750 FIR resolve: add handling of companions as objects 2019-04-30 18:45:43 +03:00
Mikhail Glukhikh
ab258767f8 FIR resolve: add extra test & comments to multiple receiver resolve 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
d1b8ca31c0 FIR resolve: add test for firstOrNull 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
a3806a6e2e Cone (FIR) context: provide proper types instead of todo's 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
dae5822986 FIR: fix nullability loss on substitution 2019-04-30 18:45:43 +03:00
Simon Ogorodnik
572c9e7115 FIR resolve: add test for map and apply 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
206afde9cc FIR inference: add constraint system from receiver 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
fda777ecae FIR: detect extension function types by reference annotation
Later it should be replaced by cone type annotation analysis
2019-04-30 18:45:42 +03:00
Simon Ogorodnik
3d73c28d1e FIR: fix receiver not being substituted 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
77efe8b857 FIR resolve: reorder call resolution sequence 2019-04-30 18:45:42 +03:00
Simon Ogorodnik
d82e790405 Cone (FIR) type context: implement supertype substitution properly 2019-04-30 18:45:42 +03:00
Mikhail Glukhikh
f47258c6b1 FIR: make substitution wrapper for class-based type scope 2019-04-30 18:45:41 +03:00
Mikhail Glukhikh
93496f1dee FIR resolve: add correct receiver tower scopes + check receivers 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
4b5172cda3 FIR (WIP): Initial support for proper lambda analysis 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
8c67ec8c89 FIR resolve: abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0de50307a Raw FIR: generate more trivial tree for lambdas (no explicit return) 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
aaf4645cef FIR: add return type to functional type's arguments 2019-04-30 18:45:41 +03:00
Simon Ogorodnik
a0176fbde5 Support labels in fir html dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
541e1addf9 FIR modularized test: fix date format in report name 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
82fbe4d83d Support String concatenation and Unit expression in html fir dump 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
a6b2e119f7 FIR resolve: support trivial when typing 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
55467909da FIR deserializer: optimize KotlinDeserializedJvmSymbolsProvider 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
3a50d2e666 FIR: provide constructors from importing scopes 2019-04-30 18:45:40 +03:00
Simon Ogorodnik
e7ea75fd81 FIR: fix search scope to include kotlin libraries package parts 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
4cb8faf666 FIR: uniquify scopes to avoid ambiguity on diamond inheritance 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
8d4cbd84e3 FIR resolve: support synthetics discrimination 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
49883d1d87 Add root index to fir dump 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
9c04751572 FIR modularized test: use qualified module names 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
3cabf490dd Use fir to html in modularized test 2019-04-30 18:45:39 +03:00
Simon Ogorodnik
61b410e276 Implement fir to html dump 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
32e941cb53 FIR: keep names for error references 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
5bf41594ec FIR resolve: add receiver consistency checking
NB: looks like checker itself may be not needed, but it's important
to check extension receiver presence during candidate collection
2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
2e7d655b20 FIR resolve: support nested class constructors 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
8b718c6822 FIR body resolve: support subject type calculation 2019-04-30 18:45:38 +03:00
Mikhail Glukhikh
e05dfb6541 FIR resolve: introduce argument mapper 2019-04-30 18:45:38 +03:00
Simon Ogorodnik
c98b820968 Extract FIR modularized tests to separate module 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
6e3f173567 Implement old FE perf test similar to FIR modularized 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
3c4f5be8fd Implement FIR modularized tests 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
fe3afccfc2 FIR resolve: provide synthetic properties scope
At the moment get* and is* functions are supported
2019-04-30 18:45:37 +03:00
Simon Ogorodnik
5763b82cdd Improve FIR benchmark util, add progress and multi-run info collection 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
45f92c490c FIR: make call resolver stop on first successful candidate 2019-04-30 18:45:37 +03:00
Simon Ogorodnik
95011b1076 Return "FIR resolve: support variable assignments" with full completion 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
c6aff9380b FIR: support resolving to objects 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
b38f3a1272 Replace ConeFunctionType with ConeClassType 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
93cb23a498 Raw FIR: support type placeholders 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
0e0c188e05 Rebuild fir-provider indexes on changes 2019-04-30 18:45:36 +03:00
Simon Ogorodnik
5f0fe4785d Implement FirProvider consistency checker 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
1dae135840 Expand ConeTypeContext, implement FIR type inference & related checkers 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
f1eb66819b Revert "FIR body resolve: support variable assignments"
Performed to make long branch rebasing easier
This reverts commit af8c3788
2019-04-30 18:45:35 +03:00
Simon Ogorodnik
935c21f906 FIR scopes: use use-site member scopes for imports 2019-04-30 18:45:35 +03:00
Simon Ogorodnik
3533541702 Provide class use-site scopes from FirSymbolProviders 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
1cd25da7af FIR scope processors: add function to check is stop on ProcessorAction 2019-04-30 18:45:34 +03:00
Simon Ogorodnik
082e9d1cd7 FIR Java: implement knownClassNamesInPackage optimization 2019-04-30 18:45:34 +03:00
Yanis Batura
a51b7fb8d0 Fix typos 2019-04-30 18:42:07 +03:00
Leonid Startsev
0ecf20bd62 Revert back visibility in deserialization ctor to public so inheritors can access it from other modules.
Fix instantiating of polymorphic serializer with generics.
Move context creation below as asked.
2019-04-30 17:53:40 +03:00
Dmitriy Dolovov
3610c99163 Move IDE-related CIDR modules into 'ide' directory 2019-04-30 21:32:21 +07:00
Svyatoslav Kuzmich
379cb08226 [JS] Reduce usage of 'js' function in stdlib
Function 'kotlin.js.js' is to be redesigned in JS IR backend,
partially because it is a hard feature to support.

Current implementation is unstable and can cause problems around
 inlining and name generator. Luckily most of its use-cases
can be covered by simpler features like dynamic expressions and
external declarations.

Thus we are reducing it's usage in stdlib to make IR backend more
stable in current state. JavaScript features that can't be covered by dynamic expression are
implemented in 'jsOperators.kt' file respectively for each backend:

 - 'internal inline' function which calls 'js' function inside for current
   pre-IR backend

 - 'internal' function with '_hack' parameters for JS IR backend which will be
   later intinsicified in a compiler
2019-04-30 15:27:19 +03:00
Alexander Udalov
e22594acde JVM IR: slightly change field renaming convention implementation
Prefer to rename fields from the class, not from the companion, to be
more in line with the old backend's behavior. This has no effect on the
behavior of current tests but removes differences in metadata (since
metadata has information about every property->field mapping) in some of
them
2019-04-30 13:15:29 +02:00
Alexander Udalov
6cc293a0c5 JVM IR: record FIELD_FOR_PROPERTY for property delegates
Delegated properties now have their $delegate fields recorded in the
metadata (in `ClassCodegen.generateField`). This part of metadata is
used by `KPropertyN.getDelegate` functions, so almost all tests on
getDelegate are now unmuted
2019-04-30 13:15:29 +02:00
Alexander Udalov
5aae832c5f Minor, update doc on -Xsanitize-parentheses
The ASM issue with parentheses was fixed in
02f00c4a82

 #KT-29475
2019-04-30 13:15:29 +02:00
Alexander Udalov
bd6e90f302 FIR: remove dependency of :compiler:fir:resolve on :compiler:cli 2019-04-30 12:01:23 +02:00
pyos
c77e8a8c2d JVM_IR: remove another redundant lowering 2019-04-30 08:20:37 +02:00
Dmitriy Dolovov
c017ef9bc8 Properly detect Kotlin/Native libraries
Issue #KT-30598 fixed
2019-04-30 13:05:22 +07:00
Dmitriy Dolovov
20d77afcce Refactor Kotlin/Native path constants
Use java.io.File instead of java.nio.Path to have more uniform API
2019-04-30 13:05:14 +07:00
Dmitriy Dolovov
2ef7cde34b Add tests for "lite" API for Kotlin/Native libraries 2019-04-30 13:05:06 +07:00
Dmitriy Dolovov
07f6059f44 Refactor "lite" API for Kotlin/Native libraries 2019-04-30 13:04:56 +07:00
Andrey Uskov
6039d86388 Importing projects with granular metadata is partially supported
(except k-lib data format of metadata libraries and multiple target
platforms per source set)
2019-04-29 19:49:18 +03:00
Andrey Uskov
998a24414a Improved parsing of internal compiler arguments with boolean state in
case when the argument is listed twice in the list of command line
arguments. The last value will be used.
#KT-27181 Fixed
2019-04-29 19:48:01 +03:00
Andrey Uskov
affe8baf74 Fix import with jps enabled. kotlin-js-ir and kotlin-test-js-ir were
removed from jps build
2019-04-29 19:45:01 +03:00
Mikhael Bogdanov
0482f7e9c5 Restrict general compare intrinsic optimization to CompareTo intrinsic 2019-04-29 16:27:35 +02:00
Simon Ogorodnik
51f5042315 Fix FIR compilation 2019-04-29 16:51:39 +03:00
Mikhail Glukhikh
b8e6291265 Inference: use generic version of error type in type approximator 2019-04-29 16:51:39 +03:00
Simon Ogorodnik
db8bd8c197 Fix check isCapturedTypeFromSubtyping to support KotlinTypeMarkers 2019-04-29 16:51:38 +03:00
Simon Ogorodnik
aabc9fa10f Abstract PostponedResolvedAtom & buildCurrentSubstitutor 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
58029830f0 Skip star-projection to avoid failures 2019-04-29 16:51:37 +03:00
Simon Ogorodnik
2ea7fb8801 Cleanup ConstraintStorage.buildResultingSubstitutor 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
57a3b1a773 Abstract TypeApproximator from NewCapturedType 2019-04-29 16:51:36 +03:00
Simon Ogorodnik
9306f3840f Abstract buildResultingSubstitutor & ResultTypeResolver from KotlinType 2019-04-29 16:51:35 +03:00
Simon Ogorodnik
fe2e5b7301 Abstract FlatSignature from kotlin types 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
8e595f015e Initial OverloadingConflictResolver abstraction from KotlinTypes 2019-04-29 16:51:34 +03:00
Simon Ogorodnik
9a1678728d Implement inference context and simple components 2019-04-29 16:51:33 +03:00
Simon Ogorodnik
04324b6723 Provide overloads with explicit resolutionFacade for resolutionApi
To ensure stable results of subsequent resolution api method calls,
it is require to provide same resolution facade, as
getResolutionFacade function doesn't guarantee to have same result in
subsequent calls due to soft caching
2019-04-29 16:51:32 +03:00
Roman Elizarov
1e5d973bb1 Fix CoroutineContext documentation with respect to equality
KT-26398 had updated behavior from reference comparison to regular
equality, but the documentation for CoroutineContext was left out.
The whole "by reference" needs to be removed, because it now
follows default behavior of all Kotlin collections and need no
further clarification.
2019-04-29 16:33:22 +03:00
Vyacheslav Gerasimov
389490ad79 Build: resolve :idea project resources lazily in ultimate plugin
to avoid using `evaluationDependsOn`
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
c218385ba8 Build: Collect sources for compiler lazily to avoid evaluationDependsOn 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
8851029baa Build: Use embedded configuration for compiler plugins 2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
50e145f239 Build: remove various evaluationDependsOn calls across the build
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
0ec1df89fa Build: use configuration for dependency on android-extensions-runtime
`evaluationDependsOn` may lead to obscure gradle errors on project configuration
2019-04-29 16:23:16 +03:00
Vyacheslav Gerasimov
b3720a55d2 Build: Make root ideaPlugin task depend on :prepare:idea-plugin
Since it's only one left in the project
2019-04-29 16:23:16 +03:00
Mikhail Glukhikh
3f6be95801 Include FIR modules into compiler #KT-30243 Fixed
(cherry picked from commit 053aa8ca1e)
2019-04-29 16:23:16 +03:00
Nicolay Mitropolsky
bd16c4629a KotlinElementActionsFactory.createChangeModifierActions modernisation
to allow IDEA relatively safely remove `createChangeModifierActions(target: JvmModifiersOwner, request: MemberRequest.Modifier)` in 192
2019-04-29 16:18:14 +03:00
Jiaxiang Chen
4b99d85322 Optimize JVM byte code generation for conditional conjunction
Implement an intrinsic method for boolean.and operation, and replace
ANDAND condition with a call to such intrinsic method.
2019-04-29 13:28:18 +02:00
Vasily Levchenko
53493657ff [kotlin-native-shared][version]bump 2019-04-29 14:08:16 +03:00
Nikolay Krasko
07ea0ffe16 Reformat and clean up idea.actions.internal 2019-04-29 12:13:18 +03:00
Nikolay Krasko
f9012cf637 Add options for disabling Kotlin line markers (KT-27332)
#KT-27332 Fixed
2019-04-29 12:13:14 +03:00
Nikolay Krasko
c72a375063 Better localization for dsl style icon change 2019-04-29 11:56:07 +03:00
Nikolay Krasko
ea8575c5a3 Remove check for Kotlin misconfiguration for the whole project (KT-30644)
Consider an existing project to be previously configured.

There's still "Configure Kotlin" action, check for configuration
triggered by adding a new Kotlin file, and notification in Kotlin files.

 #KT-30644 Fixed
2019-04-29 11:56:07 +03:00
Nikolay Krasko
01c0c3c924 Addition note about intention and quick-fixes execution in UI thread 2019-04-29 11:56:07 +03:00
Alexander Gorshenev
bd78e7e0aa Move property serialization to symbols
Make sure private field's wrapped descriptor is bound
2019-04-29 04:10:00 +03:00
Alexander Gorshenev
2c026114ae Made IrStatementOrigin serialization field optional for all statements 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
85f85fb3e8 IrStatementOrigin support in newly introduced IrDelegatedPropertyReference 2019-04-29 04:04:16 +03:00
Alexander Gorshenev
19bd01cc8a Introduced proper IrStatementOrigin serialization. 2019-04-29 04:04:16 +03:00
Nicolay Mitropolsky
0794ab9432 Uast: cleaunp warnings (but some still remains) 2019-04-28 16:36:43 +03:00
Svyatoslav Kuzmich
13b332e99e Build scripts for JS IR versions of stdlib and kotlin.tests 2019-04-26 20:14:12 +03:00
Svyatoslav Kuzmich
5da83889d9 Stdlib tests: Supporess NoInfer access instead of redeclaration
Stdlib annotation 'kotlin.internal.NoInfer' was redeclared in stdlib tests
so non-fried modules (kotlin-stdlib-jdk7, kotlin-stdlib-jdk8, etc.)
could access it.

IR deserializer does not support declaration duplicates (at least yet
for JS IR backend). Thus this commit removes this redeclaration and
suppresses errors on its usages instead.
2019-04-26 20:14:03 +03:00
Sergey Igushkin
4848911e6d Fix testNativeTests, add missing system-out to expected test outputs 2019-04-26 18:51:25 +03:00
Sergey Igushkin
9d7c5213df Fix testNewKotlinJsPlugin on Windows (slashes) 2019-04-26 18:32:43 +03:00
Dmitry Petrov
865e0cc080 IR: IrConstructorCall: fixes after rebase 2019-04-26 17:43:26 +03:00
Igor Chevdar
7f423bd841 [IR] Fixes in inliner 2019-04-26 17:43:26 +03:00
Mikhael Bogdanov
be0b2e064b Fix JVM IR inliner 2019-04-26 17:43:26 +03:00
Roman Artemev
c545481db9 Fix JS_IR IrConstructorCall support 2019-04-26 17:43:26 +03:00
Roman Artemev
2a3ce8e9f1 Serialize IrConstructorCall 2019-04-26 17:43:26 +03:00
Dmitry Petrov
b78d1bb2b9 IrConstructorCall support in JVM_IR, JS_IR, and FIR2IR 2019-04-26 17:43:25 +03:00
Dmitry Petrov
82128800c5 IR: assertion in IrCallImpl init
NB it uses descriptor to determine if we try to call constructor using
IrCall.
2019-04-26 17:43:24 +03:00
Dmitry Petrov
11eea6e86a psi2ir: generate IrConstructorCall elements in IR builder helpers 2019-04-26 17:43:24 +03:00
Dmitry Petrov
e3fd74a580 IR: annotations are represented as IrConstructorCall elements
Also, they are rendered somewhat nicer
2019-04-26 17:43:24 +03:00
Dmitry Petrov
db7bcb6464 IR proto: IrConstructorCall in protobuf format 2019-04-26 17:43:24 +03:00
Dmitry Petrov
198ccbc114 JVM_IR: support IrConstructorCall in ExpressionCodegen 2019-04-26 17:43:24 +03:00
Dmitry Petrov
37b1c175ce IR: introduce IrConstructorCall / IrConstructorCallImpl 2019-04-26 17:43:24 +03:00
Roman Artemev
023306b1b3 [JS IR BE] Add tests for main function 2019-04-26 17:04:28 +03:00
Roman Artemev
5bd3bcd237 [JS IR BE] Support main function
* Implement IR-based main function detector
2019-04-26 17:04:28 +03:00
Roman Artemev
6729603ac7 [JS IR BE] Fix warnings 2019-04-26 17:04:28 +03:00
Mikhael Bogdanov
867e39f73c Parallelize idea-gradle tests 2019-04-26 14:42:20 +02:00
Leonid Startsev
90bf36ea7a Fix reference to IrField when serializing superclass' properties 2019-04-26 15:06:54 +03:00
Leonid Startsev
6bec6e6905 Add synthetic constructors to class member scope, so they won't fly 'in the air' in the backends
This is required mainly for Native compiler since it wont't work correctly on descriptors that are not present in the class.
2019-04-26 15:04:53 +03:00
Leonid Startsev
406896eaf0 Implement equals/hashcode for IrDeclarationOrigin so deserialized unknown origins would be compared correctly 2019-04-26 14:59:51 +03:00
LepilkinaElena
02331fbd7e Unify compiler and cinterop flags names (#2294) 2019-04-26 13:34:14 +03:00
nikita.movshin
7b017cb76f Add changelog for 1.3.30 and 1.3.31 2019-04-26 13:06:12 +03:00
Mikhael Bogdanov
c53682f397 Fix AS33 compilation
Commented unnecessary code that uses unavailable API
2019-04-26 11:29:42 +02:00
Mikhael Bogdanov
ceec35bf38 Up merge changes from UsefulTestCase into KtUsefulTestCase 2019-04-26 11:29:41 +02:00
Mikhael Bogdanov
1bc03e705a Minor. Remove old parallelize approach 2019-04-26 11:29:41 +02:00
Sergey Rostov
911a5bdd0e Specify missing type arguments to fix compilation 2019-04-26 12:00:43 +03:00
Mikhail Zarechenskiy
5b33e54f77 [NI] Provide diagnostics for candidates in "allCandidates" mode
This helps for completion as it use diagnostics to clip extra
 candidates
2019-04-26 11:40:17 +03:00
Mikhail Zarechenskiy
450bfed375 Specify missing type arguments to fix compilation in FE module 2019-04-26 11:32:19 +03:00
Mikhail Zarechenskiy
57ad0aa8fb Missing fix for project compilation against bootstrap compiler 2019-04-26 06:28:13 +03:00
Anton Yalyshev
657281a60d added tracking of chosen Kotlin framework in Java-based wizards 2019-04-25 19:06:20 +03:00
Anton Yalyshev
1d3f75adfd created FUS Group for New Project Wizards and Frameworks 2019-04-25 19:06:20 +03:00
Anton Yalyshev
01f34a0ba7 switched to new FUS adapter API 2019-04-25 19:06:19 +03:00
Anton Yalyshev
63ffff175b now we send FUS for ModuleBuilders and FrameworkSupportProviders 2019-04-25 19:06:19 +03:00
Svyatoslav Kuzmich
5baa520232 Advance bootstrap to 1.3.40-dev-2251
Required for JS IR CLI and Gradle plugin
2019-04-25 19:04:59 +03:00
Ilya Matveev
774dbcd6c0 Fix IDEA import after including kotlin-native-shared in Gradle plugin 2019-04-25 21:32:03 +07:00
Mikhail Zarechenskiy
f00c946ff7 Fix projection compilation against bootstrap compiler
This is needed after 5d95a1ac
2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
ac0a1d984f [NI] Don't return resulting call if return type has uninferred types 2019-04-25 16:19:38 +03:00
Mikhail Zarechenskiy
db4ca059bd [NI] Fix IDE-refactorings when there are uninferred parameters 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
1e3db9ee7c [NI] Update test data for diagnostic tests 2019-04-25 16:19:37 +03:00
Mikhail Zarechenskiy
ff0993153c [NI] Improvements for "not enough information" diagnostic
#KT-30590 Fixed
2019-04-25 16:19:36 +03:00
Mikhail Zarechenskiy
09cc2ae27f [NI] Initial support of "not enough information" diagnostic
#KT-30590 In Progress
2019-04-25 16:19:36 +03:00
Dmitriy Novozhilov
c1b586f921 [NI] Complex test for "not enough" information diagnostic 2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
d40313a8d7 [NI] Allow capturing type projections with type variables
#KT-25302 Fixed
2019-04-25 16:19:35 +03:00
Mikhail Zarechenskiy
abd1c3df26 [NI] Fix diagnostic reporting and unveil problem wrt captured types 2019-04-25 16:19:32 +03:00
Dmitry Gridin
6826d2f193 Replace provideByFqNameMulti with provideByFqName 2019-04-25 19:47:39 +07:00
Dmitry Gridin
3e74e875e8 Add a colon check in LanguageSettingsParser 2019-04-25 19:47:39 +07:00
Dmitry Gridin
b78ec32c02 Change CodegenFactory signature from Collection<KtFile?> to Collection<KtFile> 2019-04-25 19:47:39 +07:00
Dmitry Gridin
37c856290f Fix minor compile warnings 2019-04-25 19:47:39 +07:00
Dmitry Gridin
79793a4bda Replace deprecated classes with parent 2019-04-25 19:47:38 +07:00
Dmitry Gridin
2a85bece80 Replace CodeStyleSettingsManager.getSettings with CodeStyle.getSettings 2019-04-25 19:47:38 +07:00
Dmitry Gridin
bdb97ed46a Replace deprecated icons with actual 2019-04-25 19:47:38 +07:00
Dmitry Gridin
c41b98f5b9 Replace SystemInfo.isJavaVersionAtLeast("1.7") with SystemInfo.isJavaVersionAtLeast(1, 7, 0) 2019-04-25 19:47:38 +07:00
Dmitry Gridin
d7d9771b3c Replace UastEmptyExpression with UastEmptyExpression(null) 2019-04-25 19:47:38 +07:00
Alexander Udalov
648ed92ba3 Minor, deduplicate code in CodegenTestCase.doTest 2019-04-25 14:43:56 +02:00
Alexander Udalov
1c1ff3e2b2 Minor, move android-extensions-compiler tests to package org.jetbrains.kotlin
To fix the package name mismatch inspection
2019-04-25 14:43:47 +02:00
Alexander Udalov
74dd99a8da JS: use new DefaultBuiltIns instance instead of anonymous 2019-04-25 14:42:44 +02:00
Alexander Udalov
cb6fb78bc3 JS: do not use "-no-stdlib" in non-relevant tests
Rename some Ant tests: "simple[...]" -> "simpleWithoutStdlib[...]" and
"simpleWithStdlib[...]" -> "simple[...]"
2019-04-25 14:42:43 +02:00
Alexander Udalov
0659d0cba9 JS: do not use getBuiltInsModule to compute module name
The intention of this code was to use the name "kotlin" for the builtins
module, in case we're using builtins loaded from the compiler class
loader (whose module is created in
`KotlinBuiltIns.createBuiltInsModule`). However,
`getBuiltIns().getBuiltInsModule()` may refer not necessarily to the
builtins module, but also to any valid module where the builtins are
visible from, therefore its name would be computed incorrectly. Use the
module name instead to determine if it's a synthetic builtins module
created in `createBuiltInsModule`
2019-04-25 14:42:43 +02:00
Alexander Udalov
d5fd160fd3 JS: minor, do not use '==' on descriptors from built-ins
Use KotlinBuiltIns.isString instead of equality with
KotlinBuiltIns.string, which is more portable across different module
configurations. Also use isSubtypeOf instead of
DescriptorUtils.isSubclass and thus get rid of an extra error on an
unresolved class in nativeAnnotationCheckers.kt
2019-04-25 14:42:42 +02:00
pyos
31670622c0 Remove a redundant JVM-specific lowering 2019-04-25 14:30:41 +02:00
Jake Wharton
373424f430 Add ULong.compareTo and UInt.div/rem/compareTo intrinsics for Java 8 2019-04-25 13:21:25 +02:00
Georgy Bronnikov
e6362661d1 Merge pull request #2298 from pyos/linear-toarray-lowering
JVM_IR: make ToArrayLowering linear in complexity
2019-04-25 13:28:49 +03:00
Mikhail Glukhikh
69ea0a3597 Fir broken FIR2IR test 2019-04-25 12:37:13 +03:00
Ilya Matveev
24588263ed Store kotlin-native-shared version in the jar of the Gradle plugin 2019-04-25 16:19:11 +07:00
Ilya Matveev
c9ed648303 Use kotlin-native-shared in the Gradle plugin
The kotlin-native-shared artifact includes API allowing
us to work with K/N platforms, hosts, distribution etc.
This patch replaces a dependency on kotlin-native-utils
containing copies of such classes with a dependency on
published kotlin-native-shared in the Gradle plugin and
bundles kotlin-native-shared into the Gradle plugin jar.
2019-04-25 16:19:11 +07:00
pyos
4b0b9e1f80 JVM_IR: make ToArrayLowering linear in complexity
by not running DFS from every node visited during another DFS.
2019-04-25 11:07:34 +02:00
Nicolay Mitropolsky
f118b007f0 Uast: more cases for KotlinUSimpleReferenceExpression resolve (KT-30957, KT-27385) 2019-04-25 10:07:09 +03:00
Simon Ogorodnik
9352d52e7e FIR: load default value from meta-data 2019-04-25 09:47:38 +03:00
Simon Ogorodnik
879563233a FIR: optimize caching in JVM deserializer 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f453e7df27 Improve error reporting in fir benchmark function 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
a5ca8ffe69 Refactor FirSelfImportingScope 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
f22cca5087 FIR top-level member scope: lookup constructors via classes 2019-04-25 09:47:37 +03:00
Simon Ogorodnik
9cf91738ea Use local callables index in FirClassDeclaredMemberScope 2019-04-25 09:47:37 +03:00
Mikhael Bogdanov
11e0035254 Support test parallelization in uast tests 2019-04-25 08:09:27 +02:00
Mikhael Bogdanov
d1b5c76f09 Reuse KtUsefulTest case temporary files infrastructure 2019-04-25 08:09:26 +02:00
Svyatoslav Kuzmich
e30bdb8dc9 Fix hanling module names that require escaping 2019-04-25 03:54:17 +03:00
Ilya Chernikov
c3a439a829 Fix and refactor scripting subplugin application logic
so warning is not shown when discovery configuration is not populated
fix #KT-31124
refactor code for clarity on the way
also apply scripting subplugin after main plugin to ensure that
configurations are created before scripting is initialized
2019-04-24 17:27:47 +02:00
Ilya Chernikov
917fc56f36 Fix main-kts dependencies after extracting scripting 2019-04-24 17:27:03 +02:00
Ilya Chernikov
4b8d9c8fdd Fix classloaders order on script evaluation
the dependencies one should be a parent for the modules one, to avoid
incompatibility problems. Also fixes main-kts tests
2019-04-24 17:27:03 +02:00
Anton Yalyshev
6ffc3a8679 bunch files update after master switched to 191 2019-04-24 17:23:47 +03:00
Anton Yalyshev
2329954e02 added capability to send a custom event's context 2019-04-24 17:23:22 +03:00
Anton Yalyshev
0255d66144 shortened class and function names and make them closer to actual FUS naming 2019-04-24 17:23:21 +03:00
Dmitry Gridin
9bd32eb3cb Replace GradleBaseInspection with BaseInspection
#KT-31103 Fixed
2019-04-24 20:23:15 +07:00
Dmitry Gridin
0198df4935 PackageDirectoryMismatchInspection should report when a package statement is missing
#KT-13549 Fixed
2019-04-24 20:16:54 +07:00
Dmitry Gridin
2ae30de980 MoveVariableDeclarationIntoWhenInspection shouldn't report a multi-line variable
#KT-30457 Fixed
2019-04-24 20:12:44 +07:00
Sergey Igushkin
d456ae58b6 Remove usages of com.intellij.* utils from kotlin-build-common, KT-31106
As Gradle may under certain conditions reorder the buildscript
classpath artifacts, we need to ensure that the `kotlin-build-common`
module, which duplicates some of the classes that are shaded and packed
into `kotlin-compiler-embeddable`, does not call `com.intellij.*`
classes.

Replace the `com.intellij.*` utils that were called on the execution
path with our own implementations.

Issue #KT-31106 Fixed
2019-04-24 15:51:13 +03:00
Svyatoslav Kuzmich
09d7f4015b Move test.kt stubs to smallRuntime
We already use kotlin.test with fullRuntime klib.
2019-04-24 13:06:59 +03:00
Svyatoslav Kuzmich
b0bd5802bb Remove optionalExpectation hacks
Add common sources to Generate IR Runtime
2019-04-24 13:06:58 +03:00
Svyatoslav Kuzmich
1a6e6588fc Fix: Use Vars instead of plain assignments for declaration imports 2019-04-24 13:06:58 +03:00
Ilmir Usmanov
c2884f3ca8 Optimize variable liveness analysis
During coroutines transformation, we analyse liveness of local variables
in order to decide whether we need to spill them or not.
This analysis contains hot method `useVar`, in which we previously
iterated over all variables in LVT. This is done, since these variables
are seen by debugger and we assume they are alice.
However, this variables can be generated by inliner. In this case, the
LVT's size in huge. I.e. we have loop in hot method.

By hoisting the liveness analysis of the LVT and combining its result
with result of usual liveness analysis, we achieve speed-up from 2m30s
down to 5s.
 #KT-30603 Fixed
2019-04-24 13:04:40 +03:00
Steven Schäfer
f2392a6a28 Remove Concat and StringPlus intrinsics in favor of IrStringConcatenation. 2019-04-24 12:04:12 +02:00
Natalia Selezneva
26c9d69252 Check KotlinOutOfCodeBlockTracker in OutOfBlockModificationTest
General PsiModificationTracker.outOfCodeBlockModificationTracker was removed in IDEA 192
2019-04-24 11:45:03 +03:00
Natalia Selezneva
512a297e0a Process property setter parameter in UAST 2019-04-24 11:39:17 +03:00
Natalia Selezneva
d45644cea4 Fix path to TestNG library in tests for 191 2019-04-24 11:39:17 +03:00
Nicolay Mitropolsky
1db7754298 A workaround for the IDEA-211491 in IDEA 191 to make Kotlin tests pass
for instance `InspectionTestGenerated$Inspections.testOverridingDeprecatedMember_inspectionData_Inspections_test`
2019-04-24 11:21:30 +03:00
Dmitriy Dolovov
d90b63d928 Improve logging in NativeCompilerDownloader
Issue #KT-31158 fixed
2019-04-24 14:17:16 +07:00
Dmitriy Dolovov
63f58b4a4a Add applicability condition to KotlinNativeGradleConfigurator 2019-04-24 14:17:11 +07:00
Dmitriy Dolovov
e188c313e6 Fix: Add Native KLIBs as project-level libraries
Issue #KT-30966 Fixed
2019-04-24 14:17:03 +07:00
Sergey Rostov
cfa635b36a JPS Build: update artifacts for scripting-compiler-impl and js ir backend 2019-04-24 09:45:23 +03:00
Sergey Rostov
aac564872c Scripting, main-kts: temporary workaround to avoid IDE exceptions on Kotlin project
Exclude script definition from resources classpath to avoid IDE exceptions
on kotlin project. This is done by moving MainKtsScript to new `jar-resources`
 folder which is not resource root.

#EA-127827
#KT-31176
2019-04-24 09:14:34 +03:00
Svyatoslav Kuzmich
bb3b9a935f Command line interface 2019-04-23 23:19:12 +03:00
Roman Artemev
89500d776d [IR BE] Don't use symbol table in SuspendFunctionLowering 2019-04-23 22:30:00 +03:00
Alexey Tsvetkov
bec5879e3a Fix ABI plugin
It seems that I forgot to update compiler.pro.191,
so when we switched to IJ 191, ABI plugin has broken
2019-04-23 21:56:05 +03:00
nikita.movshin
deb416484c Update copyright. Fix 2 lines comments after rebase
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:15:03 +03:00
nikita.movshin
a6230c1e2a Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 1 line comment with dates from 2000 till 2017
2019-04-23 20:09:27 +03:00
nikita.movshin
86672df107 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update TestGenerator.kt
2019-04-23 20:09:27 +03:00
nikita.movshin
abb7d3ab46 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 2 lines comment
2019-04-23 20:09:27 +03:00
nikita.movshin
a636e3d57d Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:09:23 +03:00
nikita.movshin
2e59fdc157 Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update apache.xml
2019-04-23 20:09:23 +03:00
nikita.movshin
65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Vyacheslav Gerasimov
9f3495138f Build: Use embedded configuration in kapt embeddable project
#KT-31047
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
82f9757138 Build: Fix dependency leak on :kotlin-compiler in kotlin-native-library-reader
Introduce mavenCompileScope to manage compile records in pom.xml
2019-04-23 19:32:55 +03:00
Vyacheslav Gerasimov
57cb59bfc7 Remove 181 related warnings from inspection profile 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
210ee681a4 Cleanup bunch workarounds made for 181 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
2bc11cbd58 Remove as32 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
952d2b6287 Remove 181 bunch files 2019-04-23 17:28:41 +03:00
Vyacheslav Gerasimov
e261e46e52 Remove 181 & as32 from .bunch 2019-04-23 17:28:40 +03:00
pyos
5b595b58b2 JVM_IR: fold constant string concatenations 2019-04-23 16:20:43 +02:00
Alexey Tsvetkov
1bc4a2eff9 Replace AbstractIncrementalJpsTest->AbstractIncrementalJvmJpsTest
It was accidentally replaced back when switching to IJ 191
2019-04-23 16:14:39 +03:00
Ilmir Usmanov
f94092e952 Add single 192 file for bunch not to fail 2019-04-23 15:57:51 +03:00
Jorge Antonio Díaz-Benito Soriano
3064601e5e Fix a typo
#KT-31138 Fixed
2019-04-23 13:38:19 +02:00
Steven Schäfer
8c06f7daae Fix IR declaration parents.
- Reparent declarations in FileClassLowering, InterfaceLowering,
  StaticDefaultFunctionsLowering, EnumClassLowering, and
  RenameFieldsLowering
- Set correspondingPropertySymbol in MoveCompanionObjectFieldsLowering
- Reparent field initializers in MoveCompanionObjectFieldsLowering and
  EnumClassLowering
- Ensure that parents are unique in PropertiesLowering
- Set declaration parent in SharedVariableManager
- Set field declaration parents in CallableReferenceLowering
- Set declaration parents in FunctionNVarargInvokeLowering
- Set declaration parents for external declaration fields
2019-04-23 12:51:27 +02:00
Yan Zhulanow
f39908b411 Minor: Fix configuration test, lower requirement on Kotlin plugin 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b35ed2602c Pill: Fix test dependencies handling 2019-04-23 12:38:28 +03:00
Yan Zhulanow
038c320594 Pill: Filter duplicating entries for SelfResolvingDependencies 2019-04-23 12:38:28 +03:00
Yan Zhulanow
b8aaf017ea Pill: Update module names in tasks
Pill now uses module names based on Gradle project paths.
Run configurations should be aware of the new names.
2019-04-23 12:38:28 +03:00
Mikhail Glukhikh
4a5b900d28 FIR: get rid of library type parameter symbol 2019-04-23 11:51:36 +03:00
Simon Ogorodnik
649c2f6bcc FIR deserializer: load type-parameters correctly 2019-04-23 11:51:05 +03:00
Simon Ogorodnik
853167a24d FIR deserializer: handle class type parameters properly 2019-04-23 11:41:07 +03:00
Mikhail Glukhikh
2476c0299f FIR Java: fix constructor enhancements
Before this commit,
we generated regular member functions as constructor enhancement.
Now, we generate constructors as constructor enhancement.
2019-04-23 11:41:05 +03:00
Simon Ogorodnik
2e966a7ded FIR deserializer: load type-parameters for kotlin function properly 2019-04-23 11:41:03 +03:00
Simon Ogorodnik
9bbf5bebd2 Raw FIR: support typing for delegated constructor call 2019-04-23 11:41:01 +03:00
Simon Ogorodnik
73b1676a03 Raw FIR: fix unary operators (now convention calls use receivers) 2019-04-23 11:40:32 +03:00
Mikhail Glukhikh
77e83dd8cf Raw FIR: introduce string concatenation call
This removes some 'plus' calls to be resolved
2019-04-23 11:35:41 +03:00
Simon Ogorodnik
8d2acd790d FIR Java: use safer cases in use-site scope to allow constructors 2019-04-23 11:21:46 +03:00
Mikhail Glukhikh
618295f505 FIR: implement trivial typing for break & continue 2019-04-23 11:18:24 +03:00
Mikhail Glukhikh
b9f09afc6f Raw FIR: introduce lambda argument expressions
Without it we cannot distinguish lambda argument from just last argument
2019-04-23 11:15:26 +03:00
Mikhail Glukhikh
cf72b13d84 Add accessor symbols & test for property overriding in Java 2019-04-23 11:15:24 +03:00
Simon Ogorodnik
9abf4062b1 FIR tree: implement trivial expressions typing 2019-04-23 11:14:55 +03:00
Simon Ogorodnik
c3632487d0 FIR Java: improve symbol provider laziness 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
98f4fa1f6c FIR Java: fix too strict cast in use-site scope 2019-04-23 09:49:29 +03:00
Simon Ogorodnik
539fcf82ef Fix deprecation in FIR super type resolver 2019-04-23 09:49:29 +03:00
Mikhail Glukhikh
47f61b2917 Revert "Include FIR modules into compiler #KT-30243 Fixed"
This reverts commit 053aa8ca. It causes
"IllegalArgumentException: org.gradle.*.DefaultClassLoaderScope@13fca663
must be locked before it can be used to compute a classpath!"
in Gradle integration tests
2019-04-23 09:47:18 +03:00
Ilya Kirillov
d2a3d00548 New J2K: fix existing test data 2019-04-22 22:54:48 +03:00
Ilya Kirillov
101ae75b8c New J2K: fix lost JavaMapForEachInspection in post-processing 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c4d07bd7e7 New J2K: reduce boilerplate code in post-processings for registerDiagnosticBasedProcessing's 2019-04-22 22:54:48 +03:00
Ilya Kirillov
c0ec36b3e9 New J2K: fix wrong JKTypeCastExpression children initialisation 2019-04-22 22:54:48 +03:00
Ilya Kirillov
bb81ad7b5f New J2K: do not convert Java string type to a Kotlin one because of wrong constructor calls 2019-04-22 22:54:48 +03:00
Ilya Kirillov
7e7e8f7631 New J2K: add support of lambda expressions in nullabilityAnalysis 2019-04-22 22:54:48 +03:00
Ilya Kirillov
1ffe07bb6c New J2K: fix wrong psi modification in ConvertDataClass 2019-04-22 22:54:47 +03:00
Ilya Kirillov
f11311a20b New J2K: add support of method reference conversion 2019-04-22 22:54:47 +03:00
Ilya Kirillov
8f4f80256a New J2K: do not add extra !! in ImplicitCastsConversion because it would be added later in post-processing 2019-04-22 22:54:47 +03:00
Ilya Kirillov
67770eb86b Fix "New J2K: external annotations support for nullability analysis" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
c39a54d40c Fix "New J2K: pass converter context to postprocessing" 2019-04-22 22:54:47 +03:00
Ilya Kirillov
9e1a858bed New J2K: fix exception in ConvertGettersAndSetters if function is called set 2019-04-22 22:54:47 +03:00
Ilya Kirillov
2ce7dc9d19 New J2K: external annotations support for nullability analysis 2019-04-22 22:54:47 +03:00
Ilya Kirillov
0a88276f68 Make mustNotBeNull function from JavaNullabilityChecker available for J2K 2019-04-22 22:54:47 +03:00
Ilya Kirillov
98651f3484 New J2K: add element info storage, pass info about types & functions via it 2019-04-22 22:54:47 +03:00
Ilya Kirillov
39b09b39ff New J2K: pass converter context to postprocessing 2019-04-22 22:54:46 +03:00
Ilya Kirillov
c4a238cca4 KT-26550: do not show "Convert Java File to Kotlin File" action for external libraries
#KT-26550 fixed
2019-04-22 22:54:46 +03:00
Vyacheslav Gerasimov
8723ad4f46 Switch to 191 platform 2019-04-22 21:52:19 +03:00
Sergey Rostov
21232d202e JPS Build, 191: update artifacts 2019-04-22 21:52:02 +03:00
Vyacheslav Gerasimov
1551f39daa Update asm version to 7.0.1 everywhere 2019-04-22 21:52:01 +03:00
Vyacheslav Gerasimov
aff9da72a8 Update 191 platform to 191.6707.61 2019-04-22 21:52:00 +03:00
Vyacheslav Gerasimov
67a194fa8c Remove broken 192 bunch files 2019-04-22 21:46:57 +03:00
Vyacheslav Gerasimov
6059725c76 Add 192 to .bunch 2019-04-22 21:00:10 +03:00
Svyatoslav Kuzmich
b1d303b027 Reorganize stdlib-js sources specific to the current JS backend
Move kotlin-stdlib-js project and the sources specific to the current backend to 'stdlib/js-v1' directory,
but leave sources that can be shared with the new IR backend in the common 'stdlib/js' location
with exception for 'stdlib/js/src/generated', which is used exclusively for current backend.
This simplifies sourceset configuration when building stdlib with the new backend.
2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
9dd9efd4aa [JS IR BE] Fix isQUnit for JS IR BE 2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
d7be91e8a4 [JS IR BE] Add SIZE_BYTES and SIZE_BITS to Long and Char 2019-04-22 20:30:57 +03:00
Alexander Gorshenev
3ae64061c1 Minimal tweaks in IR Validation code just to be able to turn it on in Native. 2019-04-22 19:42:33 +03:00
Mikhail Glukhikh
053aa8ca1e Include FIR modules into compiler #KT-30243 Fixed 2019-04-22 15:48:46 +03:00
Alexey Tsvetkov
77d74a261d Rename SourceFileToPathConverter->FileToPathConverter 2019-04-22 15:27:58 +03:00
Alexey Tsvetkov
f66d95545d Test JPS Kotlin caches don't change when project root is different 2019-04-22 15:27:57 +03:00
Alexey Tsvetkov
a7df7e2f9f Sort files when performing GC in lookup storage 2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
ea4fc0fb6b Disable scripting plugin in JPS tests
JVM compiler loads scripting plugin by default,
which in turn performs script template discovery
in compile classpath.

Classloading and template discovery takes noticeable
amount of time in JPS tests, because of
relatively big number of short compilations.

Disabling scripting plugin in most JPS+JVM tests
speeds up JPS tests by ~8% compared to the result before all
optimizations.
2019-04-22 15:27:56 +03:00
Alexey Tsvetkov
175dd5679c Keep application environment alive between JPS tests
This speeds up JPS tests by ~16% compared to the result before all
optimizations. The speedup comes mostly from avoiding re-reading jar
files (like kotlin-stdlib.jar).
2019-04-22 15:27:55 +03:00
Alexey Tsvetkov
80c99eceff Rebuild once after each JPS test
After each test we rebuild everything,
then we compare incremental caches and output
with caches and output after rebuild.

For some reason we did rebuild and comparison
twice per test. This seems excessive.

Removing the second rebuild speeds up JPS tests by ~15%
compared to the result before all optimizations
2019-04-22 15:27:54 +03:00
Alexey Tsvetkov
61fbe43a3f Store relative paths in JPS caches if possible
So caches can be relocated from one machine to another
2019-04-22 15:27:53 +03:00
Alexey Tsvetkov
00de7b6c44 Allow customizing source file path conversion in lookup storage 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
79337a6b96 Allow customizing source file path conversion in local IC caches 2019-04-22 15:26:34 +03:00
Alexey Tsvetkov
146eebdc7e Print lookup storage as is in tests
This way it is easier to debug when
cache's content is different after rebuild
2019-04-22 15:26:34 +03:00
Nikolay Krasko
de548d6b8b Minor: do not assert psi state in RemoveUselessIsCheckFixForWhen 2019-04-22 15:11:10 +03:00
Nikolay Krasko
b83d07ae9a Assert new quick fixes don't use resolve 2019-04-22 15:11:10 +03:00
Nikolay Krasko
682183a150 Allow resolve in write action for injection for now 2019-04-22 15:11:09 +03:00
Svyatoslav Kuzmich
889b4d721d [JS IR BE] Use constructor parameter to determine underlying type for inline classes
Inline classes from lazy IR may not have files.
2019-04-22 13:18:01 +03:00
Svyatoslav Kuzmich
3fd55673a8 [JS IR BE] Workaround for println
IR backend has a bug in decomposition of dynamic calls.
Workaround: don't use inline function call inside dynamic call argument.
2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
03ba0eae5a [JS IR BE] Minor: better internal error message in Namer 2019-04-22 13:18:00 +03:00
Svyatoslav Kuzmich
7c2ee41491 [JS IR BE] Fix boolean companion object 2019-04-22 13:18:00 +03:00
Toshiaki Kameyama
864f99782e Use property access syntax: fix problem text and highlight range
#KT-30910 Fixed
2019-04-22 16:19:37 +07:00
Toshiaki Kameyama
bf5b559923 Add function supertype: make abstract function in sealed class
#KT-30769 Fixed
2019-04-22 16:11:59 +07:00
Toshiaki Kameyama
f2c7b6b8c4 Convert to anonymous object: don't remove type arguments
#KT-30208 Fixed
2019-04-22 16:09:53 +07:00
Toshiaki Kameyama
075620daad Invert if condition intention: don't remove line breaks
#KT-30900 Fixed
2019-04-22 15:59:49 +07:00
Nikolay Krasko
a66aebdc2c Consider range marker with bad interval to be invalid (EA-141900, EA-135531) 2019-04-22 11:34:34 +03:00
Dmitry Gridin
3838976083 Fix false positive 'Remove redundant qualifier name' for property
#KT-31112 Fixed
2019-04-22 11:58:43 +07:00
Mikhail Zarechenskiy
673b54554c [NI] Also complete arguments for ambiguity calls
This is needed for IDE-tests and cases when integer literals are used
 in such ambiguity calls
2019-04-22 00:23:15 +03:00
Nikolay Krasko
088da3e807 Postpone no kotlin files in selection to CheckComponentsUsageSearch execution (KT-31092)
#KT-31092 Fixed
2019-04-19 17:12:12 +03:00
Nikolay Krasko
be471b29c4 Use bunch-specific version of gson in kotlin-gradle-plugin
While kotlin-gradle-plugin is not built for different bunches, bad
version still fails Gradle synchronize action in IDE.
2019-04-19 17:12:12 +03:00
Nikolay Krasko
04eeabcd98 Detect platform only for stdlib and use only roots for detection (KT-30442)
#KT-30442 Fixed
2019-04-19 17:12:12 +03:00
Dmitriy Novozhilov
bfb13803d5 [NI] Fix reporting of overload resolution ambiguity 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
f9cc3d9be3 [NI] Fix determining type equality in replacing of extension receiver 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
0739d13038 [NI] Record scope in trace for calls with enabled NI 2019-04-19 14:46:22 +03:00
Dmitriy Novozhilov
c86b8da982 [NI] Don't report overload ambiguity for error candidates 2019-04-19 14:46:22 +03:00
Kirill Rakhman
00c76593f2 fix typo in test data 2019-04-19 18:31:17 +07:00
Ilya Matveev
c0eba201a5 CocoaPods: Show error if a build is started not from Xcode
Issue #KT-31062 Fixed
2019-04-19 17:55:57 +07:00
Ilya Matveev
a1e20f8d2a Add tests for CocoaPods integration 2019-04-19 17:55:57 +07:00
Alexander Udalov
822b210e85 Minor, update argfile usage description 2019-04-19 12:55:23 +03:00
victor.petukhov
a567aa620b Fix headers in box and parsing spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
f6d67251fb Print info about all failed test cases in spec tests 2019-04-19 11:55:30 +03:00
victor.petukhov
86bb5d689d Add various tests for DFA testing 2019-04-19 11:55:30 +03:00
Sergey Rostov
15e3482eec JPS Build: add type-system to kotlin-reflect.jar 2019-04-19 11:51:34 +03:00
Dmitriy Novozhilov
f7b4b553b7 Minor: remove redundant import 2019-04-19 11:08:43 +03:00
Dmitriy Novozhilov
ad50bcaf09 Add extracting original value parameters and original source in IDEA Slicer
#KT-31113 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
94c4a68344 [NI] Fix determination of ArgumentMatchStatus
#KT-31081 Fixed
2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
e70bdb51c5 [NI] Automatically squash equal diagnostics in OI and NI in testdata 2019-04-19 10:53:19 +03:00
Dmitriy Novozhilov
642f8ecaf8 [NI] remove redundant replacing receiver in lambda function descriptor
#KT-30927 Fixed
#KT-31057 Fixed
2019-04-19 10:53:19 +03:00
Mikhail Zarechenskiy
2fe900d915 [NI] Resolve lambda against input types from expected type
This is needed to report more precise diagnostics and fix IDE-tests

 #KT-31059 Fixed
2019-04-19 09:08:31 +03:00
Mikhail Zarechenskiy
8f8e33f251 [NI] Strip only Exact-annotation preserving others during inference 2019-04-19 09:08:31 +03:00
Abduqodiri Qurbonzoda
3f08753f87 Move string-related files to text directory 2019-04-19 03:51:20 +03:00
Mikhael Bogdanov
dd005d3c02 Introduce IrLazyField 2019-04-18 19:56:19 +02:00
Sergey Igushkin
13120d23ce Fix Gradle task validation failure due to missing property annotation 2019-04-18 20:41:43 +03:00
Vyacheslav Gerasimov
f9d2601d92 Build: Remove kotlin-scripting-compiler-impl from kotlin-plugin.jar
It already copied to plugin lib as separate library
2019-04-18 20:05:09 +03:00
Ilmir Usmanov
eb5ea62da4 Use anonymous objects instead of lambdas as callbacks in java interop tests 2019-04-18 18:38:16 +03:00
Georgy Bronnikov
328b8f9725 Redirect EnumConstructorCall to IrFunctionAccess in IrElementTransformerVoid 2019-04-18 14:50:55 +03:00
Mikhael Bogdanov
dde28ddc52 Parallelize compiler tests 2019-04-18 13:24:58 +02:00
Mikhael Bogdanov
73836928ef Minor. Update folder suffix
Debug purpose
2019-04-18 13:24:57 +02:00
Ilya Chernikov
9900ac2462 Fix runtime compatibility with the obsolete script jvm eval config options...
also switch mainKtsTest to the mew option
2019-04-18 13:01:50 +02:00
Andrey Uskov
00c3550191 Add method 'addModuleDependencyIfNeeded' in order to keep
compatibility with AndroidStudio
#KT-31090 Fixed
2019-04-18 13:32:48 +03:00
Dmitry Gridin
9d3ebf4562 Minor: refactoring ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:33:48 +07:00
Dmitry Gridin
3bed360c98 Fix "Should be replaced with Kotlin function" warnings 2019-04-18 15:28:52 +07:00
Dmitry Gridin
d738a12b86 Fix false positive ReplaceJavaStaticMethodWithKotlinAnalog for java.io.PrintStream 2019-04-18 15:28:52 +07:00
Dmitry Gridin
fd47dc9b88 Replace popup with several quick-fixes in ReplaceJavaStaticMethodWithKotlinAnalog 2019-04-18 15:28:52 +07:00
Dmitry Gridin
ee304e92b5 Add Java Arrays.asList, Set.of, List.of to ReplaceJavaStaticMethodWithKotlinAnalogInspection
Relates to #KT-27782 #KT-21641
2019-04-18 15:28:52 +07:00
Dmitry Gridin
b5b5723ec3 Rename ReplaceJavaStaticMethodWithTopLevelFunctionInspection to ReplaceJavaStaticMethodWithKotlinAnalogInspection 2019-04-18 15:28:52 +07:00
Dmitry Gridin
23003c5d1a Add Java compare to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
7f3c4a21d5 Add Java toString to ReplaceJavaStaticMethodWithTopLevelFunctionInspection 2019-04-18 15:28:51 +07:00
Dmitry Gridin
6afc0367c0 Merge ReplaceJavaIntegerToStringWithMemberInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-12721
2019-04-18 15:28:51 +07:00
Dmitry Gridin
6b7f4dda31 Merge ReplaceArraysCopyOfWithCopyOfInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection
Relates to #KT-23023
2019-04-18 15:28:51 +07:00
Dmitry Gridin
50b89dd587 Add more cases for ReplaceJavaStaticMethodWithTopLevelFunction from java.lang.Math 2019-04-18 15:28:51 +07:00
Sergey Rostov
69120c0614 JPS build: note about updating artifacts configuration when updating bootstrap version 2019-04-18 10:36:22 +03:00
Sergey Rostov
30d1cc51bf JPS Build: update artifacts 2019-04-18 10:36:22 +03:00
pyos
b23f2a4dbb JVM_IR: set ConstantValue on static final primitive fields 2019-04-18 09:16:32 +02:00
Mikhael Bogdanov
14485c0e33 Switch default for parallel execution 2019-04-18 08:33:02 +02:00
Ilmir Usmanov
dc821a720b Fix test data 2019-04-18 01:13:01 +03:00
Ilmir Usmanov
a793055ec2 Check variables, captured by outer object when searching for suspend crossinline parameters 2019-04-18 01:12:58 +03:00
Ilmir Usmanov
7c14f4c6ae Do not duplicate $$forInline counterpart of inline capturing function 2019-04-18 01:12:56 +03:00
Ilmir Usmanov
20b9d8b2f3 Generate state-machine even if the object is going to be transformed
This fixes Java interop of inline functions, which use coroutines.
However, we cannot transform the state-machine. Thus, we generate
a $$forInline counterpart for suspend functions (similar to inline
suspend functions) and invokeSuspend$$forInline for lambdas if these
coroutines are going to transformed (i.e. are declared inside inline
functions).
During transformation we just skip method with state-machine and
transform the $$forInline counterpart. Of course, if inline site is
inline itself, we generate both state-machine version (which will be
dropped during the next transformation) and $$forInline version.
Consequently, the final version of the coroutines will not have
$$forInline counterpart.
Unfortunately, since CompileKotlinAgainstInlineKotlin tests do not allow
java sources, the tests for the interop are usual box tests.

 #KT-30707 Fixed
2019-04-18 01:12:52 +03:00
Mikhail Zarechenskiy
fe8bf98bce Fix project compilation against bootstrap compiler
Follow-up of 705a8a22, there were several usages of SAM conversions
 for Kotlin functions
2019-04-17 23:11:05 +03:00
Ilya Chernikov
ada3edb222 Fix after rebase - adapting to the new idea plugin handling scheme 2019-04-17 22:03:59 +02:00
Ilya Chernikov
4b4186ecb2 Switch to coroutines 1.1.1 2019-04-17 22:03:59 +02:00
Ilya Chernikov
7c4efb2772 Disable ScriptingGradleSubplugin if applied in the gradle prior to 5.0
Allows to avoid limiting scripting infrastructure to languageVersion 1.2,
since kotlin compiler 1.3+ is bundled with gradle only starting from 5.0
2019-04-17 22:03:59 +02:00
Ilya Chernikov
72736d78e4 Drop blocking transitive dependencies following for gradle subplugins
fixes scripting subplugin usage, since it requires some dependencies now
2019-04-17 22:03:59 +02:00
Ilya Chernikov
f688bc5140 Add diagnostics for plugin classpath problems 2019-04-17 22:03:59 +02:00
Ilya Chernikov
8a8de052a3 Fix JSR-223 and scripting samples dependencies 2019-04-17 22:03:59 +02:00
Ilya Chernikov
60b3fa3b07 Fix embeddable host test 2019-04-17 22:03:58 +02:00
Ilya Chernikov
090dadce3e Fix testdata - script extension hint is not generated anymore...
due to changes in the scripting initialization logic
2019-04-17 22:03:58 +02:00
Ilya Chernikov
64c3bcd9ab Drop refactored-out frontend.script module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
a65dafc37d Move scripting support classes to the scripting compiler impl module 2019-04-17 22:03:58 +02:00
Ilya Chernikov
8df829a7cd Move scripting-compiler-impl definition to another package...
to continue merging with the refactoring with further scripting improvements
2019-04-17 22:03:58 +02:00
Ilya Chernikov
f71cc4e480 Drop long deprecated legacy script annotations and resolvers support 2019-04-17 22:03:58 +02:00
Ilya Chernikov
4f135a5fe5 Move REPL implementations to the scripting compiler impl module 2019-04-17 22:03:57 +02:00
Ilya Chernikov
199b32cad7 Merge scripting-impl to scripting-compiler-impl module...
to continue merging with the branch with further scripting refactorings
2019-04-17 22:03:57 +02:00
Ilya Chernikov
a82b386d81 Add a new module for scripting compilation infrastructure...
add embeddable variant as well
2019-04-17 22:03:57 +02:00
Ilya Chernikov
4625468de7 Expose project environment from core env, to allow usages of plugins...
before core env construction. Refactor script evaluation extension to
this scheme.
Plus some refactorings of the logic of script/repl evaluation in K2JVMCompiler
2019-04-17 22:03:57 +02:00
Igor Yakovlev
1178e94f50 Fixed intentions that used not valid PSI
Fixed ConvertToMemberIntention and ObjectLiteralToLambdaIntention that are used PSI after lazy block reparse.
2019-04-17 20:26:23 +03:00
Igor Yakovlev
1f29b42cd3 KtBlockExpression as lazy reparseable node (KT-13841)
Changed KtBlockExpression to support LazyReparseable behaviour
Added LazyKtBlockExpressionTest
Added new BlockWrapper delegations
2019-04-17 20:26:15 +03:00
Kirill Shmakov
e774f3fe77 Update iOS template for XCode 10.2
Info.plist generated by default does not provide required bundle id key.
Added separated Info.plist and its usage is explicitly specified.

See KOTLIN-CR-2913.
2019-04-17 18:54:45 +03:00
Mikhael Bogdanov
b70ff30dc3 Don't generate bridge flag for defaults in JVM IR backend 2019-04-17 14:53:30 +02:00
pyos
115b1c6b6e JVM_IR: force materialization of non-transparent block results 2019-04-17 14:14:21 +02:00
pyos
b1bba70e40 JVM_IR: elide static field initialization to default values 2019-04-17 14:14:21 +02:00
Mikhail Zarechenskiy
bcc8802014 [NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later.

 Theoretically, this is not very good, but it aligns with the old
 inference, plus it helps avoiding multiple type mismatch diagnostics.
2019-04-17 12:55:12 +03:00
Mikhael Bogdanov
5dea14f4ce Reuse already created temp folder from UsefulTestCase 2019-04-17 11:22:19 +02:00
Mikhael Bogdanov
0d3f03a15a Support parallelization in another IDE tests 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
18f76c31ca Get rid of redundant UsefulTestCase 2019-04-17 11:22:18 +02:00
Mikhael Bogdanov
854b73b03c Specify test runners for IDE tests 2019-04-17 11:22:17 +02:00
Mikhael Bogdanov
aaf0fbdbd6 Fix debugger tests 2019-04-17 11:22:16 +02:00
Mikhael Bogdanov
51bc979edb Move parallelization utils to separate file, set test root for each process 2019-04-17 11:22:16 +02:00
Anton Bannykh
c6d177b467 JS: don't remove imports only used for fake overrides (KT-31007 fixed) 2019-04-17 11:41:47 +03:00
Anton Yalyshev
6113e66e7a removed forgotten and unnecessary code 2019-04-17 10:56:08 +03:00
Anton Yalyshev
f79517ee5d use new js gradle plugin and correct name of mpp plugin 2019-04-17 10:56:06 +03:00
Mikhael Bogdanov
3f1f335c47 Minor. Fix compilation 2019-04-17 09:50:49 +02:00
Mikhael Bogdanov
01dc66b53a Temporary workaround: use teamcity.build.tempDir instead of java.io.tmpdir
teamcity.build.tempDir is cleaned up between build executions,
 should be fixed soon on Teamcity side
2019-04-17 09:33:58 +02:00
Mikhail Zarechenskiy
e6e0b83184 [NI] Fix IDE-tests where integer types were used in unresolved calls
For example, test like CallExpression#testCallWithJavaClassReceiver

 #KT-31060 Fixed
2019-04-17 01:40:56 +03:00
Mikhail Zarechenskiy
705a8a2234 [NI] Disable SAM-conversions for Kotlin functions by default
#KT-30661 Fixed
2019-04-17 01:40:54 +03:00
Andrey Uskov
c6f29cbf38 Disable GradleInspectionTests in AndroidStudio 2019-04-17 00:17:41 +03:00
Andrey Uskov
364274ef90 Fix setting production-on-test flags in MPP projects
#KT-29854 Fixed
2019-04-17 00:17:21 +03:00
Leonid Startsev
1a0b7902c2 Create separate type arguments for writeSelf function, since it is static now.
Fixes kapt issue https://github.com/Kotlin/kotlinx.serialization/issues/429
2019-04-16 19:37:31 +03:00
Sergey Igushkin
bd1f95da04 Disable automatic JVM target 1.8 detection in Android projects, KT-31027
This is a soft revert of the fix for KT-21030 (commit ffbd0e8a).
The logic introduced for KT-21030 should now only run when a property
flag is provided, kotlin.setJvmTargetFromAndroidCompileOptions.

We can't set the JVM target to 1.8 automatically until an Android Gradle
plugin version appears that can correctly desugar the bytecode produced
by the Kotlin compiler.

So we disable the logic introduced in the fix for KT-26432
with the plan to enable it back and apply it conditionally once there is
an Android Gradle plugin version that processes the calls correctly.

Issue #KT-31027 Fixed
2019-04-16 19:02:44 +03:00
Mikhael Bogdanov
bec80dd27f Use Teamcity tmpdir to cleanUp it between executions 2019-04-16 15:37:07 +02:00
gcx11
164933a31e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
gcx11
b49c5bf74e KT-22807: allow asynchronous testing in Kotlin/JS with QUnit 2019-04-16 14:17:22 +03:00
Ilya Chernikov
d98b1dfa7e Fix testdata after adding main function to scripts 2019-04-16 11:55:24 +02:00
Ilya Chernikov
67ad3773de Implement main method generation in scripts and runnable jar saving
refactor necessary parts on the way
2019-04-16 11:55:23 +02:00
Ilya Chernikov
c896b4873b Rearrange scripting host classes, so the runner part is independent from the compiler 2019-04-16 11:55:23 +02:00
Ilya Chernikov
a6f0bd6677 Refactor jvm evaluation to make module operations cleaner and more robust
in addition:
- hide internal configuration keys
- add keys for flags controlling evaluation
- add initial module implementation for using scripts from a classpath
2019-04-16 11:55:22 +02:00
Ilya Chernikov
90444502a6 Extend evaluation API for easier passing of evaluation configuration
refactor helpers accordingly
2019-04-16 11:55:22 +02:00
Ilya Chernikov
fa58b41e43 Implement script evaluation configuration refinement 2019-04-16 11:55:21 +02:00
Ilya Chernikov
c51d4a4405 Implement simple "saving evaluators" to classes and to a jar 2019-04-16 11:55:20 +02:00
Mads Ager
a65f50bb00 JVM_IR: Generate java 8 parameter names when -java-parameters is passed.
The type mapper does not map enum parameters and outer this parameters
to the right parameter signature kinds so around half the tests
are still failing. Since a new type mapper is being worked
on I will not investigate that further right now.
2019-04-16 09:32:57 +02:00
Mikhail Zarechenskiy
e27f71c6f3 [NI] Add test for obsolete issue
#KT-30858 Obsolete
2019-04-16 10:32:12 +03:00
Mark Punzalan
9f4db04839 Change visibility of ForLoopsLowering from internal to public. 2019-04-16 09:31:40 +02:00
Vyacheslav Gerasimov
152d5a98e8 Build: Remove duplicate sam-with-receiver-compiler-plugin in libraries 2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
f052f31c83 Build: Put gradle tooling model in kotlin plugin as separate jars
Those jars are loaded by gradle during import process
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
d6e2b5066b Build: Use sync task for copying idea plugin to the output
It will prevent files from previous builds remain in the target directory
Now we can remove `cleanArtifacts` kostyl from teamcity build
2019-04-15 22:04:17 +03:00
Vyacheslav Gerasimov
478208b070 Build: remove ideaPlugin helper
Plugin distribution building logic is now handled solely by idea-plugin project
2019-04-15 22:04:17 +03:00
Yan Zhulanow
7710942ec5 Kapt: Call next resolver in populateModuleExtraModels() (KT-30995) 2019-04-15 20:11:29 +03:00
Nikolay Krasko
27fd64ed42 Enable registration of CIDR bundle to prevent test failure in AS 3.5 (KT-26337) 2019-04-15 14:46:40 +03:00
Nikolay Krasko
1da51c118e Minor: fix too long strings 2019-04-15 14:46:40 +03:00
Nikolay Krasko
4691f6fed5 Don't read attributes in invalid files (EA-141259) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
a3bd46858a Additional diagnostic added for bad class assert 2019-04-15 14:46:39 +03:00
Nikolay Krasko
28aa404356 Don't create intention for some bad psi (EA-141235) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
bc258fa856 Fix RemoveUselessIsCheckFixForWhen - don't assert psi state in quick fixes (EA-141206) 2019-04-15 14:46:39 +03:00
Nikolay Krasko
55b2a7d051 Fix NPE in surround (EA-141193) 2019-04-15 14:46:39 +03:00
Ryan
916f871fd1 Wrong File name 'KotlinNativeTaretConfigurator.kt' 2019-04-15 17:40:15 +07:00
Nikolay Kasyanov
7d2041ed82 Fix fat dSYM Info.plist copying
Issue #KT-31008 Fixed
2019-04-15 17:34:32 +07:00
Yan Zhulanow
5825da8433 Fix binary compatibility with Android plugin (KT-30978) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
0dfe122a40 Pill: Mark more projects as 'jps-compatible' in FULL variant 2019-04-15 05:17:03 +03:00
Yan Zhulanow
ae747196c2 Pill: Add kotlinVersion to the default JUnit configuration (for Gradle integration tests) 2019-04-15 05:17:03 +03:00
Yan Zhulanow
d5fa4f983e Pill: Resolve dependencies using ResolvedArtifact data 2019-04-15 05:17:03 +03:00
Svyatoslav Kuzmich
977d3ef840 [JS IR BE] New name generator 2019-04-13 14:19:36 +03:00
Svyatoslav Kuzmich
a16ca5e66c [JS IR BE] Static members lowering pass 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
38fc4b0c59 [JS IR BE] Hack irRuntime js function usage to compensate for implementation shortcomings 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
5c5d65bdb9 [JS IR BE] Lower dataClass hashCode and toString 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
e52ae38cf5 [JS IR BE] Minor: Use proper trow in js compiler test runtime 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
ce1ae417c2 [JS IR BE] Minor: don't use descriptors 2019-04-13 14:17:59 +03:00
Svyatoslav Kuzmich
7a6e245dba [JS] Minor: Use file path to V8 runner to show better error messages 2019-04-13 14:17:58 +03:00
Mikhail Zarechenskiy
1bc078769b Regenerate tests 2019-04-12 18:17:48 +03:00
Dmitriy Novozhilov
18f9272f56 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-12 17:36:59 +03:00
Dmitriy Novozhilov
ece3a0fe90 Minor: fix smartcast on var in IrUtils.kt 2019-04-12 17:36:59 +03:00
Roman Artemev
01878fe4b5 [JS IR BE] Remove unused lowering
* its functionality is merged into `FunctionInliner`
2019-04-12 15:23:28 +03:00
Roman Artemev
ece33f00a2 [IR] SuspendFunctionLowering refactoring
* distinguish common part which generates successor of `CoroutineImpl`
   into separate common lowering
 * merge it with K/N
2019-04-12 15:23:28 +03:00
Roman Artemev
bcc8f3e073 [IR] Move Ir utils from Kotlin/Native 2019-04-12 15:23:28 +03:00
Roman Artemev
cf9cce8a9b [JS IR BE] Fix type arguments stuff in Secondary Constructor lowering 2019-04-12 15:23:28 +03:00
Roman Artemev
e3699fbc31 [IR] CommonBackendContext and Symbols refactoring
* add [suspend]functionN factory factions
 * add `getContinuation` property
 * add `internalPackageName` property
 * fix lowerings
2019-04-12 15:23:28 +03:00
Mikhail Zarechenskiy
bdab7a88f6 [NI] Add test for obsolete issue
#KT-28658 Obsolete
2019-04-12 15:22:39 +03:00
Mikhael Bogdanov
d5cd49b2bf Don't delete Idea temporary folder on JVM shutdown
Before parallelization we don't delete Idea folders after test execution.
  Now there is problem with failing test on Teamcity.
  So try to keep folder undeleted (maybe there is some working daemon)
2019-04-12 14:13:53 +02:00
Ivan Gavrilovic
33e7a23208 Fix style in classpath snapshot class
Use filterTo instead of filter followed by forEach.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c28ad116d0 Convert Windows-style path when calculating class internal name 2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
955a27ec77 Use MD5 when caching class ABI structure
This avoids Kotlin Gradle plugin dependency
on Guava, and it is a good hash function for this
use-case.

Also fix some formatting.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
e171199bf5 Do not track defined constants in source files
There is no need to track definitions of constants in sources for now.
References to constants are tracked in order to capture dependencies between types.
This ensures that any change to a type defining a constant (either from the
classpath or sources), will trigger reprocessing of the type that uses the
constant.
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
929fca03fd Fixes to KAPT classpath change detection
1) Fix tests to use canonical path for comparison because Mac was failing
2) Update current classpath snapshot only with the missing entries from the previous one
3) Clean-up code and style
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
7c78644eb9 Incremental KAPT - analyze classpath changes
Use artifact transforms to capture structure and
dependencies of classpath entries. In the KAPT task
this information is used to compare previous classpath
structure with the current one. Once changed classes are
detected, all classes that transitively depend on those
are identified, and that set is passed to KAPT invocation.

In order to avoid unrelated classpath changes, we record an
ABI snapshot of the classpath entry. This snapshot ignores
all private members, and @Metadata annotation.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
c85e21d43b Incremental KAPT - pass changed classpath entries
Pass computed list of changed classpath names to KAPT instead
of relying on the history files to be computed by stub generation.
Also, stop generating classpath history changes during the stub generation.

This commit does not compute the actual changed classpath entries,
and that will be done in the following commits.

 #KT-23880
2019-04-12 15:01:47 +03:00
Ivan Gavrilovic
0c09f56118 Incremental KAPT - track constants usage
This commit adds support for tracking of used constants in
source files. For every constant used in a source file, class
that defines the constant and the constant name are tracked.

Value of the constant can be obtained using
annotation processing APIs, so if the constant value changes, a source file
using it has to be reprocessed.

 #KT-23880
2019-04-12 15:01:47 +03:00
pyos
57dca2ada5 JVM_IR: generate exception specifications 2019-04-12 13:00:54 +02:00
Ilya Matveev
f43579e9fc Update Kotlin/Native: 1.3-dev-9457 2019-04-12 17:53:34 +07:00
pyos
c7d7d903cd Add the IR version of CompileJavaAgainstKotlin tests
Only the WithoutJavac version for now, because the other one ignores
javac errors.
2019-04-12 12:43:37 +02:00
Dmitry Petrov
8a95da4a95 Minor: reformat DeepCopyIrTreeWithDescriptors.kt 2019-04-12 12:13:21 +03:00
Dmitry Petrov
bf2ab99b61 IR: IrSimpleTypeBuilder 2019-04-12 12:13:21 +03:00
Natalia Selezneva
2844d48f9f Refactoring: remove unused class 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0da6d48d5e Minor: fix toString in KotlinSourceFilterScope 2019-04-12 11:42:56 +03:00
Natalia Selezneva
0c2e9f4d9a Scratch: prohobit closing scratch output content (KT-29642)
^KT-29642 Fixed
2019-04-12 11:42:56 +03:00
Natalia Selezneva
3eda40394a Impossible to run applications with long command lines on windows
^KT-29352 Fixed
2019-04-12 11:42:50 +03:00
Natalia Selezneva
dfa5f1f090 Refactoring: extract common parts for create command line for repl and scratch 2019-04-12 11:33:32 +03:00
Ting-Yuan Huang
0dd09ea7de JVM_IR: Lower IrGetEnumValue to this whenever possible.
The reference can be lowered to `this` if it is captured in the lexical
scope of the corresponding enum entry, and not used by the enum entry's
super constructor. Otherwise, it is lowered to
`GETFIELD SomeEnum.SomeEntry`.
2019-04-12 08:58:43 +02:00
Toshiaki Kameyama
faa6eacb25 Add "Replace Java static method with Kotlin top-level function" inspection
#KT-27411 Fixed
2019-04-12 11:35:46 +07:00
Rene Groeschke
6bef27e1e8 Forward stdout and stderr logger of out of process compiler through gradle logging
Issue #KT-30596 Fixed
2019-04-11 20:36:53 +03:00
Dereck Bridie
d86ffd3f34 Add inspection "Map replaceable with EnumMap" #KT-25439 Fixed 2019-04-11 19:01:02 +03:00
Toshiaki Kameyama
607325c6e5 Add "Round using roundToInt/roundToLong" quick fix
#KT-30389 Fixed
2019-04-11 18:58:05 +03:00
Burak Eregar
1455451601 Fix "Replace !! with if-then" inspection in receiver position
#KT-5412 Fixed
2019-04-11 18:58:05 +03:00
Jan Gerling
162de77b71 Add inspection to detect boxes *Range.start & endInclusive
These properties can be replaced with equivalent collections first & last.
#KT-15537 Fixed
2019-04-11 18:58:04 +03:00
Toshiaki Kameyama
401d8c2d70 Add braces: don't move EOL comment when if statement is single statement
#KT-28619 Fixed
2019-04-11 18:58:04 +03:00
Dmitriy Novozhilov
a92cf19641 Revert "[NI] Fix reporting smartcast diagnostics for intersection types"
This reverts commit 033d7262

That commit breaks bootstraping
2019-04-11 18:49:02 +03:00
Toshiaki Kameyama
849d18669b Replace assert boolean with assert equality: do not report when arguments type are not subtype
#KT-30761 Fixed
2019-04-11 18:36:50 +03:00
Toshiaki Kameyama
93d854362b Convert to anonymous function: do not name argument when lambda is Java method
#KT-30613 Fixed
2019-04-11 18:34:24 +03:00
Dmitriy Novozhilov
033d7262a2 [NI] Fix reporting smartcast diagnostics for intersection types
#KT-30826 Fixed
2019-04-11 18:10:59 +03:00
Toshiaki Kameyama
47b1ea7fa4 SimplifiableCallChainInspection: replace .sorted().first() with .min()
#KT-30725 Fixed
2019-04-11 18:07:06 +03:00
Toshiaki Kameyama
e4b10a156e SimplifiableCallChainInspection: fix tests 2019-04-11 18:07:06 +03:00
Alexander Gorshenev
ce6cda631d IrDelegatedProperty and IrDelegatedPropertyReference were missing from the serialization 2019-04-11 17:50:53 +03:00
Yan Zhulanow
e07821ca75 Debugger: Assume a class name from the coroutine metadata may be invalid (KT-30934) 2019-04-11 17:46:21 +03:00
Georgios Andrianakis
f11c5a335a KT-30343 Add new Quarkus preset to all-open compiler plugin 2019-04-11 17:46:21 +03:00
Yan Zhulanow
7ecd88aae3 AllOpen: Allow to specify presets in the Gradle plugin 2019-04-11 17:46:20 +03:00
Ting-Yuan Huang
4f64a52d33 Kapt: Fix NPE on JDK 10-11 (KT-26203)
Gradle worker throws NPE when the parameter to the runnable is null.
This patch works that around by passing URL spec as String instead of
File?
2019-04-11 17:46:19 +03:00
Yan Zhulanow
2314ca7a94 Debugger: Fix evaluation of lambda arguments (KT-10636) 2019-04-11 17:46:19 +03:00
Yan Zhulanow
fa5705cc68 Debugger: Fix missing read action in error reporting 2019-04-11 17:46:18 +03:00
Yan Zhulanow
4f6c8d2323 Fix type renderers for Kotlin (KT-18263, KT-18247) 2019-04-11 17:46:18 +03:00
Yan Zhulanow
15db1c8a8f Debugger: Do not validate line breakpoints for irrelevant classes (KT-30714) 2019-04-11 17:46:17 +03:00
Yan Zhulanow
2c5e8dab23 Debugger: Do not require a SourcePosition to exist 2019-04-11 17:46:16 +03:00
Yan Zhulanow
81a7f73db5 Refactoring: Inline getInvokePolicy() 2019-04-11 17:46:16 +03:00
Yan Zhulanow
b26f746514 Minor: Rename KotlinEvaluatorBuilder to match the superclass name 2019-04-11 17:46:15 +03:00
Yan Zhulanow
e31f195716 Minor: Remove unnecessary '!!' 2019-04-11 17:46:15 +03:00
Yan Zhulanow
fb3efd2d78 Debugger: Fix completion for synthetic '_field' extension properties (KT-23586) 2019-04-11 17:46:14 +03:00
Yan Zhulanow
0d04dc6f99 Debugger: Allow to touch experimental stuff from evaluator (KT-30216) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
b7ea4ccc7e Debugger: Hide call-site 'this' in inline functions in Kotlin variables mode (KT-30610) 2019-04-11 17:46:13 +03:00
Yan Zhulanow
6dcaa64793 Pill: Fix platform source file location 2019-04-11 17:46:12 +03:00
Yan Zhulanow
9e99bca322 Pill: Fix artifact generation 2019-04-11 17:46:12 +03:00
Mikhael Bogdanov
5b49043939 Delete KotlinTestUtils.java.as32 and KtParsingTestCase.java.as32 2019-04-11 13:26:06 +02:00
Caleb Brinkman
c84c33cbd6 KT-30816 BasicJvmScriptEvaluator incorrect arg order
https://youtrack.jetbrains.com/issue/KT-30816

Change BasicJvmScriptEvaluator to pass constructor parameters in the
correct order, include tests for scripts w/ provided properties, and
implicit receiver, and both.
2019-04-11 10:17:55 +00:00
Dmitry Gridin
31ce6e1800 Minor: remove redundant qualifier names in QuickFixRegistrar 2019-04-11 15:13:17 +07:00
Dmitry Gridin
86a3daa302 Fix "Remove redundant qualifier name" for KtUserType with type parameter
#KT-30916 Fixed
2019-04-11 15:13:17 +07:00
Dmitry Gridin
f3faae7bb4 Fix 'Redundant qualifier name' warnings & refactoring in idea 2019-04-11 15:13:17 +07:00
Dmitry Gridin
646f325f57 Fix false positive "Redundant qualifier name" for functions with a receiver
#KT-30879 Fixed
2019-04-11 15:13:17 +07:00
Mark Punzalan
1b703448d3 Handle reversed() in ForLoopsLowering.
We get the info for the underlying progression and invert it. For
progressions whose last bound was open (e.g., `until` loop), the
reversed version will have an open first bound and so the induction
variable must be incremented first.

Also unified the way of extracting HeaderInfo out of changed calls
(e.g., `indices.reversed()`), and fixed declaration parents in
ForLoopsLowering.
2019-04-11 08:54:55 +02:00
Mikhael Bogdanov
3d1b6fb83c Minor. Fix AS32 compilation 2019-04-10 21:16:42 +02:00
pyos
b24690b35b Remove a redundant field 2019-04-10 20:51:46 +02:00
pyos
73bd683af1 Store InstructionAdapter, not ExpressionCodegen, in PromisedValue 2019-04-10 20:51:46 +02:00
pyos
96e2eb6fa1 Move PromisedValue to a separate file 2019-04-10 20:51:46 +02:00
pyos
e249c3c594 Return a stripped version of StackValue from ExpressionCodegen 2019-04-10 20:51:46 +02:00
pyos
c5f6be4282 Remove import of StackValue.* to better see use sites 2019-04-10 20:51:46 +02:00
pyos
a9bece9baa Allow intrinsics to be partial
Also, add an overridable invoke() method that skips the Callable step.
2019-04-10 20:51:46 +02:00
pyos
6e44b22340 Remove an unused non-IR IntrinsicMethod.toCallable 2019-04-10 20:51:46 +02:00
pyos
31eb542476 Return an immaterial value from Boolean.not 2019-04-10 20:51:46 +02:00
pyos
31c7183781 Return immaterial values from comparison intrinsics 2019-04-10 20:51:46 +02:00
pyos
9aff1cefb4 Make materialization of StackValues explicit 2019-04-10 20:51:46 +02:00
pyos
2356f72fd4 Make ExpressionCodegen a bit shorter in general 2019-04-10 20:51:46 +02:00
pyos
89cb31c387 Refactor try-catch covering computation 2019-04-10 20:51:46 +02:00
Mads Ager
a8e2893494 JVM_IR: Output EnclosingMethod attribute.
This works in many cases, however, it is incomplete since there
are cases where classes are extracted to top-level and therefore
reparented. Therefore, we lose the information about the function
class are nested inside.
2019-04-10 20:50:03 +02:00
Ilya Kirillov
8a94c66ce7 KT-29568, KT-26550: show "Convert Java File to Kotlin File" only for Java files
#KT-29568 fixed
#KT-26550 fixed
2019-04-10 21:29:18 +03:00
Ilya Kirillov
c7e08f9e5d New J2K: Fix existing test data 2019-04-10 21:29:18 +03:00
Ilya Kirillov
ae3920d535 New J2K: Finish DefaultArgumentsConversion 2019-04-10 21:29:18 +03:00
Ilya Kirillov
008e7a5add New J2K: do not use some keyword removing processings due to incorrect formatting after it 2019-04-10 21:29:18 +03:00
Ilya Kirillov
54d6fc846b New J2K: Add file range support for nullability analysis 2019-04-10 21:29:18 +03:00
Ilya Kirillov
33a42733f5 New J2K: make function parameters which is used as spread value argument to be not null 2019-04-10 21:29:18 +03:00
Ilya Kirillov
4844df2c6a New J2K: calculate for loop variable nullability 2019-04-10 21:29:18 +03:00
Ilya Kirillov
bd53772f5c New J2K: Fix explicit NPE cases in conversions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
4c58016fa4 New J2K: remove SuppressWarnings annotation 2019-04-10 21:29:17 +03:00
Ilya Kirillov
ecf1ab7f04 New J2K: convert internal visibility to public one for annotation class members 2019-04-10 21:29:17 +03:00
Ilya Kirillov
f0b7f1e30b New J2K: Fix type parameters for array creation expressions 2019-04-10 21:29:17 +03:00
Ilya Kirillov
cb1b597b51 New J2K: save comments in data classed conversion 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d4f6558e8a New J2K: Split convert file method in converters 2019-04-10 21:29:17 +03:00
Ilya Kirillov
af17db5f45 New J2K: handle more types of nullability annotations 2019-04-10 21:29:17 +03:00
Ilya Kirillov
d20e4bac1d New J2K: always print fully qualified names in printer to avoid name conflicts 2019-04-10 21:29:16 +03:00
Ilya Kirillov
aa53489e0b New J2K: Handle forced nullability correctly in nullability analysis 2019-04-10 21:29:16 +03:00
Ilya Kirillov
7d5793184f New J2K: Do not throw away incorrect code in switch statements 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a98382a3cb New J2K: Fix wrong fqName for jvm annotations 2019-04-10 21:29:16 +03:00
Ilya Kirillov
e181c7f097 New J2K: save comments for annotation parameters 2019-04-10 21:29:16 +03:00
Ilya Kirillov
b430cfa953 New J2K: fix priority in PolyadicExpressionConversion 2019-04-10 21:29:16 +03:00
Ilya Kirillov
99d4accf2c New J2K: fix IDEA exceptions in post-processings 2019-04-10 21:29:16 +03:00
Ilya Kirillov
a5d64bf0b1 New J2K: Resolve symbols in correctly 2019-04-10 21:29:15 +03:00
Mikhael Bogdanov
d806320383 Rename tmpDirForReusableLibrary -> tmpDirForReusableFolder 2019-04-10 20:03:09 +02:00
Mikhael Bogdanov
8287e448d1 Support parallel execution of IDEA tests 2019-04-10 20:03:08 +02:00
pyos
8ae9e7a106 JVM_IR: unwrap fake overrides when computing property signatures 2019-04-10 19:21:37 +02:00
Vyacheslav Gerasimov
1b68b1d599 Build: embed jps artifact kotlin-plugin.jar into ideaPlugin 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
f71c2bf25e Build: Drop unused fromEmbeddedComponents helper 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
b741d393ed Build: make fatJar in JPS recursively using embedded configuration 2019-04-10 17:54:07 +03:00
Vyacheslav Gerasimov
adb896d74c Build: Introduce embedded configuration used for fatJars 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
a0adc97768 Build: Embed nj2k into kotlin-plugin.jar 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
da7a4a6d58 Build: Exclude trove4j from plugin since Idea already has it 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
c492c0c9f9 Build: Generate JPS artifacts for idea plugin from gradle configurations 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
92248d609f Build: Centralize build logic for kotlin-plugin in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
384f407af6 Minor: rename sideJars -> libraries 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
01aaaae5d0 Build: Pack markdown with dependencies (if any) to the ide plugin
Right now it doesn't have any dependencies
2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
909c6eef57 Build: Remove unnecessary stdlib dependencies in :prepare:idea-plugin 2019-04-10 17:54:06 +03:00
Vyacheslav Gerasimov
b68aee5ff8 Build: Fix missing coroutines-common in ide plugin
We shouldn't omit library dependencies while copying libraries to plugin
2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
f4472fd68a Build: Depend on :prepare:idea-plugin via configuration in ultimate 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
d554b5aafa Build: Embed projects not published to maven into kotlin-plugin.jar 2019-04-10 17:54:05 +03:00
Vyacheslav Gerasimov
4ff1506161 Build: Use project dependency via configuration to build kotlin-plugin
Using configuration allows us to embed fat jars
Removed unnecessary shadowJar task, unnecessary unless relocation is required
2019-04-10 17:54:05 +03:00
victor.petukhov
3ba48f219c Remove debug code in the test for CheckerTestUtil class 2019-04-10 17:10:56 +03:00
Alexander Udalov
121f30d9cc Use IrType instead of KotlinType in SingleAbstractMethodLowering 2019-04-10 14:42:40 +03:00
Alexander Udalov
d257285c86 Load Java enums as final classes
In case Java enum has an abstract member, it has the ACC_ABSTRACT flag
set in the bytecode. However, we should still load it with final
modality to be consistent with Kotlin enums which are always considered
final

 #KT-23426 Fixed
2019-04-10 14:39:16 +03:00
Alexander Udalov
2f003ef545 Generate classes in MultifileClassCodegen exactly the same as in PackageCodegen
Two known issues with generateNonPartClassDeclarations that was here
before were the fact that we didn't sort sealed classes and its
subclasses which led to NoSuchMethodError (KT-27097), and the fact that
we didn't skip expect classes which led to incorrect duplicate JVM class
name diagnostic (KT-30843)

 #KT-27097 Fixed
 #KT-30843 Fixed
2019-04-10 14:39:16 +03:00
Alexey Tsvetkov
c8c630cecb Filter significant elements before creating ListRange
EA-134385
  EA-138187
2019-04-10 14:38:11 +03:00
Mikhail Glukhikh
568e831651 FIR: make rendering of type parameters similar to original Kotlin 2019-04-10 13:31:02 +03:00
Mikhail Glukhikh
0c334163ab FIR: add class type parameters to constructors & change their rendering 2019-04-10 13:31:01 +03:00
Toshiaki Kameyama
55a5ccac5c SimplifyAssertNotNullInspection: change level to INFORMATION
#KT-30876 Fixed
2019-04-10 16:06:37 +07:00
Georgy Bronnikov
43e87a1635 Merge pull request #2256 from pyos/flatten-phases
Flatten phase compositions
2019-04-10 10:43:14 +03:00
Dmitriy Dolovov
7beb49271f Fix: Navigation to inheritor class in non-JVM library source leads to opening stub
Issue #KT-30821 Fixed
2019-04-10 11:17:27 +07:00
Juan Chen
f489a47025 Fix SAM_WITH_RECEIVER_PLUGIN_NAME.
SAM_WITH_RECEIVER_PLUGIN_NAME in PathUtil was accidentally broken by
4c751cdd52 (diff-819dacd07c45ba85ba5459d8a09418daR34)
2019-04-09 15:19:00 +00:00
Ilmir Usmanov
00e952ab15 Introduce CHECK_TAIL_CALL_OPTIMIZATION directive
This directive generates TailCallOptimizationChecker in package helpers.
The check for tail call optimization is based on coroutine stack traces
bug (feature?): when tail call optimization hits, the continuation
object is not generated. Thus, there is no debug metadata for this
suspend function. Consequently, the coroutines stack trace does not
contain stack trace element for that function.
This check is performed by TailCallOptimizationChecker.

Since this is runtime check, unlike bytecode tests, it does not require
test data adjustments on each codegen or inliner change.

Since the check is based on debug metadata, which is JVM specific, there
is not support for other backends yet.
2019-04-09 18:01:21 +03:00
Mikhail Glukhikh
40441a18cc FIR2IR tests: do not try to dump & check external dependencies
(because both wrapped descriptors and FIR-based package descriptors
have no member scopes and aren't able to find class across module deps)
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
485035952a IR text tests: fix regex detection (like DUMP_EXTERNAL_CLASS)
Before this commit, DUMP_EXTERNAL_CLASS etc. didn't work on Windows
2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
61ae365cfd IR text tests: remove some may-be-unnecessary dumps 2019-04-09 15:36:18 +03:00
Mikhail Glukhikh
02bdc826d5 IR text tests: throw an error when test fails to build an external dump 2019-04-09 15:36:16 +03:00
Vyacheslav Gerasimov
2937cb7237 Build: Fix Android Studio 3.5 unpacking, now published as tar.gz 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
83764c113f as35: Upgrade to AS 3.5 C10 2019-04-09 15:06:22 +03:00
Vyacheslav Gerasimov
8c9e1006f2 as35: Derive as35 bunch from 191 2019-04-09 15:06:22 +03:00
Steven Schäfer
26aeddf6d9 Remove broken KotlinType.toIrType function
The KotlinType.toIrType function sometimes produces unbound symbols
and was only used in IrIntrinsicFunction and SharedVariablesManager.

This change removes the broken function and changes SharedVariableManager
to use IrType consistently and IrIntrinsicFunction to use KotlinType
consistently.
2019-04-09 13:46:02 +02:00
pyos
048fd9fa25 Create a single instance of IrIntrinsicMethods per context.
This improves JVM_IR compilation times by 2%.
2019-04-09 11:56:58 +02:00
Dmitry Gridin
fceb5ee245 Fix AutoImport for import with alias
#KT-30663 Fixed
2019-04-09 16:34:26 +07:00
Andrey Uskov
a6ae1f2ba6 Fix import of compiler arguments in IDEA if source set dependencies
could not be resolved (e.g. due to misspelling in artifact name).
Fix works only in case when both new IDEA and gradle plugins are
used
#KT-28627 Fixed
2019-04-09 12:04:59 +03:00
Andrey Uskov
ed0dfaec36 Migrate GradleFacetImportingTest to testdata 2019-04-09 12:04:32 +03:00
Andrey Uskov
0f60daec25 Fix locking multiple threads during KotlinConfiguration check
#KT-29892 Fixed
2019-04-09 12:04:14 +03:00
Andrey Uskov
ff488bb871 Create android source root test added 2019-04-09 12:03:57 +03:00
Simon Ogorodnik
dc84e8fce5 Reformat PluginDeclarationProviderFactory 2019-04-09 11:53:54 +03:00
Simon Ogorodnik
f3268c99df EA-115037: Rebuild PerModulePackageCache on miss 2019-04-09 11:53:52 +03:00
Simon Ogorodnik
dd3dfedf81 KT-30688: Fix memory leak on module in disposer after onTooComplexChange
Remove explicit cache entry removal, use weak map instead

 #KT-30688 fixed
2019-04-09 11:53:22 +03:00
Nikolay Krasko
bfda9cc57b Fix inspection Integer.toString() -> int.toString() reports 2019-04-09 11:47:30 +03:00
Nikolay Krasko
a9beb04cb7 Fix RemoveExpressionTargetFix and don't remove the whole annotation (KT-25574) 2019-04-09 11:47:29 +03:00
Nikolay Krasko
ecda8cd889 Remove resolve in ChangeRetentionToSourceFix and RemoveExpressionTargetFix (KT-25574) 2019-04-09 11:47:29 +03:00
Toshiaki Kameyama
58b6360388 Add quick fixes for RESTRICTED_RETENTION_FOR_EXPRESSION_ANNOTATION (KT-25574) 2019-04-09 11:47:29 +03:00
pyos
f37d171a52 Flatten phase compositions.
This makes stack traces and flame graphs significantly more readable.
2019-04-09 10:15:45 +02:00
pyos
fb0261bfc1 Remove JvmDescriptorWithExtraFlags and fix syntheticness
(of fields and classes, it is already correct for methods).
2019-04-09 08:18:14 +02:00
pyos
3fdcf8376f Add IR equivalent of the WriteFlags test 2019-04-09 08:11:29 +02:00
Dmitriy Dolovov
f2d513a39c Fix: Unstable IDE navigation to expect/actual symbols in stdlib
Issue #KT-30790 Fixed
2019-04-09 10:24:58 +07:00
Anton Bannykh
9b5c8bbac9 JS: switch off inlined local declaration deduplication (KT-30877 fixed)
(cherry picked from commit 681e8dd968)
2019-04-08 21:22:43 +03:00
Ilmir Usmanov
2dee506022 Generate suspend markers for inline and crossinline parameters
if they are not inlined, but directly called.
Previously, all inline and crossinline lambda calls were treated by
codegen as if they are always going to be inlined. However, this is not
always the case.

Note, that we cannot generate these markers during codegen, since we
can inline code with no suspension points, but the whole inlined code
will become one giant suspension point. This, of course, breaks
tail-call optimization and, hence, slows down cold streams.

Because of that, we generate these markers, when we are sure, that they
are not going to be inlined. The only place, in which we know that, is
the inliner. During inlining of the inline function, we check, whether
the parameter is inline or crossinline and whether it is not an inline
lambda. If these checks pass, we generate the markers. Noinline
parameters are already covered by the codegen.
 #KT-30706 Fixed
 #KT-26925 Fixed
 #KT-26418 Fixed
2019-04-08 17:28:37 +03:00
Mikhael Bogdanov
eb1bfac83f Minor. Fix test data 2019-04-08 16:23:00 +02:00
Dereck Bridie
7da52b2df5 Fix KT-13962 with kotlin.collections constructors 2019-04-08 14:53:27 +03:00
Mikhael Bogdanov
10e3dfa980 Support anonymous function as inline parameters 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
2a3a9bb5fc Support properties reificaton 2019-04-08 13:10:25 +02:00
Mikhael Bogdanov
944c200a5d Initial support of try as expression in JVM IR 2019-04-08 13:10:24 +02:00
Mikhael Bogdanov
30aeb8dc0a Support finally blocks in non-local returns 2019-04-08 13:10:23 +02:00
Mikhael Bogdanov
4c59d161d4 Support basic reification in IR 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
02cb1d7dcc Change return target in $default function on transformation 2019-04-08 13:10:22 +02:00
Mikhael Bogdanov
694a7c329d Initial support of non-local return in IR 2019-04-08 13:10:21 +02:00
Mikhael Bogdanov
3f9154a4a1 Remove declaration that would be inlined 2019-04-08 13:10:20 +02:00
Alexander Udalov
dd2c7aff6e Implement IrType.equals/hashCode via isEqualTo/toHashCode 2019-04-08 13:06:01 +03:00
Alexander Udalov
8cce5dc8de Fix missing return for checkViaDescriptors in FqNameEqualityChecker 2019-04-08 13:06:01 +03:00
Alexander Udalov
bdfe82cfff Fix incorrect condition in CheckIrElementVisitor.ensureTypeIs
Apparently it has no effect on behavior of tests because no backend uses
the checkTypes mode of IR validation
2019-04-08 13:06:01 +03:00
Sergey Rostov
26a9b2b251 JPS Build: fix kotlin-main-kts-test dependency to kotlin-main-kts 2019-04-08 12:47:25 +03:00
Alexander Udalov
5bafd4008f Use correct class loader to load .kotlin_builtins in reflection
#KT-30749 Fixed
2019-04-08 12:43:53 +03:00
Toshiaki Kameyama
3de723b8d0 SimplifiableCallChainInspection: replace .sorted().firstOrNull() with .min()
#KT-30725 Fixed
2019-04-08 11:07:24 +03:00
Sergey Rostov
bdac47369c Gradle, Native: run tests with proper Test task, process test results
#KT-30529 Fixed
2019-04-08 09:38:33 +03:00
Sergey Rostov
d5e434e95b Gradle: move JS and Android platform specific files to targets package: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
9129c08fac Gradle: move JS and Android platform specific files to targets package 2019-04-08 09:38:33 +03:00
Sergey Rostov
09611a612a Gradle, Native: move all Native-related files to targets.native directory: add suppress PackageDirectoryMismatch 2019-04-08 09:38:33 +03:00
Sergey Rostov
1d1a560e32 Gradle, Native: move all Native-related files to targets.native directory 2019-04-08 09:38:33 +03:00
Dmitry Gridin
b45aeda711 Fix caret after "Introduce import alias" if invoke in import directive
#KT-30833 Fixed
2019-04-08 11:25:32 +07:00
Nikolay Krasko
814aca9c8b Single indent for declarations on adding new line (KT-26954)
#KT-26954 Fixed
2019-04-06 20:44:06 +03:00
Nikolay Krasko
e4cc94e0a8 Check bad root presence before checking platform (KT-30442)
Detect platform based on libraries content is a long operation and should
not be called from `isConversionNeeded`. Do other checks before it.
2019-04-06 20:44:05 +03:00
Nikolay Krasko
03c6e23448 Remove platform comparisons based on string dictionary order (KT-30356)
Comparison was changed in 641a9a7153 (diff-0895a6eaf69b9fd4d43f83db9889d103R109)

 #KT-30356 Fixed
2019-04-06 20:44:05 +03:00
Nikolay Krasko
53ab1e7c99 Minor: clean warnings in folding tests 2019-04-06 20:44:05 +03:00
Nikolay Krasko
aea33a3214 Move resolve during import optimizing to background thread (KT-27106, KT-30018)
#KT-27106 Fixed
2019-04-06 20:44:05 +03:00
Vyacheslav Gerasimov
25636c9c39 Build: Compile ultimate with kotlin-stdlib-jdk8 2019-04-05 20:37:19 +03:00
Igor Yakovlev
da4d8a8c90 Parser invalid error advancing for postfix type parameters list #KT-30835 Fixed 2019-04-05 19:50:42 +03:00
Austaon
0e716fd528 KT 13962: Intention to replace Java collection constructor calls with function calls from stdlib (ArrayList() → arrayListOf()) 2019-04-05 18:19:26 +03:00
Dmitry Petrov
bbeb65905e KT-30780 Fix erased inline class context in class context hierarchy
In SourceCompilerForInline we could enter ERASED_INLINE_CLASS context
from containing declaration context. That broke codegen context
hierarchy invariants assumed in accessor generation.
2019-04-05 17:27:04 +03:00
Mikhail Glukhikh
e1915ec99e FIR2IR: add bunch file for 181 to avoid compilation problems 2019-04-05 16:18:59 +03:00
Mikhail Glukhikh
ee28467a47 Raw FIR: add work-around for deeply nested String interpolations
Controversial (but prevents total kotlin test failing)
Related to KT-29222
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
881073b1c9 Add basic FIR -> IR converter with a set of text tests
Tests duplicate IrTextTestCaseGenerated
#KT-24065 Fixed
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
92adfd8946 Add stub implementation of compileTimeInitializer in wrapped descriptors 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
d736a7da6b Raw FIR: get rid of array gets, use array sets only for modifications
(a[b] += c etc. cannot be replaced with get/set calls easily)
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
a0c4e2f05f Raw FIR: convert in to contains and !in to contains.not 2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
4482a8f794 Remove FirOperation.RANGE which was effectively unused
Associated KtTokens.RANGE is included into convention call table
2019-04-05 16:18:58 +03:00
Mikhail Glukhikh
007edcb4a4 Raw FIR: generate convention / infix binary expressions with receiver 2019-04-05 16:18:57 +03:00
Dmitry Gridin
4f8e29ad23 Fix import quickfix if import has import alias
#KT-30669 Fixed
 #KT-7380 Fixed
 #KT-30663 Fixed
2019-04-05 20:01:11 +07:00
Dmitry Gridin
6caf6858fa Minor: refactoring KotlinAddImportAction 2019-04-05 20:01:11 +07:00
Dmitriy Novozhilov
d8cbeb8d15 Add regression test for SPREAD_OF_NULLABLE diagnostic
#KT-30808 Fixed
2019-04-05 14:17:34 +03:00
Mikhail Zarechenskiy
ff2ce316e1 [NI] Resolve callable reference eagerly at the end of resolution parts
This way we'll resolve less callable references later as we'll have
 more constraints to clip wrong candidates for callable references
2019-04-05 13:16:58 +03:00
Mikhail Zarechenskiy
c3bc6ef2fa [NI] Make callable references more robust to overloads of outer call
#KT-30676 Fixed
2019-04-05 13:16:54 +03:00
Mikhail Zarechenskiy
20a7f387bf [NI] Resolve callable reference eagerly if there is only one candidate
#KT-30737 Fixed
2019-04-05 13:15:57 +03:00
Dmitriy Novozhilov
aa96a05469 [NI] Fix initial data flow info for analyzing lambdas
#KT-30734 Fixed
2019-04-05 12:52:29 +03:00
Anton Bannykh
b7ffdb9fde JS IR: support kotlin.test 2019-04-05 12:30:21 +03:00
Anton Bannykh
b0ed688986 Fix argument passing for smartJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
d04a0246db make smartJavaExec composable with NoDebugJavaExec 2019-04-05 12:30:21 +03:00
Anton Bannykh
8174d6c035 JS IR: eliminate quickIrTest 2019-04-05 12:30:21 +03:00
Anton Bannykh
ad4c2144a7 JS IR: moved klib creation to the serialization_test module 2019-04-05 12:30:20 +03:00
Anton Bannykh
0f183ed662 JS IR: split compilation and deserialization 2019-04-05 12:30:20 +03:00
Anton Bannykh
08785b7cea JS IR: split serialization into a separate module 2019-04-05 12:30:20 +03:00
Anton Bannykh
42f576f033 IR: move serialization to serialization.common 2019-04-05 12:30:20 +03:00
Steven Schäfer
59c5d8bdb8 Add an implicit cast to Unit in returns from a constructor. 2019-04-05 12:05:53 +03:00
Vasily Levchenko
826f55ecb4 Merge pull request #2240 from JetBrains/rr/minamoto/ir-IrFunctionInlineBodyImpl
[IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
2019-04-05 11:49:08 +03:00
Vasily Levchenko
1ebf7faedc [IR][refactoring] g/c IrReturnableBlock[Impl]
- drop calculatable from 'inlineFunctionSymbol' fields: 'sourceFileSymbol' and 'sourceFileName' and
replace then with extension values

- drop unused constructors.
2019-04-05 11:47:45 +03:00
pyos
05e09df683 Throw a clearer error on unexpected IR nodes in expressions 2019-04-04 21:39:49 +02:00
pyos
c3a74ded0e Make isDefaultValueForType shorter 2019-04-04 21:39:47 +02:00
pyos
fb55e34b8f Merge generateBreakOrContinueExpression and doFinallyOnReturn 2019-04-04 21:39:46 +02:00
pyos
c0af91b6d1 Inline markFunctionLineNumber 2019-04-04 21:11:39 +02:00
pyos
9f28b2042a Move common declarations up 2019-04-04 21:11:37 +02:00
pyos
a7dbd08f45 Inline genFinallyBlockOrGoto 2019-04-04 21:11:35 +02:00
pyos
6690e50dd2 Remove direct block stack manipulation 2019-04-04 21:11:33 +02:00
pyos
57450912fb Remove a couple unused classes, inline a short method 2019-04-04 21:11:31 +02:00
Toshiaki Kameyama
bcfab83d1c Add "Constructor has non-null self reference parameter" inspection (KT-29799)
#KT-29799 Fixed
2019-04-04 17:25:37 +03:00
Zalim Bashorov
6634d7ab15 [psi2ir] Minor: dynamicWithImplicitCast.kt -> dynamicWithSmartCast.kt 2019-04-04 17:14:04 +03:00
Zalim Bashorov
57a6b53780 [psi2ir] Add tests for implicit casts "to" and "from" dynamic type 2019-04-04 17:14:03 +03:00
Toshiaki Kameyama
dffcfdc02f Add inspection to replace not-null assertion with elvis return
#KT-30381 Fixed
2019-04-04 20:29:17 +07:00
Vasily Levchenko
6f9feacf6e [IR] introduced additional field 'inlineFunctionSymbol' to IrReturnableBlock
This change let backend calculate and bind right function to the code block on generation debug information
e.g. for Kotlin/Native backend this let codegnerator to produce DILocation(..., inlinedAt:..) with correct value
for inlinedAt parameter, thus signifiacntly improve behaviour of debugger.
2019-04-04 16:14:34 +03:00
Dmitry Petrov
1c0c01725b Preserve original for constructors of LazySubstitutingClassDescriptor
We would like DeclarationDescriptor.getOriginal() to always point to a
(preferably unique) unsubstituted descriptors for the given possibly
substituted descriptor. In case of LazySubstitutingClassDescriptor
(which can be observed for nested generic Java classes), this invariant
was broken, because 'getOriginal()' for constructors of substituted
class returned a copy created for this particular substituted class.
2019-04-04 14:42:23 +03:00
Ilya Kirillov
966daf8341 Regenerate NullabilityAnalysisTestGenerated 2019-04-04 14:05:05 +03:00
Alexander Podkhalyuzin
1fbbd71085 Fixed DSL Marker icon
#KT-30470 Fixed
2019-04-04 13:59:49 +03:00
Dmitriy Dolovov
ea3f4ad47f Attach K/N stdlib sources on MPP project import
Issue #KT-30635:fixed
2019-04-04 17:34:42 +07:00
Dmitriy Dolovov
f9d9d7f737 Keep K/N stdlib upper than platform libraries in IDEA UI 2019-04-04 17:34:24 +07:00
Natalia Selezneva
97531c8ec2 Do not include buildSrc module dependencies into script dependencies (KT-30295)
^KT-30295 Fixed
2019-04-04 11:06:14 +03:00
Natalia Selezneva
aa99d8fcbe Rename extension point for additional dependencies of scripts 2019-04-04 11:06:14 +03:00
pyos
4c01614136 Avoid leaking SamConstructorDescriptors from psi2ir 2019-04-04 09:45:00 +02:00
pyos
23d742237f Add tests for merging SAM wrappers and references 2019-04-04 09:45:00 +02:00
pyos
e05c151a73 Remove explicit mention of an internal name from a test 2019-04-04 09:45:00 +02:00
pyos
ee59530f71 Fix casts of the null constant to SAM types 2019-04-04 09:45:00 +02:00
pyos
f47d9d54c0 psi2ir: add test for SAM-conversion of operator arguments 2019-04-04 09:45:00 +02:00
pyos
39c8939241 JVM_IR: optimize SAM conversion of lambda literals
Instead of materializing an invokable object and storing it in an
instance of the implementation, create a specialized class that calls
the lambda directly, resulting in one less nesting layer and one less
class.
2019-04-04 09:45:00 +02:00
pyos
b74586f84e JVM_IR: implement single-abstract-method conversions 2019-04-04 09:45:00 +02:00
Mikhail Glukhikh
141e8d553e FIR body resolve: support variable assignments 2019-04-04 10:31:15 +03:00
Mikhail Glukhikh
c56b471b71 FIR body resolve: handle constant types more precisely 2019-04-04 10:31:13 +03:00
Mikhail Glukhikh
cc2a5cfc06 FIR body resolve: calculate type even for resolved references 2019-04-04 10:31:12 +03:00
Mikhail Glukhikh
d7f0392f90 FIR body resolve: fix value parameter expected type 2019-04-04 10:31:11 +03:00
Mikhail Glukhikh
8a6c9a6aec FIR deserializer: read nullability & add constructors 2019-04-04 10:31:09 +03:00
Mikhail Glukhikh
6e9d78d431 FIR structure: make implicit built-in types resolved 2019-04-04 10:31:08 +03:00
Mikhail Glukhikh
bf0190d96c FIR structure: reuse StandardClassIds in implicit built-in typeRef 2019-04-04 10:31:07 +03:00
Mikhail Glukhikh
b3cf3c6579 FIR structure: include calleeReference into FirDelegatedConstructorCall 2019-04-04 10:31:05 +03:00
Mikhail Glukhikh
63d3100122 FIR structure: FirClassLikeDeclaration is now FirStatement
Done to support (in theory) local type aliases
2019-04-04 10:31:04 +03:00
Mikhail Glukhikh
4213a4c7e2 FIR Java: reuse StandardClassIds 2019-04-04 10:31:02 +03:00
Mikhail Glukhikh
a0fa9e6b48 Raw FIR: make component call a function call, its argument -> receiver 2019-04-04 10:31:01 +03:00
Mikhail Glukhikh
30697787a0 Raw FIR: set "implicit boolean" result type for some operator calls 2019-04-04 10:31:00 +03:00
Mikhail Glukhikh
eb1aaad41b Raw FIR: generate Unit at the end of empty lambda 2019-04-04 10:30:52 +03:00
Mikhail Glukhikh
eb86c9e540 FIR: get rid of ANDAND / OROR by replacing with when 2019-04-04 10:30:49 +03:00
Mikhail Glukhikh
395651a21e Raw FIR: swap branches in when for elvis and bang-bang 2019-04-04 10:30:48 +03:00
Mikhail Glukhikh
f77ba2dd3e Raw FIR: make object/sealed/enum constructor visibility private 2019-04-04 10:30:47 +03:00
Mikhail Glukhikh
057156f323 Raw FIR builder: cleanup code 2019-04-04 10:30:45 +03:00
Mikhail Glukhikh
33729aaf9b Raw FIR: add Any/Enum/Annotation to supertypes iff no supertypes exists 2019-04-04 10:30:44 +03:00
Mikhail Glukhikh
7dd89a48f0 Raw FIR: introduce FirConstructor.isPrimary 2019-04-04 10:30:43 +03:00
Mikhail Glukhikh
61c2e4e590 Raw FIR: handle local visibility for functions & classes 2019-04-04 10:30:41 +03:00
Mikhail Glukhikh
4187ea1f86 Raw FIR: add initializers to primary constructor properties 2019-04-04 10:30:40 +03:00
Ilya Matveev
1f2d31dffb Update Kotlin/Native: 1.3-dev-9301 2019-04-04 14:24:09 +07:00
Mark Punzalan
a0940b1342 Use stricter assertions in for-loop bytecode text tests. 2019-04-04 09:07:19 +02:00
Mark Punzalan
dd65e0876f Simplify loop building by encoding open/closed bound information in the
HeaderInfo object, and modifying the operator in the loop condition.

The "additional emptiness condition" is no longer necessary with this.
The open/closed property was removed from HeaderInfo in an earlier
commit, but bringing it back in to simplify the loop building makes
more sense.

Also expanded tests for evaluation order of range bounds.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7680e7fd56 Use while loop for progressions that cannot overflow (instead of
do-while with enclosing "not empty" check).

Also do not add additional "not empty" condition for `until` loops when
the given bound is a constant != MIN_VALUE.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ba0e016c4e Add bytecode tests for array for-loop iteration. 2019-04-04 09:07:19 +02:00
Mark Punzalan
7afe121238 Eliminated the redundant ForLoopHeader.needsEmptinessCheck property, cast "bound" to progression type if necessary, fixed variable declaration order. 2019-04-04 09:07:19 +02:00
Mark Punzalan
6b83c04472 Cast step expression to the correct Number type, if necessary. 2019-04-04 09:07:19 +02:00
Mark Punzalan
f6e74079bb Cleanup ForLoopsLowering: Add more comments, remove descriptor usages,
make code style consistent.
2019-04-04 09:07:19 +02:00
Mark Punzalan
ea9572ad28 Add DefaultProgressionHandler that handles for-loops over
non-specialized progressions, including "step" progressions.

DefaultProgressionHandler uses the "first/last/step" properties of
the progression when building the loop header.
2019-04-04 09:07:19 +02:00
Mark Punzalan
301ac90770 Remove "bound" and "closed" properties from HeaderInfo and
ForLoopHeader, instead assuming that all ranges are closed and that the
"last" property is already property calculated.

This means the HeaderInfo.last for arrays, "indices" and "until"
progressions are decremented from the bound. This simplifies the loop
construction and moves the work to the handlers. This will also simplify
the handling of "reversed()" in the future since we don't need to
consider the case where the lower bound is open.
2019-04-04 09:07:19 +02:00
Mark Punzalan
93deff5e57 Rename "lowerBound/upperBound" to "first/last" and move loopVariable to
ForLoopHeader base class.

These terms are less loaded and less confusing, especially with "downTo"
progressions, and once we start handling "reversed()".
2019-04-04 09:07:19 +02:00
Mark Punzalan
8e1be5424f Handle for (i in a until Int.MIN_VALUE) corner case by adding
an additional "not empty" condition produced by the UntilHandler.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7b153b2b68 Move building of "not empty" condition (used to check if loop is empty)
from ForLoopsLowering into ForLoopHeader, reducing the building logic in
ForLoopsLowering.
2019-04-04 09:07:19 +02:00
Mark Punzalan
a2e3d3635e Replace HeaderInfo.increasing property with a "direction" enum property,
which is computed based on the value of "step" (if possible).
2019-04-04 09:07:19 +02:00
Mark Punzalan
ed9ede8936 Make HeaderInfo.step not nullable and have handlers explicitly provide
the step expression.

The semantics of "step" are now clearer: It will no longer be negated
based on the "increasing" property; if the progression is decreasing
(i.e., for "downTo" progressions), then it must be negative. The
"increasing" property is still used when building the emptiness
condition.
2019-04-04 09:07:19 +02:00
Mark Punzalan
40dbf8a3fd Move elementType() and getProgressionType() extension methods into
ProgressionType.
2019-04-04 09:07:19 +02:00
Mark Punzalan
409d99a52a Add ForLoopsLowering to JVM phases.
Also deleted StepHandler. Since the HeaderInfo.needLastCalculation is
only set to true for handling step progressions, deleted that property
and all associated logic around it.
2019-04-04 09:07:19 +02:00
Mark Punzalan
7276b7e66a Fix compilation errors after rebasing. 2019-04-04 09:07:19 +02:00
Mark Punzalan
656f6855bb Minimal porting of ForLoopsLowering from kotlin-native.
Diffs resulting from the port:
https://github.com/punzki/kotlin-native/compare/master...punzki:for-loop-diff

When ForLoopsLowering is added to the JVM lowering phases, this causes some of the forLoop bytecode tests to pass, and many still fail due to differences in behavior compared to non-IR backend:
- Generated conditions for lowered loop
- Generated temporary variables
- Supported iterables (e.g., withIndex(), CharSequences)
- Means of incrementing induction variable

The phase will be added once more TODOs are resolved and it is more functionally complete, to prevent breaking for loops.
2019-04-04 09:07:19 +02:00
Toshiaki Kameyama
f861b10798 Add "Add getter/setter" quick fix for uninitialized property
#KT-30078 Fixed
2019-04-04 11:10:39 +07:00
Austaon
efcc6f0967 Add inspection for Integer.toString(i) to i.toString() (KT-12721) 2019-04-03 19:12:54 +03:00
Ilya Gorbunov
dde2b30601 Clarify wording in Random.nextUInt docs: missed extra 'not' 2019-04-03 16:31:03 +03:00
Yan Zhulanow
69353ee9bf Async stack traces: fix compatibility with kotlin-stdlib 1.2.70 (KT-30611) 2019-04-03 15:46:33 +03:00
Yan Zhulanow
ef06009669 191: Fix test running for common modules in MPP/Gradle (KT-29908) 2019-04-03 15:46:32 +03:00
Yan Zhulanow
ee42c1211a 191: Update target IntelliJ SDK version to 191.6183 2019-04-03 15:46:32 +03:00
Ilya Kirillov
b7e6dc4f8b Fix as32 test generation 2019-04-03 14:48:54 +03:00
Sergey Igushkin
e23b74792d Fix Java sources inspected too early in Android variants (KT-30735)
The Android Gradle plugin can set Java sources after a variant is
created, similar to AP options. We need to inspect the Java sources
only from at `afterEvaluate` time.

Issue #KT-30735 Fixed
2019-04-03 14:45:52 +03:00
Ilya Matveev
5ab9723ee1 Configure CocoaPods plugin to be published at the plugin portal 2019-04-03 18:07:49 +07:00
Alexander Podkhalyuzin
a7b43a6bb7 Import only classes when setting add unambiguous on the fly is enabled
#KT-30514 Fixed
2019-04-03 13:51:21 +03:00
Mikhael Bogdanov
4450641321 Merge inlineCodegenUtils2.kt into inlineCodegenUtils.kt 2019-04-03 11:43:46 +02:00
Mikhael Bogdanov
be954c6e62 Rename LabelOwner into ReturnLabelOwner 2019-04-03 11:43:45 +02:00
Mikhael Bogdanov
20adce165f Convert CapturedParamDesc.java into Kotlin 2019-04-03 11:39:59 +02:00
Mikhael Bogdanov
a19cc8efa6 Rename .java to .kt 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
c6fb8ba08e Convert CapturedParamInfo.java into Kotlin 2019-04-03 11:39:58 +02:00
Mikhael Bogdanov
79c97ba21d Rename .java to .kt 2019-04-03 11:39:57 +02:00
Mikhael Bogdanov
d8336bd0a1 Convert ParameterInfo.java into Kotlin 2019-04-03 11:39:56 +02:00
Mikhael Bogdanov
53dd1dd76d Rename .java to .kt 2019-04-03 11:39:55 +02:00
Ilya Kirillov
243fd2f4f1 New J2K: Move nullability analysis tests to nullabilityAnalysis dir 2019-04-03 11:24:30 +03:00
Ilya Kirillov
854fc6a7d7 New J2K: Handle correctly modifiers of class members when there is no parent class in the AST 2019-04-03 11:24:29 +03:00
Ilya Kirillov
c05a01e12b New J2K: Fix NPE if no constructor was found in ImplicitInitializerConversion 2019-04-03 11:24:28 +03:00
Ilya Kirillov
6182edadfd New J2K: Move imports into JKImportList 2019-04-03 11:24:27 +03:00
Ilya Kirillov
86fa54fae9 New J2K: Convert Java method to Kotlin function independently of containing class 2019-04-03 11:24:26 +03:00
Ilya Kirillov
f28f340840 New J2K: Wrap ast to a JKTreeRoot 2019-04-03 11:24:26 +03:00
Ilya Kirillov
ddee0deeca New J2K: Move println conversion functionality to BuiltinMembersConversion 2019-04-03 11:24:25 +03:00
Ilya Kirillov
ce666295f7 New J2K: Fix npe when converting java member without parent 2019-04-03 11:24:24 +03:00
Ilya Kirillov
088241313a New J2K: Remove unused JKJavaDefaultNewExpressionImpl 2019-04-03 11:24:23 +03:00
Ilya Kirillov
50a4b9b2b5 New J2K: Remove debug println 2019-04-03 11:24:22 +03:00
Ilya Kirillov
31aea1e5e9 New J2K: Fix converting on copy-past 2019-04-03 11:24:22 +03:00
Ilya Kirillov
5ab9d6bba8 New J2K: Fix collected import inserting in J2K 2019-04-03 11:24:21 +03:00
Ilya Kirillov
1dd0a42298 New J2K: Escape name of declaration in convert data class 2019-04-03 11:24:20 +03:00
Ilya Kirillov
b411e8e18e New J2K: Split old j2k and new j2k tests 2019-04-03 11:24:19 +03:00
Ilya Kirillov
02a206bf7c New J2K: Fix converters spliting 2019-04-03 11:24:18 +03:00
Ilya Kirillov
db2ad96f00 New J2K: Fix ParameterModificationInMethodCallsConversion in a case of varargs parameter 2019-04-03 11:24:18 +03:00
Ilya Kirillov
8cec43fda3 New J2K: Assume KtConstructor as function for symbol provider 2019-04-03 11:24:17 +03:00
Ilya Kirillov
6d621a86d2 New J2K: Convert java.util.Objects.equals call to equals binary operator expression 2019-04-03 11:24:16 +03:00
Ilya Kirillov
a973f9b670 New J2K: Add support of package qualifiers for expressions 2019-04-03 11:24:16 +03:00
Ilya Kirillov
9fb6cfc26e New J2K: Collect imports to ImportStorage, not to JKFle 2019-04-03 11:24:15 +03:00
Ilya Kirillov
9d9c9f40db New J2K: Wrap adding imports to CommandProcessor.executeCommand 2019-04-03 11:24:14 +03:00
Ilya Kirillov
02c8e4cede New J2K: Do not remove semicolon after if expression when then branch is empty in RedundantSemicolonInspection 2019-04-03 11:24:14 +03:00
Ilya Kirillov
b13f7431f2 New J2K: Fix existing test data 2019-04-03 11:24:13 +03:00
Ilya Kirillov
76b73542d9 New J2K: Add type arguments to multi-dimension array initializers 2019-04-03 11:24:12 +03:00
Ilya Kirillov
99f3af9e85 New J2K: Move comments from primary constructor to init section 2019-04-03 11:24:11 +03:00
Ilya Kirillov
481b2feda3 New J2K: Collect annotations for parameters 2019-04-03 11:24:10 +03:00
Ilya Kirillov
b3af05e3ad New J2K: Fix comments order 2019-04-03 11:24:10 +03:00
Ilya Kirillov
1e73748ab4 New J2K: Fix gradle build for nj2k-services 2019-04-03 11:24:09 +03:00
Ilya Kirillov
7f9250c914 New J2K: Fix symbol provider compile error 2019-04-03 11:24:08 +03:00
Ilya Kirillov
32e69629f3 New J2K: Add imports of used kotlin functions 2019-04-03 11:24:08 +03:00
Ilya Kirillov
939b379694 New J2K: Fix old j2k build 2019-04-03 11:24:07 +03:00
Ilya Kirillov
dff4ab2437 New J2K: Fix nullability preserving in AST conversions 2019-04-03 11:24:06 +03:00
Ilya Kirillov
bdd773f806 New J2K: Add nullability analyser tests 2019-04-03 11:24:05 +03:00
Ilya Kirillov
f3b6c880d4 New J2K: Remove unused nj2k test & fix test generation 2019-04-03 11:24:04 +03:00
Ilya Kirillov
e3ee0dac6c New J2K: Add annotations to the import collector 2019-04-03 11:24:03 +03:00
Ilya Kirillov
0610583b80 New J2K: Fix RemoveRedundantExpressionQualifierProcessing 2019-04-03 11:24:02 +03:00
Ilya Kirillov
6f7f516a4f New J2K: Temporary ignore imports & error comments 2019-04-03 11:24:01 +03:00
Ilya Kirillov
bcee73ff01 New J2K: Fix debug tree printer 2019-04-03 11:24:01 +03:00
Ilya Kirillov
b81696947c New J2K: Do not call useless cast on null expression on post processing 2019-04-03 11:24:00 +03:00
Ilya Kirillov
54bd077994 New J2K: Fix type calculating 2019-04-03 11:23:59 +03:00
Ilya Kirillov
658f763887 New J2K: Save unused imports 2019-04-03 11:23:58 +03:00
Ilya Kirillov
a7d2238af4 New J2K: Add IDEA integration of J2k 2019-04-03 11:23:57 +03:00
Ilya Kirillov
a4e3e7abcc New J2K: Add !! when nullability mismatch on post processing 2019-04-03 11:23:56 +03:00
Ilya Kirillov
deb4129a16 New J2K: Add support of diagnostic based inspections on arbitrary PsiElements 2019-04-03 11:23:55 +03:00
Ilya Kirillov
47e722854c New J2K: Remove redundant modifiers in post processing 2019-04-03 11:23:55 +03:00
Ilya Kirillov
7adba40ea2 New J2K: Fix existing test data 2019-04-03 11:23:54 +03:00
Ilya Kirillov
8bd49c147c New J2K: Fix convert getters and setters 2019-04-03 11:23:53 +03:00
Ilya Kirillov
0340c218b9 New J2K: Do not show unknown comment for some kind of type types 2019-04-03 11:23:52 +03:00
Ilya Kirillov
c1ed2e020c New J2K: Fix formatting saving 2019-04-03 11:23:52 +03:00
Ilya Kirillov
13a9a56e85 New J2K: Remove redundant nullability AST conversions due to having them in nullability analyser 2019-04-03 11:23:51 +03:00
Ilya Kirillov
b24ce99097 New J2K: Process fields in modality conversion 2019-04-03 11:23:50 +03:00
Ilya Kirillov
b6625c536d New J2K: Add nullability analysis to post processing 2019-04-03 11:23:50 +03:00
Ilya Kirillov
63d3f90373 New J2K: Fix labeled statement conversion 2019-04-03 11:23:49 +03:00
Ilya Kirillov
0b92b3160f New J2K: Add parenthesis to binary expression in a case of line break before operator 2019-04-03 11:23:48 +03:00
Ilya Kirillov
c20e537b81 New J2K: Preserve comments and line breaks 2019-04-03 11:23:48 +03:00
Ilya Kirillov
b9f8ff9079 New J2K: Rearrange conversions 2019-04-03 11:23:47 +03:00
Ilya Kirillov
4aacb15872 New J2K: Add support of lambda expressions in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:23:46 +03:00
Ilya Kirillov
197fda30e2 New J2K: Implement unimplemented symbol functions 2019-04-03 11:23:46 +03:00
Ilya Kirillov
779dc5c1e2 New J2K: Add RETURN_TYPE_MISMATCH_ON_OVERRIDE to postprocessing 2019-04-03 11:23:45 +03:00
Ilya Kirillov
a1e8d0a6be New J2K: Add Spread operator support 2019-04-03 11:23:44 +03:00
Ilya Kirillov
bf8acc57e3 New J2K: Make all types data classes 2019-04-03 11:23:44 +03:00
Ilya Kirillov
fb6560c1f1 New J2K: Assume parameters when prebuilding symbol provider symbols fro converting declarations 2019-04-03 11:23:43 +03:00
Ilya Kirillov
67a8f445b0 New J2K: Fix provideDirectSymbol in symbol provider fro decompiled declaratiosns 2019-04-03 11:23:42 +03:00
Ilya Kirillov
0456c6a897 New J2K: Make method open only if parent class is open 2019-04-03 11:23:42 +03:00
Ilya Kirillov
269d3f42c6 New J2K: Transfer java method to kotlin function symbol 2019-04-03 11:23:41 +03:00
Ilya Kirillov
cc3564395c New J2K: Promete class to object when init declaration present 2019-04-03 11:23:40 +03:00
Ilya Kirillov
b94ff8af36 New J2K: Clear nullability for methods 2019-04-03 11:23:40 +03:00
Ilya Kirillov
5ae1a819bc New J2K: Add support of Java static init declarations 2019-04-03 11:23:39 +03:00
Ilya Kirillov
ef89a249f2 New J2K: Add FunctionAsAnonymousObjectToLambdaConversion & ReturnStatementInLambdaExpressionConversion conversions 2019-04-03 11:23:38 +03:00
Ilya Kirillov
a659fcd6af New J2K: Move annotations from getters to properties 2019-04-03 11:23:38 +03:00
Ilya Kirillov
1fa0ddcbe8 New J2K: Add qualifiers for static methods, fields & enum consts 2019-04-03 11:23:37 +03:00
Ilya Kirillov
b355572aab New J2K: Add annotation list for JKVariable 2019-04-03 11:23:37 +03:00
Ilya Kirillov
40f5ebb77e New J2K: Fix incorrect imports collecting 2019-04-03 11:23:36 +03:00
Ilya Kirillov
8caf45820c New J2K: Add support of more operations on string conversion 2019-04-03 11:23:35 +03:00
Ilya Kirillov
e39fc53f25 New J2K: Correctly detect varargs argument in annotations & do not throw away named arguments in annotations 2019-04-03 11:23:35 +03:00
Ilya Kirillov
90c12736da New J2K: Convert to data class iff constructor parameter type equals property type 2019-04-03 11:23:34 +03:00
Ilya Kirillov
bcb8742120 New J2K: Add support of named parameters 2019-04-03 11:23:33 +03:00
Ilya Kirillov
ea2081c2f0 New J2K: Fix existing test data 2019-04-03 11:23:33 +03:00
Ilya Kirillov
9c71d5ca25 New J2K: Add repeatable post processing groups 2019-04-03 11:23:32 +03:00
Ilya Kirillov
c827247272 New J2K: Separate new j2k from old j2k 2019-04-03 11:23:31 +03:00
Ilya Kirillov
e6f0a242fd New J2K: Parenthesize qualifier for extension methods in BuiltinMembersConversion 2019-04-03 11:23:31 +03:00
Ilya Kirillov
c111f1c52f New J2K: Cache resolving by fqNames 2019-04-03 11:23:30 +03:00
Ilya Kirillov
ea6cb716e5 New J2K: Move optimize imports invocation out of processings 2019-04-03 11:23:29 +03:00
Ilya Kirillov
f8b8d07621 New J2K: Fix existing test data 2019-04-03 11:23:29 +03:00
Ilya Kirillov
7e30b9e7f5 New J2K: Add support of binary expressions conversion to ImplicitCastsConversion 2019-04-03 11:23:28 +03:00
Ilya Kirillov
208c33a51d New J2K: Add support of prefix expression in ImplicitCastsConversion 2019-04-03 11:23:27 +03:00
Ilya Kirillov
461ef071f4 New J2K: Add AssignmentStatementSplitAlsoConversion 2019-04-03 11:23:26 +03:00
Ilya Kirillov
58fbe7913e New J2K: Use type instead of typeElement to create JKType
because first one can fail on array type
2019-04-03 11:23:25 +03:00
Ilya Kirillov
71780ef442 New J2K: Fix creating expression instead of statement 2019-04-03 11:23:25 +03:00
Ilya Kirillov
4a9ba3c756 New J2K: Do not convert array types to specialized ones in a case of boxed inner type 2019-04-03 11:23:24 +03:00
Ilya Kirillov
7494488edb New J2K: Fix type parameters of JKUnresolvedClassSymbol for new expression 2019-04-03 11:23:23 +03:00
Ilya Kirillov
18e5c1b5f2 New J2K: Fix modality conversion 2019-04-03 11:23:23 +03:00
Ilya Kirillov
936c43d2bc New J2K: Assume specifyLocalVariableTypeByDefault in for loops initializers 2019-04-03 11:23:22 +03:00
Ilya Kirillov
1e7b1f8716 New J2K: Use converter settings values in post processing 2019-04-03 11:23:21 +03:00
Ilya Kirillov
f9a08ad770 New J2K: Add BoxedTypeOperationsConversion 2019-04-03 11:23:21 +03:00
Ilya Kirillov
8b12a9f723 New J2K: Fix support of kotlin method calls 2019-04-03 11:23:20 +03:00
Ilya Kirillov
9a8f8fbfe0 New J2K: Fix KotlinType to JKType conversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
7889756d1a New J2K: Convert type arguments in TypeMappingConversion 2019-04-03 11:23:19 +03:00
Ilya Kirillov
d2a4ff172d New J2K: Add Collection.remove conversion 2019-04-03 11:23:18 +03:00
Ilya Kirillov
9fcdb7dde7 New J2K: Fix statement conversion in a case of inner blocks 2019-04-03 11:23:17 +03:00
Ilya Kirillov
d7962afd05 New J2K: Add support of annotation classes 2019-04-03 11:23:17 +03:00
Ilya Kirillov
11f4df8173 New J2K: Add RemoveRedundantCallsOfConversionMethodsIntention post processing 2019-04-03 11:23:16 +03:00
Ilya Kirillov
e4c15c3fb9 New J2K: Fix adding JvmOverloads annotation in DefaultArgumentsConversion 2019-04-03 11:23:15 +03:00
Ilya Kirillov
962b971f07 New J2K: Add conflicts handling in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
e43eb4da03 New J2K: Fix indicesByCollectionSize in for conversion 2019-04-03 11:23:14 +03:00
Ilya Kirillov
6c696f6c60 New J2K: Convert tiled prefix operation to inv invocation 2019-04-03 11:23:13 +03:00
Ilya Kirillov
d09e72656a New J2K: Add InterfaceWithFieldConversion 2019-04-03 11:23:12 +03:00
Ilya Kirillov
1d846085de New J2K: Add support of synchronized statement 2019-04-03 11:23:12 +03:00
Ilya Kirillov
0674e6462c New J2K: Fix conversions order 2019-04-03 11:23:11 +03:00
Ilya Kirillov
3c5bb0b259 New J2K: Fix symbols fqNames 2019-04-03 11:23:10 +03:00
Ilya Kirillov
34ca1e1c23 New J2K: Do not print debug trees 2019-04-03 11:23:09 +03:00
Ilya Kirillov
50278058ae New J2K: Fix nullability calculation 2019-04-03 11:23:08 +03:00
Ilya Kirillov
8aa28c0d50 New J2K: Use returnType instead of methodSymbol in operator expressions 2019-04-03 11:23:07 +03:00
Ilya Kirillov
a92c5ebe61 New J2K: Add builtIn operators conversion 2019-04-03 11:23:07 +03:00
Ilya Kirillov
fbcf2e1bcd New J2K: Move equals operator conversion from post processing to AST conversion 2019-04-03 11:23:06 +03:00
Ilya Kirillov
70c700f07a New J2K: Add post processings for removing redundant qualifiers 2019-04-03 11:23:05 +03:00
Ilya Kirillov
d0ba5e7fdf New J2K: Add missing override keyword insertion post processing 2019-04-03 11:23:04 +03:00
Ilya Kirillov
9eaa961a2a New J2K: Add support of deprecated annotation && fix annotations 2019-04-03 11:23:04 +03:00
Ilya Kirillov
3990e1d223 New J2K: Replace conversionContext to symbolProvider in JKExpression.type function 2019-04-03 11:23:03 +03:00
Ilya Kirillov
8df99e54f8 New J2K: Use JKBooleanLiteral for boolean literals 2019-04-03 11:23:02 +03:00
Ilya Kirillov
d3a6b4f12b New J2K: Fix labeled while conversion 2019-04-03 11:23:02 +03:00
Ilya Kirillov
b396ee0cca New J2K: Fix also expression && lambda parameter types 2019-04-03 11:23:01 +03:00
Ilya Kirillov
d56a52fce6 New J2K: Use protected visibility resolution from old j2k 2019-04-03 11:23:00 +03:00
Ilya Kirillov
4c880499fb New J2K: Adapt internal class conversion to old j2k 2019-04-03 11:22:59 +03:00
Ilya Kirillov
d1c1aeed0b New J2K: Fix supertypes constructor calls 2019-04-03 11:22:58 +03:00
Ilya Kirillov
5cdc01621d New J2K: Use parameter initializers as scope for nullability check in LowerNullabilityInFunctionParametersConversion 2019-04-03 11:22:57 +03:00
Ilya Kirillov
53fcf31f23 New J2K: Take parameter in data class iff constructor parameter type is subtype of property type in data class conversion 2019-04-03 11:22:56 +03:00
Ilya Kirillov
fc504c6fdc New J2K: Add ReplacePrimitiveCastWithNumberConversionFix post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
23a42b36b4 New J2K: Add RemoveEmptyPrimaryConstructorIntention post processing 2019-04-03 11:22:55 +03:00
Ilya Kirillov
d5a3b5644c New J2K: Fix java classes mapped to kotlin ones in post processings 2019-04-03 11:22:54 +03:00
Ilya Kirillov
f603932284 New J2K: Do not merge function definitions whet it is not possible 2019-04-03 11:22:53 +03:00
Ilya Kirillov
46c7cd4b40 New J2K: Fix raw types in new expression 2019-04-03 11:22:52 +03:00
Ilya Kirillov
9b73db4308 New J2K: Add TypeParametersNullabilityConversion 2019-04-03 11:22:52 +03:00
Ilya Kirillov
6dae9da7e2 New J2K: Do not filter default imports 2019-04-03 11:22:51 +03:00
Ilya Kirillov
6e1adf9b6f New J2K: Add JvmOverloads annotation when merging methods 2019-04-03 11:22:50 +03:00
Ilya Kirillov
e232d70b52 New J2K: Add NullableQualifierConversion 2019-04-03 11:22:49 +03:00
Ilya Kirillov
95efc5eecf New J2K: Make annotation's type parameters not null 2019-04-03 11:22:48 +03:00
Ilya Kirillov
211405c034 New J2K: Cleanup code builder 2019-04-03 11:22:47 +03:00
Ilya Kirillov
2d256717ff New J2K: Make JKMethodCallExpression's arguments nullable 2019-04-03 11:22:46 +03:00
Ilya Kirillov
acd8985518 New J2K: Add JetbrainsNullableAnnotationsConverter 2019-04-03 11:22:46 +03:00
Ilya Kirillov
295a160f60 New J2K: Add DefaultNullabilityToNullableConversion 2019-04-03 11:22:45 +03:00
Ilya Kirillov
3d62734cc6 New J2K: Add types to JKExpression.type 2019-04-03 11:22:44 +03:00
Ilya Kirillov
2e353ccf86 New J2K: Use default nullability by default 2019-04-03 11:22:44 +03:00
Ilya Kirillov
f3cb76ff56 New J2K: Fix TypeMappingConversion 2019-04-03 11:22:43 +03:00
Ilya Kirillov
6b889bdf57 New J2K: Add ImplicitCastsConversion 2019-04-03 11:22:42 +03:00
Ilya Kirillov
2d37a2b28e New J2K: Fix type arguments for new expression 2019-04-03 11:22:41 +03:00
Ilya Kirillov
de26e2cfe7 New J2K: Add escaping of class symbol names in code builder 2019-04-03 11:22:40 +03:00
Ilya Kirillov
11da99a1d0 New J2K: Use binaryExpression instead of operatorExpression 2019-04-03 11:22:40 +03:00
Ilya Kirillov
84ad58b50b New J2K: Move literal conversion internals to expression.kt 2019-04-03 11:22:39 +03:00
Ilya Kirillov
60d498cedc New J2K: Add !! postfix expression support 2019-04-03 11:22:38 +03:00
Ilya Kirillov
a529dcce4c New J2K: Add charAt conversion to StringMethodsConversion 2019-04-03 11:22:37 +03:00
Ilya Kirillov
7dbe16d305 New J2K: Make polyadic expression converter to resolve real operator type 2019-04-03 11:22:36 +03:00
Ilya Kirillov
841cd9c749 New J2K: Do not remove redundant nullability in post precessing for variable if initializer is nullable 2019-04-03 11:22:36 +03:00
Ilya Kirillov
bbbadb0431 New J2K: Add support of vararg parameters in method declaration 2019-04-03 11:22:35 +03:00
Ilya Kirillov
6fbc180f92 New J2K: Do not create new line after each local declaration 2019-04-03 11:22:34 +03:00
Ilya Kirillov
51ee64a757 New J2K: Add java void type to JKClassLiteralExpression & make all inner types of JKClassLiteralExpression's classType to be notNull 2019-04-03 11:22:34 +03:00
Ilya Kirillov
5e6e5bcf8c New J2K: Fix modifiers of local class 2019-04-03 11:22:33 +03:00
Ilya Kirillov
ec1bc35df7 New J2K: Use real method symbols in ArrayInitializerConversion 2019-04-03 11:22:32 +03:00
Ilya Kirillov
71b194d0d6 New J2K: Get rid of JKUnresolvedClassType and use JKClassType(JKUnresolvedClassSymbol) instead 2019-04-03 11:22:31 +03:00
Ilya Kirillov
325eec2454 New J2K: Replace java instanceof with kotlin is expression 2019-04-03 11:22:31 +03:00
Ilya Kirillov
eda99a588d New J2K: Fix declarations creation 2019-04-03 11:22:30 +03:00
Ilya Kirillov
0feaad2205 New J2K: Fix enum constant symbol 2019-04-03 11:22:29 +03:00
Ilya Kirillov
1c4e811717 New J2K: Fix symbol's fqName 2019-04-03 11:22:29 +03:00
Ilya Kirillov
7c04590d82 New J2K: Fix method call expression printing 2019-04-03 11:22:28 +03:00
Ilya Kirillov
5fc9ca8fc7 New J2K: Add resolving for kotlin properties and object members calls 2019-04-03 11:22:27 +03:00
Ilya Kirillov
db8beab499 New J2K: Fix NPE in a case of unresolved symbols 2019-04-03 11:22:27 +03:00
Ilya Kirillov
410000f94c New J2K: Fix types for kotlin properties 2019-04-03 11:22:26 +03:00
Ilya Kirillov
667ead10a3 New J2K: Add finalize & clone to JavaStandartMethodsConversion 2019-04-03 11:22:25 +03:00
Ilya Kirillov
12fe096b82 New J2K: Fix class inheritance info 2019-04-03 11:22:25 +03:00
Ilya Kirillov
ad58772453 New J2K: Use IDEA analyzers on kotlin properties & functions 2019-04-03 11:22:24 +03:00
Ilya Kirillov
cc2f27f9cd New J2K: Add string.length conversion 2019-04-03 11:22:23 +03:00
Ilya Kirillov
9704a7aa7f New J2K: Add ReplaceCallWithBinaryOperatorInspection & MayBeConstantInspection to postProcessing 2019-04-03 11:22:22 +03:00
Ilya Kirillov
b7d6a905f3 New J2K: Fix extra spaces in StructuralPsiCompare 2019-04-03 11:22:22 +03:00
Ilya Kirillov
2c8483aef4 New J2K: Rearrange conversions & add new ones 2019-04-03 11:22:21 +03:00
Ilya Kirillov
7dd60a04ec New J2K: Add EnumClassConversion 2019-04-03 11:22:20 +03:00
Ilya Kirillov
17b96b8240 New J2K: Fix printing no semicolon in enum class 2019-04-03 11:22:19 +03:00
Ilya Kirillov
dcf7895314 New J2K: Make JKKtAssignmentStatementImpl field to be a child of JKBranchElement 2019-04-03 11:22:18 +03:00
Ilya Kirillov
56aa6f83af New J2K: Assume enum class in PrimaryConstructorDetectConversion 2019-04-03 11:22:18 +03:00
Ilya Kirillov
d02be5ae94 New J2K: Create init declaration from primary constructor in PrimaryConstructorDetectConversion 2019-04-03 11:22:17 +03:00
Ilya Kirillov
8ceca44b10 New J2K: Remove useless FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:22:16 +03:00
Ilya Kirillov
757675c4ca New J2K: Make JKType.updateNullability return the same type 2019-04-03 11:22:15 +03:00
Ilya Kirillov
104cf2eef5 New J2K: Add NATIVE to EXTERNAL modifiers conversion 2019-04-03 11:22:15 +03:00
Ilya Kirillov
5cb4abf95d New J2K: Add JavaStandardMethodsConversion 2019-04-03 11:22:14 +03:00
Ilya Kirillov
cd6bcb7878 New J2K: Assume that is expression type is always not null 2019-04-03 11:22:13 +03:00
Ilya Kirillov
1615b1c6b3 New J2K: Add support of Anonymous class initializers 2019-04-03 11:22:13 +03:00
Ilya Kirillov
be90db7fca New J2K: Add ParameterModificationInMethodCallsConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
aa173783aa New J2K: Add check that field is not initialized in constructor in ImplicitInitializerConversion 2019-04-03 11:22:12 +03:00
Ilya Kirillov
730c8ca495 New J2K: Fix java assignment to also conversion 2019-04-03 11:22:11 +03:00
Ilya Kirillov
4194ace762 New J2K: Add super expression qualifier 2019-04-03 11:22:10 +03:00
Ilya Kirillov
d75549f443 New J2K: Fix grouping post processing 2019-04-03 11:22:09 +03:00
Ilya Kirillov
763ea3480d New J2K: Add support of enum consts initializingClass 2019-04-03 11:22:09 +03:00
Ilya Kirillov
49a8a8f116 New J2K: Add support of grouped postProcessings & introduce VarToVal inspection 2019-04-03 11:22:08 +03:00
Ilya Kirillov
c7df104b36 New J2K: Add ConvertDataClass PostProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
5c8035b339 New J2K: Add ConvertGettersAndSetters postProcessing 2019-04-03 11:22:07 +03:00
Ilya Kirillov
daf1f6154e New J2K: Add more types to JKExpression.type 2019-04-03 11:22:06 +03:00
Ilya Kirillov
d47543820a New J2K: Add collection classes mapping to TypeMappingConversion 2019-04-03 11:22:05 +03:00
Ilya Kirillov
df5c2f90c1 New J2K: Add basic import list mapping 2019-04-03 11:22:04 +03:00
Ilya Kirillov
213aa9a86d New J2K: Add annotations for JKField 2019-04-03 11:22:03 +03:00
Ilya Kirillov
2633834741 New J2K: Add conversion of some java modifiers to kotlin annotations 2019-04-03 11:22:03 +03:00
Ilya Kirillov
0e6e0e6df1 New J2K: Stop printing multiline lambdas in a case of single statement inside 2019-04-03 11:22:02 +03:00
Ilya Kirillov
0712db8bd3 New J2K: Add filtering local imports in ImportStatementConversion 2019-04-03 11:22:02 +03:00
Ilya Kirillov
d4077a1622 New J2K: Add boxed types support to PrimitiveTypesInitializersConversion 2019-04-03 11:22:01 +03:00
Ilya Kirillov
f14aa2292f New J2K: Implement primitive type case for ImplicitInitializerConversion 2019-04-03 11:22:00 +03:00
Ilya Kirillov
fb3c7e87a1 New J2K: Fix binaryExpressionMethodSymbol in a case of not JKMultiverseKtClassSymbol 2019-04-03 11:21:59 +03:00
Ilya Kirillov
2c7e44f41e New J2K: Add checking for receiver type in for conversion's indicesByCollectionSize 2019-04-03 11:21:59 +03:00
Ilya Kirillov
ffbdafbe69 New J2K: Add LowerNullabilityInFunctionParametersConversion 2019-04-03 11:21:58 +03:00
Ilya Kirillov
a15f51950b New J2K: Add collection operations conversion 2019-04-03 11:21:57 +03:00
Ilya Kirillov
254d2f8b67 New J2K: Fix JKType.toKtType function 2019-04-03 11:21:57 +03:00
Ilya Kirillov
77eb9b1b37 New J2K: Fix if statement printing with empty then body 2019-04-03 11:21:55 +03:00
Ilya Kirillov
b21c52aecd New J2K: Fix JKClassSymbol's name printing in a case of nested class 2019-04-03 11:21:54 +03:00
Ilya Kirillov
599aa9435f New J2K: Move postProcessingRegistrar to a NewJ2KPostProcessingRegistrarImpl and revert old one 2019-04-03 11:21:54 +03:00
Ilya Kirillov
a80a30e0af New J2K: Fix that RemoveExplicitPropertyType does not work on local variables 2019-04-03 11:21:53 +03:00
Ilya Kirillov
a5b7831773 New J2K: Add array operation conversion 2019-04-03 11:21:52 +03:00
Ilya Kirillov
1faaada01f New J2K: Add import statement conversion 2019-04-03 11:21:51 +03:00
Ilya Kirillov
a19ae4bcc2 New J2K: Fix accessing to non-existing psi in TypeMappingConversion 2019-04-03 11:21:50 +03:00
Ilya Kirillov
17f86d69a7 New J2K: Calculate function return type nullability in JavaMethodToKotlinFunctionConversion 2019-04-03 11:21:49 +03:00
Ilya Kirillov
b076e7e881 New J2K: Fix for conversion due to changing modifier types 2019-04-03 11:21:48 +03:00
Ilya Kirillov
70225ac3d0 New J2K: Fix class access expression fq name when it starts with b "java.lang." 2019-04-03 11:21:47 +03:00
Ilya Kirillov
4a16f4cc9f New J2K: Fix multiple update expressions in psi for statements 2019-04-03 11:21:46 +03:00
Ilya Kirillov
f6f619ea27 New J2K: Add blockStatementWithoutBrackets to for statement conversion 2019-04-03 11:21:46 +03:00
Ilya Kirillov
03131dc138 New J2K: Add JKBlockStatementWithoutBrackets 2019-04-03 11:21:45 +03:00
Ilya Kirillov
4b0840beb1 New J2K: Add multiple updaters to Java for loop 2019-04-03 11:21:43 +03:00
Ilya Kirillov
9532dec452 New J2K: Make JKExpression.type nullable 2019-04-03 11:21:42 +03:00
Ilya Kirillov
28aeaa040e New J2K: Split conversions to Java --> Kotlin conversions and Kotlin --> Kotlin conversions 2019-04-03 11:21:41 +03:00
Ilya Kirillov
67c6192425 New J2K: Remove unused symbolByName 2019-04-03 11:21:40 +03:00
Ilya Kirillov
2c3e8a3909 New J2K: Add print conversion to PrintlnConversion 2019-04-03 11:21:40 +03:00
Ilya Kirillov
71fcbcb60a New J2K: Change type of JKType.classSymbol to JKClassSymbol 2019-04-03 11:21:39 +03:00
Ilya Kirillov
2292e0b792 New J2K: Fix enum constant constructing 2019-04-03 11:21:38 +03:00
Ilya Kirillov
b3dc0d4aff New J2K: Add package & imports declarations to JKFile, simplify JKFile constructing 2019-04-03 11:21:37 +03:00
Ilya Kirillov
3ea4ee9110 New J2K: Add throws list for java method & add JKClassLiteralExpression 2019-04-03 11:21:36 +03:00
Ilya Kirillov
69633e7a0f New J2K: Split ModifiersList to visibilityModifier, modalityModifier, mutabilityModifier and extraModifiers & introduce JKVariable which may have any subset of modifiers 2019-04-03 11:21:35 +03:00
Ilya Kirillov
5c6092c98c New J2K: Add mangling of name identifiers 2019-04-03 11:21:34 +03:00
Ilya Kirillov
0e9abf8ca3 New J2K: Add assert statement conversion 2019-04-03 11:21:33 +03:00
Ilya Kirillov
633c29a2de New J2K: Fix when final fields become vars 2019-04-03 11:21:33 +03:00
Ilya Kirillov
8ba8a2f197 New J2K: Fix binary expression's method symbol search 2019-04-03 11:21:32 +03:00
Ilya Kirillov
bb2c32a402 New J2K: Fix package statement position 2019-04-03 11:21:31 +03:00
Ilya Kirillov
e1108e1764 New J2K: Add anonymous object creation support JKNewExpression 2019-04-03 11:21:30 +03:00
Ilya Kirillov
f58d791a05 New J2K: Introduce type arguments 2019-04-03 11:21:29 +03:00
Ilya Kirillov
40c5b56c10 New J2K: Refactor brackets in new expression printing 2019-04-03 11:21:28 +03:00
Ilya Kirillov
a30311da45 New J2K: Add dummy field to property conversion 2019-04-03 11:21:27 +03:00
Ilya Kirillov
e0ac21c4ad New J2K: Collect and print imports 2019-04-03 11:21:27 +03:00
Ilya Kirillov
c6006927ac New J2K: Add optimize import to post processing 2019-04-03 11:21:26 +03:00
Ilya Kirillov
8f960f2f47 New J2K: Fix do while loop spaces 2019-04-03 11:21:25 +03:00
Ilya Kirillov
b24d683ebe New J2K: Make JKJavaNewArrayImpl a PsiOwner 2019-04-03 11:21:24 +03:00
Ilya Kirillov
a1600bd83a New J2K: Add ForIn statement conversion 2019-04-03 11:21:23 +03:00
Ilya Kirillov
a0ab7492a8 New J2K: Add JavaTokenType.EXCL token to JKJavaOperatorToken.toKtToken() 2019-04-03 11:21:23 +03:00
Ilya Kirillov
bcaea3182e New J2K: Fix JKStatement.isEmpty method by not considering empty block statement as empty statement 2019-04-03 11:21:22 +03:00
Ilya Kirillov
f223a6ebd1 New J2K: Use default psiContext in AssignmentAsExpressionToAlsoConversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
28ef4c5dfa New J2K: Main function conversion 2019-04-03 11:21:21 +03:00
Ilya Kirillov
2f1a8831b2 New J2K: Add basic annotations support 2019-04-03 11:21:20 +03:00
Ilya Kirillov
f752796408 New J2K: Fix existing test data 2019-04-03 11:21:19 +03:00
Ilya Kirillov
5236858c20 New J2K: Add JKThrowStatement and JKContinueStatement to SwitchStatementConversion's falls fallsThrough() 2019-04-03 11:21:19 +03:00
Ilya Kirillov
42dc96d9a8 New J2K: Fix switch statement cases printing 2019-04-03 11:21:17 +03:00
Ilya Kirillov
3ea1a937c0 New J2K: Place else case in the end in switch statement conversion 2019-04-03 11:21:16 +03:00
Ilya Kirillov
115fe2cb88 New J2K: Fix statements in lambda expression 2019-04-03 11:21:15 +03:00
Ilya Kirillov
136a254da5 New J2K: Fix showing ":" in type parameter type 2019-04-03 11:21:14 +03:00
Ilya Kirillov
4080804391 New J2K: Add JKPackageDeclaration 2019-04-03 11:21:14 +03:00
Ilya Kirillov
2b6ac84dda New J2K: Add qualified label to JKThisExpression 2019-04-03 11:21:13 +03:00
Ilya Kirillov
71408c0b14 New J2K: Fix class modifiers conversion 2019-04-03 11:21:12 +03:00
Ilya Kirillov
eb0182c5a9 New J2K: Remove extra JKKtModifier.INTERNAL because there is already JKVisibilityModifier.INTERNAL 2019-04-03 11:21:11 +03:00
Ilya Kirillov
4f30283744 New J2K: Add printing of JKClassAccessExpression 2019-04-03 11:21:11 +03:00
Ilya Kirillov
2d9a9613f6 New J2K: Fix conversion of inner classed methods 2019-04-03 11:21:10 +03:00
Ilya Kirillov
f76a3504cc New J2K: Inherit JKBinaryExpression & JKUnaryExpression from JKOperatorExpression 2019-04-03 11:21:09 +03:00
Ilya Kirillov
9374816823 New J2K: Add conversion of prefix and postfix expressions 2019-04-03 11:21:08 +03:00
Ilya Kirillov
3d418d8904 New J2K: Add == to JKJavaOperatorToken.toKtToken 2019-04-03 11:21:07 +03:00
Ilya Kirillov
4310575de9 New J2K: Add ';' in a case of For loop and While loop empty body 2019-04-03 11:21:07 +03:00
Ilya Kirillov
3ddc05fdd9 New J2K: Add forEach statement generation 2019-04-03 11:21:06 +03:00
Ilya Kirillov
7b5ffce7aa New J2K: Separate statements in block 2019-04-03 11:21:05 +03:00
Ilya Kirillov
9a1e5582b6 New J2K: Render list separator as function 2019-04-03 11:21:04 +03:00
Ilya Kirillov
7af03c2859 New J2K: Set exception types as non nullable in try statement conversion 2019-04-03 11:21:04 +03:00
Ilya Kirillov
3771ccedb7 New J2K: Add JKType.updateNullability function 2019-04-03 11:21:03 +03:00
Ilya Kirillov
2e0c7e9128 New J2K: Fix spaces in structural tests 2019-04-03 11:21:02 +03:00
Ilya Kirillov
61d6709cb7 New J2K: Add temporary sorting of class declarations 2019-04-03 11:21:01 +03:00
Ilya Kirillov
03df0f1164 New J2K: Add default mutability to property in FieldToPropertyConversion 2019-04-03 11:21:01 +03:00
Ilya Kirillov
0873045718 New J2K: Print & filter primary constructor modifiers 2019-04-03 11:20:59 +03:00
Ilya Kirillov
7e7d865054 New J2K: Add enum constants 2019-04-03 11:20:59 +03:00
Ilya Kirillov
ff700b5399 New J2K: Add TypeElement.present() function 2019-04-03 11:20:58 +03:00
Ilya Kirillov
77713c1877 New J2K: Add NoType for ktProperty 2019-04-03 11:20:57 +03:00
Ilya Kirillov
a55d2b6597 New J2K: Add missing modifier priorities 2019-04-03 11:20:57 +03:00
Ilya Kirillov
55c304827a New J2K: Do not convert class to object in ClassToObjectPromotionConversion when it has inheritors 2019-04-03 11:20:56 +03:00
Ilya Kirillov
70def791c0 New J2K: Fix ClassToObjectPromotionConversion when empty constructor 2019-04-03 11:20:56 +03:00
Ilya Kirillov
44185c1246 New J2K: Fix adding init section with empty body 2019-04-03 11:20:55 +03:00
Ilya Kirillov
6a8f3a7a84 New J2K: Fix println's in printer 2019-04-03 11:20:55 +03:00
Ilya Kirillov
0bc1e96f0d New J2K: Add type parameter type 2019-04-03 11:20:54 +03:00
Ilya Kirillov
524b07f6ac New J2K: Add variance type parameters 2019-04-03 11:20:53 +03:00
Ilya Kirillov
14f5d866ee New J2K: Add type parameters to methods declaration 2019-04-03 11:20:53 +03:00
Ilya Kirillov
4097ebe583 New J2K: Add typeParameter's upper bounds 2019-04-03 11:20:52 +03:00
Ilya Kirillov
33b66ec17e New J2K: Add typeParameters to JKClass 2019-04-03 11:20:51 +03:00
Ilya Kirillov
1f59f91aeb New J2K: Add typeParameter & typeParameterList 2019-04-03 11:20:50 +03:00
Ilya Kirillov
b9d432bfac New J2K: Call RemoveEmptyClassBodyIntention 2019-04-03 11:20:49 +03:00
Ilya Kirillov
ba08f233b6 New J2K: Try with resource conversion 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d602b9e47 New J2K: Add "use" expression generator 2019-04-03 11:20:48 +03:00
Ilya Kirillov
8d45bce06a New J2K: Add try statement 2019-04-03 11:20:47 +03:00
Ilya Kirillov
594d0ba7e9 New J2K: Add throw statement 2019-04-03 11:20:46 +03:00
Ilya Kirillov
66f12d9fea New J2K: Do not print extra mutability modifier in ktProperty 2019-04-03 11:20:45 +03:00
Ilya Kirillov
5ba3d6bc67 New J2K: Fix parameters modifiers 2019-04-03 11:20:45 +03:00
Ilya Kirillov
9e98e36ac7 New J2K: Use RecursiveApplicableConversionBase in FieldInitializersInPrimaryFromParamsConversion 2019-04-03 11:20:44 +03:00
Ilya Kirillov
78c5b4acd5 New J2K: Add JKEmptyStatement 2019-04-03 11:20:43 +03:00
Ilya Kirillov
e10a81a942 New J2K: Use JKDeclaration instead of ValIdentifier in ForLoop 2019-04-03 11:20:43 +03:00
Ilya Kirillov
d228d6110c New J2K: Move expression creation functions to separated file 2019-04-03 11:20:42 +03:00
Ilya Kirillov
fad9c52853 New J2K: Add type calculating for equals operator 2019-04-03 11:20:41 +03:00
Ilya Kirillov
a1ac0c2e4b New J2K: Fix for conversion due to using operator tokens 2019-04-03 11:20:41 +03:00
Ilya Kirillov
1851239e7e New J2K: Add JKElement.detached function 2019-04-03 11:20:40 +03:00
Ilya Kirillov
753070b6c7 New J2K: Refactor code 2019-04-03 11:20:39 +03:00
Ilya Kirillov
3030a03584 New J2K: Replace backAnnotator with PsiOwner 2019-04-03 11:20:38 +03:00
Ilya Kirillov
c948e2d086 New J2K: Fix operatorName in JKKtSingleValueOperatorToken 2019-04-03 11:20:37 +03:00
Ilya Kirillov
6051b455bf New J2K: Add type for unresolved symbols 2019-04-03 11:20:36 +03:00
Ilya Kirillov
41640e1a15 New J2K: Add dependency to idea-core in j2k 2019-04-03 11:20:36 +03:00
Ilya Kirillov
29c536579f New J2K: Add converting type functions from kotlin one to j2k one 2019-04-03 11:20:35 +03:00
Ilya Kirillov
dbdd39c6ab New J2K: Add type calculating for more kinds of JKExpressions 2019-04-03 11:20:34 +03:00
Ilya Kirillov
71b3fe33a3 New J2K: Add operator tokens 2019-04-03 11:20:33 +03:00
Ilya Kirillov
cd2a17ae56 New J2K: Add calculating type for binary expressions & building binary expression with correct return type 2019-04-03 11:20:32 +03:00
Ilya Kirillov
5e4b39f10f New J2K: Add calculating type for JKExpression 2019-04-03 11:20:32 +03:00
Ilya Kirillov
27526cf866 New J2K: Add labeled statement 2019-04-03 11:20:31 +03:00
Ilya Kirillov
0a08467b45 New J2K: Add continue statement 2019-04-03 11:20:30 +03:00
Ilya Kirillov
ed61aac4fd New J2K: Add Java for loop to Kotlin while or for in loop conversion 2019-04-03 11:20:29 +03:00
Ilya Kirillov
07f99fe0d2 New J2K: Don't move initilizer to constructor if types are not the same 2019-04-03 11:20:29 +03:00
Ilya Kirillov
baa9b714d1 New J2K: Add init block 2019-04-03 11:20:28 +03:00
Ilya Kirillov
b6239a9130 New J2K: Fix InsertDefaultPrimaryConstructorConversion acceptability determining 2019-04-03 11:20:27 +03:00
Ilya Kirillov
d688b6c6da New J2K: Add filter & sort modifiers conversion 2019-04-03 11:20:26 +03:00
Ilya Kirillov
a7e0f18a57 New J2K: Add primary constructor initializers conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
2aafeda33b New J2K: Add detect primary constructors conversion 2019-04-03 11:20:25 +03:00
Ilya Kirillov
44d2a6f432 New J2K: Add printing of Java new expression 2019-04-03 11:20:24 +03:00
Ilya Kirillov
6d283b0ac1 New J2K: Add operation's text for some java operators 2019-04-03 11:20:23 +03:00
Ilya Kirillov
451a462b07 New J2K: Add printing of do-while statement 2019-04-03 11:20:22 +03:00
Ilya Kirillov
19c569e8e2 New J2K: Add conversion of Java instanceof expression to Kotlin is expression 2019-04-03 11:20:21 +03:00
Ilya Kirillov
c3ffaa34f8 New J2K: Do not ignore unused vals in CanBeVal inspection in postprocessing 2019-04-03 11:20:20 +03:00
Ilya Kirillov
4d1b2a8d5b New J2K: Add Java switch statement to Kotlin when expression conversion 2019-04-03 11:20:20 +03:00
Ilya Kirillov
6e079e38fe New J2K: Add AST copy tree function 2019-04-03 11:20:19 +03:00
Ilya Kirillov
18164b116b New J2K: Add support of break statements 2019-04-03 11:20:18 +03:00
Simon Ogorodnik
7e2d0695fe New J2K: Use context type for lambda in block to run call conversion 2019-04-03 11:20:18 +03:00
Dimach
2f1c621b5f New J2K: Improve type system and nullability computation in type mapper 2019-04-03 11:20:17 +03:00
Dimach
abc4104ba7 New J2K: Implement Array init conversions 2019-04-03 11:20:17 +03:00
Dimach
f3ffb2acfd New J2K: Implement assignment simplify conversion 2019-04-03 11:20:16 +03:00
Simon Ogorodnik
77819be8f3 New J2K: Add function to lookup symbols by fqName 2019-04-03 11:20:15 +03:00
Dimach
c43bfcb185 New J2K: Introduce context type 2019-04-03 11:20:14 +03:00
Simon Ogorodnik
986b38102e New J2K: Add insert default constructor conversion 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
aef8a7a8f1 New J2K: Clearer return type for recurse 2019-04-03 11:20:13 +03:00
Simon Ogorodnik
6fd2cc73cf New J2K: Remove incorrect ClassKind 2019-04-03 11:20:12 +03:00
Simon Ogorodnik
815070013f New J2K: Split conversions into sequential and batch 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
d793769e92 New J2K: Add block statement to run conversion 2019-04-03 11:20:11 +03:00
Simon Ogorodnik
f496a472f4 New J2K: Even better test diff UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
15981fed17 New J2K: Improve UI 2019-04-03 11:20:10 +03:00
Simon Ogorodnik
3dbdb2b64d New J2K: Support 'override' modality 2019-04-03 11:20:09 +03:00
Simon Ogorodnik
dcffb60dc9 New J2K: Create UI for tracking test changes 2019-04-03 11:20:08 +03:00
Simon Ogorodnik
e0d3ff7507 New J2K: WIP: Field to property conversion 2019-04-03 11:20:07 +03:00
Simon Ogorodnik
dbf4ba536f New J2K: Implement removing of explicit types in post-processing 2019-04-03 11:20:06 +03:00
Simon Ogorodnik
1c1804f22d New J2K: Fix after merge 2019-04-03 11:20:05 +03:00
Simon Ogorodnik
2844f8d5d9 New J2K: Add conversion to promote classes with only companions into objects 2019-04-03 11:20:04 +03:00
Simon Ogorodnik
fba5ac4c1a New J2K: Post-processing to remove redundant opens in objects 2019-04-03 11:20:03 +03:00
Simon Ogorodnik
ae1f27e327 New J2K: Add conversion that moves statics to companion object 2019-04-03 11:20:02 +03:00
Simon Ogorodnik
38760a8b7c New J2K: Support this qualifier in default arguments converter 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
b868214992 New J2K: Improve debug tree printer, now it capable of printing universe symbols 2019-04-03 11:20:01 +03:00
Simon Ogorodnik
53ebdb4a02 New J2K: Add missing accept for NameIdentifier 2019-04-03 11:20:00 +03:00
Simon Ogorodnik
4eb070a2dc New J2K: Support QuickFixActionBase for inspections in J2K Post-processing 2019-04-03 11:19:59 +03:00
Simon Ogorodnik
bc5ff67aff New J2K: Correctly support variables mutability 2019-04-03 11:19:58 +03:00
Simon Ogorodnik
f147907799 New J2K: Fix incorrect testData (due to nullability bug in old j2k) 2019-04-03 11:19:57 +03:00
Simon Ogorodnik
b530a30882 New J2K: Support different testData for new converter
Sometimes old testData is incorrect
2019-04-03 11:19:56 +03:00
Simon Ogorodnik
800b09b183 New J2K: Add temporary conversion for println calls 2019-04-03 11:19:56 +03:00
Simon Ogorodnik
911f234ba4 New J2K: Implement basic default argument converter 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
34b535c8ab New J2K: Add missing accept for null literal 2019-04-03 11:19:55 +03:00
Simon Ogorodnik
4637903e00 New J2K: Add conversion which will initialize java implicit initialized fields 2019-04-03 11:19:54 +03:00
Simon Ogorodnik
61fd76a89a New J2K: Support relaxed visibility for members of package-local classes 2019-04-03 11:19:53 +03:00
Simon Ogorodnik
1b7c980c83 New J2K: Put braces on same line, if block is empty 2019-04-03 11:19:52 +03:00
Simon Ogorodnik
63fd2439bf New J2K: Hack around type nullability calculation 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
65e0694ba1 New J2K: Primary constructor conversion 2019-04-03 11:19:51 +03:00
Simon Ogorodnik
6793c1d08f New J2K: Constructor conversion 2019-04-03 11:19:50 +03:00
Simon Ogorodnik
e83844e941 New J2K: Inner class conversion 2019-04-03 11:19:49 +03:00
Simon Ogorodnik
c87cd20a9d New J2K: Add rendering for type-parameters 2019-04-03 11:19:48 +03:00
Simon Ogorodnik
b12a91c111 New J2K: Add test with structural compare and cleanup duplicated code in tests 2019-04-03 11:19:47 +03:00
Simon Ogorodnik
ac20e9ba83 New J2K: Render list of implemented correctly 2019-04-03 11:19:46 +03:00
Simon Ogorodnik
b8bbd85bc7 New J2K: Preserve text for unresolved types, and render it in code builder 2019-04-03 11:19:45 +03:00
Simon Ogorodnik
7e2be15fcc New J2K: Clean-up parenthesizing and block rendering in code builder 2019-04-03 11:19:44 +03:00
Simon Ogorodnik
07a33ceebd New J2K: Remove unnecessary modifiers in post-processing 2019-04-03 11:19:43 +03:00
Simon Ogorodnik
13a63e421b New J2K: Print function modifiers and relax method visibility in test 2019-04-03 11:19:43 +03:00
Dimach
fe180138f3 New J2K: Assignment conversion second part. 2019-04-03 11:19:42 +03:00
Dimach
3a2b2d9e97 New J2K: Assignment expression conversion improvements 2019-04-03 11:19:41 +03:00
Simon Ogorodnik
b702e207c0 New J2K: Add inheritance and support while & type-casts in code builder 2019-04-03 11:19:40 +03:00
Simon Ogorodnik
928647462e New J2K: Support general inspections with intention wrapper as quickFix 2019-04-03 11:19:39 +03:00
Simon Ogorodnik
c41be3274e New J2K: Cleanup code generation 2019-04-03 11:19:38 +03:00
Simon Ogorodnik
2e7940149f New J2K: Break line after class def 2019-04-03 11:19:37 +03:00
Simon Ogorodnik
049bb4a8af New J2K: Don't add abstract if not class 2019-04-03 11:19:37 +03:00
Dimach
d73b006b18 New J2K: Lambda expressions. 2019-04-03 11:19:36 +03:00
Dimach
795bfa4b2f New J2K: Fix array assignment. 2019-04-03 11:19:35 +03:00
Dimach
4a0df846de New J2K: Some changes to assignment expression. 2019-04-03 11:19:34 +03:00
Dimach
0078a5a61b New J2K: Symbol provider refactor. 2019-04-03 11:19:33 +03:00
Dimach
e1f47823d4 New J2K: Array access expression. 2019-04-03 11:19:32 +03:00
Dimach
81c0dae139 New J2K: Polyadic expression conversion. 2019-04-03 11:19:31 +03:00
Dimach
15ad2af268 New J2K: More binary expressions support and boolean literals. 2019-04-03 11:19:30 +03:00
Dimach
d183285a75 New J2K: Added unresolved field references. 2019-04-03 11:19:29 +03:00
Simon Ogorodnik
f6a5ac9d97 New J2K: Standardize modality and visibility 2019-04-03 11:19:28 +03:00
Simon Ogorodnik
0ec2fb3d17 New J2K: Introduce JKFile 2019-04-03 11:19:27 +03:00
Simon Ogorodnik
e4fc4b8218 New J2K: Create services for new j2k 2019-04-03 11:19:26 +03:00
Simon Ogorodnik
9d3805defe New J2K: Apply post-processing to nj2k results 2019-04-03 11:19:25 +03:00
Simon Ogorodnik
b216574298 New J2K: Support general inspections in j2k post-processing 2019-04-03 11:19:24 +03:00
Simon Ogorodnik
ccb941ab1c New J2K: Fix type mapper 2019-04-03 11:19:23 +03:00
Simon Ogorodnik
279c835d04 New J2K: Fix nullability for converted primitive types 2019-04-03 11:19:22 +03:00
Dimach
72c88c9003 New J2K: Reference resolve for parameters. 2019-04-03 11:19:22 +03:00
Dimach
6f84750af4 New J2K: Fixed resolve of class reference. 2019-04-03 11:19:21 +03:00
Dimach
97e38615f1 New J2K: Correct resolve of local variables. 2019-04-03 11:19:20 +03:00
Dimach
485f5c7e37 New J2K: Binary expression conversion 2019-04-03 11:19:19 +03:00
Dimach
674b3ce02e New J2K: Fixed modifiers conversion, expression test now can pass. 2019-04-03 11:19:18 +03:00
Dimach
b33f5ec58f New J2K: Fixed wrong whitespace 2019-04-03 11:19:18 +03:00
Dimach
8430ada13b New J2K: Fixed few bugs in conversions and symbols improvements. 2019-04-03 11:19:17 +03:00
Dimach
39cf373286 New J2K: Operators translation. 2019-04-03 11:19:16 +03:00
Dimach
21ae28025c New J2K: Declaration statement and local variables. 2019-04-03 11:19:16 +03:00
Dimach
14dd4fc92f New J2K: Added modifiers conversion and correct resolve of void type. 2019-04-03 11:19:15 +03:00
Dimach
ab723b1d39 New J2K: Added more cases to code builder. 2019-04-03 11:19:14 +03:00
Dimach
b06f0fe848 New J2K: Code builder now VoidVisitor 2019-04-03 11:19:14 +03:00
Dimach
8ce3673aaf New J2K: Fixed array initializer 2019-04-03 11:19:13 +03:00
Dimach
6096b1fd56 New J2K: Java polyadic expression 2019-04-03 11:19:13 +03:00
Dimach
4fe9b6a7c6 New J2K: If expression improvements.
Fixed field resolve.
2019-04-03 11:19:12 +03:00
Simon Ogorodnik
986cb5be27 New J2K: Add more elements to code builder 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
a9ff38f1fa New J2K: Rename parameters to match supertype 2019-04-03 11:19:11 +03:00
Simon Ogorodnik
7fcdcb20d6 New J2K: Some code-builder basic stuff 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
ad0721aae7 New J2K: Extract fqName resolution 2019-04-03 11:19:10 +03:00
Simon Ogorodnik
00c52df519 New J2K: Add missing accept's 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
235dacfd88 New J2K: Copy return type 2019-04-03 11:19:09 +03:00
Simon Ogorodnik
caa4af07c1 New J2K: Fix crash in fqName resolution 2019-04-03 11:19:08 +03:00
Simon Ogorodnik
2c2bd9ab5a New J2K: Support all java operators 2019-04-03 11:19:07 +03:00
Dimach
6dc8933a93 New J2K: While, switch, conditional expression, moved if. 2019-04-03 11:19:07 +03:00
Simon Ogorodnik
d718fae6d9 New J2K: Deal with unresolved class types 2019-04-03 11:19:06 +03:00
Simon Ogorodnik
c53f56629e New J2K: Correctly resolve references to default constructor 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
0e2dac0899 New J2K: Add nullability to all types 2019-04-03 11:19:05 +03:00
Simon Ogorodnik
58de0ae6bc New J2K: Always use text for literals 2019-04-03 11:19:04 +03:00
Dimach
7fbff168dd New J2K: Symbol provider improvements. 2019-04-03 11:19:03 +03:00
Dimach
45eecf2c90 New J2K: Added this and super expressions. 2019-04-03 11:19:02 +03:00
Dimach
a1d37034c4 New J2K: If, for, instanceof, code block statement. 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
607d9820e7 New J2K: Add body stub for abstract methods & set return type to void for <init> 2019-04-03 11:19:01 +03:00
Simon Ogorodnik
cb4474b9a4 New J2K: Add literal conversion 2019-04-03 11:19:00 +03:00
Simon Ogorodnik
c84ecb162e New J2K: Extract common conversions logic to base class 2019-04-03 11:18:59 +03:00
Dimach
003cee8cc1 New J2K: Added assertion statement and more operators. 2019-04-03 11:18:59 +03:00
Dimach
3bbef363e6 New J2K: Added declaration statements, local variables and stub expression. 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
26c011b44a New J2K: Add todo about missing lambda expression element 2019-04-03 11:18:58 +03:00
Simon Ogorodnik
a5f0097dc7 New J2K: Add conversion for assignment as expression to also call 2019-04-03 11:18:57 +03:00
Simon Ogorodnik
fd69efa4c2 New J2K: Add missing literals and cleanup literal handling in tree builder 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
b7fd8e32cb New J2K: Introduce invalidate to mark element for removal, freeing it's children 2019-04-03 11:18:56 +03:00
Simon Ogorodnik
7c5e9cd669 New J2K: Add all primitive types 2019-04-03 11:18:55 +03:00
Simon Ogorodnik
77b6eca76e New J2K: Cleanup element impls to reference nested elements via delegates 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
9f7146d8b9 New J2K: Prohibit to override acceptChildren for BranchElementBase 2019-04-03 11:18:54 +03:00
Simon Ogorodnik
855d713368 New J2K: Use require & check instead of assert in tree consistency check 2019-04-03 11:18:53 +03:00
Simon Ogorodnik
7c278bfbab New J2K: Extract base from concrete implementations 2019-04-03 11:18:52 +03:00
Dimach
bfb0f4a369 New J2K: Type system refactored, parents from types removed, added JKTypeElement 2019-04-03 11:18:52 +03:00
Simon Ogorodnik
bc645a12b5 New J2K: More info in TODO 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
278cf82346 New J2K: Use proper tree structure in kt elements 2019-04-03 11:18:51 +03:00
Simon Ogorodnik
13475cde01 New J2K: Add accept 2019-04-03 11:18:50 +03:00
Simon Ogorodnik
4892784f70 New J2K: Improve debug tree printer for types 2019-04-03 11:18:49 +03:00
Dimach
aea0511486 New J2K: Resolve symbols properly 2019-04-03 11:18:49 +03:00
Dimach
f912639999 New J2K: Done symbols 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
1e4737b4b2 New J2K: Fix reference resolution in type mapper conversion 2019-04-03 11:18:48 +03:00
Simon Ogorodnik
7cccb99982 New J2K: WIP: Type mapper 2019-04-03 11:18:47 +03:00
Dimach
f64c32fd71 New J2K: Changed references to symbols. 2019-04-03 11:18:46 +03:00
Simon Ogorodnik
985e94fbf3 New J2K: Add from argument to detach
Support detach/attach/multilist in applyRecursive

Clarify attach/detach/onElementChanged order
2019-04-03 11:18:46 +03:00
Simon Ogorodnik
9b205c2825 New J2K: Remove multiverse 2019-04-03 11:18:45 +03:00
Dimach
83f9054a7e New J2K: Added list child into JKBranchElement. Added attach and detach method to JKElement 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
f691fb457e New J2K: WIP: Type mapping conversion 2019-04-03 11:18:44 +03:00
Simon Ogorodnik
a55591011a New J2K: WIP: New field to property conversion 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
edd23c7a83 New J2K: WIP: Introduce symbols instead of references 2019-04-03 11:18:43 +03:00
Simon Ogorodnik
4b3fdbcb0b New J2K: Enable effect-system and new inference 2019-04-03 11:18:42 +03:00
Simon Ogorodnik
9ca6829bda New J2K: Cleanup 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
254179321c New J2K: Rename visitable JKElement to JKTreeElement 2019-04-03 11:18:41 +03:00
Simon Ogorodnik
3aeffe25ee New J2K: Try another approach to tree structure 2019-04-03 11:18:40 +03:00
Simon Ogorodnik
4551d3921b New J2K: Fix after merge 2019-04-03 11:18:39 +03:00
Dimach
6806ef8cf6 New J2K: Separated multiverse and universe declarations 2019-04-03 11:18:39 +03:00
Dimach
c398940679 New J2K: Tree refactor.
Added parents, transformers removed.
2019-04-03 11:18:38 +03:00
Dimach
2ee7e3c0e8 New J2K: Fixed errors 2019-04-03 11:18:38 +03:00
Dimach
aeae668f3d New J2K: Addded kt expressions and changed literals logic. 2019-04-03 11:18:37 +03:00
Dimach
fb32783168 New J2K: ArrayType and PrimitiveType 2019-04-03 11:18:36 +03:00
Dimach
09d52d13b8 New J2K: Type system. 2019-04-03 11:18:36 +03:00
Dimach
dfd745d55b New J2K: Fixed errors. 2019-04-03 11:18:35 +03:00
Dimach
10ff8d500b New J2K: References base done. 2019-04-03 11:18:34 +03:00
knize
c8c9c19a91 New J2K: References base 2019-04-03 11:18:34 +03:00
Kirill Knize
70c291f222 New J2K: Add kotlin declarations to IR (#9) 2019-04-03 11:18:33 +03:00
Kirill Knize
c662813b09 New J2K: Implement transformChildren here and there
PR (#6)
2019-04-03 11:18:33 +03:00
Simon Ogorodnik
2f38edb55f New J2K: Display element type when hit visitElement 2019-04-03 11:18:32 +03:00
Simon Ogorodnik
a4630af109 New J2K: Simple code builder 2019-04-03 11:18:31 +03:00
Simon Ogorodnik
dc73d415ad New J2K: Fix declarations to JK conversion 2019-04-03 11:18:31 +03:00
Dimach
dd499d7a13 New J2K: Rebase to latest changes. 2019-04-03 11:18:30 +03:00
Dimach
a94957aa0f New J2K: Added java -> jk converter for new array, type cast, array access and parenthesized expression. 2019-04-03 11:18:30 +03:00
Dimach
4ecbd13e06 New J2K: Added java -> jk converter for new expression. 2019-04-03 11:18:29 +03:00
Dimach
5bf806b85c New J2K: Added java -> jk converter for field access. 2019-04-03 11:18:28 +03:00
Dimach
98d01d600a New J2K: Added java -> jk converter for method call. 2019-04-03 11:18:28 +03:00
Dimach
9bfd8e4453 New J2K: Added basic expression converter. 2019-04-03 11:18:27 +03:00
Knize
d17548ba73 New J2K: Nj2k modifiers hierarchy (#3) 2019-04-03 11:18:26 +03:00
Knize
24803e31fd New J2K: Add class mapper 2019-04-03 11:18:26 +03:00
knize
e3097d8c1f New J2K: class tree mapper 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
e33df530cd New J2K: First conversion 2019-04-03 11:18:25 +03:00
Simon Ogorodnik
8ac5eadadc New J2K: Update transformers to new style 2019-04-03 11:18:24 +03:00
Simon Ogorodnik
517dd9a260 New J2K: Fix debug tree printer after switching to single visitor 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
8ff78611ba New J2K: Make generics in transformers accept least common interface 2019-04-03 11:18:23 +03:00
Simon Ogorodnik
c1f50d3594 New J2K: Drop separated visitors 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
68c03a6236 New J2K: Add transformers 2019-04-03 11:18:22 +03:00
Simon Ogorodnik
4f7c46741e New J2K: Add debug tree visitor and some tree elements 2019-04-03 11:18:21 +03:00
Simon Ogorodnik
3ff0287c9f New J2K: Stub for JavaField initializer 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
e77fe74284 New J2K: Add Block primitive 2019-04-03 11:18:20 +03:00
Simon Ogorodnik
7ce3c57896 New J2K: Add some primitive tests for new converter 2019-04-03 11:18:19 +03:00
Simon Ogorodnik
66d6ac745f New J2K: Implement basic output generation 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
5fd3a78dbe New J2K: Add basic tree structure and visitor generation script 2019-04-03 11:18:18 +03:00
Simon Ogorodnik
9d9dbb4c25 New J2K: Add stub for JKTree builder 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
f50254d555 New J2K: Move TODO to NewJavaToKotlinConverter 2019-04-03 11:18:17 +03:00
Simon Ogorodnik
ff0b09f77b New J2K: Replicate J2K Single File test for New J2K 2019-04-03 11:18:16 +03:00
Simon Ogorodnik
b151e9c48c New J2K: Add New J2K entry-point stub 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
fb49267819 New J2K: Cleanup J2K single file test and make it extensible 2019-04-03 11:18:15 +03:00
Simon Ogorodnik
f2595e58e5 New J2K: Add newSrc source root for J2K 2019-04-03 11:18:14 +03:00
Simon Ogorodnik
1fd5738a60 Add kapt3-idea to J2K classpath to avoid spam in logs 2019-04-03 11:18:14 +03:00
Vyacheslav Gerasimov
394031a183 Build: Fix upload_plugins.gradle broken after migration to gradle 5.0
`<< {` syntax is removed since gradle 5.0
2019-04-02 23:14:23 +03:00
Ilya Gorbunov
04bbf23936 Add explicit imports of kotlin.ranges more specific functions
The extensions 'contains' and 'reversed' from kotlin.ranges can be more
specific for IntRange, LongRange, etc than the same functions from
kotlin.collections, yet they lose in overload resolution to the latter
ones when invoked from kotlin.collections package
because of same package package extensions are preferred (KT-30633).
2019-04-02 21:28:33 +03:00
Ilya Gorbunov
d77f76bdb0 Clarify wording in Random.nextInt/Long/UInt/ULong docs
#KT-30704 Fixed
2019-04-02 21:28:32 +03:00
Andrey Uskov
792fae4afc Optimize memory usage during import of MPP projects
#KT-30767 Fixed
2019-04-02 21:23:07 +03:00
Dmitry Gridin
3ca1c7b55d "Convert property to function" intention should warn about the property overloads at child class constructor
#KT-29764 Fixed
2019-04-02 22:53:56 +07:00
Dmitry Gridin
c8ea62a0d9 Change function signature should change type parameters
#KT-22896 Fixed
2019-04-02 22:53:13 +07:00
Dmitry Gridin
5e613554ee Minor: refactoring ChangeMemberFunctionSignatureFix 2019-04-02 22:53:13 +07:00
Dmitry Gridin
c48c274e59 Minor: refactoring ChangeFunctionSignature quickfix 2019-04-02 22:53:13 +07:00
Ilya Matveev
cb38f13399 Gradle plugin: Enable missing mingw_x86 target for K/N 2019-04-02 20:59:12 +07:00
Alexander Gorshenev
4332ce9884 Grab constructor call type parameters from its class, not from the contructor 2019-04-02 16:55:58 +03:00
Toshiaki Kameyama
e082522cdf Strip trailing spaces on Save: do not strip trailing spaces inside raw String
#KT-13048 Fixed
2019-04-02 15:27:08 +03:00
Ting-Yuan Huang
9fc869397d IrBuiltins: refactoring for equality checks
Previously,
* Equals performs IEEE 754 equality check for floating points and
  byte-to-byte checks for other types, including references.
* Ieee754Equals performs IEEE 754 for primitive types
* TotalOrderEquals performs total order equals to all types, including
  floating points.

Now it is simplified,
* Equals performs total order checks for all types.
* Ieee754Equals performs IEEE 754 for primitive types.
* (TotalOrderEquals is removed.)
2019-04-02 13:16:31 +02:00
Ilya Chernikov
9ddb64288c Avoid warning about scripting subplugin for MPP project
Temporary solution, the subplugin should be adapted to the new MPP
#KT-30742 fixed
2019-04-02 12:28:06 +02:00
Mikhail Zarechenskiy
63bdabcfae [NI] Clean up after merge with 3998e842 2019-04-02 12:21:15 +03:00
Mikhail Zarechenskiy
c458393e2f [NI] Do not avoid trivial constraints if they aren't from upper bounds
Since we skipped trivial constraint with `Any?` from parameter type of
 function `equals`, the compiler thought that there is no proper
 constraints (upper bounds do not matter here) and marked resolved
 call as a failed one, then diagnostic about missing equals was added

 Also, tune `TrivialConstraintTypeInferenceOracle` for `Any?`-like
 constraints

 #KT-30724 Fixed
2019-04-02 12:21:14 +03:00
Mikhail Zarechenskiy
5fa518fd55 Revert "Temporary fix for NI to compile against bootstrap compiler"
This reverts commit 791ab05e08.

 Problem was fixed in 4a1b9dcc & 1ac35420
2019-04-02 12:21:14 +03:00
Nikolay Krasko
5723bfdcaf Add a point about invalidated state between inspection checks and quick-fix run 2019-04-02 11:48:47 +03:00
Burak Eregar
9ab54d0e44 Fix: String templates suggest removing curly braces for backtick escaped identifiers 2019-04-02 11:48:47 +03:00
Toshiaki Kameyama
17a4506575 Keyword completion: complete data class with parentheses
#KT-30511 Fixed
2019-04-02 11:48:47 +03:00
Nikolay Krasko
f1a31652b3 Add action for collection basic information about Kotlin project (KT-11242)
#KT-11242 Fixed
2019-04-02 11:48:47 +03:00
Sergey Rostov
3465a30201 JPS Build: exclude intellij-core that comes from android tools
#KT-30247 Fixed
2019-04-02 09:27:26 +03:00
Toshiaki Kameyama
61f3e776a7 Add 'Covariant equals' inspection
#KT-29798 Fixed
2019-04-02 13:19:05 +07:00
Simon Ogorodnik
3998e842f1 Abstract NewInference & related from KotlinType
Cleanup TypeConstructors & KotlinTypes in VariableFixationFinder
Cleanup TypeConstructors & KotlinTypes in TypeVariableDirectionCalculator
Cleanup KotlinTypes in TypeCheckerContext for ConstraintSystem
Cleanup KotlinTypes in NewCommonSuperTypeCalculator
Cleanup KotlinTypes in TypeApproximator
Cleanup type substitution
Cleanup NewTypeVariable
Cleanup StubType
Cleanup TypeCheckerContext creation, extract common supertype context
Provide TypeSystemInferenceExtensionContext via dependency injection
2019-04-01 22:08:04 +03:00
Leonid Startsev
0ffded5bac Insert correct dispatch receivers and type arguments for expression inside generated by plugin IR functions 2019-04-01 18:54:16 +03:00
Ilya Chernikov
075a902ceb Revert createClassLikeInfo method signature change, depreceate it ...
instead and make alternative method for refactored usages.
Should fix compatibility with the Spek framework plugin.
2019-04-01 17:37:33 +02:00
Ilmir Usmanov
070fb7c250 Fix test data 2019-04-01 18:19:34 +03:00
Ilmir Usmanov
d2a80e7938 Add $result to suspend functions' LVT
#KT-28535
2019-04-01 18:19:32 +03:00
Ilmir Usmanov
05937a28ee Rename result to $result
this way it does not interfere with user-defined variables.
 #KT-28535 Fixed
2019-04-01 18:19:31 +03:00
Alexander Podkhalyuzin
742ffb98ad Use indexes instead of slow directory search for script dependencies
#KT-30018 Comment
2019-04-01 17:54:28 +03:00
Natalia Selezneva
0de0321fa9 Do not call FileEditorManager.getSelectedEditor outside UI thread (KT-30130)
^KT-30130 Fixed
2019-04-01 14:28:17 +03:00
Sergey Rostov
0e0c78317d Gradle, Kotlin/JS: enable source maps by default, get it working on tests.
Publish kotlin-test-nodejs-runner separately from kotlin-gradle-plugin.
2019-04-01 08:42:10 +03:00
Mikhail Zarechenskiy
a4cbec64b7 [NI] Remove failing codegen tests and add similar diagnostic one
These tests were added for suspend-conversions, it worked only
 with new inference, but implementation was incorrect and had other
 bugs, which were fixed in 1ac25259.
 Support of suspend-conversions will be addressed later with a different
 implementation (#KT-30703)
2019-04-01 01:36:15 +03:00
Toshiaki Kameyama
4a3e4f099d KT-30451 Redundant call of selector in maxBy&minBy
Refactor maxBy & minBy: do not call selector when collection has single item
2019-03-31 05:11:05 +03:00
Ilmir Usmanov
8c8ad48152 Enable test 2019-03-30 04:18:55 +03:00
Ilmir Usmanov
ea1e72e7b4 Generate $this$<label> as receiver name instead of $receiver 2019-03-30 04:18:53 +03:00
Ilmir Usmanov
6f14dcfacb Put suspend lambda's parameters to LVT
#KT-26412 Fixed
 #KT-28534 Fixed
2019-03-30 04:18:50 +03:00
LepilkinaElena
21fe5ac415 Fix parser for linkerOpts/compilerOpts (KT-29970) (#2219) 2019-03-29 20:13:23 +03:00
Dmitry Gridin
09b58403b9 Improve "ReplaceWith" for class with generic parameter
#KT-27089 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
88b0db6dd7 ReplaceWith intention could save generic type arguments
#KT-21195 Fixed
2019-03-29 22:35:03 +07:00
Dmitry Gridin
b0f7ddd693 Minor: refactoring replaceWith package 2019-03-29 22:35:03 +07:00
Dmitry Gridin
c343876f7c Minor: refactoring codeInliner package 2019-03-29 22:35:03 +07:00
Ilya Chernikov
16ae313b22 Apply scripting subplugin in gradle mpp plugin, so scripts could be added to mpp sources
#KT-30679 fixed
2019-03-29 15:48:45 +01:00
Ilya Chernikov
3a3ba5bd8d Fix scripts discovery in IDEA after adding optional marker extension 2019-03-29 15:47:39 +01:00
romanart
4f1ee649b0 [IR] Fix type mismatch in LocalDeclarationLowering
Note: fix is required to enable @OnlyInputTypes annotation in NI
2019-03-29 17:40:44 +03:00
Dmitriy Novozhilov
f5ca69c324 [NI] Add codegen test for IntegerLiteralType for js backend 2019-03-29 17:38:55 +03:00
Ilmir Usmanov
3e5bc674d6 Update test data 2019-03-29 17:02:44 +03:00
Ilmir Usmanov
3bfee39995 Generate debug metadata for lambdas which capture crossinline lambdas
After cold stream related fixes, we do not generate state machine until
the very last transformation of the lambda. Thus, it is safe to
generate debug metadata for that lambda.
 #KT-30694 Fixed
2019-03-29 17:02:42 +03:00
Ilmir Usmanov
f09457c569 Minor. Remove sourceFile from CoroutineTransformerMethodVisitor's parameters 2019-03-29 17:02:40 +03:00
Dmitry Petrov
2c9ed73ba8 IR: create stubs for constructor type parameters
Java constructors can have type parameters of their own:
  public class J<X extends Number> {
    public <Y extends CharSequence> J() {}
  }

When such constructors are called from Kotlin, type parameters for
constructor follow type parameters for class:
  fun test() = J<Int, String>() // <X=Int, Y=String>

Descriptor-based representation uses the same type parameters ordering.

Also, use 'withScope' in IrLazyFunction type parameters creation.
2019-03-29 16:00:56 +03:00
Dmitry Petrov
8be7f7f1f7 IR: Make sure that symbols refer to original descriptors only
If a descriptor is a WrappedDeclarationDescriptor, it SHOULD NOT be
substituted.
2019-03-29 16:00:56 +03:00
Alexander Udalov
cd6c88fa2c Do not use .kotlin_module files in reflection
Previously, we used a pretty roundabout way to load a MemberScope from a
single file facade represented by KPackageImpl, which involved going
through ModuleDescriptor, PackageFragmentProvider, PackagePartProvider
etc. The only advantage of this approach was that it sort of works
similarly as in the compiler, however mutable state in
RuntimePackagePartProvider and the fact that .kotlin_module files were
required for this to work diminished this advantage.

In this change, we load MemberScope from a KPackageImpl pretty much
directly, by using the existing method
`DeserializedDescriptorResolver.createKotlinPackagePartScope` and
caching the result in the new component PackagePartScopeCache.

 #KT-30344 Fixed
2019-03-29 13:44:23 +01:00
Alexander Udalov
7aa75ab89b Minor, update reflection tests on stdlib
Since functionFromStdlibSingleFileFacade.kt was introduced, lazyOf was
also moved to a multifile class, so we're using another function to test
that reflection on a single file package facade from stdlib works
2019-03-29 13:44:23 +01:00
Dmitriy Novozhilov
719e25c3dd [NI] Fix testdata of codegen test for IntegerLiteralType 2019-03-29 15:20:53 +03:00
Alexander Udalov
36efbc8920 JVM IR: rename JvmBackendContext.getClass and return symbol instead of descriptor 2019-03-29 12:07:11 +01:00
Alexander Udalov
b32241c967 JVM IR: build all needed stdlib symbols in JvmSymbols manually
This removes the mandatory dependency of all JVM IR tests on
kotlin-stdlib (ConfigurationKind.ALL in all IR test cases) and speeds up
tests which don't need kotiln-stdlib by about 20%. Another advantage of
this method is that all required dependencies are listed in one file,
are easy to grasp, and changes to the related code generation can be
done independently of the corresponding changes in the actual library,
which may help in bootstrapping the compiler
2019-03-29 12:07:11 +01:00
Roman Artemev
6b7eba485b [JS] Run all js tests in v8 2019-03-29 13:38:08 +03:00
Igor Chevdar
3838a2f648 [IR] Copied functions from IrGenerator to IrBuilder
With that the number of UNDEFINED_OFFSET should be greater reduced
2019-03-29 12:47:34 +03:00
Mikhail Zarechenskiy
1ac25259e8 [NI] Support callable references to suspend functions
#KT-30658 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
017f9aea35 [NI] Builder-inference: fix unresolved reference for variable calls 2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
d6db1a1b35 [NI] Relax requirement for stub types in builder-inference
For functions with implicit return type annotations will be replaced
 anyway in order to initialize return type, so this restriction in
 `StubType` was too strong

 #KT-30656 Fixed
2019-03-29 12:32:01 +03:00
Mikhail Zarechenskiy
b10d19dc78 [NI] Align builder inference with the old inference
#KT-29184 Fixed
2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
1eb70ea19e [NI] Update test data related to builder-inference 2019-03-29 12:32:00 +03:00
Mikhail Zarechenskiy
b033b9180b [NI] Avoid builder-inference algorithm if types specified explicitly
#KT-30620 Fixed
2019-03-29 12:31:59 +03:00
Dmitriy Novozhilov
1ac3542036 [NI] Decrease priority of Integer Literal Types in type checking
#KT-30446
2019-03-29 11:55:30 +03:00
Dmitriy Novozhilov
4a1b9dcc3c [NI] fix approximation of not denotable types in lambda's function descriptors 2019-03-29 11:54:37 +03:00
Alexander Udalov
a9de157fd4 Exclude .kotlin_builtins files when proguarding kotlin-reflect.jar
Even though kotlin-annotations-jvm.jar itself doesn't contain those
files, ProGuard pulls them from the project dependency of
:kotlin-annotations-jvm on :core:builtins. They are already present in
kotlin-stdlib.jar and are thus not needed in kotlin-reflect.jar
2019-03-29 09:45:44 +01:00
Nicolay Mitropolsky
81e84fb62e LightElementsEqualsTest: removing quotes from test name
because of KT-19019
2019-03-29 11:29:22 +03:00
Ilya Gorbunov
91c7233ed8 Make Throwable.addSuppressed extension work without kotlin-stdlib-jdk7*
*given that it runs on JDK7 and higher. The addSuppressed member
is called with reflection when it's available.
kotlin-stdlib-jdk7 extension still overrides that and calls
addSuppressed member statically as before.

#KT-30560 Fixed
2019-03-28 22:42:20 +03:00
Ilya Gorbunov
e6e00483d4 Put kotlin-stdlib-jdk7/8 output in test classpath when running jdk6 tests
These tests ensure how compiled jdk6 binaries work in newer JDK7/8 environment,
and most likely the stdlib-jdk7/8 artifacts will be in that environment.

This reverts test classpath change (accidentally?) made in the commit 99f2cc3d.
2019-03-28 22:42:20 +03:00
Ilmir Usmanov
3724e05b63 Fix test data 2019-03-28 22:21:25 +03:00
Denis Zharkov
66293f4024 FIR: Add @Ignore for FirResolveTestTotalKotlin
Otherwise, it leads to OOM while running on teamcity
Of course, FIR parts might be optimized there but we'll do it later
2019-03-28 17:37:36 +03:00
Mikhael Bogdanov
1a4acb1694 Fix Android test compilation: remove license from generate file 2019-03-28 15:34:46 +01:00
Denis Zharkov
3164197b88 FIR: Fix compilation for bunch file AbstractFirTypeEnhancementTest.kt.181 2019-03-28 17:32:12 +03:00
Alexander Udalov
cb7727d51a Add explicit WITH_RUNTIME to boxAgainstJava tests which need stdlib 2019-03-28 14:26:10 +01:00
Alexander Udalov
15928c5b46 Minor, take String instead of Name in IrFunction.addValueParameter
All call sites of this method construct parameters with the given string
literal name (and more such call sites are coming in subsequent commits)
and it feels like a boilerplate to wrap it into Name each time manually
2019-03-28 14:26:09 +01:00
Alexander Udalov
4cb5a4fb6d Fix misc typos in IR backends 2019-03-28 14:26:09 +01:00
Alexander Udalov
6bd4d72b81 Use more correct KProperty type in PropertyReferenceLowering
Default type is `KProperty<R>` where R is KProperty's type parameter.
This type doesn't make much sense outside the KProperty's own class
declaration. A more correct type here is `KProperty<*>`, which is the
type used in property delegates in Kotlin
2019-03-28 14:26:09 +01:00
Alexander Udalov
73383d0c20 Extract JvmSymbols to separate file, pass lazyWrapper as SymbolTable 2019-03-28 14:26:09 +01:00
Alexander Udalov
1ee4313803 Minor, introduce IrType.classOrNull 2019-03-28 14:26:09 +01:00
Alexander Udalov
dada35d785 Remove obsolete and unused descriptors and utils 2019-03-28 14:26:09 +01:00
Alexander Udalov
72ca05f86a Add kotlin-stdlib explicitly to Gradle integration test data
This is required since ed86757817, otherwise an error "Cannot access
built-in declaration ..." is reported
2019-03-28 14:25:37 +01:00
Alexander Udalov
6223c4481f Minor, disable package mismatch inspection for Groovy
This should be fine because we don't have any production Groovy code in
the project. Otherwise any build.gradle file in
kotlin-gradle-plugin-integration-tests is highlighted as yellow.

Also update inspection profile to the latest version suggested by
IntelliJ
2019-03-28 14:25:37 +01:00
Mikhael Bogdanov
9c21c71c63 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:51:28 +01:00
Sergey Rostov
4df31b2360 JPS Build: support building and running IDEA Ultimate 2019-03-28 15:48:35 +03:00
Sergey Rostov
283ad04f7c JPS Build: fix artifacts after moving dependencies repo 2019-03-28 15:48:35 +03:00
Mikhael Bogdanov
f34a2923b5 Fix IDE related test problems after adding ability to run test in parallel in compiler configuration 2019-03-28 13:17:38 +01:00
Mikhael Bogdanov
0c60ff0e80 Revert "Revert "Allow tests to be run in parallel.""
This reverts commit bdad3cac
2019-03-28 13:17:37 +01:00
Nicolay Mitropolsky
944bc31f69 Making Kotlin light elements isEquivalentTo to it's origins (KT-30583) 2019-03-28 13:19:42 +03:00
Ting-Yuan Huang
1bf0354e35 TotalOrderEquals: Handle nulls 2019-03-28 11:36:22 +03:00
Denis Zharkov
b1474b11f2 FIR: Fix FirSupertypeResolverTransformer for case of redeclarations
When transforming a specific class look for the exact match
Otherwise the last redeclaration will be overwritten by the first one
2019-03-28 11:19:52 +03:00
Simon Ogorodnik
a23e4bfdf1 Fix superType resolver 2019-03-28 11:19:52 +03:00
Simon Ogorodnik
49a0b29129 Store containers per symbol, not per callable id 2019-03-28 11:19:52 +03:00
Denis Zharkov
48f0790785 FIR: Fix bunch files for 181 2019-03-28 11:14:55 +03:00
Ilmir Usmanov
59398536d7 Generate inline site's file name in metadata
Otherwise, stacktraces will have invalid file name (declaration site).
 #KT-30508 Fixed
2019-03-28 11:14:17 +03:00
Sergey Rostov
23edafcaaf JPS Build: fix kotlin-main-kts-test 2019-03-28 10:06:36 +03:00
Sergey Rostov
7b89b0abbb JPS Build: exclude :core:builtins, use prebuilt bootstrap version 2019-03-28 10:06:35 +03:00
Sergey Rostov
fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Dmitry Gridin
5802928e52 False positive "unused constructor" for local class
#KT-30637 Fixed
2019-03-28 10:52:23 +07:00
Yan Zhulanow
0b94aa4be2 Pill: Disable a couple of scripting modules
Seems like these modules use the embeddable verson of the scripting host dependency that is not built in the Pill build.
2019-03-27 22:15:26 +03:00
Ilmir Usmanov
95f4115a10 Replace global mutable object with global variable 2019-03-27 21:40:13 +03:00
Ilya Kirillov
9813b748eb Fix android linting tests due to added external annotations support 2019-03-27 20:10:46 +03:00
Ilya Kirillov
f1f6740ec9 Show warnings for Java methods with external annotations when they called from Kotlin code 2019-03-27 20:10:46 +03:00
Mikhail Glukhikh
ba9b3397d0 Make Groovy-based inspections alive again
After commit 9b5b0447, declaration of Groovy-based inspections moved
into gradle-groovy.xml. However, this makes transitive-optional
dependency between plugin.xml, gradle-java.xml & gradle-groovy.xml
which doesn't work (see IDEA-209769) and inspections aren't loaded.

This commit breaks this transitivity by declaring dependency
to gradle-groovy.xml directly in plugin.xml.
This also fixes most tests from GradleInspectionTest group.
2019-03-27 18:06:24 +03:00
Ilmir Usmanov
0fec3470dd Regenerate anonymous object if call site of non-inlineable
functional argument is suspend
Split LambdaInfo into inlineable and non-inlineable
 #KT-26925
2019-03-27 17:44:37 +03:00
Ilmir Usmanov
1c2b8e6fad Fix wrong state-machine generation if inner object is retransformed
during inlining.
 #KT-29492 Fixed
2019-03-27 17:44:35 +03:00
Denis Zharkov
7b97c2a42a FIR: Weaken requirements for all symbols to have correct FIR
Currently, some cases like library type parameters are not supported properly
2019-03-27 17:17:59 +03:00
Denis Zharkov
825218b479 Replace FirSymbolProvider::getCallableSymbols with two methods
Requesting content of classes seems to be reasonable and at the same time
more easy to implement in Composite providers: they should find
just the first class' result instead of flatmapping all of them
2019-03-27 17:17:59 +03:00
Denis Zharkov
1426341e9f FIR: Support loading deserialized declarations from JVM class files 2019-03-27 17:17:59 +03:00
Denis Zharkov
0f9d54c4dc FIR: Support deserialization of nested classes 2019-03-27 17:17:59 +03:00
Denis Zharkov
82c6b51fab Simplify initialization process for JavaClassFinderImpl
After this change, it's not required to call "initialize" with
binding trace and KotlinCodeAnalyzer that is rather useful for FIR
2019-03-27 17:17:59 +03:00
Denis Zharkov
bb1acdbe95 Minor. Extract classes deserialization from BuiltInsPackageFragment 2019-03-27 17:17:59 +03:00
Denis Zharkov
b3e5e059bb Minor. Extract FirDeserializationContext factories 2019-03-27 17:17:59 +03:00
Denis Zharkov
aec5ec89e7 FIR: Support deserialization for built-in classes content 2019-03-27 17:17:59 +03:00
Denis Zharkov
f03c5e0583 FIR: Support loading built-in top-level functions 2019-03-27 17:17:59 +03:00
Denis Zharkov
705f97cbae FIR: Support type parameters in FirTypeDeserializer 2019-03-27 17:17:59 +03:00
Denis Zharkov
1d16008eab Do not request FirProvider for built-in synthesized classes
Because currently they don't have FIR and it might fail with an exception
2019-03-27 17:17:59 +03:00
Denis Zharkov
6daf414098 Add common supertype for FirFunction and FirProperty symbols 2019-03-27 17:17:59 +03:00
Denis Zharkov
466296bca0 Remove FirLibrarySymbolProviderImpl from FirJavaModuleBasedSession
It's anyway already being created within dependencies
2019-03-27 17:17:59 +03:00
Denis Zharkov
7a19e269fd FIR: Support import-references to callables 2019-03-27 17:17:59 +03:00
Leonid Startsev
ccca813792 Allow '@Serializable' on a type usage (for kotlinx.serialization/367) 2019-03-27 12:59:53 +03:00
Leonid Startsev
a2465910a3 Instantiating of Polymorphic in Companion.serializer() for JS and Native 2019-03-27 12:59:52 +03:00
Leonid Startsev
b108dbe568 Auto-applying @Polymorphic for interfaces and serializable abstract
classes
2019-03-27 12:59:51 +03:00
Leonid Startsev
859c95c3c4 Do not enable PolymorphicSerializer without special annotation 2019-03-27 12:59:49 +03:00
Leonid Startsev
9d707cb1d9 New instantiating type for polymorphic serializer 2019-03-27 12:59:48 +03:00
Sergey Rostov
30108d4cb9 CodeConformanceTest: revert formatting committed by mistake 2019-03-27 11:23:54 +03:00
Sergey Rostov
6bf82c1053 Gradle, Kotlin/JS: fix failing tests on Windows 2019-03-27 11:23:53 +03:00
Dmitry Gridin
0237dc3f4b Fix inspections test 'Unused symbol' for enum entry 2019-03-27 12:27:48 +07:00
Dmitry Gridin
d64702d87e Remove check "unused secondary enum class constructor"
#KT-14040 Fixed
2019-03-27 11:46:31 +07:00
Dmitry Gridin
dbe0b4aa71 Unused symbol inspection should detect enum entry
#KT-30612 Fixed
2019-03-27 11:46:30 +07:00
Dmitry Gridin
ce1ec49625 Add case for private nested class/object in KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Dmitry Gridin
4495c653cb Minor: move property from UnusedSymbolInspection to ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
3e0269a95a Minor: refactoring & fix warnings in ktPsiUtil 2019-03-27 11:46:30 +07:00
Dmitry Gridin
26575c9389 Minor: refactoring KotlinSafeDeleteProcessor 2019-03-27 11:46:30 +07:00
Sergey Igushkin
7aed9fd592 Fix Android AP in Kapt (KT-30632), run Android Kapt IT with AGP 3.3.2
Fixes a bug introduced by the commit 6fa610156e, which led to Kapt
options being imported from Android AP options too early (immediately at
creation time for each Android variant, while the Android plugin added
the options only afterwards).

Move Android subplugin options configuration to the time & scope where
it was prior to 6fa610156e.
2019-03-27 01:08:04 +03:00
Natalia Selezneva
ca49e17157 Run indexing for new script dependencies if they are updated from notification 2019-03-27 00:00:11 +03:00
Natalia Selezneva
776a89086f Fix NoSuchElementException editing script file
^KT-30440 Fixed
2019-03-26 23:58:59 +03:00
Natalia Selezneva
224f37ca00 Fix warning in scripts that dependencies are not available
^KT-30441 Fixed
2019-03-26 23:57:20 +03:00
Mikhail Zarechenskiy
791ab05e08 Temporary fix for NI to compile against bootstrap compiler 2019-03-26 22:51:20 +03:00
Mikhail Zarechenskiy
a50cc99b01 [NI] Discriminate integer literal types as they are less specific
Plus simplify code in `ResultTypeResolver` a bit
2019-03-26 22:32:14 +03:00
Mikhael Bogdanov
e01cac4c3d Fix test data 2019-03-26 17:17:54 +01:00
Anton Bannykh
b3f1908026 JS_IR: remove stub generator from IrBuiltins 2019-03-26 17:38:44 +03:00
Anton Bannykh
ed440fc060 JS IR: remove obsolete hack from SymbolTable 2019-03-26 17:38:43 +03:00
Anton Bannykh
530804d072 JS_IR: eager IrBuiltins 2019-03-26 17:38:43 +03:00
Anton Bannykh
45f5342911 JS IR: remove obsolete hacks 2019-03-26 17:38:43 +03:00
Anton Bannykh
bba4399910 JS IR: enable IR validation 2019-03-26 17:38:43 +03:00
pyos
ef5e02da84 JVM_IR: handle Nothing and Unit more consistently.
* In blocks, discard the result of any statement that has a return
   type other than void. This was previously done by wrapping each
   statement into an "implicit Unit conversion" that was actually
   compiled down to a stack pop instead. If an expression happened to
   already have type Unit, however, such a conversion was not inserted,
   resulting in a stray reference on the stack. These conversions are
   now redundant and should probably be removed.

 * In assignments and non-exhaustive conditionals, materialize a Unit
   on the stack to avoid depth mismatches that trip up the bytecode
   validator. Because such expressions are generally used at block level
   (and, indeed, the frontend will reject a non-exhaustive conditional
   used as an expression), combined with the above change this results
   in no additional GETSTATIC opcodes, as they are immediately removed
   by the peephole optimizer.
2019-03-26 13:32:02 +01:00
Zalim Bashorov
bdad3cace9 Revert "Allow tests to be run in parallel."
This reverts commit 21d81f35
2019-03-26 15:22:40 +03:00
Alexander Podkhalyuzin
37de9a0a26 Do not call find editor outside UI thread
#KT-30117 Fixed
2019-03-26 15:18:03 +03:00
Alexander Podkhalyuzin
c9581176d7 git longpaths info for Windows users 2019-03-26 15:17:21 +03:00
Alexander Podkhalyuzin
19f6290686 Fixed selection in case of empty class body
#KT-30597 Fixed
2019-03-26 15:13:54 +03:00
Steven Schäfer
29b7da7c49 Implement support for KClass fields in annotation classes. 2019-03-26 11:54:16 +01:00
Ting-Yuan Huang
4ff2825de0 Fix an assertion for type parameters 2019-03-26 10:44:06 +03:00
Ilya Matveev
acf8a0454f Store Kotlin/Native version in properties
Previously the Kotlin/Native version was hardcoded in sources of the
Gradle plugin. Such an approach is inconvenient when we want to
build Kotlin with a custom K/N version but without changes in sources
(e.g. during CI daily runs).

This patch adds a project property `versions.kotlin-native` which can
be set during build to override Kotlin/Native version. Also this
patch gets rid of hardcoding this version in sources and stores it in
a properties file packed with the Gradle plugin in a jar.
2019-03-26 12:50:53 +07:00
Andrey Uskov
a0b8140278 Fix creation of Android source roots
#KT-30464 Fixed
2019-03-26 08:28:23 +03:00
Andrey Uskov
01a100e2ef Fix KNE in intentions
EA-124846 Fixed
2019-03-26 08:27:24 +03:00
Dmitriy Dolovov
e33ea24dc7 Fix: Native libraries are not automatically unloaded from an IDE project
Issue #KT-30490 fixed
2019-03-26 09:43:06 +07:00
Toshiaki Kameyama
3b569737ad Redundant getter/setter: reduce hightlight range to header
#KT-30559 Fixed
2019-03-25 23:27:44 +03:00
Toshiaki Kameyama
0cf641398c Suspicious 'var' property: do not report when property has default getter
#KT-30565 Fixed
2019-03-25 23:26:24 +03:00
Dmitriy Novozhilov
a26df4b4c6 [NI] Update test data for spec tests 2019-03-25 23:04:50 +03:00
Victor Petukhov
568506e5c1 Exclude warning "Remove final upper bound" for functions with override modifier
^KT-25105 Fixed
2019-03-25 22:14:26 +03:00
Steven Schäfer
9cd005fbae Create temporary library directories for J2V8.
Workaround for https://github.com/eclipsesource/J2V8/issues/39
2019-03-25 19:50:37 +01:00
Steven Schäfer
21d81f353c Allow tests to be run in parallel. 2019-03-25 19:50:37 +01:00
Dmitriy Novozhilov
ca0e66bafc [NI] Refactor compiler representation of integer literals types
Add `IntegerLiteralTypeConstructor` that holds types, that can take
  integer literal with given value. It has two supertypes
  (`Number` and `Comparable<IntegerLiteralType>`) and have
  special rules for subtyping, `intersect` and `commonSuperType`
  functions with primitive number:

Example (assuming that ILT holds Int type):
* ILT <: Int
* Int :> ILT
* ILT intersect Int = Int
* commonSuperType(ILT, Int) = Int

#KT-30293 Fixed
#KT-30446 Fixed
2019-03-25 18:55:36 +03:00
Anton Bannykh
9c3e452396 IR: (update test data) NOT(Boolean) -> Boolean.not 2019-03-25 17:49:15 +03:00
Alexander Udalov
fff22d9372 Remove hack from JvmBuiltinOptimizationLowering related to booleanNotSymbol 2019-03-25 17:49:15 +03:00
Anton Bannykh
a382956c19 IR: use the correct descriptor for the booleanNotSymbol creation
NOTE corresponding function now has a dispatch receiver instead of a
single argument
2019-03-25 17:49:15 +03:00
Mikhail Glukhikh
0546548ff3 Raw FIR: add kotlin.Any super class if no super classes are visible 2019-03-25 17:17:14 +03:00
Alexey Tsvetkov
db6a7779b8 Check friend jars paths for exact match
Fixes CompileKotlinAgainstCustomBinariesTest.testInternalFromForeignModule
after unifying non-build-file mode and build-file mode.

Previously when the compiler was run without -Xbuild-file argument,
it was not using modules internally, so we were not checking if internal
descriptors were contained in destination dir of current module
(without -Xbuild-file we were returning false at `if (modules.isEmpty())
return false` in `ModuleVisibilityHelperImpl#isInFriendModule`).

After switching to using modules for CLI compilation,
any jar file contained in destination dir was considered friend,
because only a prefix was checked.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
0687b8eac3 Add argument to allow running compiler without sources
`-Xbuild-file` argument allows the compiler to run without
passing any Kotlin source file in arguments.
We have been using this property in
Kotlin Gradle plugin for a few important cases:
1. incremental compilation (to update caches when there are only removed files);
2. for KAPT (Kotlin sources don't make sense in context
of running APs).

We want to stop using `-Xbuild-file` in Kotlin Gradle plugin,
and avoid breaking the Gradle plugin or IC in other build-systems.

This change adds an argument to explicitly run
the compiler without specifying any Kotlin source file.
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
97d3d38374 Always run codegen when IC is enabled
We may need to run code generation when no source files are specified
for incremental compilation (to update caches & metadata)
2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5b7cee6221 Unify JVM compilation with and without -Xbuild-file 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
4154e97aa3 Fixes after code review 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
ada880fbad Fix non-incremental compilation 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
337ca7021d Add test for IC of non-kts scripts in Gradle 2019-03-25 16:39:47 +03:00
Alexey Tsvetkov
5f54f67f70 Stop using -Xbuild-file in Gradle Plugin
#KT-27640 fixed
    #KT-27778 fixed
    #KT-27638 fixed
2019-03-25 16:39:47 +03:00
Nikita Skvortsov
9b5b0447fa only load inspections when groovy plugin is present KT-30579
otherwise, a user who disables Groovy support gets NoClassDefFound errors
2019-03-25 16:06:55 +03:00
Svyatoslav Kuzmich
0504635254 Remove -ProperIeee754Comparisons test directive duplicate 2019-03-25 15:55:06 +03:00
Svyatoslav Kuzmich
70ef0e9431 Add '-ProperIeee754Comparisons' to some tests and disable them in JS_IR 2019-03-25 12:57:26 +03:00
Dmitriy Novozhilov
d3e98bc434 [NI] Update test data for diagnostic tests 2019-03-25 12:38:37 +03:00
Dmitry Gridin
74cd53963d Fix false positive "Unused symbol" for type alias & private nested class/object
#KT-21526 Fixed
 #KT-30527 Fixed
2019-03-25 16:32:28 +07:00
Dmitry Gridin
4441b1579f Minor: refactoring UnusedSymbolInspection 2019-03-25 16:32:28 +07:00
Mikhail Zarechenskiy
3eda7c462b [NI] Add Nothing constraint if it was inferred from a call 2019-03-25 12:17:28 +03:00
Mikhail Zarechenskiy
ca894a6a71 [NI] Don't complete nested call if there's no constraints at all 2019-03-25 12:17:28 +03:00
Dmitriy Novozhilov
9825984bc5 [NI] Update test data for diagnostic tests 2019-03-25 12:17:27 +03:00
Dmitry N. Petrov
c2a0e73a79 Merge pull request #2207 from ting-yuan/ieee754improper
Label improper IEEE 754 tests.
2019-03-25 12:10:59 +03:00
Mikhail Glukhikh
73ed52a511 Get rid of binding context in FirBodyResolveTransformer 2019-03-25 12:04:28 +03:00
Dmitry Petrov
8664fc3b28 psi2ir: add test for implicit cast on values of intersection type 2019-03-25 11:50:14 +03:00
Dmitry Petrov
d4525e19dd IR: get rid of descriptors in local delegated properties rendering 2019-03-25 11:50:14 +03:00
Dmitry Petrov
12e9943f8f IR: IrCallableReference now implements IrDeclarationReference 2019-03-25 11:50:14 +03:00
Dmitry Petrov
6ca61cf347 IR: symbol for IrLocalDelegatedProperty 2019-03-25 11:50:14 +03:00
Mikhail Glukhikh
aa6ba1cd4a Introduce typeRef for FirExpression
This helps both body resolve & conversion to IR
2019-03-25 10:38:45 +03:00
Ilya Gorbunov
adeeeeee48 Fix embedded version of kotlin-stdlib in buildSrc
To avoid bringing stdlib:1.2.30, which is a transitive dependency of
com.jakewharton.dex:dex-method-list:3.0.0, into compile classpath of
the project build scripts.
2019-03-25 03:28:06 +03:00
Georgy Bronnikov
7f8cbf5434 JVM_IR: handle new JVM targets in AdditionalClassAnnotationsLowering 2019-03-25 02:18:57 +03:00
Georgy Bronnikov
0a2450bcd5 Remove duplicate definitions 2019-03-23 19:04:36 +03:00
Georgy Bronnikov
451cda79de Rewrite AnnotationCodegen for IR, removing descriptors 2019-03-23 19:04:36 +03:00
Nikolay Krasko
8bd6e1b8e4 Rename action for throwing exception from Kotlin plugin
Make the name similar to other internal actions for throwing exceptions.
2019-03-23 11:54:57 +03:00
Nikolay Krasko
0c2bdc68f1 Additional checks for listed and approve in fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
27397f4131 Use xmlId for fetching release date (KT-30388) 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fb2e5f970d Add intention/inspections/quickfix contribution quick notes 2019-03-23 11:53:29 +03:00
Nikolay Krasko
fdf2482600 Clean up findUsages package 2019-03-23 11:53:29 +03:00
Nikolay Krasko
046a35bcda Hide concrete classes for Kotlin nodes to avoid more compatibility problems 2019-03-23 11:53:28 +03:00
Nikolay Krasko
8ab10ebda3 Minor: remove warnings in CommonIntentionActionsTest.kt 2019-03-23 11:53:28 +03:00
Ilya Chernikov
99a5885aa7 Fix ScriptingCompilerPluginTest after creating a separate jar with shared plugin code 2019-03-23 09:52:02 +01:00
Abduqodiri Qurbonzoda
636ed025da Replace "binary representation of" with "bits of" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
960797b926 Replace mistaken "bit sign" with "sign bit" 2019-03-22 21:18:27 +03:00
Abduqodiri Qurbonzoda
f36a8db8eb More detailed Primitive.toChar conversion documentation 2019-03-22 21:18:27 +03:00
Ting-Yuan Huang
caccb79324 Label improper IEEE 754 tests.
Those tests don't expect ProperIeee754Comparisons.
See KT-22723 for details.
2019-03-22 11:07:35 -07:00
Alexander Udalov
87c6b723f0 Add JvmBuiltIns.Kind instead of boolean flags in constructor 2019-03-22 14:59:03 +01:00
Alexander Udalov
c32d7ef116 Do not create additional module for built-ins in reflection 2019-03-22 14:59:03 +01:00
Alexander Udalov
ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Alexander Udalov
8ce7742e7c Inject DeserializationConfiguration into JvmBuiltInsPackageFragmentProvider 2019-03-22 14:59:03 +01:00
Alexander Udalov
05700b8c43 Use JvmResolveUtil.createContainer in AbstractDescriptorRendererTest 2019-03-22 14:59:03 +01:00
Alexander Gorshenev
a3b1d3ff62 Allow forward declarations bring additional IR dependencies
for modules present in metadata.
2019-03-22 16:47:08 +03:00
Alexander Gorshenev
674580fdef File annotation deserialization is triggered by the first file use 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
215da10687 A little refactoring of deserializer in preparation for the next commit. 2019-03-22 16:47:08 +03:00
Alexander Gorshenev
3bc4616a17 Eliminated global state in IR deserializer. 2019-03-22 16:47:08 +03:00
Ilya Matveev
8f9189d61e Update Kotlin/Native: 1.2-eap-8879 2019-03-22 20:27:18 +07:00
Simon Ogorodnik
b617c40051 FIR: Update testData for fir multi-module test (rendering+body resolve) 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
85a096029c FIR: Do not fail on not calculated type 2019-03-22 16:25:24 +03:00
Simon Ogorodnik
70e324277e FIR: Stub for super references 2019-03-22 16:25:23 +03:00
Mikhail Glukhikh
9b4fe2f991 FIR: Fix part of problems with smoke tests 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
3e7e9269ab FIR: Fix 2^n transform complexity in blocks/whens 2019-03-22 16:25:22 +03:00
Simon Ogorodnik
6799eeb084 FIR: Add CallKind 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
a562f3db3c FIR: Re-implement call resolver with proper architecture 2019-03-22 16:25:21 +03:00
Simon Ogorodnik
33b44870d6 FIR: Add test for constructor 2019-03-22 16:25:20 +03:00
Simon Ogorodnik
5aa783a961 FIR: Fix visitors/transformers and testData 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
2341692296 FIR: Change transform order in calls/variables to more appropriate 2019-03-22 16:25:19 +03:00
Simon Ogorodnik
071f324738 FIR: Prevent failing on implicit typed local declarations 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
46e432df54 FIR: Prevent failing on constructor substitution 2019-03-22 16:25:18 +03:00
Simon Ogorodnik
cd7a96e91b FIR: Proper self-type for constructor return type 2019-03-22 16:25:17 +03:00
Simon Ogorodnik
6c7be3c547 FIR: Improve diagnostic in fir unsafe 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
fedde668b3 FIR: Support captureFromArguments for ConeTypes 2019-03-22 16:25:16 +03:00
Simon Ogorodnik
6efb22cd45 FIR: Support typing of type operators 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
79018abee2 FIR: Optimize name gathering in call resolver 2019-03-22 16:25:15 +03:00
Simon Ogorodnik
b574693916 FIR: Introduce function to render fir element with it's type 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
24041828a9 FIR: Improve rendering for type operators 2019-03-22 16:25:14 +03:00
Simon Ogorodnik
27687602f8 FIR: Add functions to change nullability/arguments of ConeTypes 2019-03-22 16:25:13 +03:00
Simon Ogorodnik
2118f6008a Extract TypeArgumentListMarker.all 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
d9c40c24ed FIR: Allow rendering ConeTypes 2019-03-22 16:25:12 +03:00
Simon Ogorodnik
818701b8df FIR: Implement cycle avoidance in implicit type resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
334c42e8ab FIR: Implement deep implicit types resolution 2019-03-22 16:25:11 +03:00
Simon Ogorodnik
70be1c1024 FIR: Update testData, now it resolves due to call resolver 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
498fb94c37 FIR: Make FIR rendering more kotlin-styled 2019-03-22 16:25:10 +03:00
Simon Ogorodnik
9cc6e44158 FIR: Fix value-parameters redeclare in destructuring 2019-03-22 16:25:09 +03:00
Simon Ogorodnik
9a642ef2e5 FIR: Add test for three receivers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
43315fd61d FIR: Preparation for resolve to classifiers 2019-03-22 16:25:08 +03:00
Simon Ogorodnik
307b8a1d4c FIR: Support top-level constructors 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
d817f719a4 FIR: Cleanup failures in body resolve 2019-03-22 16:25:07 +03:00
Simon Ogorodnik
3867b255f2 FIR: Support this resolve 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
9dc6d93070 FIR: Resolve local callables 2019-03-22 16:25:06 +03:00
Simon Ogorodnik
61eb19fbbf FIR: Make possible to return variable symbols from scope 2019-03-22 16:25:05 +03:00
Simon Ogorodnik
02079bbeb5 FIR: Update fir hierarchy, decouple member declaration from callable 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
7b6f4d8ba4 FIR: Implement implicit invoke desugaring in call resolver 2019-03-22 16:25:04 +03:00
Simon Ogorodnik
3be1d0f946 FIR: Add tests for invoke 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
c58c1a6c4e FIR: Add operator test 2019-03-22 16:25:03 +03:00
Simon Ogorodnik
3ac495a45d FIR: Implement basic function call resolve 2019-03-22 16:25:02 +03:00
Simon Ogorodnik
099f98f817 FIR: Expression typing and simple call resolver 2019-03-22 16:25:02 +03:00
Alexey Tsvetkov
28873e61d4 Remove unused IncrementalCompilationServicesFacade 2019-03-22 16:13:45 +03:00
Ivan Gavrilovic
493a2006f1 Remove unused SimpleDirtyData from incremental compilation
This is not used any more and all information about
the changed symbols and fqNames is passed alongside artifacts.
2019-03-22 16:13:45 +03:00
Yan Zhulanow
49d94f72d2 Revert "Kapt: Generate constant value initializers for mutable properties (KT-30164)"
This reverts commit cce2b472
2019-03-22 15:17:12 +03:00
Yan Zhulanow
9aa6a10aff Revert "Kapt: Move out the 'final' fallback for initial field values"
This reverts commit 10e53a2e
2019-03-22 15:17:12 +03:00
Yan Zhulanow
4c794b1302 Revert "Kapt: Support default constant values for constructor parameters"
This reverts commit e4d758b6
2019-03-22 15:17:12 +03:00
Ilya Chernikov
215d24e12c Fix jps build after adding new scripting jar 2019-03-22 12:26:02 +01:00
Svyatoslav Kuzmich
8429734a67 [JS IR BE] Disable -ProperIeee754Comparisons tests 2019-03-22 13:49:37 +03:00
Sergey Rostov
d210255623 Gradle: Kotlin NodeJS tests runner for single target
#KT-30528
2019-03-22 09:57:21 +03:00
Sergey Rostov
04d8568fdc Build: fix DistModelBuilder for copy tasks without destination dir 2019-03-22 09:49:34 +03:00
Sergey Rostov
d467e4209a Gradle: Basic Kotlin NodeJS tests runner
#KT-30531 Fixed
#KT-30528 Fixed
2019-03-22 09:49:32 +03:00
Sergey Rostov
b6e675f934 Gradle: move buildCompilationProcessor from target preset to target configurator 2019-03-22 09:34:11 +03:00
Sergey Rostov
46c32f2aa6 Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-22 09:34:11 +03:00
Georgy Bronnikov
e627f08614 Make wrong phase name an error 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
fae003866b Use CLI compiler arguments directly in PhaseConfig creation 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
40079f7cae Use default argument values in PhaseConfig constructor 2019-03-21 23:32:25 +03:00
Georgy Bronnikov
469fd20902 Warn about mistyped phase names in CLI 2019-03-21 23:32:25 +03:00
Alexander Udalov
0fb444a5d1 Move createPhaseConfig to module cli
To use things like MessageCollector to report errors/warnings related to
incorrect phase configuration flags
2019-03-21 23:32:25 +03:00
Alexander Udalov
2995be8bd2 Move usages of createPhaseConfig up to cli & test modules 2019-03-21 23:32:25 +03:00
Alexander Udalov
ddad3034da Extract createPhaseConfig from PhaseConfig
To remove dependency of PhaseConfig on CLI-dependent concepts such as
CompilerConfiguration
2019-03-21 23:32:25 +03:00
Nicolay Mitropolsky
ce40bfb259 191: Uast: making KotlinUObjectLiteralExpression provide a proper referenceNameElement (KT-30534) 2019-03-21 19:56:47 +03:00
Vyacheslav Gerasimov
e3a012cd19 Fix CodeConformanceTest after merging android-dx to prepare-deps 2019-03-21 18:15:55 +03:00
Nikolay Krasko
a5f96d6470 Minor: cleanup and remove outdated TODOs 2019-03-21 18:03:15 +03:00
Nikolay Krasko
04ecc913ef Show expression type for argument names (KT-30057)
#KT-30057 Fixed
2019-03-21 18:03:15 +03:00
Nikolay Krasko
ce2f738d9f Minor: fix Nullness deprecation warnings 2019-03-21 18:03:15 +03:00
Nikolay Krasko
77f1167773 Minor: remove bunch for KotlinSliceProvider.kt 2019-03-21 18:03:15 +03:00
Nikolay Krasko
026fc998c1 Allow resolve write action check for all plugins when enabled in registry 2019-03-21 18:03:15 +03:00
Ilya Matveev
7f08ecee39 CocoaPods: Use FQ name for the sync task during an Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
0a27699591 CocoaPods: Generate wrapper if the corresponding property enabled 2019-03-21 21:09:47 +07:00
Ilya Matveev
07c3ed5bd1 Fat frameworks: Use absolute path to lipo 2019-03-21 21:09:47 +07:00
Ilya Matveev
1f94224b52 Fat frameworks: Don't fail if plist has no device capabilities
The PlistBuddy fails when deleting an entry from a file which
has no such entry. This patch workarounds this by ignoring
PlistBuddy's exit code.
2019-03-21 21:09:47 +07:00
Ilya Matveev
300acafc63 CocoaPods: Don't generate a fat framework for a single device target 2019-03-21 21:09:47 +07:00
Ilya Matveev
c079543e7d Fat frameworks: Improve header merging
1. If header contents are identical, don't write all of them
   in the resulting header. Just write content of one of the
   headers without #ifdef-s.
2. Use #elif to separate declarations for different platforms.
2019-03-21 21:09:47 +07:00
Ilya Matveev
8b8028e10d Fat frameworks: Run PlistBuddy only once for all commands
Previously we executed the PlistBuddy utility for each command
separately. This patch gathers all commands and run PlistBuddy
for all of them at once.
2019-03-21 21:09:47 +07:00
Ilya Matveev
3f04bf119e Fat frameworks: Improve error messaging 2019-03-21 21:09:47 +07:00
Ilya Matveev
1c7866e81f CocoaPods: Require Gradle wrapper for Xcode build 2019-03-21 21:09:47 +07:00
Ilya Matveev
2e60b18570 CocoaPods: Rename: simple framework -> regular framework 2019-03-21 21:09:47 +07:00
Ilya Matveev
fd825e0601 CocoaPods: Detect the real path to Gradle wrapper.
Previously the CocoaPods plugin assumed that Gradle wrapper
is located in the project directory. But the project may be
a part of multiproject build and wrapper may be located in
the root directory of such a build. Also the build may not
have the wrapper at all.

This patch looks for the wrapper in the root directory of the
build and runs the local Gradle if there is no wrapper.
2019-03-21 21:09:47 +07:00
Ilya Matveev
4985b24b07 CocoaPods: Don't use realpath utility in script phase
The realpath utility may not be found on the user's machine
so we get rid of using it.
2019-03-21 21:09:47 +07:00
Ilya Matveev
5b4d83e770 CocoaPods: Build fat arm32/arm64 frameworks
Building for old iOS devices requires us to provide fat
arm32/arm64 frameworks. This patch uses the fat framework
task to build such a framework and provides it to Xcode
if a build for a device is executed. In other cases
(building for iOS simulator or macOS) simple frameworks
are still used.
2019-03-21 21:09:47 +07:00
Ilya Matveev
6621414d72 Provide a task for building a fat framework
This patch adds a task taking several iOS frameworks and
building one fat framework on their basis.

Issue #KT-24184 Fixed
2019-03-21 21:09:47 +07:00
Roman Artemev
538512fa2a [JS IR BE] Fix unbound symbols after deserialization
* restore broken psi2ir invariant
2019-03-21 16:26:51 +03:00
Dmitriy Novozhilov
58189c79ca Add regression test for PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL diagnostic
#KT-20507
2019-03-21 16:09:46 +03:00
Alexey Tsvetkov
42aa708f16 Minor: remove JVM-specific assertion from common test code 2019-03-21 15:23:48 +03:00
Ilya Chernikov
c56382a62b Move common idea and compiler parts of the scripting plugin to the new jar 2019-03-21 12:02:29 +01:00
Nicolay Mitropolsky
af63fcb3be KotlinElementActionsFactory: adding empty annotations without parenthesises 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
1669b6aa9f 192: KotlinElementActionsFactory: changing parameters could add annotations 2019-03-21 12:47:27 +03:00
Nicolay Mitropolsky
6b91b7cce5 192: KotlinElementActionsFactory: support for keeping existing parameters on signature change 2019-03-21 12:47:26 +03:00
Nicolay Mitropolsky
713f73e414 Uast: getMaybeLightElement returns class for annotation primary constructor 2019-03-21 12:46:28 +03:00
Nicolay Mitropolsky
7b590055f8 Uast: resolveCallToDeclaration cleanup 2019-03-21 12:46:27 +03:00
Nicolay Mitropolsky
90894176f9 Uast: stop resolve parts of fqn to the full-name target 2019-03-21 12:46:27 +03:00
Dmitry Gridin
403801b0b3 Fix exception when add import
#KT-30524 Fixed
2019-03-21 16:35:43 +07:00
Dmitry Gridin
3ce002dd6e Improve: optimize ConvertMemberToExtension 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e8eb9c3d58 Minor: refactoring ConvertMemberToExtensionIntention 2019-03-21 16:35:43 +07:00
Dmitry Gridin
e11072b8c2 Improve: add more cases for MoveVariableDeclarationIntoWhen
#KT-30499 Fixed
2019-03-21 16:32:41 +07:00
Dmitry Gridin
c84ff1d8b1 Inspection "MoveVariableDeclarationIntoWhen" should inline variable declaration 2019-03-21 16:31:29 +07:00
Dmitry Petrov
f9119c001e JVM_IR: generate file class without members if it has metadata 2019-03-21 11:23:51 +03:00
Dmitry Petrov
a5c95275f0 IR: get rid of descriptors in DumpIrTree 2019-03-21 11:23:51 +03:00
Dmitry Petrov
9a82f926a1 IR: descriptor-less rendering of IR elements (work in progress) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
cd138bc022 IR: IrSymbolVisitor 2019-03-21 11:23:51 +03:00
Dmitry Petrov
110a15d395 IR: drop IrFile.fileAnnotations (it already has annotations anyway) 2019-03-21 11:23:51 +03:00
Dmitry Petrov
b42aa39033 IR: drop IrTypeAlias 2019-03-21 11:23:51 +03:00
Dmitry Petrov
e49eae528c IR: don't use descriptors in rendering (work in progress)
There's some descriptor-based code remaining. Need some more work on IR.
2019-03-21 11:23:51 +03:00
Toshiaki Kameyama
bd3d5a9dbb Use withIndex intention: fix false positive for destructuring declaration
#KT-30341 Fixed
2019-03-21 10:59:01 +03:00
Toshiaki Kameyama
cbdc79fcda Add when branches: remove unnecessary blank line
#KT-30426 Fixed
2019-03-21 10:58:11 +03:00
Mikhail Glukhikh
c1984d92ff Introduce FirFile.fileSession, get rid of most FirElement.session usages 2019-03-21 10:29:58 +03:00
Roman Artemev
698594b14d [IR] Fix classifier equality for Local classes 2019-03-20 23:45:03 +03:00
Vyacheslav Gerasimov
4cd95256b6 Build: Add tasks to clean repo directory and legacy repo directories 2019-03-20 23:38:36 +03:00
Ilya Chernikov
43e4dbb0b1 Fix tests after unblocking exceptions on loading script definitions
should be temporary, proper solution needed in the future
2019-03-20 21:19:25 +01:00
Ilya Chernikov
ffd1633e3e Write tests for dynamic versions with ivy and maven resolvers
and refactor tests
#KT-27051 fixed
this commit is just a confirmation of the fix: either it worked
from the beginning, or was fixed by some unrelated change
2019-03-20 21:19:24 +01:00
Ilya Chernikov
f2bddce4fd Refactor script definition loading error handling
reenable logging of failures
suppress loading from failed contributors
2019-03-20 21:19:24 +01:00
Ilya Chernikov
dd3ac74bd2 Refactor ivy resolver
add support for artifacts with type an classifier
use ibiblio resolver by default - it is designed for working with maven central
add test, but disable it - see comments for the reason and todos
2019-03-20 21:19:24 +01:00
Ilya Chernikov
fc9a6dec7e Add optional suffix to the script template markers
add suffix to the markers in the repo
#KT-28593 fixed
2019-03-20 21:19:24 +01:00
Ting-Yuan Huang
79fcaae991 Implement constant folding in the IR backend for JVM
The newly added pass folds the set of constant functions of the
current backend, plus IrBuiltIns.
2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
7e4d33be24 ConstantExpressionEvaluator: make evaluate*naryAndCheck public 2019-03-20 21:02:55 +01:00
Ting-Yuan Huang
f352a4dcd4 IrBuiltIns: factoring out operator names
so that they can be used in other contexts.
2019-03-20 21:02:55 +01:00
Ilya Gorbunov
8021f9c4af Clarify toSortedMap and sortedMapOf docs (KT-30100)
Remove the note about iteration order so that toSortedMap is not misused
for sorting map entires with the comparator inconsistent with key equality.
2019-03-20 22:08:03 +03:00
Vyacheslav Gerasimov
c650206f54 Build: Fix hardcoded paths in artifacts for JPS build 2019-03-20 21:29:25 +03:00
Vyacheslav Gerasimov
d9b149fd2f Build: Rename kotlinBuildRepo -> kotlinBuildLocalRepo 2019-03-20 21:29:24 +03:00
Vyacheslav Gerasimov
a1a30ad041 Build: Rename nodeJS -> nodeJSPlugin 2019-03-20 21:29:22 +03:00
Vyacheslav Gerasimov
128b70e2c4 Build: Add property to enable dependency task output verification
Enabled on teamcity by default, disabled locally by default,
kotlin.build.dependency.output.verification may be used to specify explicitly
2019-03-20 21:29:21 +03:00
Vyacheslav Gerasimov
a543dee39a Build: Get jps-build-test directly from maven 2019-03-20 21:29:19 +03:00
Vyacheslav Gerasimov
d9d6e9b10a Build: Merge AndroidSdkDependencies.kt & intellijDependencies.kt 2019-03-20 21:29:18 +03:00
Vyacheslav Gerasimov
98a7c5264c Build: Move intellij-sdk contents to prepare-deps 2019-03-20 21:29:16 +03:00
Vyacheslav Gerasimov
139286bf44 Build: Merge prepare-deps/android-dx to intellij-sdk 2019-03-20 21:29:14 +03:00
Vyacheslav Gerasimov
fc8be48fa8 Build: Improve intellij-sdk repo up-to-date check time & layout
Up-to-date check is very heavy for intellij repo due to artifact size.
If module directory in repo is written only by one task we can assume
that task if up-to-date if target directory exists.
2019-03-20 21:29:13 +03:00
Vyacheslav Gerasimov
f890cab145 Build: Rename custom-dependencies -> dependencies 2019-03-20 21:29:11 +03:00
Vyacheslav Gerasimov
07b0129a6a Build: Build android-dx and intellij-sdk repo to dependencies/repo
From KOTLIN-CR-2801 reasons to move:
 - I've changed repo layout and build process in incompatible way and decided to change location
 - It was difficult to find and annoying to locate, it was very deep and long path
 - I think dependencies/repo path is very easy to remember and find
 - It was called dependencies some time ago
2019-03-20 21:29:09 +03:00
Vyacheslav Gerasimov
ef159a4fc9 Minor: Fix typo in build error message 2019-03-20 21:17:27 +03:00
Vyacheslav Gerasimov
9f64e0fa69 Build: Remove intellijEnforceCommunitySdk flag, use currentIde instead
Setup ultimate repositories only when currentIde is Intellij
2019-03-20 21:17:27 +03:00
Yan Zhulanow
683c2b0434 Don't use experimental features of Android Extensions in 'testAndroidDaggerIC()'
AndroidDaggerProject uses the @Parcelize functionality that was experimental until 1.3.30. Now it is not.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
44f752d1c5 Always attach kotlin-android-extensions-runtime library
@Parcelize is now enabled by default, and it requires the runtime library.
Enabling it for all clients is a temporary solution.
In future, the runtime library will be split to two separate artifacts.
2019-03-20 20:52:23 +03:00
Jake Wharton
8e23555660 Make parcelize a non-experimental feature
It was already being added to the feature list by default, but was only enabled when isExperimental was true.
2019-03-20 20:52:23 +03:00
Yan Zhulanow
c40cc76ad3 Minor: Fix error message, add missing article 2019-03-20 20:52:23 +03:00
Yan Zhulanow
c7678a27e5 Kapt: Fix star indentation in stub Javadoc (KT-30163) 2019-03-20 20:52:23 +03:00
Yan Zhulanow
e4d758b614 Kapt: Support default constant values for constructor parameters 2019-03-20 20:52:23 +03:00
Yan Zhulanow
10e53a2e73 Kapt: Move out the 'final' fallback for initial field values 2019-03-20 20:52:22 +03:00
Yan Zhulanow
cce2b472bf Kapt: Generate constant value initializers for mutable properties (KT-30164) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
ce13982cfc Kapt: Use constant value references where possible in property initializers 2019-03-20 20:52:22 +03:00
Yan Zhulanow
66754e62da Kapt: Always use raw types for annotation parameter types (KT-30346) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
90e84aa15d Remove isAtBreakpoint checks as it's not valid in all cases
For example, when we stopped at a breakpoint and then did a 'step over' action, we aren't at that breakpoint any more.
However, we still can evaluate things.
2019-03-20 20:52:22 +03:00
Yan Zhulanow
bbdeb3efac Avoid using 'loadClass()' as it doesn't cache the results 2019-03-20 20:52:22 +03:00
Yan Zhulanow
e79ee1ba8e Use caching 'findClass()' instead of raw 'Class.forName()' call in async stack trace provider (KT-30268) 2019-03-20 20:52:22 +03:00
Yan Zhulanow
b2a47027fb Move eval4j to idea 2019-03-20 20:52:22 +03:00
Yan Zhulanow
65da7ba971 Add the whole content of the Apache 2.0 license to the Kotlin repo 2019-03-20 20:52:21 +03:00
Yan Zhulanow
6d90e850ff Refactoring: Incapsulate method calls into ExecutionContext 2019-03-20 20:52:21 +03:00
Yan Zhulanow
5d156c2edb Debugger: Fix indentation in code fragments 2019-03-20 20:52:21 +03:00
Yan Zhulanow
a1e5ce2c8b Don't activate Kotlin async stack trace provider in Java sources (KT-30318) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
754a7bc554 Code fragment analysis: analyze parents if there's no sensible scope for the default element (KT-29179) 2019-03-20 20:52:21 +03:00
Yan Zhulanow
97f94700b9 Don't file an exception if we failed to calculate the anonymous class name 2019-03-20 20:52:21 +03:00
Yan Zhulanow
fd3fab5bcc Minor: Fix formatting in DebuggerClassNameProvider 2019-03-20 20:52:21 +03:00
Yan Zhulanow
d0a61fa7e2 Fix breakpoint handling in Kotlin scripts (KT-29234) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
4870b2e6ba Fix asmTypeForAnonymousClassOrNull(): it should not throw an exception if a class name isn't found 2019-03-20 20:52:20 +03:00
Yan Zhulanow
3f92451fde Explicitly check for the callable class availability
'@NotNull' annotation generates a not-null assertion that caused exceptions to throw from 'asmTypeForAnonymousClassOrNull()'.
2019-03-20 20:52:20 +03:00
Yan Zhulanow
77c2a5c87c Debugger: Fix missing NOP in empty 'when' header (KT-29189) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
ba0989801a Debugger: Show captured outer this in lambdas (Variables view) (KT-30220) 2019-03-20 20:52:20 +03:00
Yan Zhulanow
723f8df23e Hide '$delegate' variables in Kotlin variables mode 2019-03-20 20:52:20 +03:00
Yan Zhulanow
570421b831 Fix lambda evaluation on JDK 9-11 (KT-29423) 2019-03-20 20:52:20 +03:00
Sergey Igushkin
af7c35b5c7 Revert profile_settings.xml accidentally deleted in ffdd43b8 2019-03-20 19:56:50 +03:00
Jake Wharton
6ee987fa2e Add intrinsics for compile-time computing trimMargin/trimIndent
These only apply when the receiver can be resolved to a constant and the margin prefix, if specified, is also a constant.
2019-03-20 17:25:29 +01:00
Alexey Tsvetkov
2ec6ab92b5 Clear outputs before compiling with in-process/out-of-process execution mode
Issue #KT-30492 Fixed
2019-03-20 17:11:37 +03:00
Ivan Gavrilovic
b2ad82b7d2 Incremental KAPT - invalidate obsolete types
Once set of dirty symbols is computed, filter these types
when they are requested from the JavaFileManager. This is accomplished
by tracking all declared types in the sources and generated sources.
It is not necessary track types in generated class files, as these will
be removed before the APs are incrementally run.

Motivation: APs (e.g. Dagger) may use Elements.getTypeElement(String)
to determine if type is already present, and if it is, they will not
generate it. Therefore, whenever generated sources is invalidated, types
it defines need to be filtered in the JavaFileManager.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:13 +03:00
Ivan Gavrilovic
2f3d234516 Incremental KAPT - handle inherited annotations
Handle annotations with @Inherited. This is important for
the aggregating APs, as the current implementation passes all sources
annotated with claimed aggregating annotations.

Issue is https://youtrack.jetbrains.com/issue/KT-23880
2019-03-20 16:43:10 +03:00
Ivan Gavrilovic
9f14daa682 Incremental annotation processing with KAPT
Add support for incremental annotation processors in KAPT. These
processors conform to https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing
specification.

Support is provided by using javac compiler APIs and
recording the source file structure. At runtime, processors
are instrumented with custom Filer that is used to keep track of generated
files. In order to support classpath changes, stub generation task is
used to generated a list of changed FQCNs, and this is simply used by KAPT.
Both worker and non-worker mode are supported.

 #KT-23880
2019-03-20 16:43:02 +03:00
Dmitry Gridin
600a955a51 Fix false positive "Unused import" for type alias
#KT-29977 Fixed
2019-03-20 20:28:22 +07:00
Dmitry Gridin
7e4b3ceede Minor: refactoring KotlinUnusedImportInspection 2019-03-20 20:28:22 +07:00
Toshiaki Kameyama
4e3d13fcee Change to star projection: do not suggest in arguments or receiver
#KT-23259 Fixed
2019-03-20 20:12:06 +07:00
Nikolay Krasko
73396b5018 Log connection problems during fetching release date 2019-03-20 14:23:43 +03:00
Nikolay Krasko
9a5b902766 Use special request for fetching plugin release date in exception reporter 2019-03-20 14:23:43 +03:00
Nikolay Krasko
a0d015dd4d Minor: document shortening and smart enter use resolve in write action 2019-03-20 14:23:42 +03:00
Nikolay Krasko
1060a24221 Don't allow to resolve anything within write action 2019-03-20 14:23:42 +03:00
Dmitry Petrov
7e4688da93 psi2ir: add test for reference to var with non-accessible setter 2019-03-20 11:57:57 +03:00
Dmitry Petrov
21dbe2e7e7 IR: symbolName mangling for IrTypeParameter
(original author: Alexander Gorshenev)
2019-03-20 11:57:57 +03:00
Roman Artemev
206e5d30d9 Regenerate protobuf 2019-03-20 11:57:57 +03:00
Dmitry Petrov
c86ef5da53 psi2ir: update testData for property references 2019-03-20 11:57:57 +03:00
romanart
5b5f3a7468 [IR] Fix classes TypeParameter [de]serialization 2019-03-20 11:57:57 +03:00
Dmitry Petrov
9f48695dde psi2ir: no unbound field symbols in delegated property references
#KT-30323 Fixed
2019-03-20 11:57:57 +03:00
Dmitry Petrov
15918fc475 IR: deprecations 2019-03-20 11:57:57 +03:00
Dmitry Petrov
bd9c5645cd IR: fix property reference symbol binding for generic properties 2019-03-20 11:57:57 +03:00
Dmitry Petrov
8b4dab7c25 JS_IR: fix property name generation 2019-03-20 11:57:57 +03:00
Dmitry Petrov
04fad012a0 IR: IrPropertySymbol introduced, some code cleaned up
#KT-30304
2019-03-20 11:57:57 +03:00
Anton Yalyshev
1bc35b1b0c updated TipsOfTheDay pics, as New Project Wizards got new names 2019-03-20 11:23:18 +03:00
Ting-Yuan Huang
f6cf434650 when: emit switch for String if possible
Effectively, the following when structure:

  when (s) {
    s1, s2 -> e1,
    s3 -> e2,
    s4 -> e3,
    ...
    else -> e
  }

is implemented as:

  when (s.hashCode()) {
    h1 -> {
      if (s == s1)
        e1
      else if (s == s2)
        e1
      else if (s == s3)
        e2
      else
        e
    }
    h2 -> if (s == s3) e2 else e,
    ...
    else -> e
  }

where s1.hashCode() == s2.hashCode() == s3.hashCode() == h1,
      s4.hashCode() == h2.

A tableswitch or lookupswitch is used for the hash code lookup.

Change-Id: I087bf623dbb4a41d3cc64399a1b42342a50757a6
2019-03-20 09:13:51 +01:00
Dmitriy Dolovov
1a9ed88be4 Don't publish CLion/AppCode plugins to IDEA channel at plugins.jetbrains.com 2019-03-20 12:19:30 +07:00
Sergey Igushkin
914f7c8719 KT-27675: Following the Gradle Java plugin, enable Kapt cache by default
As the Gradle Java plugin considers Java annotation processing cacheable
with any annotation processors, we can enable build cache by default
for Kapt tasks, leaving the opt-out flag just in case.

Issue #KT-27675 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
ffbd0e8af1 Automatically detect Android Java 1.8 source+target (KT-21030)
When Android Java 8 desugaring is set as follows (or above):

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

set the Kotlin JVM target to 1.8

Issue #KT-21030 Fixed
2019-03-19 21:22:35 +03:00
Sergey Igushkin
70db646576 Fix wrong commits picked for master: restore changes from KOTLIN-CR-2817 2019-03-19 21:22:35 +03:00
Sergey Igushkin
ec3e5c6959 Revert "Use KotlinTarget.disambiguationClassifier for task & configuration names" 2019-03-19 21:10:26 +03:00
Roman Artemev
2ed29d8869 [IR BE] Use pure IrType instead of KotlinType
* clean up code
2019-03-19 20:09:07 +03:00
Ilya Chernikov
1823ba1c48 Fix deserialization of the compiled script
#KT-29741 fixed
2019-03-19 17:11:52 +01:00
Ilya Chernikov
b395cb120a Implement import test witch caching
reproduced KT-29741
plus some tests refactoring
2019-03-19 17:11:52 +01:00
Ilya Chernikov
931b1c66d8 Fix equality and serializability of scripting data, fix relevant caching behaviour 2019-03-19 17:11:52 +01:00
Ilya Chernikov
7a4d369c9f Extend script cache tests, revealing that cache doesn't work in fact 2019-03-19 17:11:52 +01:00
Ilya Chernikov
6e55116519 Relocate packages that could be possibly used in the scripts themselves
#KT-30210 fixed
2019-03-19 17:11:52 +01:00
Sergey Igushkin
91ce7ef5ca Introduce new Gradle plugin org.jetbrains.kotlin.js
This is the Gradle plugin that does not rely on the
Java model and uses the same Kotlin model
(target – compilation – source set) as MPP does.

Also add JS DCE support for this plugin.

Issue #KT-5756 Fixed
Issue #KT-13256 Fixed
Issue #KT-16355 Fixed
Issue #KT-20156 Fixed
Issue #KT-29284 Fixed
2019-03-19 16:32:11 +03:00
Sergey Igushkin
03b74343c8 Refactor & minor fix in software component logic of AbstractKotlinTarget
* Create the sources JAR for both Gradle 4.7+ and versions below 4.7
* Set `componentName` in all branches of `createKotlinVariant`
2019-03-19 16:24:37 +03:00
Sergey Igushkin
5b5316214f Apply user-defined attributes in single-platform plugins
The attributes applied by the user to the target and its compilations
were ignored in single-platform plugins while the target was not a part
of the API.

Since the user will be able to access and configure the target, we need
to apply the attributes to the relevant configurations in the same way
as in MPP.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
8fa1630695 Add the single-platform target's 'components' to 'project.components' 2019-03-19 16:24:37 +03:00
Sergey Igushkin
a19e8fe03e Use KotlinTarget.disambiguationClassifier for task & configuration names
In MPP, the disambiguation classifier is always the same as the target
name. In single-platform projects, the task name suffix should be empty
for the JVM targets. Using the `disambiguationClassifier` for this
purpose is more consistent with other usages of
`disambiguationClassifier`.

The target name for all existing single-platform plugins will be just
'kotlin'.
2019-03-19 16:24:37 +03:00
Sergey Igushkin
4e711f9a0c Introduce single-project extensions with static types for Kotlin target 2019-03-19 16:24:37 +03:00
Sergey Igushkin
b3eef05e6e Fix user-specified attributes in Android targets (KT-27714)
Ensure that custom target and compilation attributes are copied to
relevant configurations of Android targets as well, which did not happen
because of Android variants (and missing simple apiElements,
runtimeElements) and Android compilations being created late in the
project configuration.

Issue #KT-27714 Fixed
2019-03-19 16:24:36 +03:00
Sergey Igushkin
6fa610156e Create and configure Android compilations earlier (KT-29964)
As Android variants are created after the project is evaluated,
the build script and plugins might have added some item handlers to the
domain object containers which are yet to be filled.

To ensure that those handlers see properly configured compilations and
their tasks, we need to add a compilations to the container only after
it has been properly configured.

Also, the `forEachVariant` handler is already executed in
`afterEvaluate`, and there seems to be no need to wrap our
code working with variants in `afterEvaluate`.

Issue #KT-29964 Fixed
2019-03-19 16:24:36 +03:00
Toshiaki Kameyama
e06514c945 Smart completing anonymous object: follow code style settings (KT-29572)
#KT-29572 Fixed
2019-03-19 16:09:07 +03:00
kenji tomita
e1f26ffc74 Remove spaces between accessor and its parameter list in formatter (KT-30393)
#KT-30393 Fixed
2019-03-19 16:09:07 +03:00
Toshiaki Kameyama
0acecb4936 Minor: fix caret behaviour in arg template test
#KT-29398 Fixed
2019-03-19 16:09:07 +03:00
Alexander Udalov
29d32b213e Cleanup modules descriptors.jvm, descriptors.runtime
Fix warnings and inspections
2019-03-19 13:01:03 +01:00
Alexander Udalov
b89d7029b2 Reformat modules descriptors.jvm, descriptors.runtime
Also remove several unused files (BuiltinOverridabilityCondition.kt,
PackageMappingProvider.kt)
2019-03-19 13:01:02 +01:00
pyos
39adfcced1 Add more comments to PropertyReferenceLowering 2019-03-19 12:00:29 +01:00
pyos
ed298c48b7 Unmute a test fixed by a combination of PR #2151 and #2184 2019-03-19 12:00:29 +01:00
pyos
6c68474489 JVM_IR: use correct signatures for local delegated property references
Which is `<v#N>` where N is the index of that property in the containing
class.
2019-03-19 12:00:29 +01:00
pyos
8c55376f0c Unmute almost all JVM_IR tests that use property references 2019-03-19 12:00:29 +01:00
pyos
330c4648cb Implement property references in JVM_IR 2019-03-19 12:00:29 +01:00
Dmitry Gridin
43be01bbc8 Fix false positive 'Introduce import alias' on this/super 2019-03-19 16:42:41 +07:00
Dmitry Gridin
1626bc4751 Optimize "Introduce import alias"
Relates to #KT-30462
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ccb1ae13ea Fix local conflicts in 'Introduce import alias' 2019-03-19 16:42:41 +07:00
Dmitry Gridin
9659453351 Improve: intention "Introduce Import Alias" should suggest new names for the new alias
#KT-30456 Fixed
2019-03-19 16:42:41 +07:00
Dmitry Gridin
ff34788eb3 Minor: refactoring KotlinNameSuggester 2019-03-19 16:42:41 +07:00
Nicolay Mitropolsky
0d2426b081 191: Uast: isJvmElement check added to the newly added conversion methods (EA-125791) 2019-03-19 12:24:44 +03:00
Mikhail Glukhikh
a07502374e Rename (style): russian "С" to english "C" 2019-03-19 12:23:47 +03:00
pyos
82ccf81da8 Fix this remapping in inner class constructors
Inner class constructors should use the argument instead of reading
outer `this` from a field because if such an access happens before a
delegating constructor call, e.g. when evaluating an argument, a JVM
bytecode validation error will be thrown. (The only operation on `this`
allowed before a delegating constructor call is SETFIELD, and only if
the field in question is declared in the same class.)
2019-03-19 09:20:41 +01:00
pyos
7e8db4cc4a Refactor InnerClassesLowering 2019-03-19 09:20:41 +01:00
Toshiaki Kameyama
a2adfd0cc0 Nested lambda has shadowed implicit parameter: do not report when lambda is in scope function
#KT-30173 Fixed
2019-03-19 10:37:47 +03:00
Dmitry Gridin
daf8df9e4b Fix flaky test AddReturnToUnusedLastExpressionInFunction/Nothing 2019-03-19 11:29:53 +07:00
Ilya Matveev
fd9ac54d81 Improve deprecation warning about usage of old binary DSL
Previously we showed list of all deprecated APIs even if a user uses
only one of them. This patch changes the behaviour and shows only
APIs really used by the user. An approach similar to the one used by
SingleWarningPerBuild in applied here.

Issue #KT-29998 Fixed
2019-03-19 11:19:49 +07:00
Ilya Matveev
bfb0d738b1 Disable C2 compiler for HotSpot VM when running K/N tools 2019-03-19 11:19:48 +07:00
Ilya Gorbunov
b74fe7c1c3 Clarify floor and ceil docs (KT-30418) 2019-03-19 03:12:12 +03:00
Ilya Gorbunov
b0a234ec74 Minor: collection docs formatting 2019-03-19 03:12:09 +03:00
Ilya Gorbunov
bc444df20c Clarify behavior of MutableSet.add (KT-29373) 2019-03-19 03:12:04 +03:00
Alexander Gorshenev
e9ad9273b1 Proper KotlinIr protobuf location. 2019-03-18 23:29:44 +03:00
Dmitriy Novozhilov
d01b6ef900 Revert "[NI] Support @OnlyInputTypes annotation. #KT-29307 fixed"
This reverts commit 90628112
With that annotation there is complex bug that breaks build of Kotlin compiler
2019-03-18 18:53:38 +03:00
Ilya Gorbunov
25b3f62767 Clarify yield/yieldAll function suspending the caller behavior 2019-03-18 18:01:39 +03:00
Mikhail Glukhikh
16f9eecb29 Fix "/ by zero" in FirResolveBench & switch progress OFF in smoke tests 2019-03-18 17:12:02 +03:00
Mikhail Glukhikh
741bdccca5 Enhance progress logging in FIR total resolve tests 2019-03-18 14:49:11 +03:00
Mikhail Glukhikh
a334ca6224 Move FIR total kotlin resolve in IDE test into performance group 2019-03-18 14:48:50 +03:00
Anton Yalyshev
71eb540eaf improved english in wizard's descriptions. also now user knows about project's build system from its name 2019-03-18 14:15:35 +03:00
Svyatoslav Kuzmich
1d6cd90043 [JS IR BE] Clean up compiler driver api
This is a preparation step for JS-IR CLI:
- CompiledModule was overused. Split it into KlibModuleRef and TranslationResult
- Deserialize klib dependencies from klibs itself
2019-03-18 14:13:28 +03:00
Svyatoslav Kuzmich
e302f63d9a [JS IR BE] Remove generateModuleInGlobalScope for code generator
This method used to be a workaround for test speedup.
Now we use proper close world module with runtime+stdlib module
as pre-serialized klib.
2019-03-18 14:13:28 +03:00
Ilmir Usmanov
d154cf9a59 Fix test data 2019-03-18 14:04:04 +03:00
Ilmir Usmanov
c68413b953 Do not generate StateMachineChecker if CHECK_STATE_MACHINE directive is
not present.
Otherwise, since it uses suspend functions, it breaks IR tests.
2019-03-18 14:04:03 +03:00
Ilmir Usmanov
7956ef18b2 Generate RETURN instead of ARETURN if (cross)inline suspend lambda returns Unit
#KT-30073 Fixed
2019-03-18 14:04:02 +03:00
Ilmir Usmanov
cc9a0041e0 Check number of suspensions in crossinline tests 2019-03-18 14:04:01 +03:00
Ilmir Usmanov
df52c5217d Add facility to check number of suspensions in coroutine tests 2019-03-18 14:04:01 +03:00
Maxim Shafirov
ca35c9e2ff Update copyright dates 2019-03-18 12:52:27 +03:00
Nikolay Krasko
b0156bc5db Minor: cleanup KotlinTypeCheckerTest.java 2019-03-18 11:56:20 +03:00
Burak Eregar
db4144426a Fix SimplifiableCallChain inspection quick fix removes comments for intermediate operations 2019-03-18 11:35:32 +03:00
Toshiaki Kameyama
8728bc0820 Convert to scope function: also convert binary expression
#KT-30228 Fixed
2019-03-18 11:18:23 +03:00
Toshiaki Kameyama
e340af51df Add "Rename class to containing file name" intention
#KT-25262 Fixed
2019-03-18 11:09:09 +03:00
Toshiaki Kameyama
39016594b1 Replace return with 'if'/'when': don't drop return label
#KT-30414 Fixed
2019-03-18 09:46:10 +03:00
victor.petukhov
9a2178d96b Split 'nothingTypedSuspendFunction' test into two separate tests (for old and new coroutines) 2019-03-16 21:39:44 +03:00
victor.petukhov
29493a4977 Fix 'nothingTypedSuspendFunction' test after 70c35f4186 2019-03-16 14:15:08 +03:00
Alexander Gorshenev
51e862e793 Fix file descriptor unlimited growth. 2019-03-16 13:45:45 +03:00
victor.petukhov
5fc0d85b3c Regenerate FIR tests (include tests for implicit nothing as type parameter) 2019-03-16 00:41:58 +03:00
Alexander Udalov
2539873492 Remove CommonBackendContext.getClass
This function is unused in backend.common (and actually throws exception
in Native), therefore it makes sense to move it down to subtypes
2019-03-15 19:27:48 +01:00
Alexander Udalov
e13b8eb039 Remove CommonBackendContext.getInternalFunctions
Similarly to getInternalClass, move to subclasses
2019-03-15 19:27:48 +01:00
Alexander Udalov
bd694105e9 Remove CommonBackendContext.getInternalClass
Move to subclasses: getJvmInternalClass, getJsInternalClass and
getKonanInternalClass (in Kotlin/Native). The advantage of this is that
this API need not be shared between backends any longer, which makes
sense because implementation details differ across platforms
2019-03-15 19:27:48 +01:00
Alexander Udalov
4ab1916ebf Cleanup Symbols and JvmIr.JvmSymbols 2019-03-15 19:27:47 +01:00
Alexander Udalov
e9c2bc81aa Remove lateinitIsInitializedPropertyGetter, introduce static check function
This will be helpful in JVM IR tests without stdlib where it's not
necessary to have 'isInitialized' in dependencies
2019-03-15 19:27:47 +01:00
Alexander Udalov
c730de13df Minor, add missing copyright to compiler modules 2019-03-15 19:27:46 +01:00
Alexander Udalov
9ca7719d1f Minor, inline obsolete and deprecated createFunctionSymbol
Also undeprecate 'createSymbolForScopeOwner' and make it private
2019-03-15 19:07:16 +01:00
Alexander Udalov
0c8e58936c Remove DeepCopyIrTree and most "Creates unbound symbol" deprecated members 2019-03-15 19:05:19 +01:00
victor.petukhov
70c35f4186 Introduce warning about implicitly inferred Nothing as a type parameter
^KT-20849 Fixed
2019-03-15 19:28:38 +03:00
Roman Artemev
1f98eaa27b [JS IR BE] Fix Callable reference with vararg
* Update tests
2019-03-15 19:21:38 +03:00
Roman Artemev
a2d65e8a60 [IR] Code clean up 2019-03-15 19:21:38 +03:00
Roman Artemev
95821313e3 [IR BE] Get rid of usages of descriptor-based IrType utils 2019-03-15 19:21:38 +03:00
Roman Artemev
238f1b2b06 [IR] * Implement isSubtypeOfClass and commonSuperclass based on pure Ir
* Implement type strict equality check
     * Move type checkers into Ir
     * Implement strict Fqn-based classifier equality checker
2019-03-15 19:21:38 +03:00
Simon Ogorodnik
e056882aa6 Add DiagnosticsTest testData based smoke test for FIR #KT-29962 Fixed
Yet seven of these tests fail with an exception in RawFirBuilder
2019-03-15 18:31:55 +03:00
Mikhail Glukhikh
0d976a4870 FIR: forbid supertype resolve in local classes 2019-03-15 18:31:49 +03:00
Abduqodiri Qurbonzoda
35c6f09886 Implement coerce extension functions for unsigned types 2019-03-15 17:46:48 +03:00
Abduqodiri Qurbonzoda
a369496aca Throw IOOB on invalid index in JS StringBuilder.get to adhere contract 2019-03-15 17:40:31 +03:00
Abduqodiri Qurbonzoda
814d6cf39c Document Array and String get() function behavior (KT-30141) 2019-03-15 17:40:19 +03:00
Anton Bannykh
a4c693ec29 [JS IR BE] updated inliner to the most recent version
FunctionInlining.kt commit 364b7ae72a :
364b7ae72a/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/lower/FunctionInlining.kt
2019-03-15 14:56:33 +03:00
Anton Bannykh
0249e33f3e IR: add skipExternalProperties flag to PropertiesLowering
Same problem as in deafult argument lowering: JVM and JS semantics differ.
Same solution: skip in common lowerings, process if needed in platform ones.
2019-03-15 14:56:31 +03:00
Anton Bannykh
9a56b0e6d6 [JS IR BE] Reorder phases in order to extract a common prefix 2019-03-15 14:56:31 +03:00
Anton Bannykh
017cd3a0f6 IR: more verbose unsatisfied phase requirement reporting 2019-03-15 14:55:10 +03:00
Anton Bannykh
9dd9ef1cf0 IR: Make Phaser complain about duplicate phase names
(instead of silently throwing away all but the last phase
with the same name)
2019-03-15 14:55:10 +03:00
Anton Bannykh
bb1660c688 JS: better error reporting for V8 runner
In case of stack overflow both the code and the memory release
caused an exception. Only the latter was shown, and it did
not contain much useful information.
2019-03-15 14:55:10 +03:00
Anton Bannykh
b61a520da9 [JS IR BE] unmute tests 2019-03-15 14:07:53 +03:00
Svyatoslav Kuzmich
41a45d98e7 [JS IR BE] Regenerate & unmute tests 2019-03-15 13:53:23 +03:00
Svyatoslav Kuzmich
0f07209490 [JS IR BE] Remove unnecesary println from tests 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
d203e062bb [JS IR BE] Remove package from operators.kt 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
7b3416c99f [JS IR BE] Disable @library test for JS IR
@library is an internal annotation used in legacy stdlib to expose
declarations written in JS.

IR BE based stdlib will not include JS code thus annotation will not
be supported.
2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
41bbd4d2d6 [JS IR BE] Support property accessors with @JsName 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
c7f1238a07 [JS IR BE] Add @JsName to inheritanceInNativeClass.kt test to avoid relying on mangling 2019-03-15 13:53:21 +03:00
Svyatoslav Kuzmich
9230b70294 [JS IR BE] Minor dynamic refactoring 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
94dc6ff24a [JS IR BE] Disable legacy test 2019-03-15 13:53:20 +03:00
Svyatoslav Kuzmich
4005b5ce10 [JS IR BE] Fix fqNames in moveBodilessDeclarationsToSeparatePlace 2019-03-15 13:53:20 +03:00
Dmitry Gridin
d333a0ad4e Allow "Create class" action in return statement
#KT-22137 Fixed
2019-03-15 17:33:14 +07:00
Dmitry Gridin
41cfb4e2ed Minor: refactoring createClassUtils.kt 2019-03-15 17:33:14 +07:00
Dmitry Gridin
220cb95b85 Move caret to class name after creating it from "CreateFromUsage" action
Relates to #KT-24631
2019-03-15 17:27:06 +07:00
Alexander Gorshenev
0c8f0a433d Copying kotlin-native fix
* commit 575cbf48c3
    | Author: SvyatoslavScherbina <Svyatoslav.Scherbina@jetbrains.com>
    | Date:   Thu Mar 14 14:25:10 2019 +0300
    |
    |     Optimize DescriptorReferenceDeserializer again (#2755)

to common ir deserializer.
2019-03-15 12:48:48 +03:00
Anton Bannykh
826b9d935d JS/JS IR: split testing tasks for the two backends
Run jsTest for current backend, and jsIrTest for the JS-IR backend tests
2019-03-15 12:19:33 +03:00
Dmitriy Novozhilov
b07aed7a00 [NI] Fix determination of completion mode. #KT-30406 Fixed 2019-03-15 10:39:50 +03:00
Dmitriy Novozhilov
1c92c22dee [NI] Add support ExpectedTypeFromCast to new inference. #KT-30405 Fixed 2019-03-15 10:39:29 +03:00
Dmitriy Novozhilov
9062811231 [NI] Support @OnlyInputTypes annotation. #KT-29307 fixed
Also KT-26698 fixed in new inference
2019-03-15 10:39:11 +03:00
Dmitriy Novozhilov
0ba163d70b [NI] Fix testdata of inference lambdas with SAM conversions
Tetdata was broken in 3e147af3c0
#KT-27565 related
2019-03-15 10:39:11 +03:00
Mark Punzalan
3585792b3b Break out bytecodeText/conditions tests into smaller tests for if/while/do-while. 2019-03-15 08:32:22 +01:00
Mark Punzalan
9eb11ff3e9 Generate conditional jumps with optimizations for loops, if possible. 2019-03-15 08:32:22 +01:00
Mikhail Glukhikh
2aaf13e734 FIR: fix test compilation for 181 patchset 2019-03-15 10:24:15 +03:00
Ilya Gorbunov
7a038f1330 Refactor sanitizeStackTrace function to spare allocations
Use Arrays.copyOfRange instead of List.subList.toArray.
2019-03-15 06:26:59 +03:00
Alexander Gorshenev
ee7660065b Changes after code review 2019-03-15 03:03:08 +03:00
Alexander Gorshenev
f8be378a65 Port of native fix to common deserializer
* commit 347e2dadc6
    | Author: Igor Chevdar <igor.chevdar@jetbrains.com>
    | Date:   Wed Mar 6 12:51:40 2019 +0300
    |
    |     [Serializer] More graceful fix of parents
2019-03-15 03:03:08 +03:00
Alexander Gorshenev
cc93239397 Commonized native and js IR serialization infrastructure 2019-03-15 03:03:08 +03:00
Mikhail Glukhikh
909a5fd32d FIR: implement named arguments #KT-24081 Fixed 2019-03-14 18:30:13 +03:00
Mikhail Glukhikh
d65b30dd82 Fix corner-cases in ConeTypeContext / FIR builder / FIR enhancements
This fixes a pack of FIR smoke diagnostic tests, now all of them pass
Related to KT-29962
2019-03-14 18:30:12 +03:00
Mikhail Glukhikh
8ea347653b Remove some FirElement.session usages in FIR resolve 2019-03-14 18:23:25 +03:00
Mikhail Glukhikh
63cb8bb1a7 Remove FirElement.session usages from RawFirBuilder & around
Related to KT-30187
2019-03-14 18:23:11 +03:00
Mikhail Glukhikh
e6bb920a1d FIR Java: support Kotlin extension overriding: at last, #KT-29937 Fixed 2019-03-14 18:18:40 +03:00
Mikhail Glukhikh
d00d078b4f FIR Java: implement "appendErasedType" thus adding predefined signatures
Related to KT-29937
2019-03-14 18:18:20 +03:00
Mikhail Glukhikh
43d06f85e3 Add raw type comparison for Java (J2K mapping is taken into account)
NB: Java enhancement scope does not perform substitution, so we could
have some duplicates inside "type enhancement" testData

Related to KT-29937
2019-03-14 18:17:58 +03:00
Mikhail Glukhikh
f5e2cd2ac4 No override check in FirClassUseSiteScope, fix nasty substitution bug
This fixes MPP override test
(see mppFakeOverride in FirMultiModuleResolveTestGenerated)
2019-03-14 18:17:44 +03:00
Mikhail Glukhikh
de14dd1b9f FIR type enhancements: more accurate * handling 2019-03-14 18:17:31 +03:00
Mikhail Glukhikh
c708171add FIR type enhancements: support annotations for default parameter values
Related to KT-29937
2019-03-14 18:17:17 +03:00
Mikhail Glukhikh
5f3a01c25a Get rid of FirElement.session usages inside fir:java 2019-03-14 18:16:58 +03:00
Mikhail Glukhikh
6c12fabf74 FIR: make JavaClassEnhancementScope use-site, get rid of scope providers
Related to KT-29937
2019-03-14 18:09:41 +03:00
Mikhail Glukhikh
e0348b56a1 FIR type enhancement: extract indexed Java type qualifiers 2019-03-14 18:08:16 +03:00
Mikhail Glukhikh
be412baf9f FIR type enhancement: fold flexible types when it's possible
Related to KT-29937
2019-03-14 18:08:01 +03:00
Mikhail Glukhikh
3d29b31177 FIR type enhancements: handle class qualifiers, add new JSR 305 tests
Related to KT-29937
2019-03-14 18:07:46 +03:00
Mikhail Glukhikh
6c8aba8039 FIR: support callable symbols in dependencies provider
This breaks mppFakeOverrides test because of bug in FIR fake overrides
2019-03-14 18:07:32 +03:00
Mikhail Glukhikh
33fb3d154b FIR Java model: support static members & enum entries
Related to KT-29218
2019-03-14 18:07:17 +03:00
Mikhail Glukhikh
0434a55ea2 FIR: add initial JSR 305 tests for Java type enhancements 2019-03-14 17:57:28 +03:00
Mikhail Glukhikh
14fb495ab6 Support Java constructors in FIR (related to KT-29218) 2019-03-14 17:57:13 +03:00
Mikhail Glukhikh
484e67727f JavaClassifierTypeImpl: convert to Kotlin & cleanup 2019-03-14 17:56:57 +03:00
Mikhail Glukhikh
21d19f4144 JavaClassifierTypeImpl.java -> kt 2019-03-14 17:56:41 +03:00
Mikhail Glukhikh
fb788dc4c0 Fix null Java type argument problem & add relevant test 2019-03-14 17:56:23 +03:00
Mikhail Glukhikh
7563a98999 FIR type enhancement: make J2K mapping and changed handling more exact
Related to KT-29937
2019-03-14 17:56:05 +03:00
Mikhail Glukhikh
9bb2278fd4 Simplify JavaClassEnhancementScope: callback -> TypeInSignature 2019-03-14 17:55:47 +03:00
Mikhail Glukhikh
226cf8e42c FIR Java types: handle wildcard types correctly
Related to KT-29937, KT-29218
2019-03-14 17:55:25 +03:00
Mikhail Glukhikh
6c79b184c0 FIR Java types: add Kotlin/Java mapping & mutability enhancements
Related to KT-29937
2019-03-14 17:55:10 +03:00
Mikhail Glukhikh
e7ac88d326 FIR: implement Java fields (in provider, type enhancement, scopes)
Related to KT-29218
2019-03-14 17:54:53 +03:00
Mikhail Glukhikh
4255c9f774 Add FIR enhancement tests, fix some exceptions / problems around them
Test data and tests themselves are based on
compiler/testData/loadJava/compiledJava
2019-03-14 17:52:33 +03:00
Mikhail Glukhikh
f31faafd72 Introduce initial version of FIR Java type enhancement
Java type enhancement is performed by a special scope kind
Java FIR dump was added for multiplatform tests to look at enhancements
Overrides, J2K mapping, special cases does not work yet

Related to KT-29937
2019-03-14 17:51:00 +03:00
Mikhail Glukhikh
060bd1b464 Add separate FirJava elements (class, method, parameter, type reference)
Related to KT-29218
2019-03-14 17:40:04 +03:00
Mikhail Glukhikh
109f1938f6 FIR: make simplification around class substitution scope 2019-03-14 17:39:49 +03:00
Mikhail Glukhikh
8ac34e1a0f Reformat: context (Java resolve) 2019-03-14 17:39:25 +03:00
Denis Zharkov
6740cdabac Get rid of ConeAbbreviatedType::directExpansion
It becomes necessary after extracting supertypes resolution into a
separate phase.
But also it looks reasonable because direct expansion actually depends
on the module we are looking from.
2019-03-14 17:06:45 +03:00
Denis Zharkov
92defc2ae3 Extract supertypes resolution into a separate FIR phase 2019-03-14 17:06:45 +03:00
Steven Schäfer
3f4c5c8d53 Resolve type aliases when looking for default arguments to actual methods.
Change-Id: I059093c1af32fcd7a2de36c25160c352d6f03a3c
2019-03-14 14:59:34 +01:00
Toshiaki Kameyama
dfd3947856 Keyword completion: add 'fun' after 'suspend' (KT-29038)
#KT-29038 Fixed
2019-03-14 15:35:45 +03:00
Toshiaki Kameyama
fd262bcd8d Smart completion: fix anonymous object code style (KT-29572)
#KT-29572 Fixed
2019-03-14 15:35:44 +03:00
Toshiaki Kameyama
6acf3ad629 Add "arg" postfix template (KT-29398)
#KT-29398 Fixed
2019-03-14 15:35:44 +03:00
Ilmir Usmanov
0c0f035241 Set default value of releaseCoroutines in TypeSignatureMapping to true 2019-03-14 15:06:07 +03:00
Dmitriy Dolovov
5af2cbeacd Fix MPP wizard tests
Issue #KT-30003 fixed
2019-03-14 18:11:25 +07:00
Nicolay Mitropolsky
69ea0175a2 KotlinElementActionsFactory.createAddAnnotationActions: adding @field annotation target for targetless annotations (KT-18459) 2019-03-14 10:59:00 +03:00
Dmitry Gridin
3bf0fb8957 Intention “Introduce import alias” shouldn't modify other files
#KT-30412 Fixed
2019-03-14 12:09:41 +07:00
Dmitry Gridin
179dfce3a8 Fix false positive for type error in intentions AddReturnTo...
Relates to #KT-25272
2019-03-14 10:52:59 +07:00
Georgy Bronnikov
d7ce24410d Remove descriptors from SharedVariablesManager 2019-03-13 23:13:41 +03:00
Ilya Gorbunov
edc766af56 Document exception thrown for negative n in take/takeLast/drop/dropLast
#KT-29151
2019-03-13 17:58:19 +03:00
Ilya Gorbunov
6bc7c06038 Add samples for is(|Not|NullOr)Empty and is(|Not|NullOr)Blank functions 2019-03-13 17:58:05 +03:00
Ilya Gorbunov
ed878be1f7 Docs: reword summaries for a couple of experimental annotations 2019-03-13 17:53:37 +03:00
Ilya Gorbunov
ffe8b4419c Docs: use consistent kotlinlang.org url in references 2019-03-13 17:53:37 +03:00
Dmitry Gridin
479e812bbc Fix false positive "Redundant lambda arrow" inspection
#KT-29590 Fixed
 #KT-19462 Fixed
 #KT-29124 Fixed
2019-03-13 20:57:30 +07:00
Sergey Igushkin
49ee197578 Ignore deprecated configurations in a test with Gradle 5.3+ (KT-30378) 2019-03-13 16:39:56 +03:00
Sergey Igushkin
0830977d16 Exclude the configurations of source sets from dependency resolution
The `*Api`, `*Implementation`, `*CompileOnly`, and `*RuntimeOnly`
configurations of a `KotlinSourceSet` must not be resolved directly, as
they lack attributes needed to choose a Kotlin MPP variant, and they
must not be candidates in variant-aware resolution of a project
dependency either.

With Gradle 5.3, these configurations failed to resolve anyway, as they
had no proper `org.gradle.usage` attribute, and the disambiguation
rules of the 'java-base' plugin conflicted with the Kotlin rules.
2019-03-13 16:39:55 +03:00
Sergey Igushkin
7c139e059a Fix publishing with Gradle 5.3 (KT-30379)
In Gradle 5.3, there was a change to the internal logic of publishing
`SoftwareComponent`s with the 'maven-publish' plugin, and,
simultaneously, a new public API was introduced for user-defined
software components, see https://github.com/gradle/gradle/pull/8399

Earlier, the 'maven-publish' plugin used the Gradle `Usage` attribute
values to arrange the dependencies of a software component's
`UsageContext`s into the Maven scopes. Now that mechanism doesn't work
and a `SoftwareComponent` must provide an explicit mapping of the
variants to POMs by using the `SoftwareComponentFactory.adhoc` API.

However, the new API lacks some features we need to properly publish an
MPP, such as adding a component to another one as a variant, so we still
create old-style software components under the hood and
then wrap them into the new API (and then wrap the adhoc components once
again).

We also continue to use the old-style components for Kotlin-specific
logic like finding a target in another project that a dependency
resolved to, as the components produced by the new API lack crucial
information that is used in the logic, like references to
`KotlinCompilation`s.

Issue #KT-30379 Fixed
2019-03-13 16:39:55 +03:00
Sergey Igushkin
eedb8b0ae1 Run tests against Gradle 5.3 RC2 2019-03-13 16:39:55 +03:00
Sergey Igushkin
17df1ce096 Support a Gradle Usage value 'java-api-jars'
The support on our side involves:

* using the new value for Maven publishing, as the 'maven-publish'
plugin now expects 'java-api-jars' for dependency scopes ordering where
it used to expect 'java-api'

* accepting the new value in KotlinUsages compatibility and
disambiguation rules
2019-03-13 16:39:55 +03:00
Nikolay Krasko
491fb40dd3 Fix INRE from find usages activated with Ctrl + Click (EA-137655)
Only Ctrl + Click is affected as find usages from Alt + F7 is a different
action (`GotoDeclarationAction` is `DumbAware`, but `ShowUsagesAction` is not).
2019-03-13 15:30:06 +03:00
Dmitriy Dolovov
40474bee3f Update Kotlin/Native project templates
Use modern "binaries" DSL
2019-03-13 18:53:47 +07:00
Dereck Bridie
a02ad76b16 KT-25272: Unused expression as last expression of normal function should have quickfix to add "return" Fixed 2019-03-13 17:53:48 +07:00
Burak Eregar
e02877d1dc Disable WhenWithOnlyElse by default. 2019-03-13 13:25:00 +03:00
Abduqodiri Qurbonzoda
a0e2ca669b Write docs for primitive types conversions 2019-03-13 13:14:37 +03:00
Nikolay Krasko
76d4a2fd17 Minor: cleanup org.jetbrains.kotlin.idea package 2019-03-13 12:55:02 +03:00
Nikolay Krasko
08b93b0ba0 Make internal mode controlled from execution arguments 2019-03-13 12:55:00 +03:00
Nikolay Krasko
8e7145d6ff Allow to pass addition system properties to runIde task 2019-03-13 12:54:58 +03:00
Toshiaki Kameyama
bee7736baf Find Java usage of @JvmField declared in primary constructor (KT-18322)
#KT-18322 Fixed
2019-03-13 12:54:55 +03:00
Mads Ager
8b566fda76 JVM_IR: Perform asm type conversion for string concat arguments.
This ensures that the Unit instance is loaded when string
concatenation contains a sub part that is a call of a Unit
return-type method.
2019-03-13 10:01:21 +01:00
Ting-Yuan Huang
013ad4b8e4 JVM_IR: defer some branch optimizations to codegen.
Specifically, defer the removal of hand-written "if (true|false)" from
JvmBuiltinOptimizationLowering into codegen so that appropriate debug
info (and a NOP) can be inserted.

Change-Id: Ia11af05ad8b4251946bd3e685fb7c3319f0f433f
2019-03-13 08:48:20 +01:00
Ting-Yuan Huang
6bbb0269b1 IR: Set when.origin for IrIfElseImpl
Change-Id: I38510b59e3dc936baadbfe3ef2702990493815e5
2019-03-13 08:48:20 +01:00
Ilya Chernikov
18198987a3 Restore jvmTarget 1.6 for scripting libraries that could be used externally
#KT-29319 fixed
2019-03-13 08:47:17 +01:00
Mikhael Bogdanov
1e3277d0e6 Set proper origin for cascaded if expression 2019-03-13 08:27:07 +01:00
Max Medvedev
1040665471 add missing && 2019-03-13 09:09:19 +03:00
Dmitry Gridin
8f9c536a82 Change priority of the quick fixes
#KT-30233 Fixed
2019-03-13 11:07:05 +07:00
Dmitry Gridin
3d66147685 Minor: fix warnings & refactoring 2019-03-13 11:07:05 +07:00
Abduqodiri Qurbonzoda
ba61695a45 Check for index-out-of-bound in elementAt function (KT-30051) 2019-03-12 21:39:09 +03:00
Alexander Udalov
584137121b Do not write version requirements in metadata for lambdas
#KT-29790 Fixed
2019-03-12 18:53:08 +01:00
Alexander Udalov
e942bff4a2 Reformat module 'serialization', fix inspections 2019-03-12 18:53:08 +01:00
Alexander Udalov
a269e9bc00 JVM IR: fix typo in condition in KCallableNamePropertyLowering
This however makes testLocalFunctionName fail because currently
isSubclassOf (incorrectly) returns false and therefore an anonymous
class is generated and the name is taken from there. The name there is
"box$OK" which is incorrect. The isSubclassOf issue is KT-28198 and will
be fixed separately; the incorrect name issue will be investigated later
2019-03-12 18:49:41 +01:00
Mikhael Bogdanov
dd59deb977 Mute failed test 2019-03-12 13:33:35 +01:00
Mikhail Zarechenskiy
f95fdb3cf1 Advance bootstrap to include fix in NI about Nothing-expressions
See 1594c1fc for details. Also, remove fix from f07fed9a.
2019-03-12 15:27:12 +03:00
Alexey Tsvetkov
efe93176ab Fix inter-project IC for kaptGenerateStubs task with AGP
In Android projects we need to detect modules by inspecting jar files
in order to find build history files.
However `useModuleDetection` property was not set up correctly for
KaptGenerateStubsTask.

    #KT-29761 Fixed
2019-03-12 15:10:49 +03:00
Nikolay Krasko
1bfd6705cc Minor: fix junit.framework.Assert deprecation warnings 2019-03-12 14:28:31 +03:00
Nikolay Krasko
213b98fefe Review changes: revert compiler behaviour, add test, remove inner classes 2019-03-12 14:28:31 +03:00
Harry Billinis
6ba134b1be Better names suggestion for constant like reference expressions (KT-28485)
Code was simplified after @igorwojda suggestions

 #KT-28485 Fixed
2019-03-12 14:28:31 +03:00
Nikolay Krasko
7886095327 Prevent constant reporting from released plugin versions in EA (KT-30388)
Apply a compromise strategy between "no report" and "always report".
Report only for several days after release and don't bother users afterwards.

 #KT-30388 Fixed

All exceptions still can be found in Idea Log.
2019-03-12 12:13:24 +03:00
Nikolay Krasko
7f07782095 Allow to throw plugin exception when plugin version is patched 2019-03-12 12:05:21 +03:00
Nikolay Krasko
ddc9d0eba1 Allow to override plugin version with system property
Need this during testing and development.
2019-03-12 12:05:21 +03:00
Steven Schäfer
9ea39d2b7c Fix return types for while loops. 2019-03-12 09:33:00 +01:00
Steven Schäfer
4c8425caeb Run ExpectDeclarationsRemoving in the JVM_IR backend. 2019-03-12 09:29:00 +01:00
Abduqodiri Qurbonzoda
82002e5e73 Remove implementations of conversions from UByte/UShort to Float/Double 2019-03-12 02:56:44 +03:00
Alexander Udalov
d12e5ddafc Generate bytecode for array intrinsics manually
#KT-28285 Fixed
2019-03-11 18:36:10 +01:00
Alexander Udalov
dd0b087b92 Add StackValue.put(InstructionAdapter) for convenience 2019-03-11 18:36:09 +01:00
Alexander Udalov
f9be21c935 Report warning on @Synchronized on inline methods
Until KT-27310 is supported, we warn users that this has no effect.

 #KT-29884 Fixed
2019-03-11 18:32:44 +01:00
Alexander Udalov
76aff56b04 Remove unneded parameter of ResolverForProjectImpl 2019-03-11 18:31:59 +01:00
Alexander Udalov
0ccf7345e3 Move JsAnalyzerFacade from ide-common to js.frontend
To be used in diagnostic tests now, and as a replacement for
TopDownAnalyzerFacadeForJS in the future
2019-03-11 18:31:59 +01:00
Dmitry Gridin
6b8547f57b Fix "Specify type explicitly" intention with generic type
#KT-27641 Fixed
 #KT-30252 Fixed
2019-03-11 23:38:19 +07:00
Dmitry Gridin
57040f6f9d Minor: refactoring & fix warnings 2019-03-11 23:38:19 +07:00
Toshiaki Kameyama
f1e66d0654 Add "Replace 'associate' with 'associateBy' or 'associateWith'" inspection
#KT-26269 Fixed
2019-03-11 19:33:17 +03:00
Ilya Gorbunov
42120b93b8 KT-29151 Provide specialized string samples for all drop/take functions
These include:
- take, takeLast, takeWhile, takeLastWhile,
- drop, dropLast, dropWhile, dropLastWhile
2019-03-11 19:30:59 +03:00
Burak Eregar
991e739693 KT-29151 Fix the problematic pages - CharSequence.take() & String.take() 2019-03-11 19:30:58 +03:00
Toshiaki Kameyama
0f45e3d238 Fix false positive for HasPlatformType with member extension on 'dynamic'
#KT-29812 Fixed
2019-03-11 19:28:08 +03:00
Mikhail Zarechenskiy
1594c1fc6b [NI] Don't consider Nothing-constraint as proper to complete call
Follow-up of 9b3e17f0. There we decided to complete call if a type
 variable from a return type has proper lower constraints, now we refine
 this rule wrt `Nothing`-like constraints to avoid inferring type variables
 to Nothing, which is quite useless

 #KT-30370 Fixed
2019-03-11 19:14:29 +03:00
Dmitriy Dolovov
77ab15ec65 Add a hint to the message about not found Kotlin Gradle plugin version
Issue #KT-19788
2019-03-11 18:15:05 +07:00
Dmitry Gridin
6ba0a182bb Fix false positive "Insert explicit type arguments" intention
#KT-16139 Fixed
2019-03-09 14:01:04 +07:00
Dmitry Gridin
212e573c26 Minor: refactoring InsertExplicitTypeArgumentIntention 2019-03-09 14:01:04 +07:00
Ilya Gorbunov
6ae5e91930 Move UArraysKt into kotlin.collections.unsigned package
Provide UArraysKt class in kotlin.collections for binary compatibility
instead of removed multipart facade class. It contains only non-inline
functions of the latter.
2019-03-08 23:35:40 +03:00
Ilya Gorbunov
db4c4132f6 Make JvmPackageName a common internal annotation 2019-03-08 23:35:37 +03:00
Ilya Gorbunov
f07fed9afa Temporary fix to avoid runtime exception due to incorrect inferred type
Caused by: java.lang.ClassCastException:
kotlin.collections.EmptySet cannot be cast to java.lang.Void
  at org.jetbrains.kotlin.codegen.coroutines.CoroutineTransformerMethodVisitorKt.findSafelyReachableReturns(CoroutineTransformerMethodVisitor.kt:984)

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2019-03-08 23:35:32 +03:00
Ilya Gorbunov
1f83a48839 Advance bootstrap to 1.3.40-dev-310 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
be6c2d8c7d Implement min max minOf maxOf functions for unsigned types (KT-30035) 2019-03-08 23:34:36 +03:00
Abduqodiri Qurbonzoda
bf83f0e070 Implement contains extension functions for URanges (KT-26378) 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
cb587893c0 Implement sorting extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
c42dbb34ca Implement drop, take & filter extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
abb275775e Implement map, flatMap, zip & groupBy extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
503264b996 Implement folding extension functions for UArrays 2019-03-08 23:34:35 +03:00
Abduqodiri Qurbonzoda
7695b5e575 Implement sum extension function for UArrays (KT-28779) 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
690e35f11a Implement reduce, forEach, min & max extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
fc85781bfc Implement asList, slice & sliceArray extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
114736c09b Implement reversing extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
92cd84682c Implement first, last & single extension functions for UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
299fac8e2d Implement conversion from typed array and collection to UArrays 2019-03-08 23:34:34 +03:00
Abduqodiri Qurbonzoda
bbaabb90e4 Implement any, all, none, count & sumBy functions for UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
512d986006 Implement index-requesting extension functions for UArrays
Contains implementations of `indexOf`, `lastIndexOf`, `indexOfFirst`,
`indexOfLast`, `lastIndex` and `indices` extension functions.
2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
876dff6d22 Implement fill extension function for UArrays (KT-28339) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6b92190726 Implement component(N) functions for destructuring UArrays 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
550c74bb6b Implement binarySearch method for UArrays (KT-27262) 2019-03-08 23:34:33 +03:00
Abduqodiri Qurbonzoda
6cd9858147 Specialize plus operator for UArrays (KT-28397) 2019-03-08 23:34:32 +03:00
Nikolay Krasko
8977d0e26d Setup Missing API inspection 2019-03-08 19:13:07 +03:00
Alexander Udalov
d8b364ea40 Mark KAnnotatedElement.hasAnnotation as experimental
#KT-29041 Fixed
2019-03-08 14:57:01 +01:00
Kerooker
a342f844b8 Implements KAnnotatedElement.hasAnnotation()
This commit fixes KT-29041, by adding a convenience method to verify if a certain `KAnnotatedElement` has an annotation or not
2019-03-08 14:53:51 +01:00
Ilya Matveev
3a33f68fc9 Fix compilation after refactoring MPP extension access 2019-03-07 20:04:59 +03:00
Kirill Shmakov
fe9236f91e Add key 'module' into interop definitions file 2019-03-07 19:42:32 +03:00
Ilya Matveev
607288b089 Update Kotlin/Native: 1.2-eap-8365 2019-03-07 18:36:56 +03:00
Ilya Matveev
45c2489a53 CocoaPods: Replace '-' with '_' in podspec name 2019-03-07 18:08:50 +03:00
Ilya Matveev
230f11df42 CocoaPods: Refactor framework name mangling 2019-03-07 18:08:50 +03:00
Ilya Matveev
226da18e3a CocoaPods: Rename user-visible: Cocoapods -> CocoaPods 2019-03-07 18:08:50 +03:00
Ilya Matveev
7ac7ea58f8 CocoaPods: Rename podspec task: generatePodspec -> podspec 2019-03-07 18:08:50 +03:00
Ilya Matveev
2f45206268 CocoaPods: Replace dynamic dummy framework with a static one 2019-03-07 18:08:50 +03:00
Ilya Matveev
1f2f0244a1 Refactor kotlin multiplatform extension access 2019-03-07 18:08:50 +03:00
Ilya Matveev
52c9c74f52 CocoaPods: Use regex to split quoted compiler args 2019-03-07 18:08:50 +03:00
Ilya Matveev
3b80ffe1d6 CocoaPods: Add 'native' in the plugin ID
kotlin-cocoapods -> kotlin-native-cocoapods
org.jetbrains.kotlin.cocoapods ->
org.jetbrains.kotlin.native.cocoapods
2019-03-07 18:08:50 +03:00
Ilya Matveev
3cd20fab75 Support -Xstatic-framework in DSL
In Kotlin/Native 1.3.30 EAP1 an ability to build
a static ObjC framework has been added. This patch
adds support for this feature in the kotlin-multiplatform
plugin.
2019-03-07 18:08:50 +03:00
Ilya Matveev
60026c8aa1 Update Kotlin/Native: 1.3.30-eap-8089 2019-03-07 18:08:50 +03:00
Ilya Matveev
21a69b0e5b CocoaPods: Basic support
This patch adds a separate Gradle plugin allowing
a user to import Kotlin/Native modules in Cocoapods
projects and use Cocoapods dependencies in Kotlin
code via cinterop.

The plugin when applied does the following things:

1. Add a framework binary for each supported (iOS
   or macOS) platform in the project.

2. Add a Cocoapods extension allowing one to configure
   Cocoapods dependencies of the project.

3. Create cinterop tasks for each dependency from the
   previous point. The tasks are added for main
   compilations of each supported platform.

4. Add a task to generate a podspec-file which includes
   the framework from the point 1, script to
   build it and dependencies from the point 2.

So the Cocoapods import procedure is the following:

1. A user runs `./gradlew generatePodspec`. The plugin
   creates a podspec-file with all dependencies.

2. The user adds a dependency on this podspec in his Podfile
   and runs `pod install`. Cocoapods downloads dependencies
   and configures user's XCode project.

3. The user runs XCode build. XCode builds dependencies and then
   runs Gradle build. Gradle performs interop processing and
   builds the Kotlin framework. Compiler options and header
   search paths are passed in the Gradle from XCode environment
   variables. After that the final application is built by XCode.

Issue #KT-30269 Fixed
2019-03-07 18:08:50 +03:00
Ilya Matveev
2999cdd3e0 Avoid resolution ambiguity for cinterop DSL
Earlier we used to have two methods: cinterops(Container.() -> Unit) and
cinterops(Action<Container>). It's OK for Groovy DSL but causes resolution
ambiguity in Kotlin DSL. This patch removes the first overload to avoid
this situation. The second overload still can be called in Kotlin DSL
as `cinterops { ... }`.
2019-03-07 18:05:54 +03:00
Ilya Matveev
8a012c83e5 Deprecate old DSL method for binary configuration
In 1.3.20 a new binaries DSL was introduced. This
patch deprecates old DSL methods used for binary
configuration in 1.3.0 and 1.3.1x.

Issue #KT-29998 Fixed
2019-03-07 18:05:54 +03:00
Ilya Matveev
b971a91a8c Add main interop libraries in test interop dependencies
Earlier we added interop libraries built for a main compilation
in dependencies of a corresponding test compilation. But we didn't
add them in dependencies of interop libraries built for the test
compilation. It caused cinterop failures when the test compilation
has interop libraries. This patch fixes it by adding main interop
libraries in dependencies of test ones.

Also earlier interop libraries of test compilations were
unintentionally added in apiElements and publication. This patch
fixes this issue too.

Issue #KT-30290 Fixed
2019-03-07 18:05:54 +03:00
Dmitriy Novozhilov
b681e4bda3 NI. Fix call commonSuperType for 0 types (bug introduced in cbf1d773) 2019-03-07 17:50:30 +03:00
Roman Elizarov
4f532a7c05 Invoke probeCoroutineResumed on each unroll of the frame from heap
Fixes KT-29997
2019-03-07 17:04:11 +03:00
Dmitriy Novozhilov
9b50d31169 NI. Fix StackOverFlow in type approximation. #KT-30021 Fixed 2019-03-07 16:24:53 +03:00
Dmitriy Novozhilov
cbf1d773f7 NI. Coerce return type of lambda function descriptor to Unit. #KT-30242 Fixed 2019-03-07 14:36:09 +03:00
Dmitriy Novozhilov
77c98bef4d Fix recursion in contract declaration analysis. KT-26386 Fixed
Issue fixed only in old inference
2019-03-07 14:35:18 +03:00
Dmitriy Novozhilov
d0462859bf Minor. Fix reporting diagnostic in contract with callable reference 2019-03-07 14:35:13 +03:00
Alexander Udalov
518b03125c Support JVM target versions up to 12
#KT-26240 Fixed
2019-03-07 11:42:31 +01:00
Alexander Udalov
9f75fd0d62 Minor, remove confusing logic from GenericReplChecker 2019-03-07 11:42:31 +01:00
Alexander Udalov
c7c377e1b1 Use JvmTarget.DEFAULT instead of JVM_1_6 where applicable 2019-03-07 11:42:31 +01:00
Pavel Nikitin
a6b7aa3257 KT-30322 Memory leak in CompilationSourceSetUtil (#2158)
Issue #KT-30322 Fixed
2019-03-07 12:57:48 +03:00
Anton Yalyshev
b3cbd7d5bd update names for Kotlin Gradle DSL wizards as well 2019-03-07 10:44:58 +03:00
Dmitriy Dolovov
dbc66bd0ae Native: Support 2- and 3-digit Kotlin/Native versions 2019-03-07 12:59:27 +07:00
Nikolay Krasko
ec0084ef61 Minor: remove outdated ant mentioning 2019-03-06 18:16:30 +03:00
Nikolay Krasko
878e56f2ab Minor: clean deprecated warnings in KotlinTestFinder.kt 2019-03-06 18:16:29 +03:00
Nikolay Krasko
606a7766af Make colours for lambda return hints similar to other hints (KT-30203)
Works for IntlliJ and Darcula themes but doesn't work with High Contrast
2019-03-06 18:16:29 +03:00
Nikolay Krasko
0e990ae01b Update inserting algorithm to preserve order for tags with the same offset 2019-03-06 18:16:29 +03:00
Nikolay Krasko
06dbe1ec09 Avoid adding DYNAMIC_PROPERTY_CALL highlighting twice
Tested in idea/testData/highlighter/Dynamic.kt
2019-03-06 18:16:29 +03:00
Nikolay Krasko
1cc59f4b18 Mute false positive duplicate warnings in highlighting in 191 2019-03-06 18:16:28 +03:00
Mikhael Bogdanov
6a893ba196 Regenerate test data 2019-03-06 16:12:43 +01:00
Steven Schäfer
eec25dbea2 Avoid true condition generation for do while loop, since it confuses the Java verifier.
Change-Id: I96eca6623a91a8365090768f42c6e865b612e1cc
2019-03-06 16:04:23 +01:00
Alexander Udalov
59fda8d7ce Support JvmPackageName with JvmMultifileClass
This is an internal feature of our standard library needed to compile
new API for unsigned types
2019-03-06 15:34:23 +01:00
Alexander Udalov
ea21cda4df Reformat MultifileClassCodegen, fix inspections 2019-03-06 15:33:45 +01:00
Alexander Udalov
670b06ae97 Minor, ignore tests on typeOf without reflection on Android
Currently all Android tests are run with kotlin-reflect in the
classpath, so these tests can't succeed
2019-03-06 15:25:21 +01:00
Sergey Igushkin
7d9405a9cb Warning for Kotlin plugins loaded multiple times (KT-30276)
Print a warning with an instruction on how to fix this. Don't warn about
different versions and duplicate plugins in composite build.

Issue #KT-30276 Fixed
2019-03-06 16:05:02 +03:00
Sergey Igushkin
42a7c87e2e Setup conf2ScopeMappings for 'api' configuration with 'maven' plugin
The 'java' plugin doesn't expect the 'api' configuration to exist (it
is only introduced by the 'java-library' plugin) and doesn't map it
to the compile scope when publishing with the legacy 'maven' plugin.

This commit adds the missing conf2ScopeMapping for 'api' -> 'compile'
2019-03-06 16:04:08 +03:00
Sergey Igushkin
803af3e040 Fix ConcurrentModificationException iterating over tasks (KT-29971)
Issue #KT-29971 Fixed
2019-03-06 16:04:08 +03:00
Sergey Igushkin
4aaa1a8067 Rewrite MPP dependencies in POMs of single-platform projects (KT-27059)
This is needed to ensure that POMs of single-platform Kotlin projects
depending on MPP libraries contain dependencies (Maven coordinates)
of the platform-specific modules of the libraries.

The mechanism and rationale are the same as in KT-28482

Issue #KT-27059 Fixed
2019-03-06 16:04:07 +03:00
Sergey Igushkin
51279a8195 Add a switch that disables dependencies rewriting in POMs
This covers the cases when a user knows what they do and doesn't want
anything to do any changes to the POMs, e.g. they want to manually
replace all of the dependencies, so they need the original dependencies.
2019-03-06 16:04:07 +03:00
Sergey Igushkin
2f8baf6715 Refactor: move all tools for MPP dependencies rewriting to a utils file 2019-03-06 16:04:07 +03:00
Natalia Selezneva
f98429c509 Preprocess script dependencies before running UnusedSymbolInspection
^KT-29474
2019-03-06 15:42:50 +03:00
Natalia Selezneva
47a4500eaa Show notification that script dependencies are not ready yet 2019-03-06 15:42:49 +03:00
Natalia Selezneva
1d56f44093 Show progress for loading script dependencies even show notification is true when there are more than 3 scripts in queue
We are trying to update script dependencies silently when 'Reload script dependencies on file change' is off,
but in case when the queue for update is too long we need to make process visible to user and make it cancelable.
2019-03-06 15:42:49 +03:00
Natalia Selezneva
8331d9789e Fire one 'roots changed' event after all scripts dependencies loaded
^KT-29474
2019-03-06 15:42:49 +03:00
Natalia Selezneva
6bc6dea916 Check project.isDisposed before attaching script reports 2019-03-06 15:42:48 +03:00
Natalia Selezneva
c2dd365158 Do not search for text occurrences if this option is switched off 2019-03-06 15:40:59 +03:00
Natalia Selezneva
4a0574dc5f Scratch can be modified during execution (KT-30200)
^KT-30200 Fixed
2019-03-06 15:40:46 +03:00
Natalia Selezneva
0dbbd8e08c Introduce ScratchPanelListener to set module in the created panel (KT-30049)
^KT-30049 Fixed
2019-03-06 15:40:30 +03:00
Ting-Yuan Huang
c1d721a15f when: emit lookupswitch/tableswitch if possible
A lookupswitch or tableswitch can be used if all conditions are equality
checks to constants. To be more specific, it can be done if:
  1. All conditions are CALL 'EQEQ(Any?, Any?)': Boolean
  2. All types of variables involved in comparison are in the same group
     of Char/Byte/Short/Int, String or enum.
  3. All arg0 refer to the same value.
  4. All arg1 are IrConst<*>.

Change-Id: Ifd7cb618395f6c5cc64601018b446f0bb7f5891c
2019-03-06 13:33:55 +01:00
Sergey Rostov
f5d0a38629 JPS Build: update artifacts 2019-03-06 14:42:49 +03:00
Simon Ogorodnik
3950dec4db Implement TypeSystemContext for FIR #KT-29968 Fixed
Use this context in FirClassUseSiteScope for type comparison
2019-03-06 13:36:00 +03:00
Simon Ogorodnik
85cd4f3cdf Extract common code (TypeSystemContext) 2019-03-06 13:33:29 +03:00
Igor Chevdar
2c7b05a67b Wrapped descriptors: supported complex annotations 2019-03-06 13:25:06 +03:00
Toshiaki Kameyama
6b35c06d50 Add intention to replace '!isNotEmpty()' to 'isEmpty()'
#KT-30123 Fixed
2019-03-06 11:06:40 +03:00
Mikhail Zarechenskiy
88ee0bf6af Swap arguments for diagnostic message about incompatible enums
This commit is restoring previous behavior changed in c4b69b65 and
 fixing `DiagnosticMessageTestGenerated.testIncompatibleEnums` test
2019-03-06 10:44:45 +03:00
Yan Zhulanow
3315c1c35b Debugger: Call invokeMethod() safely, through the execution context (KT-30268, EA-131589) 2019-03-06 03:30:56 +03:00
Yan Zhulanow
9d176917e6 Fix EA-138393: Calculate async stack traces only on breakpoints 2019-03-06 03:30:55 +03:00
Yan Zhulanow
eb1543c71a Minor: Fix a few compilation warnings in compiler and compiler tests, fix formatting 2019-03-06 03:30:55 +03:00
Yan Zhulanow
5564760ebf Pill: Recognize non-default test source roots 2019-03-06 03:30:55 +03:00
Yan Zhulanow
bab1c63126 Fix EA-135863: Access allLineLocations() safely 2019-03-06 03:30:54 +03:00
Yan Zhulanow
b54f9a0c05 Fix EA-105847, use 'location()' safely 2019-03-06 03:30:54 +03:00
Roman Artemev
e3e3fcded1 Fix windows j2v8 artifact 2019-03-05 22:56:48 +03:00
Alexander Udalov
2bec72d46a Additional cleanup of KotlinTypeMapper after J2K 2019-03-05 20:34:32 +01:00
Mikhael Bogdanov
20da778046 Add default values to KotlinTypeMapper constructor, remove them from call sites
~
2019-03-05 20:34:25 +01:00
Mikhael Bogdanov
cc0c3b1592 Specify default value for irBackend 2019-03-05 20:33:35 +01:00
Mikhael Bogdanov
a3c3282362 Minor. Clean up code after convertion 2019-03-05 20:33:34 +01:00
Mikhael Bogdanov
315df81397 Convert KotlinTypeMapper to Kotlin 2019-03-05 20:33:33 +01:00
Mikhael Bogdanov
61a95b440f Rename .java to .kt 2019-03-05 20:33:32 +01:00
Mikhael Bogdanov
b43622b87f Minor. Code clean 2019-03-05 20:33:31 +01:00
Alexander Udalov
d1e33534db Implement typeOf intrinsic on JVM
#KT-29915 Fixed
2019-03-05 18:16:31 +01:00
Alexander Udalov
5d297c40fd Minor, move ReifiedTypeParameterSubstitutionChecker to PlatformConfiguratorBase 2019-03-05 17:58:10 +01:00
Alexander Udalov
c61fe16202 Minor, fix inspections, remove unused in codegenUtil.kt 2019-03-05 17:58:10 +01:00
Alexander Udalov
e3779b1883 Minor, relax parameter type of AsmUtil.putJavaLangClassInstance 2019-03-05 17:58:10 +01:00
Alexander Udalov
afe3bed7e1 Minor, remove unused functions from inlineCodegenUtils.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
214ef0c3c2 Move generation of inline intrinsics to inlineIntrinsics.kt 2019-03-05 17:58:09 +01:00
Alexander Udalov
69eae035f6 JVM IR: do not add kotlin-reflect in tests unconditionally 2019-03-05 17:58:09 +01:00
Alexander Udalov
4d817aa6cf Minor, simplify/optimize FunctionTypeConstructor.computeSupertypes 2019-03-05 16:28:53 +01:00
Alexander Udalov
b73a927133 Remove KotlinTestUtils.replaceHash
Both package parts and SAM wrappers have no hashes in their names for a
long time already
2019-03-05 16:28:53 +01:00
Alexander Udalov
74b14f14bd Minor, refactor parseLanguageVersionSettings
Get rid of code duplication, use a more type-safe approach to
enumerating analysis flags
2019-03-05 16:28:53 +01:00
Alexander Udalov
4136fd1dbb Minor, remove unused parameter of LazyImportResolver.collectFromImports 2019-03-05 16:28:53 +01:00
Alexander Udalov
c069371591 Inline LazyImportScope.selectSingleFromImports 2019-03-05 16:28:52 +01:00
Alexander Udalov
b6e745fe52 Minor, rename InlineExposed -> PublishedApi in readme 2019-03-05 16:28:52 +01:00
Alexander Udalov
9d94a54f03 Simplify ExternalDependenciesGenerator
Remove unused parameters, inline inner class
2019-03-05 16:28:34 +01:00
Alexander Udalov
4b712bd14b Remove dependency of backend-common on descriptors.jvm 2019-03-05 16:28:34 +01:00
Alexander Udalov
d7fd4987ae Remove dependency of ir.tree on frontend.java 2019-03-05 16:28:34 +01:00
Alexander Udalov
45e8d2e1df Do not use JVM-specific code for SAM conversions in psi2ir
Extract all JVM-specific code into GeneratorExtensions.SamConversion.
This is needed in order to remove dependency of ir.tree on frontend.java
2019-03-05 16:28:33 +01:00
Alexander Udalov
aaa2bad719 Do not use IR_EXTERNAL_JAVA_DECLARATION_STUB in DeclarationStubGenerator
This code is common across backends and it should not depend on
JVM-specific behavior. Introduce GeneratorExtensions to reverse the
dependency here
2019-03-05 16:28:33 +01:00
Alexander Udalov
f29012a78f Remove unreachable code in psi2ir tests, delete unused tests 2019-03-05 16:28:33 +01:00
Mikhail Glukhikh
8e29ee53a4 Deprecate session in FirElement (related to KT-30275) 2019-03-05 18:23:17 +03:00
Denis Zharkov
2dbe96c853 Extract ConeClassifierLookupTag (aka SearchSymbol)
So, for classifiers there are both Symbols and LookupTags
The difference between them is that the former are assumed to have
a reference to the actual FirDeclaration while LookupTags
effectively contain only classId and
something informative may only be obtained by FirSession

#KT-24075 Fixed
2019-03-05 18:23:17 +03:00
Toshiaki Kameyama
6b5ba272a0 Import members from: suggest on type reference
#KT-29927 Fixed
2019-03-05 18:19:33 +03:00
Abduqodiri Qurbonzoda
3af6b36401 Write docs for unsigned types conversions 2019-03-05 17:34:15 +03:00
Nicolay Mitropolsky
f664499708 Uast: getMaybeLightElement cleanup 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
ec1badf60d Uast: testing resolve for method called on variables of parametrized types 2019-03-05 14:30:08 +03:00
Nicolay Mitropolsky
5268cd4663 Uast: type-parameter references resolves to type-parameters 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
ec26ea4e36 Uast: TypeReferences log test added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
adb13b2f9e Uast: ResolveEverythingTest tests for generics added 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
337f16194a Uast: resolving references to local function declarations 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
72860fb695 Uast: making KotlinUSimpleReferenceExpression able to resolve to types 2019-03-05 14:30:07 +03:00
Nicolay Mitropolsky
e1e1e53e4a Uast: setup for KotlinUastResolveEverythingTest 2019-03-05 14:30:07 +03:00
Mikhail Zarechenskiy
c4b69b65bc Gradually prohibit comparison of incompatible enums
#KT-22043 Fixed
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
82c8289666 Refactoring: move getRepresentativeUpperBound method to core
Plus prettify it a bit
2019-03-05 13:33:23 +03:00
Mikhail Zarechenskiy
7c357c0ec0 [NI] Complete calls during one inference session only once
The problem is that delegated properties resolve two calls together:
 `getValue`/`setValue` with a common receiver, which can contain
 callable references. For each completion new anonymous descriptor
 was created and caused "rewrite at slice" exceptions later.
 Now there is a little hack to check that during one inference session
 we don't complete one call more than one time.

 More correct fix would be to explicitly specify common receiver for
 inference session but it requires quite big refactoring, which will
 be done later with a whole refactoring of the common solver

 #KT-30250 Fixed
2019-03-05 13:33:22 +03:00
Stanislav Erokhin
14c93c7c0e Remove obsolete ant build file: build-docs.xml 2019-03-05 12:54:02 +03:00
Anton Yalyshev
52f297c644 renewed pictures of our wizards in TipOfTheDay #KT-28941 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
8a3659008e unified naming of Kotlin projects #KT-17829 Fixed 2019-03-05 11:40:19 +03:00
Anton Yalyshev
415793be1c better look for wizards names and descriptions: removed word dups and specified build system #KT-27183 Fixed 2019-03-05 11:40:19 +03:00
Simon Ogorodnik
dc56fd873a Add missing type-system dependency to ultimate 2019-03-05 01:52:03 +03:00
Roman Artemev
88d365328a [JS IR BE] Run JS IR tests in V8 engine 2019-03-04 23:24:18 +03:00
Roman Artemev
2ccd093099 Update test data 2019-03-04 23:24:18 +03:00
Roman Artemev
80a2be50c3 Regenerate tests 2019-03-04 23:24:18 +03:00
romanart
8e02964112 Make test be language version agnostic 2019-03-04 23:24:17 +03:00
romanart
2d6b291998 Rename test 2019-03-04 23:24:17 +03:00
romanart
5d6f42e4e6 Fix rebase 2019-03-04 23:24:17 +03:00
Roman Artemev
3770d310f1 Deserialization code clean up 2019-03-04 23:24:17 +03:00
Roman Artemev
d085e66aa3 [JS IR BE] Optimize test performance
* temporary disable verification
 * restore default/full runtime source set scheme
2019-03-04 23:24:16 +03:00
Roman Artemev
5033d99380 [JS IR BE] Update test data 2019-03-04 23:24:16 +03:00
Roman Artemev
a19bdd0c18 [JS IR BE] Refactored klibs proto files 2019-03-04 23:24:16 +03:00
Roman Artemev
52baf90518 Drop DebugJsAstProtoBuf 2019-03-04 23:24:15 +03:00
Roman Artemev
cae800b24e [JS IR BE] Fix deserialization performance 2019-03-04 23:24:15 +03:00
Roman Artemev
079f2534c7 [JS IR BE] Support compilation and tests against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
b99377fd69 [JS IR BE] Fix backend to be able compile test against klib 2019-03-04 23:24:15 +03:00
Roman Artemev
0ec75f1534 [JS IR BE] Temporary fix K/JS stdlib 2019-03-04 23:24:14 +03:00
Roman Artemev
b0b6b359b1 [JS IR BE] Do not produce KotlinType creating IrType 2019-03-04 23:24:14 +03:00
Roman Artemev
6863f9e4f3 [JS IR BE] Make backend be able work with unbound symbols
* Fix array type deserialization
 * Prepare to compilation against klibs
2019-03-04 23:24:14 +03:00
Roman Artemev
2334ea2742 [JS IR BE] Support IrDynamicExpression in proto and deserializer 2019-03-04 23:24:13 +03:00
Roman Artemev
44010cc6ef [JS IR BE] Refactored compiler interface 2019-03-04 23:24:13 +03:00
Roman Artemev
67f0d49ea1 [JS IR BE] Fix rebase 2019-03-04 23:24:13 +03:00
Roman Artemev
4ede02f5b2 [JS IR BE] Update test data 2019-03-04 23:24:12 +03:00
Roman Artemev
b2cfef4902 [JS IR BE] Lazy initialize lowering properties 2019-03-04 23:24:12 +03:00
Roman Artemev
c95d99dbe0 [JS IR BE] Use symbol instead of declaration 2019-03-04 23:24:12 +03:00
Roman Artemev
862ccd05df [JS IR BE] Merge native fixes into Ir Serializer 2019-03-04 23:24:12 +03:00
Roman Artemev
813fef6f26 [JS IR BE] Get rid of usages of KotlinType 2019-03-04 23:24:11 +03:00
Roman Artemev
d034ce106e [JS IR BE] Implement isPrimitiveArray with pure Ir 2019-03-04 23:24:11 +03:00
Roman Artemev
3a444cd0f3 [JS IR BE] Move IrSerializer from native to JS
* Fix issues
2019-03-04 23:24:10 +03:00
Roman Artemev
5384f23f30 [JS IR BE] Extract metadata deserializer to keep binary compatibility
* add UniqId extension to metadata protobuf
2019-03-04 23:24:10 +03:00
Roman Artemev
3718edb6bc [JS IR BE] Some preparation for IrSerialization 2019-03-04 23:24:09 +03:00
Ilya Gorbunov
d4b97d33ef Introduce kotlin.ExperimentalStdlibApi annotation for prerelease API
#KT-30174
2019-03-04 20:47:49 +03:00
Kirill Shmakov
05be09c839 Explicitly order projects for cidr plugin build
With additional module included, evaluation of :prepare:idea-plugin
is requested prior to :prepare evaluation. See KOTLIN-CR-2775.
2019-03-04 20:21:52 +03:00
Mikhail Glukhikh
14a6f684dc Reformat "make constructor parameter a property" quick-fix 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
9e2ee6183c Fix "make constructor parameter a property" for vararg case
Same should work for annotated parameters
#KT-29312 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
c714e599ea Don't report "Unsafe call with ? extension receiver" with smart-cast
#KT-29499 Fixed
2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
4d19120d84 Don't report "main parameter not necessary" in objects #KT-29414 Fixed 2019-03-04 17:57:52 +03:00
Mikhail Glukhikh
022c625d2d MPP web builder: upgrade Ktor version to 1.1.3 #KT-29918 Fixed 2019-03-04 17:57:52 +03:00
Simon Ogorodnik
4882627712 Make type-system KotlinType-independent
- Port NewKotlinTypeChecker.equalTypes
- Decouple new-type transform from isSubtypeOf
- Port isSubtypeForSameConstructor
- Port checkSubtypeForSpecialCases
- Port isSubTypeOf without internals
- Port anySupertype
- Port isSubtypeForSameConstructor, findCorrespondingSupertypes
- Port isSubtypeOfForSingleClassifierType
- Port NullabilityChecker
- Reorder checks for performance
2019-03-04 17:27:45 +03:00
Simon Ogorodnik
d210e8bad0 Introduce optional optimization parameters for type system context 2019-03-04 17:10:47 +03:00
Simon Ogorodnik
8992537180 Place instance markers in KotlinType hierarchy 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
be79aeafa7 Create first draft of AbstractStrictEqualityTypeChecker 2019-03-04 17:10:46 +03:00
Stanislav Erokhin
f7702d3e43 Create new core module: type-system 2019-03-04 17:10:45 +03:00
Natalia Selezneva
fe278ea0a0 Add test for build.gradle.kts highlighting 2019-03-04 16:13:23 +03:00
Mikhael Bogdanov
6d9c49e55e Add IrCompileKotlinAgainstKotlinTest tests 2019-03-04 13:59:58 +01:00
Toshiaki Kameyama
1b7627e039 Surround with null check: suggested for an assignment
#KT-30215 Fixed
2019-03-04 15:11:57 +03:00
Toshiaki Kameyama
2314a38342 Reformat SurroundWithNullCheckFix 2019-03-04 15:11:57 +03:00
Sergey Rostov
f467d892ca Gradle: Supress PackageDirectoryMismatch in targets for gradle.plugin.mpp package 2019-03-04 13:12:34 +03:00
Sergey Rostov
88c04f75f1 Gradle: Move files from org.jetbrains.kotlin.gradle.plugin.mpp to org.jetbrains.kotlin.gradle.targets 2019-03-04 13:12:22 +03:00
Sergey Igushkin
51234d10b9 Actual change for splitting files preserving Git history
Remove resulting redeclarations and finish the split in files below:

  - from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:12:10 +03:00
Sergey Igushkin
b096057bdc (step 8/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the temporary files back to their original paths.
2019-03-04 13:11:42 +03:00
Sergey Igushkin
0473bd2c4c Merge commit 'ffdd43b8083c4fd7795799e351f23d997534a43e'; commit 'af3bf257ba1584fd2f3d690fe76c48778699e29b'; commit '83d22a3744df1b79545070fbb9ea13ee1182a614'; commit 'b7cf915e884caea8cabc2db5f611fa5d5a7536e8'; commit '522a5b8c3ffd84c11cb70efead9c152e8d62cd37'; commit '37a117574f314263360350964e80ce182c093e31' into move-packages-on-master 2019-03-04 13:11:35 +03:00
Sergey Igushkin
bb90cf7831 (step 7/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves the original files to
temporary files suffixed with '.git_split_tmp'
2019-03-04 13:11:35 +03:00
Sergey Igushkin
37a117574f (step 6/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinMetadataTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinWithJavaCompilation.kt
2019-03-04 13:11:32 +03:00
Sergey Igushkin
522a5b8c3f (step 5/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmWithJavaTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinNativeCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinWithJavaCompilationFactory.kt
2019-03-04 13:11:31 +03:00
Sergey Igushkin
b7cf915e88 (step 4/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargetPresets.kt -> mpp\KotlinJvmTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJsCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinNativeCompilationFactory.kt
2019-03-04 13:11:28 +03:00
Sergey Igushkin
83d22a3744 (step 3/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinWithJavaTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinJsTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmAndroidCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmAndroidCompilationFactory.kt
2019-03-04 13:11:26 +03:00
Sergey Igushkin
af3bf257ba (step 2/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  mpp\kotlinTargets.kt -> mpp\KotlinNativeTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinNativeTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinJvmCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJvmCompilationFactory.kt
2019-03-04 13:11:24 +03:00
Sergey Igushkin
ffdd43b808 (step 1/8) Copy files with Git history (automatic commit)
- from KotlinTargetConfigurator.kt
    - to KotlinNativeTaretConfigurator.kt
  - from mpp\kotlinTargets.kt
    - to mpp\KotlinAndroidTarget.kt
    - to mpp\KotlinNativeTarget.kt
    - to mpp\KotlinWithJavaTarget.kt
  - from mpp\kotlinTargetPresets.kt
    - to mpp\KotlinAndroidTargetPreset.kt
    - to mpp\KotlinNativeTargetPreset.kt
    - to mpp\KotlinJsTargetPreset.kt
    - to mpp\KotlinJvmTargetPreset.kt
    - to mpp\KotlinJvmWithJavaTargetPreset.kt
    - to mpp\KotlinMetadataTargetPreset.kt
  - from mpp\kotlinCompilations.kt
    - to mpp\KotlinCommonCompilation.kt
    - to mpp\KotlinJvmCompilation.kt
    - to mpp\KotlinJvmAndroidCompilation.kt
    - to mpp\KotlinJsCompilation.kt
    - to mpp\KotlinNativeCompilation.kt
    - to mpp\KotlinWithJavaCompilation.kt
  - from mpp\KotlinCompilationFactory.kt
    - to mpp\KotlinJsCompilationFactory.kt
    - to mpp\KotlinJvmCompilationFactory.kt
    - to mpp\KotlinJvmAndroidCompilationFactory.kt
    - to mpp\KotlinNativeCompilationFactory.kt
    - to mpp\KotlinWithJavaCompilationFactory.kt
  - from mpp\kotlinCompilationOutputs.kt
    - to mpp\KotlinWithJavaCompilationOutput.kt

This commit moves:

  KotlinTargetConfigurator.kt -> KotlinNativeTaretConfigurator.kt
  mpp\kotlinTargets.kt -> mpp\KotlinAndroidTarget.kt
  mpp\kotlinTargetPresets.kt -> mpp\KotlinAndroidTargetPreset.kt
  mpp\kotlinCompilations.kt -> mpp\KotlinCommonCompilation.kt
  mpp\KotlinCompilationFactory.kt -> mpp\KotlinJsCompilationFactory.kt
  mpp\kotlinCompilationOutputs.kt -> mpp\KotlinWithJavaCompilationOutput.kt
2019-03-04 13:11:22 +03:00
Dmitry Gridin
dce2139eb0 Fix KNPE from "Create" quick fix
#KT-27289 Fixed
2019-03-04 13:01:18 +03:00
Dmitry Gridin
78bee70946 Refactoring 2019-03-04 13:01:18 +03:00
Nikolay Krasko
b458e187af Extract ITNReporter.submit() compatibility problem to separate file 2019-03-04 12:14:23 +03:00
Nikolay Krasko
a5434d7d9e Add internal action for reporting exceptions from Kotlin plugin 2019-03-04 12:14:23 +03:00
Nikolay Krasko
6504cb285b Add internal action for continuous enabling and disable dumb mode 2019-03-04 12:14:22 +03:00
Nikolay Krasko
27ba9b5481 Fix Goto tests by invoking action directly instead of using handler
Problem introduced in
1f7f3d9fdc

Implementation CodeInsightActionHandler was returned for GotoDeclarationAction later.
2019-03-04 12:14:22 +03:00
Mikhail Zarechenskiy
93e79afab4 [NI] Preserve nullability of resulting type from CST if it's possible
Consider common supertype of `S` and `Nothing`, where `S` has nullable
 upper bound or it's flexible. Before the fix, result was `S?`, which
 is correct but too conservative. Now, we'll preserve nullability of
 resulting type if it's already nullable.

 This happened because we were failing to find path of not-nullable
 types from `Nothing` to `S`, which should obviously exists by
 semantics of Nothing
2019-03-04 11:29:39 +03:00
Mikhail Zarechenskiy
9b3e17f0d7 [NI] Avoid building controversial systems by clipping extra constraints
#KT-23854 Fixed
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
92b40ea9d5 [NI] Refactor adding expected type constraint
Add comments, make computation needed for expected type more clear
2019-03-04 11:29:38 +03:00
Mikhail Zarechenskiy
43cf6623f9 [NI] Added test for controversial common system
See KT-23854
2019-03-04 11:29:38 +03:00
Dmitry Gridin
5927032143 Fix "Introduce import alias" on extensions
#KT-30214 Fixed
2019-03-04 10:15:52 +03:00
Pavel V. Talanov
853e9a2aa0 Prevent calls to onFirstRun default implementation for gradle rc
This is temporary until we get compatible API from IDEA
    to support gradle run configurations for MPP projects in IDEA 191+
2019-03-04 02:52:41 +01:00
Andrey Uskov
25dc81c2bd Fix memory leak in gradle import
#KT-30076 Fixed
2019-03-03 20:28:04 +03:00
Andrey Uskov
3919898d19 Minor. Reformat code in multiplatform project importer 2019-03-03 20:27:12 +03:00
Ilya Chernikov
db3eb5707b Drop redundant usages of the ScriptDefinitionProvider 2019-03-02 08:10:17 +01:00
Ilya Chernikov
e99715cf82 Extract extra imports provision into an extension, implement one ...
for script in the plugin, drop direct dependency on scripts from
FileScopeFactory
2019-03-02 08:10:17 +01:00
Ilya Chernikov
57ac149f5b Extract script cli evaluation to the plugin 2019-03-02 08:10:17 +01:00
Ilya Chernikov
7c3bdde102 Fix sequence of the script definitions search - explicit ones should be tried first 2019-03-02 08:10:16 +01:00
Ilya Chernikov
196e274929 Move calculating dependencies from script sources to plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
336f43dbf2 Reorganize files and folders in the scripting plugin 2019-03-02 08:10:16 +01:00
Ilya Chernikov
adb4d264ec Move script definition extraction functions to the plugin
plus finish refactoring of these functions
2019-03-02 08:10:16 +01:00
Nicolay Mitropolsky
815fcd062d Uast: caching isJvmElement if all modules are Jvm (KT-28564) 2019-03-01 20:14:57 +03:00
Alexander Udalov
8ef7f73164 Fix incorrect enum comparison in kotlinx-metadata
Previously, we compared instances of different enums and thus the
conditions were always true. This did not affect visible behavior of the
program except the fact that we've been writing default field values
(kind and level) for version requirements to protobuf where they
could've been omitted
2019-03-01 17:09:03 +01:00
Shagen Ogandzhanian
ed4e93cc98 Fix for npm publishing configuration
This reverts commit 0188cd5330.
Turns out it's not a url after all
2019-03-01 15:46:28 +01:00
Dmitry Gridin
2a940f5b0a Fix KT-26965 2019-03-01 17:43:56 +03:00
Shagen Ogandzhanian
7162dd9807 Prepare JsTestChecker (but not introduce so far) for J2V8 adoption 2019-03-01 15:29:35 +01:00
Wil
d3ac50f694 Minor: typo fix in Writer.buffered docs 2019-03-01 17:09:27 +03:00
Dereck Bridie
4156a76129 #KT-26965 Add inspection + quickfix for replacing Collection<T>.count() with .size 2019-03-01 16:58:36 +03:00
Toshiaki Kameyama
240ff08069 Specify type: escape with backticks if need
#KT-29677 Fixed
2019-03-01 16:43:02 +03:00
Toshiaki Kameyama
1a818970c3 Add inspection to replace Java Map.forEach with Kotlin's forEach
#KT-17278 Fixed
2019-03-01 16:15:23 +03:00
Nicolay Mitropolsky
9c674cb7c3 Uast: support for KtDelegatedSuperTypeEntry (KT-30033) 2019-03-01 15:00:31 +03:00
Dmitriy Novozhilov
2f5843f764 Move detecting of illegal call of contract function into call checker
(#KT-26153, #KT-26191) fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
54e5cce9be Prohibit declaring multiple callsInPlace contract on same lambda.
#KT-26150 fixed
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
4a7420d77d Allow declaring contracts on suspend functions. KT-27468 Fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
84da8b6279 Report CONTRACT_NOT_ALLOWED diagnostic on extension property getter/setter
KT-27090
2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
b484e03fa8 Allow use contract function by FQN. #KT-29772 fixed 2019-03-01 14:50:46 +03:00
Dmitriy Novozhilov
7072b9d179 Fix order of fixing type variables for callable references. KT-25433 Fixed 2019-03-01 14:50:33 +03:00
Andrey Uskov
735f86a50e Fix creation of KotlinSDK. GradleFacetImportTest fixed 2019-03-01 13:12:43 +03:00
Andrey Uskov
325ed8eb32 Change class hierarchy of KotlinSourceRootType. Deadlock during concurrent classloading fixed
#KT-30137 Fixed
2019-03-01 13:12:16 +03:00
Toshiaki Kameyama
87dc1a035b Convert property initializer to getter: suggest on property name
#KT-29344 Fixed
2019-03-01 11:37:42 +03:00
Toshiaki Kameyama
20aa8ebdb0 Add "Throwable not thrown" Inspection
#KT-11629 Fixed
2019-03-01 11:35:12 +03:00
Toshiaki Kameyama
e0aeb8f7ec Remove redundant let: rename invoke call
#KT-29556 Fixed
2019-03-01 11:31:07 +03:00
Toshiaki Kameyama
df3953f03a Redundant Unit: fix false positive when return type is nullable Unit
#KT-30038 Fixed
2019-03-01 11:12:25 +03:00
Toshiaki Kameyama
d67c793a9b map.get() with not-null assertion: add quick-fixes
#KT-30010 Fixed
2019-03-01 11:11:05 +03:00
Mikhail Glukhikh
84a3239cdf FIR: extract "toTypeProjection" 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
f8497bc339 FIR: extract "constructType" from type resolver 2019-03-01 10:36:19 +03:00
Mikhail Glukhikh
1cefcc1438 Add "firCompilerTest" configuration & include it into compiler tests 2019-03-01 10:36:19 +03:00
Natalia Selezneva
bc1e836f01 Fix saving Kotlin Scripting Setting to xml
^KT-30146 Fixed
2019-03-01 09:42:43 +03:00
Ilya Gorbunov
640699e076 Do not expose internal copyOfUninitializedElements and copyOfNulls 2019-02-28 23:44:00 +03:00
Ilya Gorbunov
2e9497f8f8 Rewrite copyOfUninitializedElements with templates without using copyRangeTo 2019-02-28 22:57:45 +03:00
Ilya Gorbunov
c1a51d44a4 Rewrite copyInto without using copyRangeTo
Rename array copying implementation to arrayCopy
2019-02-28 22:57:45 +03:00
Ilya Gorbunov
b8d9e896c2 Move sorting implementations for Native to kotlin.collections
- Move Array.sortWith to generated code
2019-02-28 22:57:45 +03:00
Svyatoslav Kuzmich
e11fda1c49 [JS IR BE] Skip external methods in js default arguments stub generators 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
8da076c1ed [JS IR BE] Fix basic reflection for primitive types 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
a01407eec9 [JS IR BE] Don't mangle Any::equals method 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
27005d7c2e [JS IR BE] Basic support for external varargs 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich
0d9218b017 [JS IR BE] Refactor namer 2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
e9cdad1143 [JS IR BE] Remove support for dynamic symbols and descriptors
Dynamic expressions in IR are now represented as IrDynamicOperatorExpression

We don't have dynamic functions, dynamic dispatch receivers anymore
2019-02-28 20:13:55 +03:00
Svyatoslav Kuzmich
d323dce2b6 [JS IR BE] Fix codegen for nested external objects 2019-02-28 20:13:55 +03:00
Dmitry Gridin
41f3316981 Fix caret position in "Convert function to property" intention
#KT-19944 Fixed
2019-02-28 15:59:50 +03:00
Dmitry Gridin
29a63ae58c Refactoring & fix warnings 2019-02-28 15:59:50 +03:00
Vadim Brilyantov
bd2e51ded5 Fix for bug introduced in moveConflictUtils (never show warnings when moving to the same scope) 2019-02-28 15:52:28 +03:00
victor.petukhov
bd03ecf4a0 Rename helper file with typealias samples for spec tests 2019-02-28 14:55:41 +03:00
victor.petukhov
b7a5d73bf0 Add type inference tests by specification to remote run tests 2019-02-28 11:55:16 +03:00
Georgy Bronnikov
c618ef9304 Correct phase argument names and cli test outputs 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
5ff1337ec8 Add some phase checkers 2019-02-28 11:53:02 +03:00
Georgy Bronnikov
da13d3288e Check pre- and postconditions on phases 2019-02-28 11:53:02 +03:00
Natalia Selezneva
48433110a4 Do not threat modifications inside lambdas in KtScriptInitializer block as out of code block 2019-02-28 10:59:15 +03:00
Natalia Selezneva
49277bb5e4 Optimize MemberVisibilityCanBePrivateInspection: check that descriptor is in class before resolving it 2019-02-28 10:59:14 +03:00
Natalia Selezneva
560acd631c KtScriptInitializer doesn't has a descriptor 2019-02-28 10:59:13 +03:00
Natalia Selezneva
3b4d1dd7bf Optimize ChangeVisibilityModifierIntention: do not analyze element if declaration isn't local 2019-02-28 10:59:12 +03:00
Natalia Selezneva
869fb46c0b Optimize KotlinUFunctionCallExpression.isAnnotationArgumentArrayExpression 2019-02-28 10:59:12 +03:00
Toshiaki Kameyama
6ca22fbf34 Remove redundant let: do not report for function stored in variable call
#KT-30082 Fixed
2019-02-28 10:44:05 +03:00
Dmitry Gridin
304007f602 Fix false positive "Redundant companion reference"
#KT-30166 Fixed
2019-02-28 10:42:22 +03:00
Sergey Rostov
50263ed7cd JPS Build: update artifacts configuration (bootstrap) 2019-02-28 09:16:10 +03:00
Yan Zhulanow
7c0233dfeb 191: 191: Fix test compilation, remove deleted test 2019-02-27 21:41:09 +03:00
Kirill Shmakov
262b3fde3d Fix Gradle MPP integration tests
#KT-30056 Fixed
2019-02-27 20:51:04 +03:00
Dmitry Gridin
3756b6f54d Add inspection to remove redundant qualifier name
#KT-12134 Fixed
2019-02-27 20:43:35 +03:00
Dmitry Gridin
d0c3a28996 Move canBePossibleToDropReceiver to Companion object & fix warnings 2019-02-27 20:43:35 +03:00
Ilya Gorbunov
19bd326810 Swap mismatched docs for Result.onSuccess/onFailure KT-30109 2019-02-27 17:53:11 +03:00
Ilya Gorbunov
908009bf42 Improve double-to-ulong conversion tests
#KT-27108
2019-02-27 17:49:41 +03:00
Mikhail Zarechenskiy
892fb9f39e Increment metadata version and improve message for error type
Follow-up of 617bed1b
2019-02-27 14:03:22 +03:00
Vyacheslav Gerasimov
f7428e7161 Build: Add diagnostic for publish() helper 2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
a42f607ecf Build: Fix artifacts signing for maven central
With gradle > 5.0 `publish()` helper call should be done before
`noDefaultJar()` or any other artifact hacks, otherwise singing plugin doesn't sign any jars
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
df3aa48c9b Build: Apply java plugin in kotlin-annotation-processing-embeddable
Otherwise artifact signature works incorrectly for this project
2019-02-27 13:21:17 +03:00
Vyacheslav Gerasimov
f4c157a9bc Build: properly remove artifact from archives in runtimeJar helper 2019-02-27 13:21:17 +03:00
Alexander Podkhalyuzin
6098e97ae5 Do not go to the same type twice during contains search
This fixes exponent in algorithm for scala.FunctionN.curried, where N can be up to 22.

#KT-29435 Fixed
2019-02-27 12:36:43 +03:00
Nicolay Mitropolsky
c151be5547 Uast multiresolve key description fix 2019-02-27 12:15:32 +03:00
Mark Punzalan
fc5eac26cd Extracted complex string concatenation bytecode test case into separate test data file. 2019-02-27 08:36:35 +01:00
Mark Punzalan
d4d5a6011c Flatten nested string concatenation expressions into a single IrStringConcatenation, in a separate lowering phase.
Consolidating these into IrStringConcatenations allows the backend to produce efficient code for string concatenations (e.g., using StringBuilder for JVM).
2019-02-27 08:36:35 +01:00
Natalia Selezneva
ae22bdee15 Add scripting resolver extension to plugin-kotlin-extensions.xml 2019-02-27 09:37:07 +03:00
Sergey Rostov
63dca7b3b5 Build: exclude annotations.jar from Intellij 2019-02-27 09:11:42 +03:00
Sergey Rostov
17c0422d8f Build: got rid of @TestOnly annotations on fields and classes 2019-02-27 09:08:34 +03:00
Dmitry Gridin
c89d1af9fa Improve Create property from Usage
Place generated property next to other properties
 #KT-14886 Fixed
2019-02-27 00:07:55 +03:00
Dmitry Gridin
5d599ee2ff Refactoring 2019-02-27 00:07:55 +03:00
Alexander Udalov
76e133014b Minor, explain why we don't store array type arguments in ::class in proto 2019-02-26 19:09:42 +01:00
Alexander Udalov
736ac12374 Prohibit type parameters in class literals in annotation arguments
#KT-27799 Fixed
2019-02-26 19:09:42 +01:00
Vadim Brilyantov
c633f7568f #KT-25674: Fix unexpected reference renames in literals when moving referenced files. 2019-02-26 15:37:48 +03:00
Vadim Brilyantov
c7acd89fad #KT-19799: Add initialDirectory to KotlinAwareMoveFilesOrDirectoriesDialog 2019-02-26 15:37:47 +03:00
Vadim Brilyantov
0c1e7e1d63 #KT-23099: Fix name clashes when moving top-level objects with same signature 2019-02-26 15:37:45 +03:00
Vadim Brilyantov
f7c4760cb9 #KT-17825: Filter PackageLookupObjects as available for completion 2019-02-26 15:37:42 +03:00
Vadim Brilyantov
c5d1190d15 #KT-26611: Change mnemonic for "search references" checkbox to Alt+R 2019-02-26 15:37:40 +03:00
Vadim Brilyantov
01200252f5 #KT-22721: Fix move refactoring to make it check previous PsiElement before a whitespace 2019-02-26 15:37:39 +03:00
Vadim Brilyantov
e413395cbf #KT-19661: Create missing directories when moving to a user-defined path 2019-02-26 15:37:34 +03:00
Vadim Brilyantov
dc2c8140a9 Add optimize imports with timeout for move refactoring 2019-02-26 15:35:17 +03:00
Vadim Brilyantov
0ec3d15218 #KT-19924: Fix usability issue with extract declaration from file intention
Fix ExtractDeclaration intention name in tests

Fix ExtractDeclaration intention folder and description to avoid "not found Dir URL" exception
2019-02-26 15:35:15 +03:00
Alexander Gorshenev
888641e7f1 Use file symbol instead of a file name string in IrReturnableBlockImpl 2019-02-26 13:54:04 +03:00
Alexander Udalov
e2106d4d08 Do not assert that function is inline in MemberDescriptor.isInlineOnly
This is a more accurate fix of the problem described in 946acd2416
2019-02-26 11:16:01 +01:00
Alexander Udalov
b8bc79e17c Support non-trivial default argument values in expected functions on JVM
#KT-22818 Fixed
2019-02-26 11:02:30 +01:00
Ting-Yuan Huang
b2cc661783 Set target backend of BytecodeTextTestGenerated to JVM
as BytecodeTextTestGenerated is only available to JVM.

Change-Id: I0bb15b35ab3b8418434875971a572f3e49a516a5
2019-02-26 09:22:43 +01:00
Alexander Udalov
cfcd0d7b4a Minor, fix localClassLiteral.kt on JDK 9 2019-02-25 23:37:43 +01:00
13386 changed files with 468086 additions and 848266 deletions

13
.bunch
View File

@@ -1,8 +1,7 @@
183
182
181_182
as32_181_182
as33_182
as34
as35_as34
191
192
183
182_183
as33_182_183
as34_183
as35

11
.gitignore vendored
View File

@@ -2,7 +2,7 @@
.idea/shelf
/android.tests.dependencies
/confluence/target
/dependencies
/dependencies/repo
/dist
/local
/gh-pages
@@ -15,10 +15,6 @@ workspace.xml
*.versionsBackup
/idea/testData/debugger/tinyApp/classes*
/jps-plugin/testData/kannotator
/ultimate/dependencies
/ultimate/ideaSDK
/ultimate/out
/ultimate/tmp
/js/js.translator/testData/out/
/js/js.translator/testData/out-min/
.gradle/
@@ -40,4 +36,9 @@ build/
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
.idea/artifacts/dist_auto_*
.idea/artifacts/ideaPlugin.xml
kotlin-ultimate/
node_modules/
.rpt2_cache/
libraries/tools/kotlin-test-nodejs-runner/lib/
local.properties

8
.idea/ant.xml generated
View File

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

View File

@@ -8,16 +8,16 @@
</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="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-minimal-for-test/1.3.50-dev-397/9537914625d42146d9ebdd50cc7427c1116958dd/kotlin-stdlib-minimal-for-test-1.3.50-dev-397.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 id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.50-dev-397/41d9c6981aea1e2b3be9491c0d69f068cfeda9d8/kotlin-stdlib-common-1.3.50-dev-397.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.50-dev-397/908a2bdb953a6cc1e0ee306066b435c7469bc1/kotlin-stdlib-common-1.3.50-dev-397-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 id="extracted-dir" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.50-dev-397/8fecb29089c335c4cb37f2ae37f204bd8c0a015/kotlin-stdlib-js-1.3.50-dev-397.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 id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.50-dev-397/49551e2d0590be904a7178f881a90753425fe8e0/kotlin-stdlib-1.3.50-dev-397-sources.jar" output-file-name="kotlin-stdlib-sources.jar" />
</element>
<element id="directory" name="kotlinc">
<element id="artifact" artifact-name="kotlinc" />

View File

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

@@ -8,28 +8,28 @@
</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.jetbrains.kotlin/builtins/1.3.50-dev-397/842ec330289185e9ea136dd86f2846b6ff9a8a10/builtins-1.3.50-dev-397.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/asm-all-7.0.1.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/guava-25.1-jre.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/intellij-core/191.6707.61/artifacts/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="$PROJECT_DIR$/dependencies/repo/kotlin.build/intellij-core/191.6707.61/artifacts/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="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/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="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/jna-platform.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/jna.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/jps-standalone/191.6707.61/artifacts/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="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/log4j.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/lz4-1.3.0.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/lib/oro-2.0.8.jar" path-in-jar="/" />
<element id="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/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="extracted-dir" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/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" />
@@ -44,7 +44,6 @@
<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" />
@@ -67,6 +66,9 @@
<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" />
<element id="module-output" name="kotlin.core.type-system.main" />
<element id="module-output" name="kotlin.compiler.ir.serialization.common.main" />
<element id="module-output" name="kotlin.compiler.ir.serialization.js.main" />
</root>
</artifact>
</component>

View File

@@ -32,6 +32,7 @@
<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="module-output" name="kotlin.core.type-system.main" />
<element id="file-copy" path="$PROJECT_DIR$/resources/kotlinManifest.properties" />
</root>
</artifact>

View File

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

View File

@@ -16,6 +16,7 @@
<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" />
<element id="module-output" name="kotlin.core.type-system.main" />
</root>
</artifact>
</component>

View File

@@ -7,7 +7,7 @@
</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="file-copy" path="$PROJECT_DIR$/dependencies/repo/kotlin.build/ideaIC/191.6707.61/artifacts/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">
@@ -129,9 +129,12 @@
<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 id="file-copy" path="$PROJECT_DIR$/plugins/scripting/scripting-compiler/build/tmp/jar/MANIFEST.MF" />
</element>
</element>
<element id="archive" name="kotlin-scripting-compiler-impl.jar">
<element id="module-output" name="kotlin.kotlin-scripting-compiler-impl.main" />
</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">
@@ -223,14 +226,14 @@
<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="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jdk8/1.3.50-dev-397/cea97f07f62c8c851aca7dc9710d9c0214b585ad/kotlin-stdlib-jdk8-1.3.50-dev-397.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.50-dev-397/37b7a5e6a0178c1ef97d486c2baaab0b07e119d9/kotlin-stdlib-jdk7-1.3.50-dev-397.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.50-dev-397/a49478f35e92b4bf2e1a3bd628dc71e561d2eb04/kotlin-stdlib-1.3.50-dev-397.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.50-dev-397/d87ad86ff1d0f960c89bee95c4f643297e54f9f1/kotlin-stdlib-jdk7-1.3.50-dev-397-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.50-dev-397/1f51a4f91853cfea7a295fd3154b11ed16d64932/kotlin-stdlib-jdk8-1.3.50-dev-397-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.50-dev-397/a6fb09cf5de9f1afa10699ae2b58156067307cd/kotlin-stdlib-js-1.3.50-dev-397-sources.jar" />
<element id="file-copy" path="$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-js/1.3.50-dev-397/8fecb29089c335c4cb37f2ae37f204bd8c0a015/kotlin-stdlib-js-1.3.50-dev-397.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.50-dev-397/49551e2d0590be904a7178f881a90753425fe8e0/kotlin-stdlib-1.3.50-dev-397-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" />

View File

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

View File

@@ -4,8 +4,11 @@
<w>cidr</w>
<w>foldable</w>
<w>instrumentator</w>
<w>jdks</w>
<w>protobuf</w>
<w>redirector</w>
<w>remapper</w>
<w>unpresent</w>
</words>
</dictionary>
</component>

7
.idea/dictionaries/NK.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<component name="ProjectDictionaryState">
<dictionary name="NK">
<words>
<w>typealias</w>
</words>
</dictionary>
</component>

View File

@@ -19,6 +19,7 @@
<w>preloader</w>
<w>preloading</w>
<w>preprocess</w>
<w>proximities</w>
<w>redeclarations</w>
<w>smap</w>
<w>subclassed</w>

View File

@@ -21,7 +21,6 @@
</inspection_tool>
<inspection_tool class="BooleanMethodIsAlwaysInverted" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="BusyWait" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CStyleArrayDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastConflictsWithInstanceof" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="CastToIncompatibleInterface" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ChainedEquality" enabled="false" level="WARNING" enabled_by_default="true" />
@@ -76,6 +75,7 @@
<option name="m_ignoreLoopsWithoutConditions" value="false" />
</inspection_tool>
<inspection_tool class="ForLoopThatDoesntUseLoopVariable" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="GrPackage" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlUnknownTag" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues">
<value>
@@ -98,29 +98,22 @@
<inspection_tool class="IncompatibleAPI" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.util.JdomKt#element" reason="Removed in 191" />
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
<Problem reference="com.intellij.codeInspection.reference.RefFile#getPsiElement" reason="Absent in 182. Use psiFile extension instead." />
<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." />
<Problem reference="com.intellij.util.AstLoadingFilter" reason="Absent in 181. Almost all methods were renamed in 183. Use org.jetbrains.kotlin.util.AstLoadingFilter instead." />
<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." />
<Problem reference="org.jetbrains.kotlin.idea.reporter.ITNReporterCompat#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.diagnostic.ITNReporter#submit" reason="parentComponent is nullable in AS" />
<Problem reference="com.intellij.codeInspection.dataFlow.Nullness" reason="Deprecated since 182. Use org.jetbrains.kotlin.idea.util.compat.Nullability instead." />
</list>
</option>
</inspection_tool>
@@ -273,6 +266,10 @@
<option name="ignoreObjectMethods" value="true" />
<option name="ignoreAnonymousClassMethods" value="false" />
</inspection_tool>
<inspection_tool class="MissingRecentApi" enabled="true" level="ERROR" enabled_by_default="true">
<option name="sinceBuildString" value="182.0" />
<option name="untilBuildString" value="192.SNAPSHOT" />
</inspection_tool>
<inspection_tool class="MisspelledCompareTo" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledEquals" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MisspelledHashcode" enabled="true" level="WARNING" enabled_by_default="true" />
@@ -304,16 +301,6 @@
<inspection_tool class="PackageName" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="namePattern" value="[a-z_][a-z\d_]*(\.[a-z_][a-zA-Z\d_]*)*" />
</inspection_tool>
<inspection_tool class="ProblematicAPIUsage" enabled="true" level="ERROR" enabled_by_default="true">
<option name="problems">
<list>
<Problem reference="com.intellij.testFramework.PlatformTestCase#createModuleAt" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.testFramework.PlatformTestCase#doCreateRealModuleIn" reason="Not static anymore in 181 after 7dacf096c47d2125e17031c71a037b63ab00ec53" />
<Problem reference="com.intellij.openapi.progress.ProgressManager#getProgressIndicator" reason="Nullable in 181. Temporary use progressIndicatorNullable instead." />
<Problem reference="com.intellij.testFramework.fixtures.CodeInsightTestFixture#getProjectDisposable" reason="Method was introduced in 173 and absent in 172. Use getProjectDisposableEx instead. (95eaf81e0ea497f8c69263c11fd3202d28a7a1b2)" />
</list>
</option>
</inspection_tool>
<inspection_tool class="ProtectedMemberInFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PublicFieldAccessedInSynchronizedContext" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="ERROR" enabled_by_default="true">
@@ -329,16 +316,11 @@
</inspection_tool>
<inspection_tool class="SSBasedInspection" enabled="true" level="WARNING" enabled_by_default="true">
<searchConfiguration name="SwingUtilities.invokeLater" text="SwingUtilities.invokeLater($runnable$)" recursive="false" caseInsensitive="false" type="JAVA">
<constraint name="Instance" regexp="SwingUtilities" minCount="0" target="true" within="" contains="" />
<constraint name="MethodCall" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
<constraint name="runnable" within="" contains="" />
</searchConfiguration>
<replaceConfiguration name="DirectCallOfDispose" text="$Instance$.dispose()" recursive="false" caseInsensitive="false" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="Disposer.dispose($Instance$)">
<constraint name="Instance" regexp="super" nameOfExprType="Disposable" withinHierarchy="true" exprTypeWithinHierarchy="true" minCount="0" negateName="true" within="" contains="" />
<constraint name="MethodCall" target="true" within="" contains="" />
<constraint name="Parameter" minCount="0" maxCount="2147483647" within="" contains="" />
<constraint name="__context__" within="" contains="" />
</replaceConfiguration>
<replaceConfiguration name="new Object[0]" text="new Object[0]" recursive="false" caseInsensitive="true" type="JAVA" reformatAccordingToStyle="true" shortenFQN="true" replacement="com.intellij.util.ArrayUtil.EMPTY_OBJECT_ARRAY" />
@@ -402,6 +384,7 @@
</inspection_tool>
<inspection_tool class="StringEquality" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="StringEqualsEmptyString" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="StringOperationCanBeSimplifiedMerged" />
<inspection_tool class="SwitchStatementWithConfusingDeclaration" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SynchronizeOnThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="SystemOutErr" enabled="true" level="WARNING" enabled_by_default="true">

5
.idea/misc.xml generated
View File

@@ -47,6 +47,8 @@
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="org.jetbrains.annotations.Nullable" />
<option name="myDefaultNotNull" value="org.jetbrains.annotations.NotNull" />
<option name="myNullables">
<value>
<list size="9">
@@ -84,6 +86,9 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="PsiViewerSettings">
<option name="splitDividerLocation" value="35" />
</component>
<component name="SuppressABINotification">
<option name="modulesWithSuppressedNotConfigured">
<set>

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,11 @@ For local development, if you're not working on bytecode generation or the stand
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties) to setup JDK_* variables.
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
On Windows you might need to add long paths setting to the repo:
git config core.longpaths true
## Building

View File

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

View File

@@ -40,4 +40,4 @@ javadocJar()
testsJar()
projectTest()
projectTest(parallel = true)

View File

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

View File

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

View File

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

View File

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

View File

@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.compilerRunner;
import com.intellij.util.containers.ContainerUtil;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.reflect.KClass;
@@ -25,6 +24,7 @@ import kotlin.reflect.KVisibility;
import kotlin.reflect.full.KClasses;
import kotlin.reflect.jvm.ReflectJvmMapping;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.cli.common.arguments.Argument;
import org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments;
import org.jetbrains.kotlin.cli.common.arguments.InternalArgument;
@@ -60,7 +60,7 @@ public class ArgumentUtils {
@NotNull List<String> result
) throws IllegalAccessException, InstantiationException, InvocationTargetException {
for (KProperty1 property : KClasses.getMemberProperties(clazz)) {
Argument argument = ContainerUtil.findInstance(property.getAnnotations(), Argument.class);
Argument argument = findInstance(property.getAnnotations(), Argument.class);
if (argument == null) continue;
if (property.getVisibility() != KVisibility.PUBLIC) continue;
@@ -90,4 +90,14 @@ public class ArgumentUtils {
}
}
}
@Nullable
private static <T> T findInstance(Iterable<? super T> iterable, Class<T> clazz) {
for (Object item : iterable) {
if (clazz.isInstance(item)) {
return clazz.cast(item);
}
}
return null;
}
}

View File

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

View File

@@ -45,7 +45,10 @@ interface IncrementalCacheCommon {
/**
* Incremental cache common for JVM and JS for specifit ClassName type
*/
abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
abstract class AbstractIncrementalCache<ClassName>(
workingDir: File,
protected val pathConverter: FileToPathConverter
) : BasicMapsOwner(workingDir), IncrementalCacheCommon {
companion object {
private val SUBTYPES = "subtypes"
private val SUPERTYPES = "supertypes"
@@ -70,17 +73,16 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
private val subtypesMap = registerMap(SubtypesMap(SUBTYPES.storageFile))
private val supertypesMap = registerMap(SupertypesMap(SUPERTYPES.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile))
protected val classFqNameToSourceMap = registerMap(ClassFqNameToSourceMap(CLASS_FQ_NAME_TO_SOURCE.storageFile, pathConverter))
internal abstract val sourceToClassesMap: AbstractSourceToOutputMap<ClassName>
internal abstract val dirtyOutputClassesMap: AbstractDirtyClassesMap<ClassName>
/**
* A file X is a complementary to a file Y if they contain corresponding expect/actual declarations.
* Complementary files should be compiled together during IC so the compiler does not complain
* about missing parts.
* TODO: provide a better solution (maintain an index of expect/actual declarations akin to IncrementalPackagePartProvider)
*/
private val complementaryFilesMap = registerMap(FilesMap(COMPLEMENTARY_FILES.storageFile))
private val complementaryFilesMap = registerMap(ComplementarySourceFilesMap(COMPLEMENTARY_FILES.storageFile, pathConverter))
override fun classesFqNamesBySources(files: Iterable<File>): Collection<FqName> =
files.flatMapTo(HashSet()) { sourceToClassesMap.getFqNames(it) }
@@ -153,14 +155,17 @@ abstract class AbstractIncrementalCache<ClassName>(workingDir: File) : BasicMaps
removedFqNames.forEach { classFqNameToSourceMap.remove(it) }
}
protected class ClassFqNameToSourceMap(storageFile: File) :
protected class ClassFqNameToSourceMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) :
BasicStringMap<String>(storageFile, EnumeratorStringDescriptor(), PathStringDescriptor) {
operator fun set(fqName: FqName, sourceFile: File) {
storage[fqName.asString()] = sourceFile.canonicalPath
storage[fqName.asString()] = pathConverter.toPath(sourceFile)
}
operator fun get(fqName: FqName): File? =
storage[fqName.asString()]?.let(::File)
storage[fqName.asString()]?.let(pathConverter::toFile)
fun remove(fqName: FqName) {
storage.remove(fqName.asString())

View File

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

View File

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

View File

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

View File

@@ -19,10 +19,7 @@ package org.jetbrains.kotlin.incremental
import com.intellij.util.io.DataExternalizer
import org.jetbrains.kotlin.incremental.js.IncrementalResultsConsumerImpl
import org.jetbrains.kotlin.incremental.js.TranslationResultValue
import org.jetbrains.kotlin.incremental.storage.BasicStringMap
import org.jetbrains.kotlin.incremental.storage.DirtyClassesFqNameMap
import org.jetbrains.kotlin.incremental.storage.SourceToFqNameMap
import org.jetbrains.kotlin.incremental.storage.StringToLongMapExternalizer
import org.jetbrains.kotlin.incremental.storage.*
import org.jetbrains.kotlin.metadata.ProtoBuf
import org.jetbrains.kotlin.metadata.deserialization.NameResolverImpl
import org.jetbrains.kotlin.metadata.deserialization.getExtensionOrNull
@@ -36,19 +33,22 @@ import java.io.DataInput
import java.io.DataOutput
import java.io.File
open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName>(cachesDir) {
open class IncrementalJsCache(
cachesDir: File,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<FqName>(cachesDir, pathConverter) {
companion object {
private val TRANSLATION_RESULT_MAP = "translation-result"
private val INLINE_FUNCTIONS = "inline-functions"
private val HEADER_FILE_NAME = "header.meta"
private const val TRANSLATION_RESULT_MAP = "translation-result"
private const val INLINE_FUNCTIONS = "inline-functions"
private const val HEADER_FILE_NAME = "header.meta"
fun hasHeaderFile(cachesDir: File) = File(cachesDir, HEADER_FILE_NAME).exists()
}
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToFqNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesFqNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
private val translationResults = registerMap(TranslationResultMap(TRANSLATION_RESULT_MAP.storageFile, pathConverter))
private val inlineFunctions = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile, pathConverter))
private val dirtySources = hashSetOf<File>()
@@ -113,14 +113,13 @@ open class IncrementalJsCache(cachesDir: File) : AbstractIncrementalCache<FqName
}
fun nonDirtyPackageParts(): Map<File, TranslationResultValue> =
hashMapOf<File, TranslationResultValue>().apply {
for (path in translationResults.keys()) {
val file = File(path)
if (file !in dirtySources) {
put(file, translationResults[path]!!)
}
hashMapOf<File, TranslationResultValue>().apply {
for (file in translationResults.keys()) {
if (file !in dirtySources) {
put(file, translationResults[file]!!)
}
}
}
}
private object TranslationResultValueExternalizer : DataExternalizer<TranslationResultValue> {
@@ -152,31 +151,33 @@ private object TranslationResultValueExternalizer : DataExternalizer<Translation
}
}
private class TranslationResultMap(storageFile: File) : BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
private class TranslationResultMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<TranslationResultValue>(storageFile, TranslationResultValueExternalizer) {
override fun dumpValue(value: TranslationResultValue): String =
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
"Metadata: ${value.metadata.md5()}, Binary AST: ${value.binaryAst.md5()}, InlineData: ${value.inlineData.md5()}"
fun put(file: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[file.canonicalPath] = TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
fun put(sourceFile: File, newMetadata: ByteArray, newBinaryAst: ByteArray, newInlineData: ByteArray) {
storage[pathConverter.toPath(sourceFile)] =
TranslationResultValue(metadata = newMetadata, binaryAst = newBinaryAst, inlineData = newInlineData)
}
operator fun get(file: File): TranslationResultValue? =
storage[file.canonicalPath]
operator fun get(sourceFile: File): TranslationResultValue? =
storage[pathConverter.toPath(sourceFile)]
operator fun get(key: String): TranslationResultValue? =
storage[key]
fun keys(): Collection<File> =
storage.keys.map { pathConverter.toFile(it) }
fun keys(): Collection<String> =
storage.keys
fun remove(file: File, changesCollector: ChangesCollector) {
val protoBytes = storage[file.canonicalPath]!!.metadata
val protoMap = getProtoData(file, protoBytes)
fun remove(sourceFile: File, changesCollector: ChangesCollector) {
val path = pathConverter.toPath(sourceFile)
val protoBytes = storage[path]!!.metadata
val protoMap = getProtoData(sourceFile, protoBytes)
for ((_, protoData) in protoMap) {
changesCollector.collectProtoChanges(oldData = protoData, newData = null)
}
storage.remove(file.canonicalPath)
storage.remove(path)
}
}
@@ -199,15 +200,17 @@ fun getProtoData(sourceFile: File, metadata: ByteArray): Map<ClassId, ProtoData>
return classes
}
private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
private class InlineFunctionsMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Map<String, Long>>(storageFile, StringToLongMapExternalizer) {
fun process(srcFile: File, newMap: Map<String, Long>, changesCollector: ChangesCollector) {
val key = srcFile.canonicalPath
val key = pathConverter.toPath(srcFile)
val oldMap = storage[key] ?: emptyMap()
if (newMap.isNotEmpty()) {
storage[key] = newMap
}
else {
} else {
storage.remove(key)
}
@@ -219,9 +222,9 @@ private class InlineFunctionsMap(storageFile: File) : BasicStringMap<Map<String,
}
fun remove(sourceFile: File) {
storage.remove(sourceFile.canonicalPath)
storage.remove(pathConverter.toPath(sourceFile))
}
override fun dumpValue(value: Map<String, Long>): String =
value.dumpMap { java.lang.Long.toHexString(it) }
value.dumpMap { java.lang.Long.toHexString(it) }
}

View File

@@ -43,8 +43,12 @@ val KOTLIN_CACHE_DIRECTORY_NAME = "kotlin"
open class IncrementalJvmCache(
private val targetDataRoot: File,
targetOutputDir: File?
) : AbstractIncrementalCache<JvmClassName>(File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME)), IncrementalCache {
targetOutputDir: File?,
pathConverter: FileToPathConverter
) : AbstractIncrementalCache<JvmClassName>(
workingDir = File(targetDataRoot, KOTLIN_CACHE_DIRECTORY_NAME),
pathConverter = pathConverter
), IncrementalCache {
companion object {
private val PROTO_MAP = "proto"
private val CONSTANTS_MAP = "constants"
@@ -58,7 +62,7 @@ open class IncrementalJvmCache(
private val MODULE_MAPPING_FILE_NAME = "." + ModuleMapping.MAPPING_FILE_EXT
}
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile))
override val sourceToClassesMap = registerMap(SourceToJvmNameMap(SOURCE_TO_CLASSES.storageFile, pathConverter))
override val dirtyOutputClassesMap = registerMap(DirtyClassesJvmNameMap(DIRTY_OUTPUT_CLASSES.storageFile))
private val protoMap = registerMap(ProtoMap(PROTO_MAP.storageFile))
@@ -68,7 +72,8 @@ open class IncrementalJvmCache(
private val partToMultifileFacade = registerMap(MultifileClassPartMap(MULTIFILE_CLASS_PARTS.storageFile))
private val inlineFunctionsMap = registerMap(InlineFunctionsMap(INLINE_FUNCTIONS.storageFile))
// todo: try to use internal names only?
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile))
private val internalNameToSource = registerMap(InternalNameToSourcesMap(INTERNAL_NAME_TO_SOURCE.storageFile, pathConverter))
// gradle only
private val javaSourcesProtoMap = registerMap(JavaSourcesProtoMap(JAVA_SOURCES_PROTO_MAP.storageFile))
private val outputDir by lazy(LazyThreadSafetyMode.NONE) { requireNotNull(targetOutputDir) { "Target is expected to have output directory" } }
@@ -440,14 +445,16 @@ open class IncrementalJvmCache(
override fun dumpValue(value: String): String = value
}
inner class InternalNameToSourcesMap(storageFile: File) :
BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Iterable<File>) {
storage[internalName] = sourceFiles.map { it.canonicalPath }
inner class InternalNameToSourcesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, EnumeratorStringDescriptor(), PathCollectionExternalizer) {
operator fun set(internalName: String, sourceFiles: Collection<File>) {
storage[internalName] = pathConverter.toPaths(sourceFiles)
}
operator fun get(internalName: String): Collection<File> =
(storage[internalName] ?: emptyList()).map(::File)
pathConverter.toFiles(storage[internalName] ?: emptyList())
fun remove(internalName: String) {
storage.remove(internalName)

View File

@@ -0,0 +1,33 @@
/*
* Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental
import java.io.File
import java.io.Serializable
data class IncrementalModuleEntry(
private val projectPath: String,
val name: String,
val buildDir: File,
val buildHistoryFile: File
) : Serializable {
companion object {
private const val serialVersionUID = 0L
}
}
class IncrementalModuleInfo(
val projectRoot: File,
val dirToModule: Map<File, IncrementalModuleEntry>,
val nameToModules: Map<String, Set<IncrementalModuleEntry>>,
val jarToClassListFile: Map<File, File>,
// only for js and mpp
val jarToModule: Map<File, IncrementalModuleEntry>
) : Serializable {
companion object {
private const val serialVersionUID = 0L
}
}

View File

@@ -71,7 +71,7 @@ class JavaClassesSerializerExtension : KotlinSerializerExtensionBase(BuiltInSeri
override fun serializeProperty(
descriptor: PropertyDescriptor,
proto: ProtoBuf.Property.Builder,
versionRequirementTable: MutableVersionRequirementTable,
versionRequirementTable: MutableVersionRequirementTable?,
childSerializer: DescriptorSerializer
) {
super.serializeProperty(descriptor, proto, versionRequirementTable, childSerializer)

View File

@@ -30,15 +30,18 @@ import java.io.IOException
import java.util.*
open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
open class LookupStorage(
targetDataDir: File,
pathConverter: FileToPathConverter
) : BasicMapsOwner(targetDataDir) {
companion object {
private val DELETED_TO_SIZE_TRESHOLD = 0.5
private val MINIMUM_GARBAGE_COLLECTIBLE_SIZE = 10000
}
private val countersFile = "counters".storageFile
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile))
private val idToFile = registerMap(IdToFileMap("id-to-file".storageFile, pathConverter))
private val fileToId = registerMap(FileToIdMap("file-to-id".storageFile, pathConverter))
private val lookupMap = registerMap(LookupMap("lookups".storageFile))
@Volatile
@@ -152,7 +155,7 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
size = 0
deletedCount = 0
for ((file, oldId) in oldFileToId.entries) {
for ((file, oldId) in oldFileToId.entries.sortedBy { it.key.path }) {
val newId = addFileIfNeeded(file)
oldIdToNewId[oldId] = newId
}
@@ -174,11 +177,19 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
flush(false)
}
@TestOnly fun dump(lookupSymbols: Set<LookupSymbol>, basePath: File? = null): String {
@TestOnly
fun dump(lookupSymbols: Set<LookupSymbol>): String {
flush(false)
val sb = StringBuilder()
val p = Printer(sb)
p.println("====== File to id map")
p.println(fileToId.dump())
p.println("====== Id to file map")
p.println(idToFile.dump())
val lookupsStrings = lookupSymbols.groupBy { LookupSymbolKey(it.name, it.scope) }
for (lookup in lookupMap.keys.sorted()) {
@@ -186,12 +197,11 @@ open class LookupStorage(targetDataDir: File) : BasicMapsOwner(targetDataDir) {
val key = if (lookup in lookupsStrings) {
lookupsStrings[lookup]!!.map { "${it.scope}#${it.name}" }.sorted().joinToString(", ")
}
else {
} else {
lookup.toString()
}
val value = fileIds.map { idToFile[it]?.let { if (basePath == null) it.absolutePath else it.toRelativeString(basePath) } ?: it.toString() }.sorted().joinToString(", ")
val value = fileIds.map { it.toString() }.sorted().joinToString(", ")
p.println("$key -> $value")
}

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.incremental
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import org.jetbrains.kotlin.build.GeneratedFile
import org.jetbrains.kotlin.build.GeneratedJvmClass
import org.jetbrains.kotlin.build.JvmSourceRoot
@@ -67,11 +65,23 @@ fun makeModuleFile(
friendDirs
)
val scriptFile = File.createTempFile("kjps", StringUtil.sanitizeJavaIdentifier(name) + ".script.xml")
FileUtil.writeToFile(scriptFile, builder.asText().toString())
val scriptFile = File.createTempFile("kjps", sanitizeJavaIdentifier(name) + ".script.xml")
scriptFile.writeText(builder.asText().toString())
return scriptFile
}
private fun sanitizeJavaIdentifier(string: String) =
buildString {
for (char in string) {
if (char.isJavaIdentifierPart()) {
if (length == 0 && !char.isJavaIdentifierStart()) {
append('_')
}
append(char)
}
}
}
fun makeCompileServices(
incrementalCaches: Map<TargetId, IncrementalCache>,
lookupTracker: LookupTracker,

View File

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

View File

@@ -0,0 +1,30 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import java.io.File
class ComplementarySourceFilesMap(
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, complementaryFiles: Collection<File>) {
storage[pathConverter.toPath(sourceFile)] = pathConverter.toPaths(complementaryFiles)
}
operator fun get(sourceFile: File): Collection<File> {
val paths = storage[pathConverter.toPath(sourceFile)].orEmpty()
return pathConverter.toFiles(paths)
}
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(pathConverter.toPath(file)) }
}

View File

@@ -18,26 +18,27 @@ package org.jetbrains.kotlin.incremental.storage
import java.io.File
internal class FileToIdMap(file: File) : BasicMap<File, Int>(file, FileKeyDescriptor, IntExternalizer) {
override fun dumpKey(key: File): String = key.toString()
internal class FileToIdMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Int>(file, IntExternalizer) {
override fun dumpValue(value: Int): String = value.toString()
operator fun get(file: File): Int? = storage[file]
operator fun get(file: File): Int? = storage[pathConverter.toPath(file)]
operator fun set(file: File, id: Int) {
storage[file] = id
storage[pathConverter.toPath(file)] = id
}
fun remove(file: File) {
storage.remove(file)
storage.remove(pathConverter.toPath(file))
}
fun toMap(): Map<File, Int> {
val result = HashMap<File, Int>()
for (key in storage.keys) {
val value = storage[key] ?: continue
result[key] = value
result[pathConverter.toFile(key)] = value
}
return result
}

View File

@@ -0,0 +1,25 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import java.io.File
interface FileToPathConverter {
fun toPath(file: File): String
fun toFile(path: String): File
}
fun FileToPathConverter.toPaths(files: Collection<File>): List<String> =
files.map { toPath(it) }
fun FileToPathConverter.toFiles(paths: Collection<String>): List<File> =
paths.map { toFile(it) }
object FileToCanonicalPathConverter : FileToPathConverter {
override fun toPath(file: File): String = file.canonicalPath
override fun toFile(path: String): File = File(path)
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.incremental.storage
import org.jetbrains.kotlin.incremental.dumpCollection
import java.io.File
class FilesMap(storageFile: File)
: BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
operator fun set(sourceFile: File, outputFiles: Collection<File>) {
storage[sourceFile.absolutePath] = outputFiles.map { it.absolutePath }
}
operator fun get(sourceFile: File): Collection<File> =
storage[sourceFile.absolutePath].orEmpty().map(::File)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
fun remove(file: File): Collection<File> =
get(file).also { storage.remove(file.absolutePath) }
}

View File

@@ -16,20 +16,24 @@
package org.jetbrains.kotlin.incremental.storage
import com.intellij.util.io.EnumeratorStringDescriptor
import com.intellij.util.io.ExternalIntegerKeyDescriptor
import java.io.File
internal class IdToFileMap(file: File) : BasicMap<Int, File>(file, ExternalIntegerKeyDescriptor(), FileKeyDescriptor) {
internal class IdToFileMap(
file: File,
private val pathConverter: FileToPathConverter
) : BasicMap<Int, String>(file, ExternalIntegerKeyDescriptor(), EnumeratorStringDescriptor.INSTANCE) {
override fun dumpKey(key: Int): String = key.toString()
override fun dumpValue(value: File): String = value.toString()
override fun dumpValue(value: String): String = value
operator fun get(id: Int): File? = storage[id]
operator fun get(id: Int): File? = storage[id]?.let { pathConverter.toFile(it) }
operator fun contains(id: Int): Boolean = id in storage
operator fun set(id: Int, file: File) {
storage[id] = file
storage[id] = pathConverter.toPath(file)
}
fun remove(id: Int) {

View File

@@ -21,32 +21,40 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import java.io.File
internal class SourceToJvmNameMap(storageFile: File) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile)
internal class SourceToFqNameMap(storageFile: File) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile)
internal class SourceToJvmNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<JvmClassName>(JvmClassNameTransformer, storageFile, pathConverter)
internal class SourceToFqNameMap(
storageFile: File,
pathConverter: FileToPathConverter
) : AbstractSourceToOutputMap<FqName>(FqNameTransformer, storageFile, pathConverter)
internal abstract class AbstractSourceToOutputMap<Name>(
private val nameTransformer: NameTransformer<Name>,
storageFile: File
private val nameTransformer: NameTransformer<Name>,
storageFile: File,
private val pathConverter: FileToPathConverter
) : BasicStringMap<Collection<String>>(storageFile, PathStringDescriptor, StringCollectionExternalizer) {
fun clearOutputsForSource(sourceFile: File) {
remove(sourceFile.absolutePath)
remove(pathConverter.toPath(sourceFile))
}
fun add(sourceFile: File, className: Name) {
storage.append(sourceFile.absolutePath, nameTransformer.asString(className))
storage.append(pathConverter.toPath(sourceFile), nameTransformer.asString(className))
}
fun contains(sourceFile: File): Boolean =
sourceFile.absolutePath in storage
pathConverter.toPath(sourceFile) in storage
operator fun get(sourceFile: File): Collection<Name> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asName)
fun getFqNames(sourceFile: File): Collection<FqName> =
storage[sourceFile.absolutePath].orEmpty().map(nameTransformer::asFqName)
storage[pathConverter.toPath(sourceFile)].orEmpty().map(nameTransformer::asFqName)
override fun dumpValue(value: Collection<String>) =
value.dumpCollection()
value.dumpCollection()
private fun remove(path: String) {
storage.remove(path)

View File

@@ -177,20 +177,6 @@ object PathStringDescriptor : EnumeratorStringDescriptor() {
override fun isEqual(val1: String, val2: String?) = FileUtil.pathsEqual(val1, val2)
}
object FileKeyDescriptor : KeyDescriptor<File> {
override fun read(input: DataInput): File = File(input.readUTF())
override fun save(output: DataOutput, value: File) {
output.writeUTF(value.canonicalPath)
}
override fun getHashCode(value: File?): Int =
FileUtil.FILE_HASHING_STRATEGY.computeHashCode(value)
override fun isEqual(val1: File?, val2: File?): Boolean =
FileUtil.FILE_HASHING_STRATEGY.equals(val1, val2)
}
open class CollectionExternalizer<T>(
private val elementExternalizer: DataExternalizer<T>,
private val newCollection: () -> MutableCollection<T>

View File

@@ -16,8 +16,6 @@
package org.jetbrains.kotlin.modules
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.openapi.util.text.StringUtil.escapeXml
import org.jetbrains.kotlin.build.JvmSourceRoot
import org.jetbrains.kotlin.cli.common.modules.ModuleXmlParser.*
import org.jetbrains.kotlin.config.IncrementalCompilation
@@ -137,6 +135,13 @@ class KotlinModuleXmlBuilder {
}
private fun getEscapedPath(sourceFile: File): String {
return escapeXml(toSystemIndependentName(sourceFile.path))
return escapeXml(sourceFile.invariantSeparatorsPath)
}
private companion object {
private val xmlEscapeReplacement = mapOf("<" to "&lt;", ">" to "&gt;", "&" to "&amp;", "'" to "&#39;", "\"" to "&quot;")
private val xmlEscapeRegex = Regex(xmlEscapeReplacement.keys.joinToString("|", "(?:", ")") { Regex.escape(it) })
private fun escapeXml(string: String) = string.replace(xmlEscapeRegex) { xmlEscapeReplacement.getValue(it.value) }
}
}

View File

@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.incremental.testingUtils
import com.intellij.openapi.util.io.FileUtil
import java.io.File
import java.util.*
import kotlin.math.max
private val COMMANDS = listOf("new", "touch", "delete")
private val COMMANDS_AS_REGEX_PART = COMMANDS.joinToString("|")
@@ -166,7 +167,7 @@ class TouchFile(path: String, private val touchPolicy: TouchPolicy) : Modificati
TouchPolicy.TIMESTAMP -> {
val oldLastModified = file.lastModified()
//Mac OS and some versions of Linux truncate timestamp to nearest second
file.setLastModified(Math.max(System.currentTimeMillis(), oldLastModified + 1000))
file.setLastModified(max(System.currentTimeMillis(), oldLastModified + 1000))
}
TouchPolicy.CHECKSUM -> {
file.appendText(" ")

View File

@@ -2643,7 +2643,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
boolean hasArrayDimensionCount();
@@ -2657,7 +2659,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
int getArrayDimensionCount();
@@ -3220,7 +3224,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -3236,7 +3242,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4365,7 +4373,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public boolean hasArrayDimensionCount() {
@@ -4381,7 +4391,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public int getArrayDimensionCount() {
@@ -4397,7 +4409,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder setArrayDimensionCount(int value) {
@@ -4416,7 +4430,9 @@ public final class DebugProtoBuf {
* - Array&lt;String&gt;::class, if array_dimension_count = 1
* - Array&lt;Array&lt;String&gt;&gt;::class, if array_dimension_count = 2
* - etc.
* Other forms of array class literals are not supported by this format, see KT-26568
* Since it's very difficult to represent Kotlin-specific type aspects (nullability, type projections) of array arguments
* in class literals on JVM, we don't bother to do represent this in our format as well.
* So, for example, values `Array&lt;Array&lt;in B?&gt;&gt;::class` and `Array&lt;out Array&lt;B&gt;&gt;?&gt;::class` will be represented exactly the same here.
* </pre>
*/
public Builder clearArrayDimensionCount() {
@@ -34427,7 +34443,7 @@ public final class DebugProtoBuf {
"tbrains.kotlin.metadata.VersionRequireme" +
"nt.Level:\005ERROR\022\022\n\nerror_code\030\004 \001(\005\022\025\n\007m" +
"essage\030\005 \001(\005B\004\230\265\030\001\022e\n\014version_kind\030\006 \001(\016" +
"2=.org.jetbrains.kotlin.metadata.Version" +
"2=.org.jetbrains.kotlin.metadata.version" +
"Requirement.VersionKind:\020LANGUAGE_VERSIO" +
"N\"+\n\005Level\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HI" +
"DDEN\020\002\"J\n\013VersionKind\022\024\n\020LANGUAGE_VERSIO" +

View File

@@ -1,7 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
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 proguard.gradle.ProGuardTask
@@ -10,11 +8,13 @@ import org.gradle.kotlin.dsl.*
buildscript {
extra["defaultSnapshotVersion"] = "1.3-SNAPSHOT"
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.30-eap-28", projectExtId = "Kotlin_1330_Compiler", onlySuccessBootstrap = false))
// when updating please also update JPS artifacts configuration: https://jetbrains.quip.com/zzGUAYSJ6gv3/JPS-Build-update-bootstrap
kotlinBootstrapFrom(BootstrapOption.TeamCity("1.3.50-dev-397", onlySuccessBootstrap = false))
repositories.withRedirector(project) {
bootstrapKotlinRepo?.let(::maven)
maven("https://plugins.gradle.org/m2")
maven("https://dl.bintray.com/kotlin/ktor")
}
// a workaround for kotlin compiler classpath in kotlin project: sometimes gradle substitutes
@@ -27,12 +27,16 @@ buildscript {
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
classpath("net.sf.proguard:proguard-gradle:6.0.3")
classpath("net.sf.proguard:proguard-gradle:6.1.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
// a workaround to add another one buildSrc with Cidr-specific tools to Gradle classpath
val kotlinUltimateBuildSrcDep = "org.jetbrains.kotlin.ultimate:buildSrc:1.0"
if (findProperty("cidrPluginsEnabled")?.toString()?.toBoolean() == true) {
classpath("org.jetbrains.kotlin.ultimate:buildSrc:1.0")
logger.info("Adding buildscript classpath dependency \"$kotlinUltimateBuildSrcDep\" in build.gradle.kts")
classpath(kotlinUltimateBuildSrcDep)
} else {
logger.info("NOT adding buildscript classpath dependency \"$kotlinUltimateBuildSrcDep\" in build.gradle.kts")
}
}
}
@@ -59,11 +63,11 @@ buildScan {
}
val configuredJdks: List<JdkId> =
getConfiguredJdks().also {
it.forEach {
logger.info("Using ${it.majorVersion} home: ${it.homeDir}")
}
getConfiguredJdks().also {
it.forEach { jdkId ->
logger.info("Using ${jdkId.majorVersion} home: ${jdkId.homeDir}")
}
}
val defaultSnapshotVersion: String by extra
val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion)
@@ -91,6 +95,17 @@ val artifactsDir = "$distDir/artifacts"
val ideaPluginDir = "$artifactsDir/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$artifactsDir/ideaUltimatePlugin/Kotlin"
extra["ktorExcludesForDaemon"] = listOf(
"org.jetbrains.kotlin" to "kotlin-reflect",
"org.jetbrains.kotlin" to "kotlin-stdlib",
"org.jetbrains.kotlin" to "kotlin-stdlib-common",
"org.jetbrains.kotlin" to "kotlin-stdlib-jdk8",
"org.jetbrains.kotlin" to "kotlin-stdlib-jdk7",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-jdk8",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-core",
"org.jetbrains.kotlinx" to "kotlinx-coroutines-core-common"
)
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
extra["libsDir"] = project.file(distLibDir)
@@ -120,10 +135,20 @@ fun checkJDK() {
if (jdkChecked) {
return
}
var unpresentJdks = JdkMajorVersion.values().filter { it.isMandatory() }.map { it -> it.name }.filter { it == null || extra[it] == jdkNotFoundConst }.toList()
if (!unpresentJdks.isEmpty()) {
throw GradleException("Please set environment variable${if (unpresentJdks.size > 1) "s" else ""}: ${unpresentJdks.joinToString()} to point to corresponding JDK installation.")
val unpresentJdks = JdkMajorVersion.values()
.filter { it.isMandatory() }
.map { it.name }
.filter { extra[it] == jdkNotFoundConst }
.toList()
if (unpresentJdks.isNotEmpty()) {
throw GradleException("Please set environment variable" +
(if (unpresentJdks.size > 1) "s" else "") +
": " + unpresentJdks.joinToString() +
" to point to corresponding JDK installation.")
}
jdkChecked = true
}
@@ -145,8 +170,8 @@ extra["versions.junit"] = "4.12"
extra["versions.javaslang"] = "2.0.6"
extra["versions.ant"] = "1.8.2"
extra["versions.android"] = "2.3.1"
extra["versions.kotlinx-coroutines-core"] = "1.0.1"
extra["versions.kotlinx-coroutines-jdk8"] = "1.0.1"
extra["versions.kotlinx-coroutines-core"] = "1.1.1"
extra["versions.kotlinx-coroutines-jdk8"] = "1.1.1"
extra["versions.json"] = "20160807"
extra["versions.native-platform"] = "0.14"
extra["versions.ant-launcher"] = "1.8.0"
@@ -155,6 +180,14 @@ extra["versions.org.springframework"] = "4.2.0.RELEASE"
extra["versions.jflex"] = "1.7.0"
extra["versions.markdown"] = "0.1.25"
extra["versions.trove4j"] = "1.0.20181211"
extra["versions.kotlin-native-shared"] = "1.0-dev-73"
// NOTE: please, also change KTOR_NAME in pathUtil.kt and all versions in corresponding jar names in daemon tests.
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.3-dev-9780"
}
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled = project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild
@@ -167,93 +200,95 @@ extra["intellijUltimateEnabled"] = intellijUltimateEnabled
extra["intellijSeparateSdks"] = intellijSeparateSdks
extra["IntellijCoreDependencies"] =
listOf(if (Platform[191].orHigher()) "asm-all-7.0" else "asm-all",
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java",
"streamex",
"trove4j")
listOf(
if (Platform[191].orHigher()) "asm-all-7.0.1" else "asm-all",
"guava",
"jdom",
"jna",
"log4j",
"picocontainer",
"snappy-in-java",
"streamex",
"trove4j"
)
extra["compilerModules"] = arrayOf(
":compiler:util",
":compiler:container",
":compiler:resolution",
":compiler:serialization",
":compiler:psi",
*if (project.findProperty("fir.enabled") == "true") {
arrayOf(
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir"
)
} else {
emptyArray()
},
":compiler:frontend",
":compiler:frontend.common",
":compiler:frontend.java",
":compiler:frontend.script",
":compiler:cli-common",
":compiler:daemon-common",
":compiler:daemon",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
":compiler:light-classes",
":compiler:cli",
":compiler:incremental-compilation-impl",
":js:js.ast",
":js:js.serializer",
":js:js.parser",
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":compiler",
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:deserialization",
":core:util.runtime"
":compiler:util",
":compiler:container",
":compiler:resolution",
":compiler:serialization",
":compiler:psi",
":compiler:frontend",
":compiler:frontend.common",
":compiler:frontend.java",
":compiler:cli-common",
":compiler:ir.tree",
":compiler:ir.psi2ir",
":compiler:ir.backend.common",
":compiler:backend.jvm",
":compiler:backend.js",
":compiler:ir.serialization.common",
":compiler:ir.serialization.js",
":compiler:backend-common",
":compiler:backend",
":compiler:plugin-api",
":compiler:light-classes",
":compiler:cli",
":compiler:cli-js",
":compiler:incremental-compilation-impl",
":js:js.ast",
":js:js.serializer",
":js:js.parser",
":js:js.frontend",
":js:js.translator",
":js:js.dce",
":compiler",
":kotlin-build-common",
":core:metadata",
":core:metadata.jvm",
":core:descriptors",
":core:descriptors.jvm",
":core:deserialization",
":core:util.runtime",
":core:type-system",
":compiler:fir:cones",
":compiler:fir:resolve",
":compiler:fir:tree",
":compiler:fir:psi2fir",
":compiler:fir:fir2ir",
":compiler:fir:java"
)
val coreLibProjects = listOf(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js",
":kotlin-reflect"
val coreLibProjects = listOfNotNull(
":kotlin-stdlib",
":kotlin-stdlib-common",
":kotlin-stdlib-js",
// Local builds are disabled at the request of the lib team
// TODO: Enable when tests are fixed
":kotlin-stdlib-js-ir".takeIf { isTeamcityBuild },
":kotlin-stdlib-jdk7",
":kotlin-stdlib-jdk8",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-jvm",
":kotlin-test:kotlin-test-junit",
":kotlin-test:kotlin-test-junit5",
":kotlin-test:kotlin-test-testng",
":kotlin-test:kotlin-test-js",
":kotlin-reflect"
)
val gradlePluginProjects = listOf(
":kotlin-gradle-plugin",
":kotlin-gradle-plugin:plugin-marker",
":kotlin-gradle-plugin-api",
":kotlin-gradle-plugin",
":kotlin-gradle-plugin:plugin-marker",
":kotlin-gradle-plugin-api",
// ":kotlin-gradle-plugin-integration-tests", // TODO: build fails
":kotlin-allopen",
":kotlin-allopen:plugin-marker",
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-noarg:plugin-marker",
":kotlin-sam-with-receiver"
":kotlin-allopen",
":kotlin-allopen:plugin-marker",
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-noarg:plugin-marker",
":kotlin-sam-with-receiver"
)
apply {
@@ -282,29 +317,29 @@ val ignoreTestFailures by extra(project.findProperty("ignoreTestFailures")?.toSt
allprojects {
jvmTarget = defaultJvmTarget
if (defaultJavaHome != null) {
javaHome = defaultJavaHome
} else {
logger.error("Could not find default java home. Please set environment variable JDK_${defaultJavaHome} to point to JDK ${defaultJavaHome} installation.")
}
configurations.maybeCreate("embedded")
jvmTarget = defaultJvmTarget
javaHome = defaultJavaHome
// There are problems with common build dir:
// - some tests (in particular js and binary-compatibility-validator depend on the fixed (default) location
// - idea seems unable to exclude common builddir from indexing
// - idea seems unable to exclude common buildDir from indexing
// therefore it is disabled by default
// buildDir = File(commonBuildDir, project.name)
val mirrorRepo: String? = findProperty("maven.repository.mirror")?.toString()
repositories {
intellijSdkRepo(project)
androidDxJarRepo(project)
kotlinBuildLocalRepo(project)
mirrorRepo?.let(::maven)
bootstrapKotlinRepo?.let(::maven)
jcenter()
maven(protobufRepo)
maven(intellijRepo)
maven(bootstrapKotlinRepo!!.replace("artifacts/content/maven/", "artifacts/content/internal/repo"))
maven(kotlinNativeRepo)
maven("https://dl.bintray.com/kotlin/ktor")
}
configureJvmProject(javaHome!!, jvmTarget!!)
@@ -357,21 +392,30 @@ allprojects {
fun File.toProjectRootRelativePathOrSelf() = (relativeToOrNull(rootDir)?.takeUnless { it.startsWith("..") } ?: this).path
fun FileCollection.printClassPath(role: String) =
println("${project.path} $role classpath:\n ${joinToString("\n ") { it.toProjectRootRelativePathOrSelf() } }")
println("${project.path} $role classpath:\n ${joinToString("\n ") { it.toProjectRootRelativePathOrSelf() }}")
try { javaPluginConvention() } catch (_: UnknownDomainObjectException) { null }?.let { javaConvention ->
try {
javaPluginConvention()
} catch (_: UnknownDomainObjectException) {
null
}?.let { javaConvention ->
task("printCompileClasspath") { doFirst { javaConvention.sourceSets["main"].compileClasspath.printClassPath("compile") } }
task("printRuntimeClasspath") { doFirst { javaConvention.sourceSets["main"].runtimeClasspath.printClassPath("runtime") } }
task("printTestCompileClasspath") { doFirst { javaConvention.sourceSets["test"].compileClasspath.printClassPath("test compile") } }
task("printTestRuntimeClasspath") { doFirst { javaConvention.sourceSets["test"].runtimeClasspath.printClassPath("test runtime") } }
}
run configureCompilerClasspath@ {
run configureCompilerClasspath@{
val bootstrapCompilerClasspath by rootProject.buildscript.configurations
configurations.findByName("kotlinCompilerClasspath")?.let {
dependencies.add(it.name, files(bootstrapCompilerClasspath))
}
}
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
}
}
}
@@ -413,8 +457,7 @@ val copyCompilerToIdeaPlugin by task<Copy> {
val ideaPlugin by task<Task> {
dependsOn(copyCompilerToIdeaPlugin)
val childIdeaPluginTasks = getTasksByName("ideaPlugin", true) - this@task
dependsOn(childIdeaPluginTasks)
dependsOn(":prepare:idea-plugin:ideaPlugin")
}
tasks {
@@ -439,18 +482,18 @@ tasks {
create("coreLibsTest") {
(coreLibProjects + listOf(
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
":kotlin-stdlib:samples",
":kotlin-test:kotlin-test-js:kotlin-test-js-it",
":kotlinx-metadata-jvm",
":tools:binary-compatibility-validator"
)).forEach {
dependsOn(it + ":check")
dependsOn("$it:check")
}
}
create("gradlePluginTest") {
gradlePluginProjects.forEach {
dependsOn(it + ":check")
dependsOn("$it:check")
}
}
@@ -460,10 +503,12 @@ tasks {
create("jvmCompilerTest") {
dependsOn("dist")
dependsOn(":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests")
dependsOn(
":compiler:test",
":compiler:container:test",
":compiler:tests-java8:test",
":compiler:tests-spec:remoteRunTests"
)
dependsOn(":plugins:jvm-abi-gen:test")
}
@@ -472,6 +517,12 @@ tasks {
dependsOn(":js:js.tests:runMocha")
}
create("firCompilerTest") {
dependsOn(":compiler:fir:psi2fir:test")
dependsOn(":compiler:fir:resolve:test")
dependsOn(":compiler:fir:fir2ir:test")
}
create("scriptingTest") {
dependsOn("dist")
dependsOn(":kotlin-script-util:test")
@@ -481,6 +532,7 @@ tasks {
create("compilerTest") {
dependsOn("jvmCompilerTest")
dependsOn("jsCompilerTest")
dependsOn("firCompilerTest")
dependsOn("scriptingTest")
dependsOn(":kotlin-build-common:test")
@@ -527,46 +579,55 @@ 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")
dependsOn(
":idea:idea-gradle:test",
":idea:idea-gradle-native:test",
":idea:idea-maven:test",
":j2k:test",
":nj2k:test",
":idea:eval4j:test"
)
}
create("idea-plugin-tests") {
dependsOn("dist")
dependsOn("idea-plugin-main-tests",
"idea-plugin-additional-tests")
dependsOn(
"idea-plugin-main-tests",
"idea-plugin-additional-tests"
)
}
create("android-ide-tests") {
dependsOn("dist")
dependsOn(":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test")
dependsOn(
":plugins:android-extensions-ide:test",
":idea:idea-android:test",
":kotlin-annotation-processing:test"
)
}
create("plugins-tests") {
dependsOn("dist")
dependsOn(":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-ide-plugin:test")
dependsOn(
":kotlin-annotation-processing:test",
":kotlin-source-sections-compiler-plugin:test",
":kotlin-allopen-compiler-plugin:test",
":kotlin-noarg-compiler-plugin:test",
":kotlin-sam-with-receiver-compiler-plugin:test",
":plugins:uast-kotlin:test",
":kotlin-annotation-processing-gradle:test",
":kotlinx-serialization-ide-plugin:test"
)
}
create("ideaPluginTest") {
dependsOn(
"idea-plugin-tests",
"jps-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
"idea-plugin-tests",
"jps-tests",
"plugins-tests",
"android-ide-tests",
":generators:test"
)
}
@@ -601,7 +662,18 @@ val zipCompiler by task<Zip> {
}
}
val zipStdlibTests by task<Zip> {
destinationDirectory.set(file(distDir))
archiveFileName.set("kotlin-stdlib-tests.zip")
from("libraries/stdlib/common/test") { into("common") }
from("libraries/stdlib/test") { into("test") }
doLast {
logger.lifecycle("Stdlib tests are packed to ${archiveFile.get()}")
}
}
val zipTestData by task<Zip> {
dependsOn(zipStdlibTests)
destinationDir = file(distDir)
archiveName = "kotlin-test-data.zip"
from("compiler/testData") { into("compiler") }
@@ -641,11 +713,11 @@ val zipPlugin by task<Zip> {
configure<IdeaModel> {
module {
excludeDirs = files(
project.buildDir,
commonLocalDataDir,
".gradle",
"dependencies",
"dist"
project.buildDir,
commonLocalDataDir,
".gradle",
"dependencies",
"dist"
).toSet()
}
}
@@ -653,7 +725,7 @@ configure<IdeaModel> {
fun jdkPath(version: String): String {
val jdkName = "JDK_${version.replace(".", "")}"
val jdkMajorVersion = JdkMajorVersion.valueOf(jdkName)
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath?:jdkNotFoundConst
return configuredJdks.find { it.majorVersion == jdkMajorVersion }?.homeDir?.canonicalPath ?: jdkNotFoundConst
}
@@ -715,12 +787,3 @@ tasks.create("findShadowJarsInClasspath").doLast {
project.checkConfig("testCompileClasspath")
}
}
allprojects {
afterEvaluate {
if (cacheRedirectorEnabled()) {
logger.info("Redirecting repositories for $displayName")
repositories.redirect()
}
}
}

View File

@@ -65,6 +65,7 @@ rootProject.apply {
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
val intellijUltimateEnabled by extra(project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild)
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
extra["intellijReleaseType"] = if (extra["versions.intellijSdk"]?.toString()?.endsWith("SNAPSHOT") == true)
"snapshots"
@@ -73,7 +74,7 @@ else
extra["versions.androidDxSources"] = "5.0.0_r2"
extra["customDepsOrg"] = "kotlin.build.custom.deps"
extra["customDepsOrg"] = "kotlin.build"
repositories {
if (cacheRedirectorEnabled) {
@@ -91,15 +92,16 @@ repositories {
}
dependencies {
compile(kotlin("stdlib", embeddedKotlinVersion))
compile("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
compile("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
compile("net.rubygrapefruit:native-platform-windows-i386:${property("versions.native-platform")}")
compile("com.jakewharton.dex:dex-method-list:3.0.0")
compile("com.github.jengelman.gradle.plugins:shadow:${property("versions.shadow")}")
compile("org.jetbrains.intellij.deps:asm-all:7.0")
compile("org.jetbrains.intellij.deps:asm-all:7.0.1")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.4.2")
compile("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:0.5")
}
samWithReceiver {
@@ -109,4 +111,4 @@ samWithReceiver {
fun Project.`samWithReceiver`(configure: org.jetbrains.kotlin.samWithReceiver.gradle.SamWithReceiverExtension.() -> Unit): Unit =
extensions.configure("samWithReceiver", configure)
tasks["build"].dependsOn(":prepare-deps:android-dx:build", ":prepare-deps:intellij-sdk:build")
tasks["build"].dependsOn(":prepare-deps:build")

View File

@@ -1,124 +0,0 @@
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
import org.gradle.jvm.tasks.Jar
val toolsOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "macosx"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
val buildToolsVersion = rootProject.extra["versions.androidBuildTools"] as String
val dxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
repositories {
ivy {
artifactPattern("https://dl.google.com/android/repository/[artifact]_[revision](-[classifier]).[ext]")
artifactPattern("https://android.googlesource.com/platform/dalvik/+archive/android-$dxSourcesVersion/[artifact].[ext]")
metadataSources {
artifact()
}
}
}
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val dxModuleName = "android-dx"
val dxRevision = buildToolsVersion
val dxRepoModuleDir = File(customDepsRepoDir, "$customDepsOrg/$dxModuleName/$dxRevision")
val buildToolsZip by configurations.creating
val dxSourcesTar by configurations.creating
dependencies {
buildToolsZip("google:build-tools:$buildToolsVersion:$toolsOs@zip")
dxSourcesTar("google:dx:0@tar.gz")
}
val unzipDxJar by tasks.creating {
dependsOn(buildToolsZip)
inputs.files(buildToolsZip)
outputs.files(File(dxRepoModuleDir, "dx.jar"))
doFirst {
project.copy {
from(zipTree(buildToolsZip.singleFile).files)
include("**/dx.jar")
into(dxRepoModuleDir)
}
}
}
val dxSourcesTargetDir = File(buildDir, "dx_src")
val untarDxSources by tasks.creating {
dependsOn(dxSourcesTar)
inputs.files(dxSourcesTar)
outputs.dir(dxSourcesTargetDir)
doFirst {
project.copy {
from(tarTree(dxSourcesTar.singleFile))
include("src/**")
includeEmptyDirs = false
into(dxSourcesTargetDir)
}
}
}
val prepareDxSourcesJar by tasks.creating(Jar::class) {
dependsOn(untarDxSources)
from("$dxSourcesTargetDir/src")
destinationDir = dxRepoModuleDir
baseName = "dx"
classifier = "sources"
}
val prepareIvyXml by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar)
inputs.files(unzipDxJar, prepareDxSourcesJar)
val ivyFile = File(dxRepoModuleDir, "$dxModuleName.ivy.xml")
outputs.file(ivyFile)
doLast {
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"
it.classifier = "sources"
})
writeTo(ivyFile)
}
}
}
val build by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar, prepareIvyXml)
}
val clean by tasks.creating(Delete::class) {
delete(dxRepoModuleDir)
delete(buildDir)
}

View File

@@ -0,0 +1,440 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import org.gradle.internal.os.OperatingSystem
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
val verifyDependencyOutput: Boolean by rootProject.extra
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
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val androidBuildToolsVersion = rootProject.extra["versions.androidBuildTools"] as String
val androidDxSourcesVersion = rootProject.extra["versions.androidDxSources"] as String
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("verifyDependencyOutput: $verifyDependencyOutput")
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val androidStudioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
val androidToolsOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "macosx"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
if (cacheRedirectorEnabled) {
artifactPattern("https://cache-redirector.jetbrains.com/dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$androidStudioOs.[ext]")
}
artifactPattern("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$androidStudioOs.[ext]")
metadataSources {
artifact()
}
}
}
ivy {
artifactPattern("https://dl.google.com/android/repository/[artifact]_[revision](-[classifier]).[ext]")
artifactPattern("https://android.googlesource.com/platform/dalvik/+archive/android-$androidDxSourcesVersion/[artifact].[ext]")
metadataSources {
artifact()
}
}
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
val intellijUltimate by configurations.creating
val androidStudio by configurations.creating
val sources by configurations.creating
val jpsStandalone by configurations.creating
val intellijCore by configurations.creating
val nodeJSPlugin by configurations.creating
val androidBuildTools by configurations.creating
val androidDxSources by configurations.creating
/**
* Special repository for annotations.jar required for idea runtime only.
*
* See IntellijDependenciesKt.intellijRuntimeAnnotations for more details.
*/
val intellijRuntimeAnnotations = "intellij-runtime-annotations"
val customDepsRepoDir = rootProject.rootDir.parentFile.resolve("dependencies/repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val repoDir = File(customDepsRepoDir, customDepsOrg)
val androidDxModuleName = "android-dx"
val androidDxRevision = androidBuildToolsVersion
val androidDxRepoModuleDir = File(repoDir, "$androidDxModuleName/$androidDxRevision")
dependencies {
if (androidStudioRelease != null) {
val extension = if (androidStudioOs == "linux" && androidStudioRelease.startsWith("3.5"))
"tar.gz"
else
"zip"
androidStudio("google:android-studio-ide:$androidStudioBuild@$extension")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
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")
jpsStandalone("com.jetbrains.intellij.idea:jps-standalone:$intellijVersion")
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
androidBuildTools("google:build-tools:$androidBuildToolsVersion:$androidToolsOs@zip")
androidDxSources("google:dx:0@tar.gz")
}
val dxSourcesTargetDir = File(buildDir, "dx_src")
val untarDxSources by tasks.creating {
dependsOn(androidDxSources)
inputs.files(androidDxSources)
outputs.dir(dxSourcesTargetDir)
doFirst {
project.copy {
from(tarTree(androidDxSources.singleFile))
include("src/**")
includeEmptyDirs = false
into(dxSourcesTargetDir)
}
}
}
val prepareDxSourcesJar by tasks.creating(Jar::class) {
dependsOn(untarDxSources)
from("$dxSourcesTargetDir/src")
destinationDir = File(repoDir, sources.name)
baseName = androidDxModuleName
classifier = "sources"
version = androidBuildToolsVersion
}
val unzipDxJar by tasks.creating {
dependsOn(androidBuildTools)
inputs.files(androidBuildTools)
outputs.files(File(androidDxRepoModuleDir, "dx.jar"))
doFirst {
project.copy {
from(zipTree(androidBuildTools.singleFile).files)
include("**/dx.jar")
into(androidDxRepoModuleDir)
}
}
}
val buildIvyRepoForAndroidDx by tasks.creating {
dependsOn(unzipDxJar, prepareDxSourcesJar)
inputs.files(unzipDxJar, prepareDxSourcesJar)
outputs.file(File(androidDxRepoModuleDir, "$androidDxModuleName.ivy.xml"))
doLast {
writeIvyXml(
customDepsOrg,
androidDxModuleName,
androidBuildToolsVersion,
androidDxModuleName,
androidDxRepoModuleDir,
androidDxRepoModuleDir,
androidDxRepoModuleDir,
prepareDxSourcesJar.outputs.files.singleFile
)
}
}
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
val makeIntellijAnnotations by tasks.creating(Copy::class.java) {
dependsOn(makeIntellijCore)
from(repoDir.resolve("intellij-core/$intellijVersion/artifacts/annotations.jar"))
val targetDir = File(repoDir, "$intellijRuntimeAnnotations/$intellijVersion")
into(targetDir)
val ivyFile = File(targetDir, "$intellijRuntimeAnnotations.ivy.xml")
outputs.files(ivyFile)
doLast {
writeIvyXml(
customDepsOrg,
intellijRuntimeAnnotations,
intellijVersion,
intellijRuntimeAnnotations,
targetDir,
targetDir,
targetDir,
allowAnnotations = true
)
}
}
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 sourcesFile = mergeSources.outputs.files.singleFile
val makeIde = if (androidStudioBuild != null) {
buildIvyRepositoryTask(
androidStudio,
customDepsOrg,
customDepsRepoDir,
if (androidStudioOs == "mac")
::skipContentsDirectory
else
::skipToplevelDirectory
)
} else {
val task = if (installIntellijUltimate) {
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
} else {
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
}
task.configure {
dependsOn(mergeSources)
}
task
}
val build by tasks.creating {
dependsOn(
makeIntellijCore,
makeIde,
buildIvyRepositoryTask(jpsStandalone, customDepsOrg, customDepsRepoDir, null, sourcesFile),
makeIntellijAnnotations,
buildIvyRepoForAndroidDx
)
if (installIntellijUltimate) {
dependsOn(
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
)
}
}
// Task to delete legacy repo locations
tasks.create("cleanLegacy", Delete::class.java) {
delete("$projectDir/android-dx")
delete("$projectDir/intellij-sdk")
}
tasks.create("clean", Delete::class.java) {
delete(customDepsRepoDir)
}
fun buildIvyRepositoryTask(
configuration: Configuration,
organization: String,
repoDirectory: File,
pathRemap: ((String) -> String)? = null,
sources: File? = null
) = tasks.register("buildIvyRepositoryFor${configuration.name.capitalize()}") {
fun ResolvedArtifact.moduleDirectory(): File =
File(repoDirectory, "$organization/${moduleVersion.id.name}/${moduleVersion.id.version}")
dependsOn(configuration)
inputs.files(configuration)
if (verifyDependencyOutput) {
outputs.dir(provider {
configuration.resolvedConfiguration.resolvedArtifacts.single().moduleDirectory()
})
} else {
outputs.upToDateWhen {
configuration.resolvedConfiguration.resolvedArtifacts.single()
.moduleDirectory()
.exists()
}
}
doFirst {
configuration.resolvedConfiguration.resolvedArtifacts.single().run {
val moduleDirectory = moduleDirectory()
val artifactsDirectory = File(moduleDirectory(), "artifacts")
logger.info("Unpacking ${file.name} into ${artifactsDirectory.absolutePath}")
copy {
val fileTree = when (extension) {
"tar.gz" -> tarTree(file)
"zip" -> zipTree(file)
else -> error("Unsupported artifact extension: $extension")
}
from(fileTree.matching {
exclude("**/plugins/Kotlin/**")
})
into(artifactsDirectory)
if (pathRemap != null) {
eachFile {
path = pathRemap(path)
}
}
includeEmptyDirs = false
}
writeIvyXml(
organization,
moduleVersion.id.name,
moduleVersion.id.version,
moduleVersion.id.name,
File(artifactsDirectory, "lib"),
File(artifactsDirectory, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
val pluginsDirectory = File(artifactsDirectory, "plugins")
if (pluginsDirectory.exists()) {
file(File(artifactsDirectory, "plugins"))
.listFiles { file: File -> file.isDirectory }
.forEach {
writeIvyXml(
organization,
it.name,
moduleVersion.id.version,
it.name,
File(it, "lib"),
File(it, "lib"),
File(moduleDirectory, "ivy"),
*listOfNotNull(sources).toTypedArray()
)
}
}
}
}
}
fun writeIvyXml(
organization: String,
moduleName: String,
version: String,
fileName: String,
baseDir: File,
artifactDir: File,
targetDir: File,
vararg sourcesJar: File,
allowAnnotations: Boolean = false
) {
fun shouldIncludeIntellijJar(jar: File) =
jar.isFile
&& jar.extension == "jar"
&& !jar.name.startsWith("kotlin-")
&& (allowAnnotations || jar.name != "annotations.jar") // see comments for [intellijAnnotations] above
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(organization, moduleName, version))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
artifactDir.listFiles()?.forEach { jarFile ->
if (shouldIncludeIntellijJar(jarFile)) {
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(
FileBasedIvyArtifact(
jarFile,
DefaultIvyPublicationIdentity(organization, relativeName, version)
).also {
it.conf = "default"
}
)
}
}
sourcesJar.forEach {
val sourcesArtifactName = it.name.substringBeforeLast("-").substringBeforeLast("-")
addArtifact(
FileBasedIvyArtifact(
it,
DefaultIvyPublicationIdentity(organization, sourcesArtifactName, version)
).also { artifact ->
artifact.conf = "sources"
artifact.classifier = "sources"
}
)
}
writeTo(File(targetDir, "$fileName.ivy.xml"))
}
}
fun skipToplevelDirectory(path: String) = path.substringAfter('/')
fun skipContentsDirectory(path: String) = path.substringAfter("Contents/")

View File

@@ -1,285 +0,0 @@
@file:Suppress("PropertyName")
import org.gradle.api.publish.ivy.internal.artifact.FileBasedIvyArtifact
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyConfiguration
import org.gradle.api.publish.ivy.internal.publication.DefaultIvyPublicationIdentity
import org.gradle.api.publish.ivy.internal.publisher.IvyDescriptorFileGenerator
import java.io.File
import org.gradle.internal.os.OperatingSystem
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
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
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
val installIntellijUltimate = intellijUltimateEnabled
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
if (intellijVersionDelimiterIndex == -1) {
error("Invalid IDEA version $intellijVersion")
}
val platformBaseVersion = intellijVersion.substring(0, intellijVersionDelimiterIndex)
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
logger.info("intellijVersion: $intellijVersion")
logger.info("androidStudioRelease: $androidStudioRelease")
logger.info("androidStudioBuild: $androidStudioBuild")
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
logger.info("installIntellijCommunity: $installIntellijCommunity")
logger.info("installIntellijUltimate: $installIntellijUltimate")
val studioOs by lazy {
when {
OperatingSystem.current().isWindows -> "windows"
OperatingSystem.current().isMacOsX -> "mac"
OperatingSystem.current().isLinux -> "linux"
else -> {
logger.error("Unknown operating system for android tools: ${OperatingSystem.current().name}")
""
}
}
}
repositories {
if (androidStudioRelease != null) {
ivy {
if (cacheRedirectorEnabled) {
artifactPattern("https://cache-redirector.jetbrains.com/dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
}
artifactPattern("https://dl.google.com/dl/android/studio/ide-zips/$androidStudioRelease/[artifact]-[revision]-$studioOs.zip")
metadataSources {
artifact()
}
}
}
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
val intellijUltimate by configurations.creating
val sources by configurations.creating
val `jps-standalone` by configurations.creating
val `jps-build-test` by configurations.creating
val `intellij-core` by configurations.creating
val `plugins-NodeJS` by configurations.creating
val customDepsRepoDir = File(buildDir, "repo")
val customDepsOrg: String by rootProject.extra
val customDepsRevision = intellijVersion
val customDepsRepoModulesDir = File(customDepsRepoDir, "$customDepsOrg/$customDepsRevision")
val repoDir = customDepsRepoModulesDir
dependencies {
if (androidStudioRelease != null) {
intellij("google:android-studio-ide:$androidStudioBuild")
} else {
if (installIntellijCommunity) {
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
}
if (installIntellijUltimate) {
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")
`intellij-core`("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
if (intellijUltimateEnabled) {
`plugins-NodeJS`("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
}
}
fun Task.configureExtractFromConfigurationTask(sourceConfig: Configuration,
pathRemap: (String) -> String = { it },
extractor: (Configuration) -> Any) {
dependsOn(sourceConfig)
inputs.files(sourceConfig)
val targetDir = File(repoDir, sourceConfig.name)
outputs.dirs(targetDir)
doFirst {
project.copy {
from(extractor(sourceConfig))
into(targetDir)
eachFile {
path = pathRemap(path)
}
}
}
}
fun removePathPrefix(path: String): String {
if (androidStudioRelease == null) return path
val slashes = if (studioOs == "mac") 2 else 1
var result = path
repeat(slashes) {
result = result.substringAfter('/')
}
return result
}
val unzipIntellijSdk by tasks.creating {
configureExtractFromConfigurationTask(intellij, pathRemap = { removePathPrefix(it) }) {
zipTree(it.singleFile).matching {
exclude("**/plugins/Kotlin/**")
}
}
}
val unzipIntellijUltimateSdk by tasks.creating {
configureExtractFromConfigurationTask(intellijUltimate) {
zipTree(it.singleFile).matching {
exclude("plugins/Kotlin/**")
}
}
}
val unzipIntellijCore by tasks.creating { configureExtractFromConfigurationTask(`intellij-core`) { zipTree(it.singleFile) } }
val unzipJpsStandalone by tasks.creating { configureExtractFromConfigurationTask(`jps-standalone`) { zipTree(it.singleFile) } }
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, vararg sourcesJar: File) {
with(IvyDescriptorFileGenerator(DefaultIvyPublicationIdentity(customDepsOrg, moduleName, intellijVersion))) {
addConfiguration(DefaultIvyConfiguration("default"))
addConfiguration(DefaultIvyConfiguration("sources"))
jarFiles.asFileTree.files.forEach { jarFile ->
if (jarFile.isFile && jarFile.extension == "jar") {
val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar")
addArtifact(
FileBasedIvyArtifact(jarFile, DefaultIvyPublicationIdentity(customDepsOrg, relativeName, intellijVersion)).also {
it.conf = "default"
}
)
}
}
sourcesJar.forEach {
val sourcesArtifactName = it.name.substringBeforeLast("-").substringBeforeLast("-")
addArtifact(
FileBasedIvyArtifact(it, DefaultIvyPublicationIdentity(customDepsOrg, sourcesArtifactName, intellijVersion)).also { artifact ->
artifact.conf = "sources"
artifact.classifier = "sources"
}
)
}
writeTo(File(customDepsRepoModulesDir, "$fileName.ivy.xml"))
}
}
val prepareIvyXmls by tasks.creating {
dependsOn(unzipIntellijCore, unzipJpsStandalone, mergeSources, copyJpsBuildTest)
val intellijSdkDir = File(repoDir, intellij.name)
val intellijUltimateSdkDir = File(repoDir, intellijUltimate.name)
if (installIntellijCommunity) {
dependsOn(unzipIntellijSdk)
inputs.dir(intellijSdkDir)
outputs.file(File(repoDir, "${intellij.name}.ivy.xml"))
}
if (installIntellijUltimate) {
dependsOn(unzipIntellijUltimateSdk)
inputs.dir(intellijUltimateSdkDir)
outputs.file(File(repoDir, "${intellijUltimate.name}.ivy.xml"))
}
val flatDeps = listOf(`intellij-core`, `jps-standalone`, `jps-build-test`)
flatDeps.forEach {
inputs.dir(File(repoDir, it.name))
outputs.file(File(repoDir, "${it.name}.ivy.xml"))
}
inputs.dir(File(repoDir, sources.name))
if (intellijUltimateEnabled) {
dependsOn(unzipNodeJSPlugin)
inputs.dir(File(repoDir, `plugins-NodeJS`.name))
outputs.file(File(repoDir, "${`plugins-NodeJS`.name}.ivy.xml"))
}
doFirst {
val sources = File(repoDir, sources.name).listFiles()
if (installIntellijCommunity) {
val libDir = File(intellijSdkDir, "lib")
writeIvyXml(intellij.name,
intellij.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
*sources)
File(intellijSdkDir, "plugins").listFiles { file: File -> file.isDirectory }.forEach {
writeIvyXml(it.name, "intellij.plugin.${it.name}", files("$it/lib/"), File(it, "lib"), *sources)
}
}
if (installIntellijUltimate) {
val libDir = File(intellijUltimateSdkDir, "lib")
writeIvyXml(intellij.name, // important! the module name should be "intellij"
intellijUltimate.name,
fileTree(libDir).filter {
it.parentFile == libDir && !it.name.startsWith("kotlin-")
},
libDir,
*sources)
File(intellijUltimateSdkDir, "plugins").listFiles { it: File -> it.isDirectory }.forEach {
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), *sources)
}
if (intellijUltimateEnabled) {
val nodeJsBaseDir = "${`plugins-NodeJS`.name}/NodeJS/lib"
writeIvyXml("NodeJS", `plugins-NodeJS`.name, files("$repoDir/$nodeJsBaseDir"), File(repoDir, nodeJsBaseDir), *sources)
}
}
}
val build by tasks.creating {
dependsOn(prepareIvyXmls)
}
val clean by tasks.creating(Delete::class) {
delete(customDepsRepoModulesDir)
delete(buildDir)
}

View File

@@ -11,5 +11,4 @@ pluginManagement {
}
}
include "prepare-deps:android-dx",
"prepare-deps:intellij-sdk"
include "prepare-deps"

View File

@@ -1,15 +0,0 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.Project
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.kotlin.dsl.extra
import java.io.File
fun RepositoryHandler.androidDxJarRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = File("${project.rootDir}/buildSrc/prepare-deps/android-dx/build/repo")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[artifact](-[classifier]).jar")
}
fun Project.androidDxJar() = "kotlin.build.custom.deps:android-dx:${rootProject.extra["versions.androidBuildTools"]}"

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Project

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.tasks.JavaExec

View File

@@ -4,13 +4,17 @@ import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.task
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> javaExec@{
fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> {
configure()
passClasspathInJar()
}
// Moves the classpath into a jar metadata, to shorten the command line length and to avoid hitting the limit on Windows
fun JavaExec.passClasspathInJar() {
val jarTask = project.task("${name}WriteClassPath", Jar::class) {
val classpath = classpath
val main = main
@@ -28,21 +32,16 @@ fun Project.smartJavaExec(configure: JavaExec.() -> Unit) = task<JavaExec> javaE
)
}
}
archiveName = "$main.${this@javaExec.name}.classpath.container.$extension"
archiveName = "$main.${this@passClasspathInJar.name}.classpath.container.$extension"
destinationDir = temporaryDir
}
dependsOn(jarTask)
doFirst {
main = "-jar"
classpath = project.files()
val copyArgs = args.orEmpty().toList()
args(jarTask.outputs.files.singleFile)
args(copyArgs)
args = listOf(jarTask.outputs.files.singleFile.path) + args.orEmpty()
}
}

View File

@@ -73,6 +73,12 @@ fun <T : Jar> Project.runtimeJar(task: T, body: T.() -> Unit = {}): T {
removeArtifacts(configurations.getOrCreate("archives"), defaultJarTask)
}
return task.apply {
configurations.findByName("embedded")?.let { embedded ->
dependsOn(embedded)
from {
embedded.map(::zipTree)
}
}
setupPublicJar(project.the<BasePluginConvention>().archivesBaseName)
setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE)
body()
@@ -121,7 +127,7 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
apply<plugins.PublishedKotlinModule>()
if (artifactsRemovedDiagnosticFlag) {
error("`publish()` should be called before removing artifacts typically done in `noDefaultJar()` of `runtimeJar()` calls")
error("`publish()` should be called before removing artifacts typically done in `noDefaultJar()` or `runtimeJar()` call")
}
afterEvaluate {
@@ -134,27 +140,6 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload {
}
}
fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit): Copy {
val thisProject = this
val pluginTask = task<Copy>("ideaPlugin") {
body()
into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path)
rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "")
}
task("idea-plugin") {
dependsOn(pluginTask)
}
return pluginTask
}
fun Project.ideaPlugin(subdir: String = "lib"): Copy = ideaPlugin(subdir) {
runtimeJarTaskIfExists()?.let {
from(it)
}
}
fun Project.dist(
targetDir: File? = null,
targetName: String? = null,

View File

@@ -0,0 +1,91 @@
import org.gradle.api.Project
import org.gradle.api.initialization.Settings
import org.gradle.api.internal.DynamicObjectAware
import java.io.File
import java.util.*
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
interface PropertiesProvider {
val rootProjectDir: File
fun getProperty(key: String): Any?
}
class KotlinBuildProperties(
private val propertiesProvider: PropertiesProvider
) {
private val localProperties: Properties = Properties()
init {
val localPropertiesFile = propertiesProvider.rootProjectDir.resolve("local.properties")
if (localPropertiesFile.isFile) {
localPropertiesFile.reader().use(localProperties::load)
}
}
private operator fun get(key: String): Any? = localProperties.getProperty(key) ?: propertiesProvider.getProperty(key)
private fun getBoolean(key: String): Boolean = this[key]?.toString() == "true"
val isJpsBuildEnabled: Boolean = getBoolean("jpsBuild")
val isInIdeaSync: Boolean = run {
// "idea.sync.active" was introduced in 2019.1
System.getProperty("idea.sync.active")?.toBoolean() == true || let {
// before 2019.1 there is "idea.active" that was true only on sync,
// but since 2019.1 "idea.active" present in task execution too.
// So let's check Idea version
val majorIdeaVersion = System.getProperty("idea.version")
?.split(".")
?.getOrNull(0)
val isBeforeIdea2019 = majorIdeaVersion == null || majorIdeaVersion.toInt() < 2019
isBeforeIdea2019 && System.getProperty("idea.active")?.toBoolean() == true
}
}
val isInJpsBuildIdeaSync: Boolean
get() = isJpsBuildEnabled && isInIdeaSync
val includeJava9: Boolean
get() = !isInJpsBuildIdeaSync
val useBootstrapStdlib: Boolean
get() = isInJpsBuildIdeaSync
}
private const val extensionName = "kotlinBuildFlags"
class ProjectProperties(val project: Project): PropertiesProvider {
override val rootProjectDir: File
get() = project.projectDir
override fun getProperty(key: String): Any? = project.findProperty(key)
}
val Project.kotlinBuildProperties: KotlinBuildProperties
get() = rootProject.extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(ProjectProperties(rootProject)).also {
rootProject.extensions.add(extensionName, it)
}
class SettingsProperties(val settings: Settings): PropertiesProvider {
override val rootProjectDir: File
get() = settings.rootDir
override fun getProperty(key: String): Any? {
val obj = (settings as DynamicObjectAware).asDynamicObject
return if (obj.hasProperty(key)) obj.getProperty(key) else null
}
}
fun getKotlinBuildPropertiesForSettings(settings: Any) = (settings as Settings).kotlinBuildProperties
val Settings.kotlinBuildProperties: KotlinBuildProperties
get() = extensions.findByName(extensionName) as KotlinBuildProperties?
?: KotlinBuildProperties(SettingsProperties(this)).also {
extensions.add(extensionName, it)
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Action
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.NamedDomainObjectProvider
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.ExternalModuleDependency
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
import org.gradle.kotlin.dsl.accessors.runtime.addExternalModuleDependencyTo
import org.gradle.kotlin.dsl.add
val NamedDomainObjectContainer<Configuration>.embedded: NamedDomainObjectProvider<Configuration> get() = named("embedded")
fun DependencyHandler.embedded(dependencyNotation: Any): Dependency? =
add("embedded", dependencyNotation)
fun DependencyHandler.embedded(
dependencyNotation: String,
dependencyConfiguration: Action<ExternalModuleDependency>
): ExternalModuleDependency =
addDependencyTo(this, "embedded", dependencyNotation, dependencyConfiguration)
fun DependencyHandler.embedded(
group: String,
name: String,
version: String? = null,
configuration: String? = null,
classifier: String? = null,
ext: String? = null,
dependencyConfiguration: Action<ExternalModuleDependency>? = null
): ExternalModuleDependency = addExternalModuleDependencyTo(
this, "embedded", group, name, version, configuration, classifier, ext, dependencyConfiguration
)
fun <T : ModuleDependency> DependencyHandler.embedded(
dependency: T,
dependencyConfiguration: T.() -> Unit
): T = add("embedded", dependency, dependencyConfiguration)

View File

@@ -1,6 +1,6 @@
/*
* Copyright 2000-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.
* Copyright 2000-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package tasks

View File

@@ -1,16 +1,21 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
@file:Suppress("unused")
// usages in build scripts are not tracked properly
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.tasks.AbstractCopyTask
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import java.io.File
val Project.isSnapshotIntellij get() = rootProject.extra["versions.intellijSdk"].toString().endsWith("SNAPSHOT")
val Project.intellijRepo get() = "https://www.jetbrains.com/intellij-repository/" + if (isSnapshotIntellij) "snapshots" else "releases"
fun Project.commonDep(coord: String): String {
val parts = coord.split(':')
@@ -70,16 +75,17 @@ fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir:
fun Project.kotlinDep(artifactBaseName: String, version: String): String = "org.jetbrains.kotlin:kotlin-$artifactBaseName:$version"
val Project.useBootstrapStdlib: Boolean get() =
findProperty("jpsBuild")?.toString() == "true"
fun Project.kotlinStdlib(suffix: String? = null): Any {
return if (useBootstrapStdlib)
return if (kotlinBuildProperties.useBootstrapStdlib)
kotlinDep(listOfNotNull("stdlib", suffix).joinToString("-"), bootstrapKotlinVersion)
else
dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"))
}
fun Project.kotlinBuiltins(): Any =
if (kotlinBuildProperties.useBootstrapStdlib) "org.jetbrains.kotlin:builtins:$bootstrapKotlinVersion"
else dependencies.project(":core:builtins")
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")
@@ -93,6 +99,12 @@ val Project.protobufRepo: String
fun Project.protobufLite(): String = "org.jetbrains.kotlin:protobuf-lite:$protobufVersion"
fun Project.protobufFull(): String = "org.jetbrains.kotlin:protobuf-relocated:$protobufVersion"
val Project.kotlinNativeRepo: String
get() = "https://jetbrains.bintray.com/kotlin-native-dependencies"
val Project.kotlinNativeVersion: String get() = property("versions.kotlin-native") as String
val Project.kotlinNativeSharedVersion: String get() = property("versions.kotlin-native-shared") as String
fun File.matchMaybeVersionedArtifact(baseName: String) = name.matches(baseName.toMaybeVersionedJarRegex())
private val wildcardsRe = """[^*?]+|(\*)|(\?)""".toRegex()
@@ -113,7 +125,6 @@ private fun String.toMaybeVersionedJarRegex(): Regex {
return Regex(if (hasJarExtension) escaped else "$escaped(-\\d.*)?\\.jar") // TODO: consider more precise version part of the 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)
@@ -127,22 +138,5 @@ val compilerManifestClassPath
get() = "annotations-13.0.jar kotlin-stdlib.jar kotlin-reflect.jar kotlin-script-runtime.jar trove4j.jar"
object EmbeddedComponents {
val CONFIGURATION_NAME = "embeddedComponents"
}
fun AbstractCopyTask.fromEmbeddedComponents() {
val embeddedComponents = project.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
if (this is ShadowJar) {
from(embeddedComponents)
} else {
dependsOn(embeddedComponents)
from {
embeddedComponents.map { file ->
if (file.isDirectory)
project.files(file)
else
project.zipTree(file)
}
}
}
val CONFIGURATION_NAME = "embedded"
}

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package idea

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.buildUtils.idea
@@ -75,9 +75,9 @@ open class DistModelBuilder(val rootProject: Project, pw: PrintWriter) {
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)
is Copy -> copy.destinationDir?.also { context.setDest(it.path) }
is Sync -> copy.destinationDir?.also { context.setDest(it.path) }
is AbstractArchiveTask -> copy.archivePath?.also { context.setDest(it.path) }
}
when (copy) {
@@ -100,15 +100,17 @@ open class DistModelBuilder(val rootProject: Project, pw: PrintWriter) {
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
if (ctx.destination != null) {
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)
newCtx.child("SINGE PARENT COPY SPEC") { child ->
it.sourcePaths.forEach {
processSourcePath(it, child)
}
}
}
}

View File

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

View File

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

View File

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

View File

@@ -8,8 +8,8 @@ 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.
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
fun org.gradle.api.Project.idea(configure: org.gradle.plugins.ide.idea.model.IdeaModel.() -> Unit): Unit =

View File

@@ -1,195 +0,0 @@
@file:Suppress("unused")
/*
* Copyright 2010-2017 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.
*/
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ProjectDependency
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.tasks.*
import org.gradle.api.tasks.compile.AbstractCompile
import org.gradle.kotlin.dsl.*
import java.io.File
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,
// however, it causes problems for Kotlin projects:
// The "internal" modifier can be used to restrict access to the same module.
// To make it possible to use internal methods from the main source set in test classes,
// the Kotlin Gradle plugin adds the original output directory of the Java task
// as "friendly directory" which makes it possible to access internal members
// of the main module. Also this directory should be available on classpath during compilation
// This fails when we change the classes dir. The easiest fix is to prepend the
// classes from the "friendly directory" to the compile classpath.
val testCompile = tasks.findByName("compileTestKotlin") as AbstractCompile?
testCompile?.doFirst {
testCompile.classpath = (testCompile.classpath
- mainSourceSet.output.classesDirs
+ files((mainSourceSet as ExtensionAware).extra.get("classesDirsCopy")))
}
}
val instrumentationClasspathCfg = configurations.create("instrumentationClasspath")
dependencies {
instrumentationClasspathCfg(intellijDep()) { includeJars("javac2", "jdom", "asm-all", "jgoodies-forms", rootProject = rootProject) }
}
afterEvaluate {
sourceSets.all { sourceSetParam ->
// This copy will ignore filters, but they are unlikely to be used.
val classesDirs = (sourceSetParam.output.classesDirs as ConfigurableFileCollection).from as Collection<Any>
val classesDirsCopy = project.files(classesDirs.toTypedArray()).filter { it.exists() }
(sourceSetParam as ExtensionAware).extra.set("classesDirsCopy", classesDirsCopy)
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)
instrumentTask.apply {
dependsOn(sourceSetParam.classesTaskName).onlyIf { !classesDirsCopy.isEmpty }
sourceSet = sourceSetParam
instrumentationClasspath = instrumentationClasspathCfg
originalClassesDirs = classesDirsCopy
output = instrumentedClassesDir
}
instrumentTask.outputs.dir(instrumentedClassesDir)
// Ensure that our task is invoked when the source set is built
sourceSetParam.compiledBy(instrumentTask)
@Suppress("UNUSED_EXPRESSION")
true
}
}
}
@CacheableTask
open class IntelliJInstrumentCodeTask : ConventionTask() {
companion object {
private const val FILTER_ANNOTATION_REGEXP_CLASS = "com.intellij.ant.ClassFilterAnnotationRegexp"
private const val LOADER_REF = "java2.loader"
}
var sourceSet: SourceSet? = null
var instrumentationClasspath: Configuration? = null
@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() })
@get:OutputDirectory
lateinit var output: File
@TaskAction
fun instrumentClasses() {
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"
)
}
logger.info("Compiling forms and instrumenting code with nullability preconditions")
if (instrumentNotNull) {
prepareNotNullInstrumenting(classpath.asPath)
}
instrumentCode(sourceDirs, instrumentNotNull)
}
private fun copyOriginalClasses() {
project.copy {
from(originalClassesDirs)
into(output)
}
}
private fun prepareNotNullInstrumenting(classpath: String) {
ant.withGroovyBuilder {
"typedef"(
"name" to "skip",
"classpath" to classpath,
"loaderref" to LOADER_REF,
"classname" to FILTER_ANNOTATION_REGEXP_CLASS
)
}
}
private fun instrumentCode(srcDirs: FileCollection, instrumentNotNull: Boolean) {
val headlessOldValue = System.setProperty("java.awt.headless", "true")
// 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 }
val instrumentationClasspath =
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
) {
if (instrumentNotNull) {
ant.withGroovyBuilder {
"skip"("pattern" to "kotlin/Metadata")
}
}
}
}
if (headlessOldValue != null) {
System.setProperty("java.awt.headless", headlessOldValue)
} else {
System.clearProperty("java.awt.headless")
}
}
}

View File

@@ -1,173 +0,0 @@
/*
* Copyright 2010-2017 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.
*/
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.*
import java.io.File
private fun Project.intellijRepoDir() = File("${project.rootDir.absoluteFile}/buildSrc/prepare-deps/intellij-sdk/build/repo")
fun RepositoryHandler.intellijSdkRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = project.intellijRepoDir()
val intellijEnforceCommunitySdk = project.getBooleanProperty("intellijEnforceCommunitySdk") == true
setUrl(baseDir)
if (!intellijEnforceCommunitySdk) {
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]Ultimate.ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellijUltimate.plugin.[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]Ultimate/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellijUltimate/plugins/[module]/lib/[artifact](-[classifier]).jar")
}
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellij.plugin.[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[revision]/plugins-[module].ivy.xml")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/intellij/plugins/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/plugins-[module]/[module]/lib/[artifact](-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact].jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/[module]/[artifact](-[revision])(-[classifier]).jar")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[revision]/sources/[artifact]-[revision]-[classifier].[ext]")
metadataSources {
ivyDescriptor()
}
}
fun Project.intellijDep(module: String = "intellij") = "kotlin.build.custom.deps:$module:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijCoreDep() = intellijDep("intellij-core")
fun Project.intellijPluginDep(plugin: String) = intellijDep(plugin)
fun Project.intellijUltimateDep() = intellijDep("intellij")
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
}
if (rootProject != null && rootProject.extra.has("versions.jar.$baseName")) {
baseName += "-${rootProject.extra["versions.jar.$baseName"]}"
}
artifact {
name = baseName
type = "jar"
extension = "jar"
}
}
}
// Workaround. Top-level Kotlin function in a default package can't be called from a non-default package
object IntellijRootUtils {
fun getRepositoryRootDir(project: Project): File = with (project.rootProject) {
return File(intellijRepoDir(), "kotlin.build.custom.deps/${extra["versions.intellijSdk"]}")
}
fun getIntellijRootDir(project: Project): File = with (project.rootProject) {
return File(getRepositoryRootDir(this), "intellij${if (isIntellijCommunityAvailable()) "" else "Ultimate"}")
}
}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).toTypedArray(), rootProject = project.rootProject)
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilterPredicate: (String) -> Boolean) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).filter { jarsFilterPredicate(it) }.toTypedArray(), rootProject = project.rootProject)
fun Project.isIntellijCommunityAvailable() = !(rootProject.extra["intellijUltimateEnabled"] as Boolean) || rootProject.extra["intellijSeparateSdks"] as Boolean
fun Project.isIntellijUltimateSdkAvailable() = (rootProject.extra["intellijUltimateEnabled"] as Boolean)
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
fun Project.intellijUltimateRootDir() =
if (isIntellijUltimateSdkAvailable())
File(intellijRepoDir(), "kotlin.build.custom.deps/${rootProject.extra["versions.intellijSdk"]}/intellijUltimate")
else
throw GradleException("intellij ultimate SDK is not available")
fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
if (!rootProject.extra.has("versions.androidStudioRelease")) {
block()
}
}
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): JavaExec {
return task<JavaExec>(name) {
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
classpath = mainSourceSet.runtimeClasspath
main = "com.intellij.idea.Main"
workingDir = File(intellijRootDir(), "bin")
jvmArgs(
"-Xmx1250m",
"-XX:ReservedCodeCacheSize=240m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-ea",
"-Didea.is.internal=true",
"-Didea.debug.mode=true",
"-Didea.system.path=$ideaSandboxDir",
"-Didea.config.path=$ideaSandboxConfigDir",
"-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (rootProject.findProperty("versions.androidStudioRelease") != null) {
jvmArgs("-Didea.platform.prefix=AndroidStudio")
}
if (project.hasProperty("noPCE")) {
jvmArgs("-Didea.ProcessCanceledException=disabled")
}
args()
doFirst {
val disabledPluginsFile = File(ideaSandboxConfigDir, "disabled_plugins.txt")
val disabledPluginsContents = disabledPluginsFile.takeIf { it.isFile }?.readLines()
val filteredContents = disabledPluginsContents?.filterNot { it.contains("org.jetbrains.kotlin") }
if (filteredContents != null && filteredContents.size != disabledPluginsContents.size) {
with(disabledPluginsFile.printWriter()) {
filteredContents.forEach(this::println)
}
}
}
body()
}
}

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import org.gradle.api.Project

View File

@@ -0,0 +1,206 @@
/*
* Copyright 2010-2017 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.
*/
// usages in build scripts are not tracked properly
@file:Suppress("unused")
import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.artifacts.repositories.IvyArtifactRepository
import org.gradle.api.tasks.JavaExec
import org.gradle.kotlin.dsl.*
import java.io.File
private fun Project.kotlinBuildLocalRepoDir() = File("${project.rootDir.absoluteFile}/dependencies/repo")
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> "android-studio-ide"
Ide.Kind.IntelliJ -> {
if (getBooleanProperty("intellijUltimateEnabled") == true) "ideaIU" else "ideaIC"
}
}
private fun Project.ideModuleVersion() = when (IdeVersionConfigurator.currentIde.kind) {
Ide.Kind.AndroidStudio -> rootProject.findProperty("versions.androidStudioBuild")
Ide.Kind.IntelliJ -> rootProject.findProperty("versions.intellijSdk")
}
fun RepositoryHandler.kotlinBuildLocalRepo(project: Project): IvyArtifactRepository = ivy {
val baseDir = project.kotlinBuildLocalRepoDir()
setUrl(baseDir)
ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/ivy/[module].ivy.xml")
ivyPattern("${baseDir.canonicalPath}/[organisation]/${project.ideModuleName()}/[revision]/ivy/[module].ivy.xml") // bundled plugins
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/artifacts/lib/[artifact](-[classifier]).[ext]")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/artifacts/[artifact](-[classifier]).[ext]")
artifactPattern("${baseDir.canonicalPath}/[organisation]/${project.ideModuleName()}/[revision]/artifacts/plugins/[module]/lib/[artifact](-[classifier]).[ext]") // bundled plugins
artifactPattern("${baseDir.canonicalPath}/[organisation]/sources/[artifact]-[revision](-[classifier]).[ext]")
artifactPattern("${baseDir.canonicalPath}/[organisation]/[module]/[revision]/[artifact](-[classifier]).[ext]")
metadataSources {
ivyDescriptor()
}
}
fun Project.intellijDep(module: String? = null) = "kotlin.build:${module ?: ideModuleName()}:${ideModuleVersion()}"
fun Project.intellijCoreDep() = "kotlin.build:intellij-core:${rootProject.extra["versions.intellijSdk"]}"
fun Project.jpsStandalone() = "kotlin.build:jps-standalone:${rootProject.extra["versions.intellijSdk"]}"
fun Project.nodeJSPlugin() = "kotlin.build:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}"
fun Project.androidDxJar() = "kotlin.build:android-dx:${rootProject.extra["versions.androidBuildTools"]}"
fun Project.jpsBuildTest() = "com.jetbrains.intellij.idea:jps-build-test:${rootProject.extra["versions.intellijSdk"]}"
/**
* Runtime version of annotations that are already in Kotlin stdlib (historically Kotlin has older version of this one).
*
* SHOULD NOT BE USED IN COMPILE CLASSPATH!
*
* `@NonNull`, `@Nullabe` from `idea/annotations.jar` has `TYPE` target which leads to different types treatment in Kotlin compiler.
* On the other hand, `idea/annotations.jar` contains org/jetbrains/annotations/Async annations which is required for IDEA debugger.
*
* So, we are excluding `annotaions.jar` from all other `kotlin.build` and using this one for runtime only
* to avoid accidentally including `annotations.jar` by calling `intellijDep()`.
*/
fun Project.intellijRuntimeAnnotations() = "kotlin.build:intellij-runtime-annotations:${rootProject.extra["versions.intellijSdk"]}"
fun Project.intellijPluginDep(plugin: String) = intellijDep(plugin)
fun Project.intellijUltimateDep() = intellijDep("ideaIU")
fun Project.intellijUltimatePluginDep(plugin: String) = intellijDep(plugin)
fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = null) {
names.forEach {
var baseName = it.removeSuffix(".jar")
if (rootProject != null && rootProject.extra.has("ignore.jar.$baseName")) {
return@forEach
}
if (rootProject != null && rootProject.extra.has("versions.jar.$baseName")) {
baseName += "-${rootProject.extra["versions.jar.$baseName"]}"
}
artifact {
name = baseName
type = "jar"
extension = "jar"
}
}
}
// Workaround. Top-level Kotlin function in a default package can't be called from a non-default package
object IntellijRootUtils {
fun getRepositoryRootDir(project: Project): File = with(project.rootProject) {
return File(kotlinBuildLocalRepoDir(), "kotlin.build")
}
fun getIntellijRootDir(project: Project): File = with(project.rootProject) {
return File(
getRepositoryRootDir(this),
"${ideModuleName()}/${ideModuleVersion()}/artifacts"
)
}
}
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project) =
includeJars(*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).toTypedArray(), rootProject = project.rootProject)
fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFilterPredicate: (String) -> Boolean) =
includeJars(
*(project.rootProject.extra["IntellijCoreDependencies"] as List<String>).filter { jarsFilterPredicate(it) }.toTypedArray(),
rootProject = project.rootProject
)
fun Project.isIntellijCommunityAvailable() =
!(rootProject.extra["intellijUltimateEnabled"] as Boolean) || rootProject.extra["intellijSeparateSdks"] as Boolean
fun Project.isIntellijUltimateSdkAvailable() = (rootProject.extra["intellijUltimateEnabled"] as Boolean)
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
fun Project.intellijUltimateRootDir() =
if (isIntellijUltimateSdkAvailable())
File(kotlinBuildLocalRepoDir(), "kotlin.build/ideaIU/${rootProject.extra["versions.intellijSdk"]}/artifacts")
else
throw GradleException("intellij ultimate SDK is not available")
fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
if (!rootProject.extra.has("versions.androidStudioRelease")) {
block()
}
}
fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File, body: JavaExec.() -> Unit): JavaExec {
return task<JavaExec>(name) {
val ideaSandboxConfigDir = File(ideaSandboxDir, "config")
classpath = mainSourceSet.runtimeClasspath
main = "com.intellij.idea.Main"
workingDir = File(intellijRootDir(), "bin")
jvmArgs(
"-Xmx1250m",
"-XX:ReservedCodeCacheSize=240m",
"-XX:+HeapDumpOnOutOfMemoryError",
"-ea",
"-Didea.debug.mode=true",
"-Didea.system.path=$ideaSandboxDir",
"-Didea.config.path=$ideaSandboxConfigDir",
"-Dapple.laf.useScreenMenuBar=true",
"-Dapple.awt.graphics.UseQuartz=true",
"-Dsun.io.useCanonCaches=false",
"-Dplugin.path=${ideaPluginDir.absolutePath}"
)
if (rootProject.findProperty("versions.androidStudioRelease") != null) {
jvmArgs("-Didea.platform.prefix=AndroidStudio")
}
if (project.hasProperty("noPCE")) {
jvmArgs("-Didea.ProcessCanceledException=disabled")
}
jvmArgs("-Didea.is.internal=${project.findProperty("idea.is.internal") ?: true}")
project.findProperty("idea.args")?.let { arguments ->
jvmArgs(arguments.toString().split(" "))
}
args()
doFirst {
val disabledPluginsFile = File(ideaSandboxConfigDir, "disabled_plugins.txt")
val disabledPluginsContents = disabledPluginsFile.takeIf { it.isFile }?.readLines()
val filteredContents = disabledPluginsContents?.filterNot { it.contains("org.jetbrains.kotlin") }
if (filteredContents != null && filteredContents.size != disabledPluginsContents.size) {
with(disabledPluginsFile.printWriter()) {
filteredContents.forEach(this::println)
}
}
}
body()
}
}

View File

@@ -2,27 +2,30 @@
package org.jetbrains.kotlin.pill
import org.gradle.api.artifacts.*
import org.gradle.api.artifacts.component.*
class DependencyMapper(
val predicate: (ResolvedDependency) -> Boolean,
vararg val configurations: String,
val mapping: (ResolvedDependency) -> MappedDependency?
) {
constructor(
group: String,
module: String,
vararg configurations: String,
version: String? = null,
mapping: (ResolvedDependency) -> MappedDependency?
) : this(
{ dep ->
dep.moduleGroup == group
&& dep.moduleName == module
&& (version == null || dep.moduleVersion == version)
},
configurations = *configurations,
mapping = mapping
)
class DependencyMapper(val predicate: (ResolvedArtifact) -> Boolean, val mapping: (ResolvedArtifact) -> MappedDependency?) {
companion object {
fun forProject(path: String, mapping: (ResolvedArtifact) -> MappedDependency?): DependencyMapper {
return DependencyMapper(
predicate = { artifact ->
val identifier = artifact.id.componentIdentifier as? ProjectComponentIdentifier
identifier?.projectPath == path
},
mapping = mapping
)
}
fun forModule(group: String, module: String, version: String?, mapping: (ResolvedArtifact) -> MappedDependency?): DependencyMapper {
return DependencyMapper(
predicate = { artifact ->
val identifier = artifact.id.componentIdentifier as? ModuleComponentIdentifier
identifier?.group == group && identifier?.module == module && (version == null || identifier?.version == version)
},
mapping = mapping
)
}
}
}
class MappedDependency(val main: PDependency?, val deferred: List<PDependency> = emptyList())

View File

@@ -0,0 +1,94 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("PackageDirectoryMismatch")
package org.jetbrains.kotlin.pill
import java.io.File
import org.gradle.api.Project
import org.gradle.api.tasks.SourceSet
import org.gradle.api.artifacts.*
import org.gradle.api.artifacts.component.*
data class PDependencies(val main: List<PDependency>, val deferred: List<PDependency>) {
fun join(): List<PDependency> {
return main + deferred
}
}
fun Project.resolveDependencies(
configuration: Configuration,
forTests: Boolean,
dependencyMappers: List<DependencyMapper>,
withEmbedded: Boolean = false
): PDependencies {
val dependencies = mutableListOf<PDependency>()
val deferred = mutableListOf<PDependency>()
nextArtifact@ for (artifact in configuration.resolvedConfiguration.resolvedArtifacts) {
val identifier = artifact.id.componentIdentifier
for (mapper in dependencyMappers) {
if (mapper.predicate(artifact)) {
val mapped = mapper.mapping(artifact)
if (mapped != null) {
mapped.main?.let { dependencies += it }
deferred += mapped.deferred
}
continue@nextArtifact
}
}
fun addProjectDependency(projectPath: String) {
val project = rootProject.findProject(projectPath) ?: error("Cannot find project $projectPath")
fun addSourceSet(name: String, suffix: String): Boolean {
val sourceSet = project.sourceSets?.findByName(name)?.takeIf { !it.allSource.isEmpty() } ?: return false
dependencies += PDependency.Module(project.pillModuleName + '.' + suffix)
return true
}
if (forTests && artifact.classifier == "tests") {
addSourceSet(SourceSet.TEST_SOURCE_SET_NAME, "test") || addSourceSet(SourceSet.MAIN_SOURCE_SET_NAME, "src")
} else {
addSourceSet(SourceSet.MAIN_SOURCE_SET_NAME, "src")
}
if (withEmbedded) {
val embeddedConfiguration = project.configurations.findByName(EmbeddedComponents.CONFIGURATION_NAME)
if (embeddedConfiguration != null) {
dependencies += resolveDependencies(embeddedConfiguration, forTests, dependencyMappers, withEmbedded).join()
}
}
}
when (identifier) {
is ProjectComponentIdentifier -> addProjectDependency(identifier.projectPath)
is LibraryBinaryIdentifier -> addProjectDependency(identifier.projectPath)
is ModuleComponentIdentifier -> {
val file = artifact.file
val library = PLibrary(file.name, classes = listOf(file))
dependencies += PDependency.ModuleLibrary(library)
}
}
}
val existingFiles = mutableSetOf<File>()
for (dependency in configuration.dependencies) {
if (dependency !is SelfResolvingDependency) {
continue
}
val files = dependency.resolve().filter { it !in existingFiles }.takeIf { it.isNotEmpty() } ?: continue
existingFiles.addAll(files)
val library = PLibrary(dependency.name, classes = files.toList())
deferred += PDependency.ModuleLibrary(library)
}
return PDependencies(dependencies, deferred)
}

View File

@@ -5,6 +5,7 @@ package org.jetbrains.kotlin.pill
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.internal.file.copy.SingleParentCopySpec
import org.gradle.api.plugins.JavaPlugin
import org.gradle.api.tasks.Copy
@@ -34,6 +35,10 @@ sealed class ArtifactElement {
myChildren += child
}
fun add(children: List<ArtifactElement>) {
myChildren += children
}
abstract fun render(context: PathContext): xml
fun renderRecursively(context: PathContext): xml {
@@ -102,99 +107,37 @@ sealed class ArtifactElement {
}
}
fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
val mainIdeaPluginTask = rootProject.tasks.getByName("ideaPlugin")
val gradleArtifactDir = File(rootProject.extra["ideaPluginDir"] as File, "lib")
val ideaPluginTasks = mainIdeaPluginTask.taskDependencies
.getDependencies(mainIdeaPluginTask)
.filter { it.name == "ideaPlugin" }
.filterIsInstance<Copy>()
fun generateKotlinPluginArtifactFile(rootProject: Project, dependencyMappers: List<DependencyMapper>): PFile {
val root = Root()
// Copy kotlinc directory
fun Project.getProject(name: String) = findProject(name) ?: error("Cannot find project $name")
val prepareIdeaPluginProject = rootProject.getProject(":prepare:idea-plugin")
root.add(Directory("kotlinc").apply {
val kotlincDirectory = rootProject.extra["distKotlinHomeDir"].toString()
add(DirectoryCopy(File(kotlincDirectory)))
})
for (task in ideaPluginTasks) {
val spec = task.rootSpec.children.filterIsInstance<SingleParentCopySpec>().singleOrNull()
?: error("Copy spec is not unique in ${rootProject.name}. Available specs: ${task.rootSpec.children}")
root.add(Directory("lib").apply {
val librariesConfiguration = prepareIdeaPluginProject.configurations.getByName("libraries")
add(getArtifactElements(rootProject, librariesConfiguration, dependencyMappers, false))
val sourcePaths = spec.sourcePaths
for (sourcePath in sourcePaths) {
if (sourcePath is ShadowJar) {
if (sourcePath.project.path == ":prepare:idea-plugin") {
val kotlinPluginJar = Archive(sourcePath.archiveName).also { root.getDirectory("lib").add(it) }
add(Directory("jps").apply {
val prepareJpsPluginProject = rootProject.getProject(":kotlin-jps-plugin")
add(Archive(prepareJpsPluginProject.name + ".jar").apply {
val jpsPluginConfiguration = prepareIdeaPluginProject.configurations.getByName("jpsPlugin")
add(getArtifactElements(rootProject, jpsPluginConfiguration, dependencyMappers, true))
})
})
kotlinPluginJar.add(FileCopy(File(rootProject.projectDir, "resources/kotlinManifest.properties")))
add(Archive("kotlin-plugin.jar").apply {
add(FileCopy(File(rootProject.projectDir, "resources/kotlinManifest.properties")))
for (jarFile in sourcePath.project.configurations.getByName("packedJars").resolve()) {
kotlinPluginJar.add(ExtractedDirectory(jarFile))
}
@Suppress("UNCHECKED_CAST")
for (projectPath in sourcePath.project.extra["projectsToShadow"] as List<String>) {
val jpsModuleName = rootProject.findProject(projectPath)!!.name + ".src"
kotlinPluginJar.add(ModuleOutput(jpsModuleName))
}
continue
}
}
fun fileCopySnapshotAware(file: File): FileCopy {
val SHAPSHOT_JAR_SUFFIX = "-SNAPSHOT.jar"
if (file.name.endsWith(SHAPSHOT_JAR_SUFFIX)) {
return FileCopy(file, file.name.dropLast(SHAPSHOT_JAR_SUFFIX.length).substringBeforeLast("-") + ".jar")
}
return FileCopy(file)
}
when (sourcePath) {
is Jar -> {
val targetDir = ("lib/" + task.destinationDir.toRelativeString(gradleArtifactDir)).withoutSlash()
val archiveForJar = Archive(sourcePath.project.name + ".jar").apply {
if (task.project.plugins.hasPlugin(JavaPlugin::class.java)) {
add(ModuleOutput(sourcePath.project.name + ".src"))
}
root.getDirectory(targetDir).add(this)
}
val embeddedComponents = sourcePath.project.configurations
.findByName(EmbeddedComponents.CONFIGURATION_NAME)?.resolvedConfiguration
if (embeddedComponents != null) {
val configuration = CollectedConfiguration(embeddedComponents, Scope.COMPILE)
for (dependencyInfo in listOf(configuration).collectDependencies()) {
val dependency = (dependencyInfo as? DependencyInfo.ResolvedDependencyInfo)?.dependency ?: continue
if (dependency.isModuleDependency) {
archiveForJar.add(ModuleOutput(dependency.moduleName + ".src"))
} else if (dependency.configuration == "tests-jar" || dependency.configuration == "jpsTest") {
error("Test configurations are not allowed here")
} else {
for (file in dependency.moduleArtifacts.map { it.file }) {
archiveForJar.add(ExtractedDirectory(file))
}
}
}
}
}
is Configuration -> {
require(sourcePath.name == "sideJars") { "Configurations other than 'sideJars' are not supported" }
for (file in sourcePath.resolve()) {
root.getDirectory("lib").add(fileCopySnapshotAware(file))
}
}
else -> error("${task.name} Unexpected task type ${task.javaClass.name}")
}
}
}
val embeddedConfiguration = prepareIdeaPluginProject.configurations.getByName(EmbeddedComponents.CONFIGURATION_NAME)
add(getArtifactElements(rootProject, embeddedConfiguration, dependencyMappers, true))
})
})
val artifact = PArtifact("KotlinPlugin", File(rootProject.projectDir, "out/artifacts/Kotlin"), root)
return PFile(
@@ -203,3 +146,36 @@ fun generateKotlinPluginArtifactFile(rootProject: Project): PFile {
)
}
private fun getArtifactElements(
rootProject: Project,
configuration: Configuration,
dependencyMappers: List<DependencyMapper>,
extractDependencies: Boolean
): List<ArtifactElement> {
val dependencies = rootProject.resolveDependencies(configuration, false, dependencyMappers, withEmbedded = true).join()
val artifacts = mutableListOf<ArtifactElement>()
for (dependency in dependencies) {
when (dependency) {
is PDependency.Module -> {
val moduleOutput = ModuleOutput(dependency.name)
if (extractDependencies) {
artifacts += moduleOutput
} else {
artifacts += Archive(dependency.name + ".jar").apply {
add(moduleOutput)
}
}
}
is PDependency.Library -> artifacts += ProjectLibrary(dependency.name)
is PDependency.ModuleLibrary -> {
val files = dependency.library.classes
artifacts += files.map(if (extractDependencies) ::ExtractedDirectory else ::FileCopy)
}
}
}
return artifacts
}

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("PackageDirectoryMismatch")
@@ -33,13 +33,11 @@ data class PProject(
data class PModule(
val name: String,
val bundleName: String,
val rootDirectory: File,
val moduleFile: File,
val contentRoots: List<PContentRoot>,
val orderRoots: List<POrderRoot>,
val moduleForProductionSources: PModule? = null,
val group: String? = null
val moduleForProductionSources: PModule? = null
)
data class PContentRoot(
@@ -64,8 +62,6 @@ data class PSourceRootKotlinOptions(
val apiVersion: String?,
val languageVersion: String?,
val jvmTarget: String?,
val addCompilerBuiltIns: Boolean?,
val loadBuiltInsFromDependencies: Boolean?,
val extraArguments: List<String>
) {
fun intersect(other: PSourceRootKotlinOptions) = PSourceRootKotlinOptions(
@@ -75,8 +71,6 @@ data class PSourceRootKotlinOptions(
if (apiVersion == other.apiVersion) apiVersion else null,
if (languageVersion == other.languageVersion) languageVersion else null,
if (jvmTarget == other.jvmTarget) jvmTarget else null,
if (addCompilerBuiltIns == other.addCompilerBuiltIns) addCompilerBuiltIns else null,
if (loadBuiltInsFromDependencies == other.loadBuiltInsFromDependencies) loadBuiltInsFromDependencies else null,
extraArguments.intersect(other.extraArguments).toList()
)
}
@@ -102,7 +96,8 @@ data class PLibrary(
val javadoc: List<File> = emptyList(),
val sources: List<File> = emptyList(),
val annotations: List<File> = emptyList(),
val dependencies: List<PLibrary> = emptyList()
val dependencies: List<PLibrary> = emptyList(),
val originalName: String = name
) {
fun attachSource(file: File): PLibrary {
return this.copy(sources = this.sources + listOf(file))
@@ -135,7 +130,7 @@ fun parse(project: Project, libraries: List<PLibrary>, context: ParserContext):
*/
private val CONFIGURATION_MAPPING = mapOf(
listOf("runtime") to Scope.RUNTIME,
listOf("compile") to Scope.COMPILE,
listOf("compile", "embedded") to Scope.COMPILE,
listOf("compileOnly") to Scope.PROVIDED
)
@@ -162,7 +157,7 @@ private fun ParserContext.parseModules(project: Project, excludedProjects: List<
var productionSourcesModule: PModule? = null
fun getModuleFile(suffix: String = ""): File {
val relativePath = File(project.projectDir, project.name + suffix + ".iml")
val relativePath = File(project.projectDir, project.pillModuleName + suffix + ".iml")
.toRelativeString(project.rootProject.projectDir)
return File(project.rootProject.projectDir, ".idea/modules/$relativePath")
@@ -177,13 +172,12 @@ private fun ParserContext.parseModules(project: Project, excludedProjects: List<
var dependencies = parseDependencies(project, mainRoot.forTests)
if (productionContentRoots.isNotEmpty() && mainRoot.forTests) {
val productionModuleDependency = PDependency.Module(project.name + ".src")
val productionModuleDependency = PDependency.Module(project.pillModuleName + ".src")
dependencies += POrderRoot(productionModuleDependency, Scope.COMPILE, true)
}
val module = PModule(
project.name + nameSuffix,
project.name,
project.pillModuleName + nameSuffix,
mainRoot.path,
getModuleFile(nameSuffix),
roots,
@@ -199,13 +193,12 @@ private fun ParserContext.parseModules(project: Project, excludedProjects: List<
}
val mainModuleFileRelativePath = when (project) {
project.rootProject -> File(project.rootProject.projectDir, project.name + ".iml")
project.rootProject -> File(project.rootProject.projectDir, project.rootProject.name + ".iml")
else -> getModuleFile()
}
modules += PModule(
project.name,
project.name,
project.pillModuleName,
project.projectDir,
mainModuleFileRelativePath,
listOf(PContentRoot(project.projectDir, false, emptyList(), allExcludedDirs)),
@@ -242,9 +235,9 @@ private fun parseSourceRoots(project: Project): List<PSourceRoot> {
val sourceRoots = mutableListOf<PSourceRoot>()
for (sourceSet in project.sourceSets) {
for (sourceSet in (project.sourceSets ?: emptyList())) {
val kotlinCompileTask = kotlinTasksBySourceSet[sourceSet.name]
val kind = if (sourceSet.name == SourceSet.TEST_SOURCE_SET_NAME) Kind.TEST else Kind.PRODUCTION
val kind = if (sourceSet.isTestSourceSet) Kind.TEST else Kind.PRODUCTION
fun Any.getKotlin(): SourceDirectorySet {
val kotlinMethod = javaClass.getMethod("getKotlin")
@@ -298,9 +291,8 @@ private fun parseSourceRoots(project: Project): List<PSourceRoot> {
private fun parseResourceRootsProcessedByProcessResourcesTask(project: Project, sourceSet: SourceSet): List<PSourceRoot> {
val isMainSourceSet = sourceSet.name == SourceSet.MAIN_SOURCE_SET_NAME
val isTestSourceSet = sourceSet.name == SourceSet.TEST_SOURCE_SET_NAME
val resourceRootKind = if (isTestSourceSet) PSourceRoot.Kind.TEST_RESOURCES else PSourceRoot.Kind.RESOURCES
val resourceRootKind = if (sourceSet.isTestSourceSet) PSourceRoot.Kind.TEST_RESOURCES else PSourceRoot.Kind.RESOURCES
val taskNameBase = "processResources"
val taskName = if (isMainSourceSet) taskNameBase else sourceSet.name + taskNameBase.capitalize()
val task = project.tasks.findByName(taskName) as? ProcessResources ?: return emptyList()
@@ -319,20 +311,26 @@ private fun parseResourceRootsProcessedByProcessResourcesTask(project: Project,
return roots.map { PSourceRoot(it, resourceRootKind, null) }
}
private val SourceSet.isTestSourceSet: Boolean
get() = name == SourceSet.TEST_SOURCE_SET_NAME
|| name.endsWith("Test")
|| name.endsWith("Tests")
private fun getKotlinOptions(kotlinCompileTask: Any): PSourceRootKotlinOptions? {
val compileArguments = kotlinCompileTask.invokeInternal("getSerializedCompilerArguments") as List<String>
val compileArguments = run {
val method = kotlinCompileTask::class.java.getMethod("getSerializedCompilerArguments")
method.isAccessible = true
method.invoke(kotlinCompileTask) as List<String>
}
fun parseBoolean(name: String) = compileArguments.contains("-$name")
fun parseString(name: String) = compileArguments.dropWhile { it != "-$name" }.drop(1).firstOrNull()
val addCompilerBuiltins = "Xadd-compiler-builtins"
val loadBuiltinsFromDependencies = "Xload-builtins-from-dependencies"
fun isOptionForScriptingCompilerPlugin(option: String)
= option.startsWith("-Xplugin=") && option.contains("kotlin-scripting-compiler")
val extraArguments = compileArguments.filter {
it.startsWith("-X") && !isOptionForScriptingCompilerPlugin(it)
&& it != "-$addCompilerBuiltins" && it != "-$loadBuiltinsFromDependencies"
}
return PSourceRootKotlinOptions(
@@ -342,8 +340,6 @@ private fun getKotlinOptions(kotlinCompileTask: Any): PSourceRootKotlinOptions?
parseString("api-version"),
parseString("language-version"),
parseString("jvm-target"),
parseBoolean(addCompilerBuiltins),
parseBoolean(loadBuiltinsFromDependencies),
extraArguments
)
}
@@ -361,93 +357,25 @@ private fun Any.invokeInternal(name: String, instance: Any = this): Any? {
}
private fun ParserContext.parseDependencies(project: Project, forTests: Boolean): List<POrderRoot> {
val configurations = project.configurations
val configurationMapping = if (forTests) TEST_CONFIGURATION_MAPPING else CONFIGURATION_MAPPING
with(project.configurations) {
val mainRoots = mutableListOf<POrderRoot>()
val deferredRoots = mutableListOf<POrderRoot>()
val mainRoots = mutableListOf<POrderRoot>()
val deferredRoots = mutableListOf<POrderRoot>()
fun collectConfigurations(): List<CollectedConfiguration> {
val configurations = mutableListOf<CollectedConfiguration>()
for ((configurationNames, scope) in configurationMapping) {
for (configurationName in configurationNames) {
val configuration = findByName(configurationName)?.also { it.resolve() } ?: continue
val extraDependencies = resolveExtraDependencies(configuration)
configurations += CollectedConfiguration(configuration.resolvedConfiguration, scope, extraDependencies)
}
}
return configurations
for ((configurationNames, scope) in configurationMapping) {
for (configurationName in configurationNames) {
val configuration = configurations.findByName(configurationName) ?: continue
val (main, deferred) = project.resolveDependencies(configuration, forTests, dependencyMappers)
mainRoots += main.map { POrderRoot(it, scope) }
deferredRoots += deferred.map { POrderRoot(it, scope) }
}
nextDependency@ for (dependencyInfo in collectConfigurations().collectDependencies()) {
val scope = dependencyInfo.scope
if (dependencyInfo is DependencyInfo.CustomDependencyInfo) {
val files = dependencyInfo.files
val library = PLibrary(files.firstOrNull()?.nameWithoutExtension ?: "unnamed", classes = files)
mainRoots += POrderRoot(PDependency.ModuleLibrary(library), scope)
continue
}
val dependency = (dependencyInfo as DependencyInfo.ResolvedDependencyInfo).dependency
for (mapper in dependencyMappers) {
if (dependency.configuration in mapper.configurations && mapper.predicate(dependency)) {
val mappedDependency = mapper.mapping(dependency)
if (mappedDependency != null) {
val mainDependency = mappedDependency.main
if (mainDependency != null) {
mainRoots += POrderRoot(mainDependency, scope)
}
for (deferredDep in mappedDependency.deferred) {
deferredRoots += POrderRoot(deferredDep, scope)
}
}
continue@nextDependency
}
}
mainRoots += if (dependency.isModuleDependency && scope != Scope.TEST) {
POrderRoot(PDependency.Module(dependency.moduleName + ".src"), scope)
} else if (dependency.configuration == "tests-jar" || dependency.configuration == "jpsTest") {
POrderRoot(
PDependency.Module(dependency.moduleName + ".test"),
scope,
isProductionOnTestDependency = true
)
} else {
val classes = dependency.moduleArtifacts.map { it.file }
val library = PLibrary(dependency.moduleName, classes)
POrderRoot(PDependency.ModuleLibrary(library), scope)
}
}
return removeDuplicates(mainRoots + deferredRoots)
}
return removeDuplicates(mainRoots + deferredRoots)
}
private fun resolveExtraDependencies(configuration: Configuration): List<File> {
return configuration.dependencies
.filterIsInstance<SelfResolvingDependency>()
.map { it.resolve() }
.filter { isGradleApiDependency(it) }
.flatMap { it }
}
private fun isGradleApiDependency(files: Iterable<File>): Boolean {
return listOf("gradle-api", "groovy-all").all { dep ->
files.any { it.extension == "jar" && it.name.startsWith("$dep-") }
}
}
private fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
val dependenciesByScope = roots.groupBy { it.scope }.mapValues { it.value.mapTo(mutableSetOf()) { it.dependency } }
fun dependenciesFor(scope: Scope) = dependenciesByScope[scope] ?: emptySet<PDependency>()
@@ -480,59 +408,11 @@ private fun removeDuplicates(roots: List<POrderRoot>): List<POrderRoot> {
return result.toList()
}
data class CollectedConfiguration(
val configuration: ResolvedConfiguration,
val scope: Scope,
val extraDependencies: List<File> = emptyList())
val Project.pillModuleName: String
get() = path.removePrefix(":").replace(':', '.')
sealed class DependencyInfo(val scope: Scope) {
class ResolvedDependencyInfo(scope: Scope, val dependency: ResolvedDependency) : DependencyInfo(scope)
class CustomDependencyInfo(scope: Scope, val files: List<File>) : DependencyInfo(scope)
}
val ResolvedDependency.isModuleDependency
get() = configuration in JpsCompatiblePlugin.MODULE_CONFIGURATIONS
fun List<CollectedConfiguration>.collectDependencies(): List<DependencyInfo> {
val dependencies = mutableListOf<DependencyInfo>()
val unprocessed = LinkedList<DependencyInfo>()
val existing = mutableSetOf<Pair<Scope, ResolvedDependency>>()
for ((configuration, scope, extraDependencies) in this) {
for (dependency in configuration.firstLevelModuleDependencies) {
unprocessed += DependencyInfo.ResolvedDependencyInfo(scope, dependency)
}
if (!extraDependencies.isEmpty()) {
unprocessed += DependencyInfo.CustomDependencyInfo(scope, extraDependencies)
}
}
while (unprocessed.isNotEmpty()) {
val info = unprocessed.removeAt(0)
dependencies += info
info as? DependencyInfo.ResolvedDependencyInfo ?: continue
val data = Pair(info.scope, info.dependency)
existing += data
for (child in info.dependency.children) {
if (Pair(info.scope, child) in existing) {
continue
}
unprocessed += DependencyInfo.ResolvedDependencyInfo(info.scope, child)
}
}
return dependencies
}
private val Project.sourceSets: SourceSetContainer
val Project.sourceSets: SourceSetContainer?
get() {
lateinit var result: SourceSetContainer
project.configure<JavaPluginConvention> { result = sourceSets }
return result
val convention = project.convention.findPlugin(JavaPluginConvention::class.java) ?: return null
return convention.sourceSets
}

View File

@@ -13,51 +13,37 @@ import java.io.File
class PillConfigurablePlugin : Plugin<Project> {
override fun apply(project: Project) {
project.configurations.create(EmbeddedComponents.CONFIGURATION_NAME)
project.configurations.maybeCreate(EmbeddedComponents.CONFIGURATION_NAME)
project.extensions.create("pill", PillExtension::class.java)
}
}
class JpsCompatiblePlugin : Plugin<Project> {
companion object {
val MODULE_CONFIGURATIONS = arrayOf("apiElements", "runtimeElements")
private fun mapper(module: String, vararg configurations: String): DependencyMapper {
return DependencyMapper("org.jetbrains.kotlin", module, *configurations) { MappedDependency(PDependency.Library(module)) }
}
private fun getDependencyMappers(projectLibraries: List<PLibrary>): List<DependencyMapper> {
val mappersForKotlinLibrariesExeptStdlib = projectLibraries
.filter { it.name != "kotlin-stdlib" }
.mapTo(mutableListOf()) { mapper(it.name, "default", "distJar", *MODULE_CONFIGURATIONS) }
.map { DependencyMapper.forProject(it.originalName) { MappedDependency(PDependency.Library(it.name)) } }
return mappersForKotlinLibrariesExeptStdlib + listOf(
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib", "distJar", *MODULE_CONFIGURATIONS) {
val disabledModuleMappers = listOf(
":kotlin-stdlib-common",
":core:builtins",
":kotlin-compiler",
":kotlin-compiler-embeddable",
":kotlin-test:kotlin-test-common",
":kotlin-test:kotlin-test-annotations-common"
).map { DependencyMapper.forProject(it) { null } }
return listOf(
DependencyMapper.forProject(":kotlin-stdlib") {
MappedDependency(
PDependency.Library("kotlin-stdlib"),
listOf(PDependency.Library("annotations-13.0"))
)
},
DependencyMapper("org.jetbrains", "annotations", "default", "runtime", version = "13.0") {
MappedDependency(
null,
listOf(PDependency.Library("annotations-13.0"))
)
},
DependencyMapper("org.jetbrains.kotlin", "kotlin-reflect-api", *MODULE_CONFIGURATIONS) {
MappedDependency(PDependency.Library("kotlin-reflect"))
},
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler-embeddable", "runtimeJar") { null },
DependencyMapper("org.jetbrains.kotlin", "kotlin-stdlib-js", "distJar") { null },
DependencyMapper("org.jetbrains.kotlin", "kotlin-compiler", "runtimeJar") { null },
DependencyMapper("org.jetbrains.kotlin", "compiler", *MODULE_CONFIGURATIONS) { null },
DependencyMapper("kotlin.build.custom.deps", "android", "default") { dep ->
val (sdkCommon, otherJars) = dep.moduleArtifacts.map { it.file }.partition { it.name == "sdk-common.jar" }
val mainLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName, otherJars))
val deferredLibrary = PDependency.ModuleLibrary(PLibrary(dep.moduleName + "-deferred", sdkCommon))
MappedDependency(mainLibrary, listOf(deferredLibrary))
}
)
DependencyMapper.forProject(":kotlin-test:kotlin-test-jvm") { MappedDependency(PDependency.Library("kotlin-test-jvm")) },
DependencyMapper.forProject(":kotlin-reflect-api") { MappedDependency(PDependency.Library("kotlin-reflect")) }
) + mappersForKotlinLibrariesExeptStdlib + disabledModuleMappers
}
fun getProjectLibraries(rootProject: Project): List<PLibrary> {
@@ -78,7 +64,8 @@ class JpsCompatiblePlugin : Plugin<Project> {
PLibrary(
library.name,
classes = listOf(File(libraryPath, "$archivesBaseName.jar")).filterExisting(),
sources = listOf(File(libraryPath, "$archivesBaseName-sources.jar")).filterExisting()
sources = listOf(File(libraryPath, "$archivesBaseName-sources.jar")).filterExisting(),
originalName = library.path
)
}
@@ -141,7 +128,9 @@ class JpsCompatiblePlugin : Plugin<Project> {
}
val projectLibraries = getProjectLibraries(rootProject)
val parserContext = ParserContext(getDependencyMappers(projectLibraries), variant)
val dependencyMappers = getDependencyMappers(projectLibraries)
val parserContext = ParserContext(dependencyMappers, variant)
val jpsProject = parse(rootProject, projectLibraries, parserContext)
.mapLibraries(this::attachPlatformSources, this::attachAsmSources)
@@ -152,7 +141,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
removeJpsAndPillRunConfigurations()
removeAllArtifactConfigurations()
generateKotlinPluginArtifactFile(rootProject).write()
generateKotlinPluginArtifactFile(rootProject, dependencyMappers).write()
copyRunConfigurations()
setOptionsForDefaultJunitRunConfiguration(rootProject)
@@ -273,6 +262,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
addOrReplaceOptionValue("ideaSdk.androidPlugin.path", platformDirProjectRelative + "/plugins/android/lib")
addOrReplaceOptionValue("robolectric.classpath", robolectricClasspath)
addOrReplaceOptionValue("use.jps", "true")
addOrReplaceOptionValue("kotlinVersion", project.rootProject.extra["kotlinVersion"].toString())
val isAndroidStudioBunch = project.findProperty("versions.androidStudioRelease") != null
addOrReplaceOptionValue("idea.platform.prefix", if (isAndroidStudioBunch) "AndroidStudio" else null)
@@ -308,7 +298,7 @@ class JpsCompatiblePlugin : Plugin<Project> {
}
private fun attachPlatformSources(library: PLibrary): PLibrary {
val platformSourcesJar = File(platformDir, "../sources/ideaIC-$platformVersion-sources.jar")
val platformSourcesJar = File(platformDir, "../../../sources/intellij-$platformVersion-sources.jar")
if (library.classes.any { it.startsWith(platformDir) }) {
return library.attachSource(platformSourcesJar)

View File

@@ -31,12 +31,7 @@ private fun renderModulesFile(project: PProject) = PFile(
for (module in project.modules) {
val moduleFilePath = pathContext(module.moduleFile)
if (module.group != null) {
xml("module", "fileurl" to "file://$moduleFilePath", "filepath" to moduleFilePath, "group" to module.group)
} else {
xml("module", "fileurl" to "file://$moduleFilePath", "filepath" to moduleFilePath)
}
xml("module", "fileurl" to "file://$moduleFilePath", "filepath" to moduleFilePath)
}
}
}
@@ -85,10 +80,8 @@ private fun renderModule(project: PProject, module: PModule) = PFile(
kotlinCompileOptions.noStdlib.option("noStdlib")
kotlinCompileOptions.noReflect.option("noReflect")
kotlinCompileOptions.moduleName.option("moduleName")
module.name.option("moduleName")
xml("option", "name" to "jvmTarget", "value" to platformVersion)
kotlinCompileOptions.addCompilerBuiltIns.option("addCompilerBuiltIns")
kotlinCompileOptions.loadBuiltInsFromDependencies.option("loadBuiltInsFromDependencies")
kotlinCompileOptions.languageVersion.option("languageVersion")
kotlinCompileOptions.apiVersion.option("apiVersion")
@@ -204,4 +197,4 @@ private fun renderLibraryToXml(library: PLibrary, pathContext: PathContext, name
}
}
fun PLibrary.renderName() = name?.takeIf { it != "unspecified" } ?: classes.first().nameWithoutExtension
fun PLibrary.renderName() = name.takeIf { it != "unspecified" } ?: classes.first().nameWithoutExtension

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
import com.jakewharton.dex.*

View File

@@ -1,15 +1,8 @@
@file:Suppress("unused") // usages in build scripts are not tracked properly
import org.gradle.api.Project
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.*
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.tasks.*
import org.gradle.kotlin.dsl.*
import org.gradle.language.jvm.tasks.ProcessResources
//import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
inline fun Project.sourceSets(crossinline body: SourceSetsBuilder.() -> Unit) =
SourceSetsBuilder(this).body()
inline fun Project.sourceSets(crossinline body: SourceSetsBuilder.() -> Unit) = SourceSetsBuilder(this).body()
class SourceSetsBuilder(val project: Project) {
@@ -40,23 +33,6 @@ val SourceSet.projectDefault: Project.() -> Unit
}
}
// TODO: adding KotlinSourceSet dep to the plugin breaks the build unexpectedly, resolve and uncomment
//val SourceSet.kotlin: SourceDirectorySet
// get() =
// (this as HasConvention)
// .convention
// .getPlugin(KotlinSourceSet::class.java)
// .kotlin
//
//
//fun SourceSet.kotlin(action: SourceDirectorySet.() -> Unit) =
// kotlin.action()
fun Project.getSourceSetsFrom(projectPath: String): SourceSetContainer {
evaluationDependsOn(projectPath)
return project(projectPath).sourceSets
}
val Project.sourceSets: SourceSetContainer
get() = javaPluginConvention().sourceSets

View File

@@ -25,10 +25,13 @@ import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.task
import java.io.File
import java.lang.Character.isLowerCase
import java.lang.Character.isUpperCase
import java.nio.file.Files
import java.nio.file.Path
fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}): Test = getOrCreateTask(taskName) {
fun Project.projectTest(taskName: String = "test", parallel: Boolean = false, body: Test.() -> Unit = {}): Test = getOrCreateTask(taskName) {
doFirst {
val commandLineIncludePatterns = (filter as? DefaultTestFilter)?.commandLineIncludePatterns ?: emptySet()
val patterns = filter.includePatterns + commandLineIncludePatterns
@@ -98,6 +101,34 @@ fun Project.projectTest(taskName: String = "test", body: Test.() -> Unit = {}):
environment("PROJECT_BUILD_DIR", buildDir)
systemProperty("jps.kotlin.home", rootProject.extra["distKotlinHomeDir"]!!)
systemProperty("kotlin.ni", if (rootProject.hasProperty("newInferenceTests")) "true" else "false")
var subProjectTempRoot: Path? = null
doFirst {
val teamcity = rootProject.findProperty("teamcity") as? Map<*, *>
val systemTempRoot =
// TC by default doesn't switch `teamcity.build.tempDir` to 'java.io.tmpdir' so it could cause to wasted disk space
// Should be fixed soon on Teamcity side
(teamcity?.get("teamcity.build.tempDir") as? String)
?: System.getProperty("java.io.tmpdir")
systemTempRoot.let {
subProjectTempRoot = Files.createTempDirectory(File(systemTempRoot).toPath(), project.name + "Project_" + taskName + "_")
systemProperty("java.io.tmpdir", subProjectTempRoot.toString())
}
}
doLast {
subProjectTempRoot?.let {
try {
delete(it)
} catch (e: Exception) {
project.logger.warn("Can't delete test temp root folder $it", e.printStackTrace())
}
}
}
if (parallel) {
maxParallelForks = Math.max(Runtime.getRuntime().availableProcessors() / 2, 1)
}
body()
}
@@ -122,7 +153,7 @@ private fun Task.useAndroidConfiguration(systemPropertyName: String, configName:
.also {
dependencies.add(
configName,
dependencies.project(":custom-dependencies:android-sdk", configuration = configName)
dependencies.project(":dependencies:android-sdk", configuration = configName)
)
}
}

View File

@@ -1,7 +1,7 @@
<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" />
<module name="pill.generate-all-tests.test" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
<method />
</configuration>

View File

@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] JS Backend Tests" type="JUnit" factoryName="JUnit">
<module name="js.tests.test" />
<module name="js.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" />

View File

@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="[Pill] Java 8 Tests" type="JUnit" factoryName="JUnit">
<module name="tests-java8.test" />
<module name="compiler.tests-java8.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.jetbrains.kotlin.*" />

View File

@@ -24,8 +24,8 @@ dependencies {
testCompile(projectTests(":jps-plugin"))
testCompile(commonDep("junit:junit"))
testCompile(intellijDep()) { includeJars("openapi", "idea", "idea_rt", "groovy-all", "jps-builders", rootProject = rootProject) }
testCompile(intellijDep("jps-standalone")) { includeJars("jps-model") }
testCompile(intellijDep("jps-build-test"))
testCompile(jpsStandalone()) { includeJars("jps-model") }
testCompile(jpsBuildTest())
}
sourceSets {
@@ -38,5 +38,14 @@ projectTest {
doFirst {
environment("kotlin.tests.android.timeout", "45")
}
if (project.hasProperty("teamcity") || project.hasProperty("kotlin.test.android.teamcity")) {
systemProperty("kotlin.test.android.teamcity", true)
}
project.findProperty("kotlin.test.android.path.filter")?.let {
systemProperty("kotlin.test.android.path.filter", it.toString())
}
workingDir = rootDir
}

View File

@@ -33,11 +33,16 @@ import javax.xml.parsers.ParserConfigurationException
class CodegenTestsOnAndroidRunner private constructor(private val pathManager: PathManager) {
private val isTeamcity = System.getProperty("kotlin.test.android.teamcity") != null || System.getenv("TEAMCITY_VERSION") != null
private fun runTestsInEmulator(): TestSuite {
val rootSuite = TestSuite("Root")
downloadDependencies()
val emulator = Emulator(pathManager, Emulator.ARM)
val emulatorType = if (isTeamcity) Emulator.ARM else Emulator.X86
println("Using $emulatorType emulator!")
val emulator = Emulator(pathManager, emulatorType)
emulator.createEmulator()
val gradleRunner = GradleRunner(pathManager)

View File

@@ -34,8 +34,8 @@ public class PathManager {
return getAndroidSdkRoot() + "/platforms";
}
public String getAndroidEmulatorRoot() {
String androidEmulatorRoot = getAndroidSdkRoot() + "/emulator";
public String getAndroidAvdRoot() {
String androidEmulatorRoot = getAndroidSdkRoot() + "/emulatoravd";
new File(androidEmulatorRoot).mkdirs();
return androidEmulatorRoot;
}
@@ -48,6 +48,10 @@ public class PathManager {
return getAndroidSdkRoot() + "/tools";
}
public String getEmulatorFolderInAndroidSdk() {
return getAndroidSdkRoot() + "/emulator";
}
public String getBuildToolsFolderInAndroidSdk() {
return getAndroidSdkRoot() + "/build-tools";
}

View File

@@ -35,14 +35,16 @@ public class SDKDownloader {
private final String skdToolsZipPath;
private final String buildToolsZipPath;
private final String gradleZipPath;
private final String emulatorZipPath;
private final PathManager pathManager;
private static final String PLATFORM_TOOLS = "28.0.1";
private static final String SDK_TOOLS = "25.2.5";
private static final String SDK_TOOLS = "4333796"; //"26.1.1";
public static final String BUILD_TOOLS = "28.0.3";
private static final int ANDROID_VERSION = 19;
public static final String GRADLE_VERSION = "4.6";
public static final String EMULATOR_TOOLS_VERSION = "5264690"; //"28.0.23";
public SDKDownloader(PathManager pathManager) {
@@ -51,9 +53,10 @@ public class SDKDownloader {
armImage = pathManager.getRootForDownload() + "/arm-image.zip";
x86Image = pathManager.getRootForDownload() + "/x86-image.zip";
platformToolsZipPath = pathManager.getRootForDownload() + "/platform-tools" + PLATFORM_TOOLS + ".zip";
skdToolsZipPath = pathManager.getRootForDownload() + "/tools" + SDK_TOOLS + ".zip";
skdToolsZipPath = pathManager.getRootForDownload() + "/sdk-tools" + SDK_TOOLS + ".zip";
buildToolsZipPath = pathManager.getRootForDownload() + "/build-tools" + BUILD_TOOLS + ".zip";
gradleZipPath = pathManager.getRootForDownload() + "/gradle" + GRADLE_VERSION + ".zip";
emulatorZipPath = pathManager.getRootForDownload() + "/emulator" + EMULATOR_TOOLS_VERSION + ".zip";
}
public void downloadPlatform() {
@@ -70,12 +73,17 @@ public class SDKDownloader {
}
public void downloadSdkTools() {
download(getDownloadUrl("https://dl.google.com/android/repository/tools_r" + SDK_TOOLS), skdToolsZipPath);
download("https://dl.google.com/android/repository/sdk-tools-" + getPlatformName() + "-" + SDK_TOOLS + ".zip",
skdToolsZipPath);
}
public void downloadBuildTools() {
download(getDownloadUrl("https://dl.google.com/android/repository/build-tools_r" + BUILD_TOOLS), buildToolsZipPath);
}
public void downloadEmulator() {
download("https://dl.google.com/android/repository/emulator-" + getPlatformName() + "-" + EMULATOR_TOOLS_VERSION + ".zip",
emulatorZipPath);
}
public void downloadGradle() {
download("https://services.gradle.org/distributions/gradle-" + GRADLE_VERSION + "-bin.zip", gradleZipPath);
@@ -93,11 +101,27 @@ public class SDKDownloader {
suffix = "-linux.zip";
}
else {
throw new IllegalStateException("Your operating system doesn't supported yet.");
throw new IllegalStateException("Your operating system isn't supported yet.");
}
return prefix + suffix;
}
private static String getPlatformName() {
if (SystemInfo.isWindows) {
return "windows";
}
else if (SystemInfo.isMac) {
return "darwin";
}
else if (SystemInfo.isUnix) {
return "linux";
}
else {
throw new IllegalStateException("Your operating system isn't supported yet.");
}
}
public void downloadAll() {
downloadSdkTools();
downloadAbi();
@@ -105,6 +129,7 @@ public class SDKDownloader {
downloadPlatformTools();
downloadBuildTools();
downloadGradle();
downloadEmulator();
}
@@ -123,10 +148,9 @@ public class SDKDownloader {
//BUILD TOOLS
String buildTools = androidSdkRoot + "/build-tools/";
String buildToolsFolder = buildTools + BUILD_TOOLS + "/";
new File(buildToolsFolder).delete();
unzip(buildToolsZipPath, buildTools);
new File(buildTools + "/android-9").renameTo(new File(buildToolsFolder));
unzip(emulatorZipPath, androidSdkRoot);
}
public void deleteAll() {

View File

@@ -34,11 +34,12 @@ public class Emulator {
public static final String ARM = "arm";
public static final String X86 = "x86";
private static final String AVD_NAME = "kotlin_box_test_avd";
private final static Pattern EMULATOR_PATTERN = Pattern.compile("emulator-([0-9])*");
private final PathManager pathManager;
private String platform;
private final String platform;
public Emulator(PathManager pathManager, String platform) {
this.pathManager = pathManager;
@@ -53,47 +54,36 @@ public class Emulator {
commandLine.addParameter("avd");
commandLine.addParameter("--force");
commandLine.addParameter("-n");
commandLine.addParameter("my_avd");
commandLine.addParameter(AVD_NAME);
commandLine.addParameter("-p");
commandLine.addParameter(pathManager.getAndroidEmulatorRoot());
commandLine.addParameter("-t");
commandLine.addParameter("1");
commandLine.addParameter("-b");
commandLine.addParameter(getEmulatorAbi());
commandLine.addParameter(pathManager.getAndroidAvdRoot());
commandLine.addParameter("-k");
if (platform == X86) {
commandLine.addParameter("system-images;android-19;default;x86");
} else {
commandLine.addParameter("system-images;android-19;default;armeabi-v7a");
}
return commandLine;
}
private String getEmulatorAbi(){
return platform == X86 ? "x86" : "armeabi-v7a";
}
private GeneralCommandLine getStartCommand() {
GeneralCommandLine commandLine = new GeneralCommandLine();
String emulatorCmdName = SystemInfo.isWindows ? "emulator.exe" : "emulator";
commandLine.setExePath(pathManager.getToolsFolderInAndroidSdk() + "/" + emulatorCmdName);
commandLine.setExePath(pathManager.getEmulatorFolderInAndroidSdk() + "/" + "emulator");
commandLine.addParameter("-avd");
commandLine.addParameter("my_avd");
if (platform != X86) {
//problem with qemu options
commandLine.addParameter("-no-audio");
}
commandLine.addParameter(AVD_NAME);
commandLine.addParameter("-no-audio");
commandLine.addParameter("-no-window");
return commandLine;
}
private GeneralCommandLine getWaitCommand() {
GeneralCommandLine commandLine = new GeneralCommandLine();
String adbCmdName = SystemInfo.isWindows ? "adb.exe" : "adb";
commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/" + adbCmdName);
GeneralCommandLine commandLine = createAdbCommand();
commandLine.addParameter("wait-for-device");
return commandLine;
}
private GeneralCommandLine getStopCommandForAdb() {
GeneralCommandLine commandLine = new GeneralCommandLine();
String adbCmdName = SystemInfo.isWindows ? "adb.exe" : "adb";
commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/" + adbCmdName);
GeneralCommandLine commandLine = createAdbCommand();
commandLine.addParameter("kill-server");
return commandLine;
}
@@ -118,8 +108,7 @@ public class Emulator {
private GeneralCommandLine createAdbCommand() {
GeneralCommandLine commandLine = new GeneralCommandLine();
String adbCmdName = SystemInfo.isWindows ? "adb.exe" : "adb";
commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/" + adbCmdName);
commandLine.setExePath(pathManager.getPlatformToolsFolderInAndroidSdk() + "/" + "adb");
return commandLine;
}
@@ -186,11 +175,6 @@ public class Emulator {
command.addParameter("kill");
RunUtils.execute(command);
if (SystemInfo.isWindows) {
//TODO check that command above works on windows and remove this
OutputUtils.checkResult(RunUtils.execute(getStopCommand()));
}
finishProcess("emulator64-" + platform);
finishProcess("emulator-" + platform);
}

View File

@@ -30,10 +30,15 @@ public class PermissionManager {
public static void setPermissions(PathManager pathManager) {
if (!SystemInfo.isWindows) {
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() + "/bin64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getBuildToolsFolderInAndroidSdk() + "/" + SDKDownloader.BUILD_TOOLS));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getPlatformToolsFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() +"/qemu/linux-x86_64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getToolsFolderInAndroidSdk() +"/bin"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk()));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk() +"/bin"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk() +"/bin64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getEmulatorFolderInAndroidSdk() +"/qemu/linux-x86_64"));
setExecPermissionForSimpleNamedFiles(new File(pathManager.getAndroidSdkRoot() + "/system-images/android-19/default/armeabi-v7a/"));
RunUtils.execute(generateChmodCmd(pathManager.getGradleBinFolder() + "/gradle"));
}
}

View File

@@ -1,6 +1,6 @@
/*
* 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.
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.android.tests
@@ -41,6 +41,8 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
private val generatedTestNames = Lists.newArrayList<String>()
private val pathFilter: String? = System.getProperties().getProperty("kotlin.test.android.path.filter")
private fun generateOutputFiles() {
prepareAndroidModule()
generateAndSave()
@@ -80,7 +82,6 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
FileWriter(File(testSourceFilePath).also { it.parentFile.mkdirs() }).use {
val p = Printer(it)
p.print(FileUtil.loadFile(File("license/LICENSE.txt")))
p.println(
"""package $testClassPackage;
|
@@ -195,6 +196,10 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
} else if (FileUtilRt.getExtension(file.name) != KotlinFileType.EXTENSION) {
// skip non kotlin files
} else {
if (pathFilter != null && !file.path.contains(pathFilter)) {
continue
}
if (!InTextDirectivesUtils.isPassingTarget(TargetBackend.JVM, file)) {
continue
}

View File

@@ -42,6 +42,7 @@ public class SpecialFiles {
//Test with no reflection at runtime
excludedFiles.add("noReflectAtRuntime");
excludedFiles.add("noReflect");
excludedFiles.add("functionNtoStringNoReflect.kt");
excludedFiles.add("getDelegateWithoutReflection.kt");

View File

@@ -6,7 +6,6 @@ plugins {
dependencies {
compile(project(":core:descriptors"))
compile(project(":core:descriptors.jvm"))
compile(project(":compiler:util"))
compile(project(":compiler:frontend"))
compile(project(":compiler:ir.tree"))

View File

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

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