gradle
原来copy不必必然是一个task,不必是下面这种形式: 
task  copy(type:Copy){ 
    from ” 
    into ” 
}
可以直接用: 
copy { 
   into ‘build/webroot’ 
   exclude ‘/.svn/’ 
   from(‘src/main/webapp’) { 
      include ‘*/.jsp’ 
      filter(ReplaceTokens, tokens:[copyright:’2009’, version:’2.3.1’]) 
   } 
   from(‘src/main/js’) { 
      include ‘*/.js’ 
   } 
}
这个用的是Project的copy方法,里面的参数是一个闭包,closure. 
现在才明白,闭包是什么,就是{ 
}。
现在有一个问题: 
copy { 
   into ‘build/webroot’ 
   exclude ‘/.svn/’ 
   from(‘src/main/webapp’) { 
      include ‘*/.jsp’ 
      filter(ReplaceTokens, tokens:[copyright:’2009’, version:’2.3.1’]) 
   } 
   from(‘src/main/js’) { 
      include ‘*/.js’ 
   } 
}
闭包的参数文档在哪找的?
copy的时候怎么文件过滤?
copy { 
   from configurations.runtime 
   into ‘build/deploy/lib’ 
} 
这种的源代码怎么看?
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号