blob: b86af2b198254b6c42a70d8dce9eebb3b8ff623d [file] [log] [blame]
Yigit Boyare421e292015-03-13 12:57:48 -07001Properties databindingProperties = new Properties()
George Mount4c5cc002015-03-12 09:18:12 -07002databindingProperties.load(new FileInputStream("${projectDir}/databinding.properties"))
Yigit Boyare421e292015-03-13 12:57:48 -07003databindingProperties.mavenRepoDir = "${projectDir}/${databindingProperties.mavenRepoName}"
4ext.config = databindingProperties
5
6
7println "local maven repo is ${ext.config.mavenRepoDir}."
8
9new File(ext.config.mavenRepoDir).mkdir()
Yigit Boyar840f0ce2014-12-12 16:45:00 -080010subprojects {
Yigit Boyarf9e51c02015-03-12 14:30:29 -070011 apply plugin: 'maven'
Yigit Boyar840f0ce2014-12-12 16:45:00 -080012 group = 'com.android.databinding'
Yigit Boyare421e292015-03-13 12:57:48 -070013 version = config.snapshotVersion
Yigit Boyar840f0ce2014-12-12 16:45:00 -080014 repositories {
Yigit Boyar840f0ce2014-12-12 16:45:00 -080015 mavenCentral()
Yigit Boyarf9e51c02015-03-12 14:30:29 -070016 maven {
Yigit Boyare421e292015-03-13 12:57:48 -070017 url "file://${config.mavenRepoDir}"
Yigit Boyarf9e51c02015-03-12 14:30:29 -070018 }
Yigit Boyar840f0ce2014-12-12 16:45:00 -080019 }
Yigit Boyarf9e51c02015-03-12 14:30:29 -070020 uploadArchives {
21 repositories {
22 mavenDeployer {
Yigit Boyare421e292015-03-13 12:57:48 -070023 repository(url: "file://${config.mavenRepoDir}")
Yigit Boyarf9e51c02015-03-12 14:30:29 -070024 }
25 }
26 }
27}
28
29task deleteRepo(type: Delete) {
Yigit Boyare421e292015-03-13 12:57:48 -070030 delete "${config.mavenRepoDir}"
Yigit Boyarf9e51c02015-03-12 14:30:29 -070031}
32
33file('integration-tests').listFiles().findAll { it.isDirectory() }.each {
34 println("${it.getAbsolutePath()}")
35 def testTask = project.tasks.create "runTestsOf${it.getName().capitalize()}", Exec
36 testTask.workingDir 'integration-tests/TestApp'
37 //on linux
38 testTask.commandLine './gradlew'
39 testTask.args 'clean', 'connectedCheck', '--info'
40 testTask.dependsOn subprojects.uploadArchives
41}
42
43task runIntegrationTests {
44 dependsOn tasks.findAll { task -> task.name.startsWith('runTestsOf') }
45}
46
47task runAllTests {
48 dependsOn runIntegrationTests
49}
50
51allprojects {
52 afterEvaluate { project ->
53 runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('test')}
54 }
55}
56
57
58task rebuildRepo() {
59 dependsOn deleteRepo
60 dependsOn subprojects.uploadArchives
Yigit Boyar840f0ce2014-12-12 16:45:00 -080061}