Commit Graph

50 Commits

Author SHA1 Message Date
Timofey Solonin 3dd33e5aa7 Add external APIs to publish multiplatform resources in a target
^KT-65540
2024-02-27 14:04:51 +00:00
Timofey Solonin 74628c0394 Register multiplatform publication extension
^KT-65540
2024-02-27 10:27:38 +00:00
Yahor Berdnikau bdb96dc0db [Gradle] Rename to HasConfigurableKotlinCompilerOptions
Added "Kotlin" to better indicate to what this interface belongs to.

^KT-65196
2024-02-26 19:32:26 +00:00
Yahor Berdnikau facc9cdb58 [Gradle] Add compiler options DSL for Kotlin targets
Restore compiler options DSL for all Kotlin targets. 'KotlinTarget'
interface does not provide any common way to configuring options - this
is the responsibility of related plugin extensions.

From the hierarchical standpoint of view target DSL overrides options
configured in the extension.

^KT-57292 In Progress
2024-01-19 14:16:11 +00:00
Yahor Berdnikau e527781772 [Gradle] Introduce HasConfigurableCompilerOptions DSL interface
This interface should be attached to the KGP DSL entities that want to
provide an ability to configure Kotlin compiler options.

^KT-60733 In Progress
2024-01-19 14:16:11 +00:00
Yahor Berdnikau 41003732b1 [Gradle] Add JVM toolchain configure method to Kotlin target
These methods are only added to provide more user-friendly error
when user tries to configure JVM toolchain in Kotlin target DSL.

^KT-64629 Verification Pending
2024-01-05 12:34:27 +00:00
Yahor Berdnikau 2af60a5e27 [Gradle] Add deprecated access to sourceSets container inside KotlinTarget
This should keep compatability with user scripts that for any reason tried to configure 'sourceSets' container inside KotlinTarget, but keep such users warned.

^KT-57292 In Progress
2023-12-21 10:30:50 +00:00
Sebastian Sellmair 4c7ad7eeb5 [Gradle] Add IdeMultiplatformImportAction API
This API can be used to schedule actions/setup code that is only
relevant for IDE sync.

^KT-56440 Verification Pending
2023-12-12 14:52:04 +00:00
Yahor Berdnikau ffa6bfc95e [Gradle] Partially restore top-level compiler options DSL in MPP
To support configuring free compiler arguments for all shared source
sets (KT-61573), we restore 'compilerOptions { }' DSL in the
multiplatform extension.

To avoid user confusion on accidentally using 'compilerOptions {}'
inside Kotlin targets and Kotlin compilations DSL, similar methods with
ERROR deprecation level were added into `KotlinTarget` and
`KotlinCompilation` interfaces. Invoking these interfaces will throw
UnsupportedOperationException. Such an approach works both for Kotlin
and Groove Gradle scripts.

^KT-63491 Fixed
2023-11-21 14:06:17 +00:00
Ilya Goncharov dcab981ee8 [Gradle, Wasm] Use static source sets accessors for wasm
^KT-62955 fixed
2023-11-20 10:30:16 +00:00
Igor Yakovlev 38695ff14c Fix Wasm gradle plugin DSL invalid behaviour
Fixed #KT-63315
2023-11-08 18:48:33 +01:00
Sebastian Sellmair a8e637205c [Gradle] Migrate extraProperties.getOrPut usages to *StoredProperty
KT-61634
2023-10-17 12:10:15 +00:00
Ilya Goncharov 22a01432df [Gradle,JS] Remove legacy target in Gradle plugin
This reverts commit 4c82206d

^KT-60694 fixed
2023-10-17 09:42:38 +00:00
Sebastian Sellmair 1dad890652 [Gradle][KMP] Remove top level and target level compilerOptions APIs
as those experimental APIs have shown to negatively affect usages
of stable APIs (because of resolve confusion), whilst also
failing to address popular use cases.

KT-61636
KT-61355
KT-61368
2023-10-04 12:23:39 +00:00
Sebastian Sellmair 34abc008ec [Gradle] Update api dump after removing KPM import code
KT-61463
2023-08-29 16:45:12 +00:00
Yahor Berdnikau bc871c6cfa [Gradle] Add multiplatform extension compiler options DSL
Now the multiplatform extension exposes compiler option DSL for common
compiler arguments. This compiler option synced as a convention for
targets compiler option.

In the case of Kotlin source sets which are not used as defaultSourceSet
 in compilations - extension compiler options are synced as convention
 into those.

^KT-57292 In Progress
2023-08-07 14:09:31 +00:00
Yahor Berdnikau 7dfbf28d93 [Gradle] Introduce compilerOptions for Kotlin external target
Kotlin external target now properly exposes compilerOptions which could
be used by target users to configure target compilations compiler
options.

^KT-57292 In Progress
2023-08-03 14:29:44 +00:00
Ilya Goncharov b9e5b8a087 [Gradle, Wasm] Add wasmWasi target, replace wasm target onto wasmJs
KT-60654
2023-08-01 13:11:36 +00:00
Timofey Solonin a580d4e5aa [MPP] Validate fromPreset API changes 2023-07-28 17:53:45 +00:00
Ilya Goncharov 4c82206d3b [Gradle,JS] Return legacy target to Gradle plugin back 2023-07-28 09:29:03 +00:00
Sebastian Sellmair 7cef7ac639 [Gradle] Restore 'KotlinTargetHierarchyDsl' for easier transition to hierarchy templates
^KT-60596 Verification Pending
2023-07-27 08:07:34 +00:00
Ilya Goncharov 54debac4c5 [Gradle, JS] Remove K/JS legacy support from Gradle plugin 2023-07-25 13:08:23 +00:00
Sebastian Sellmair 96b33007e5 [Gradle] Implement 'publishJvmEnvironmentAttribute' flag
When the flag is 'on', then publications will include
The 'org.gradle.jvm.environment' Gradle attribute.

We previously did not publish this attribute, as it lead
to problems for 'old' consumers.

We will roll out publications gradually with this feature flag.
The external Android target is expected to opt into this flag
as it is necessary for disambiguating Android from JVM targets
when the external Android target also uses KotlinPlatformType.jvm
2023-07-21 14:24:10 +00:00
Sebastian Sellmair 4e85434536 [Gradle] Implement CompilationAssociator.default, ...
... to allow extending the default behaviour for ExternalTargetApi consumers

^KT-59562 Verification Pending
2023-07-01 06:58:16 +00:00
Sebastian Sellmair 24debfd9b7 [Gradle] ExternalTargetApi: Implement ExternalKotlinTargetSourcesJarUtils
This utils are intended to be used external target authors exclusively
and shall help to create sources.jar files using regular
Kotlin Multiplatform conventions.

^KT-58109 Verification Pending
2023-06-30 09:34:07 +00:00
Sebastian Sellmair 3f1faa26ac [Gradle] ExternalTargetApi: Add sourcesElements-published and add this configuration to the published component
^KT-58109 In Progress
2023-06-30 09:34:07 +00:00
Sebastian Sellmair 1cd8089e92 [Gradle] Move KotlinHierarchyTemplate.Templates.default into -api module
^KT-58676 Verification Pending
2023-06-26 11:36:17 +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
Sebastian Sellmair b2dd83515c [Gradle] Stabilise Kotlin Hierarchy Template DSL
- Remove 'Target' name from hierarchy components as in
    - KotlinTargetHierarchyBuilder -> KotlinHierarchyBuilder
    - KotlinTargetHierarchyDsl -> KotlinHierarchyDsl

- Rename KotlinTargetHierarchyDescriptor -> KotlinHierarchyTemplate
    To convey a better intuition about the 'template' vs 'layout' separation:
    A 'template' is used to 'layout' the actual 'hierarchy' on a given project.

- Move entities from .mpp.targetHierarchy to .hierarchy package
    As the .targetHierarchy package was using the 'target' term as well

- Rename SourceSetTree to KotlinSourceSetTree

- Rename SourceSetTreeClassifier to KotlinSourceSetTreeClassifier
    (Support external target APIs by introducing a V2 api version)

^KT-58676 In Progress
2023-06-26 11:36:16 +00:00
Sebastian Sellmair a80d6a7b74 [Gradle] Ide Dependency Resolution: Filter 'loop' or 'self' dependencies
Those are dependencies that point back to the original project.
This can happen with two projects like

```
// project a
kotlin {
    commonMain.get().dependencies {
        api(project(":b"))
    }
}

// project b
kotlin {
    commonTest.get().dependencies {
        implementation(project(":a"))
    }
}
```

Where b(test) -> a -> b

^KT-59020 Verification Pending
2023-06-07 12:38:54 +00:00
Anton Lakotka dfae730d0f [Gradle] Update kotlin-gradle-plugin.api after removing
unused defaultConfigurationName

^KT-55201 Verification Pending
2023-05-31 15:45:26 +00:00
Sebastian Sellmair ff7e4f7986 [Gradle] Implement SourceSetTreeClassifier API
- This new API will be configurable for 'External Kotlin Targets'
- This change also moves targetHierarchy.android {} into the androidTarget
to avoid potential confusion around the KGP managed AndroidTarget vs
the Google implementation.

KT-58710
2023-05-16 13:19:42 +00:00
Sebastian Sellmair ca2a5a8ebf [Gradle] Remove .configure property from External.*Descriptors
KT-58601
2023-05-12 08:14:47 +00:00
Sebastian Sellmair 74fd66202b [Gradle] Remove unnecessary Deprecated ExternalKotlinTargetApis
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair d9f572bc0b [Gradle] Remove old ExternalTargetApiExtensions
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair f588b06ca5 [Gradle] Remove .configure duplication in ExternalKotlinTargetDescriptorBuilder
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair e1e2c04044 [Gradle] Replace IdeMultiplatformImport.*Level enums with simpler IdeMultiplatformImport.Priority
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair 82ac61e306 [Gradle] Remove IdeDependencyResolver and IdeDependencyTransformer .plus methods
KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair ca38f3192c [Gradle] IdeAdditionalArtifactResolver, IdeDependencyResolver: Replace object Empty with companion val empty
... to remove the type from the API surface.

KT-58601
2023-05-12 08:14:46 +00:00
Sebastian Sellmair caa6b6f9f3 [Gradle] ExternalTargetApi: Check-in/Document ExternalKotlinCompilationDescriptor
KT-55524
2023-04-25 12:49:52 +00:00
Sebastian Sellmair 5e13e118fa [Gradle] ExternalTargetApi: Rename 'DecoratedKotlinCompilationFactory' to 'CompilationFactory'
To be consistent with 'TargetFactory' in ExternalKotlinTargetDescriptor

KT-55524
2023-04-25 12:49:52 +00:00
Sebastian Sellmair 898e2beecb [Gradle] ExternalTargetApi: Rename 'ExternalDecoratedKotlinCompilation' to 'DecoratedExternalKotlinCompilation'
To be consistent with 'DecoratedExternalKotlinTarget'

KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 6e6e2977f9 [Gradle] ExternalTargetApi: Check-in/Document IdeDependencyTransformer
KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 6a38162b45 [Gradle] ExternalTargetApi: Check-in/Document IdeAdditionalArtifactResolver
KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 9978906f6f [Gradle] ExternalTargetApi: Check-in/Document IdeDependencyEffect
KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 55cc2e5e42 [Gradle] ExternalTargetApi: Check-in/Document ExternalKotlinTargetDescriptor
KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 403a4b48fa [Gradle] ExternalTargetApi: Check-in/Document IdeMultiplatformImport
KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 127f3e55e8 [Gradle] ExternalTargetApi: Check-in/Document IdeDependencyResolver
KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 63f8cf2237 [Gradle] ExternalTargetApi: Check-in/Document IdeBinaryDependencyResolver
KT-55524
2023-04-25 12:49:51 +00:00
Sebastian Sellmair 9f003328cf [Gradle] Setup initial api validation for ExternalTargetApi
KT-55524
2023-04-25 12:49:50 +00:00