@VisibleForTesting public static boolean createGradleWrapper(@NotNull File projectDirPath,@NotNull String gradleVersion) throws IOException {
  File projectWrapperDirPath=new File(projectDirPath,FD_GRADLE_WRAPPER);
  if (!projectWrapperDirPath.isDirectory()) {
    File wrapperSrcDirPath=new File(TemplateManager.getTemplateRootFolder(),FD_GRADLE_WRAPPER);
    if (!wrapperSrcDirPath.exists()) {
      for (      File root : TemplateManager.getExtraTemplateRootFolders()) {
        wrapperSrcDirPath=new File(root,FD_GRADLE_WRAPPER);
        if (wrapperSrcDirPath.exists()) {
          break;
        }
 else {
          wrapperSrcDirPath=null;
        }
      }
    }
    if (wrapperSrcDirPath == null) {
      return false;
    }
    copyDirContent(wrapperSrcDirPath,projectDirPath);
  }
  File wrapperPropertiesFile=getGradleWrapperPropertiesFilePath(projectDirPath);
  updateGradleDistributionUrl(gradleVersion,wrapperPropertiesFile);
  return true;
}

@ VisibleForTesting public static boolean createGradleWrapper ( @ NotNull File projectDirPath , @ NotNull String gradleVersion ) throws IOException { File projectWrapperDirPath = new File ( projectDirPath , FD_GRADLE_WRAPPER ) ; if ( ! projectWrapperDirPath . isDirectory ( ) ) { File wrapperSrcDirPath = new File ( TemplateManager . getTemplateRootFolder ( ) , FD_GRADLE_WRAPPER ) ; if ( ! wrapperSrcDirPath . exists ( ) ) { for ( File root : TemplateManager . getExtraTemplateRootFolders ( ) ) { wrapperSrcDirPath = new File ( root , FD_GRADLE_WRAPPER ) ; if ( wrapperSrcDirPath . exists ( ) ) { break ; } else { wrapperSrcDirPath = null ; } } } if ( wrapperSrcDirPath == null ) { return false ; } copyDirContent ( wrapperSrcDirPath , projectDirPath ) ; } File wrapperPropertiesFile = getGradleWrapperPropertiesFilePath ( projectDirPath ) ; updateGradleDistributionUrl ( gradleVersion , wrapperPropertiesFile ) ; return true ; }
creates the gradle wrapper in the project at the given directory .
