forked from square/phrase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (72 loc) · 1.96 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
import com.android.builder.core.BuilderConstants;
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
}
}
dependencies {
repositories {
mavenCentral()
}
}
group = GROUP
version = VERSION_NAME
apply plugin: 'com.android.library'
apply plugin: 'maven'
android {
compileSdkVersion 28
buildToolsVersion '28.0.2'
defaultConfig {
minSdkVersion 19
versionName VERSION_NAME
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
implementation 'com.android.support:support-annotations:27.1.1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.19.0'
testImplementation 'org.easytesting:fest-assert-core:2.0M10'
testImplementation 'org.robolectric:robolectric:4.0-alpha-3'
}
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (!BuilderConstants.DEBUG.equals(name)) {
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
artifacts.add('archives', task);
}
}
apply plugin: 'checkstyle'
checkstyle {
configFile file('checkstyle.xml')
ignoreFailures true
showViolations false
configProperties = [
'checkstyle.suppressions.file': file('checkstyle-suppressions.xml'),
]
}
// Applying the checkstyle plugin adds multiple tasks but not
// one for checkstylin' against android sources. This task
// belows does the trick.
task checkstyle(type: Checkstyle) {
configFile file('checkstyle.xml')
source 'src/main/java'
ignoreFailures false
showViolations true
include '**/*.java'
exclude '**/gen/**'
classpath = files()
}
apply from: 'gradle-mvn-push.gradle'
repositories {
google()
}