Commit Graph

1307 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov 83764c113f as35: Upgrade to AS 3.5 C10 2019-04-09 15:06:22 +03:00
Alexey Tsvetkov 97d3d38374 Always run codegen when IC is enabled
We may need to run code generation when no source files are specified
for incremental compilation (to update caches & metadata)
2019-03-25 16:39:47 +03:00
Alexander Udalov ed86757817 Rework how built-in types are loaded in compiler for JVM
In TopDownAnalyzerFacadeForJVM, we now always use the "load built-ins
from module dependencies" behavior that was previously only enabled with
the dedicated CLI argument -Xload-builtins-from-dependencies. However,
sometimes we compile code without kotlin-stdlib in the classpath, and we
don't want everything to crash because some standard type like
kotlin.Unit hasn't been found.

To mitigate this, we add another module at the end of the dependencies
list, namely a "fallback built-ins" module. This module loads all
built-in declarations from the compiler's class loader, as was done by
default previously. This prevents the compiler from crashing if any
built-in declaration is not found, but compiling the code against
built-ins found in the compiler is still discouraged, so we report an
error if anything is resolved to a declaration from this module, via a
new checker MissingBuiltInDeclarationChecker.

Also introduce a new CLI argument -Xsuppress-missing-builtins-error
specifically to suppress this error and to allow compiling code against
compiler's own built-ins.

 #KT-19227 Fixed
 #KT-28198 Fixed
2019-03-22 14:59:03 +01:00
Vyacheslav Gerasimov fc8be48fa8 Build: Improve intellij-sdk repo up-to-date check time & layout
Up-to-date check is very heavy for intellij repo due to artifact size.
If module directory in repo is written only by one task we can assume
that task if up-to-date if target directory exists.
2019-03-20 21:29:13 +03:00
Alexander Udalov b73a927133 Remove KotlinTestUtils.replaceHash
Both package parts and SAM wrappers have no hashes in their names for a
long time already
2019-03-05 16:28:53 +01:00
Andrey Uskov 325ed8eb32 Change class hierarchy of KotlinSourceRootType. Deadlock during concurrent classloading fixed
#KT-30137 Fixed
2019-03-01 13:12:16 +03:00
Yaroslav Russkih 9ac52fad17 Use https everywhere - documentation and samples 2019-02-19 21:35:36 +01:00
Anton Bannykh 0fa87e3baa JS: advance IC version 2019-02-14 15:14:28 +03:00
Anton Bannykh 21cbc7b018 JS: add incremental test for local declarations change 2019-02-14 15:14:28 +03:00
Alexey Tsvetkov dbdc7a5b07 Add verbose mode to build reports
#KT-12700

Verbose mode can be enabled by adding `kotlin.build.report.verbose=true`
to `gradle.properties` file.
2019-02-12 22:10:11 +03:00
Alexey Tsvetkov 01c23510c7 Print recompilation reasons in build report 2019-02-12 22:10:11 +03:00
Alexey Tsvetkov 47bb938b94 Adjust build report verbosity 2019-02-12 22:10:11 +03:00
Sergey Rostov f35185b261 Build: remove explicit dependencies to org.jetbrains.annotations 2019-01-28 13:43:08 +03:00
Vyacheslav Gerasimov 13d87e8eae Remove as31 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov 818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Sergey Rostov 75e59fdc46 JPS: exclude source roots from other targets
Previously `findJavaRootDescriptor` was return source root for random
module. This cause build errors for mpp (same file may appear in
multiple source roots of common and platform modules)

#KT-28988 Fixed
2019-01-11 12:53:11 +03:00
Sergey Rostov 5cda676c9f JPS: Print components of CacheVersion, add tests 2019-01-10 08:50:39 +03:00
Sergey Rostov b3985d2735 JPS: remove cache version from test data 2019-01-10 08:50:38 +03:00
Mikhael Bogdanov e963c52c80 Update copyright in generated non-compiler tests 2019-01-02 13:34:03 +01:00
Sergey Rostov 74271cfecd JPS: Use module name from compiler arguments (JVM) 2018-12-26 08:43:00 +03:00
Mikhael Bogdanov c19c979b7d Use last asm api for visitor construction 2018-12-20 12:55:09 +01:00
Alexey Tsvetkov 2196d81322 Enable JS IC by default
#KT-28842 Fixed
2018-12-17 15:46:11 +03:00
Andrey Uskov c85f56a0a8 Remove some bunches for build scripts. 2018-12-06 19:44:09 +03:00
Sergey Rostov df2e4524d7 Move resources from /src to separate /resources directory.
Previously this files was stored in /src directory and was included in
resources mainly by SourceSet.projectDefault from sourceSets.kt:

val processResources = tasks.getByName(processResourcesTaskName) as ProcessResources
processResources.from("resources") { include("**") }
processResources.from("src") { include("META-INF/**", "**/*.properties") }

Also there are some custom rules like this:

resources.srcDir("../idea-analysis/src").apply { include("**/*.properties") }
resources.srcDirs("idea-repl/src").apply { include("META-INF/**") }

All this rules are synthesized in script
https://github.com/snrostov/kotlin-migrate-resources/blob/master/src/main/kotlin/main.kt

This commit created using that script. See README.md for more details on
 script.
2018-11-30 15:01:01 +03:00
Sergey Rostov 62b0b3e4e9 JPS: report about unsupported targets once
Report about unsupported targets once per target type, show presentable
chunks list and don't show more then 5 chunks.

Example: "Native is not yet supported in IDEA internal build system.
Please use Gradle to build a, b, c, d, e and 10 other  (enable 'Delegate
IDE build/run actions to Gradle' in Settings)."

#KT-26980 Fixed
#KT-28316 Fixed
2018-11-28 11:08:57 +03:00
Sergey Rostov ab2b4311fd JPS: fix SimpleKotlinJpsBuildTest.testDaemon
Make it the same as testJpsDaemonIC
2018-11-28 10:46:57 +03:00
Sergey Rostov 0c39358b5f JPS: fix testJpsDaemonIC
1. Checking for COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was moved to COMPILE_DAEMON_DEFAULT_RUN_DIR_PATH.

Looks like COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS was introduced incorrectly in 220fab0d3f.
Checking of this property was added in DaemonOptions.runFilesPathOrDefault, while DaemonOptions.runFilesPath was internally used in runFilesPathOrDefault and in many other places.
For example DaemonOptions.runFilesPath used to pass this option to daemon server.
So daemon was started with runFilesPath that ignores COMPILE_DAEMON_CUSTOM_RUN_FILES_PATH_FOR_TESTS.

2. JpsKotlinCompilerRunner._jpsCompileServiceSession was leaked between tests.

Fixed by extracting @TestOnly releaseCompileServiceSession() and calling it in tests tearDown()

3. The result of compileWithDaemon was ignored in compileWithDaemonOrFallback.

So, the fallback was never called, and the FAIL_ON_FALLBACK_PROPERTY was actually was never worked.
This was fixed. Also the message was improved to make it easier to find the original fail cause.
2018-11-28 10:46:57 +03:00
Sergey Rostov c06b000e8d JPS: Test for "Cyclically dependent modules should have same compiler"
KT-27285
2018-11-28 10:46:57 +03:00
Sergey Rostov 3c8b15ca54 JPS: Report "Cyclically dependent modules should have same compiler" as build error rather than exception
#KT-27285 Fixed
2018-11-28 10:46:57 +03:00
Sergey Rostov ce4422e2ef JPS, tests: Support multimodule mpp tests without steps 2018-11-28 10:46:58 +03:00
Sergey Rostov dcc47fd8ef JPS: support KotlinResourceSourceRootType
Implementation is similar to KotlinSourceRootProvider.
This workaround is required since ResourcesTarget.computeRootDescriptors
supports only JavaResourceRoots.

#KT-27622 Fixed
2018-11-26 09:29:49 +03:00
Sergey Rostov 1301333e37 JPS, tests, minor: rename test files in modules for better readability 2018-11-26 09:29:38 +03:00
Sergey Rostov 63c6e3e1b4 JPS, minor: formatting 2018-11-26 09:29:38 +03:00
Sergey Rostov 32bd4d5936 JPS, tests: update removeAndRestoreCompanion[WithImplicitUsages] test data
src/A.kt is affected by removed classes
2018-11-26 09:29:38 +03:00
Sergey Rostov 7cdd5257c8 JPS: clear target local cache version file when caches are not required anymore
Makes changeIncrementalOption/incrementalOff test green
2018-11-26 09:29:38 +03:00
Sergey Rostov 1f162cfacf JPS, tests, minor: reformat test data for changeIncrementalOption/incrementalOff 2018-11-26 09:29:38 +03:00
Sergey Rostov 4cd4e230bf JPS, tests: update test data for cacheVersionChanged/withError
In this test only lookups caches are invalidated and only in first step.
module4 shouldn't be rebuilt since is compiled in step 1 and it is independent of all dirty modules.

Previously this module was rebuilt because of #KT-27044 which is fixed
by 5232f08
2018-11-26 09:29:38 +03:00
Sergey Rostov a508f53f9d JPS, tests, minor: reformat test data for cacheVersionChanged/withError 2018-11-26 09:29:38 +03:00
Sergey Rostov 06b908d48f JPS, tests: Add docs for incremental/cacheVersionChanged tests 2018-11-26 09:29:38 +03:00
Sergey Rostov dfe662364d JPS, minor: remove unused parameter 2018-11-22 08:40:32 +03:00
Sergey Rostov f70d01f657 Fix updating complementary files map in case of compilation errors
#KT-27868 Fixed

Previously given dirtyFiles was removed from complementaryFilesMap
exactly on call of clearComplementaryFilesMapping. This causes fail
of next build in case of compilation error of previous build on JPS
(since complementary files not known on second build). The right way
to do it is removing (replacing) them only after successful
build.

This was working on Gradle since Gradle rebuilds whole module (project)
in case of build error.
2018-11-22 08:40:32 +03:00
Sergey Rostov cc9892a27d JPS: Add tests for mpp complementary files tracking after build error (KT-27868) 2018-11-22 08:40:32 +03:00
Sergey Rostov 84d6c1df5a Add assertion for overwriting common sources flag
Wrong flag state causes compilation errors for optional expectation
(this flag is used to pass -Xcommon-sources)
2018-11-22 08:40:32 +03:00
Sergey Rostov 5a25d3ef58 Workaround for KT-28099 Duplicated dependency to common module
Duplicated dependencies causes duplicated source roots which in turns
causes duplicated files dirty state tracking.
2018-11-22 08:40:31 +03:00
Alexey Tsvetkov a41c2d759a Avoid catching exceptions from workers in GradleKotlinCompilerRunner
Exceptions were catched in `KotlinCompilerRunner.runCompiler`.
When the method from superclass is not used in
`GradleKotlinCompilerRunner`, the superclass does not make much sense
anymore, so I turned it into util object.
2018-11-14 11:41:43 +03:00
Alexey Tsvetkov 37dfe2b608 Use Workers API for NMPP tasks
This change enables parallel execution of compile tasks in NMPP projects
within a subproject.

    #KT-28155 In Progress
2018-11-14 11:41:43 +03:00
Anton Bannykh 59009430e5 JS: report inline suspend functions to IC
* Also inline suspend lambda'a
* Also use correct JsName's in exported suspend inline fun's
* Also use less unused imports
2018-11-07 12:11:01 +03:00
Sergey Rostov cce125b982 JPS: Don't catch BuildDataCorruptedException as internal error.
BuildDataCorruptedException should be thrown up to `IncProjectBuilder`
to be handled by TeamCity.

#KT-27037 Fixed
2018-10-27 16:08:38 +03:00
Sergey Rostov 0b8d94a6b1 JPS: Fix initialization order for case when all kotlin rebuild.
#KT-27792 Fixed
2018-10-27 16:08:16 +03:00
Vyacheslav Gerasimov 4076923a26 as34: Apply changes from AS 3.3 2018-10-26 18:25:20 +03:00