Commit Graph

5222 Commits

Author SHA1 Message Date
Shagen Ogandzhanian c1f75d2324 Introduce idl definition for SVGMaskElement 2018-12-17 16:11:22 +01:00
Sergey Igushkin 67e82a54e5 Fix Gradle 5.0 deprecation warnings:
* DefaultSourceDirectorySet constructor is deprecated -> objects()
* IvyRepository.layout('pattern') { } is deprecated -> patternLayout { }

Issue #KT-26808 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin 557fb07f44 Fix the localToProject attribute schema for Gradle 4.10.2+
In Gradle 4.10.2, a change was made in the attributes disambiguation
process: if some of the candidates have a single attribute value and
others don't have that attribute (i.e. have a null value), the
disambiguation rule for that attribute doesn't get called.
Effectively, null values are excluded from disambiguation, but still may
cause ambiguity (sic!)

See: https://github.com/gradle/gradle/issues/6747#issuecomment-445921139

This change affected our attribute `localToProject` that we use to
disambiguate the deprecated but still consumable configurations like
`compile`, `runtime`, `testCompile`, `testRuntime` from those
configurations which should have priority during project dependency
resolution: the `*Element` ones. Our scheme marked the former
configurations with the attribute and the latter were not marked, with
a disambiguation rule that preferred null values.

To fix this logic with Gradle 4.10.2, we instead mark both kinds of
configurations with the attribute, which now has a value 'public'
that is preferred by the rule over the other values. We also make sure
that the attribute doesn't leak into the published Gradle metadata, as
it is only needed for project-to-project dependencies resolution.

Issue #KT-28795 Fixed
2018-12-17 16:09:57 +03:00
Sergey Igushkin 2349aaf488 Workaround for ConcurrentModificationException in KotlinModelBuilder
In Gradle 5.0, iterating over the `.withType<...>()` result below
caused a ConcurrentModificationException. Workaround that by first
collecting the items into a list.
2018-12-17 16:09:56 +03:00
Sergey Igushkin d7522e2283 Fix some tests for Gradle 5.0 and update some dependency versions
* Introduce GradleVersionRequired.InRange and thus prevent older
tests (e.g. Android 2.3.0) from running with newer Gradle versions

* Add a task outputs pattern suitable for Gradle 5.0

* Run some of the Android tests with AGP 3.1.0 (and Gradle 4.4) instead
of 3.0.0 to ensure compatibility with Gradle 5.0

* Update test projects according to Gradle 5.0 dropped deprecated
features: classesDir, left-shift operator, default org.gradle.util.*
imports

* Fix a Gradle test after Gradle 5.0 changed `publishing` behavior to
run the closure eagerly rather than after evaluation
2018-12-17 16:09:56 +03:00
Sergey Igushkin 5f21ced26b Advance test Gradle version to 5.0 2018-12-17 16:09:56 +03:00
Alexey Tsvetkov 2196d81322 Enable JS IC by default
#KT-28842 Fixed
2018-12-17 15:46:11 +03:00
Alexey Tsvetkov ce9150f2b2 Add project property to disable AP discovery in compile classpath
AP discovery in compile classpath can be disabled in all subprojects
by adding "kapt.include.compile.classpath = false" to 'gradle.properties' file.

KT-24530

The setting can be overrided per project by using KAPT DSL
in a 'build.gradle' file:
```
kapt {
    includeCompileClasspath = false
}
```
2018-12-17 15:41:34 +03:00
Vadim Brilyantov 7fb43144d4 fix KotlinVersion and set it to be 1_3_0 2018-12-17 15:07:10 +03:00
Alexey Tsvetkov 0ea7716eb1 Test that javac is loaded once when worker is reused 2018-12-16 04:28:44 +03:00
Ting-Yuan Huang 6c627fa5c1 Cache classloaders for tools.jar and kapt in Gradle workers
#KT-28852 fixed

The loaders and hence some classes were repeatedly loaded and
jit-compiled everytime when KaptExecution were dispatched. Those
classes, like JavaCompiler, can be very large and therefore created a
significant overhead. In some projects, the overhead accounted for more
than 40% of total CPU time of annotation processing.

This change tries to cache the classloaders so that they won't be
reloaded and re-jitted.
2018-12-16 04:28:44 +03:00
Alexey Tsvetkov 1ba6d5361b Run in-process compiler in separate thread
The compiler uses thread local values,
so when the compiler runs Gradle's thread,
it leaks classes preventing
a compiler's classloader from being collected.

    #KT-28037 fixed
2018-12-15 23:39:06 +03:00
Alexey Tsvetkov a6fca47871 Minor: remove unused util 2018-12-15 23:39:06 +03:00
Alexey Tsvetkov cab32f0e43 Print stacktrace to Gradle logger instead of writing directly to stderr 2018-12-15 23:39:06 +03:00
Vadim Brilyantov 65982bbee8 disable statistics for 181 as FUS is only available since 182 2018-12-14 20:19:22 +03:00
Vadim Brilyantov 93d93cd40e fix report kotlin targets for android case 2018-12-14 20:19:19 +03:00
Vadim Brilyantov df5ec5c218 report stats for pullUp/pushDown refactorings
tmp
2018-12-14 20:19:19 +03:00
Shagen Ogandzhanian 714b4f25c0 Introduce better typing for on[event-name] attributes from idl
see https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2548
2018-12-14 13:17:41 +01:00
Ilya Chernikov 77a4505ec2 [minor] get rid of obsolete "environment" wording 2018-12-13 18:00:12 +01:00
Ilya Chernikov 9e5d04b836 Add generic interfaces to dependency resolvers 2018-12-13 18:00:11 +01:00
Ilya Chernikov e0a542234f Add script config refinement before compilation into API 2018-12-13 18:00:10 +01:00
Ilya Chernikov 3fe324bbb4 Add UrlScriptSource 2018-12-13 18:00:08 +01:00
Ilya Chernikov fb929c290d [minor] copy utility fun to reduce dependencies 2018-12-13 18:00:08 +01:00
Alexander Udalov bbc7edf9d1 Fix incorrect character replacement in ClassName.jvmInternalName
#KT-28682 Fixed
2018-12-13 13:23:45 +01:00
Vyacheslav Gerasimov 201522c6c8 as31: Fix KaptWithKotlincTask compilation 2018-12-12 17:58:29 +03:00
Shagen Ogandzhanian 44da3c89b7 Introduce PointerEvent-related definitions
* Resolves https://youtrack.jetbrains.com/issue/KT-23932
 * Backed by review https://upsource.jetbrains.com/kotlin/branch/KT-23932-POINTER-EVENT-FROM-REMOTE-IDL
2018-12-12 14:53:18 +01:00
Shagen Ogandzhanian 2d49268a0b Support float initializers in fun params generated from idl definitions 2018-12-12 14:12:27 +01:00
Shagen Ogandzhanian 03966985a1 Add mininal test suite to idl2k, remove deprecated ANTLRFileStream 2018-12-11 22:46:01 +01:00
Alexey Tsvetkov b6c975739c Deprecate AP discovery in compile configurations in Gradle
#KT-24368 Fixed
2018-12-11 16:08:16 +03:00
Alexey Tsvetkov d6459e6c49 Add option to disable AP discovery in compile classpath
#KT-24530 Fixed

To disable discovery and enable avoidance for kapt tasks,
use "kapt.includeCompileClasspath = false"
2018-12-11 16:08:16 +03:00
Shagen Ogandzhanian 1f0bca12e1 Leave undefined values for undefined params in idl-generated code unassigned
https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2535
2018-12-07 16:05:00 +01:00
Ilya Gorbunov 7b08f6f8f1 readLine: extend buffer to decode surrogate pairs from utf-8 correctly
CharBuffer had capacity to hold 2 chars, which was not enough to append
a surrogate pair when the buffer was not empty.

The buffer was extended and the decoding algorithm rewritten to deal with
a buffer of any length.

#KT-28572 Fixed
2018-12-07 17:42:09 +03:00
Andrey Uskov abadfbb632 Fix dependencies after removal of build scripts bunches 2018-12-06 22:58:39 +03:00
Andrey Uskov c85f56a0a8 Remove some bunches for build scripts. 2018-12-06 19:44:09 +03:00
Ilmir Usmanov 1336e8f3e3 Take java 9 modules into account in coroutines debug metadata
reading
 #KT-28237
2018-12-06 16:59:15 +03:00
Roman Elizarov 75e2dfda19 Added COROUTINE_SUSPENDED docs
Fixes KT-28488
2018-12-06 11:00:32 +03:00
Dave Leeds 6ff3ae3447 KT-20357: Add samples for commonPrefixWith and commonSuffixWith 2018-12-05 19:21:57 +03:00
Vyacheslav Gerasimov 508fe28781 Build: Add NoDebugJavaExec to filter out debugger arguments added by Idea
Workaround for IDEA-200192:
IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution
2018-12-05 16:23:25 +03:00
Shagen Ogandzhanian b154d10cc5 Merge pull request #2013 from JetBrains/KT-16305-MUTATION_OBSERVER_INIT
Skip assignment for null-value ArrayLike object in idl-based generate…
2018-12-04 20:33:24 +01:00
Vyacheslav Gerasimov 17a60e3fd3 Build: use UtilityJavaExec task for compileJs and generateVisitors 2018-12-04 15:38:56 +03:00
Shagen Ogandzhanian 8294309e5b Skip assignment for null-value ArrayLike object in idl-based generated code 2018-12-04 12:44:43 +01:00
Ilya Gorbunov 736818dfa7 Use Before/AfterMethod from TestNG as kotlin.test.Before/AfterTest
According to their documentation they should be invoked before and after
each test method runs.

#KT-27629 Fixed
2018-12-03 21:46:26 +03:00
Ilya Gorbunov 48c80e247e Move kotlin.test common annotations tests
Place them in tests of kotlin-test-annotations-common, so that every
platform module that implements that common module (e.g. kotlin-test-junit,
kotlin-test-junit5, kotlin-test-testng) gets these tests run.

Improve test for BeforeTest/AfterTest annotations to check that they are
invoked before/after _each_ test method.

#KT-27629
2018-12-03 21:46:26 +03:00
Corey ae7cc8a133 Consider non-existent AttributeContainers empty
Given the prior faulty logic, no tree of `HierarchyAttributeContainer`s would ever report itself as empty (not even a 'tree' consisting of a single, attribute-less/empty HierarchyAttributeContainer), since every tree will have a root, which will lack a parent, and it considered the lack of existence of a parent to mean that that root container is not empty.
2018-11-30 16:21:33 +03:00
Sergey Igushkin 8cec50e6e2 Reorder MPP plugin logic to fix eager publishing configuration
In Gradle 5.0, the `publishing` extension is configured eagerly, so
we need to make sure everything we use in publishing setup is already
available at the point when it's triggered:

* the `metadata` target
* the source JARs

Issue #KT-28520 Fixed
2018-11-30 15:34:58 +03:00
Sergey Igushkin 0f670f806f Fix Android Extensions early dependency resolution
Make compiler plugin options evaluate lazily, with Lazy<String> and
FileCollection as replacements for the eagerly-evaluated data.

Adjust compiler plugin option usages so that their evaluation is not
triggered when not necessary.

Issue #KT-26065 Fixed
2018-11-30 15:34:21 +03:00
Sergey Rostov 5237079c5d Move resources: fix copy-resources kotlin compiler maven plugins 2018-11-30 15:01:02 +03:00
Sergey Rostov 487c57e2e0 Move resources, kotlin-reflect.jar: remove manually included META-INF/services/*
Now it already included. Manually including causes duplicated contents
in resulting files, for example:

1	   kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
2	   kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
3	   kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition
4	+  kotlin.reflect.jvm.internal.impl.load.java.FieldOverridabilityCondition
5	+  kotlin.reflect.jvm.internal.impl.load.java.ErasedOverridabilityCondition
6	+  kotlin.reflect.jvm.internal.impl.load.java.JavaIncompatibilityRulesOverridabilityCondition

Removing this line fixes that.
2018-11-30 15:01:02 +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
Ilya Matveev 093b9d174d Update Kotlin/Native: 1.0.3 2018-11-30 18:58:01 +07:00