422 Commits

Author SHA1 Message Date
Anton Lakotka f72b67a5ca [Gradle] Update kotlin-gradle-plugin-api.api
Add new field `sourcesElementsConfigurationName` to KotlinTarget

^KT-36943
2022-12-01 18:57:03 +00:00
Anton Lakotka 3fa85bf7fd [Gradle, MPP] Publish sources as gradle variants
Now when MPP library is published it will contain "sourcesElements"
variant for each target and one for common code.

Sources variants are published under gradle attributes that were
borrowed from Java Gradle Plugin for consistency reasons.
This makes it compatible with JVM tooling that rely on these attributes.

^KT-36943 Verification Pending
2022-12-01 18:57:02 +00:00
Artem Daugel-Dauge 4f736524b2 KT-54969 Kotlin artifacts withPodspec DSL 2022-11-27 18:09:38 +00:00
Sebastian Sellmair e5398e6be7 [Gradle][Minor] Move KotlinTargetComponent into separate source file
KT-54981
2022-11-21 07:33:17 +00:00
Ilya Gorbunov 59131f8138 Use BCV plugin to dump and check public API of Kotlin Gradle plugin-related artifacts 2022-11-18 06:00:18 +00:00
Ilya Goncharov 54a166b2a3 [Gradle, JS] Deprecate for users to not use on their scripts 2022-11-01 14:08:55 +00:00
Ilya Goncharov 8dbdfb4591 [Gradle, JS] Generate externals inside top level dependencies with deprecation 2022-11-01 14:08:54 +00:00
Sebastian Sellmair f148390e14 [Gradle] Rename KotlinCompilationData to GradleKpmCompilationData
^KT-54312 Verification Pending
2022-10-27 09:13:16 +00:00
Sebastian Sellmair b3d82c74fe [Gradle] KotlinCompilation: Remove .ownModuleName vs .moduleName duplication
This mechanism is simply not necessary anymore.
Just using the 'ownModuleName' as the value of 'moduleName' is
sufficient.

^KT-54312 Verification Pending
2022-10-27 09:13:16 +00:00
Sebastian Sellmair c71517399e [Gradle] Remove Compiler.*Options typealias
^KT-54312 Verification Pending
2022-10-27 09:13:10 +00:00
Sebastian Sellmair 69b7cef2e2 [Gradle] Restore AbstractKotlinCompilation and AbstractKotlinCompilationToRunnableFiles...
... into KotlinCompilation class hierarchy (scheduled for removal later)

KT-54312
2022-10-27 09:13:08 +00:00
Sebastian Sellmair 4cbd715b17 [Gradle] Implement Kotlin*NativeCompilations with underlying KotlinCompilationImpl
KT-54312
2022-10-27 09:13:06 +00:00
Sebastian Sellmair a67b2a8be5 [Gradle] Implement KotlinJvmCompilation with new underlying KotlinCompilationImpl
KT-54312
2022-10-27 09:13:06 +00:00
Sebastian Sellmair aef7512477 [Gradle][Minor] Move KotlinCompilationOutput into separate source file
KT-54312
2022-10-27 09:13:01 +00:00
Sebastian Sellmair b5327bc46e [Gradle][Minor] Move Kotlin2JvmSourceSetProcessor into separate source file
KT-54312
2022-10-27 09:12:57 +00:00
sebastian.sellmair c332c928fc [Gradle][MPP] Refine naming for KotlinTargetHierarchyBuilder
^KT-53570 Verification Pending
2022-10-24 14:34:49 +00:00
Sebastian Sellmair da8a18920d [Gradle][MPP] Mark KotlinTargetsContainer and KotlinTargetHierarchyBuilder with KotlinTargetsDsl annotation
To prevent confusing shortcuts defined on `KotlinTargetsContainer`
when declaring a KotlinTargetHierarchy:

e.g.

```kotlin
kotlin {
    targetHierarchy.default {
        common {
            ios() // <- [DSL_SCOPE_VIOLATION]
            //'fun ios(): Unit' can't be called in this context
            // by implicit receiver. Use the explicit one if necessary
        }
    }
 }
```

^KT-53570 Verification Pending
2022-10-24 14:34:48 +00:00
Sebastian Sellmair 1823e0fad4 [Gradle][MPP] KotlinTargetHierarchyBuilderImpl: only build child groups if explicitly included
^KT-53570 Verification Pending
2022-10-24 14:34:47 +00:00
Sebastian Sellmair 487368d9df [Gradle][MPP] KotlinTargetHierarchyDescriptor: Remove function supertype
^KT-53570 Verification Pending
2022-10-24 14:34:47 +00:00
Sebastian Sellmair a8a861e1ce [Gradle][MPP] KotlinTargetHierarchyBuilder: implement w/ include & exclude predicates
^KT-53570 Verification Pending
2022-10-24 14:34:47 +00:00
Sebastian Sellmair c5d6162578 [Gradle][MPP] Implement initial KotlinTargetHierarchy APIs
^KT-53570 Verification Pending
2022-10-24 14:34:46 +00:00
Ilya Goncharov c7fff95231 [JS] Warning on npm dependencies with generateExternals declaration 2022-10-18 14:01:26 +00:00
Ilya Goncharov 1d97b9b936 [Gradle, JS] Remove generateExternals 2022-10-18 14:01:24 +00:00
Sergej Jaskiewicz 227864c6ec [JS IR] Add a compiler option for generating name entries in sourcemaps 2022-10-14 10:09:39 +00:00
Yahor Berdnikau 023b9bf284 Align new compiler options names with api naming
Use Kotlin*CompilerOptions or Kotlin*CompilerToolOptions naming approach.

^KT-54306 Fixed
2022-10-13 12:19:08 +00:00
Nikolay Krasko 6afceb1e84 Remove more usages for embedded with isTransitive = true
It's a refactoring because the list of dependencies shouldn't change

Follow up for KTI-942
2022-10-12 13:44:30 +00:00
konstantin.tskhovrebov afa8a577cc [KT-54060] Disable bitcode embedding to frameworks for Xcode >= 14. 2022-09-30 09:54:33 +00:00
Alexander Udalov ba150ca370 Add JVM target bytecode version 19
Test data in `box/annotations/typeAnnotations` is changed because nested
classes in type annotations are rendered differently in JDK 19
(`Outer.Nested` instead of `Outer$Nested`).

 #KT-54116 Fixed
2022-09-22 21:56:10 +02:00
Ilya Goncharov cab79d950f [Gradle, JS] outputName -> moduleName 2022-09-21 10:58:25 +00:00
Ilya Goncharov 55731f27a4 [Gradle, JS] Adopt changes about compilerOptions 2022-09-21 10:58:24 +00:00
Ilya Goncharov 8d90173ea5 [JS, IR] Deprecated outputFile 2022-09-21 10:58:23 +00:00
Sebastian Sellmair 7a8250cf17 [Gradle] Add ReadMe.md to k.g.p-api module
^KT-54029 Verification Pending
2022-09-19 16:03:46 +00:00
Sebastian Sellmair 8189d7b254 [Gradle] Implement kotlin-gradle-plugin-annotations module
This will include Internal* and *Experimental annotations for the
Kotlin Gradle Plugin. The separate module is proposed, so that
additional modules can use those annotations without
a dependency to the full kotlin-gradle-plugin-api module
(see -idea modules)

^KT-54029 WIP
2022-09-19 16:03:44 +00:00
Yahor Berdnikau c81f1259c3 Update KotlinNativeArtifact usages
^KT-27301 In Progress
2022-09-19 12:30:41 +02:00
Yahor Berdnikau 4881e32e44 Update KotlinJsDce task to use compiler options
^KT-27301 In Progress
2022-09-19 12:30:40 +02:00
Yahor Berdnikau b2f03f6224 Update KotlinCompile task to use compiler options
For Android extension temporary solution via KotlinJvmOptions is
provided.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau cb6ba1487b Update CompilationDetails to use Compiler*Options
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau a3ac5b91f6 Update Gradle plugin api to use compiler options
Binary compatible. Source incompatible via adding new methods to
interfaces.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 286d0d56af Introduce Kotlin compiler options with Gradle Properties API types
Old one is deprecated and delegates to new options. All new options
are marked with task input types, so they could be used as `@Nested`
input.

Generated options are using specific types in generated
compiler options. This should simplify code completion and provide
meaningful hints to user.

At this point repository compilation will fail.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 28dd3d4e71 Generate Gradle compiler types into separate project
This will allow to use them on the DSL generation.

^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau 5eebcf8c77 Generate Js runtime diagnostic mode type
^KT-27301 In Progress
2022-09-19 12:30:39 +02:00
Yahor Berdnikau c1ed683ed8 Generate Js source map embed mode type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 626bd34319 Generate JS module kind type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 14f45b48b3 Generate JS main function execution mode type
^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 7772ab00cd Generate JvmTarget Gradle DSL object
This is generated based on JvmTarget compiler type without exposing
compiler internals.

^KT-27301 In Progress
2022-09-19 12:30:38 +02:00
Yahor Berdnikau 6842842827 Generate KotlinVersion Gradle DSL object
To avoid exposing compiler internal types inside Gradle DSL public api.

ApiVersion and LanguageVersion in terms of compiler api is almost the
same. Actually ApiVersion is generated based on LanguageVersion. To
reduce user confusion what enum to use and what is the difference
- in Gradle DSL they are now exposed as single enum - KotlinVersion.

Mark KotlinVersion with DeprecationLevel.ERROR if related
LanguageVersion is unsupported and with DeprecationLevel.WARNING if
related LanguageVersion is deprecated.

^KT-27301 In Progress
2022-09-19 12:30:34 +02:00
Ilya Goncharov bf8681296b [Gradle, JS] IR by default and report warnings for using legacy compiler
- just legacy - report warning about deprecation
- both - report warning about deprecation of legacy
- no compiler explicitly chosen - error about explicit setting compiler

warn from cli legacy compiler

nowarn flag - kotlin.js.compiler.nowarn

KT-42326
KT-53074
2022-09-16 09:48:41 +00:00
Alexander Udalov 0569f429dd Report error on -Xuse-old-backend, remove Gradle option useOldBackend
Allow using old JVM backend only to compile kts.

 #KT-48532 Fixed
2022-09-16 00:16:31 +02:00
Sebastian Sellmair f4eba62f8c [Gradle][MPP] Ensure presence of .defaultSourceSet when creating kotlinCompilations
This will finally make calls to KotlinCompilation.defaultSourceSet
or sourceSets.getByName(compilation.defaultSourceSetName) safe.

This will also enable removing the `kotlinSourceSetsIncludingDefault`
pitfall

^KT-52726 Verification Pending
2022-09-12 10:58:46 +00:00
Yahor Berdnikau 59a052a615 Add '@NormalizeLineEndings' annotation to task inputs
Excluding '@Classpath' inputs due to the bug in Gradle:
https://github.com/gradle/gradle/issues/20708.

Also MacOs only tasks are excluded.

^KT-50673 Fixed
2022-09-07 13:24:25 +00:00