GarouDan
02/03/2019, 3:54 PMegorand
02/03/2019, 7:33 PMGarouDan
02/03/2019, 7:46 PMegorand
02/03/2019, 9:21 PMdependsOn
inside the dependencies block of the target you’re configuringdependencies {
dependsOn jvmMain
}
GarouDan
02/03/2019, 10:03 PMjvmAndroid
and jvmApi
source sets have a dependsOn
relation with the jvm
source set.
But the problem is somehow a little different, because the android and api projects aren’t inside the “common” module, but outside, on different folders. If they were in the same module I agree that we could to something like that.
For example, here in the kotlinconfapp, in the android project we have `implementation project(':common')`:
https://github.com/JetBrains/kotlinconf-app/blob/88ec4e4bf3ee2c8eac7da9416e1b565a85fa2727/android/app/build.gradle#L48
And in the same project, in the api project, we also have the same line, `implementation project(':common')`:
https://github.com/JetBrains/kotlinconf-app/blob/88ec4e4bf3ee2c8eac7da9416e1b565a85fa2727/backend/build.gradle#L12
This strategy works if we have just one api and one android project, where both share just one common jvm implementation.
https://github.com/JetBrains/kotlinconf-app/blob/88ec4e4bf3ee2c8eac7da9416e1b565a85fa2727/common/build.gradle#L6
What I’m looking is something more flexible, so we could have a common code to not only jvm based projects, but 3 common codes. One for all jvm projects, one for android projects and one for api projects, for example. (Actually, I would like to extend this strategy to several other projects, but this is just a small case).
In the way that the kotlinconf app is configured, it is exporting just one preset that is compatible with the jvm and we add this as a dependency using implementation project(':common')
. So because of that I was asking if we could do something like implementation project(':common:jvmAndroid')
or achieve a similar result.egorand
02/03/2019, 10:07 PMGarouDan
02/03/2019, 10:09 PMdany
02/04/2019, 8:38 AMGarouDan
02/04/2019, 10:51 AM