/
modulesCommon.gradle
124 lines (109 loc) · 3.72 KB
/
modulesCommon.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
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'signing'
apply plugin: 'maven-publish'
group = 'com.github.mindbox-moscow'
android {
compileSdkVersion 33
buildToolsVersion "33.0.2"
defaultConfig {
minSdkVersion 19
targetSdkVersion 33
versionCode 1
multiDexEnabled true
versionName '"' + SDK_VERSION_NAME + '"'
buildConfigField 'String', 'VERSION_NAME', '"' + SDK_VERSION_NAME + '"'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
debuggable true
buildConfigField "Boolean", "DEBUG_MODE", "true"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
dokka {
outputFormat = 'javadoc'
outputDirectory = "$buildDir/dokka"
}
task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
}
}
afterEvaluate {
apply plugin: 'maven-publish'
publishing {
publications {
release(MavenPublication) {
from components.release
artifact androidSourcesJar
groupId = 'cloud.mindbox'
artifactId = ARTIFACT_ID
version = SDK_VERSION_NAME
pom {
name = ARTIFACT_NAME
description = 'Test release'
url = 'https://github.com/mindbox-moscow/android-sdk'
licenses {
license {
name = 'The Mindbox License'
url = 'https://github.com/mindbox-moscow/android-sdk/blob/master/LICENSE.md'
}
}
developers {
developer {
id = 'mindbox'
name = 'Petr Nikitin'
email = 'nikitin@mindbox.ru'
}
}
scm {
connection = 'scm:https://github.com/mindbox-moscow/android-sdk.git'
developerConnection = 'scm:git://github.com/mindbox-moscow/android-sdk.git'
url = 'https://github.com/mindbox-moscow/android-sdk'
}
}
}
}
repositories {
if (!project.hasProperty("sonatypeUsername")) {
ext.sonatypeUsername = "sonatypeUsername"
}
if (!project.hasProperty("sonatypePassword")) {
ext.sonatypePassword = "sonatypePassword"
}
maven {
name = "OSSRH"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
signing {
def signingKeyId = findProperty("signing.keyId")
def signingKey = findProperty("signing.secretKeyRingFile")
def signingPassword = findProperty("signing.password")
if (signingKeyId && signingKey && signingPassword) {
println("Signing applied")
sign publishing.publications.release
} else {
println("Signing not applied")
}
}
}