use of com.android.build.gradle.BasePlugin in project atlas by alibaba.
the class AppPluginHook method getAndroidBuilder.
// public void replaceTaskManager() throws Exception {
//
// AppPlugin appPlugin = project.getPlugins().findPlugin(AppPlugin.class);
//
// if (null == appPlugin) {
// return;
// }
//
// TaskManager taskManager =
// (TaskManager)ReflectUtils.getField(BasePlugin.class, appPlugin, "taskManager");
//
// DependencyManager dependencyManager = (DependencyManager)ReflectUtils.getField(TaskManager.class, taskManager,
// "dependencyManager");
//
// AtlasDependencyManager atlasDependencyManager = new AtlasDependencyManager(project,
// (ExtraModelInfo)ReflectUtils
// .getField(dependencyManager,
// "extraModelInfo"),
// (SdkHandler)ReflectUtils
// .getField(dependencyManager,
// "sdkHandler"));
//
// ReflectUtils.updateField(TaskManager.class, taskManager, "dependencyManager", atlasDependencyManager);
//
// }
public AndroidBuilder getAndroidBuilder() throws Exception {
BasePlugin basePlugin = project.getPlugins().findPlugin(AppPlugin.class);
if (null == basePlugin) {
basePlugin = project.getPlugins().findPlugin(LibraryPlugin.class);
}
if (null == basePlugin) {
return null;
}
AndroidBuilder androidBuilder = (AndroidBuilder) ReflectUtils.getField(BasePlugin.class, basePlugin, "androidBuilder");
return androidBuilder;
}
Aggregations