Do I understand it right? File dependencies are u...
# ksp
m
Do I understand it right? File dependencies are used to: 1. Determine that a file not associated to any existing file should be removed. 2. Determine what files should be considered dirty. If any input of an output becomes dirty, all the other dependencies of this output becomes dirty as well. • So if output file
OA.kt
depends on
A.kt
and `B.kt`: ◦ If we change
A.kt
, then both
A.kt
and
B.kt
become dirty. ◦ If we change
B.kt
, then both
B.kt
and
A.kt
become dirty. • If
0A.kt
depends on
A.kt
and
B.kt
,
0B.kt
depends on
B.kt
and
C.kt
,
OD.kt
depends on
D.kt
and
E.kt
. ◦ Change in
A.kt
will make
A.kt
,
B.kt
and
C.kt
dirty. ◦ Change in
B.kt
will make
A.kt
,
B.kt
and
C.kt
dirty. ◦ Change in
C.kt
will make
A.kt
,
B.kt
and
C.kt
dirty. ◦ Change in
D.kt
will make
D.kt
and
E.kt
dirty. ◦ Change in
E.kt
will make
D.kt
and
E.kt
dirty. Dependency of aggregating files become dirty when any file changes. I based on the description here, and my own experiments, but it wasn't easy to figure it out. If this is correct, I would love to see something like that in docs.
o
I did not review your variants due to time constraints, but maybe this thread helps to clarify and/or provide additional insights: https://kotlinlang.slack.com/archives/C013BA8EQSE/p1650650502293889
g
• So if output file
OA.kt
depends on
A.kt
and `B.kt`:
◦ If we change
A.kt
, then both
A.kt
and
B.kt
become dirty.
Noob here, but I don't understand why B.kt would be dirty here. If A.kt has been changed and B.kt does not reference A.kt, then I presume only A.kt is dirty, and indeed will trigger the re-compute of 0A.kt
m
I would also love to see some good rationale, but I already confirmed this behavior in my experiments.
t
Yes, this is correct. In the example of
OA
,
A
and
B
, if
A
is changed, a processor will need both
A
and
B
to generate (an updated)
OA
. Therefore
B
is needed by the processor and considered dirty.