Class RunTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.jooby.gradle.BaseTask
io.jooby.gradle.RunTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

public class RunTask extends BaseTask
Gradle plugin for Jooby run.
Since:
2.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Run task.
    static final String
    Run task on test classpath.

    Fields inherited from class io.jooby.gradle.BaseTask

    APP_CLASS_NAME

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a jooby run task.
  • Method Summary

    Modifier and Type
    Method
    Description
    List of file extensions that trigger a compilation request.
    Main class to run.
    Deprecated.
    Application port.
    List of file extensions that trigger an application restart.
    How long to wait after last file change to restart.
    Run app using a single classloader.
    void
    run()
    Run task.
    void
    setCompileExtensions(List<String> compileExtensions)
    Set compile extensions.
    void
    setMainClass(String mainClass)
    Set main class name.
    void
    setMainClassName(String mainClassName)
    Deprecated.
    void
    Set application port.
    void
    setRestartExtensions(List<String> restartExtensions)
    Set restart extensions.
    void
    setUseSingleClassLoader(Boolean useSingleClassLoader)
    Run app using a single classloader.
    void
    setWaitTimeBeforeRestart(Long waitTimeBeforeRestart)
    Set How long to wait after last file change to restart.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Field Details

  • Constructor Details

    • RunTask

      public RunTask()
      Creates a jooby run task.
  • Method Details

    • run

      public void run() throws Throwable
      Run task.
      Throws:
      Throwable - If something goes wrong.
    • getMainClassName

      @Deprecated @ReplacedBy("mainClass") public String getMainClassName()
      Deprecated.
      Main class to run.
      Returns:
      Main class (one with main method).
    • getMainClass

      @Input @Optional public String getMainClass()
      Main class to run.
      Returns:
      Main class (one with main method).
    • setMainClassName

      @Deprecated public void setMainClassName(String mainClassName)
      Deprecated.
      Set main class name.
      Parameters:
      mainClassName - Main class name.
    • setMainClass

      public void setMainClass(String mainClass)
      Set main class name.
      Parameters:
      mainClass - Main class name.
    • getRestartExtensions

      @Input @Optional public List<String> getRestartExtensions()
      List of file extensions that trigger an application restart. Default is: conf, properties and class.
      Returns:
      Restart extensions.
    • setRestartExtensions

      public void setRestartExtensions(List<String> restartExtensions)
      Set restart extensions. Extension is expected to be specify without . (dot).
      Parameters:
      restartExtensions - Restart extensions.
    • isUseSingleClassLoader

      @Input @Optional public Boolean isUseSingleClassLoader()
      Run app using a single classloader. Default is: false.
      Returns:
      Run app using a single classloader. Default is: false.
    • setUseSingleClassLoader

      public void setUseSingleClassLoader(Boolean useSingleClassLoader)
      Run app using a single classloader. Default is: false.
      Parameters:
      useSingleClassLoader - Run app using a single classloader. Default is: false.
    • getCompileExtensions

      @Input @Optional public List<String> getCompileExtensions()
      List of file extensions that trigger a compilation request. Compilation is done via Maven or Gradle. Default is: java and kt.
      Returns:
      Compile extensions.
    • setCompileExtensions

      public void setCompileExtensions(List<String> compileExtensions)
      Set compile extensions. Extension is expected to be specify without . (dot).
      Parameters:
      compileExtensions - Compile extensions.
    • getPort

      @Input @Optional public Integer getPort()
      Application port.
      Returns:
      Application port.
    • setPort

      public void setPort(Integer port)
      Set application port.
      Parameters:
      port - Application port.
    • getWaitTimeBeforeRestart

      @Input @Optional public Long getWaitTimeBeforeRestart()
      How long to wait after last file change to restart. Default is: 500 milliseconds.
      Returns:
      How long to wait after last file change.
    • setWaitTimeBeforeRestart

      public void setWaitTimeBeforeRestart(Long waitTimeBeforeRestart)
      Set How long to wait after last file change to restart. Default is: 500 milliseconds.
      Parameters:
      waitTimeBeforeRestart - How long to wait after last file change to restart.