-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
77 lines (64 loc) · 2.25 KB
/
build.gradle
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
75
76
77
plugins {
id 'net.saliman.properties' version '1.4.3'
}
apply plugin: 'maven-publish'
apply plugin: 'net.saliman.properties'
task clean(type: Delete) {
delete 'build', upstreamDirectory, aarOutputDirectory, mavenRepositoryDirectory
}
task configureUpstream(type: Exec) {
commandLine './scripts/configure-upstream.sh'
args = [upstreamRepo]
}
task upstreamBranches(type: Exec, dependsOn: ['configureUpstream']) {
description 'List all upstream branches'
commandLine 'git'
args = ['branch', '-a']
}
task upstreamTags(type: Exec, dependsOn: ['configureUpstream']) {
description 'List all upstream tags'
commandLine 'git'
args = ['tag']
}
task checkoutUpstream(type: Exec, dependsOn: ['configureUpstream']) {
description 'Checks out a specific version of volley, overwrite version with -P upstreamVersion={version} and -P upstreamType={branch/tag}'
commandLine './scripts/checkout-upstream.sh'
args = [upstreamVersion, upstreamType, upstreamDirectory]
}
task buildLibrary(type: Exec, dependsOn: ['checkoutUpstream']) {
commandLine './scripts/build-library.sh'
args = [upstreamDirectory, aarOutputDirectory, aarOutputBasename, aarVersion, upstreamGradleVersion]
if(project.hasProperty('androidHome')) {
environment ANDROID_HOME: androidHome
}
}
task prepareMavenRepo(type: Exec) {
commandLine './scripts/prepare-maven-repo.sh'
args = [mavenRepositoryDirectory, mavenRepositoryBranch]
}
publishing {
publications {
repositories.maven {
url mavenRepositoryDirectory
}
maven(MavenPublication) {
artifacts {
groupId 'tv.tape.android-volley'
artifactId 'library'
version aarVersion
artifact (aarOutputDirectory + '/' + aarOutputBasename + aarVersion + '.aar')
}
}
}
}
publish.dependsOn buildLibrary
task commitNewMavenVersion(type: Exec, dependsOn: ['prepareMavenRepo', 'publish']) {
commandLine './scripts/commit-new-maven-version.sh'
args = [mavenRepositoryDirectory, aarVersion, upstreamVersion, upstreamType, upstreamRepo]
}
task pushMavenRepo(type: Exec, dependsOn: ['prepareMavenRepo']) {
workingDir mavenRepositoryDirectory
commandLine 'git'
args = ['push', 'origin', 'HEAD:' + mavenRepositoryBranch]
}
task publishLibrary(dependsOn: ['commitNewMavenVersion', 'pushMavenRepo'])