Yigit Boyar | f5140a1 | 2015-03-13 12:57:48 -0700 | [diff] [blame] | 1 | Properties databindingProperties = new Properties() |
George Mount | 230ecdb | 2015-03-12 09:18:12 -0700 | [diff] [blame] | 2 | databindingProperties.load(new FileInputStream("${projectDir}/databinding.properties")) |
Yigit Boyar | f5140a1 | 2015-03-13 12:57:48 -0700 | [diff] [blame] | 3 | databindingProperties.mavenRepoDir = "${projectDir}/${databindingProperties.mavenRepoName}" |
| 4 | ext.config = databindingProperties |
| 5 | |
Yigit Boyar | f5140a1 | 2015-03-13 12:57:48 -0700 | [diff] [blame] | 6 | println "local maven repo is ${ext.config.mavenRepoDir}." |
| 7 | |
| 8 | new File(ext.config.mavenRepoDir).mkdir() |
Yigit Boyar | fea2044 | 2014-12-12 16:45:00 -0800 | [diff] [blame] | 9 | subprojects { |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 10 | apply plugin: 'maven' |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 11 | group = config.group |
Yigit Boyar | f5140a1 | 2015-03-13 12:57:48 -0700 | [diff] [blame] | 12 | version = config.snapshotVersion |
Yigit Boyar | fea2044 | 2014-12-12 16:45:00 -0800 | [diff] [blame] | 13 | repositories { |
Yigit Boyar | fea2044 | 2014-12-12 16:45:00 -0800 | [diff] [blame] | 14 | mavenCentral() |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 15 | maven { |
Yigit Boyar | f5140a1 | 2015-03-13 12:57:48 -0700 | [diff] [blame] | 16 | url "file://${config.mavenRepoDir}" |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 17 | } |
Yigit Boyar | fea2044 | 2014-12-12 16:45:00 -0800 | [diff] [blame] | 18 | } |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 19 | uploadArchives { |
| 20 | repositories { |
| 21 | mavenDeployer { |
Yigit Boyar | f5140a1 | 2015-03-13 12:57:48 -0700 | [diff] [blame] | 22 | repository(url: "file://${config.mavenRepoDir}") |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 23 | } |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | task deleteRepo(type: Delete) { |
Yigit Boyar | f5140a1 | 2015-03-13 12:57:48 -0700 | [diff] [blame] | 29 | delete "${config.mavenRepoDir}" |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 30 | } |
| 31 | |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 32 | def buildExtensionsTask = project.tasks.create "buildExtensionsTask", Exec |
| 33 | buildExtensionsTask.workingDir file('extensions').getAbsolutePath() |
| 34 | //on linux |
| 35 | buildExtensionsTask.commandLine './gradlew' |
| 36 | buildExtensionsTask.args 'clean', 'uploadArchives', '--info', '--stacktrace' |
| 37 | buildExtensionsTask.dependsOn subprojects.uploadArchives |
| 38 | |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 39 | file('integration-tests').listFiles().findAll { it.isDirectory() }.each { |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 40 | println("Creating run test task for ${it.getAbsolutePath()}.") |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 41 | def testTask = project.tasks.create "runTestsOf${it.getName().capitalize()}", Exec |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 42 | testTask.workingDir it.getAbsolutePath() |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 43 | //on linux |
| 44 | testTask.commandLine './gradlew' |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 45 | testTask.args 'clean', 'connectedCheck', '--info', '--stacktrace' |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 46 | testTask.dependsOn subprojects.uploadArchives |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 47 | testTask.dependsOn buildExtensionsTask |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | task runIntegrationTests { |
| 51 | dependsOn tasks.findAll { task -> task.name.startsWith('runTestsOf') } |
| 52 | } |
| 53 | |
| 54 | task runAllTests { |
| 55 | dependsOn runIntegrationTests |
| 56 | } |
| 57 | |
| 58 | allprojects { |
| 59 | afterEvaluate { project -> |
| 60 | runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('test')} |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 61 | runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('connectedCheck')} |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 62 | } |
| 63 | } |
| 64 | |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 65 | subprojects.uploadArchives.each { it.shouldRunAfter deleteRepo } |
| 66 | buildExtensionsTask.shouldRunAfter deleteRepo |
Yigit Boyar | ff5868e | 2015-03-25 12:46:05 -0700 | [diff] [blame^] | 67 | tasks['runTestsOfMultiModuleTestApp'].dependsOn tasks['runTestsOfIndependentLibrary'] |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 68 | |
Yigit Boyar | 1ec5cb0 | 2015-03-12 14:30:29 -0700 | [diff] [blame] | 69 | |
| 70 | task rebuildRepo() { |
| 71 | dependsOn deleteRepo |
| 72 | dependsOn subprojects.uploadArchives |
Yigit Boyar | 243a1e3 | 2015-03-13 15:58:53 -0700 | [diff] [blame] | 73 | dependsOn buildExtensionsTask |
Yigit Boyar | fea2044 | 2014-12-12 16:45:00 -0800 | [diff] [blame] | 74 | } |