Commit Graph

1680 Commits

Author SHA1 Message Date
Ilya Chernikov 4eb557724c Convert compiler projects to the new intellij deps 2018-01-30 17:06:13 +03:00
Ilya Chernikov c153a386ab Fix tests 2018-01-30 17:06:11 +03:00
Ilya Chernikov a4f28cd94f Make all dependencies to idea sdk intransitive 2018-01-30 17:06:11 +03:00
Ilya Chernikov 74411d9b9c Convert all compiler modules to intellij plugin 2018-01-30 17:06:06 +03:00
Dmitry Savvinov b29a6e48fb Refactor language features, which control effect system
- Introduce new language feature 'ReadDeserializedContracts', which
allows to deserialize contracts from metadata.

- Introduce new language feature 'AllowContractsForCustomFunctions',
which allows reading contracts from sources.

- Use new features instead of combination 'CallsInPlaceEffect ||
ReturnsEffect'

- Rename 'CallsInPlaceEffect' -> 'UseCallsInPlaceEffect',
'ReturnsEffect' -> 'UseReturnsEffect'. As names suggest, they control
if it is allowed to use corresponding effect in analysis.

We have to introduce separate 'ReadDeserializedContracts' to enable
contracts only in some modules of the project, because libraries are
read with project-wide settings (see KT-20692).
2018-01-26 11:30:44 +03:00
Alexey Tsvetkov f77586574f Always sort files in K2JSCompiler
Previously files were sorted only when IncrementalDataProvider
was not null to normalize js output in case of incremental compilation.
Because of that an output js file could be different after rebuild
in IC tests.
The issue could be reproduced anywhere, but the tests failed only on
Windows, and it seems tests were not run on Windows for some time.
2018-01-22 18:34:17 +03:00
Alexander Udalov 95f9884799 Move META-INF/extensions/compiler.xml to module 'cli' 2018-01-18 12:48:04 +01:00
Anton Bannykh c6d7ffb3eb JS DCE: drop unknown file report severity to WARNING
*.kjsm and other files might be received when FileCollection is
used in Gradle as a dependency.

Example: `testCompile project(":$coroutines_core").sourceSets.test.output`
(a popular-ish solution to introduce dependencies between tests)
2018-01-12 20:00:34 +03:00
Anton Bannykh 5d6d321fb2 Reformat K2JSDce.kt 2018-01-12 20:00:34 +03:00
Nicolay Mitropolsky 0acfce55a8 KotlinCoreEnvironment: set ideaCompatibleBuildNumber = "173.1" 2018-01-12 13:53:41 +03:00
Nicolay Mitropolsky 4c775a9516 JvmFacade-related tests repair 2018-01-12 13:53:18 +03:00
Dmitry Jemerov 70caae4c6f Register new service and EPs added in 173 2018-01-12 13:53:02 +03:00
Denis Zharkov 3cfe43f83a Add -Xsupport-compatqual-checker-framework-annotations flag
It's implemented through Jsr305State while it's not related
to jsr-305 becasue currently it's the most convenient way
to introduce the flag.

Probably, it's worth renaming Jsr305State to something more abstract
like NullabilityAnnotationsConfiguration

 #KT-21982 Fixed
2018-01-10 17:02:46 +03:00
Ilya Chernikov efc470df2b Reading KOTLIN_HOME only once
may fix #KT-21145, or at least make it less flaky
2017-12-28 09:43:44 +01:00
Alexander Udalov 129fad6ade Minor, merge two KotlinCoreEnvironment-creating functions 2017-12-27 14:50:04 +01:00
Alexander Udalov 613297ad60 Rename ModuleScriptData -> ModuleChunk and refactor related code
Use the term "build file" instead of the old "module"/"module script"
2017-12-27 14:50:03 +01:00
Ilya Chernikov 953a485fe7 Increment repl line generation on compilation error
fixes #KT-17921 and #KT-21141
Tests added to the JSR223 local eval example
2017-12-26 19:27:32 +01:00
Ilya Chernikov 2d8e73f3f6 Make JSR 223 examples compatible with embeddable compiler, strip ...
some dependencies.
Fixes #KT-17561 and related issues
Warning: API changed slightly
2017-12-26 19:27:31 +01:00
Sergey Igushkin 149b197b24 Fix unconditional warning in JS compilation with sourceMap disabled. 2017-12-25 15:30:01 +03:00
Alexey Tsvetkov fec2d08d22 Compile actual and expected declarations together
#KT-20840 fixed
2017-12-22 16:12:19 +03:00
Alexey Tsvetkov 3f082346ae Do not set api version to language version when language version is null
#KT-21852 fixed
    #KT-21574 fixed
2017-12-18 16:22:07 +03:00
Yan Zhulanow e5a2be4f3c EA-96041: Make error message more user-friendly 2017-12-15 02:08:00 +09:00
Alexander Udalov c5c4c9cfcc Support "-module-name" argument for common code compiler
#KT-20892 Fixed
2017-12-13 11:49:58 +01:00
Alexander Udalov 3ede503042 Minor, remove empty K2JSCompilerArguments.java 2017-12-13 11:49:58 +01:00
Alexander Udalov cc9ebb26de Minor, improve "-module-name" argument description 2017-12-13 11:49:58 +01:00
Alexey Sedunov 38d3362bcb Configuration: Support selection of "Latest stable" version vs specific one
#KT-21229 Fixed
2017-12-12 20:48:26 +03:00
Denis Zharkov e24e711208 Avoid rebuilds after changes of layouts xml-files
This commit makes IC react more granularly on these changes
Precisely, it marks dirty only kt-files that having lookups into
synthetic package built upon a changed layout-file

 #KT-21622 Fixed
2017-12-12 16:17:58 +03:00
Denis Zharkov 34452f4f4a Introduce JavaClassesTracker interface into java resolution components
It's purpose is passing java classes being used during analysis
to incremental compilation to let it track diffs

Potentially it might be done the other way:
incremental compilation could build a separate container to analyze
necessary classes, but it's rather hard to implement now

 #KT-17621 In Progress
2017-12-12 16:17:58 +03:00
Alexander Udalov 3c98274006 Move -Xjsr-305 argument parsing out of K2JVMCompilerArguments
To simplify K2JVMCompilerArguments, which is mostly a data holder
2017-12-11 18:02:37 +01:00
Alexander Udalov 5092758acb Improve help message on -Xjsr305 CLI argument 2017-12-11 18:02:04 +01:00
Alexander Udalov 2be7116b0b Deduplicate classpath roots in compiler when -Xbuild-file is used
In kotlin-gradle-plugin, the compiler is invoked with a
K2JVMCompilerArguments instance where both the classpath is set, and the
buildFile is used (containing the same classpath entries in XML).
Previously, the compiler concatenated those two classpaths, which
resulted in duplicated entries, which could slow down compilation. Now,
if buildFile is used, the classpath passed explicitly is ignored
(exactly as, for example, destination ("-d"), which is also stored in
the XML build file).

No test added because there doesn't seem to be any change in
user-visible behavior
2017-12-08 12:07:22 +01:00
Alexander Udalov d65b999c2c Minor, rename variable for clarity 2017-12-08 12:07:22 +01:00
Denis Zharkov ac56965a99 Do not force loading all kt-files inside LazyPackageDescriptor constructor
Effectively it leads to all stubs being built for any once used package

The idea is that they only were used for FILE_TO_PACKAGE_FRAGMENT
that is mostly read in backend and rarely in the IDE, so we can replace
its usages with searching through related package-fragments
2017-12-07 12:53:33 +03:00
Yan Zhulanow 3d1ca61f9f Kapt: Remove artificial KaptError exception on errors from annotation processor (KT-21262) 2017-12-01 22:53:20 +09:00
Yan Zhulanow eccc3447f6 Infrastructure: move compiler plugin tests back to their modules 2017-12-01 22:53:14 +09:00
Alexander Udalov 7248f2568a Drop USE_NEW_INFERENCE, configure language version settings in KotlinTestUtils
This will only have effect for tests which do not use their own instance
of LanguageVersionSettings though
2017-12-01 13:35:25 +01:00
Alexey Andreev 1d48442a5d Change default output dir in JS DCE Gradle plugin
See KT-21328

Compiler removes all files from its output directory.
Due to this reason (and some other reasons) it't not a good idea
to put DCE output to `classes` dir.
Therefore we changed output dir to `$buildDir/kotlin-js-min`.
Additionally, we now allow to customize output dir.
In particular, this fixes issues with webpack in multi-project build +
continuous Gradle build.
2017-11-29 20:08:30 +03:00
Alexey Andreev 5672e1f56e JS: add DCE devmode. Fix mapping paths in source maps
See KT-20210, KT-21307
2017-11-29 20:08:30 +03:00
Alexey Andreev ffdebfab45 JS: change the way how DCE resolves input paths 2017-11-29 20:08:29 +03:00
Alexander Udalov d4b5032810 Add JDK roots to the beginning of the roots list
This behavior was used until 6a1b6d10d8, where the JDK has
unintentionally started to be added to the end of the list, breaking
code which depended on libraries which bundle something from the JDK

 #KT-21299 Fixed
2017-11-29 11:49:48 +01:00
Dmitry Petrov d976eeabf7 Refactor GenerationState creation 2017-11-29 12:17:06 +03:00
Alexander Udalov aca74cef0e Replace dependencies on kotlin-reflect with kotlin-reflect-api
See the previous commit for information on the kotlin-reflect vs
kotlin-reflect-api distinction.

Add kotlin-reflect as an explicit runtime dependency of most of the test
configurations because even though they all depend on tests-common, the
runtime dependency on kotlin-reflect is not exported from tests-common
to other modules because the projectTests dependency is not transitive.
2017-11-28 12:35:49 +01:00
Dmitry Savvinov 440b6d9934 Add -Xeffect-system CLI argument which enables Effect System 2017-11-23 12:35:51 +03:00
Leonid Startsev d6e5551237 More entry points for compiler plugins
* In Kotlin/JS JPS compilation
* In kotlin-common CLI compiler
* In kotlin-common gradle build
2017-11-23 12:12:01 +03:00
Mikhail Glukhikh 078c27efa3 Add fallback flag for legacy var smart casts after try #KT-21377 Fixed 2017-11-22 18:31:04 +03:00
Mikhail Glukhikh 8b6e63dc18 Add forgotten new inference to JS 2017-11-22 18:31:03 +03:00
Alexander Udalov ad730cedf6 Rename idea/src/META-INF/extensions/{common.xml -> compiler.xml}
To emphasize that this file declares extensions to be registered in the
compiler, not only in the IDE
2017-11-15 11:05:16 +01:00
Alexander Udalov afc9d3ef8b Remove idea/src/META-INF/extensions/{kotlin2jvm.xml,kotlin2js.xml}
Keep the EnvironmentConfigFiles enum because its values are used in
determining whether the environment is going to be used for JVM or
non-JVM project analysis, but remove the actual files.

Drop EnvironmentConfigFiles.EMPTY and replace its only usage in
preprocessor with JVM_CONFIG_FILES: it's easier and won't affect
anything
2017-11-15 11:05:15 +01:00
Pavel V. Talanov ef539bd89d Tests: use standard script definition in cli tests by default 2017-11-14 16:30:35 +03:00
Pavel V. Talanov cdfdc1d19b Refactor script definitions loading
Make ScriptDefinitionProvider an interface
    and provide different implementation for cli and IDEA
Rework ide extension point to a simpler interface (ScriptDefinitionContributor)
Move template loading logic into a top level function
Allow script definitions to be reloaded in IDE
2017-11-14 16:30:33 +03:00