Revision a4e7fcf8ab9633fa2001cf799c8bb93243e87533 authored by James Rodewig on 25 May 2021, 16:23:42 UTC, committed by James Rodewig on 25 May 2021, 16:23:42 UTC
1 parent b1ad71b
Raw File
build.gradle
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */

subprojects {
  /*
   * All subprojects are java projects using Elasticsearch's standard build
   * tools.
   */
  apply plugin: 'elasticsearch.build'

  /*
   * Subprojects may depend on the "core" lib but may not depend on any
   * other libs. This keeps our dependencies simpler.
   */
  project.afterEvaluate {
    configurations.all { Configuration conf ->
      dependencies.matching { it instanceof ProjectDependency }.all { ProjectDependency dep ->
        Project depProject = dep.dependencyProject
        if (depProject != null
          && false == depProject.path.equals(':libs:elasticsearch-core')
          && depProject.path.startsWith(':libs')) {
          throw new InvalidUserDataException("projects in :libs "
            + "may not depend on other projects libs except "
            + ":libs:elasticsearch-core but "
            + "${project.path} depends on ${depProject.path}")
        }
      }
    }
  }
}
back to top