summaryrefslogtreecommitdiffstats
path: root/tools/data-binding/build.gradle
blob: 675f19661647db00d5e6f7d812009205e5c4ccf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Properties databindingProperties = new Properties()
databindingProperties.load(new FileInputStream("${projectDir}/databinding.properties"))
databindingProperties.mavenRepoDir = "${projectDir}/${databindingProperties.mavenRepoName}"
ext.config = databindingProperties

println "local maven repo is ${ext.config.mavenRepoDir}."

new File(ext.config.mavenRepoDir).mkdir()
subprojects {
    apply plugin: 'maven'
    group = config.group
    version = config.snapshotVersion
    repositories {
        mavenCentral()
        maven {
            url "file://${config.mavenRepoDir}"
        }
    }
    uploadArchives {
        repositories {
            mavenDeployer {
                repository(url: "file://${config.mavenRepoDir}")
            }
        }
    }
}

task deleteRepo(type: Delete) {
    delete "${config.mavenRepoDir}"
}

def buildExtensionsTask = project.tasks.create "buildExtensionsTask", Exec
buildExtensionsTask.workingDir file('extensions').getAbsolutePath()
//on linux
buildExtensionsTask.commandLine './gradlew'
buildExtensionsTask.args 'clean', 'uploadArchives', '--info', '--stacktrace'
buildExtensionsTask.dependsOn subprojects.uploadArchives

file('integration-tests').listFiles().findAll { it.isDirectory() }.each {
    println("Creating run test task for  ${it.getAbsolutePath()}.")
    def testTask = project.tasks.create "runTestsOf${it.getName().capitalize()}", Exec
    testTask.workingDir it.getAbsolutePath()
    //on linux
    testTask.commandLine './gradlew'
    testTask.args 'clean', 'connectedCheck', '--info', '--stacktrace'
    testTask.dependsOn subprojects.uploadArchives
    testTask.dependsOn buildExtensionsTask
}

task runIntegrationTests {
    dependsOn tasks.findAll { task -> task.name.startsWith('runTestsOf') }
}

task runAllTests {
    dependsOn runIntegrationTests
}

allprojects {
    afterEvaluate { project ->
        runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('test')}
        runAllTests.dependsOn project.tasks.findAll {task -> task.name.equals('connectedCheck')}
    }
}

subprojects.uploadArchives.each { it.shouldRunAfter deleteRepo  }
buildExtensionsTask.shouldRunAfter deleteRepo
tasks['runTestsOfMultiModuleTestApp'].dependsOn tasks['runTestsOfIndependentLibrary']


task rebuildRepo() {
    dependsOn deleteRepo
    dependsOn subprojects.uploadArchives
    dependsOn buildExtensionsTask
}