blob: 2f2365496501acd28c0983c1a54583af23d944e0 [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 Boyarc64ae352015-04-21 14:05:41 -07004databindingProperties.eapOutDir = "${projectDir}/${databindingProperties.eapOutFolderName}"
Yigit Boyaree758672015-04-16 15:12:02 -07005databindingProperties.prebuildFolder = "${projectDir}/${databindingProperties.prebuildFolderName}" +
6 "/${databindingProperties.releaseVersion}"
7
Yigit Boyare421e292015-03-13 12:57:48 -07008ext.config = databindingProperties
9
Yigit Boyare421e292015-03-13 12:57:48 -070010println "local maven repo is ${ext.config.mavenRepoDir}."
Yigit Boyaree758672015-04-16 15:12:02 -070011println "local pre-build folder is ${ext.config.prebuildFolder}."
Yigit Boyare421e292015-03-13 12:57:48 -070012
13new File(ext.config.mavenRepoDir).mkdir()
Yigit Boyaree758672015-04-16 15:12:02 -070014new File(ext.config.prebuildFolder).mkdir()
15
Yigit Boyar840f0ce2014-12-12 16:45:00 -080016subprojects {
Yigit Boyarf9e51c02015-03-12 14:30:29 -070017 apply plugin: 'maven'
Yigit Boyara6e45832015-03-13 15:58:53 -070018 group = config.group
Yigit Boyare421e292015-03-13 12:57:48 -070019 version = config.snapshotVersion
Yigit Boyar840f0ce2014-12-12 16:45:00 -080020 repositories {
Yigit Boyar840f0ce2014-12-12 16:45:00 -080021 mavenCentral()
Yigit Boyarf9e51c02015-03-12 14:30:29 -070022 maven {
Yigit Boyare421e292015-03-13 12:57:48 -070023 url "file://${config.mavenRepoDir}"
Yigit Boyarf9e51c02015-03-12 14:30:29 -070024 }
Yigit Boyar840f0ce2014-12-12 16:45:00 -080025 }
Yigit Boyarf9e51c02015-03-12 14:30:29 -070026 uploadArchives {
27 repositories {
28 mavenDeployer {
Yigit Boyare421e292015-03-13 12:57:48 -070029 repository(url: "file://${config.mavenRepoDir}")
Yigit Boyarf9e51c02015-03-12 14:30:29 -070030 }
31 }
32 }
33}
34
35task deleteRepo(type: Delete) {
Yigit Boyare421e292015-03-13 12:57:48 -070036 delete "${config.mavenRepoDir}"
Yigit Boyarf9e51c02015-03-12 14:30:29 -070037}
38
Yigit Boyaree758672015-04-16 15:12:02 -070039task deletePrebuildFolder(type: Delete) {
40 delete "${config.prebuildFolder}"
41}
42
Yigit Boyarc64ae352015-04-21 14:05:41 -070043task deleteEap(type: Delete) {
44 delete "${config.eapOutDir}"
45}
46
47
Yigit Boyara6e45832015-03-13 15:58:53 -070048def buildExtensionsTask = project.tasks.create "buildExtensionsTask", Exec
49buildExtensionsTask.workingDir file('extensions').getAbsolutePath()
Yigit Boyara6e45832015-03-13 15:58:53 -070050buildExtensionsTask.commandLine './gradlew'
51buildExtensionsTask.args 'clean', 'uploadArchives', '--info', '--stacktrace'
52buildExtensionsTask.dependsOn subprojects.uploadArchives
53
Yigit Boyaree758672015-04-16 15:12:02 -070054def prepareExtensionPrebuilds = project.tasks.create "prepareExtensionPrebuilds", Exec
55prepareExtensionPrebuilds.workingDir file('extensions').getAbsolutePath()
56prepareExtensionPrebuilds.commandLine './gradlew'
57prepareExtensionPrebuilds.args 'clean', 'preparePrebuilds', '--info', '--stacktrace'
58prepareExtensionPrebuilds.dependsOn subprojects.uploadArchives
59
Yigit Boyarf9e51c02015-03-12 14:30:29 -070060file('integration-tests').listFiles().findAll { it.isDirectory() }.each {
Yigit Boyara6e45832015-03-13 15:58:53 -070061 println("Creating run test task for ${it.getAbsolutePath()}.")
Yigit Boyarf9e51c02015-03-12 14:30:29 -070062 def testTask = project.tasks.create "runTestsOf${it.getName().capitalize()}", Exec
Yigit Boyara6e45832015-03-13 15:58:53 -070063 testTask.workingDir it.getAbsolutePath()
Yigit Boyarf9e51c02015-03-12 14:30:29 -070064 //on linux
65 testTask.commandLine './gradlew'
Yigit Boyara6e45832015-03-13 15:58:53 -070066 testTask.args 'clean', 'connectedCheck', '--info', '--stacktrace'
Yigit Boyarf9e51c02015-03-12 14:30:29 -070067 testTask.dependsOn subprojects.uploadArchives
Yigit Boyara6e45832015-03-13 15:58:53 -070068 testTask.dependsOn buildExtensionsTask
Yigit Boyarf9e51c02015-03-12 14:30:29 -070069}
70
71task runIntegrationTests {
72 dependsOn tasks.findAll { task -> task.name.startsWith('runTestsOf') }
73}
74
75task runAllTests {
76 dependsOn runIntegrationTests
77}
78
Yigit Boyaree758672015-04-16 15:12:02 -070079task preparePrebuilds() {
80 dependsOn deletePrebuildFolder
81 dependsOn prepareExtensionPrebuilds
82}
83
Yigit Boyarf9e51c02015-03-12 14:30:29 -070084allprojects {
85 afterEvaluate { project ->
86 runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('test')}
Yigit Boyara6e45832015-03-13 15:58:53 -070087 runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('connectedCheck')}
Yigit Boyaree758672015-04-16 15:12:02 -070088 preparePrebuilds.dependsOn project.tasks.findAll {task -> task.name.startsWith('prebuild')}
Yigit Boyarf9e51c02015-03-12 14:30:29 -070089 }
90}
91
Yigit Boyara6e45832015-03-13 15:58:53 -070092subprojects.uploadArchives.each { it.shouldRunAfter deleteRepo }
93buildExtensionsTask.shouldRunAfter deleteRepo
Yigit Boyar99a3d312015-03-25 12:46:05 -070094tasks['runTestsOfMultiModuleTestApp'].dependsOn tasks['runTestsOfIndependentLibrary']
Yigit Boyara6e45832015-03-13 15:58:53 -070095
Yigit Boyarf9e51c02015-03-12 14:30:29 -070096
97task rebuildRepo() {
98 dependsOn deleteRepo
99 dependsOn subprojects.uploadArchives
Yigit Boyara6e45832015-03-13 15:58:53 -0700100 dependsOn buildExtensionsTask
Yigit Boyaree758672015-04-16 15:12:02 -0700101}
102
Yigit Boyarc64ae352015-04-21 14:05:41 -0700103task copySamplesToEap(type : Copy) {
104 mustRunAfter deleteEap
105 from ("$projectDir/samples") {
106 exclude "**/build"
107 }
108 into "${config.eapOutDir}/samples"
109}
110
111
112task copyMavenRepoToEap(type : Copy) {
113 mustRunAfter deleteEap
114 dependsOn rebuildRepo
115 from(config.mavenRepoDir)
116 into "${config.eapOutDir}/${config.mavenRepoName}"
117}
118
119tasks.create(name : 'createEapConfigFile') << {
120 def propsFile = new File("${config.eapOutDir}/databinding.properties")
121 Properties props = new Properties()
122 props.setProperty('snapshotVersion', config.snapshotVersion)
123 props.setProperty('mavenRepoName', config.mavenRepoName)
124 props.store(propsFile.newWriter(), null)
125}
126
127
128task batchEAP() {
129 dependsOn deleteEap
130 dependsOn copyMavenRepoToEap
131 dependsOn copySamplesToEap
132 dependsOn createEapConfigFile
133
134}