Commit Graph

1046 Commits

Author SHA1 Message Date
Alexey Tsvetkov ea674ecd97 Remove old IC: remove flags from CompilationResult
Original commit: 50091bfac8
2017-07-31 19:34:58 +03:00
Alexander Udalov 8bccb53e20 Drop deprecated KotlinPaths.getRuntimePath, use getStdlibPath instead
Original commit: 8b149db0ec
2017-07-28 14:16:48 +03:00
Alexander Udalov ddb863f4a6 Refactor utilities in AbstractKotlinJpsBuildTestCase
Original commit: b988582531
2017-07-28 14:16:47 +03:00
Alexander Udalov 9332bd3b97 Move JPS-related kotlin-home detection code to jps-plugin
Original commit: 4b42f9e071
2017-07-28 14:11:35 +03:00
Alexander Udalov 3c4c7734e2 J2K PathUtil: convert and prettify
Original commit: 46a01ec131
2017-07-28 14:11:35 +03:00
Mikhael Bogdanov 45628a15fb Properly generate inner classes when compiling source for inline
KT-19175: Compiler generates different bytecode when classes are compiled separately or together

 #KT-19175 Fixed

Original commit: ff676c050f
2017-07-26 20:31:14 +02:00
Alexander Udalov 5747e1505a 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

Original commit: 2f99f6ad34
2017-07-26 11:45:24 +03:00
Mikhail Zarechenskiy f6eb56c4cc Simplify diagnostic when there are wrong number of type arguments
#KT-12767 Fixed

Original commit: ee173077c0
2017-07-12 14:37:27 +03:00
Ilya Chernikov ba786ee7e2 Rolling back commits related to Unit -> Void? confersion in RMI interface
since it breaks the compatibility and doesn't actually help - the problem
with NoClassDef Unit is apparently elsewhere.

Original commit: fc12f37105
2017-07-11 15:06:38 +02:00
Mikhail Glukhikh 3f0e3902f0 More cleanup: lift return / assignment out
Original commit: dfe2c16bc7
2017-07-10 12:59:58 +03:00
Alexey Andreev 41e4f7eaba Copy stdlib-js source map during JPS build
Original commit: 7edb352aeb
2017-07-10 12:42:33 +03:00
Ilya Chernikov 6ce3d5adc1 Get rid of kotlin.Unit usage in RMI interfaces
attempt to fight mysterous "Cannot instantiate kotlin.Unit" exception.

Original commit: 21eed9ee78
2017-07-08 18:16:29 +02:00
Ilya Chernikov a30506e404 Fix failing tests on TC on Windows by falling back to standard launcher
...in one more case
Plus some minor test tweaks, diagnostics improvement and important comments

Original commit: 06d27a9efa
2017-07-08 18:16:28 +02:00
Alexander Udalov eb54e42adf Rename -module argument to -Xbuild-file
To prevent confusion with Java 9 module-related arguments

 #KT-18754 Fixed

Original commit: 55468735df
2017-07-06 17:03:25 +03:00
Mikhail Glukhikh 3f1c413ee9 Code cleanup: several inspections applied
Original commit: 840847e47c
2017-06-29 16:25:57 +03:00
Alexander Udalov 186b002a01 Implement Java 9 module visibility checks
In this commit, only IDE tests are added, because we look for module
declarations in the IDE across the whole project, whereas in the
compiler we should do this on the module path only and that requires
separate work (KT-18599) which is done in the following commits.

(The change in Cache.kt is needed so that
JvmModuleAccessibilityChecker.ClassifierUsage, which is an inner class,
would be injected properly.)

 #KT-18598 In Progress
 #KT-18599 In Progress

Original commit: e32880d9a3
2017-06-29 15:59:56 +03:00
Alexander Udalov d4f67643d8 Refactor MockLibraryUtil and related tests
- separate compileLibraryToJar into two public functions, for JVM and JS
- allow to pass any extra options instead of just -Xallow-kotlin-package
- add a bunch of default arguments for the most common cases

Original commit: 8af923c5ff
2017-06-26 16:22:04 +03:00
Mikhail Zarechenskiy 157729b31d Do not propose to specify constructor invocation in diagnostics
#KT-17188 Fixed

Original commit: 0579604653
2017-06-22 15:02:10 +03:00
Alexey Andreev 524001e97e Add support for relative JS source map paths in JPS
Original commit: 1d6f01ee6c
2017-06-20 17:40:33 +03:00
Alexander Udalov 5445b75309 Fix KotlinJpsBuildTest.testHelp on Windows
Original commit: a614419b43
2017-06-07 14:17:35 +03:00
Alexander Udalov c27636cf3a CLI: fix non-XML rendering of argument parse error, simplify code
If the compiler is invoked through JPS, an instance of
XmlMessageRenderer is used and the output should be a valid XML.
Previously, we reported the argument parse error (and the note to try
"-help") before calling messageRenderer.renderPreamble, which resulted
in invalid XML. The same was happening for the usage printed on "-help".
Both of these problems are fixed

 #KT-14848 Fixed

Original commit: a802e7fb71
2017-06-06 19:52:04 +03:00
Alexander Udalov 2b630b38ab 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)

Original commit: 7febd846e8
2017-06-06 14:29:26 +03:00
Alexey Tsvetkov c70d749476 Set destination to null when module is set in JPS
This fixes the warning "The '-d' option with a directory destination
is ignored because '-module' is specified", when a project imported
from Gradle is built with JPS.

    #KT-17665 fixed

Original commit: b06b18de07
2017-05-31 16:59:03 +03:00
Alexey Andreev ad224cb6ac Command-line tool for JS DCE
Original commit: 8a8fdf1968
2017-05-26 18:20:17 +03:00
Dmitry Petrov 8077289242 Update testData after changes in diagnostics
Original commit: c83b764c73
2017-05-26 13:58:46 +03:00
Dmitry Petrov cb8ab93160 Update testData for changed diagnostic messages
Original commit: 7979663e6c
2017-05-26 13:58:46 +03:00
Alexander Udalov 7231c777c1 Fix compilation against JRE 9 on JPS
Write the modular JDK (9+) path to the module.xml file passed to the
compiler from the JPS plugin. This path is then recorded in the compiler
configuration in KotlinToJVMBytecodeCompiler.configureSourceRoots. This
is needed because in JPS plugin, we pass "-no-jdk" and thus no JDK home
path was recorded in the compiler configuration in
K2JVMCompiler.setupJdkClasspathRoots. Presence of JDK home path in the
configuration is crucial for JDK 9 support (see
KotlinCoreEnvironment.Companion.createApplicationEnvironment), because
classes there can only be loaded with the special "jrt" file system, not
as .class files in .jar files

 #KT-17801 Fixed

Original commit: 965b4199f4
2017-05-24 15:46:57 +03:00
Alexey Sedunov f679043929 Kotlin Facet: Do not rewrite v2 configuration to latest version
This causes unwanted changes in configuration files
after plugin update

Original commit: 151b512a6c
2017-05-22 13:51:07 +03:00
Valentin Kipyatkov 0fbb7719c5 Fixed error message to quote parameter name
Original commit: 1fe6886a33
2017-05-20 23:44:20 +03:00
Dmitry Petrov 8f05bad893 Fix incremental compilation problems related to type alias constructors
1. Determine source element for descriptors with NO_SOURCE recursively.

2. Always provide type abbreviation for type alias constructor
return type.

 #KT-15495 Fixed

Original commit: a2db4dc0d5
2017-05-18 10:55:16 +03:00
baratynskiy f2eb937c11 Add tools.jar for JPS plugin
Original commit: 91412b0ee9
2017-05-17 17:48:59 +03:00
Zalim Bashorov e476fb3bfd Don't print unnecessary empty line separators when generate tests
Original commit: fb9d88315a
2017-05-16 19:42:47 +03:00
Dmitry Petrov ab26de17eb Update test for incremental compilation after new DCE
Previous test had an inline setter that didn't produce any effect,
thus, corresponding code was removed by new DCE.
Make sure that changes made in the inline property are caught up by IC.

Original commit: 8903504334
2017-05-16 17:28:43 +03:00
Anton Bannykh 48328f7989 JS: support internal visibility from friend modules
Friend modules should be provided using the -Xfriend-modules flag
in the same format as -libraries. No manual configuration required for
JPS, Gradle and Maven plugins.

Friend modules could be switched off using the -Xfriend-modules-disabled
flag. Doing that will
  * prevent internal declarations from being exported,
  * values provided by -Xfriend-modules ignored,
  * raise a compilation error on attemps to use internal declarations from other modules

Fixes #KT-15135 and #KT-16568.

Original commit: 2e9a59819a
2017-05-04 21:44:17 +03:00
Alexander Udalov 8c25a1982e Change how kotlinc and tools display their version
- Display the Kotlin version in kotlin-gradle-plugin. This is needed
  because if "-version" is specified in compiler arguments, the "info"
  level of the message printed by the compiler in CLICompiler prevents
  it from being displayed by default (unless "--debug" is passed to
  Gradle).
- Display the version of JRE the compiler is running on. This will be
  helpful to diagnose Java 9 related issues in the future.
- In CLI, also display the executable name (kotlinc-jvm or kotlinc-js)

Original commit: fcf44af294
2017-04-28 20:49:54 +03:00
Alexander Udalov 5629e77d87 Improve messages printed by JPS plugin in Messages view
- Don't print "Loaded plugin: KotlinAndroidJpsPlugin" and "Using
  kotlin-home = ..." for every build. They are rarely useful; they can
  be found in the build log now
- Instead of potentially confusing for the user "Kotlin JPS plugin
  version ..." output simply "Kotlin version ...". Also add the version
  of the JRE, where the compiler is being run
- Do not treat messages reported with severity LOGGING as BuildMessage
  with kind PROGRESS. Such build messages are displayed to the user in
  the progress/status bar when IDEA Make process is running, but LOGGING
  messages never had this meaning. In particular, users could be
  confused by the progress bar message "Kotlin: Configuring the
  compilation environment" visible for a very long time during
  compilation. This message just happens to be the last LOGGING message
  reported by the compiler before the actual compilation; its presence
  there created an illusion that Kotlin spends most of the time
  configuring the compilation environment

 #KT-17387 Fixed

Original commit: bb01ca038a
2017-04-28 20:49:29 +03:00
Alexander Udalov 96f67570e6 Introduce "-Xreport-output-files" to report source-output mapping for JPS
This makes "-verbose" not required for JPS to run correctly and
therefore allows to print more useful debugging stuff in the compiler
and read them in CLI, for example. The output will also be more readable
because there'll be no "output" messages

Original commit: d8d3bafbe9
2017-04-28 20:49:28 +03:00
Alexey Tsvetkov ce22d1cf9b Fix internal visibility check for deserialized typealiases
#KT-15495 fixed

Original commit: 50085722d1
2017-04-25 16:27:23 +03:00
Zalim Bashorov 74f1a0cb73 Don't export kotlin-reflect form util module and add it explicitly where it's required.
Also, remove kotlin-reflect form container module.

Main goal is get rid of kotlin-reflect.jar from modules what required for minimal compiler.jar which can compile Kotlin only to JS to make it smaller.

Original commit: 05c3e7e81d
2017-04-17 18:18:31 +03:00
Alexander Udalov 7f8b88fee2 Do not parse/serialize additional compiler arguments in JPS
This is mostly a revert of f936dea8, where the issue of the compiler
failing on repeated command line arguments was worked around. Now the
compiler behaves more properly: it uses the last passed argument and its
value, and prints a warning that several values have been passed. With
this behavior, the workaround is no longer necessary

Original commit: dc5e51f4ac
2017-04-17 15:51:43 +03:00
Alexander Udalov abacf2845f 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)

Original commit: be54e4b93b
2017-04-14 20:07:54 +03:00
Zalim Bashorov 6bedbfb67f Add tests for KT-12199 to prevent regression
#KT-12199 Obsolete

Original commit: 712b2c8117
2017-04-11 15:46:13 +03:00
Nikolay Krasko 4009a45bcd Revert "Workaround for building against jars from both JDK 6 and JDK 8 on TeamCity"
This reverts commit 6666fa1c77.

Original commit: cee54a4111
2017-04-11 12:33:07 +03:00
Alexander Udalov a56ccdc951 Use null instead of CompilerMessageLocation.NO_LOCATION in MessageCollector
Original commit: 861d9a1620
2017-04-11 12:08:31 +03:00
Alexey Sedunov 55c4221d9f Kotlin Facet: Fix facet creation with non-default JVM target
Original commit: 18632c3200
2017-04-06 18:18:31 +03:00
Alexey Sedunov 24eae3367d Kotlin Facet: Convert paths to OS-independent form
#KT-17223 Fixed

Original commit: 6bf23d5e02
2017-04-04 14:35:12 +03:00
Anton Bannykh 34e697e991 JS: add suffix '_test' to test module output files to avoid name conflicts (KT-16979)
Also stop setting AMD module ids explicitly.

Original commit: 4086a84622
2017-03-28 21:44:56 +03:00
Alexander Udalov 2208b46941 Support nested classes in KotlinCliJavaFileManagerImpl.findClass
findClass(String, GlobalSearchScope) is invoked for example when we're
resolving supertypes of classes in Java libraries. Previously, it never
found nested classes and falled back to CoreJavaFileManager's
implementation, which lacks a fix for the original issue (KT-12664,
which was fixed in JvmDependenciesIndex in ff783f1f and 2c344635)

 #KT-16931 Fixed

Original commit: c67eb84369
2017-03-27 17:19:24 +03:00
Alexey Tsvetkov bf01fa4729 Use connect-and-lease when using daemon in JPS & Gradle
Relates to KT-15562 "Service is dying".

This commit includes multiple changes:
 1. JPS & Gradle daemon clients are refactored to use `connectAndLease` from `KotlinCompilerClient`.
 `connectAndLease` was introduced in previous commits
 2. `withKotlin` was removed because `connectAndLease` already covers retrying on connection error
 3. Gradle flag files creation is changed:
   * client-alive flag file lives as long as Gradle instance lives,
   * session-alive flag file lives until the end of a build.

Original commit: 9d95c841a6
2017-03-24 19:03:36 +03:00
Alexey Tsvetkov a4cffe9b9e Improve daemon client debug reports
Before this change a daemon client debug messages were printed
only when the client could not connect and the 'kotlin.daemon.verbose'
system property was set up.

Now messages are printed if the debug logging is enabled and
the 'kotlin.daemon.verbose' is set up.

Original commit: 9819de1abd
2017-03-24 19:03:32 +03:00