daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Dec 9th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // disalbe all test task for sub project
  2. project.afterEvaluate {
  3. // first way
  4. //        def targetTasks = project.tasks.findAll { task ->
  5. //            println project.name + " task showing---" + task.name
  6. //            task.name.contains("test") || task.name.contains("Test")
  7. //        }
  8. //
  9. //        targetTasks.each {
  10. //            println "disable test task  :${it.name}"
  11. //            it.setEnabled false
  12. //        }
  13.  
  14. // second way
  15.     project.tasks.all { task ->
  16.         println project.name + " task showing---" + task.name
  17.         def ignoreTask = task.name.contains("test") || task.name.contains("Test")
  18.         if (ignoreTask) {
  19.             println "disable test task  :${task.name}"
  20.             task.setEnabled false
  21.         }
  22.     }
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top