Class CopyFromAction<T extends org.gradle.api.Task>

java.lang.Object
dev.nokee.companion.util.CopyFromAction<T>
Type Parameters:
T - must be AbstractNativeCompileTask, AbstractLinkTask or CppCompile
All Implemented Interfaces:
org.gradle.api.Action<T>

public class CopyFromAction<T extends org.gradle.api.Task> extends Object implements org.gradle.api.Action<T>
Utility action that copies the configuration from a task to another.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends org.gradle.api.Task>
    org.gradle.api.Action<T>
    copyFrom(org.gradle.api.provider.Provider<? extends T> otherTask)
    Copies the configuration of the specified task to the current task.
    void
    execute(T task)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • execute

      public void execute(T task)
      Specified by:
      execute in interface org.gradle.api.Action<T extends org.gradle.api.Task>
    • copyFrom

      public static <T extends org.gradle.api.Task> org.gradle.api.Action<T> copyFrom(org.gradle.api.provider.Provider<? extends T> otherTask)
      Copies the configuration of the specified task to the current task.

      We only copy the configuration that are safe to duplicate.

      Type Parameters:
      T - must be AbstractNativeCompileTask, AbstractLinkTask or CppCompile
      Parameters:
      otherTask - the task to copy the configuration from
      Returns:
      a configuration action that will perform the copy