Interface ScriptContext

  • All Implemented Interfaces:

    
    public interface ScriptContext
    
                        

    Collects the DSL elements for defining scripts.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Unit appendScript(Function0<String> script) Appends the result of the provided function to the existing script.
      Unit from(File file) Generates a script from the provided file.
      Unit from(URL url) Generates a script from the provided url.
      Unit from(String url) Generates a script from the provided url.
      abstract Unit from(String shebang, Function0<String> script) Generates a script with either the provided shebang or with a shebang invoking bash, and with the result of the provided function.
      Unit tasks(String name, String otherNames, Boolean requireSuccess) Adds the provided tasks to the script, by invoking ./gradlew <taskname>.
      Unit tasks(Task task, Task otherTasks, Boolean requireSuccess) Adds the provided tasks to the script, by invoking ./gradlew <taskname>.
      Unit tasks(TaskProvider<?> task, TaskProvider<?> otherTasks, Boolean requireSuccess) Adds the provided tasks to the script, by invoking ./gradlew <taskname>.
      abstract Unit tasks(Object first, Object others, Boolean requireSuccess) Adds the provided tasks to the script, by invoking ./gradlew <taskname>.
      abstract String getName() Hook name.
      abstract String getScript() Script content.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • appendScript

         abstract Unit appendScript(Function0<String> script)

        Appends the result of the provided function to the existing script.

      • from

         abstract Unit from(String shebang, Function0<String> script)

        Generates a script with either the provided shebang or with a shebang invoking bash, and with the result of the provided function.

      • tasks

         Unit tasks(String name, String otherNames, Boolean requireSuccess)

        Adds the provided tasks to the script, by invoking ./gradlew <taskname>. By default, a failure of the task implies a failure of the commit. To run a task without considering the failure critical, pass [requireSuccess] = false.

      • tasks

         Unit tasks(Task task, Task otherTasks, Boolean requireSuccess)

        Adds the provided tasks to the script, by invoking ./gradlew <taskname>. By default, a failure of the task implies a failure of the commit. To run a task without considering the failure critical, pass [requireSuccess] = false.

      • tasks

         Unit tasks(TaskProvider<?> task, TaskProvider<?> otherTasks, Boolean requireSuccess)

        Adds the provided tasks to the script, by invoking ./gradlew <taskname>. By default, a failure of the task implies a failure of the commit. To run a task without considering the failure critical, pass [requireSuccess] = false.

      • tasks

         abstract Unit tasks(Object first, Object others, Boolean requireSuccess)

        Adds the provided tasks to the script, by invoking ./gradlew <taskname>. By default, a failure of the task implies a failure of the commit. To run a task without considering the failure critical, pass [requireSuccess] = false.

      • getScript

         abstract String getScript()

        Script content. To be fetched only when the configuration is complete.