I'm trying to use new `webMain` shared source set ...
# webassembly
r
I'm trying to use new
webMain
shared source set with 2.2.20-Beta2 but it doesn't work for me. With
val webMain by getting { }
I have this error
KotlinSourceSet with name 'webMain' not found.
. What am I missing?
đź‘€ 1
What's even stranger ...
webMain.dependencies {}
works fine, which is completely different from https://youtrack.jetbrains.com/issue/KT-79188/Pre-generated-accessors-arent-available-for-webMain-webTest-source-sets
r
@Robert Jaros https://github.com/TheReprator/KVideo-Player may be you get some assistance from here, as i am also using 2.2.20-Beta2 with webMain, it might assist you
r
You are using
webMain.dependencies {}
and it works fine for me as well. But I'm used to
by getting {}
configuration and it seems broken.
r
oops
r
That's why it's called beta I suppose :P
h
What happens when using
webMain by named
?
r
Doesn't work as well. Even simple
getByName("webMain")
doesn't work.
I've also tested
Copy code
sourceSets.configureEach {
    println(this)
}
and it prints both
webMain
and
webTest
correctly.
e
Did you apply the default target hierarchy?
applyDefaultTargetHierarchy()
h
getByName != named. It is just Gradle laziness behavior. configureEach is lazy, named too, getByName isn’t.
r
Did you apply the default target hierarchy?
applyDefaultTargetHierarchy()
Isn't it applied automatically?
Can't find
applyDefaultTargetHierarchy()
, but adding
applyDefaultHierarchyTemplate()
fixes the problem!