private static void collectAssetDirs(@NotNull AndroidFacet facet, @NotNull List<String> result)
      throws IOException {
    final File assetsDir = facet.getAssetsDir();

    if (assetsDir != null) {
      result.add(assetsDir.getPath());
    }

    for (AndroidFacet depFacet :
        AndroidJpsUtil.getAllAndroidDependencies(facet.getModule(), true)) {
      final File depAssetsDir = depFacet.getAssetsDir();

      if (depAssetsDir != null) {
        result.add(depAssetsDir.getPath());
      }
    }
  }
  @NotNull
  private static String[] collectNativeLibsFolders(@NotNull AndroidFacet facet) throws IOException {
    final List<String> result = new ArrayList<String>();
    final File libsDir = facet.getNativeLibsDir();

    if (libsDir != null) {
      result.add(libsDir.getPath());
    }

    for (AndroidFacet depFacet :
        AndroidJpsUtil.getAllAndroidDependencies(facet.getModule(), true)) {
      final File depLibsDir = depFacet.getNativeLibsDir();
      if (depLibsDir != null) {
        result.add(depLibsDir.getPath());
      }
    }
    return ArrayUtil.toStringArray(result);
  }
  private static boolean checkUpToDate(
      @NotNull Module module,
      @NotNull Map<Module, AndroidFileSetState> module2state,
      @NotNull AndroidFileSetStorage storage)
      throws IOException {
    final AndroidFileSetState moduleState = module2state.get(module);
    final AndroidFileSetState savedState = storage.getState(module.getName());
    if (savedState == null || !savedState.equalsTo(moduleState)) {
      return false;
    }

    for (AndroidFacet libFacet : AndroidJpsUtil.getAllAndroidDependencies(module, true)) {
      final Module libModule = libFacet.getModule();
      final AndroidFileSetState currentLibState = module2state.get(libModule);
      final AndroidFileSetState savedLibState = storage.getState(libModule.getName());

      if (savedLibState == null || !savedLibState.equalsTo(currentLibState)) {
        return false;
      }
    }
    return true;
  }