Commit Graph

39372 Commits

Author SHA1 Message Date
Alexey Tsvetkov aa9a40b61b Add tests with new Android Gradle Plugin 2017-05-31 16:59:03 +03:00
Sergey Igushkin dce6a4f869 Fix UnsupportedOperationException caused by mutation of FileCollection 2017-05-31 16:59:03 +03:00
Sergey Igushkin a68f7d79f5 Migration to AGP 2.3.0 2017-05-31 16:59:03 +03:00
Sergey Igushkin 6e721c4cee Further fixes for Android tests on TeamCity
Added support repository to download_android_sdk.xml
Changed the build tools version in testProject to 23.0.1

(trial) Remove platform 22
2017-05-31 16:59:03 +03:00
Sergey Igushkin 227a1d5fa0 Got rid of the sdk-manager plugin. 2017-05-31 16:59:03 +03:00
Alexey Tsvetkov 18505157e0 Fix failing Gradle tests
* Extract ANDROID_HOME_PATH constant
* Set ANDROID_HOME_PATH to dependencies/androidSDK
* Running download_android_sdk.xml is now needed to run Gradle Integration Tests
* Modify download_android_sdk.xml so that tools/android is executable

(cherry picked from commit 75a6e37)
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov 6e07b1cd99 Gradle: set default values of languageVersion and apiVersion to null
Before the change, Gradle always explicitly set language and api
version to the latest version, preventing the compiler
from inferencing the arguments.

     #KT-18047 fixed
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov b06b18de07 Set destination to null when module is set in JPS
This fixes the warning "The '-d' option with a directory destination
is ignored because '-module' is specified", when a project imported
from Gradle is built with JPS.

    #KT-17665 fixed
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov 5fbb41bf86 Stabilize test of Gradle's daemon for memory leaks
We need to wait for GC to finish, because GC can be concurrent
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov d80a463735 Report memory usage only when system property is set
This improves performance of Gradle builds with debug logging (--debug),
because System.gc is now forced only when the system property
'kotlin.gradle.test.report.memory.usage' is set.

    #KT-17960 fixed
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov a6a829c272 Improve test error message 2017-05-31 16:59:03 +03:00
Alexey Tsvetkov e1457ffea0 Limit max number of active Gradle processes for the test run
This is needed to avoid retaining memory by each Gradle version
which is critical for running tests on CI server.
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov 2fa8a1139f Refactor Gradle ITs so any Gradle wrapper version can be used
This change:
* fixes tests with missing (in branch 1.1.3) GradleWrapper-3.4
* enables using any Gradle version in integration tests
without adding a new GradleWrapper-<version> dir.

The only difference between wrappers is in a version
number in a `gradle-wrapper.properties` file.
I removed all but one wrappers from `test/resources`,
and replaced the version with the template token <GRADLE_WRAPPER_VERSION>
for the remaining wrapper.
During a test run a template wrapper for each required version
is copied to a temporary directory.
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov be1b1029a4 Minor: add .gitignore for gradle-tools 2017-05-31 16:59:03 +03:00
Alexey Tsvetkov a8263361c0 Fix tests for coroutines setting in Gradle
ArgumentUtils#convertArgumentsToStringList does not
serialize an argument with default value,
so the string "-Xcoroutines=warn" was no longer present in logs.
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov 0a17dc3229 Refactor kapt tasks' wiring
* Unify tasks wiring for new and old Android Gradle Plugin
* rename wireKaptTask->registerGeneratedJavaSource
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov e529592d15 Pass task object instead of task name to dependsOn
This simplifies filtering out dependsOn later
2017-05-31 16:59:03 +03:00
Alexey Tsvetkov c8d05f8485 Remove most of Gradle tests with Jack
Jack is deprecated and Kotlin Gradle plugin throws,
so one test checking that build is failing with the exception
is enough.
2017-05-31 16:59:02 +03:00
Alexey Tsvetkov 0cb67b4052 Minor: simplify expression 2017-05-31 16:59:02 +03:00
Alexey Tsvetkov c20d569aaa Simplify friend paths configuration 2017-05-31 16:59:02 +03:00
Sergey Igushkin 3e95a551e0 Various fixes
* Expose internals as public to use them in the agp25 source set
* Refactor of Android25ProjectHandler.kt
* Fix Kapt3 for non-Android projects
2017-05-31 16:59:02 +03:00
Sergey Igushkin 546a26a4cd Fix Kapt task depending on compileKotlin because of incorrect filtering
of compileJava dependencies

(cherry picked from commit 9a2c3b0)
2017-05-31 16:59:02 +03:00
Alexey Tsvetkov 95d3d3057a Update gradle wrapper permissions
It was not executable on linux
2017-05-31 16:59:02 +03:00
Sergey Igushkin a82c0c843e Use the Google Maven repository instead of local preview.
(cherry picked from commit 4279335)

(cherry picked from commit 0e8b850)
2017-05-31 16:59:02 +03:00
Sergey Igushkin edd22310c0 (minor) Fix missing dependency on JUnit
(cherry picked from commit 7ad5d04)
2017-05-31 16:59:02 +03:00
Sergey Igushkin 1bc0e8a276 Fix friend paths configuration with the new API for compile*Test tasks
Add lazy `friendClasspathEntries` to KotlinCompile
Set `friendClasspathEntries` in the Android25Pro
Change to AGP 3.0.0-alpha1;

(cherry picked from commit 1d6dd5c)

(cherry picked from commit 6cdf501)
2017-05-31 16:59:02 +03:00
Sergey Igushkin 7fae7c1d55 Fix registering the non-existent Kapt3 classes directory as bytecode if
Kapt3 is disabled.

(cherry picked from commit 692e23c)

(cherry picked from commit 1cbdb6c)
2017-05-31 16:59:02 +03:00
Sergey Igushkin 77031ab6f9 Change the legacy API threshold to 2.5.0
(cherry picked from commit fca2e23)

(cherry picked from commit 9394d15)
2017-05-31 16:59:02 +03:00
Sergey Igushkin d2a08c5fe4 Tasks wiring improvements & Kapt3 integration through variant wrapping 2017-05-31 16:59:02 +03:00
Sergey Igushkin b0c2c4eba9 Task wiring
* Generalized tasks wiring
* Moved the old implementation to LegacyAndroidAndroidProjectHandler.kt
* Added an implementation with the new AGP API

(cherry picked from commit 1b4592d)

(cherry picked from commit 50a75d4)
2017-05-31 16:59:02 +03:00
Sergey Igushkin eb71dee9cc Add prototype against the new AGP API
* Add a separate Gradle source set, that is compiled against the new
  versions of AGP and Gradle

* Separate the public AGP API usages from the old internal API usages
  in KotlinPlugin.kt -- see AbstractAndroidProjectHandler

* Implement Android25ProjectHandler with the new AGP API, wired it
  to KotlinAndroidPlugin through reflection

(cherry picked from commit e6dbf54)

(cherry picked from commit 88e3d4b)
2017-05-31 16:59:02 +03:00
Dmitry Petrov a5620454fa Minor: use IntrinsicMethods.INTRINSICS_CLASS_NAME where appropriate 2017-05-31 16:48:14 +03:00
Dmitry Petrov a6f8aad49b Minor: fix typo in exception message 2017-05-31 16:48:14 +03:00
Dmitry Petrov 08885e273b Support additional intrinsics in null check elimination
1. checkExpressionValueIsNotNull implies checked value is non-null

2. throwNpe never returns

 #KT-18162 Fixed Target versions 1.1.4
 #KT-18164 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Dmitry Petrov d559212d70 Optimize out trivial INSTANCEOF checks
#KT-18157 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Mikhail Glukhikh 74ee9ce68b Fix "remove explicit type arguments" in J2K
Do not delete type arguments if intention is not applicable just befor
2017-05-31 12:47:56 +03:00
Mikhail Glukhikh 9c15db93d9 Inline: more accurate handling of type arguments
Partial revert of b8cc7c2ca6
Soften requirements in remove type arguments intention in this mode
So #KT-17622 Fixed
Related to KT-17623
2017-05-31 12:47:50 +03:00
Mikhail Glukhikh 38d6c597a3 Handle expected type more precisely in RemoveExplicitTypeArguments
So #KT-17623 Fixed
2017-05-31 12:46:59 +03:00
Mikhail Glukhikh c67f8c07d2 Minor cleanup 2017-05-31 12:46:47 +03:00
Alexey Andreev e6b0cc64bd Fix copying of non-abstract functions of interfaces in JS BE
Fix copying of non-abstract functions of interfaces to implementing
classes when implementing class inherits interface via 2+ paths.

See KT-18187
2017-05-31 11:21:13 +03:00
Dmitry Petrov c558e2657b Update testData for light classes after generic signature fixes 2017-05-31 10:18:48 +03:00
Dmitry Petrov 17d2472511 Do not patch generic signature for methods with special bridges
Somewhat awkward solution for KT-18189.
2017-05-31 10:18:48 +03:00
Dmitry Petrov fd00a6fbe8 Generate generic signatures for special bridges
#KT-12408 Fixed Target versions 1.1.4
2017-05-31 10:18:48 +03:00
Dmitry Petrov 48a60e6f39 Dump generic signatures in bytecode listing tests if required
Add '// WITH_SIGNATURES' to test file if generic signatures should be
dumped.
2017-05-31 10:18:48 +03:00
Dmitry Petrov 78de1fb72c Handle incorrect code for interface delegation
#KT-15931 Fixed Target versions 1.1.4
2017-05-31 10:18:48 +03:00
Yan Zhulanow 4f132f6d40 Kapt: Fix output file reporting in IC
Fix REPORT_OUTPUT_FILES option passing to GenerationState created in kapt.

This fixes these tests:
Kapt3Incremental.testChangeAnnotatedPropertyType()
Kapt3Incremental.testRemoveAnnotations()
Kapt3Incremental.testRemoveSourceFile()
2017-05-30 22:09:20 +03:00
Alexander Udalov 1572d2cf2b Improve modular JDK root module detection
According to the spec, "java.se" and every other non-"java.*" module
that exports at least one package without qualification, is a root.
Currently we only support compilation of a single unnamed module, and
apparently unnamed module should read all root modules.

 #KT-18180 Fixed
2017-05-30 17:35:25 +03:00
Alexander Udalov 5042bbe4a1 Minor refactoring in ContentRoots, JvmContentRoots and usages 2017-05-30 17:35:23 +03:00
Alexander Udalov 227c2d2c23 Minor, display multiline argument help prettier 2017-05-30 17:33:11 +03:00
Mikhail Glukhikh 00fa7c8166 Minor cleanup: MoveReceiverAnnotationFix 2017-05-30 15:58:22 +03:00