Commit Graph

6760 Commits

Author SHA1 Message Date
Nikolay Krasko 2a71fe97cf 201: picocontainer.jar is removed 2020-02-11 20:27:59 +03:00
Nikolay Krasko 162c2f3dc9 201: openapi.jar is removed 2020-02-11 20:27:59 +03:00
Dmitriy Dolovov 51af1c13b1 [Commonizer] Don't use base64 with padding in paths to libraries 2020-02-11 17:14:11 +07:00
Dmitriy Dolovov b9911d0e0c [Commonizer] Use only if kotlin.native.enableDependencyPropagation=false 2020-02-11 08:51:54 +07:00
Dmitriy Dolovov 63b03d29dc [Commonizer] Prevent from running commonizer from Gradle more then once 2020-02-11 08:51:39 +07:00
Dmitriy Dolovov 7cf4395ccd [Commonizer] Integrate commonizer to the Gradle plugin, p.2
Call commonizer CLI via Gradle tool runner.
2020-02-11 08:51:32 +07:00
Dmitriy Dolovov d7e82bf899 [Commonizer] Integrate commonizer to the Gradle plugin, p.1
Detect when it's really necessary to run commonizer. Resolve Kotlin/Native
platform dependencies. Add dependencies to the proper Gradle configurations.

Note: The most common source sets such as "commonMain" and "commonTest"
should not be used as Native intermediate source sets.
2020-02-11 08:51:24 +07:00
Ilya Matveev 10d2eebe28 Gradle, native: Fix running cinterop on Windows hosts 2020-02-07 18:51:07 +07:00
Dmitriy Dolovov 6d21e0c5e2 Fix: Kotlin/Native compiler tool name in Gradle IT 2020-02-06 14:13:18 +07:00
Dmitriy Dolovov b8e49cb784 Fix: Kotlin/Native compiler tool name in Gradle root runner 2020-02-06 10:10:22 +07:00
Sergey Igushkin 764bf1cb32 Add a non-public-API mechanism to import free args for MPP source sets
Arguments can be set using a project extra property following the
pattern: `kotlin.mpp.freeCompilerArgsForSourceSet.$sourceSetName`.

Only a compilation's default source set free args are appended to the
compiler args during Gradle builds.
2020-02-05 20:46:26 +03:00
Sergey Igushkin a8aa334203 Fix API version parsing: add 1.4 to available values
In Kotlin 1.3, we didn't allow setting language version to 1.4. With
the default language version changed to 1.4, it worked because the
language version had only been checked in the setter of the language
settings, and the default value had not been checked.
2020-02-05 20:46:25 +03:00
Sergey Igushkin cd32cef2b6 Fix MPP Gradle tests
* Use `maven { setUrl(...) }` in Groovy DSL
* Configure compilation tasks beforehand
  in testMppBuildWithCompilerPlugins
* Prevent `gradleSettingsScript()` from failing
  when no settings script is found
2020-02-05 20:46:24 +03:00
Sergey Igushkin 77f60d6d6c Enable KlibBasedMppIT by default and on all host (using Linux targets) 2020-02-05 20:45:40 +03:00
Sergey Igushkin 5cc8dfb2a3 Compile common code to klib whenever HMPP is enabled
As the HMPP with *.kotlin_metadata was never widespread, we can
immediately move to *.klib compilations whenever a build author
enables HMPP.
2020-02-05 20:45:40 +03:00
Sergey Igushkin 0ef8d23f57 Rework legacy metadata variant in MPP with source sets metadata
* Make publishing the compatibility variant optional, and don't publish
  the compatibility variant by default -- the library maintainer should
  do this explicitly
* To build the compatibility artifact, compile the commonMain source
  set using a separate compilation (the default `main` compilation,
  while creating a separate `commonMain` compilation; this separation
  is needed to be able to still compile *.kotlin_metadata from
  commonMain even when compiling *.klib from all source sets)
* When the compatibility variant is disabled, clear the dependencies of
  the `main` compilation and disable its Kotlin compilation task
* When the compatibility variant is enabled, exposed it for project
  dependencies resolution as well, so that its artifact can be used by
  the dependent project instead of the granular metadata artifact that
  will contain *.klib (which can't be read by the legacy compiler)
* Refactor the configuration of the metadata compilation dependencies:
  concentrate all the logic in one place and make it process the source
  sets graph lazily.
2020-02-05 20:45:39 +03:00
Sergey Igushkin 8a08fef2b3 Export implementation dependencies of Native-shared source sets as API
As the Kotlin/Native compiler always requires transitive dependencies
to be present among the libraries during compilation, it is necessary
to export the implementation dependencies of Native-shared source sets
as if they were API dependencies.

To do that, add the extendsFrom-relationship between the apiElements
configuration of the metadata target (so that Gradle adds the
dependencies to the transitive dependencies graph) and also add the
dependencies to the project structure metadata (so that the consumer
can find out that it's only their corresponding Native-shared source
sets that need these particular transitive dependencies)
2020-02-05 20:45:39 +03:00
Sergey Igushkin 81216ceb51 Use the project name + compilation name for secondary klib compilations
This helps avoid duplicate library names when compiling shared-Native
source sets (the resulting klibs will have a more unique name than just
the source set name which likely repeats between projects)
2020-02-05 20:45:38 +03:00
Pavel Kirpichenkov a5d201e263 Exclude unsupported language versions from gradle options
^KT-36146 Fixed
2020-02-05 20:15:17 +03:00
Ilya Goncharov 1e2e556328 [Gradle, JS] Fix test 2020-02-04 16:21:13 +03:00
Ilya Goncharov 60da37404e [Gradle, JS] Distribution and distributeResources 2020-02-04 13:07:10 +03:00
Dmitriy Dolovov e302818e26 Refactor KotlinNativeToolRunner to make it extendable
Now, it's possible to add new tool runners independent of Kotlin/Native
distribution. Ex: Upcoming KotlinNativeKlibCommonizerToolRunner
2020-02-04 15:49:49 +07:00
Roman Golyshev fe779bf7bd KT-34795 Fix failing NewMultiplatformIT#testLibAndApp test
- Revert back `maven(...)` to `maven { setUrl(...) }`, because in this test this syntax is used intentionally to be valid both for `.gradle` and `.gradle.kts`
2020-02-03 15:55:28 +03:00
Dmitriy Dolovov ef199f8e45 Mark obsolete createKotlinLibrary() call as @Deprecated 2020-02-01 17:07:18 +07:00
Pavel Kirpichenkov 3819b2ce59 Change unsupported 1.0 version in maven plugin tests
KT-36146
2020-01-31 16:58:51 +03:00
Pavel Kirpichenkov 724eda8fdb Advance explicit Kotlin versions in gradle integration tests
1.0 and 1.1 are no longer supported starting from 1.4, new errors break tests
See KT-36146
2020-01-31 11:47:25 +03:00
Vyacheslav Gerasimov 06448b6469 Revert "Set local build version to 1.4.255-SNAPSHOT"
This reverts commit a8650ccf
2020-01-30 18:20:27 +03:00
Vyacheslav Gerasimov a8650ccfd2 Set local build version to 1.4.255-SNAPSHOT
#KT-36128
2020-01-29 20:20:33 +03:00
Alexander Udalov 953b461c53 Add new compiler errors and flags when JVM compiles against JVM IR
From now on, the old JVM backend will report an error by default when
compiling against class files produced by the JVM IR backend. This is
needed because we're not yet sure that the ABI generated by JVM IR is
fully correct and do not want to land in a 2-dimensional compatibility
situation where we'll need to consider twice more scenarios when
introducing any breaking change in the language. This is generally OK
since the JVM IR backend is still going to be experimental in 1.4.

However, for purposes of users which _do_ need to compile something with
the old backend against JVM IR, we provide two new compiler flags:
* -Xallow-jvm-ir-dependencies -- allows to suppress the error when
  compiling with the old backend against JVM IR.
* -Xir-binary-with-stable-api -- allows to mark the generated binaries
  as stable, when compiling anything with JVM IR, so that dependent
  modules will compile even with the old backend automatically. In this
  case, the author usually does not care for the generated ABI, or s/he
  ensures that it's consistent with the one expected by the old compiler
  with some external tools.

Internally, this is implemented by storing two new flags in
kotlin.Metadata: one tells if the class file was compiled with the JVM
IR, and another tells if the class file is stable (in case it's compiled
with JVM IR). Implementation is similar to the diagnostic reported by
the pre-release dependency checker.
2020-01-29 17:20:41 +01:00
Vyacheslav Gerasimov e4258e528f Introduce internal property sourceMapBaseDirs for Kotlin2JsCompile
Separate property needed to prevent Gradle snapshotting absolute paths
as inputs when passed as compiler argument.
To reduce property visibility to external users put it to the impl class
which will make it invisible in completion but still usable in Kotlin
build.
2020-01-29 18:15:31 +03:00
Dmitriy Dolovov 9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00
Svyatoslav Kuzmich 091e8495cd [JS IR] Use util-klib tool to filter klib in JS IR gradle plugin 2020-01-29 15:22:07 +03:00
Ilya Gorbunov 7792613f88 Finishing touch: drop experimental coroutines sourcesets from stdlib
#KT-36083
2020-01-29 09:12:42 +03:00
Ilya Gorbunov b5a0daabc3 Extract kotlin.coroutines.experimental API into compat artifact
Add public API dump for kotlin-coroutines-experimental-compat

#KT-36083
2020-01-29 09:12:39 +03:00
Andrey Uskov 4eb38721a5 Minor. Fix BuildSessionLoggerTest 2020-01-27 22:25:28 +03:00
Andrey Uskov 9ae3b2cf43 Fixed locking statistics files when multiple gradle daemons started 2020-01-27 22:23:21 +03:00
Alexander Gorshenev fcce35c06f Move tools to resolveSingleFileKlib 2020-01-27 20:21:32 +03:00
Alexander Gorshenev dfa509ec5b This reverts commits
afb2e9f38d.
    8c4fa6446d.
    f3bc533073.
    ccf084b1a5.
2020-01-27 15:30:16 +03:00
Alexander Gorshenev f3bc533073 Move tools to resolveSingleFileKlib 2020-01-27 14:24:14 +03:00
Ilya Goncharov ca150005a8 [Gradle, JS] Fix Task Configuration Avoidance 2020-01-27 11:50:08 +03:00
Ilya Goncharov a2b774b186 [Gradle, JS] Distribution task depends on processResources 2020-01-27 11:50:08 +03:00
Sergey Igushkin 823d3cc412 (minor) Fix accessing a shared-native compilation's konanTarget
As future some Kotlin/Native compilations in the future may have
different platforms within one target, it's more preferable to
access the konanTarget from the compilation, not its target.
2020-01-24 23:20:56 +03:00
Sergey Igushkin 1f42951152 Fix KlibBasedMppIT test compilation error (missing import) 2020-01-24 20:49:57 +03:00
Vyacheslav Gerasimov 1f3755248c Build: Make task inputs relative to improve caching 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 8e0dd604af Build: Annotate KotlinModuleShadowTransformer with @CacheableTransformer 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 131765537a Build: Implement preserveFileTimestamps for stripMetadata task 2020-01-24 19:40:00 +03:00
Vyacheslav Gerasimov 317972db2a Build: Make :kotlin-reflect:stripMetadata cacheable 2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 3f10329347 Build: Fix publication of stdlib-js to avoid publishing all artifacts
Because of https://github.com/gradle/gradle/issues/4612 install and
uploadArchives tasks published artifacts which were not meant
to be published
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 7dcdc506d8 Build: Fix outputs for :kotlin-stdlib-js:compileJs
jsOutputMetaFile was missing
2020-01-24 19:39:59 +03:00
Vyacheslav Gerasimov 770344770d Build: Make :kotlin-stdlib-js:compileJs task cacheable 2020-01-24 19:39:58 +03:00