forked from Tapadoo/Alerter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
115 lines (92 loc) · 3.1 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
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: "maven-publish"
apply plugin: 'kotlin-android-extensions'
apply plugin: 'org.jetbrains.dokka'
//Quality Standards
apply from: rootProject.file('quality.gradle')
final String GROUP_ID = "com.tapadoo.android"
final String VERSION = "7.2.4"
final String DESCRIPTION = "An Android Alerting Library"
final String GITHUB_URL = "https://github.com/Tapadoo/Alerter"
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName VERSION
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
lintOptions {
abortOnError true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
// Create the POM configuration - required for jCenter uploading
def pomConfig = {
licenses {
license {
name "MIT License"
url "https://opensource.org/licenses/MIT"
distribution "repo"
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from "$buildDir/javadoc"
}
// Create the publication with the pom configuration:
afterEvaluate {
publishing {
publications {
Alerter(MavenPublication) {
groupId GROUP_ID
version VERSION
artifactId project.getName()
//from components.android
artifact sourcesJar
artifact javadocJar
// Tell maven to prepare the generated "*.aar" file for publishing
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
pom.withXml {
def root = asNode()
root.appendNode('description', DESCRIPTION)
root.appendNode('name', project.getName())
root.appendNode('url', GITHUB_URL)
root.children().last() + pomConfig
}
}
}
}
}
configurations {
javadocDeps
}
dependencies {
implementation "androidx.annotation:annotation:1.2.0"
implementation "androidx.appcompat:appcompat:1.2.0"
// Local Unit Tests - in src/test
testImplementation 'junit:junit:4.12'
// Instrumentation Tests - in src/androidTest
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}
dokka {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/javadoc"
}