blob: d4aa037273fee22a188950dbb696d9a14eac5198 [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}"
Yigit Boyaree758672015-04-16 15:12:02 -07004databindingProperties.prebuildFolder = "${projectDir}/${databindingProperties.prebuildFolderName}" +
5 "/${databindingProperties.releaseVersion}"
6
Yigit Boyare421e292015-03-13 12:57:48 -07007ext.config = databindingProperties
8
Yigit Boyare421e292015-03-13 12:57:48 -07009println "local maven repo is ${ext.config.mavenRepoDir}."
Yigit Boyaree758672015-04-16 15:12:02 -070010println "local pre-build folder is ${ext.config.prebuildFolder}."
Yigit Boyare421e292015-03-13 12:57:48 -070011
12new File(ext.config.mavenRepoDir).mkdir()
Yigit Boyaree758672015-04-16 15:12:02 -070013new File(ext.config.prebuildFolder).mkdir()
14
Yigit Boyar840f0ce2014-12-12 16:45:00 -080015subprojects {
Yigit Boyarf9e51c02015-03-12 14:30:29 -070016 apply plugin: 'maven'
Yigit Boyara6e45832015-03-13 15:58:53 -070017 group = config.group
Yigit Boyare421e292015-03-13 12:57:48 -070018 version = config.snapshotVersion
Yigit Boyar840f0ce2014-12-12 16:45:00 -080019 repositories {
Yigit Boyar840f0ce2014-12-12 16:45:00 -080020 mavenCentral()
Yigit Boyarf9e51c02015-03-12 14:30:29 -070021 maven {
Yigit Boyare421e292015-03-13 12:57:48 -070022 url "file://${config.mavenRepoDir}"
Yigit Boyarf9e51c02015-03-12 14:30:29 -070023 }
Yigit Boyar840f0ce2014-12-12 16:45:00 -080024 }
Yigit Boyarf9e51c02015-03-12 14:30:29 -070025 uploadArchives {
26 repositories {
27 mavenDeployer {
Yigit Boyare421e292015-03-13 12:57:48 -070028 repository(url: "file://${config.mavenRepoDir}")
Yigit Boyarf9e51c02015-03-12 14:30:29 -070029 }
30 }
31 }
32}
33
34task deleteRepo(type: Delete) {
Yigit Boyare421e292015-03-13 12:57:48 -070035 delete "${config.mavenRepoDir}"
Yigit Boyarf9e51c02015-03-12 14:30:29 -070036}
37
Yigit Boyaree758672015-04-16 15:12:02 -070038task deletePrebuildFolder(type: Delete) {
39 delete "${config.prebuildFolder}"
40}
41
Yigit Boyara6e45832015-03-13 15:58:53 -070042def buildExtensionsTask = project.tasks.create "buildExtensionsTask", Exec
43buildExtensionsTask.workingDir file('extensions').getAbsolutePath()
Yigit Boyara6e45832015-03-13 15:58:53 -070044buildExtensionsTask.commandLine './gradlew'
45buildExtensionsTask.args 'clean', 'uploadArchives', '--info', '--stacktrace'
46buildExtensionsTask.dependsOn subprojects.uploadArchives
47
Yigit Boyaree758672015-04-16 15:12:02 -070048def prepareExtensionPrebuilds = project.tasks.create "prepareExtensionPrebuilds", Exec
49prepareExtensionPrebuilds.workingDir file('extensions').getAbsolutePath()
50prepareExtensionPrebuilds.commandLine './gradlew'
51prepareExtensionPrebuilds.args 'clean', 'preparePrebuilds', '--info', '--stacktrace'
52prepareExtensionPrebuilds.dependsOn subprojects.uploadArchives
53
Yigit Boyarf9e51c02015-03-12 14:30:29 -070054file('integration-tests').listFiles().findAll { it.isDirectory() }.each {
Yigit Boyara6e45832015-03-13 15:58:53 -070055 println("Creating run test task for ${it.getAbsolutePath()}.")
Yigit Boyarf9e51c02015-03-12 14:30:29 -070056 def testTask = project.tasks.create "runTestsOf${it.getName().capitalize()}", Exec
Yigit Boyara6e45832015-03-13 15:58:53 -070057 testTask.workingDir it.getAbsolutePath()
Yigit Boyarf9e51c02015-03-12 14:30:29 -070058 //on linux
59 testTask.commandLine './gradlew'
Yigit Boyara6e45832015-03-13 15:58:53 -070060 testTask.args 'clean', 'connectedCheck', '--info', '--stacktrace'
Yigit Boyarf9e51c02015-03-12 14:30:29 -070061 testTask.dependsOn subprojects.uploadArchives
Yigit Boyara6e45832015-03-13 15:58:53 -070062 testTask.dependsOn buildExtensionsTask
Yigit Boyarf9e51c02015-03-12 14:30:29 -070063}
64
65task runIntegrationTests {
66 dependsOn tasks.findAll { task -> task.name.startsWith('runTestsOf') }
67}
68
69task runAllTests {
70 dependsOn runIntegrationTests
71}
72
Yigit Boyaree758672015-04-16 15:12:02 -070073task preparePrebuilds() {
74 dependsOn deletePrebuildFolder
75 dependsOn prepareExtensionPrebuilds
76}
77
Yigit Boyarf9e51c02015-03-12 14:30:29 -070078allprojects {
79 afterEvaluate { project ->
80 runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('test')}
Yigit Boyara6e45832015-03-13 15:58:53 -070081 runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('connectedCheck')}
Yigit Boyaree758672015-04-16 15:12:02 -070082 preparePrebuilds.dependsOn project.tasks.findAll {task -> task.name.startsWith('prebuild')}
Yigit Boyarf9e51c02015-03-12 14:30:29 -070083 }
84}
85
Yigit Boyara6e45832015-03-13 15:58:53 -070086subprojects.uploadArchives.each { it.shouldRunAfter deleteRepo }
Yigit Boyarae161282015-04-21 11:02:58 -070087subprojects.uploadArchives.each { it.shouldRunAfter deletePrebuildFolder }
Yigit Boyara6e45832015-03-13 15:58:53 -070088buildExtensionsTask.shouldRunAfter deleteRepo
Yigit Boyar99a3d312015-03-25 12:46:05 -070089tasks['runTestsOfMultiModuleTestApp'].dependsOn tasks['runTestsOfIndependentLibrary']
Yigit Boyara6e45832015-03-13 15:58:53 -070090
Yigit Boyarf9e51c02015-03-12 14:30:29 -070091
92task rebuildRepo() {
93 dependsOn deleteRepo
94 dependsOn subprojects.uploadArchives
Yigit Boyara6e45832015-03-13 15:58:53 -070095 dependsOn buildExtensionsTask
Yigit Boyaree758672015-04-16 15:12:02 -070096}
97