Commit Graph

91227 Commits

Author SHA1 Message Date
Sergey Igushkin 6cc73a73ce KT-MR-5666 Make CompilationDetails.directlyIncludedSourceSets read-only 2022-02-14 15:05:15 +00:00
Anton Lakotka b3bd92ddaa [Gradle] update testKpmModelMapping to run only MPP + Android tests
Add test config for running KPM model mapping with advanced gradle
version
2022-02-14 15:05:15 +00:00
Sergey Igushkin 7048cc3139 KT-MR-5666 Revert removal of default impl for relatedConfigurationNames 2022-02-14 15:05:14 +00:00
Sergey Igushkin 619381e462 KT-MR-5666 Get the older semantics of compileAllTask & outputs
This doesn't suffer from `compilation.allOutputs` not being configurable
and follows the previous implementation
2022-02-14 15:05:14 +00:00
Sergey Igushkin ce53f347a0 KT-MR-5666 Remove reverse mapping in K/N, as the platforms work in KPM 2022-02-14 15:05:13 +00:00
Sergey Igushkin f3606cdd9e KT-MR-5666 Model mapping: throw clearer error for non-MPP projects 2022-02-14 15:05:13 +00:00
Sergey Igushkin a37217809f KPM: Remove the workaround for excluding Android non-AAR variants
It is no longer needed with custom code for Android variants publication
setup.
2022-02-14 15:05:13 +00:00
Sergey Igushkin a574a1f6d2 KT-MR-5666 SourceSetMappedFragmentLocator
* fix choosing longest module name (did mistakenly choose shortest)
* fix missing return for single-part name
* add unit tests
2022-02-14 15:05:12 +00:00
Sergey Igushkin 5e8c74d3ad KT-MR-5666 Minor fixes, refactorings & formatting 2022-02-14 15:05:12 +00:00
Sergey Igushkin 97bb0110c3 KT-MR-5666 Sane default for newDependencyFilesHolder's dependencyFiles 2022-02-14 15:05:11 +00:00
Sergey Igushkin faf2f3e48d KT-MR-5666 Use SetProperty for artifacts in place of ListProperty 2022-02-14 15:05:11 +00:00
Sergey Igushkin b926f3ea2f KT-MR-5666 Keep dep graph utils internal; reuse transitive closure utils 2022-02-14 15:05:10 +00:00
Sergey Igushkin 7a4d81f87f Model mapping: remove interface delegation in AbstractKotlinCompilation 2022-02-14 15:05:10 +00:00
Sergey Igushkin a81049a180 Model mapping: support Android targets 2022-02-14 15:05:10 +00:00
Sergey Igushkin bfbefed331 Model mapping: support mavenPublication { ... } DSL 2022-02-14 15:05:09 +00:00
Sergey Igushkin ffec4a1a43 Model mapping: simulate associateWith by just adding a module dependency 2022-02-14 15:05:09 +00:00
Sergey Igushkin ab8284d5b8 KPM, Model mapping: setup source paths for fragments by source set names
When a fragment is represented as a source set in the mapped model, the
source set name may differ from <fragmentName><moduleName>. For example,
some source set names don't end with *Main or *Test. In case we can
detect the source set that represents the fragment, use the
source set name for the fragment's sources directory.
2022-02-14 15:05:08 +00:00
Sergey Igushkin 3e8b27db4b Model mapping: reorder setup, create the modules early
This is needed in order for the fragment locator to correctly
locate the test module when the `commonTest` source set is created.
2022-02-14 15:05:08 +00:00
Sergey Igushkin f19e65f2d4 Remove illegal dependsOn edges in MPP tests
Those dependsOn edges were not used in any way, and not assertion
checked for them. They are illegal according to KPM design, and
we generally consider such a setup unsupported with the stable MPP
plugin, too.
2022-02-14 15:05:07 +00:00
Sergey Igushkin 388cb96055 Model mapping: rework publications from legacy-mapped variants
Use the publication requests API to express all the details
of a legacy target's publications (artifact & attributes overrides)
2022-02-14 15:05:07 +00:00
Sergey Igushkin 4aeef7169d Model mapping: support Metadata target
Add compilations to the metadata target according to the content
of the KPM metadata compilation registry (`main` module only)
2022-02-14 15:05:07 +00:00
Sergey Igushkin 289c42f431 Model mapping: fix the binaries task not created for Native targets 2022-02-14 15:05:06 +00:00
Sergey Igushkin 55eeb0ca8f Model mapping: apply user-defined attributes in KPM 2022-02-14 15:05:06 +00:00
Sergey Igushkin 51f737056e KPM: adjust naming to match the MPP plugin
Adjust the names of:
* dependency configurations
* elements configurations
* platform JAR tasks
* metadata JAR tasks

All of them omit the module name if it's `main
2022-02-14 15:05:05 +00:00
Sergey Igushkin 3361f015a5 Model mapping: add toString implementation for legacy-mapped variants 2022-02-14 15:05:05 +00:00
Sergey Igushkin 730ba811f6 KPM: filter out duplicates from directRefinesDependencies 2022-02-14 15:05:04 +00:00
Sergey Igushkin 882fd94e59 KPM: don't compile single-platform Native fragments to metadata KLIBs 2022-02-14 15:05:04 +00:00
Sergey Igushkin 52e8f1a32d KPM: consider implementation dependencies as direct module dependencies 2022-02-14 15:05:04 +00:00
Sergey Igushkin a58f04e30b KPM: add module name to directory names in the sources JAR
For example, it will now be `common` -> `commonMain`, so that the
behavior emulates the sources JARs built by the stable MPP plugin
2022-02-14 15:05:03 +00:00
Sergey Igushkin 6546ebd248 KPM: In Native variants, expose the implementation dependencies as API
This simulates the behavior of the stable plugin which also exposes the
implementation dependencies in the Native targets.
2022-02-14 15:05:03 +00:00
Sergey Igushkin f5a400a0eb KPM: Fix JAR naming: put the platform name into appendix, not classifier 2022-02-14 15:05:02 +00:00
Sergey Igushkin c21123cec8 KPM: Add the JVM JAR artifact to the projects archives configuration
This automatically sets up the dependency between the `assemble` task
and the task building the JAR
2022-02-14 15:05:02 +00:00
Sergey Igushkin 29fe11b957 KPM: change detection of single-platform fragments to support WASM
The previous predicate checked only for JVM/Android and JS, now the
check is independent of the particular platform
2022-02-14 15:05:01 +00:00
Sergey Igushkin 43f7d0fe95 KPM: print fragment names in the error from illegal refines(...) calls 2022-02-14 15:05:01 +00:00
Anton Lakotka e237072a68 [MPP, KPM]: Add test runner for KPM Model Mapping
Add new testKpmModelMapping task that will inject
`kotlin.kpm.experimentalModelMapping=true` property for all
testSuites that implements `BaseGradleIT`.
2022-02-14 15:05:01 +00:00
Anton Lakotka c5f0cea9a1 [MPP]: Add support for old Gradle BasePluginConvention
BasePluginConvention was deprecated in favor of BasePluginExtension
which was introduced in 7.1. So it should be supported until 8.0
where it will be removed.
2022-02-14 15:05:00 +00:00
Anton Lakotka f1261bd799 [MPP, KPM]: Generate KpmNativeVariants from KonanTargets 2022-02-14 15:05:00 +00:00
Anton Lakotka bfd5ec3e39 [MPP, KPM]: Use new configureSingleVariantPublication API 2022-02-14 15:04:59 +00:00
Anton Lakotka 4bc1804f23 [MPP, KPM]: Use new configureSingleVariantPublication API 2022-02-14 15:04:59 +00:00
Anton Lakotka 349bcca9e5 [MPP, KPM]: Include sources into publication of LegacyMappedVariant 2022-02-14 15:04:59 +00:00
Sergey Igushkin 0f251477e9 KPM: reshape the API for setting up publications
Accept a more structured requests for setting up publication.

Allow passing lower-level overrides for publication
settings of a particular configuration,
which is needed to set up legacy targets'
publications in KPM.
2022-02-14 15:04:58 +00:00
Sergey Igushkin 8676685ebc Adjust KPM publication for legacy model publication requirements 2022-02-14 15:04:58 +00:00
Sergey Igushkin 42fa23398b KPM publication setup: use lowercase artifact IDs 2022-02-14 15:04:57 +00:00
Sergey Igushkin 87c3a1b531 Prototype reverse model mapping: represent legacy-only targets in KPM 2022-02-14 15:04:57 +00:00
Sergey Igushkin 57b85e155c KPM/Gradle: don't include host-specific klibs into the common metadata 2022-02-14 15:04:56 +00:00
Sergey Igushkin c3fe4e7fb2 KPM/Gradle: disable metadata compilations for JVM & JS shared fragments 2022-02-14 15:04:56 +00:00
Sergey Igushkin dbb34a44f0 Map Kotlin/Native compilation to the supported-platform KPM variants 2022-02-14 15:04:56 +00:00
Sergey Igushkin c67f80e1f3 Map Kotlin/Native compilation to the supported-platform KPM variants 2022-02-14 15:04:55 +00:00
Sergey Igushkin 736a33b182 Fix missing K/N compilation task dependency in the compilationOoutputs 2022-02-14 15:04:55 +00:00
Sergey Igushkin 992f7bf3c1 Disable o.j.k.multiplatform publications with KPM model mapping 2022-02-14 15:04:54 +00:00