52 Commits

Author SHA1 Message Date
Dmitry Savvinov 8f3c0e71fa [native] Drop deprecated Kotlin/Native targets (5/8)
Adjust KGP: drop usages of deprecated KonanTargets, leave
@Deprecated-stubs in public APIs for readable errors

^KT-64517
2024-03-12 16:22:27 +00:00
Sebastian Sellmair 6d38a314cc [Gradle] Remove kpm native variant codegen
KT-61463
2023-08-29 16:45:12 +00:00
Timofey Solonin 969deb639c [MPP] Deprecate preset APIs
^KT-59321
2023-07-28 17:53:45 +00:00
Svyatoslav Scherbina 61dbe7fb75 [Gradle] temporarily change error to warning for linuxArm32Hfp
^KT-58864
2023-07-25 12:33:46 +00:00
Sebastian Sellmair 845c8bd1c3 [Gradle] Implement KotlinGradlePluginDsl annotation and check in for binary compatibility validation
^KT-58676 Verification Pending
2023-06-26 11:36:17 +00:00
Anton Lakotka e5d35f7d1a [Gradle] deprecate android and introduce androidTarget preset
Android preset needs to be removed in favor of Android Pluggable Target

Changes were originally introduced by commit:
becf50ee0f
but then, unfortunately, reverted due to binary compatibility issues

^KT-59049 Verification Pending
^KT-57903 Verification Pending
2023-06-08 22:10:24 +00:00
Anton Lakotka 5a8b6e9603 Revert "[Gradle/MPP] Refactored KotlinTargetContainerWithPresetFunctions"
This reverts commit becf50ee

These changes are binary incompatible due to move of methods with
default arguments.

^KT-59049 In Progress
^KT-57903 In Progress
2023-06-08 22:10:24 +00:00
Alexander Shabalin 1ef198ead4 [Gradle][MPP] Promote several K/N targets deprecation level to error 2023-05-26 14:47:45 +00:00
Stanislav Erokhin becf50ee0f [Gradle/MPP] Refactored KotlinTargetContainerWithPresetFunctions
Android preset functions were moved to a separate interface
because we need to write custom deprecation with ReplaceWith
due KT-57903.
After that we had generated:
 - all the K/N preset functions
 - jvm functions.
I decided to move jvm function to separate file too,
so the whole division to several files would be somewhat sane.

I kept the KotlinTargetContainerWithPresetFunctions interface to
keep source/binary compatibility for the `android`/ `jvm` preset
functions users

#KT-57903 In Progress
2023-04-25 19:40:53 +00:00
Nikolay Krasko 8b12b3f18d Minor: remove code from top-level and move to task configurations 2023-03-20 17:58:15 +00:00
Stanislav Erokhin 37ab139139 [Gradle][MPP] Deprecate several K/N targets 2023-01-11 17:52:28 +00:00
Anton Lakotka fe2ee9886d [Gradle] watchosDeviceArm64 should not run simulator tests
This reverts commit 640ba1ec

^KT-54583 Verification Pending
2022-10-24 11:20:51 +00:00
Anton Lakotka 640ba1ecfa [Gradle] Add watchosDeviceArm64 to nativeTargetsWithSimulatorTests
^KT-53107
2022-10-05 19:32:02 +00:00
Yahor Berdnikau f0cfe60734 Remove deprecated ConfigureUtil usages in HasKotlinDependencies
^KT-46019 In Progress
2022-07-04 15:24:46 +00:00
Yahor Berdnikau ae3451e2c8 Remove deprecated ConfigureUtil usages in KotlinNativeBinaryContainer
^KT-46019 In Progress
2022-07-04 15:24:44 +00:00
Yahor Berdnikau e765d65b50 Remove deprecated ConfigureUtil usages in Kotlin presets DSL
^KT-46019 In Progress
2022-07-04 15:24:44 +00:00
sebastian.sellmair dcd47a89dd [kpm] Introduce GradleKpm* naming convention (1/2)
All Gradle specific kpm entities shall be disambiguated by using
the `GradleKpm` prefix. For example `MyEntity` shall now be called
`GradleKpmMyEntity` and a subclass would be called like
`GradleKpmSpecialMyEntity`
2022-05-25 13:15:42 +00:00
Yahor Berdnikau e38ca74927 Fix compilation warnings in 'pill-importer' project
These warnings have fail compilation with bootstrap.
2022-05-03 11:47:30 +00:00
konstantin.tskhovrebov e974d16e7a Add KotlinArtifactsExtensionImpl code generator. 2022-04-21 08:32:28 +00:00
Yahor Berdnikau 2c7992596c Remove 'kotlin-gradle-plugin-dsl-codegen' from Gradle dependencies
Gradle dependencies configuration doesn't make sense in this module.

^KT-49227 In Progress
2022-04-04 20:38:00 +02:00
Yahor Berdnikau 0af5b34921 Move some Gradle libraries to use common-dependency configuration
^KT-49227 In Progress
2022-02-22 12:35:02 +00:00
Anton Lakotka f1261bd799 [MPP, KPM]: Generate KpmNativeVariants from KonanTargets 2022-02-14 15:05:00 +00: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 ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
sebastian.sellmair 5dcaaf47cb [Gradle] Support for Apple Silicon targets
^KT-45302 Verification Pending
2021-05-28 14:27:32 +00:00
Sergey Bogolepov f3424a98b7 generateMppTargetContainerWithPresets: remove unneeded hack 2020-11-30 14:01:12 +07:00
Sergey Bogolepov e39560b134 [KT-43276] Add watchos_x64 target 2020-11-30 14:01:12 +07:00
Ilya Goncharov cc97138e9c [Gradle, JS] Extract JS presets container, no js in codegen since now 2020-02-21 13:14:36 +03:00
Ilya Goncharov fa335b5360 [Gradle, JS] Js default compiler type for mpp 2020-02-21 13:14:36 +03:00
Ilya Goncharov 488538889b [Gradle, JS] Extract JS presets container, no js in codegen since now 2020-02-20 19:32:34 +03:00
Ilya Goncharov a5602165ec [Gradle, JS] Fix names for js mpp 2020-02-20 19:32:33 +03:00
Ilya Goncharov 37b3b3ec56 [Gradle, JS] Js default compiler type for mpp 2020-02-20 19:32:33 +03:00
Ilya Goncharov ae391f3776 [Gradle, JS] Fix codegen for js platform 2020-02-20 19:32:31 +03:00
Ilya Goncharov 6793fb285e [Gradle, JS] Prepare for review 2020-02-12 17:29:32 +03:00
Ilya Goncharov 406c249d99 [Gradle, JS] Fix mpp generator 2020-02-12 17:29:29 +03:00
Ilya Goncharov d0e2a653f7 [Gradle, JS] Reformat code 2020-02-12 17:29:22 +03:00
Dmitriy Dolovov 9594b8db42 Rename Kotlin/Native modules for uniformity 2020-01-29 20:30:46 +07:00
Ilya Matveev cc3438f20c Gradle, native: Add separate classes for targets with different tests 2019-12-11 19:57:21 +07:00
Ilya Matveev e6ab70c18d Gradle, native: Support simulator tests 2019-12-11 19:57:21 +07:00
Ilya Matveev 37e828d4aa Gradle, native: Disable watchOS x64
Currently a 64-bit simulator for watchOS is not available so
we disable this target.
2019-10-11 18:28:18 +03:00
Sergey Igushkin 9f0c5675bd Introduce execution & test run API, KT-32679
* KotlinExecution
* KotlinExecutionSource
* KotlinTestRun
* Aggregating executions and execution sources
* KotlinTargetWithTests

* Add a `testableTargets` extension
* Make some Kotlin/Native targets testable (this requires
  having a separate preset type for them)
* Implement test runs encapsulating the tests for all
  existing testable targets by refactoring their
  TargetConfigurator classes

Issue #KT-32679 Fixed
2019-09-25 15:46:01 +03:00
Ilya Matveev 5b64410259 Gradle, native: Remove kotlin native repo in DSL codegen 2019-05-28 20:26:29 +03:00
Ilya Matveev cfb8e75829 Revert "Use kotlin-native-shared in the Gradle plugin"
This reverts commit c9ed648303.
2019-05-28 20:26:29 +03:00
Ilya Matveev f47aafc471 Gradle, native: Rename test binary class: Test -> TestExecutable 2019-05-28 10:46:23 +03:00
Ilya Matveev 48b1f71cef Gradle, native: Introduce separate binary type for tests
Earlier native tests were represented by the same binary type as product
executables. We also used to create test tasks in the same manner as run
tasks for product executables. Such tasks could be obtained used a property
of an executable binary with type Exec.

But now we have a separate class for test tasks. Also we probably will want
to create several tasks for the same test. So we cannot use the same run task
property for both test and product executables. Also representing test and
product executables by the same binary type leads to the fact that assemble
task execution causes building not only product binaries but also the test
ones.

This patch solves the issues described above by introducing a separate binary
type for tests. Such a test binary can be created in the same manner as other
binaries:

    kotlin.macosX64 {
        binaries {
            test("integration") { ... }
        }
    }

One test binary and a task executing it is created by the plugin out of the box.
This test binary replaces a test executable used to be created earlier.

Issue #KT-31609 Fixed
2019-05-28 10:46:23 +03:00
Sergey Rostov c0deea33bb Gradle, JS: resolve NPM dependencies inside task when possible
#KT-30530
2019-05-18 08:15:28 +03:00
Sergey Igushkin be05095df5 Introduce Java support in JVM MPP targets (KT-26256)
Deprecate the `jvmWithJava` preset, add warning.

Add a function `withJava()` to JVM MPP targets which applies the 'java'
plugin and sets up the Kotlin & Java interoperation.

Issue #KT-26256 Fixed

Signed-off-by: Sergey Igushkin <hotkeytlt@gmail.com>
2019-05-13 16:25:09 +03:00
Ilya Matveev c9ed648303 Use kotlin-native-shared in the Gradle plugin
The kotlin-native-shared artifact includes API allowing
us to work with K/N platforms, hosts, distribution etc.
This patch replaces a dependency on kotlin-native-utils
containing copies of such classes with a dependency on
published kotlin-native-shared in the Gradle plugin and
bundles kotlin-native-shared into the Gradle plugin jar.
2019-04-25 16:19:11 +07:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Ilya Matveev ea21662bed Provide an extended DSL for final native binaries
In 1.3.0 only basic settings for final native binaries (e.g.
executables or frameworks) are available. They allow a user to
specify what kinds of binaries should be produced from one or another
compilation but they don't allow specifying different options for
different binaries or creating more than 2 (debug and release)
binaries of the same kind (e.g. executable) from the same
compilation. Also link tasks for these binaries are created after
project evaluation thus they are inaccessible for a user outside
of an afterEvaluate block.

This patch adds an extended binary DSL allowing a user to declare
binaries independently from compilations and to specify different
options (e.g. linker arguments) for different binaries. Also
link tasks for binaries declared in this DSL are created at a
configuration time so user can access them outside of an
afterEvaluate block.

Also this patch adds creating run tasks for all executables
declared in the buildscript (KT-28106)

Initial DSL methods for binaries declaration are still supported.

Kotlin DSL example is the following:

kotlin {
    macosX64 {
        binaries {
            // Create debug and release executable with
            // a name prefix 'Foo'.
            // Two domain objects will be created:
            // fooDebugExecutable and fooReleaseExecutable
            executable("Foo", listOf(RELEASE, DEBUG)) {
                compilation = compilations["foo"]
                entryPoint = "foo.main"
                linkerOpts.add("-Llib/path")
                println(runTask.name)
            }

            // Name prefix and build types are optional.
            // debugFramework and releaseFramework are created here.
            framework()
        }
    }
}
2018-12-18 18:34:54 +07:00