-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
executable file
·65 lines (62 loc) · 2.08 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
buildscript {
repositories {
google()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.12"
}
}
allprojects {
repositories {
google()
jcenter()
mavenLocal()
maven {
url 'https://artifactory.bidmachine.io/bidmachine'
}
maven {
url 'https://artifactory.bidmachine.io/bidmachine-private/'
credentials {
username = System.getenv("APD_USERNAME")
password = System.getenv("APD_USERPASSWORD")
}
}
}
}
ArrayList<Project> collectAdapters() {
def includingAdNetworks = gradle.ext.has("includingAdNetworks")
? gradle.ext.get("includingAdNetworks") : null
def excludingAdNetworks = gradle.ext.has("excludingAdNetworks")
? gradle.ext.get("excludingAdNetworks") : null
ArrayList<Project> resultProjects = new ArrayList<>()
project(":adapters").childProjects.values().forEach { project ->
if (includingAdNetworks == null
|| includingAdNetworks.contains(project.name)) {
if (excludingAdNetworks == null
|| !excludingAdNetworks.contains(project.name)) {
resultProjects.add(project)
}
}
}
return resultProjects
}
task uploadEverythingToArtifactory() {
doLast {
if (!project.hasProperty("repo")) {
throw new GradleException("repo not provided")
}
if (!project.hasProperty("uname")) {
throw new GradleException("uname not provided")
}
if (!project.hasProperty("upassword")) {
throw new GradleException("upassword not provided")
}
}
collectAdapters().forEach { Project project ->
finalizedBy ":adapters:${project.name}:publishAdapterToArtifactory"
}
finalizedBy ':bidmachine:uploadAarToArtifactory'
}