blob: 675f19661647db00d5e6f7d812009205e5c4ccf3 [file] [log] [blame]
Properties databindingProperties = new Properties()
databindingProperties.load(new FileInputStream("${projectDir}/databinding.properties"))
databindingProperties.mavenRepoDir = "${projectDir}/${databindingProperties.mavenRepoName}"
ext.config = databindingProperties
println "local maven repo is ${ext.config.mavenRepoDir}."
new File(ext.config.mavenRepoDir).mkdir()
subprojects {
apply plugin: 'maven'
group = config.group
version = config.snapshotVersion
repositories {
mavenCentral()
maven {
url "file://${config.mavenRepoDir}"
}
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://${config.mavenRepoDir}")
}
}
}
}
task deleteRepo(type: Delete) {
delete "${config.mavenRepoDir}"
}
def buildExtensionsTask = project.tasks.create "buildExtensionsTask", Exec
buildExtensionsTask.workingDir file('extensions').getAbsolutePath()
//on linux
buildExtensionsTask.commandLine './gradlew'
buildExtensionsTask.args 'clean', 'uploadArchives', '--info', '--stacktrace'
buildExtensionsTask.dependsOn subprojects.uploadArchives
file('integration-tests').listFiles().findAll { it.isDirectory() }.each {
println("Creating run test task for ${it.getAbsolutePath()}.")
def testTask = project.tasks.create "runTestsOf${it.getName().capitalize()}", Exec
testTask.workingDir it.getAbsolutePath()
//on linux
testTask.commandLine './gradlew'
testTask.args 'clean', 'connectedCheck', '--info', '--stacktrace'
testTask.dependsOn subprojects.uploadArchives
testTask.dependsOn buildExtensionsTask
}
task runIntegrationTests {
dependsOn tasks.findAll { task -> task.name.startsWith('runTestsOf') }
}
task runAllTests {
dependsOn runIntegrationTests
}
allprojects {
afterEvaluate { project ->
runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('test')}
runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('connectedCheck')}
}
}
subprojects.uploadArchives.each { it.shouldRunAfter deleteRepo }
buildExtensionsTask.shouldRunAfter deleteRepo
tasks['runTestsOfMultiModuleTestApp'].dependsOn tasks['runTestsOfIndependentLibrary']
task rebuildRepo() {
dependsOn deleteRepo
dependsOn subprojects.uploadArchives
dependsOn buildExtensionsTask
}