Created
          January 30, 2019 22:19 
        
      - 
      
 - 
        
Save farrukhnajmi/da3e9aced6b105c37ca0fe990543c4b4 to your computer and use it in GitHub Desktop.  
    Gradle afterTask hook to print inputs and outputs of all tasks
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | gradle.taskGraph.afterTask { task -> | |
| StringBuffer taskInfo = new StringBuffer() | |
| taskInfo << "name:$task.name group:$task.group : $task.description conv:$task.convention.plugins\n" | |
| taskInfo << " Inputs\n" | |
| if ((task.inputs != null) && (task.inputs.files != null) && (!task.inputs.files.empty)) { | |
| task.inputs.files.each { it -> | |
| taskInfo << " ${it.absolutePath}\n" | |
| } | |
| } else { | |
| taskInfo << " None\n" | |
| } | |
| taskInfo << " outputs:\n" | |
| if ((task.outputs != null) && (task.outputs.files != null) && (!task.outputs.files.empty)) { | |
| task.outputs.files.each { it -> | |
| taskInfo << " ${it.absolutePath}\n" | |
| } | |
| } else { | |
| taskInfo << " None\n" | |
| } | |
| println taskInfo | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment