rootProject.name = 'spring-xd'

include 'spring-xd-analytics'
include 'spring-xd-analytics-ml'

include 'spring-xd-rxjava'
include 'spring-xd-reactor'

include 'spring-xd-messagebus-spi'
include 'spring-xd-messagebus-local'
include 'spring-xd-messagebus-kafka'
include 'spring-xd-messagebus-redis'
include 'spring-xd-messagebus-rabbit'

include 'spring-xd-dirt'
include 'spring-xd-batch'
include 'spring-xd-gemfire-server'
include 'redis'
include 'spring-xd-module'
include 'spring-xd-module-spi'
include 'spring-xd-tuple'
include 'spring-xd-hadoop'
include 'spring-xd-hadoop:hadoop27'
include 'spring-xd-hadoop:cdh5'
include 'spring-xd-hadoop:hdp22'
include 'spring-xd-hadoop:phd21'
include 'spring-xd-hadoop:phd30'
include 'spring-xd-yarn:spring-xd-yarn-client'
include 'spring-xd-yarn:spring-xd-yarn-appmaster'
include 'spring-xd-spark-streaming'
include 'spring-xd-spark-streaming-tests'
include 'spring-xd-test'
include 'spring-xd-rest-client'
include 'spring-xd-rest-domain'
include 'spring-xd-shell'
include 'spring-xd-ui'
include 'spring-xd-integration-test'
include 'spring-xd-integration-test:acceptance-test-sparkapp'
include 'spring-xd-test-fixtures'
include 'spring-xd-distributed-test'
include 'spring-xd-benchmark'
include 'documentation-toolchain'

['source', 'processor', 'sink', 'job'].each {kind->
	new File(rootDir, "modules/${kind}").eachDir { dir ->
		if (new File(dir, "config/${dir.name}.xml").exists() || new File(dir, "config/${dir.name}.properties").exists()) {
		    include ":modules.${kind}.${dir.name}"
		    project(":modules.${kind}.${dir.name}").projectDir = dir
		}
	}
}

// For projects living in extensions/ directory:
// This prevents the detection of the extensions/ directory itself
// as a project (which it is not) and avoids manual listing of projects
new File(rootDir, 'extensions').eachDir { dir ->
	if (new File(dir, 'src/main/java').exists() || new File(dir, 'src/test/java').exists()) {
		include ":${dir.name}"
		project(":${dir.name}").projectDir = dir
	}
}

// For projects living in spring-xd-starters/ directory:
// This prevents the detection of the spring-xd-starters/ directory itself
// as a project (which it is not) and avoids manual listing of projects
new File(rootDir, 'spring-xd-starters').eachDir { dir ->
	if (new File(dir, 'publish-maven.gradle').exists()) {
		include ":${dir.name}"
		project(":${dir.name}").projectDir = dir
	}
}

// For projects living in spring-xd-gradle-plugins/ directory:
// This prevents the detection of the spring-xd-gradle-plugins/ directory itself
// as a project (which it is not) and avoids manual listing of projects
new File(rootDir, 'spring-xd-gradle-plugins').eachDir { dir ->
	include ":${dir.name}"
	project(":${dir.name}").projectDir = dir
}