Commit Graph

6339 Commits

Author SHA1 Message Date
Yahor Berdnikau 013139f18e Unset MapProperty if not task outputs is present.
By default, Gradle creates such property as empty. 'isPresent' returns
'true' in such case.

^KT-46406 Fixed
2021-09-30 18:55:42 +02:00
Yahor Berdnikau de8d4e9e3c Fix reflection call is not working on older Gradle versions.
It happens, older Gradle versions has two functions with the same name,
but different parameters.
2021-09-30 18:55:42 +02:00
Hung Nguyen b5f74ef9a6 KT-45777: Add tests for top-level functions
Address review + Minor changes
Fix error when building with -Pbootstrap.local=true
Fix tests failing on Windows due to '/' character
2021-09-30 17:57:47 +03:00
Hung Nguyen e26dc4d574 KT-45777: Compute classpath changes based on changed snapshots only
to avoid unnecessarily loading unchanged ones.

Duplicate classes will make this a bit tricky. This commit outlines the
algorithm to handle them, the full implementation will follow later.

Also handle removed classes when computing classpath changes.

Test: New tests in ClasspathChangesComputerTest
2021-09-30 17:57:47 +03:00
Ilya Gorbunov 04d70162d2 Make DurationUnit not a typealias of TimeUnit on JVM
Provide conversion functions between DurationUnit and TimeUnit
2021-09-30 14:31:54 +00:00
Dmitriy Novozhilov e933c7b6d9 [Build] Remove testApi(intellijDep()) dependencies from all modules
Since IDEA moved most of it's jars to java 11 it's illegal to use them
  in our dependencies, so all modules which use `intellijDep()` should
  carefully specify which jars they use
2021-09-30 14:41:31 +03:00
Denis.Zharkov 7c3383bb39 Fix warnings after KT-48899
All API ToolingModelBuilder is marked as NonNullApi
https://github.com/gradle/gradle/commit/f93bf949486e73655810ab49ad316100b1c2804c#diff-76e89b92025ccef4e2763c5ee8d30bde939c4a9db26bfc913eac88069cbf5d36
2021-09-30 14:36:27 +03:00
Ilya Gorbunov ec5c06238d Split language and api version lifetimes, restore apiVersion 1.3 support
KT-49007
2021-09-29 21:46:53 +03:00
Ilya Gorbunov 47adc4fdaa Prolong -no-stdlib option lifetime and regenerate Gradle compilation options
-no-stdlib may still be required internally for kotlin gradle plugin
to launch the compiler with the correct options.
2021-09-29 21:46:52 +03:00
Alexander Likhachev c6e1e4fd8e [Gradle] Make compileOnly/compile/runtime configurations not resolvable
#KT-48245 Fixed
2021-09-29 16:34:10 +00:00
Yahor Berdnikau 60cbfbf107 Change KotlinGradleSubplugin deprecation level to ERROR.
^KT-48830 Fixed
2021-09-29 12:13:02 +00:00
Svyatoslav Kuzmich 841f5a583e [Wasm] Support wasm target in multiplatform plugin 2021-09-28 18:26:07 +03:00
sebastian.sellmair 4eaabe54ee [Gradle] Finalize naming of 'runProjectConfigurationHealthCheckWhenEvaluated' API
^KT-48823
2021-09-28 12:11:10 +00:00
sebastian.sellmair 5430b19262 [Gradle] Add 'gradleKotlinDsl' dependency to 'functionalTestImplementation'
^KT-48823
2021-09-28 12:11:10 +00:00
sebastian.sellmair 29fb74d27d [Gradle] Don't run post-evaluation-checks on projects that failed to configure
When in 'lenient' or 'classpath' mode, Gradle will catch exceptions
during project evaluation and collect them into the
'ClassPathModeExceptionCollector'.

Running checks on the project after evaluation should only happen
if the project is properly configured (aka no such exceptions collected)
to prevent false positive error reports (that will then fail
the Gradle process and swallow the real cause)

^KT-48823 Verification Pending
2021-09-28 12:11:09 +00:00
Yahor Berdnikau e4827efb4a Remove WorkersIT test.
Now all compilations are using workers and issues should be covered
by other tests.

^KT-46406 Fixed
2021-09-28 11:41:09 +00:00
Yahor Berdnikau 3dc69495f9 Restore tasks outputs to pre-execution state in worker.
Workers usually execute later than task action and does not raise
exception to the task. Such behaviour skips task outputs restoration to
the pre-execution state.

Kotlin compiler on incremental compilation error leaves 'dirty*' files
in the build output, forcing Gradle to run non-incrementally on the
next build. Fixed it by moving task outputs reset logic into worker as
well.

^KT-46406 In Progress
2021-09-28 11:41:09 +00:00
Yahor Berdnikau 904f9c72f2 Remove 'kotlin.parallel.tasks.in.project' property.
^KT-46406 In Progress
2021-09-28 11:41:08 +00:00
Yahor Berdnikau 24454ba726 Split toolchain and jvm target validation tests.
Should slightly improve test suite execution time.
2021-09-28 13:38:06 +02:00
Vyacheslav Karpukhin 5530080a7d KMA-271 Android dependencies are not imported with AGP 7 2021-09-28 10:51:28 +00:00
Dmitriy Novozhilov 4f7103b2a1 Add ApiVersion for 1.7 2021-09-28 10:16:51 +03:00
Ilya Gorbunov af5ec9d289 Fix a typo in Typography object constants KT-46243 2021-09-27 14:55:19 +00:00
Yahor Berdnikau ac164c2bff Fix 'verbose' argument was not excluded from task inputs.
^KT-48134 Fixed
2021-09-27 13:48:12 +00:00
Ilya Matveev 3d9966818d [Gradle] Add tests for K/N binary options 2021-09-27 11:53:12 +00:00
Ilya Matveev cbe5dc40ef [Gradle] Improve UP-TO-DATE checks for K/N binary options 2021-09-27 11:53:11 +00:00
Ilya Matveev 6ad9af972e [Gradle] Move K/N binary options retrieving to PropertiesProvider 2021-09-27 11:53:11 +00:00
sebastian.sellmair 7f67ce96a0 [Gradle, MPP] CInteropProcess: Relax up-to-date condition to "outputFile.exists"
^KT-48882 Verification Pending
2021-09-27 11:17:20 +00:00
sebastian.sellmair dcd19f41b9 [Gradle, MPP] Only warn on failed cinterop generation during idea sync
^KT-48882 Verification Pending
2021-09-27 11:17:20 +00:00
sebastian.sellmair 52c6713fff [Gradle] Implement CInteropIdeaSyncIT to cover ^KT-48882 2021-09-27 11:17:19 +00:00
Yahor Berdnikau 8b594e295c Don't validate JVM target on empty Java sources.
When toolchain is not configured, Kotlin sets by default JVM target to
"1.8". Compiling Kotlin project on JDK 9+ produces JVM target mismatch
warning even if Java sources are empty.

Skip the jvm validation check if associated Java task sources are empty.

^KT-48745 Fixed
2021-09-27 08:31:00 +00:00
Sergey Bogolepov 708931b404 [K/N][Gradle] Use build service to read konan.properties
Also pass additionalCacheFlags when compiling compiler caches.
2021-09-27 11:21:25 +03:00
Vyacheslav Gerasimov c6c993aa19 Fix deprecated Gradle VersionNumber warning
Required for Gradle 7+ #KTI-559
2021-09-26 23:36:40 +03:00
Vyacheslav Gerasimov edea9b0db3 Suppress deprecated ConfigureUtil in mppPresetFunctionsCodegen.kt
Required for Gradle 7+ #KTI-559
2021-09-26 23:36:40 +03:00
Vyacheslav Gerasimov 8b5db6473b Fix deprecated ConfigureUtil usages in KGP
Required for Gradle 7+ #KTI-559
2021-09-26 23:36:40 +03:00
Yahor Berdnikau c1ba586c96 Replace removed Gradle methods with reflection call.
This is required to update Kotlin repo to Gradle 7.1.
2021-09-26 23:36:40 +03:00
Vyacheslav Gerasimov f91d6958a8 Build: Rework runtimeJar helper and drop redundant configuration
#KTI-559
2021-09-26 20:10:29 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
sebastian.sellmair c51d37d65d [Gradle] [MPP] CInteropPropagatedDependencies: Consider associate compilations
^KT-48856 Verification Pending
2021-09-24 13:13:01 +00:00
sebastian.sellmair e7d8804bdf [Gradle] [MPP] Implement integration test to cover ^KT-48856 2021-09-24 13:13:00 +00:00
sebastian.sellmair 440856f593 [Gradle] [MPP] Add TODO comment for post-commit review ^KT-48885
^KT-46273
2021-09-23 18:48:52 +00:00
sebastian.sellmair 70fde9700f [Gradle] [MPP] Add further explicit check for orphan source sets
^KT-46273 Verification Pending
2021-09-23 18:48:52 +00:00
sebastian.sellmair da361a030e [Gradle] [MPP] Fix 'getDependenciesTransformation' for ^KT-46273
This setup requires a 'jvm like' target and an orphan source set, which
depends on 'commonTest'. This orphan will not participate in any
compilation and therefore will not have any platform.

The code expected at least one test task for this source set
and therefore at least one test framework.

^KT-46273 Verification Pending
2021-09-23 18:48:51 +00:00
Hung Nguyen aea693e309 KT-45777: Ignore faulty groovy-2.5.11 jar
Test: The following should pass
    - Step 1: ./gradlew publish
    - Step 2: ./gradlew publish compileTestKotlin -Pbootstrap.local=true
        -Pbootstrap.local.path=/path/to/kotlin/build/repo
        -Pkotlin.incremental.useClasspathSnapshot=true
2021-09-23 12:51:06 +03:00
Hung Nguyen a6d0fcc676 KT-45777: Support compile avoidance
Test: Updated existing incremental compilation integration tests
2021-09-23 12:51:03 +03:00
Hung Nguyen f400305cc6 KT-45777: Handle problematic classes when taking snapshots
There are certain classes that we are not yet able to take snapshots of,
either because the class is faulty, or there is a bug in our code.

For these classes, we will use a special snapshot and fall back to the
existing approach to compute classpath changes.

In the short run, we will update this list of cases as they arise. In
the long run, we will:
  - Fix all cases that are caused by bugs in our code.
  - Decide what to with the faulty jars in general and remove the list.

Test: The following should pass
  - Step 1: ./gradlew publish
  - Step 2: ./gradlew publish -Pbootstrap.local=true
              -Pbootstrap.local.path=/path/to/kotlin/build/repo
              -Pkotlin.incremental.useClasspathSnapshot=true
2021-09-23 12:47:51 +03:00
Abduqodiri Qurbonzoda eccd035881 Upgrade kotlinx-html-js version to 0.6.12 in gradle plugin tests because of #KT-24782 2021-09-22 12:56:12 +00:00
Alexander Dudinsky c2715d26f1 Fix `NewMultiplatformIT' tests 2021-09-22 00:56:40 +03:00
Abduqodiri Qurbonzoda 9a5a3bfdfb Advance kotlin.browser and kotlin.dom packages deprecation level to ERROR #KT-39330 2021-09-20 12:28:07 +00:00
Dmitriy Novozhilov 0923d39215 [Build] Setup useFirForLibraries flag 2021-09-20 14:18:18 +03:00
Svyatoslav Scherbina b656d67bd4 [Gradle, Native, IT] Workaround NativeEmbeddableCompilerJarIT on Apple silicon
The tests fail on Apple silicon because Gradle plugin doesn't provide
run tasks for macosArm64 (KT-48649).

Workaround this by making the tests execute link task instead of run.
2021-09-20 08:36:25 +00:00