Advertisement
Guest User

Dynamic Metadata For Gradle Dependencies

a guest
Apr 17th, 2010
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.62 KB | None | 0 0
  1. apply plugin: 'java'
  2.  
  3. configurations.allObjects { configuration ->
  4.     configuration.allDependencies { dependency ->
  5.         dependency.eclipse = new EclipseProps()
  6.     }
  7. }
  8.  
  9. dependencies {
  10.     compile("junit:junit:4.4") {
  11.         eclipse.export = false
  12.     }
  13.     compile("foo:bar:1.0") {
  14.         eclipse.exclude = true
  15.     }
  16.     compile("org.spockframework:spock:0.4")
  17. }
  18.  
  19. task showExported << {
  20.     configurations.compile.dependencies.each{ dep ->
  21.         if (dep.eclipse.export) {
  22.             println dep.name
  23.         }
  24.     }
  25. }
  26.  
  27. class EclipseProps {
  28.     boolean export = true
  29.     boolean exclude = false
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement