pluginManagement {
    plugins {
        id 'com.gradle.develocity' version '4.2'
        id 'biz.aQute.bnd.builder' version '7.1.0'
        id 'com.github.jk1.dependency-license-report' version '2.9'
        id 'com.github.node-gradle.node' version '7.1.0'
    }
}

plugins {
    id 'com.gradle.develocity'
}

dependencyResolutionManagement {
    repositories {
        mavenCentral()
        maven {
            url = uri( 'https://repo.jenkins-ci.org/releases/' )
            content {
                includeGroup( 'org.jvnet.mock-javamail' )
            }
        }
    }
}

develocity {
    buildScan {
        publishing.onlyIf { false }
        termsOfUseUrl = 'https://gradle.com/terms-of-service'
        termsOfUseAgree = 'yes'
    }
}

include 'core:core-api'
include 'core:core-audit'
include 'core:core-event'
include 'core:core-schema'
include 'core:core-repo'
include 'core:core-security'
include 'core:core-image'
include 'core:core-export'
include 'core:core-mail'
include 'core:core-elasticsearch'
include 'core:core-content'
include 'core:core-site'
include 'core:core-i18n'
include 'core:core-media'
include 'core:core-app'
include 'core:core-service'
include 'core:core-extractor'
include 'core:core-blobstore'
include 'core:core-auth'
include 'core:core-macro'
include 'core:core-task'
include 'core:core-cluster'
include 'core:core-hazelcast'
include 'core:core-internal'
include 'core:core-project'
include 'core:core-scheduler'
include 'core:core-shared'

include 'server:server-config'
include 'server:server-deploy'
include 'server:server-status'
include 'server:server-udc'
include 'server:server-rest'
include 'server:server-trace'
include 'server:server-metrics'

include 'script:script-api'
include 'script:script-impl'

include 'web:web-api'
include 'web:web-impl'
include 'web:web-vhost'
include 'web:web-jetty'
include 'web:web-dos'
include 'web:web-dispatch'
include 'web:web-session'
include 'web:web-header'

include 'jaxrs:jaxrs-api'
include 'jaxrs:jaxrs-impl'

include 'portal:portal-api'
include 'portal:portal-impl'

include 'admin:admin-api'
include 'admin:admin-impl'
include 'admin:admin-event'

include 'itest:itest-core'

include 'tools:testing'

include 'lib:lib-common'
include 'lib:lib-content'
include 'lib:lib-i18n'
include 'lib:lib-portal'
include 'lib:lib-mail'
include 'lib:lib-auth'
include 'lib:lib-io'
include 'lib:lib-context'
include 'lib:lib-websocket'
include 'lib:lib-repo'
include 'lib:lib-node'
include 'lib:lib-task'
include 'lib:lib-value'
include 'lib:lib-event'
include 'lib:lib-admin'
include 'lib:lib-cluster'
include 'lib:lib-auditlog'
include 'lib:lib-project'
include 'lib:lib-vhost'
include 'lib:lib-scheduler'
include 'lib:lib-export'
include 'lib:lib-schema'
include 'lib:lib-app'
include 'lib:lib-grid'

include 'launcher:launcher-api'
include 'launcher:launcher-impl'
include 'launcher:launcher-main'

include 'blobstore:blobstore-file'

include 'app:app-system'

include 'repack:repack-elasticsearch'
include 'repack:repack-tika'

include 'runtime'

rootProject.name = 'xp'

configureProjects( rootProject )

def configureProjects( root )
{
    root.children.each { p ->
        configureProject( p )
        configureProjects( p )
    }
}

def configureProject( p )
{
    String dirName = p.path.substring( 1 ).replace( ':', '/' )
    p.projectDir = new File( settingsDir, "modules/${dirName}" )
    assert p.projectDir.isDirectory()
}
