-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathbuild.gradle
144 lines (121 loc) · 3.98 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
133
134
135
136
137
138
139
140
141
142
143
144
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
apply plugin: 'org.jetbrains.dokka'
android {
def version = 33
compileSdk 29
defaultConfig {
minSdkVersion 23
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 29
versionCode version
versionName "0.6.08"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
resValue "integer", "versionCodeIntegrationLibrary", "$version"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.annotation:annotation:1.4.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
api 'com.github.evotor:push-notifications:v0.2.1'
api 'com.github.evotor:query-api:1.0.0'
implementation 'com.google.code.gson:gson:2.8.9'
testImplementation 'junit:junit:4.13.2'
}
repositories {
mavenCentral()
google()
}
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.6.21"
}
}
// in the individual module build.gradle files
allprojects {
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dokkaJavadoc.configure {
moduleName = 'integration-library'
outputDirectory.set(file("$buildDir/javadoc"))
dokkaSourceSets {
named("main") {
noAndroidSdkLink.set(false)
}
}
}
dokkaHtml.configure {
outputDirectory.set(file("$buildDir/dokkaHtml"))
dokkaSourceSets {
named("main") {
noAndroidSdkLink.set(false)
}
}
}
task sourceJar(type: Jar) {
classifier "sources"
from android.sourceSets.main.java.srcDirs
}
// build a jar with javadoc
task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
archiveClassifier = 'javadoc'
from dokkaJavadoc.outputDirectory
}
publishing {
publications {
mavenKotlin(MavenPublication) {
groupId 'com.github.evotor'
artifactId "integration-library"
version "STDEV-13213"
artifact(sourceJar)
artifact(javadocJar)
artifact "${project.buildDir}/outputs/aar/${project.archivesBaseName}-release.aar"
//generate pom nodes for dependencies
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
configurations.api.allDependencies.each { dependency ->
if (dependency.group) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
configurations.implementation.allDependencies.each { dependency ->
if (dependency.group) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', dependency.group)
dependencyNode.appendNode('artifactId', dependency.name)
dependencyNode.appendNode('version', dependency.version)
}
}
}
}
}
}