Yigit Boyar 243a1e3e18 Support for multi module setups
This CL adds support for building multi module apps
with proper context.

For library modules, we only generate base classes in the initial
compilation. We also generate a temporary BR file which does
not have final methods.

When final app is being generated, all layout binders, adapters
and Bindable information gets merged and all final classes
are generated in their appropriate packages.

This CL also adds support for Test runs and any
number of build variants.

Bug: 19714904
Change-Id: I9b50b54db05f3fa206eec33709d43c2ac94a9e5e
2015-03-19 12:40:00 -07:00

74 lines
2.3 KiB
Groovy

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'].shouldRunAfter tasks['runTestsOfIndependentLibrary']
task rebuildRepo() {
dependsOn deleteRepo
dependsOn subprojects.uploadArchives
dependsOn buildExtensionsTask
}