-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
64 lines (52 loc) · 1.67 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
buildscript {
ext.kotlin_version = '1.3.40'
ext.arbor_version = '1.33.97'
ext.support_lib_version = '28.0.0'
ext.dokka_version = '0.9.16'
repositories {
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
repositories {
google()
}
static String getSnapshotUrl() {
return System.getenv('SNAPSHOT_URL')
}
static String getReleaseUrl() {
return System.getenv('RELEASE_URL')
}
static String getRepoUsername() {
return System.getenv('REPO_USERNAME')
}
static String getRepoPassword() {
return System.getenv('REPO_PASSWORD')
}
static boolean isCi() {
String jenkinsHome = System.getenv('JENKINS_HOME')
boolean isJenkins = jenkinsHome != null && !jenkinsHome.isEmpty()
boolean isCircle = System.getenv('CIRCLECI') ? true : false
return (isJenkins || isCircle)
}
allprojects {
String jenkinsHome = System.getenv('JENKINS_HOME')
boolean isJenkins = jenkinsHome != null && !jenkinsHome.isEmpty()
String tagName = isJenkins ? null : System.getenv('CIRCLE_TAG')
boolean isTag = tagName != null && !tagName.isEmpty()
String buildNumber = isJenkins ? System.getenv('BUILD_NUMBER') : System.getenv('CIRCLE_BUILD_NUM') ?: "0"
group 'com.jwoolston.libusb'
version "$VERSION_NAME.${buildNumber}" + (isTag ? "" : "-SNAPSHOT")
repositories {
mavenCentral()
jcenter()
google()
}
}