Commit Graph

49 Commits

Author SHA1 Message Date
Alexey Tsvetkov b06b18de07 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
2017-05-31 16:59:03 +03:00
Alexander Udalov 965b4199f4 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
2017-05-24 15:46:57 +03:00
Dmitry Petrov a2db4dc0d5 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
2017-05-18 10:55:16 +03:00
Zalim Bashorov fb9d88315a Don't print unnecessary empty line separators when generate tests 2017-05-16 19:42:47 +03:00
Anton Bannykh 2e9a59819a 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.
2017-05-04 21:44:17 +03:00
Alexander Udalov bb01ca038a 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
2017-04-28 20:49:29 +03:00
Alexey Tsvetkov 50085722d1 Fix internal visibility check for deserialized typealiases
#KT-15495 fixed
2017-04-25 16:27:23 +03:00
Zalim Bashorov 05c3e7e81d 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.
2017-04-17 18:18:31 +03:00
Nikolay Krasko cee54a4111 Revert "Workaround for building against jars from both JDK 6 and JDK 8 on TeamCity"
This reverts commit 0cf1c8d900.
2017-04-11 12:33:07 +03:00
Anton Bannykh 4086a84622 JS: add suffix '_test' to test module output files to avoid name conflicts (KT-16979)
Also stop setting AMD module ids explicitly.
2017-03-28 21:44:56 +03:00
Alexander Udalov c67eb84369 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 5a533a52 and 164c72e8)

 #KT-16931 Fixed
2017-03-27 17:19:24 +03:00
Alexey Tsvetkov 40574d31ac JPS tests: avoid using deprecated API 2017-03-20 18:46:00 +01:00
Nikolay Krasko 95061885b0 Update after separating JPS builders into two modules 2017-03-20 18:45:35 +01:00
Alexey Tsvetkov 05f278ce20 JPS: implement tracking of null annotations
#KT-12933 fixed
    #KT-14266 fixed
2017-03-20 18:45:21 +01:00
Dmitry Jemerov a2b0b3d6eb fix compilation against branch 163 2017-03-20 18:45:15 +01:00
Alexander Udalov bf90cb5cc0 JS: support -Xskip-metadata-version-check for incompatible ABI libraries
Allow the compiler to read such libraries without any errors, at the
risk of crashing with an exception.

Also fix a minor bug in the diagnostic message in LibrarySourcesConfig
and in the corresponding test in KotlinJpsBuildTest
2017-03-20 17:22:29 +03:00
Mikhail Glukhikh b121bf8802 Cleanup: fix some compiler warnings (mostly deprecations, javaClass) 2017-03-15 17:35:31 +03:00
Anton Bannykh 6608e97d35 JPS JS: simplified the code and added tests for the missing meta.js case (e.g. empty sourceroot; fixed by yole in 00ed0248d9a23701dbef52da02259d174a9999e7) 2017-02-28 16:05:16 +03:00
Alexander Udalov 4c9afb9d20 Move testable IS_PRE_RELEASE flag to KotlinCompilerVersion
It'll be used in the JS back-end as well soon, so
DeserializedDescriptorResolver is not the best place for it
2017-02-13 12:11:15 +03:00
Alexey Andreev 7192529733 JS: drop support of old library format 2017-02-10 21:04:50 +03:00
Anton Bannykh f0e3c87b84 JPS: fixed duplicate meta.js in case of multiple source roots in the same module. 2017-02-03 13:03:12 +03:00
Anton Bannykh 289a7a9cc3 JS: fixed support for test source roots (KT-6627) 2017-02-03 13:03:12 +03:00
Alexander Udalov e5680565b3 JS: drop "-kjsm" flag, merge logic with "-meta-info"
#KT-16049 Fixed
2017-01-30 11:31:03 +03:00
Alexey Tsvetkov b9dbe69232 Rebuild all kotlin files when EAP flag is changed 2017-01-26 13:38:52 +03:00
Alexey Tsvetkov 4a63e47aa0 Save JvmBuildMetaInfo to file after build 2017-01-26 13:38:52 +03:00
Denis Zharkov 9f217de10b Write kotlin metadata on class-files for coroutine state machines
Otherwise it breaks JPS assumptions, that leads to exceptions like:
Error:Kotlin: [Internal Error] java.lang.AssertionError: Couldn't load KotlinClass from /Users/jetbrains/IdeaProjects/KotlinPlaygroundBeta11/out/production/KotlinPlaygroundBeta11/Counter$both$1.class; it may happen because class doesn't have valid Kotlin annotations
    at org.jetbrains.kotlin.build.GeneratedJvmClass.<init>(generatedFiles.kt:36)
    at org.jetbrains.kotlin.jps.build.KotlinBuilder.getGeneratedFiles(KotlinBuilder.kt:469)
    at org.jetbrains.kotlin.jps.build.KotlinBuilder.doBuild(KotlinBuilder.kt:241)
    at org.jetbrains.kotlin.jps.build.KotlinBuilder.build(KotlinBuilder.kt:140)
...
2017-01-16 17:53:15 +03:00
Mikhail Zarechenskiy 6cccad9647 Update year in license and regenerate tests 2017-01-10 12:01:17 +03:00
Alexey Tsvetkov 18d50b930d Minor: add Throws(Exception) to avoid override issues in java 2016-11-18 23:17:34 +03:00
Alexey Tsvetkov ea93ec3eec Ensure jps caches are always cleared in tests 2016-11-18 23:17:30 +03:00
Zalim Bashorov 1dedb38481 Regenerate tests 2016-11-09 21:41:12 +03:00
Alexander Udalov 0b59c71340 Add mock runtime to KotlinJpsBuildTest test cases
To prevent test failures once the JVM compiler stops loading definitions of
built-in declarations from itself and starts to rely on their presence in the
library, that the compiled source code depends on
2016-10-26 16:31:07 +03:00
Alexander Udalov 7b2a80ffa4 Fix incremental recompilation of JvmMultifileClass with top level function
See 53b584f and previous changes where this behavior was broken (this was
untested, however). Fixes EA-90065
2016-10-19 12:50:10 +03:00
Michael Bogdanov d48ef2efc7 Fix for KT-14012: Back-end (JVM) Internal error every first compilation after the source code change
#KT-14012 Fixed
2016-10-18 10:46:51 +03:00
Zalim Bashorov 797f7ab28e JPS: don't consider that the module is not Kotlin JS until check all libraries.
#KT-14082 Fixed
2016-09-29 14:52:51 +03:00
Dmitry Jemerov b315a07f0d delete work dir after each JPS test 2016-07-18 16:52:16 +02:00
Denis Zharkov efe718602a Support type aliases in incremental compilation
#KT-12871 Fixed
2016-06-28 16:22:08 +03:00
Alexey Andreev a9ed789727 KT-3008 Fix CLI and JPS tests related to JS translator 2016-06-27 15:33:28 +03:00
Mikhael Bogdanov a090133581 Inline properties support in incremental compilation 2016-06-24 17:05:53 +03:00
Zalim Bashorov 0e428ca10c JPS: don't consider that production target of module "B" is depends on test target of module "A" when "B" depends on "A"
#KT-12595 Fixed
2016-06-15 15:01:32 +03:00
Denis Zharkov 07592398c1 Preserve sources properly for coroutine parts
Otherwise incremental reporting leads to exception when inlining into coroutine body happens
2016-06-08 18:53:16 +03:00
Zalim Bashorov c11d504a26 Minor: add test for KT-11993 "NoSuchMethodError when testing internal symbols" 2016-05-05 20:45:29 +03:00
Valentin Kipyatkov b551886889 Code cleanup: removed redundant semicolons 2016-04-29 11:26:25 +03:00
Alexander Udalov 2df8e56b94 Do not store project in JPS tests after they're executed
This saves a couple dozen megabytes currently
2016-04-18 17:26:59 +03:00
Nikolay Krasko 0cf1c8d900 Workaround for building against jars from both JDK 6 and JDK 8 on TeamCity 2016-04-12 14:53:20 +03:00
Zalim Bashorov 51c6abdbed IC: take into account added and removed classes when calculate affected names 2016-04-11 19:26:18 +03:00
Nikolay Krasko 47c7181f2a Extract tests-common module without any actual tests
The main reasoning for the module is to avoid running any compiler tests while executing run configuration that searches tests across module dependencies.
2016-04-08 17:40:38 +03:00
Zalim Bashorov f5ca949f2c IC: improve logging in tests and fix DataContainerVersionChangedTestGenerated#testWithError
Test logging improvements:
  * print which chunk building in the round for multimodule projects
  * print actions after cache changed
2016-04-08 13:45:37 +03:00
Nikolay Krasko 9e88db7e58 Fix bad test modification 2016-04-06 21:46:02 +03:00
Nikolay Krasko 46b5305666 Extract jps-tests to separate module
Remove dependency to idea-full to build jps-plugin with Java 1.6
2016-04-05 00:39:46 +03:00