Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.79 KB | None | 0 0
  1. void apply(Project project) {
  2.  
  3.         project.pluginManager.apply(NspJavaService)
  4.  
  5.         project.task('test_dependencies') {
  6.             doLast {
  7.                 project.configurations.runtime.getAllDependencies().withType(ProjectDependency)
  8.                         .each {  processProjectDependency(it, project.getName()) }
  9.             }
  10.         }
  11.         project.tasks.build.dependsOn('test_dependencies')
  12.     }
  13.  
  14.     private processProjectDependency(ProjectDependency projectDependency, String projectName) {
  15.         def dependencyPath = projectDependency.getDependencyProject().getPath()
  16.         if(dependencyPath.contains("application-services")) {
  17.             throw new GradleException(projectName + " has illegal dependency on an application service " + dependencyPath)
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement