Commit Graph

38390 Commits

Author SHA1 Message Date
Ilya Gorbunov 94895c4e4d Clean warnings in binary-compatibility-validator cases 2017-04-17 14:50:07 +03:00
Mikhael Bogdanov 46cdf0215e Add codegen tests with substituted bytecode version (1.8->1.9) 2017-04-17 13:22:04 +02:00
Alexey Andreev b11e33901b Fix parsing of JavaScript number literals out of integer range
Fix KT-17219
2017-04-17 14:17:08 +03:00
Alexander Udalov b7de272884 CLI: support delimiter for array arguments
The " " delimiter is used in kotlin-native (see
K2NativeCompilerArguments)
2017-04-17 11:51:33 +03:00
Alexander Udalov ae1fb16fe8 Fix compilation of kotlin-gradle-plugin 2017-04-17 11:51:08 +03:00
Alexander Udalov 10f2e9d33a Revert usages of -X arguments to old form in some places
We use the old compiler in Gradle build and in GradleFacetImportTest, so
some changes in f4b6db4 should not have been made yet
2017-04-17 11:33:58 +03:00
Alexander Udalov 072f87ddab Introduce -Xintellij-plugin-root, deprecate CompilerJarLocator 2017-04-14 20:13:11 +03:00
Alexander Udalov ce6676baa8 Do not print usage if wrong argument is passed, do not exit with INTERNAL_ERROR
This is a normal situation, not an internal error of the compiler, so
return COMPILATION_ERROR instead
2017-04-14 20:07:54 +03:00
Alexander Udalov ff846e787f Report warning for non-boolean CLI argument passed multiple times
Only if its values are different, see the test
2017-04-14 20:07:54 +03:00
Alexander Udalov be54e4b93b Get rid of coroutinesWarn/coroutinesEnable/coroutinesError
Use a single coroutinesState instead. Change the coroutines state in
some tests from "warn" to "enable"/"error" to test that deserialization
of older config files works ("warn" is the default value, so it wasn't
testing anything here)
2017-04-14 20:07:54 +03:00
Alexander Udalov f4b6db4dc0 Change format of -X arguments to require value after '='
Report a warning when an argument is passed in the old form (with the
whitespace)

 #KT-17264 Fixed
2017-04-14 20:07:54 +03:00
Alexander Udalov 78c0111c6e Drop cli-parser, use simple reflection-based parser instead
The main reason of this change is that major changes are required in how
command line arguments are parsed in kotlinc, and it's much easier to
make them in our own codebase (given that the code is short and simple
enough) than in a third-party library
2017-04-14 20:07:53 +03:00
Sergey Mashkov 007408c792 Maven: rename completion providers 2017-04-14 13:27:09 +03:00
Sergey Mashkov c890200f08 Maven: show non-stable language/api versions only in internal mode 2017-04-14 13:27:08 +03:00
Sergey Mashkov a22ed0f7c0 Maven: minor: fix comment 2017-04-14 13:27:08 +03:00
Sergey Mashkov 711398f14f Maven: eliminate constants in maven.xml 2017-04-14 13:27:07 +03:00
Sergey Mashkov a427248969 Maven: add more plugin parameters IDE support 2017-04-14 13:27:07 +03:00
Sergey Mashkov 2521dacc25 Maven: KT-17093 Import from maven: please provide a special tag for coroutine option 2017-04-14 13:27:06 +03:00
Sergey Mashkov 5010047b1b KT-16283 Maven compiler plugin warns, "Source root doesn't exist" 2017-04-14 13:27:05 +03:00
Sergey Mashkov 40a5e646c6 KT-10028 Support parallel builds in maven
mark all the mojos as not thread safe so Maven should never run them in parallel
2017-04-14 13:27:05 +03:00
Sergey Mashkov 307fdd1024 KT-16762 Maven: JS compiler option main is missing 2017-04-14 13:27:04 +03:00
Sergey Mashkov 6de0d79a78 KT-16743 Update configuration options in Kotlin Maven plugin
deprecate parameters module and testModule
2017-04-14 13:27:04 +03:00
Sergey Mashkov de35863b57 KT-16743 Update configuration options in Kotlin Maven plugin
add javaParameters configuration parameter
2017-04-14 13:27:03 +03:00
Sergey Mashkov e6b729d38b KT-16743 Update configuration options in Kotlin Maven plugin
deprecate parameters module and testModule
2017-04-14 13:27:02 +03:00
Alexey Andreev e182290f54 Fix sorting of source files before compilation.
This should fix unstable generated JS between recompilations.
2017-04-14 11:46:52 +03:00
Mikhael Bogdanov a35ad64454 Disable reflection tests on android 2017-04-14 10:33:13 +02:00
Alexander Udalov 7fe9b99087 Support different target platforms for modules in AnalyzerFacade
Instead of reusing the same AnalyzerFacade that is used for resolution
of a module to resolve its dependencies, analyze each dependency
module/library with a facade depending on its target platform. Introduce
and use CommonLibraryDetectionUtil in addition to
KotlinJavaScriptLibraryDetectionUtil, to detect common libraries (with
.kotlin_metadata files).

Note that before multi-platform projects, this was not needed because
there were only two platforms (JVM and JS), and JVM module had only JVM
modules/libraries as dependencies, JS module had only JS
modules/libraries as dependencies. Now, for example, a JVM module can
have a common module/library as a dependency, and it would be incorrect
to analyze that dependency with JvmAnalyzerFacade because that facade
does not know anything about .kotlin_metadata files.

The changes in Dsl.kt and KotlinCacheServiceImpl.kt are needed because
PsiElement.getJavaDescriptorResolver, called from some IDE code, started
to fail on a common module, because the container for a common module
does not have the JavaDescriptorResolver
2017-04-14 00:44:00 +03:00
Alexander Udalov 722687acd6 Refactor multiplatform test cases in MultiModuleHighlightingTest
Groupt multiplatform test cases in a nested class, get rid of duplicated
code, rename "header" -> "common" where it relates to the common module
2017-04-14 00:43:59 +03:00
Alexey Tsvetkov c41818b6a7 Minor: use JDK_18 instead of JAVA_HOME to run Maven IC tests 2017-04-13 21:53:28 +03:00
Alexey Tsvetkov 753c99a377 Wrap getDaemonConnection in try-catch
Just in case it would throw one day
2017-04-13 21:53:28 +03:00
Alexey Tsvetkov 6b315259d3 Fix "Unexpected message" from daemon when CompilerMessageLocation is null
Recently the CompilerMessageLocation.NO_LOCATION was replaced with a null value.
This caused daemon clients to report "Unexpected message" for compiler messages without location.
2017-04-13 21:53:28 +03:00
Alexey Tsvetkov e160931ec5 Delete daemon client file when Gradle process stops
#KT-17177 fixed
2017-04-13 21:53:28 +03:00
Alexey Tsvetkov 34a8896ad4 Minor: rename test KotlinDaemonAdvaced->KotlinDaemonIT 2017-04-13 21:53:28 +03:00
Mikhael Bogdanov a6c9cf7d3f Minor. Cleanup code 2017-04-13 19:04:47 +02:00
Mikhael Bogdanov 3df32ad425 Add flag for dex verification 2017-04-13 19:04:45 +02:00
Mikhael Bogdanov df65b3f6b3 Refactor test framework to process directives in one place
Perform directive processing in base test class
2017-04-13 19:04:44 +02:00
Alexander Udalov c2f275faec Refactor codegen test utilities
Use GenerationUtils.compileFiles instead of
CodegenTestUtil.generateFiles
2017-04-13 19:04:43 +02:00
Mikhael Bogdanov 7613ec54f5 Add run configuration to run common java backend tests under jdk 9
With jvmTarget 1.6 and 1.8
2017-04-13 17:54:39 +02:00
Mikhael Bogdanov a8382c25b2 Add run configuration to run common java backend tests on jdk 8 with jvm target 1.8 2017-04-13 17:54:38 +02:00
Mikhael Bogdanov 806db3852d Support for custom default jvmTarget in jvm backend tests 2017-04-13 17:54:37 +02:00
Mikhael Bogdanov 2bb5b3881a Run dex checker only on java 6 files 2017-04-13 17:54:36 +02:00
Mikhael Bogdanov 73d771717c Don't assign classFileFactory outside generateClassesInFile
Otherwise dex cheker wouldn't be called
2017-04-13 17:54:35 +02:00
Alexey Andreev 5c1882bfcc Unmute test that passes 2017-04-13 17:33:15 +03:00
Dmitry Petrov e0ebaac70c Perform additional checks on catch parameter declaration
KT-8320 It should not be possible to catch a type parameter type
KT-7645 Prohibit default value for `catch`-block parameter
2017-04-13 16:23:17 +03:00
Dmitry Petrov 5ccfbcbe22 KT-4960 Redeclaration is not reported for type parameters of interfaces
When resolving a class body for a class without a primary constructor
(e.g., an interface), no checks were performed for redeclarations
in the corresponding class header.
Creating & initializing a lexical scope of an appropriate kind will do it.
Note that since class has no primary constructor, only type parameters
could be redeclared (and that's KT-4960).
2017-04-13 15:57:24 +03:00
Alexander Udalov eb0c0a8869 Fix incorrect logic in KotlinJavaScriptLibraryDetectionUtil
Previously the lambda almost always returned false, because the library
root is never a JS file with metadata, which led to
processFilesRecursively always returning false, which led to every
library being detected as a Kotlin/JS library here
2017-04-13 14:39:07 +03:00
Nikolay Krasko 01782fb4b9 Fix build: restore lost imports 2017-04-13 14:30:17 +03:00
Alexander Udalov bbdff8c7ce Move DeclarationDescriptor.substitute to separate interface Substitutable
To get rid of pointless/confusing implementations in ModuleDescriptor,
PackageViewDescriptor, TypeParameterDescriptor and others.

Note that there are still implementations that do not make sense, for
example in those subclasses of VariableDescriptor which are not also
subclasses of CallableMemberDescriptor (e.g. ValueParameterDescriptor).
Those can be removed by making CallableMemberDescriptor (instead of
CallableDescriptor) inherit from Substitutable. However, that would
require more changes in the compiler because CallableDescriptor is used
rather often in places where in fact only CallableMemberDescriptor
instances can appear.

Explicit return types and casts are required in some places now because
there's no single non-trivial supertype for
ClassifierDescriptorWithTypeParameters and CallableDescriptor.
Previously it was DeclarationDescriptorWithVisibility, now it's both
that and Substitutable<...>
2017-04-13 14:16:07 +03:00
Nikolay Krasko 9f037c3c62 Minor: remove warnings caused by ExtensionPointName.create nullability 2017-04-13 13:48:03 +03:00
Nikolay Krasko baa75fc8d5 Refactoring: move OptionsParser to separate file 2017-04-13 13:48:02 +03:00