Commit Graph

44663 Commits

Author SHA1 Message Date
Alexander Udalov a23af6306c Update test data of log tag consistency test on lint
The reason is that UastUtils.tryResolveNamed (in
LogDetector.checkTagConsistent) started to refer to the field of the
property in the companion after d0ed0c4049 instead of its getter
2018-03-15 18:19:43 +01:00
Denis Zharkov 21932b5824 Use mockJDK as a bootClasspath for AbstractCompileKotlinAgainstJavaTest
Otherwise JAVA_HOME is being used that lead to test result depending
on minor JDK version used on a computer

 #KT-21047 Fixed
2018-03-15 19:00:31 +03:00
Denis Zharkov 1766812bf3 Minor. Reformat AbstractCompileKotlinAgainstJavaTest 2018-03-15 19:00:31 +03:00
Denis Zharkov c334f46825 Avoid retaining reference to ProtoBuf.Package in JvmPackagePartSource
Otherwise, 2e933a165a doesn't help
2018-03-15 18:59:44 +03:00
Denis Zharkov 4b78abaa7a Minor. Reformat JvmPackagePartSource 2018-03-15 18:59:44 +03:00
yukuku 6f6b0baf3b Fix wrong example on the docs of @PurelyImplements 2018-03-15 18:56:26 +03:00
Alexey Tsvetkov baa20e2677 Ensure absolute paths are written to module xml file
Since d0ca0dca2b
first IC build uses CompilationMode.Rebuild instead of Incremental
to avoid unnecessary work (computing API difference etc.).

However there is a branch that does not transform source files
paths to absolute ones before writing them to module xml file.

In our plugins we have always transformed files to absolute ones before
passing them to IncrementalJvmCompilerRunner, so there is no problem.

But third party build systems could pass relative paths to IncrementalJvmCompilerRunner
(namely Kobalt does so).
It turned out to break builds because KotlinToJVMBytecodeCompiler takes
module xml file's (which is a temporary file itself) parent as a base
for relative source files (see KotlinToJVMBytecodeCompiler.getAbsolutePaths).

This change ensures that makeModuleFile always uses absolute files.

    #KT-22542 fixed
2018-03-15 18:06:13 +03:00
Anton Bannykh e377a30929 Use mocha instead of QUnit for debugging stdlib tests in browser 2018-03-15 17:54:17 +03:00
Anton Bannykh 338bde23fc JS stdlib: run kotlin.test library tests 2018-03-15 17:54:17 +03:00
Vyacheslav Gerasimov f0ec073bf6 Build: Include ultimate projects only if intellijUltimateEnabled 2018-03-15 16:35:20 +03:00
Vyacheslav Gerasimov ef018d2ac1 Make dependencies on Android gradle plugin non-transitive
com.android.tools.build:gradle brings about 50 unused transitive dependencies including idea-core and uast, sometimes it breaks IDE features like navigation to declarations and debugging.

Inline contents of ReflectionUtil.findMethod to remove dependency on idea-core
2018-03-15 15:20:22 +03:00
Anton Bannykh 04cbea4956 JS: fix Long constant translation (KT-19228 fixed) 2018-03-15 14:58:10 +03:00
Alexey Sedunov b7d79cc146 Gradle: Do not resolve sourcesets in projects with Android module 2018-03-15 13:17:43 +03:00
Denis Zharkov e1c29ad3fd Regenerate tests for androidx support annotations 2018-03-15 10:34:33 +03:00
Denis Zharkov 7d8e7f481d Add a reference to third-party/annotations/androidx in license 2018-03-15 10:34:33 +03:00
Jake Wharton b22f051edb Add support for nullability annotations in androidx package. 2018-03-15 10:34:33 +03:00
Toshiaki Kameyama a3b35cbfe0 Reformat: ConvertToStringTemplateIntention 2018-03-15 10:32:07 +03:00
Toshiaki Kameyama 66906e2c80 Process '$' correctly in "Convert concatenation to template"
So #KT-12226 Fixed
2018-03-15 10:29:58 +03:00
Alexey Belkov 3b2bbee595 Standardize and improve descriptions of intentions/inspections 2018-03-15 09:56:47 +03:00
Nikolay Krasko bc7ccbc39b Fix stub mismatch for top level declaration with JvmPackageName (KT-21831)
ClassId stores jvm name and it differs from kotlin name in that case.

 #KT-21831 Fixed
2018-03-14 21:16:58 +03:00
Toshiaki Kameyama c1f43558b9 Unwrap: function parameter (KT-14788)
#KT-14788 Fixed
2018-03-14 21:16:58 +03:00
Ilya Chernikov 6838873a93 Fix local build problem - task compileJava not found
The problem is happening because our plugin deletes the task from
common projects, which may lead to such errors. The proper fix is
planned in our gradle plugin.
2018-03-14 15:39:30 +01:00
Ilya Chernikov 755f05e669 Switch to gradle 4.6 2018-03-14 15:39:30 +01:00
Ilya Chernikov 07b82ff1cc Fix noDefaultJar helper - remove the disabled jar from archives
before this fix switching to the gradle 4.6-rc1 caused the problem on
local publish task - kotlin-compiler.jar not found
2018-03-14 15:39:30 +01:00
Mikaël Peltier d0ed0c4049 KT-14258 Optimize accesses to properties defined into companion
- Use direct access to property defined into companion object when
it is possible rather than always use an accessor to access the
property.
- Use direct access will speedup runtime performance.
- Avoid to generate useless accessors for companion properties.

Fix of https://youtrack.jetbrains.com/issue/KT-14258
2018-03-14 15:30:40 +01:00
Anton Bannykh fd244be9ca JS: add tests to make sure KT-22019 is fixed 2018-03-14 17:15:16 +03:00
Natalia Selezneva a5ac8abc7c Run Script Action should add script dependencies to classpath 2018-03-14 16:09:03 +03:00
Natalia Selezneva 7d76554966 Run script action in IDE should use kotlin compiler from plugin
^KT-22647 Fixed
2018-03-14 16:08:57 +03:00
Natalia Selezneva 2486be0f86 'Configure kotlin' should set 1.2-SNAPSHOT version in build.gradle for snapshot version of kotlin plugin 2018-03-14 16:08:33 +03:00
Mikhael Bogdanov cdcb651c8e Get rid of 'BRIDGE' flag on $default functions 2018-03-14 13:57:49 +01:00
Zalim Bashorov ac5ef57876 Regenerate tests 2018-03-14 15:06:35 +03:00
Zalim Bashorov 055b900d8a Add generating tests using "whitelist" of target backend; add new target backends: JS_IR and JVM_IR 2018-03-14 15:06:31 +03:00
Zalim Bashorov 82f41a1125 J2K TargetBackend 2018-03-14 15:06:31 +03:00
Zalim Bashorov 9970dd051f Fix copyright's start year in generated tests 2018-03-14 15:04:58 +03:00
Zalim Bashorov 814be1810c Don't write copyright to *.gradle.kts and *.gradle files 2018-03-14 15:04:57 +03:00
Zalim Bashorov c0ce3f849d Fix copyright's start year 2018-03-14 15:04:57 +03:00
Alexander Udalov e21c73229c Throw exceptions explicitly in protoTypeTableUtil
Previously, if both type and typeId messages were missing (for example,
ProtoBuf.Function.returnType/returnTypeId) because of some bug, the
behavior was unpredictable because a type with id 0 from the type table
would be returned, which could be a completely irrelevant type. This is
an incorrect situation and we should report a diagnostic instead.
Temporarily throw an exception instead, since this only affects how the
compiler works on bad metadata
2018-03-14 12:25:23 +01:00
Alexander Udalov 0a78fe8ae3 Move some serialization helpers to metadata/metadata.jvm 2018-03-14 12:25:22 +01:00
Alexander Udalov 779290be0c J2K Interner: convert and prettify 2018-03-14 12:25:22 +01:00
Alexander Udalov bda7514b43 J2K Interner: rename .java -> .kt 2018-03-14 12:25:21 +01:00
Alexander Udalov acf357e9b5 Extract descriptor-related behavior in StringTable to separate interface
Descriptor-related code is only needed to be able to compute
"replacement" names for local classes, which are different in JVM and JS
2018-03-14 12:25:20 +01:00
Alexander Udalov 043f4c3d01 Increase patch number of metadata versions
After adding inline classes in 915455ebe9
2018-03-14 12:25:19 +01:00
Alexander Udalov 407de206a3 Minor corrections in proto schemas, mostly in comments
Also set up code style for the protobuf plugin
2018-03-14 12:25:19 +01:00
Alexander Udalov 9d8d4b837b Minor, move JavaFlexibleTypeDeserializer.id to JvmProtoBufUtil
To be able to read platform types with metadata.jvm
2018-03-14 12:25:18 +01:00
Alexander Udalov 241673c6a1 Add forgotten SinceKotlin to Metadata.pn
kotlin.Metadata is internal, so it shouldn't have any visible effect
2018-03-14 12:25:17 +01:00
Alexander Udalov 3f3e05a9d2 Move essential metadata-related classes to 'metadata' and 'metadata.jvm' 2018-03-14 12:25:16 +01:00
Alexander Udalov 88dea9aa70 Move NameResolver to module 'metadata' and J2K
Also move NameResolverImpl to 'metadata' and JvmNameResolver to
'metadata.jvm'
2018-03-14 12:25:16 +01:00
Alexander Udalov 0ba42850f9 Drop ClassData and PackageData, rename ClassDataWithSource -> ClassData
Use pairs in JvmProtoBufUtil for simplicity
2018-03-14 12:25:15 +01:00
Alexander Udalov 5ed5ac8291 Minor, use stdlib instead of ifEmpty 2018-03-14 12:25:14 +01:00
Alexander Udalov a5a69c5099 Remove dependency of ClassMapperLite on JavaToKotlinClassMap
There are two reasons for this. First, this class will be used in the
metadata reading library which should not have dependencies on lots of
compiler stuff JavaToKotlinClassMap depends on.

Second, it was easy to accidentally break the deserialization in old
compilers by adding another mapping to JavaToKotlinClassMap. This was
possible because ClassMapperLite is used to decide whether or not the
JVM signature is "trivial" and should be written to the metadata (at
JvmSerializerExtension.SignatureSerializer.requiresSignature). If the
signature is trivial but mentions a type added in JavaToKotlinClassMap
in the new compiler, the old compiler will not be able to load the
signature correctly. See the comment on ClassMapperLite for more
information
2018-03-14 12:25:14 +01:00