https://kotlinlang.org logo
Title
p

PHondogo

10/29/2020, 8:49 PM
Hello! Is it possible to create several common targets in MPP? If yes then how?
b

Big Chungus

10/29/2020, 10:55 PM
Yes and all custom sourceSets are "common"
Create them via kotlin.sourceSets.create
Then connect them to other sourceSets as needed via dependsOn
p

PHondogo

10/30/2020, 7:51 AM
I need to create the target, to be able to depend on it from other gradle module using gradle attributes.
b

Big Chungus

10/30/2020, 8:01 AM
Correct
p

PHondogo

10/30/2020, 11:26 AM
I couldn't understand how can one module dependens on source set (not target) from another.
b

Big Chungus

10/30/2020, 11:28 AM
It can't, but one module's sourceSets can depend on other sourceSets in the same module
It helps to think of a module as a local lib. Fully isolated and self contained bundle of code. So things you cannot do with external libs you cannot do with modules you depend on as well.