RouterBuildHelper { public static RouterModel getRouterModel(File jsonDir, String projectName, String scheme, String host, boolean html) { File[] files = jsonDir.listFiles(); if (files == null) { return null; } RouterModel routerModel = new RouterModel(); routerModel.scheme = scheme; routerModel.host = host; routerModel.projectName = projectName; for (File file : files) { if (!file.isFile()) { continue; } String name = file.getName(); if (name.startsWith("Router-") && name.endsWith(".json")) { String moduleName = name.replace("Router-", "").replace(".json", ""); String json = FileUtils.readToString(file); if (json != null) { RouterModel tmp = JSON.parseObject(json, RouterModel.class); if (tmp != null) { for (ActivityModel item : tmp.activityModels){ item.module = moduleName; } for (TaskModel item : tmp.taskModels){ item.module = moduleName; } for (ComponentModel item : tmp.componentModels){ item.module = moduleName; } for (RouterDelegateModel item : tmp.delegateModels){ item.module = moduleName; } routerModel.add(tmp); if (html) { parseHTMLInfo(moduleName, tmp); } } } } } Collections.sort(routerModel.activityModels); Collections.sort(routerModel.taskModels); Collections.sort(routerModel.interceptorModels); Collections.sort(routerModel.componentModels); Collections.sort(routerModel.delegateModels); return routerModel; }  static RouterModel getRouterModel(File jsonDir, String projectName, String scheme, String host, boolean html); static void build(File sourceDir, File jsonDir, String projectName, String scheme, String host); static void saveRouterModel(File jsonDir, RouterModel routerModel, String moduleName);  }
@Test public void getRouterModel() { File file = new File("/Users/Wiki/Documents/Workspace/joyrun/joyrun-android-dev/lib.base/src/main/java/com/grouter/data"); RouterModel routerModel = RouterBuildHelper.getRouterModel(file,"","","",false); }