Commit Graph

501 Commits

Author SHA1 Message Date
Ilya Chernikov c91a3f8bf0 Add sam-with-receiver and source-sections compiler plugins to maven
rename source-sections compiler plugin jar in the dist (add kotlin- prefix),
according to the agreed naming scheme for the artefacts. (The renaming of the
other plugins should follow.)
in addition configure proguard to retain VirtualFile members, since they
are used in the source-sections plugin
2017-04-19 15:22:15 +02:00
Zalim Bashorov 51e84f7ce4 Move some script related part of frontend to separate module to avoid using kotlin-reflect.jar in frontend 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:35 +03:00
Denis Zharkov 5e449fdc02 Optimize control-flow analysis by use of persistent maps
The case that it's worth to optimize is functions
with a lot of variables.

After debugging it's recovered that control-flow works nearly
O(n * m) where n is pseudocode size and m is a number of variables:
the algorithm performs O(n) copies of hashmap of size O(m)

Persistent maps should help because we don't need to perform a
copy of them, so the expected performance after the change is applied
is O(n log m)

We've tried pcollections and javaslang, and the latter one has demonstrated
better results

See results before and after optimizations
before:
https://github.com/dzharkov/kotlin-compiler-benchmarks/blob/3da7ba45a704969653d70b50995f730e968540d8/reports/benchmarks-many-vars-2017-03-14.txt

after with pcollections:
https://github.com/dzharkov/kotlin-compiler-benchmarks/blob/3da7ba45a704969653d70b50995f730e968540d8/reports/benchmarks-many-vars-persistent-optimizations-2017-03-17.txt

after with javaslang:
https://github.com/dzharkov/kotlin-compiler-benchmarks/blob/d22a871b175b291fb337b51ef6465ba70bbfd96c/reports/benchmarks-many-vars-javaslang-2017-04-07.txt
2017-04-11 11:26:11 +03:00
Ilya Gorbunov 3425f6d3af Remove dist-quick as it fails on terminal steps anyway.
Add compiler-for-maven packing step to dist-quick-compiler-only.
2017-04-10 19:46:06 +03:00
Ilya Gorbunov 37e046f6cd Provide shortcuts for producing quick compiler for maven and rebuilding stdlib-js from ant. 2017-04-10 19:46:06 +03:00
Ilya Gorbunov afba967fcf Use kotlin-stdlib.jar instead of kotlin-runtime.jar as runtime during build 2017-04-10 19:46:06 +03:00
Ilya Gorbunov e7dc7ec005 Rebuild sources for kotlin-daemon-client and compiler-client-embeddable in maven build
Do not build these sources in ant.
Do not require them as artifact dependencies.
2017-04-08 19:07:54 +03:00
Ilya Gorbunov 6e961be1a1 No need to fork ant under jdk8 to build annotation-processing 2017-04-08 08:31:03 +03:00
Ilya Gorbunov eef835f6c1 Remove ant targets that are superseded by gradle build. 2017-04-08 08:31:01 +03:00
Ilya Gorbunov 356f8dd0d1 Killswitch: do not build runtime with ant, switch to gradle artifacts. 2017-04-06 20:32:37 +03:00
Ilya Gorbunov df44f3bfe6 Launch kotlin runtime gradle build from ant.
Fork ant to build compiler as it requires a lot of memory.
Pass build.number to gradle build.
2017-04-06 20:32:37 +03:00
Ilya Chernikov a309511adf Add actual sources to compiler and daemon client jars 2017-04-06 10:02:46 +02:00
Ilya Chernikov 7ceaca133a Add new artifact kotlin-compiler-client-embeddable.jar 2017-04-06 10:02:44 +02:00
Ilya Chernikov 32d0d7a4d5 Remove xerces from compiler uberjar, pack compiler with explicit jar names
xercesImpl was unnecessarily added to the compiler uberjar during migration
to the idea platform 171. This caused NCDFE about classes from org.w3c
package.
And to simplify application of this commit and to ensure that only required
jars are packed into the uberjar, the build.xml was altered to use
explicit list of the jars from the ideaSdk/core directory, rather than
a mask.

Fixes #KT-17143 and #KT-17157

(cherry picked from commit 5595bea)
2017-04-04 15:14:46 +02:00
Ilya Gorbunov c740c0b177 Do not produce javadoc for kotlin-compiler and do not attach it to maven artifacts 2017-04-01 04:32:01 +03:00
Alexander Udalov a5d70cfa68 Support running Kotlin compiler CLI on Java 9 on Unix
Workaround IDEA-170005, IDEA-170494 and similar issues by opening the
required packages from java.base to the unnamed module

 #KT-14988 In Progress
2017-03-30 13:04:41 +03:00
Ilya Chernikov 4b430b49a7 Implement source sections compiler plugin
allows to compile only parts of the source files, denoted by top-level
"sections" (function with lambda param calls), but preserving original
file line/column numbers for easier diagnostics. Allow e.g. to compile
gradle "buildscript" section without preprocessing original file in
advance. See tests for examples.
2017-03-21 16:30:46 +01:00
Dmitry Jemerov 3a8cf68541 Keep class file version during shrinking; generate Java 8 bytecode
sometimes
2017-03-20 18:45:59 +01:00
Alexey Sedunov 73b879ea89 Misc: Include cli-parser 1.1.2 sources into the project under different package and drop original library dependency
This would allow building the project with Kotlin JPS plugin on TeamCity where older library takes precendence due to appearing earlier in JPS classpath
2017-03-14 15:33:06 +03:00
Dmitry Jemerov 1d86bd5610 Build multiplatform stdlib docs 2017-03-01 16:08:38 +01:00
Dmitry Jemerov adc937c57d Extract separate target for preprocessing JS stdlib sources 2017-03-01 16:08:28 +01:00
Alexander Udalov c10524586a Use proguard to remove unused symbols from kotlin-reflect.jar
#KT-16268 Fixed
2017-02-15 10:46:48 +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
Alexander Udalov 46bf057b47 JS: do not generate .meta.js and .kjsm for built-ins 2017-01-30 11:31:02 +03:00
Zalim Bashorov 29ac01f2e2 KJS: allow to use packages with names starting with "kotlin" only if the -Xallow-kotlin-package command line option is specified
#KT-14668 Fixed
2017-01-29 17:21:01 +03:00
Ilya Gorbunov 0df31f1223 Build kotlin-stdlib-js.jar in ant
#KT-15940
2017-01-27 22:19:40 +03:00
Ilya Gorbunov f9e552e3c2 Build kotlin-stdlib in addition to kotlin-runtime in ant build. 2017-01-24 22:38:05 +03:00
Ilya Gorbunov a0cfd8d35e Change builtins module name to kotlin-runtime to match that of maven built artifact. 2017-01-24 22:04:46 +03:00
Ilya Gorbunov 9b9852cdc9 kotlin-test: rename shared module to common.
Do not use shared kotlin-test while building js stdlib.
2017-01-24 19:39:05 +03:00
Sergey Mashkov 98075c17c9 kotlin-test: extract from JS library, convert to multiplatform 2017-01-23 15:43:02 +03:00
Alexander Udalov fc637eb420 Change runtime component from "Core" to "Main"
This is needed to allow the old compiler have the new runtime libraries in the
classpath. See the previous commit for a more elaborate explanation
2017-01-21 12:57:15 +03:00
Zalim Bashorov 7f10ce072f KJS: move js part of "kotlin.js" and related files to "js.libraries" module 2017-01-18 14:25:36 +03:00
Zalim Bashorov cb4c3ed686 KJS: rename "js.dart-ast" module to "js.ast" 2017-01-09 17:13:23 +03:00
Alexander Udalov c4f731b987 Write Kotlin-Version to runtime artifacts built with Maven
Add a test that checks that Kotlin-Version and Kotlin-Runtime-Component have
been written to all relevant runtime libraries
2016-12-26 17:46:36 +03:00
Alexey Tsvetkov f40a3eff20 Move IC from Gradle to compiler
Reasons for moving:
1. Integration with Kotlin daemon for Gradle.
Gradle bundles Kotlin compiler (kotlin-compiler-embeddable) since Gradle 3.2.
There is no plugin isolation in Gradle, so strange compilation errors/exceptions may happen.
We decided to fix this problem by compiling out-of-process using Kotlin daemon.

Reasons for moving IC to the compiler:
* Better isolation from Gradle process.
* Incremental compilation logic is not scattered across two process and multiple modules.
* Makes it possible to implement standalone CLI IC
2016-12-19 22:46:12 +03:00
Alexander Udalov 90eb229036 Extract compiler-for-maven target in build.xml
To be used after "compiler-quick" to quickly test changes to the compiler in
the Maven build
2016-12-15 12:11:31 +03:00
Dmitry Petrov 1866a33781 Check classpath version consistency.
Add 'Kotlin-version' attribute to kotlin-runtime and kotlin-reflect JARs.
2016-12-13 21:08:59 +03:00
Yan Zhulanow de15003706 Minor: Add sam-with-receiver to Ultimate project classpath, fix cli plugin path in build.xml 2016-12-09 20:26:41 +03:00
Yan Zhulanow cbef0250aa Allow to turn the first parameter of a SAM-converted lambda into the receiver (KT-12848) 2016-12-09 20:01:21 +03:00
Yan Zhulanow e626b121ad NoArg: Add compiler plugin 2016-12-09 20:01:10 +03:00
Yan Zhulanow 6abde4223b AllOpen: Add IDE integration 2016-12-09 20:01:07 +03:00
Yan Zhulanow 58f408e173 Allopen: Add allopen compiler plugin 2016-12-09 20:00:54 +03:00
Yan Zhulanow bd9d33fe44 Kapt3: Replace kapt2 in Ant and Maven artifacts with kapt3 2016-12-05 19:57:34 +03:00
Alexey Andreev 20669c1b97 JS: fix building stubs for JS library that contains classes in default package 2016-11-24 17:49:11 +03:00
Alexey Andreev 23428c9544 JS: fix coroutine test. Fix hanging IDEA tests 2016-11-23 17:01:03 +03:00
Ilya Gorbunov 491ca582b3 Include collection type aliases into mock-runtime as they are used extremely often in tests 2016-11-21 18:20:33 +03:00
Ilya Gorbunov ed3c54dbd0 Include new type aliases into mock runtime. 2016-11-16 18:47:42 +03:00
Alexey Andreev 5ef8879aae JS: fixes after code review 2016-11-11 16:26:39 +03:00
Alexey Andreev a452260da6 JS: simplify merging kotlin.js 2016-11-11 16:26:38 +03:00
Alexey Andreev f244bbaae3 JS: change how declarations are exported from modules. Change how parts of kotlin.js merged 2016-11-11 16:26:36 +03:00