Skip to content

Commit 2455dd0

Browse files
authored
[CQ] remove reflective support for olde 4.1 API (#8353)
Remove stale reflective logic introduced in 24812e6 See: #8352 --- - [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR. <details> <summary>Contribution guidelines:</summary><br> - See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](#8098)). </details>
1 parent af791f2 commit 2455dd0

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/io/flutter/utils/GradleUtils.java

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -213,29 +213,7 @@ private static GradleSettingsFile parseSettings(Project project) {
213213

214214
@SuppressWarnings("rawtypes")
215215
private static BuildModelContext makeBuildModelContext(Project project) {
216-
// return BuildModelContext.create(project);
217-
Method method = ReflectionUtil.getDeclaredMethod(BuildModelContext.class, "create", Project.class);
218-
if (method != null) {
219-
try {
220-
return (BuildModelContext)method.invoke(null, project);
221-
}
222-
catch (IllegalAccessException | InvocationTargetException e) {
223-
throw new RuntimeException(e);
224-
}
225-
}
226-
// If we get here we're using the 4.1 API.
227-
// return BuildModelContext.create(project, new AndroidLocationProvider());
228-
Class locationProviderClass = AndroidLocationProvider.class.getInterfaces()[0];
229-
// Class.forName("com.android.tools.idea.gradle.dsl.model.BuildModelContext.ResolvedConfigurationFileLocationProvider");
230-
// does not work in the debugger. That's why we get it from the interfaces of AndroidLocationProvider.
231-
method = ReflectionUtil.getDeclaredMethod(BuildModelContext.class, "create", Project.class, locationProviderClass);
232-
assert method != null;
233-
try {
234-
return (BuildModelContext)method.invoke(null, project, new AndroidLocationProvider());
235-
}
236-
catch (IllegalAccessException | InvocationTargetException e) {
237-
throw new RuntimeException(e);
238-
}
216+
return BuildModelContext.create(project, new AndroidLocationProvider());
239217
}
240218

241219
// The project is an Android project that contains a Flutter module.

0 commit comments

Comments
 (0)