Class AppHelper

java.lang.Object
nl.colorize.gradle.application.AppHelper

public class AppHelper extends Object
Utility class with shared logic between the different tasks and sub-plugins.
  • Method Details

    • requireWindows

      public static void requireWindows()
    • requireMac

      public static void requireMac()
    • getLibsDir

      public static File getLibsDir(org.gradle.api.Project project)
    • check

      public static void check(boolean condition, String message)
    • getEnvironmentVariable

      public static String getEnvironmentVariable(String name)
    • getProjectDir

      public static File getProjectDir(org.gradle.api.Project project, String name)
    • getProjectFile

      public static File getProjectFile(org.gradle.api.Project project, String name)
    • getOutputDir

      public static File getOutputDir(org.gradle.api.Project project, String name)
    • cleanDirectory

      public static void cleanDirectory(File dir)
      Makes sure the application bundle directory is empty before we start. This is necessary because Gradle uses very aggressive caching, and JLink will not work unless the directory is empty.
    • walk

      public static List<File> walk(File start, Predicate<File> filter)
    • mkdir

      public static File mkdir(File dir)
    • loadResourceFile

      public static String loadResourceFile(String path)
    • rewriteTemplate

      public static String rewriteTemplate(String templatePath, Map<String,String> placeholders)
      Loads a template from the specified classpath resource, then rewrites the placeholders in the template using the actual values. The placeholders should use the format "{{name}}".