Commit Graph

48 Commits

Author SHA1 Message Date
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
Sergey Bogolepov 479e7a5169 [K/N] Fix KT-48566 by falling back to the old behavior
In 1.5.20 HostManager.host started to check host architecture and it
leads to regressing in case of os+arch combination that is not supported
by HostManager.
Before 1.5.20 HostManager.host was determined only by OS. It is
not correct, but Gradle plugin uses HostManager even if there are
no Native targets. We fallback to this behavior to workaround this
regression.
2021-09-07 04:42:01 +00:00
Sergey Bogolepov 1315fdaf56 [K/N] Proper MinGW cross-compilation support 2021-08-23 16:01:36 +00:00
Mikhael Bogdanov 228100ef09 Upgrade toolchain to api/lv 1.4 2021-07-29 19:45:53 +02:00
Pavel Punegov 789799ac17 Revert simpleOsName in HostManager
Support old naming in simpleOsName.
Introduce new platformName method for the new archive naming.
2021-06-02 18:30:52 +03:00
Pavel Punegov 3293a888ca [native] Archive naming: use $os-$arch convention 2021-06-01 10:20:05 +00:00
Pavel Punegov 48ef739525 [native] Rename Apple MacOS targets in simpleOsName
Use Arm64 suffix for Apple Arm arch and X64 for Intel X86_64
2021-06-01 10:20:04 +00:00
Sergey Bogolepov b541721a79 Deprecate Architecture.bitness property
There is no such thing as "bitness" of CPU achitecture.
Something more appropriate and correct (e.g. ABI) should be
introduced instead.
2021-05-27 10:09:25 +03:00
Sergey Bogolepov bed42e9ab2 Revert "Drop useless bitness property from Architecture"
As it turn outs, `Architecture.bitness` leaks to public Gradle API and
we need to deprecate it gracefully.
This reverts commit 79bf2a1f.
2021-05-27 10:09:24 +03:00
Yahor Berdnikau 13fd2a24ea Fix exposing provided by Gradle Kotlin dependencies.
Ensure that Gradle plugin dependencies do not include kotlin-stdlib,
kotlin-reflect and other dependencies that are provided by Gradle
runtime.

^KT-41142 Fixed
2021-05-12 23:28:37 +03:00
Sergey Bogolepov 6ab38c1ff8 Add support for Apple Silicon simulators 2021-04-08 16:51:51 +03:00
Sergey Bogolepov 79bf2a1f14 Drop useless bitness property from Architecture 2021-04-08 16:51:48 +03:00
Sergey Bogolepov 5243720043 Add support for android and wasm on macos_arm64 2021-03-24 17:37:51 +03:00
Sergey Bogolepov 30863cd184 Support the rest of Linux targets on macos_arm64 2021-03-24 17:37:45 +03:00
Sergey Bogolepov 0e1276fc6c Support the rest of Apple targets on macos_arm64 2021-03-24 17:37:44 +03:00
Sergey Bogolepov 8ba4f060f0 Enable linuxX64 target on macOsArm64 host
Because tests for Gradle plugin assumes that linuxX64
is available on all hosts.
2021-03-22 14:02:43 +03:00
Sergey Bogolepov 7e18b69e7d Add initial support for macos_arm64 host 2021-03-22 14:02:41 +03:00
Sergey Bogolepov d276d583ba Keep host_os and host_arch methods for backward-compatibility
Because it is still used by IDE plugin
2021-03-19 15:24:45 +03:00
Sergey Bogolepov 30e9c645f8 Revert "Revert "Cleanup TargetManager.kt a little bit""
This reverts commit 3dd25e49
2021-03-19 15:24:42 +03:00
Sergey Bogolepov 1d8d76eb7f Revert "Revert "Cleanup HostManager.kt a little bit""
This reverts commit 98b2c000
2021-03-19 15:24:41 +03:00
Nikolay Krasko 98b2c00083 Revert "Cleanup HostManager.kt a little bit"
This reverts commit 9d957f68
2021-03-17 20:40:48 +03:00
Nikolay Krasko 3dd25e4965 Revert "Cleanup TargetManager.kt a little bit"
This reverts commit a4010c7a
2021-03-17 20:40:29 +03:00
Sergey Bogolepov a4010c7abe Cleanup TargetManager.kt a little bit 2021-03-17 13:44:03 +00:00
Sergey Bogolepov 9d957f686a Cleanup HostManager.kt a little bit 2021-03-17 13:44:03 +00:00
Sergey Bogolepov d7bd3d671c Fix formatting of HostManager.kt 2021-03-17 13:44:02 +00:00
Alexander Udalov 848b08a475 Minor, suppress 1.3 language version warnings 2021-03-12 11:18:57 +01:00
Alexander Likhachev 2ae7740c46 Set explicit lang version 1.3 for kotlin-native-utils & kotlin-util-io
Without explicit version we cannot use those modules in buildscripts with Gradle 6.8+ because Gradle doesn't set flag `skipPrereleaseCheck` (previously was named `skipMetadataVersionCheck`). This way we make it compatible with all supported versions of Gradle.
2021-03-11 14:12:38 +03:00
Vasily Levchenko 840c1e612c [build] joint (step 2)
- dist:
  - compiler
  - tools(cinterop,klib)
  - stdlib
  - cache
2021-02-24 11:07:13 +01:00
Sergey Bogolepov 06498c0efd Support for macos_arm64 target in backend 2021-02-02 15:30:03 +07:00
Alexander Udalov 77a9d14f93 Capitalize/decapitalize only ASCII characters across project
Use {de,}capitalizeAsciiOnly and to{Lower,Upper}CaseAsciiOnly where
possible, and stdlib's functions with Locale.US everywhere else.

Otherwise, if the default system locale is Turkish, the capital latin
letter "I" is transformed in toLowerCase to "ı" (see
https://github.com/JetBrains/kotlin/blob/66bc142f92085047a1ca64f9a291f0496e33dd98/libraries/stdlib/jvm/test/text/StringJVMTest.kt#L119),
which for example breaks the codegen for `intArrayOf` in
KT-25400/KT-43405.

Similarly, lower case latin letter "i" is transformed to "İ".

 #KT-13631 Fixed
 #KT-25400 Fixed
 #KT-43405 Fixed
2020-12-28 16:10:30 +01:00
Alexander Likhachev 2d2042ad12 [Gradle, K/N] Configuration cache support for compile & link with warns
#KT-43151 Fixed
2020-11-11 10:58:37 +03:00
Sergey Bogolepov 2ad13847d1 [KT-40670] Allow to override konan.properties from CLI 2020-10-20 17:00:00 +07:00
Sergey Bogolepov 5a0a853d9b [Native] Add simple symbol mechanism to konan.properties
Java Properties format is extremely trivial and does not support any
kind of references or variables. It makes konan.properties repetitive.
This commits adds support of perl-like `$` sigil which allows to
reference properties inside values.
2020-09-15 13:54:09 +07:00
Ilya Matveev 5287ffb4a5 [Native] Don't use konan.home to determine a path to the K/N dist
A fix for KT-37550 requires us to stop using system properties when
the compiler is started from Gradle. This patch stops reading the
konan.home property to determine a path to the compiler and requires
this path to be explicitly specified in a constructor of the
Distribution class.

Issue #KT-37550
2020-05-19 18:57:39 +07:00
Nikolay Krasko 4230a17427 Revert "Force bootstrap stdlib in modules that used in composite build"
This reverts commit ad76562c
2020-04-27 15:58:38 +03:00
Nikolay Krasko ad76562cbc Force bootstrap stdlib in modules that used in composite build 2020-04-27 15:36:49 +03:00
Dmitriy Dolovov a2e2213d31 Keep KonanTarget.predefinedTargets as Map<String, KonanTarget> 2020-04-01 23:10:47 +07:00
Dmitriy Dolovov 31a1f8ff4b Include :native:kotlin-native-utils into kotlin-compiler.jar 2020-04-01 11:46:55 +07:00
Ilya Matveev 172a45a637 Gradle, native: Fix building platform libraries for MIPS
The sysroot for linux_mips doesn't contain one of platform
libs available for Linux (zlib). So we need to put def-files
to the K/N distribution on a per-target basis instead of putting
a single set of def-files for all targets of the same OS.

Corresponding change in the K/N repository:
https://github.com/JetBrains/kotlin-native/pull/4023

This patch take this change into account at the Gradle plugin side.
2020-03-30 17:31:12 +07:00
Dmitriy Dolovov 36988cf15c Refactoring: Keep predefined K/N targets inside of KonanTarget.Companion 2020-03-27 13:11:46 +07:00
Dmitriy Dolovov 7a19558d54 Refactoring: Put KonanTarget & related classes into separate .kt files 2020-03-27 13:11:35 +07:00
Ilya Matveev 27f5c577c9 Gradle, native: Generate platform libraries at the user side
Since 1.4, a regular K/N distribution will not contain prebuilt
platform libraries, so the libraries must be generated at the
user side.

This patch adds support for such generation to the MPP Gradle
plugin. The generation itself is performed by separate utility
provided by the K/N compiler distribution. The plugin checks
existence of platform libraries for required targets and starts
this utility if some some of these libraries are missing. Building
caches for platform libraries is also performed at this step.

The patch also adds some project properties allowing a user to
workaround potential problems. User will be able to:
  - Use a special distribution with prebuilt platform libraries.
  - Force building platform libraries in the good old sourcecode mode
    in case of some issues with the new metadata mode.

Kotlin/Native counterpart: https://github.com/JetBrains/kotlin-native/pull/3829.

Issue #KT-32931 Fixed
2020-03-24 18:54:11 +07:00
Sergey Bogolepov e919e7b79a [Gradle][Native][Cache] Don't skip metadata-based interop libraries
`resolveSingleFileKlib` by default doesn't support klibs with
non-default ir providers. In case of cache generation for native interop
libraries we need to override this behavior because they have
ir_provider=kotlin.native.cinterop.
2020-03-12 18:11:47 +07:00
Kirill Shmakov 03c6f13831 Add fallback value in K/N version computation 2020-03-05 08:35:34 +03: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
Dmitriy Dolovov 4dbf60eb2c Fix: Load properties in konan Distribution in safe way
Issue #KT-36333
2020-02-04 19:24:42 +07:00
Dmitriy Dolovov f69eef811b Minor: Remove unnecessary IO check 2020-02-04 19:24:36 +07:00
Dmitriy Dolovov 9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00