Commit Graph

3550 Commits

Author SHA1 Message Date
Sergey Bogolepov ac3864543c Add Family.TVOS, Family.WATCHOS and KonanTarget.ANDROID_X86, KonanTarget.WATCHOS_X86, KonanTarget.WATCHOS_ARM32. 2019-09-03 18:54:30 +07:00
Ilya Chernikov fda37eaaae [minor] Rearrange test utils for easier reuse 2019-08-28 17:59:12 +02:00
Nikolay Igotti fcb0b1b5eb Add new native targets. (#2538) 2019-08-23 16:11:40 +03:00
Ivan Gavrilovic 7bc739359b Use JDK_8 when stopping Gradle daemons with version below 5.0
Gradle started supporting running on JDK11 only with Gradle 5.0.
This commit sets JAVA_HOME to JDK8 whenever stopping daemon with
version below 5.0
2019-08-22 15:47:45 +03:00
Ivan Gavrilovic d13e26d67e Add a check that processors from KAPT classpath are not run
This commit adds check that javaslang.match.PatternsProcessor,
which is in kotlin-compiler-embeddable jar, is not run when using
JDK9+.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic f3acd8d10c KT-33028, KT-33050: Fix how kapt invokes javac on JDK 9+
This commit fixes KT-33028 by not setting empty boot classpath when
running on JDK9+. When compiling with -source 8 and below, this allows
classes from java.base module to be available in the boot classpath.

This commit also fixes KT-33050 by passing the source level of Java compile
task in the KAPT javac options. This is important as some annotation processors
are using ProcessingEnvironment.getSourceVersion() in order to decide what
code to generate.

Test: Kapt3IT test added for worker and non-worker invocations
2019-08-22 15:45:40 +03:00
Ilya Chernikov 315a9d66a0 Refactor more tasks to lazy API 2019-08-21 20:20:08 +02:00
Ilya Chernikov 2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Ilya Chernikov 0f41dc814f Switch many common tasks defined in buildSrc to lazy creation
also refactor some locally defined tasks to the creation avoidance API
2019-08-21 20:20:08 +02:00
Sergey Igushkin 50e758cbb7 Remove the @Inclubating annotation from UnstableApiUsage inspection
Also remove `@Suppress("UnstableApiUsage)"` where it was relevant
2019-08-21 19:42:34 +03:00
Sergey Igushkin ffd0b438da Don't create the Kapt generate stubs output dir in lazy initializer
Creating a directory in the property getter interferes with Gradle cache
 outputs snapshotting, resulting in build cache being disabled for the
 task with the following info message:

 Caching disabled for task ':app:kaptGenerateStubsKotlin': Gradle does
 not know how file 'build/tmp/kapt3/incrementalData/main' was created
 (output property 'destinationDir'). Task output caching requires exclusive
 access to output paths to guarantee correctness.

 As Gradle automatically creates any @OutputDirectory, we don't need
 to create it at the task initialization phase.
2019-08-21 19:42:34 +03:00
Sergey Igushkin cbb8bf2deb Extract members from Kotlin tasks, don't iterate over them (KT-31713)
Refactor: move some properties from the Kotlin tasks to the
new task data model, so they can be accessed without forcing the
tasks to instantiate.

Don't iterate over Kotlin tasks of all projects in the IC-related code;
instead, inspect the model.

Issue #KT-31713 Fixed
2019-08-21 19:42:34 +03:00
Ilya Gorbunov a985402507 Introduce ClockMark.hasPassedNow, hasNotPassedNow functions
Makes it more clear to use them than comparing elapsed with Duration.ZERO.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov 44195d436e Rename: Clock.markNow, ClockMark.elapsedNow
Add "Now" suffix to the names of functions that depend on the current
time moment.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov f889d25287 Introduce TestClock.plusAssign(Duration) and hide implementation details
TestClock.plusAssign(Duration) is for advancing TestClock time.
Hide reading value, do not allow to provide initial reading,
fix clock unit to nanoseconds at construction time.
2019-08-16 15:28:45 +03:00
Ilya Gorbunov 4de9361c37 Introduce Duration.isPositive method 2019-08-16 15:25:57 +03:00
Shagen Ogandzhanian 3b8da0afe4 Update dukat dependency to 0.0.16 2019-08-16 06:29:11 +03:00
Abduqodiri Qurbonzoda 63895483fd Fix take method from iterating one extra element (KT-32024) 2019-08-15 01:01:36 +03:00
Ivan Gavrilovic 0a26742501 Run KAPT non-incrementally if annotation processor classpath changes
Annotation processor classpath for a KAPT run is recorded, and the current
run is compared against the previous one. If those differ, KAPT should
run non-incrementally.

Test: KaptIncrementalWithIsolatingApt.testChangingAnnotationProcessorClasspath
2019-08-14 18:05:04 +09:00
Ivan Gavrilovic 2412b5f992 Delete output when unable to run KAPT incrementally
When comparing previous and current classpath snapshots, and it is not
possible to compute the types that changed, make sure to delete the outputs
before invoking KAPT.

Test: KaptIncrementalWithAggregatingApt.testIncompatibleClasspathChanges
2019-08-14 18:05:04 +09:00
Sergey Igushkin 5578434629 Fix: No value has been specified for 'binaryResultsDirectory' (KT-33246)
With Gradle 5.5+, set the property `binaryResultsDirectory` that
replaces `binResultsDir`.

Issue #KT-33246 Fixed
2019-08-12 18:23:50 +03:00
Alexander Udalov 01ddac58e1 Add language feature for changed name of property annotations method
#KT-31352 Fixed
2019-08-12 16:48:26 +02:00
Alexander Udalov ea0142da60 Use JVM name of getter in synthetic method for property annotations
#KT-31352 In Progress
2019-08-12 16:48:25 +02:00
Alexander Udalov a7c8fdcbe2 Use Intrinsics.checkNotNull and throw NPE in !! operator generation
This method was introduced in c204e8fc67 "just in case" and was never
used. Therefore we're free to change its semantics and use it in all new
generated code (with API version >= 1.4), without even worrying that the
newly used API will leak from inline functions in stdlib when used with
an older API version. Since we agreed to change the type of thrown
exceptions to java.lang.NPE in KT-22275, invoke a new method
throwJavaNpe now which throws that exception instead of KNPE.

Note that the additional method that takes an exception message is still
unused and exists just in case we need to use it in the future. The new
method throwJavaNpe is public also "just in case" we need to invoke it
in the future; currently it's not invoked from the bytecode.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Sergey Rostov ba9c632f15 Gradle, npm: use state file as fake output for :kotlinNpmInstall task
This is required in case when NpmSimpleLinker works (instead of yarn).
NpmSimpleLinker will not produce yarn.lock file, so :kotlinNpmInstall
was always up-to-date. Adding fake state file fixes the problem.

#KT-32874 Fixed
2019-08-12 10:41:16 +03:00
Sergey Rostov 6b5739bd6a Gradle, ProcessedFilesCache: don't report on clashes with for targets with removed source 2019-08-12 10:41:15 +03:00
Abduqodiri Qurbonzoda 84971d2003 Mention union in intersect documentation and vice versa (KT-26212) 2019-08-12 01:15:20 +03:00
Sergey Igushkin ec54246b3a Fix TCServiceMessagesClient not removing an empty line prefix on Windows 2019-08-07 12:20:13 +03:00
Sergey Rostov 3e25166832 Gradle, js, karma: require webpack npm dependencies 2019-08-07 09:29:22 +03:00
Sergey Rostov 99762193f9 Gradle, js, npm: proper disambiguation classifier for npm and tools configurations
#KT-32293 Fixed
2019-08-07 09:29:22 +03:00
Sergey Rostov 1dc860f206 Gradle, js, npm: fix targets and compilation listener
#KT-32293 Fixed
2019-08-07 09:29:21 +03:00
Sergey Rostov 87e80317a0 Gradle, js, external declarations: read flags from properties 2019-08-07 09:29:21 +03:00
Vyacheslav Gerasimov 89b152809f Build: Make dependencies on builtins compileOnly
for kotlin-annotations-android & kotlin-annotations-jvm, to prevent
builtins from occurring in maven pom compile scope.

 #KT-33140
2019-08-06 18:09:20 +03:00
Sergey Igushkin a874f4f5c3 Don't use addIfNotNull core util in the JS Gradle plugin
The function was placed in a package whose another top-level function
used coroutines. This led to a NCDFE kotlin.coroutines.Continuation
with Gradle versions that bundle Kotlin pre-1.3 stdlib.

Instead, use the existing util function `lowerCamelCaseName` which also
filters nulls.
2019-08-06 16:55:46 +03:00
Ilya Matveev 499f9330d2 Gradle: Don't use the deprecated "layout" method for Ivy repos
Issue #KT-30258 fixed
2019-08-06 14:13:27 +07:00
Sergey Igushkin 88e5d2bc70 Fix unrelated tasks being configured at execution time, KT-31666
Replace iteration over all tasks with `.matching { ... }` with `
.configureEach { if (...) ... }`, so that the check iterates
just over those tasks which are triggered to configure from
somewhere else.

Issue #KT-31666 Fixed
2019-08-05 17:08:22 +03:00
Louis CAD e5e5e9084e Improve error message (#2505)
Fore the case where a target has been created or configured twice with different presets,
avoid showing "null" inside the error message if existing target has not preset,
and append a point.
2019-08-05 10:35:10 +03:00
Ilya Gorbunov 103e16c40f kotlin-maven-plugin: avoid adding sourceroots to read-only freeArgs list 2019-08-04 03:15:54 +03:00
Ilya Gorbunov 65b0a5f903 Unify withIndex docs wording 2019-08-01 19:55:36 +03:00
Ilya Gorbunov 3751a8a797 Common Array.fill for unsigned arrays, improve docs, native impl name
KT-32359
2019-08-01 19:02:39 +03:00
Jake Wharton 1a6069382e Provide Array.fill in common stdlib
KT-32359
2019-08-01 19:02:38 +03:00
Alexey Tsvetkov efe62c983a Decrease max heap size for test process on Windows
Test processes themselves don't do much
(RAM heavy work is done in Kotlin and Gradle daemons).
The default 1600m max heap size is unreasonably high
for copying test projects and checking output logs.
2019-07-31 04:48:20 +03:00
Alexey Tsvetkov 4db3dcc28f Use short temp dirs names only in gradle integration tests 2019-07-31 04:48:20 +03:00
Alexey Tsvetkov 1a0c6fe8b8 Unify test tasks configuration in gradle tests 2019-07-31 04:48:20 +03:00
Alexey Tsvetkov 847af4456a Remove KotlinGradlePluginJpsParametrizedIT
We've stopped running it on CI some time ago,
does not seem very useful now
2019-07-31 04:48:20 +03:00
Ivan Gavrilovic de5335b17f Fix gradle integration tests on Windows
Android Gradle Plugin 3.0 and 3.1 use aapt that does not handle
long paths on Windows. This commit uses shorter paths for the project
working directory on Windows.

Test: running integration tests on Windows
2019-07-31 04:48:20 +03:00
Alexey Tsvetkov 317c39f27d Enable assertions in Kotlin Compile Daemon process
#KT-32992 Fixed
2019-07-29 19:40:36 +03:00
Alexey Tsvetkov 2ae19e1d42 Run :kotlin-gradle-plugin:validateTaskProperties on every install
Previously `validateTaskProperties` was run with tests
(`test` task depends on `validateTaskProperties` task).
Tests run with `--continue` argument on TeamCity,
so the validation was not failing remote-run builds.
To fix this, make `install` depend on `validateTaskProperties`.
2019-07-26 15:31:59 +03:00
Nikolay Krasko 58f294a757 Fix kotlin compiler tests in 192 (KT-32193)
#KT-32193 Fixed
2019-07-26 12:38:40 +03:00
Ilya Chernikov 5fe843d754 Refactor main-kts build scripts - fix red code in IDEA 2019-07-26 08:55:15 +02:00