blob: 675f19661647db00d5e6f7d812009205e5c4ccf3 [file] [log] [blame]
Yigit Boyarf5140a12015-03-13 12:57:48 -07001Properties databindingProperties = new Properties()
George Mount230ecdb2015-03-12 09:18:12 -07002databindingProperties.load(new FileInputStream("${projectDir}/databinding.properties"))
Yigit Boyarf5140a12015-03-13 12:57:48 -07003databindingProperties.mavenRepoDir = "${projectDir}/${databindingProperties.mavenRepoName}"
4ext.config = databindingProperties
5
Yigit Boyarf5140a12015-03-13 12:57:48 -07006println "local maven repo is ${ext.config.mavenRepoDir}."
7
8new File(ext.config.mavenRepoDir).mkdir()
Yigit Boyarfea20442014-12-12 16:45:00 -08009subprojects {
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070010 apply plugin: 'maven'
Yigit Boyar243a1e32015-03-13 15:58:53 -070011 group = config.group
Yigit Boyarf5140a12015-03-13 12:57:48 -070012 version = config.snapshotVersion
Yigit Boyarfea20442014-12-12 16:45:00 -080013 repositories {
Yigit Boyarfea20442014-12-12 16:45:00 -080014 mavenCentral()
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070015 maven {
Yigit Boyarf5140a12015-03-13 12:57:48 -070016 url "file://${config.mavenRepoDir}"
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070017 }
Yigit Boyarfea20442014-12-12 16:45:00 -080018 }
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070019 uploadArchives {
20 repositories {
21 mavenDeployer {
Yigit Boyarf5140a12015-03-13 12:57:48 -070022 repository(url: "file://${config.mavenRepoDir}")
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070023 }
24 }
25 }
26}
27
28task deleteRepo(type: Delete) {
Yigit Boyarf5140a12015-03-13 12:57:48 -070029 delete "${config.mavenRepoDir}"
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070030}
31
Yigit Boyar243a1e32015-03-13 15:58:53 -070032def buildExtensionsTask = project.tasks.create "buildExtensionsTask", Exec
33buildExtensionsTask.workingDir file('extensions').getAbsolutePath()
34//on linux
35buildExtensionsTask.commandLine './gradlew'
36buildExtensionsTask.args 'clean', 'uploadArchives', '--info', '--stacktrace'
37buildExtensionsTask.dependsOn subprojects.uploadArchives
38
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070039file('integration-tests').listFiles().findAll { it.isDirectory() }.each {
Yigit Boyar243a1e32015-03-13 15:58:53 -070040 println("Creating run test task for ${it.getAbsolutePath()}.")
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070041 def testTask = project.tasks.create "runTestsOf${it.getName().capitalize()}", Exec
Yigit Boyar243a1e32015-03-13 15:58:53 -070042 testTask.workingDir it.getAbsolutePath()
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070043 //on linux
44 testTask.commandLine './gradlew'
Yigit Boyar243a1e32015-03-13 15:58:53 -070045 testTask.args 'clean', 'connectedCheck', '--info', '--stacktrace'
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070046 testTask.dependsOn subprojects.uploadArchives
Yigit Boyar243a1e32015-03-13 15:58:53 -070047 testTask.dependsOn buildExtensionsTask
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070048}
49
50task runIntegrationTests {
51 dependsOn tasks.findAll { task -> task.name.startsWith('runTestsOf') }
52}
53
54task runAllTests {
55 dependsOn runIntegrationTests
56}
57
58allprojects {
59 afterEvaluate { project ->
60 runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('test')}
Yigit Boyar243a1e32015-03-13 15:58:53 -070061 runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('connectedCheck')}
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070062 }
63}
64
Yigit Boyar243a1e32015-03-13 15:58:53 -070065subprojects.uploadArchives.each { it.shouldRunAfter deleteRepo }
66buildExtensionsTask.shouldRunAfter deleteRepo
Yigit Boyarff5868e2015-03-25 12:46:05 -070067tasks['runTestsOfMultiModuleTestApp'].dependsOn tasks['runTestsOfIndependentLibrary']
Yigit Boyar243a1e32015-03-13 15:58:53 -070068
Yigit Boyar1ec5cb02015-03-12 14:30:29 -070069
70task rebuildRepo() {
71 dependsOn deleteRepo
72 dependsOn subprojects.uploadArchives
Yigit Boyar243a1e32015-03-13 15:58:53 -070073 dependsOn buildExtensionsTask
Yigit Boyarfea20442014-12-12 16:45:00 -080074}