mohamed rejeb
11/08/2023, 11:08 AMzsmb
11/08/2023, 12:28 PM"desktop"
in that case is a dynamic name for a JVM target, you could call it anything, and these source set accessors are static, pre-defined properties (implemented here).
So you can either get the source set the regular way
sourceSets {
val desktopMain by getting
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
}
}
Or if you really want an accessor that has autocompletion and is the same as the others, you can define one yourself
// Somewhere in scope, like top level in the Gradle build file
val NamedDomainObjectContainer<KotlinSourceSet>.desktopMain by KotlinSourceSetConvention
// In the kotlin{} block
sourceSets {
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
}
}
Jeff Lockhart
11/08/2023, 5:53 PMjvm("desktop")
, does it still get connected into the default hierarchy template the same as if it had the default jvm
source set name?zsmb
11/08/2023, 6:19 PMjvm
target in the default hierarchy really just depends on common
, so... I suppose the answer is yes. It will definitely depend on common
.Jeff Lockhart
11/08/2023, 6:26 PMjvm
target was a bad example. But if you were to rename a native target, for example, would it still get connected to the hierarchy in the same way?Jeff Lockhart
11/08/2023, 6:29 PMzsmb
11/08/2023, 6:37 PMJeff Lockhart
11/08/2023, 6:38 PM