e

    eygraber

    3 weeks ago
    Do custom test source sets need an explicit dependency on the main source set? Or is there some magic convention with the names that sets it up automatically? e.g. in the following example, is
    dependsOn(appleMain)
    necessary?
    with(sourceSets) {
      val appleMain = create("appleMain") {
        dependsOn(getByName("commonMain"))
      }
    
      create("appleTest") {
        dependsOn(appleMain)
        dependsOn(getByName("commonTest"))
      }
    }
    Javier

    Javier

    3 weeks ago
    apple test doesn't need to depend on common test
    darwinMain.dependsOn(commonMain)
    for (darwinMainSourceSet in darwinMainSourceSets) {
      darwinMainSourceSet.dependsOn(darwinMain)
    }
    
    darwinTest.dependsOn(commonTest)
    for (darwinTestSourceSet in darwinTestSourceSets) {
      darwinTestSourceSet.dependsOn(darwinTest)
    }
    appleTest depends on commonTest and commonTest already dopends on commonMain
    e

    eygraber

    3 weeks ago
    I'm not following. I have code in
    commonTest
    that I want to use in
    appleTest
    so I have that dependency there for that reason. My question is, do I need a dependency on
    appleMain
    from
    appleTest
    or is one set up automagically?
    Javier

    Javier

    3 weeks ago
    I am not setting it
    e

    eygraber

    3 weeks ago
    I too have not been setting it, but I'm wondering if I should
    e

    ephemient

    3 weeks ago
    if you create
    kotlin.targets.apple
    then
    kotlin.sourceSets.appleMain
    ,
    kotlin.sourceSets.appleTest
    will be set up, you don't need to create
    e

    eygraber

    3 weeks ago
    I don't want an
    apple
    target; just source sets
    Oliver.O

    Oliver.O

    3 weeks ago
    IIRC, you have to set up that dependency for a custom test target. Only preset test targets come with an implicit dependency on their respective main target.
    e

    eygraber

    3 weeks ago
    So I do need both
    dependsOn(appleMain)
    dependsOn(commonTest)
    Oliver.O

    Oliver.O

    3 weeks ago
    Yes, that's my understanding.
    Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    3 weeks ago
    Never out dependsOn edges from *Test to *Main source sets! This visibility will be inferred for you automatically.
    So to answer the question: no, the dependsOn(appleMain) should be removed!
    e

    eygraber

    3 weeks ago
    Is that inference based on convention, e.g. that the source set suffix is
    main
    and
    test
    ?
    Javier

    Javier

    3 weeks ago
    I would like to know more about that target one
    @Sebastian Sellmair [JB] is that documented?
    currently I am creating each main/test separately but looks like the correct approach is having the properly targets
    Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    3 weeks ago
    No the inference is not based on names, but based on the concept of associated compilations 👍
    Javier

    Javier

    3 weeks ago
    But is there any difference/utility in creating those targets or they are irrelevant?
    Oliver.O

    Oliver.O

    3 weeks ago
    Given
    main
    and
    test
    compilations and a modified source set hierarchy like so: •
    commonMain
    frontendMain
    ▪︎
    appleMain
    ▪︎
    desktopMain
    commonTest
    appleTest
    How would the plugin infer that
    appleTest
    should depend on
    appleMain
    but not on
    desktopMain
    or
    frontendMain
    ?
    Javier

    Javier

    3 weeks ago
    I guess it is based on what is able to compile as @Sebastian Sellmair [JB] said. Your apple tests are going associated to X number of tests source sets, and those test source sets are matching the same compilation of their respective main sets. So it infer it
    e

    eygraber

    3 weeks ago
    test source sets are matching the same compilation of their respective main sets
    So if
    iosMain
    depends on
    appleMain
    and
    iosTest
    depends on
    appleTest
    is the inference that
    appleTest
    should depend on
    appleMain
    ?
    Javier

    Javier

    3 weeks ago
    I think so
    e

    eygraber

    2 weeks ago
    @Sebastian Sellmair [JB] can you confirm this
    Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    2 weeks ago
    Let’s do a meetup in the next days, where I present how this works internally, okay? You can use the following mental model: Think of the main and test hierarchy like two modules/two gradle projects. With this setup we also do the inference for you, right? Its similar in main/test relations: The information about which source sets are visible are coming from the concept of
    associatedCompilations
    where test compilations get associated with their main compilations. Based upon this the source set visibility inference is done.
    e

    eygraber

    2 weeks ago
    Would love to hear more about this in a meetup. Hopefully next week if possible; I'm on a company retreat this week 😅
    Oliver.O

    Oliver.O

    2 weeks ago
    I'd be disappointed if such information were restricted to a hand-picked audience. Can't this be done more openly and cooperatively?
    Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    2 weeks ago
    Hmmm, I get this request, but I don't know how to process this. I am just an engineer, trying to help 🥴
    Oliver.O

    Oliver.O

    2 weeks ago
    That's excellent and much appreciated. We're all trying to help here and I think that works best if everyone can participate and benefit. In this case, I don't know what options actually exist and what kind of meetup you are referring to – some closed-shop "VIP" thing? If explanations are too complex for this chat, is there a way to have open meetups, for example? Or just have someone from dev rel create a video? Whom to ask about this?
    Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    2 weeks ago
    No closed or ‘VIP’ kind of things with me. Most of this is as open as this slack channel. Sure, you need to know where to look, but everybody can join. I usually announce the meetup here in this channel and on my twitter. Will announce the next one in a few minutes… 👍
    Regarding dev-relations: cc @Pamela Hill
    Oliver.O

    Oliver.O

    2 weeks ago
    Hey, that's I've been asking for! I had asked before for an invitation or some announcement but never got an answer. Your twitter follower count has just increased. All good now. Thank you!
    Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    2 weeks ago
    but never got an answer.
    Oh I am sorry to hear that, where did you ask?
    Oliver.O

    Oliver.O

    2 weeks ago
    Right here and even tagged you directly (which I'm trying to avoid usually): https://kotlinlang.slack.com/archives/C3PQML5NU/p1659714572688459?thread_ts=1659657142.265759&cid=C3PQML5NU
    Sebastian Sellmair [JB]

    Sebastian Sellmair [JB]

    2 weeks ago
    Sorry about that! That slipped through, somehow 😢 You’re pretty welcome to join next Monday! The setup is quite simple: Usually, I talk about some random topics (as mentioned in the recent announcement as well) and then we all together just randomly ask questions and talk about things 👍 Should be relaxed
    Oliver.O

    Oliver.O

    2 weeks ago
    Can happen, all good, problem solved. I'll be there! Thank you for offering that one to the community. Really much appreciated and nothing I'd take for granted. ❤️
    p

    Pamela Hill

    2 weeks ago
    Hi @Oliver.O! I've just started in August so must have missed something in the rigours of starting. How can I help?
    Oliver.O

    Oliver.O

    2 weeks ago
    Hi @Pamela Hill, and welcome! As it finally turned out (see above), you have not really missed anything. Sebastian Sellmair is offering a valuable service to the community, namely an open meetup for multiplatform with implementor-level insights. Due to a misunderstanding, that meetup looked like a private event, which it is not. So everything is fine and there is nothing for dev rel to improve at this stage. Once we discover topics, which might be interesting for dev rel to cover, I'm pretty sure people, including me, will keep you updated. Thanks for being responsive and have a good start! 🚀
    p

    Pamela Hill

    2 weeks ago
    I'll also try to be at the meetup to say hello 👋