Commit Graph

286 Commits

Author SHA1 Message Date
Alexander Podkhalyuzin 3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
Ilya Chernikov 27968c8e13 Set proper jvmTarget for projects 2017-09-19 21:37:27 +02:00
Ilya Chernikov deda50dbbb Continue switching projects to improved dsl: sourceSets and test running 2017-09-19 21:37:26 +02:00
Ilya Chernikov 61dfb75e0e Implement Gradle Kotlin DSL build 2017-09-19 21:37:06 +02:00
Stanislav Erokhin 7982f3489e Rename compiler key -Xno-check-impl to -Xno-check-actual 2017-09-16 19:47:39 +03:00
Denis Zharkov 4d95c30360 Restore -Xjsr305-annotations flag as a deprecated 2017-09-14 18:05:32 +03:00
Alexander Udalov d32e101802 Support deprecatedName for advanced CLI arguments 2017-09-14 18:05:32 +03:00
Dmitry Petrov 179e720e4a Provide fallback flag for KT-19174
-Xno-exception-on-explicit-equals-for-boxed-null

Also unify corresponding names.
2017-09-14 10:15:28 +03:00
Anton Bannykh 22dc36a596 JS: enable translation of primitive arrays to TypedArray's by default (KT-17137) 2017-09-13 18:45:19 +03:00
e5l 5bb88b659b Rename flag Xjsr305-annotations->Xjsr305 2017-09-13 15:19:54 +06:00
Alexander Udalov 593d6b7a95 Minor, do not use ".java.kotlin" on KClass instances 2017-09-12 15:02:25 +03:00
Dmitry Petrov 5d44e095c8 Nullability assertions for extension receiver
In Kotlin 1.1 and before, there were no nullability assertions on
extension receivers, because receiver is resolved with NO_EXPECTED_TYPE.
So, if an expression of platform type is passed as an extension receiver
to a non-private function, it would fail with IllegalArgumentException.
However, if the function is private, then we generated no parameter
assertions under assumption that such function can be called from Kotlin
only, and all arguments are checked on the call site. Thus 'null' could
propagate indefinitely.

In Kotlin 1.2, we do the following:
- Generate nullability assertions for expression receivers.
NB nullability assertions are stored for ReceiverValue instances, not
for expressions: given expression can act as receiver in different
calls, each with an expected receiver type of its own.
- Generate nullability assertions for extension receivers of private
operator functions.
NB it still can throw NPE for some particular "optimized" cases, but at
least those nulls would not propagate indefinitely.

This behavior is disabled by an "advanced" command-line option
'-Xno-receiver-assertions'.
2017-09-01 09:49:21 +03:00
Alexander Udalov fb4bf4e5b8 Report error if Java 9 module "kotlin.stdlib" is not found in the graph
Use "-Xallow-kotlin-package" to suppress this error

 #KT-19176 Fixed
2017-08-30 15:47:54 +03:00
baratynskiy 1b0d7ff5be javac-wrapper: constant evaluator 2017-08-29 18:01:36 +03:00
baratynskiy 8494e54608 javac-wrapper: -Xuse-javac -> -Xuse-javac and -Xcompile-java 2017-08-29 18:01:36 +03:00
Mikhail Glukhikh 3623f581b8 Eliminate a set of warnings, mostly nullability ones 2017-08-18 15:10:27 +03:00
e5l 5501cdf049 Add warnings for jsr305 nullable annotations
#KT-19115 Fixed
2017-08-15 11:01:08 +03:00
e5l 746de612ad Move Jsr305State to util.runtime 2017-08-15 11:01:08 +03:00
Alexey Sedunov d10fa8f891 Minor: Fix array detection 2017-08-03 01:55:44 +03:00
Dmitry Jemerov b423d58a14 Load JSR-305 annotations for libraries if it's enabled for any module
#KT-19303 Fixed
2017-08-02 15:25:34 +02:00
Alexey Sedunov 40163868af Support mutable/immutable compiler arguments 2017-08-01 19:40:37 +03:00
Alexey Sedunov 2984a5a19f Fix reflection-based operations on compiler arguments after conversion 2017-08-01 19:40:22 +03:00
Alexey Sedunov 50599c933f J2K: CommonToolArguments and inheritors 2017-08-01 19:36:49 +03:00
Alexey Sedunov 2e49971989 J2K: CommonToolArguments and inheritors (rename) 2017-08-01 19:36:49 +03:00
Mikhail Glukhikh c5a81691fb Partial code cleanup: can be private and some others applied 2017-08-01 17:08:56 +03:00
Alexander Udalov 1e6850f198 CLI: improve error message if libraries are not found in Kotlin home
Also support the '-kotlin-home' argument in kotlinc-js

 #KT-18859 Fixed
2017-07-28 14:16:46 +03:00
Alexander Udalov 224df7a1ea Change -Xload-jsr305-annotations argument to -Xjsr305-annotations={ignore|enable}
See https://youtrack.jetbrains.com/issue/KT-19229 for a complete
explanation

 #KT-19229 Fixed
 #KT-10942
2017-07-26 11:45:25 +03:00
Alexander Udalov 2f99f6ad34 Refactor AnalysisFlags and their support in IDE
* Support flags with any value (not just Boolean)
* Support all flags by parsing arguments in KotlinFacetSettings, instead
  of manually listing known flags

 #KT-19210 Fixed
2017-07-26 11:45:24 +03:00
Alexander Udalov 845de7aa4d Minor, change parameter type of parseCommandLineArguments 2017-07-26 11:45:24 +03:00
Mikhail Glukhikh 951e8cd91a Code cleanup: unnecessary local variable applied 2017-07-21 18:58:48 +03:00
Ilya Chernikov e4ed217a3b Add missing explicit serialVersionUID to the REPL API classes 2017-07-08 18:16:27 +02:00
Alexander Udalov 127cd1295e Disable JSR-305 annotations by default, introduce CLI argument
No package annotations are going to be loaded, and
TypeQualifierDefault/TypeQualifierNickname are no longer recognized by
default. Use the CLI argument "-Xload-jsr305-annotations" to enable this
behavior back

 #KT-10942
2017-07-07 22:08:50 +03:00
Mikhail Glukhikh 9c06739594 Cleanup: apply "lift out..." inspection (+ some others) 2017-07-07 18:15:30 +03:00
Alexander Udalov 0f15413d47 Minor, do not output stack trace on invalid contents of build file 2017-07-06 17:03:25 +03:00
Alexander Udalov 55468735df Rename -module argument to -Xbuild-file
To prevent confusion with Java 9 module-related arguments

 #KT-18754 Fixed
2017-07-06 17:03:25 +03:00
Alexander Udalov 158afdea2b Improve sorting of compiler messages in GroupingMessageCollector
Ensure that messages reported on a file but with no line information are
reported before diagnostics related to code. This fixes
Java9ModulesIntegrationTest.testSeveralModulesWithTheSameName on some
machines
2017-07-06 13:01:16 +03:00
Mikhail Glukhikh 840847e47c Code cleanup: several inspections applied 2017-06-29 16:25:57 +03:00
Alexander Udalov 03d83db660 Support -Xmodule-path and -Xadd-modules command line arguments
#KT-18598 In Progress
 #KT-18599 Fixed
2017-06-29 15:59:56 +03:00
Alexey Andreev cfbb9209a7 Add JS DCE gradle plugin 2017-06-29 10:32:30 +03:00
vitaly.khudobakhshov d165ea9ea7 Add expression type string to the REPL API
PR-1131
2017-06-27 11:28:40 +02:00
Alexey Andreev a0e1bde594 Allow to embed source files into JS source maps 2017-06-26 18:15:28 +03:00
Alexey Andreev 60dd475493 Don't expose sourceMapSourceRoots argument to Gradle (JS)
Exposing this property causes IDEA to treat it as a free
command line argument, which is undesirable.
Support source roots via setting command line arguments inside
JS gradle task.
2017-06-20 17:40:35 +03:00
Alexey Andreev 13ab63ae09 Generate relative paths in JS source maps
Also, add CLI options to manipulate prefixes of path

See KT-4078
2017-06-20 17:40:32 +03:00
Alexander Udalov ed922deb93 REPL: do not output additional newline after compiler and runtime errors 2017-06-08 12:28:05 +03:00
Alexander Udalov a67382fdec Daemon: do not exit with internal error on invalid arguments
Invalid compiler arguments should lead to a compilation error, not
internal error. This has been fixed by splitting the
"parseArguments(...)" call (which does parsing + validation) in
CompileServiceImpl into two calls of parseCommandLineArguments +
validateArguments, and returning with a compilation error if the latter
did not succeed

 #KT-16057 Fixed
 #KT-14848 In Progress
2017-06-06 19:52:02 +03:00
Alexander Udalov 7febd846e8 Export 'intellij-core' in module 'frontend'
Remove intellij-core from dependencies of modules which already depend
on frontend or any module that exports frontend (such as frontend.java)
2017-06-06 14:29:26 +03:00
Alexander Udalov a236400785 CLI: drop CommonCompilerArguments.createDefaultInstance
Move the corresponding default value initializers to the field
declarations
2017-06-06 14:17:26 +03:00
Alexey Tsvetkov 6e07b1cd99 Gradle: set default values of languageVersion and apiVersion to null
Before the change, Gradle always explicitly set language and api
version to the latest version, preventing the compiler
from inferencing the arguments.

     #KT-18047 fixed
2017-05-31 16:59:03 +03:00
Alexey Andreev 522a56947c Add -keep command line option to JS DCE tool 2017-05-26 18:20:23 +03:00
Alexey Andreev 8a8fdf1968 Command-line tool for JS DCE 2017-05-26 18:20:17 +03:00