@@ -70,7 +70,7 @@ class SampleProjectTest {
70
70
GradleRunner .create().apply {
71
71
forwardOutput()
72
72
withProjectDir(targetProject)
73
- withGradleVersion(" 7.4.2 " )
73
+ withGradleVersion(" 8.1.1 " )
74
74
withArguments(" clean" , " assembleDebug" , " --stacktrace" )
75
75
// Ensure this value is true when `--debug-jvm` is passed to Gradle, and false otherwise
76
76
withDebug(
@@ -107,7 +107,6 @@ class SampleProjectTest {
107
107
}
108
108
109
109
110
-
111
110
@ParameterizedTest
112
111
@MethodSource(" agpVerProvider" )
113
112
fun buildToolInfoTest_getAAPT2Successfully (agpVer : String ) {
@@ -136,43 +135,84 @@ class SampleProjectTest {
136
135
fun manifestMergePreHookConfigureActionTest_GetSuccessfully (agpVer : String ) {
137
136
val fileFromGetMethod =
138
137
File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /all-manifests-by-getAllInputManifestsForDebug.json" )
139
- assertThat(" all-manifests-by-getAllInputManifestsForDebug.json does not exist" , fileFromGetMethod.exists())
140
- val getTaskDeps =
141
- File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /get-all-input-manifests-for-debug-task-deps.txt" )
142
- assertThat(getTaskDeps.readText(), Matchers .equalTo(" processDebugManifest" ))
138
+ assertThat(
139
+ " all-manifests-by-getAllInputManifestsForDebug.json does not exist" ,
140
+ fileFromGetMethod.exists()
141
+ )
142
+ // val getTaskDeps =
143
+ // File("./build/test-app-for-$agpVer/${testProjectJsonOutputPath}/get-all-input-manifests-for-debug-task-deps.txt")
144
+ // assertThat(getTaskDeps.readText(), Matchers.equalTo("processDebugManifest"))
143
145
}
144
146
145
147
@ParameterizedTest
146
148
@MethodSource(" agpVerProvider" )
147
149
fun generateAllResourcesBeforeMergeTest_FetchSuccessfully (agpVer : String ) {
148
- val out = File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /all-resources.json" )
150
+ val out =
151
+ File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /all-resources.json" )
149
152
assertThat(" all-resources.json does not exist" , out .exists())
150
153
assertThat(out .readText(), StringContains (" appcompat" ))
151
154
}
152
155
153
156
@ParameterizedTest
154
157
@MethodSource(" agpVerProvider" )
155
158
fun getResourceMergeDirTest_FetchSuccessfully (agpVer : String ) {
156
- val out = File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /merged-resource-dir.txt" )
159
+ val out =
160
+ File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /merged-resource-dir.txt" )
157
161
assertThat(" merged-resource-dir.txt does not exist" , out .exists())
158
162
assertThat(out .readText(), StringContains (" app/build/intermediates/merged_res/debug" ))
159
163
}
160
164
161
165
@ParameterizedTest
162
166
@MethodSource(" agpVerProvider" )
163
167
fun javaResourceMergePreHookConfigureAction_TransformSuccessfully (agpVer : String ) {
164
- val out =
165
- File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /all-java-res-by-preUpdateJavaResTaskAction.json" )
168
+ val out = File (
169
+ " ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /" +
170
+ " all-java-res-by-preUpdateJavaResTaskAction.json"
171
+ )
166
172
assertThat(" all-java-res-by-preUpdateJavaResTaskAction.json does not exist" , out .exists())
167
- assertThat(out .readText(), StringContains (" android-lib/build/intermediates/library_java_res/debug/res.jar" ))
173
+ // The legacy ALL_JAVA_RES artifact
174
+ if (agpVer == " 8.0.1" ) {
175
+ assertThat(
176
+ out .readText(),
177
+ StringContains (" android-lib/build/intermediates/library_java_res/debug/res.jar" )
178
+ )
179
+ }
168
180
}
169
181
170
182
@ParameterizedTest
171
183
@MethodSource(" agpVerProvider" )
172
184
fun javaResourceMergePreHookConfigureAction_GetSuccessfully (agpVer : String ) {
173
- val out =
174
- File (" ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /all-java-res-by-getAllInputJavaResForDebug.json" )
185
+ val out = File (
186
+ " ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /" +
187
+ " all-java-res-by-getAllInputJavaResForDebug.json"
188
+ )
175
189
assertThat(" all-java-res-by-getAllInputJavaResForDebug.json does not exist" , out .exists())
190
+
191
+ // The new JAVA_RES_FOR_SUB_PROJECTS
192
+ val outForSubProjects = File (
193
+ " ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /" +
194
+ " all-java-res-of-sub-projects-by-getAllInputJavaResForDebug.json"
195
+ )
196
+ assertThat(
197
+ " all-java-res-of-sub-projects-by-getAllInputJavaResForDebug.json does not exist" ,
198
+ outForSubProjects.exists()
199
+ )
200
+ if (agpVer != " 8.0.1" ) {
201
+ assertThat(
202
+ outForSubProjects.readText(),
203
+ StringContains (" android-lib/build/intermediates/java_res/debug/out" )
204
+ )
205
+ }
206
+
207
+ // The new JAVA_RES_FOR_EXT_PROJECTS
208
+ val outForExtProjects = File (
209
+ " ./build/test-app-for-$agpVer /${testProjectJsonOutputPath} /" +
210
+ " all-java-res-of-ext-projects-by-getAllInputJavaResForDebug.json"
211
+ )
212
+ assertThat(
213
+ " all-java-res-of-ext-projects-by-getAllInputJavaResForDebug.json does not exist" ,
214
+ outForSubProjects.exists()
215
+ )
176
216
}
177
217
178
218
}
0 commit comments