-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
132 lines (118 loc) · 4.49 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Global gradle configuration. This configuration will be used for all sub-projects.
apply from: './configuration.gradle'
apply from: './repositories.gradle'
apply from: './dependencies.gradle'
/**
* Global build script configuration ===============================================================
*/
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.15.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
}
/**
* All projects global configuration ===============================================================
*/
allprojects {
repositories {
google()
jcenter()
maven { url repos.bintray.universum.studios.android }
mavenLocal()
maven { url repos.project.artifacts }
}
// Disable pre-dexing of libraries when running builds in CI environment.
if (config.ci.EXECUTING == true) {
project.plugins.whenPluginAdded { plugin ->
if (plugin.class.name == "com.android.build.gradle.AppPlugin") {
logger.quiet("Disabled pre-dexing for module :${project.name}")
project.android.dexOptions.preDexLibraries = false
} else if (plugin.class.name == "com.android.build.gradle.LibraryPlugin") {
logger.quiet("Disabled pre-dexing for library module :${project.name}")
project.android.dexOptions.preDexLibraries = false
}
}
}
}
/**
* All projects global tasks =======================================================================
*/
/**
* Task that cleans build directory of the root project.
*/
task clean(type: Delete) {
delete rootProject.buildDir
}
/**
* Task that assembles release variant of all library modules.
*/
task assembleLibrary() {
group 'build'
description 'Assembles release variant of all library modules.'
subprojects.findAll { if (it.name.startsWith("library")) dependsOn ":${it.name}:assembleRelease" }
}
/**
* Task that deploys (uploads) the primary library module into Maven local repository.
*/
task deployToMavenLocal(dependsOn: ':library:publishToMavenLocal') {
group 'deploy'
description 'Deploys primary artifact of the library to the local Maven repository.'
}
/**
* Task that deploys (uploads) all library modules (except groups) into Maven local repository.
*/
task deployModulesToMavenLocal() {
group 'deploy'
description 'Deploys artifacts for all library modules (except groups) into Maven local repository.'
subprojects.findAll { if (it.name.startsWith("library-") && !it.name.endsWith('_group')) dependsOn ":${it.name}:publishToMavenLocal" }
}
/**
* Task that deploys (uploads) all library module groups into Maven local repository.
*/
task deployGroupsToMavenLocal() {
group 'deploy'
description 'Deploys artifacts for all library module groups into Maven local repository.'
subprojects.findAll { if (it.name.startsWith("library-") && it.name.endsWith('_group')) dependsOn ":${it.name}:publishToMavenLocal" }
}
/**
* Task that deploys (uploads) the primary library module up to the Bintray repository.
*/
task deployToBintray(dependsOn: ':library:bintrayUpload') {
group 'deploy'
description 'Deploys primary artifact of the library up to the Bintray repository.'
}
/**
* Task that deploys (uploads) all library modules (except groups) up to the Bintray repository.
*/
task deployModulesToBintray() {
group 'deploy'
description 'Deploys artifacts for all library modules (except groups) up to the Bintray repository.'
subprojects.findAll { if (it.name.startsWith("library-") && !it.name.endsWith('_group')) dependsOn ":${it.name}:bintrayUpload" }
}
/**
* Task that deploys (uploads) all library module groups up to the Bintray repository.
*/
task deployGroupsToBintray() {
group 'deploy'
description 'Deploys artifacts for all library module groups up to the Bintray repository.'
subprojects.findAll { if (it.name.startsWith("library-") && it.name.endsWith('_group')) dependsOn ":${it.name}:bintrayUpload" }
}
/**
* Task that updates library artifacts directory.
*/
task updateArtifacts() {
subprojects.findAll { if (it.name.startsWith("library")) dependsOn ":${it.name}:updateArtifacts" }
doLast {
if (file(repos.project.artifacts).exists()) {
exec {
commandLine 'git', 'add', repos.project.artifacts, '-A'
}
}
}
}