Alexander Udalov
2b1b1fb0d4
Merge VirtualFileKotlinClassFinder into VirtualFileFinder
...
VirtualFileKotlinClassFinder was the only direct subclass of VirtualFileFinder
2017-03-03 13:33:50 +03:00
Alexander Udalov
abb5bc6aba
Simplify VirtualFileFinder and their factories' hierarchy
...
Since there's no JsVirtualFileFinder anymore, inline JvmVirtualFileFinder into
VirtualFileFinder and drop "Jvm" prefix everywhere
2017-03-03 13:33:50 +03:00
Dmitry Jemerov
af7de9a0c5
Warn when running the compiler under Java 6 or 7
...
(cherry picked from commit 5537800)
(cherry picked from commit 5614874)
2017-03-01 16:21:57 +01:00
Ilya Chernikov
d3682b7f7d
Implement JSR 223 script template with eval functions, some fixes
2017-02-24 16:58:25 +01:00
Ilya Chernikov
a3a782613a
Cleanup
2017-02-24 16:58:24 +01:00
Ilya Chernikov
b9469a9308
Fix script-util after changes in repl infrastruct
2017-02-24 16:58:24 +01:00
Ilya Chernikov
b23911fd59
Reintroduce history check between compile and eval, place generation into code line and id
2017-02-24 16:58:24 +01:00
Ilya Chernikov
7b2ea001c1
Fix state conversion, fix tests
2017-02-24 16:58:24 +01:00
Ilya Chernikov
f9dedab8c8
Extract repl state as a separate object
2017-02-24 16:58:24 +01:00
Alexander Udalov
a9678010a8
Invert LanguageFeature responsible for warning on coroutines
...
The problem was that LanguageVersionSettingsImpl.DEFAULT did not have
"WarnOnCoroutines" as a feature and so it was manually added to the settings,
but only in two places: in the compiler and in the IDE
2017-02-22 18:55:48 +03:00
Alexander Udalov
21449763ab
Add extension CompilerConfiguration.languageVersionSettings for convenience
2017-02-21 10:58:19 +03:00
Alexander Udalov
8e407d548a
Suggest to provide explicit dependency on new kotlin-reflect
...
In case when there's kotlin-stdlib 1.1 and kotlin-reflect 1.0 in the classpath
2017-02-15 20:43:25 +03:00
Alexander Udalov
71fcb07fad
Infer API version from older runtime in compiler's classpath
...
For example, if you invoke kotlinc 1.1 with kotlin-stdlib 1.0 in the classpath,
we now infer -api-version 1.0 automatically
2017-02-15 20:43:25 +03:00
Alexander Udalov
b56639a775
Filter out files with the same paths in runtime version checker
...
To prevent listing them several times in the diagnostic message
2017-02-15 20:43:25 +03:00
Alexander Udalov
8457ab7c58
Report warnings instead of errors in runtime version checker
2017-02-15 20:43:25 +03:00
Alexander Udalov
2e8bfde2e7
Move -Xskip-metadata-version-check from JVM to common arguments
...
To be used in JS
2017-02-15 10:46:48 +03:00
Alexander Udalov
a1a71a01b1
Drop JvmMetadataVersion.skipCheck, support this correctly
...
Pass the value of this flag via DeserializationConfiguration
2017-02-15 10:46:48 +03:00
Alexander Udalov
20d856fa77
Minor, remove blank line in extra help
2017-02-13 14:09:38 +03:00
Alexander Udalov
8fee62a8c5
Minor, explain what CompilerMessageSeverity.STRONG_WARNING is
2017-02-13 12:11:16 +03:00
Ilya Chernikov
da2f310895
Convert line endings when creating ReplCodeLine, fixes KT-15861
...
(cherry picked from commit 894ee4c)
2017-02-09 22:00:30 +01:00
Alexey Sedunov
4325632b3e
Kotlin Facet: Always parse argument string to proper compiler arguments bean
...
#KT-16137 Fixed
#KT-16157 Fixed
#KT-16206 Fixed
2017-02-08 11:56:59 +03:00
Alexey Andreev
9d6f4d7770
JS: don't treat library without JS metadata as error, report warning and continue instead. See KT-16158
2017-02-08 11:29:30 +03:00
Ilya Chernikov
99b902f5f2
Fix version calculation code
...
(cherry picked from commit fb74040)
2017-02-07 13:45:22 +01:00
Ilya Chernikov
f6ce74edb3
Set jvmTarget property for repl compilation from sys prop or java version, fixes KT-16126
...
(cherry picked from commit 4cf2bce)
2017-02-07 13:45:12 +01:00
Alexander Udalov
ca1ed850b8
Improve error on runtime of version different than API version
...
Include the actual runtime version in the error message
2017-02-06 19:39:15 +03:00
Alexander Udalov
57f8ef372f
Report different runtime versions earlier than incompatibility with API version
...
Previously if you had kotlin-reflect 1.0 and kotlin-runtime 1.1 in the
classpath, checkCompatibleWithApiVersion was invoked first, and an error was
reported that suggested to pass "-api-version" to the compiler. However, no
correct "-api-version" can be passed in this case, because
checkMatchingVersions would then report that the two libraries have different
versions anyway. So, now we first ensure that all libraries have the same
version, and only then do check if the version is correct
2017-02-06 19:39:15 +03:00
Alexander Udalov
3a7eec8635
Check API version instead of language in JVM runtime versions checker
...
It should be a valid case to invoke the 1.1 compiler with the 1.0 runtime in
the classpath and "-api-version 1.0". However, previously it was an error and
the message suggested to specify "-language-version 1.0". Language version 1.0
implies API version 1.0, so this effectively made the "-api-version" option
useless
2017-02-06 19:39:15 +03:00
Anton Bannykh
289a7a9cc3
JS: fixed support for test source roots (KT-6627)
2017-02-03 13:03:12 +03:00
Alexander Udalov
464820458e
JS: rename "-library-files" argument to "-libraries" and change separator
...
Use the system separator (':' or ';') instead of commas
#KT-16083 Fixed
2017-01-31 16:26:35 +03:00
Alexander Udalov
424afba246
Add hint to use "-language-version", when applicable, in JVM runtime checker
2017-01-30 20:27:17 +03:00
Alexander Udalov
7167139c2e
Refactor JvmRuntimeVersionsConsistencyChecker for readability
2017-01-30 20:27:16 +03:00
Alexander Udalov
9e877b4a9e
Do not report error on libraries that bundle Kotlin runtime in classpath
...
Instead, report a strong warning, suggesting to remove such libraries from the
classpath
#KT-15995 Fixed
2017-01-30 20:27:16 +03:00
Alexander Udalov
e9a737b85a
Promote severity of configuration warnings to STRONG_WARNING
...
The reason is that these configuration problems may be the reason of
compilation errors, but they were hidden from the output because warnings are
not reported when there's at least one error
2017-01-30 16:01:29 +03:00
Alexander Udalov
7ac96163ac
Introduce CompilerMessageSeverity.STRONG_WARNING
...
This is a severity for mandatory warnings, i.e. those which should be reported
in any case, even if there are compilation errors
2017-01-30 16:01:27 +03:00
Dmitry Jemerov
3a3cf048a6
Register ControlFlowFactory in KotlinCoreProjectEnvironment
...
#KT-16047 Fixed
2017-01-30 13:22:47 +01:00
Alexander Udalov
e5680565b3
JS: drop "-kjsm" flag, merge logic with "-meta-info"
...
#KT-16049 Fixed
2017-01-30 11:31:03 +03:00
Zalim Bashorov
29ac01f2e2
KJS: allow to use packages with names starting with "kotlin" only if the -Xallow-kotlin-package command line option is specified
...
#KT-14668 Fixed
2017-01-29 17:21:01 +03:00
Ilya Chernikov
b8b044c6b0
Reuse script args substitution for replacing bindings in JSR 223 sample engines, fixes KT-15450
2017-01-27 22:20:44 +01:00
Ilya Chernikov
0b689a4ecb
PR-1021 review: minor fixes
...
# Conflicts:
# compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/GenericReplCompilingEvaluator.kt
# compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/repl/GenericReplEvaluator.kt
# compiler/cli/src/org/jetbrains/kotlin/cli/jvm/repl/GenericReplCompiler.kt
2017-01-27 22:20:44 +01:00
apatrida
5ad06e1e92
PR-1021: Merge Keplin project scripting code into Kotlin core.
...
Overhauls the scripting layers (GenericRepl and related, and JSR223 and related)
Adds repeating modes (none, only latest eval'd line, or random order)
Also adds better thread-safe IO capturing, default imports, SimpleRepl wrapper, more unit tests
NOTE: the script-util part of the pull request was rejected due to various problems and incompatibilities.
It may be incorporated into the code later.
(originally cherry picked from commit 6f7d517)
2017-01-27 22:20:44 +01:00
Ilya Chernikov
8caf607378
PR-1021 preparations: prepare files to preserve important history
...
- Split GenericRepl.kt into separate files
- Rename Repl.kt
2017-01-27 22:20:44 +01:00
Alexey Sedunov
591910a216
Kotlin Facet: Import compiler arguments from Gradle project
...
#KT-15819 Fixed
#KT-15929 Fixed
2017-01-26 18:06:14 +03:00
Ilya Chernikov
ec7e8873f4
Update daemon client with wrappers for basic compiler API
...
Other changes to extract results for compiler, tests.
2017-01-25 15:29:15 +01:00
Alexander Udalov
76fc3b40d5
Do not consider Kotlin compiler as library in runtime versions checker
...
Otherwise because there's no Kotlin-Version in its manifest, it's regarded as a
1.0 runtime library which conflicts with 1.1 libraries
2017-01-23 11:30:53 +03:00
Alexander Udalov
139d37cfd0
Support "Main" component in JVM runtime version consistency checker
...
The point here is to disable the "checkNotNewerThanCompiler" check because it
breaks a real life use case of compiling with an old compiler against the new
runtime library (that may come implicitly as a transitive dependency of another
library). However, to keep the possibility of restoring this check in the
future without backporting the needed changes into the old branches, we now
only perform this check for the "Core" runtime components, and all other checks
-- for "Core" and "Main" runtime components. In the follow-up commit, we change
the runtime component of our libraries to "Main". If we decide we need the
"checkNotNewerThanCompiler" behavior in the future, we can change the runtime
component to "Core", effectively restoring this check in the old compilers
2017-01-21 12:57:14 +03:00
Alexander Udalov
7b4e826650
Enable JVM runtime version consistency checker in 1.1
2017-01-21 12:57:14 +03:00
Mikhael Bogdanov
62514e126d
Enable jvm 1.8 platform in cli
2017-01-13 13:52:54 +01:00
Alexey Tsvetkov
bdae0b5efb
Fix the build
2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
2ec9773e15
Minor: fix CompilerMessageSeverity order
2017-01-13 15:08:12 +03:00
Alexey Tsvetkov
16352ff2e5
Refactor messages sending
2017-01-13 15:08:12 +03:00