You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update explanatory diagram and project vs directory identifiers
We use p for Gradle projects and d for File directories on disk. We
could have used any identifier but choosing the same letter is a bit of
a mind bender for newbies that are not familiar.
We also change the diagram to better match how the code sets up the
projects.
Copy file name to clipboardExpand all lines: affectedmoduledetector/src/test/kotlin/com/dropbox/affectedmoduledetector/AffectedModuleDetectorImplTest.kt
+51-48Lines changed: 51 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -62,22 +62,25 @@ class AffectedModuleDetectorImplTest {
62
62
}
63
63
64
64
/*
65
+
d: File directories
66
+
p: Gradle projects
65
67
66
68
Dummy project file tree:
67
-
"library modules" "UI modules"
68
-
root -----------------root2
69
-
/ | \ | | | | / | \
70
-
p1 p7 p2 p8p9 p10 p11p12 p13 p14
69
+
"library modules" "UI modules"
70
+
tmpDir -------------- tmpDir2
71
+
/ | \ | | | / \
72
+
d1 d7 d2 d8d9 d10 d12 d13 (d10)
71
73
/ \
72
-
p3p5
74
+
d3d5
73
75
/ \
74
-
p4p6
76
+
d4d6
75
77
76
78
Dependency forest:
77
-
78
-
p1 p2 p7 p8 p9 p10 p11 p12 p14
79
-
/ \ / \ \
80
-
p3 p5 p6 p13
79
+
root ------------------- root2
80
+
/ \ | | | | / \
81
+
p1 p2 p7 p8 p9 p10 p12 p13
82
+
/ / \
83
+
p3 --- p5 p6
81
84
/
82
85
p4
83
86
@@ -99,61 +102,61 @@ class AffectedModuleDetectorImplTest {
99
102
100
103
// Library modules
101
104
p1 =ProjectBuilder.builder()
102
-
.withProjectDir(tmpDir.resolve("p1"))
105
+
.withProjectDir(tmpDir.resolve("d1"))
103
106
.withName("p1")
104
107
.withParent(root)
105
108
.build()
106
109
p2 =ProjectBuilder.builder()
107
-
.withProjectDir(tmpDir.resolve("p2"))
110
+
.withProjectDir(tmpDir.resolve("d2"))
108
111
.withName("p2")
109
112
.withParent(root)
110
113
.build()
111
114
p3 =ProjectBuilder.builder()
112
-
.withProjectDir(tmpDir.resolve("p1/p3"))
115
+
.withProjectDir(tmpDir.resolve("d1/d3"))
113
116
.withName("p3")
114
117
.withParent(p1)
115
118
.build()
116
119
val p3config = p3.configurations.create("p3config")
117
120
p3config.dependencies.add(p3.dependencies.project(mutableMapOf("path" to ":p1")))
118
121
p4 =ProjectBuilder.builder()
119
-
.withProjectDir(tmpDir.resolve("p1/p3/p4"))
122
+
.withProjectDir(tmpDir.resolve("d1/d3/d4"))
120
123
.withName("p4")
121
124
.withParent(p3)
122
125
.build()
123
126
val p4config = p4.configurations.create("p4config")
124
127
p4config.dependencies.add(p4.dependencies.project(mutableMapOf("path" to ":p1:p3")))
125
128
p5 =ProjectBuilder.builder()
126
-
.withProjectDir(tmpDir.resolve("p2/p5"))
129
+
.withProjectDir(tmpDir.resolve("d2/d5"))
127
130
.withName("p5")
128
131
.withParent(p2)
129
132
.build()
130
133
val p5config = p5.configurations.create("p5config")
131
134
p5config.dependencies.add(p5.dependencies.project(mutableMapOf("path" to ":p2")))
132
135
p5config.dependencies.add(p5.dependencies.project(mutableMapOf("path" to ":p1:p3")))
133
136
p6 =ProjectBuilder.builder()
134
-
.withProjectDir(tmpDir.resolve("p1/p3/p6"))
137
+
.withProjectDir(tmpDir.resolve("d1/d3/d6"))
135
138
.withName("p6")
136
139
.withParent(p3)
137
140
.build()
138
141
val p6config = p6.configurations.create("p6config")
139
142
p6config.dependencies.add(p6.dependencies.project(mutableMapOf("path" to ":p2")))
140
143
p7 =ProjectBuilder.builder()
141
-
.withProjectDir(tmpDir.resolve("p7"))
144
+
.withProjectDir(tmpDir.resolve("d7"))
142
145
.withName("p7")
143
146
.withParent(root)
144
147
.build()
145
148
p8 =ProjectBuilder.builder()
146
-
.withProjectDir(tmpDir.resolve("p8"))
149
+
.withProjectDir(tmpDir.resolve("d8"))
147
150
.withName("cobuilt1")
148
151
.withParent(root)
149
152
.build()
150
153
p9 =ProjectBuilder.builder()
151
-
.withProjectDir(tmpDir.resolve("p9"))
154
+
.withProjectDir(tmpDir.resolve("d9"))
152
155
.withName("cobuilt2")
153
156
.withParent(root)
154
157
.build()
155
158
p10 =ProjectBuilder.builder()
156
-
.withProjectDir(tmpDir.resolve("p10"))
159
+
.withProjectDir(tmpDir.resolve("d10"))
157
160
.withName("benchmark")
158
161
.withParent(root)
159
162
.build()
@@ -166,7 +169,7 @@ class AffectedModuleDetectorImplTest {
166
169
.build()
167
170
// The existence of this project is a test for the benchmark use case. It is picked up by
168
171
p13 =ProjectBuilder.builder() // allProjects in ui, even though it is in the root1 dir
169
-
.withProjectDir(tmpDir.resolve("p10")) // and is symlinked as p10
172
+
.withProjectDir(tmpDir.resolve("d10")) // and is symlinked as p10
170
173
.withName("benchmark")
171
174
.withParent(root2)
172
175
.build()
@@ -248,7 +251,7 @@ class AffectedModuleDetectorImplTest {
0 commit comments