Commit Graph

81 Commits

Author SHA1 Message Date
Alexey Andreev 8a8fdf1968 Command-line tool for JS DCE 2017-05-26 18:20:17 +03:00
Alexander Udalov 9b85fed3c4 Fix typo in kotlinc-js help
File separator is '/', path separator is ':' or ';'
2017-05-18 13:29:03 +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 fcf44af294 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)
2017-04-28 20:49:54 +03:00
Alexander Udalov d8d3bafbe9 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
2017-04-28 20:49:28 +03:00
Alexander Udalov 072f87ddab Introduce -Xintellij-plugin-root, deprecate CompilerJarLocator 2017-04-14 20:13:11 +03:00
Alexander Udalov be54e4b93b 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)
2017-04-14 20:07:54 +03:00
Alexander Udalov f4b6db4dc0 Change format of -X arguments to require value after '='
Report a warning when an argument is passed in the old form (with the
whitespace)

 #KT-17264 Fixed
2017-04-14 20:07:54 +03:00
Dmitry Jemerov 406714a1f4 Remove warning for running the compiler under Java 6/7
Now the compiler won't even start, so no need to check this manually.
2017-04-10 17:30:03 +02:00
Anton Bannykh 9b34e21619 JS: fixed <Type>Array.iterator methods; added -Xtypedarray compiler key
The <Type>Array.iterator used to lack next<Type>() method (KT-16626).

The -Xtypedarray compiler key enables translation of primitive arrays
to TypedArrays, and primitive array`is`-checks (KT-15358, KT-14007,
KT-14614, KT-16056).
2017-03-27 23:09:34 +03:00
Dmitry Jemerov 0d86bdd216 Remove Java 6/7 warning from expected output of the compiler 2017-03-20 18:45:51 +01:00
Dmitry Jemerov af7de9a0c5 Warn when running the compiler under Java 6 or 7
(cherry picked from commit 5537800)

(cherry picked from commit 5614874)
2017-03-01 16:21:57 +01:00
Alexander Udalov 2e8bfde2e7 Move -Xskip-metadata-version-check from JVM to common arguments
To be used in JS
2017-02-15 10:46:48 +03:00
Alexander Udalov 20d856fa77 Minor, remove blank line in extra help 2017-02-13 14:09:38 +03:00
Alexey Andreev 7192529733 JS: drop support of old library format 2017-02-10 21:04:50 +03:00
Alexey Andreev 9d6f4d7770 JS: don't treat library without JS metadata as error, report warning and continue instead. See KT-16158 2017-02-08 11:29:30 +03:00
Alexander Udalov 464820458e JS: rename "-library-files" argument to "-libraries" and change separator
Use the system separator (':' or ';') instead of commas

 #KT-16083 Fixed
2017-01-31 16:26:35 +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 ef42e3e4aa JS: write full version (major.minor.patch) to .meta.js 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
Alexey Andreev 31c758994d JS: remove diagnostic about callable reference to built-in 2017-01-25 18:09:22 +03:00
Mikhail Zarechenskiy d1a3c4c48b Fix description of -Xcoroutines key 2016-12-15 23:58:11 +03:00
Mikhail Zarechenskiy 664485f4bb Introduce keys to control applicability of coroutines
By default now we produce warnings on coroutines
2016-12-15 23:58:07 +03:00
Alexander Udalov 204873edf2 Support "-Xno-check-impl" argument, check only real declarations
Use "-Xno-check-impl" to suppress checking whether the platform declaration
implementation has the "impl" modifier.

Do not check presence of fake overrides from platform class in the impl class,
otherwise there would be a lot of errors about the fact that
equals/hashCode/toString are not marked with the "impl" modifier
2016-11-25 20:50:29 +03:00
Alexander Udalov 73f872172f Add multi-platform projects as experimental language feature 2016-11-22 18:19:01 +03:00
Zalim Bashorov bdecb661e3 KJS: fix wrongAbiVersion test after abi version was increased. Make it less fragile with the hack for JS tests. 2016-10-20 13:47:50 +03:00
Zalim Bashorov 279b4dc03c Remove obsolete test about class literals is not supported 2016-10-14 19:44:55 +03:00
Alexander Udalov 167ab1f860 Introduce "-api-version" CLI option
The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.

Also support "!API_VERSION" directive in diagnostic tests

 #KT-14298 Fixed
2016-10-11 17:46:01 +03:00
Alexander Udalov 8d660c2f6e Refactor gradle option generation mechanism
Ensure there's a statically checked dependency on LanguageVersion and
JvmTarget, so that this information is updated automatically once a new
language version or a JVM target is added
2016-10-11 17:30:15 +03:00
Alexey Tsvetkov 8fa7e1f93e Minor: JS test fix 2016-10-05 22:50:46 +03:00
Alexey Andreev cfbe48ac46 KT-3008: fix ABI compatibility test 2016-06-27 15:33:31 +03:00
Alexey Andreev a9ed789727 KT-3008 Fix CLI and JPS tests related to JS translator 2016-06-27 15:33:28 +03:00
Alexey Andreev b556b6efca KT-3008 Fix JS backend tests 2016-06-27 15:33:24 +03:00
Alexander Udalov bc5202a4d7 Validate "-language-version" argument value, add tests 2016-05-26 22:15:39 +03:00
Alexander Udalov e1ba4480d7 Support "-language-version" CLI option for compatibility with older releases
Introduce LanguageFeatureSettings, instance of which should be injected by the
container and be accessible everywhere during the compilation (front-end and
back-end).

Parameters of LanguageFeatureSettings are unused in this commit, will be used
later
2016-05-26 22:15:39 +03:00
Alexander Udalov 3b22483fb2 CLI tests: move file existance checks to config files 2016-02-17 20:51:57 +03:00
Zalim Bashorov c28b701ccf JS: ignore annotation on expression when its retention is SOURCE
#KT-8258
2016-02-15 21:35:30 +03:00
Michael Nedzelsky c80c33efb6 add kjsm option for kotlin js command line compiler 2015-11-23 22:32:32 +03:00
Alexander Udalov dce64c974f Don't output error for "kotlinc -version"
#KT-9676 Fixed
2015-11-05 15:13:19 +03:00
Denis Zharkov f0e3fd617d Adjust testData to CharSequence.length transformation 2015-10-14 20:39:35 +03:00
Mikhail Glukhikh 3770e7f49f Introduction of AnnotationTarget.CLASS as a replacement for CLASSIFIER (first step) 2015-09-11 17:59:40 +03:00
Mikhail Glukhikh 8f7b29f80a Annotation rename: target --> @Target 2015-09-07 13:42:26 +03:00
Mikhail Glukhikh 0d2a81f098 Annotation target checking in front-end, a set of tests for different annotation targets, existing test fixes
No checks for erroneous annotations. Additional checks for identifiers.
2015-07-14 16:25:04 +03:00
Dmitry Jemerov 5eb4a47a1a command line flag to repeat compilation multiple times 2015-06-17 14:55:12 +02:00
Alexander Udalov 54dfd626ab CLI: improve diagnostic message format
- render the whole line where the error/warning points to, if any, and another
  line with '^', like other compilers do
- lowercase diagnostic severity
- decapitalize the message if it doesn't start with a proper name
2015-06-15 15:42:41 +03:00
Alexander Udalov bca5eb083e Don't report warnings when there are errors
All sane compilers do this
2015-06-15 15:42:40 +03:00
Michael Nedzelsky 744e760444 tests for KT-7618 Compiling Maven project targeting JS fails when no source file present 2015-06-11 22:21:25 +03:00
Michael Nedzelsky 999c83240c JS: error message (not exception) for incompatible abi version during compilation 2015-06-10 05:37:57 +03:00
Alexander Udalov 45c28abfee Keep built-in metadata for reflection interfaces
Reflection interfaces (interfaces in kotlin.reflect.* in core/builtins/) are
now fully considered as built-ins and can be accessed via KotlinBuiltIns. This
increases runtime size by ~20kb, but only because KotlinBuiltIns is static and
is therefore constructed only via resource loading from the compiler classpath
at the moment. As soon as it's possible to inject KotlinBuiltIns to the
particular resolution process, the metadata on JVM will be loaded via standard
annotation mechanism (kotlin.jvm.internal.KotlinClass/KotlinPackage) and wasted
runtime space will be reclaimed
2015-05-26 14:27:38 +03:00
Michael Bogdanov ef4981b0ef Report error on indirect inline cycles 2015-05-21 10:06:02 +03:00