Hey guys, I have 4 modules: 1. `app` plain JVM mo...
# multiplatform
d
Hey guys, I have 4 modules: 1.
app
plain JVM module + Android ( depends on
third
) 2.
second
multiplatform without Android ( depends on
third
) 3.
third
multiplatform + Android module ( depends on
fourth
) 4.
fourth
fourth
is supposed to contain Android-only source code, so how should I set it up? Should it be multiplatform + Android or JVM only + Android? I tried some stuff, but I have
(xxx) Could not resolve project :fourth
Required by:
project (yyy)
*Replace (xxx) with secondsourceSet and thirdsourceSet and (yyy) with :third and :second > :third
Specifically: •
second
is a module with integration tests •
third
is a DI module, where I aggregate Koin modules from various modules •
third
has an
expected val AndroidModule
• on
third:androidMain
I aggregate Koin modules from Android modules (
HomePresentationModule
for example ) •
forth
is an Android presentation module, it contains the Koin module
HomePresentationModule
j
forth can be an android library which third can add in the android source set dependencies
d
I tried something like that but failed. I was thinking that it might be better to have: •
app
>
third:android
second
>
third:kotlin
So split
third
in 2 submodules
j
Which is the fail?
d
The one I mentioned in the first message
j
there is no difference between a kmp with android which only has android code and an android library
have you done
androidMain.dependencies { implementation(...) }
?
d
So I probably did something wrong 😄 But btw having 2 separate lines would be better
j
on third
or you tried in
commonMain
d
Tried that and
Copy code
dependencies {
  implementation()
}
j
that is not going to work
if you want to use the normal
dependencies
block
d
*an was supposed to be and
j
you need to
Copy code
dependencies {
    "androidMain"(...)
}
d
Tried both
j
if you run
./gradlew third:assemble
, does it work?
d
Same error, but doesn’t matter much now 😄
j
is it open source?
d
Pushed a commit now with the change I mentioned
j
which is third and which fourth
d
third is
cinescout/di
, fourth is
cinescout/home/presentation
j
not sure if it is a GitHub outage or you have deleted the content of those files
d
First one should be
home/presentation
, not only
home
, second you’re looking into the last commit
Look into the one before, as now I have
di/android
and
di/kotlin
Empty gradle files are required for my modules plugin, otherwise I cannot guarantee a path for modules
Because
/home/presentation
, for example, would have a different path whether
home
is a module or a plain folder, so I made them all modules 🙂
j
weird setup, intermediate path are already modules too without those gradle files
d
No, they’re just plain folder
j
gradle treats them as modules anyway
d
In my case, home-presentation path is
:cinescout:cinescout-home:cinescout-home-presentation
, without it would be
:cinescout:cinescout-home-presentation
r
Weird setup. Though your issue might be because you don't have an
android()
target inside the build.gradle file for di/kotlin. Specifically inside the
kotlin {}
block
d
I may didn’t update my repo, but I added it before trying ( same as manifest file )