Created
          November 30, 2011 14:48 
        
      - 
      
 - 
        
Save hansd/1409317 to your computer and use it in GitHub Desktop.  
    Autowiring with 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
    
  
  
    
  | task analyzeTestJar(type: AnalyzeJar) { | |
| jar = testJar | |
| } | |
| task copy(type:Copy) { | |
| from testJar | |
| into 'build/myJars' | |
| } | |
| class AnalyzeJar extends DefaultTask { | |
| Task jar | |
| AnalyzeJar() { | |
| inputs.files { jar.outputs.files } | |
| } | |
| @TaskAction | |
| def analyze() { | |
| println "Size: ${jar.archivePath.size()}" | |
| project.exec { | |
| commandLine "unzip", "-t", jar.archivePath | |
| } | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment