ursus
05/29/2021, 12:37 AMimplementation
dependency is used in a given module? (for all modules; other than obviously trying each one and running build)ephemient
05/29/2021, 6:00 AMursus
05/29/2021, 1:19 PMursus
05/29/2021, 6:46 PMapi
instead of implementaion
and I kind of disagree
What's your policy on that? api
if the given dependency is part of public api?ephemient
05/29/2021, 6:48 PMephemient
05/29/2021, 6:49 PMephemient
05/29/2021, 6:50 PMinternal
visibility - it just looks public
to Javaursus
05/29/2021, 6:55 PMmodule A
interface A
module B
interface B : A
module C want to depends on interface B, should it `implementaion both a, b` or should b `api a`?
ursus
05/29/2021, 7:01 PMapi A
in them? i.e. muple dependencies expose the same transitive oneephemient
05/29/2021, 7:20 PMursus
05/29/2021, 7:23 PMinterface Stateful<S> {
val state: rxjava.Observable<S>
}
should this module api rxjava
? to me its obvious that it should, but the plugin suggests I remove rxjava ..ephemient
05/29/2021, 7:27 PM:reason
task say?ursus
05/29/2021, 7:30 PMursus
05/29/2021, 8:03 PMursus
05/29/2021, 8:04 PMdata class SomethingElse(
...
)
@JsonClass(generateAdapter = true)
data class MccSubscriber(
val id: SubscriberId
)
complains I can remove epdendency which provides the SubscriberId type
ephemient
05/29/2021, 8:28 PMursus
05/29/2021, 9:28 PMcontract
module which only contains interfaces and impl
module which contains implmentations of those interfaces. Everybody dpeends on contract, nobody but the final :app
on the impl .. should the impl api contract
? so ˛:app
has only :impl module includes basically?
if so, should :impl module also api
basically everything?ephemient
05/29/2021, 9:52 PMapi
the contracts it implements, as those are exposed types. if it depends on other things that it does not expose, then those can be implementation
. maybe you want it as api
as a convenience for :app
to use, that would be allowed, it just makes incremental compilation less effectiveursus
05/29/2021, 10:15 PMephemient
05/29/2021, 11:02 PMursus
05/29/2021, 11:18 PMephemient
05/29/2021, 11:45 PMursus
05/30/2021, 12:08 AMephemient
05/30/2021, 12:12 AMephemient
05/30/2021, 12:13 AMursus
05/30/2021, 1:16 AM:base-user
interface BaseUser
:app1-user
interface App1User : BaseUser
api project(":base-user")
:some-call-site-needing-app1user
implementation project(":app1-user")
-- vs --
:base-user
interface BaseUser
:app1-user
interface App1User : BaseUser
implementation project(":base-user")
:some-call-site-needing-app1user
implementation project(":app1-user")
implementation project(":base-user")
ursus
05/30/2021, 1:17 AMBaseUser
then both :app1-user
and :some-call-site-needing-app1user
need to be recompiled in either case, no?
and if so, only difference is in the convenience of the :some-call-site-needing-app1user
only needing 1 include line, no?ephemient
05/30/2021, 1:47 AMephemient
05/30/2021, 1:49 AM:lib1
class Foo
:lib2
class Bar {
fun bar() = Foo().toString()
}
:app
fun main() {
Bar.bar()
}
then api
versus implementation
changes how much incremental compile needs to happen as a result of editing lib1
ursus
05/30/2021, 3:59 AMapi
here, dependencies are always private, not part of public apiursus
05/30/2021, 2:44 PMephemient
05/30/2021, 6:07 PMephemient
05/30/2021, 6:09 PMursus
05/30/2021, 8:13 PMephemient
05/30/2021, 9:53 PMconst val
are inlined into all use sites as per JVM spec which makes analysis much harder. see https://blog.gradle.org/incremental-compiler-avoidance#:~:text=constant)
if a non-api dependency of lib changes, and lib's public api does not change as a result, app does not get rebuiltursus
05/31/2021, 12:56 AMephemient
05/31/2021, 2:10 AMursus
05/31/2021, 3:55 AMursus
05/31/2021, 3:59 AMephemient
05/31/2021, 4:01 AMephemient
05/31/2021, 4:02 AMursus
05/31/2021, 4:03 AMursus
05/31/2021, 4:04 AMif there was no incremental compilation; all dependant modules would get recompiled fullyis this correct then?
ursus
05/31/2021, 4:09 AMephemient
05/31/2021, 4:31 AMephemient
05/31/2021, 4:33 AMephemient
05/31/2021, 4:34 AMephemient
05/31/2021, 4:36 AMephemient
05/31/2021, 4:37 AMif there was no incremental compilation; all dependant modules would get recompiled fullynot with ABI-aware compile avoidance, but seemingly true for Kotlin
ursus
05/31/2021, 10:18 PM