-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmodulesCommon.gradle
121 lines (106 loc) · 3.68 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
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'org.jlleitschuh.gradle.ktlint'
group = 'com.github.mindbox-cloud'
android {
compileSdkVersion libs.versions.compile.sdk.get().toInteger()
buildToolsVersion libs.versions.build.tools.get()
defaultConfig {
minSdkVersion libs.versions.min.sdk.get().toInteger()
targetSdkVersion libs.versions.target.sdk.get().toInteger()
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'
}
publishing {
singleVariant("release") {
withSourcesJar()
}
}
kotlin {
explicitApi()
}
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'cloud.mindbox'
artifactId = ARTIFACT_ID
version = SDK_VERSION_NAME
pom {
name = ARTIFACT_NAME
description = 'Android Mindbox SDK'
url = 'https://github.com/mindbox-cloud/android-sdk'
licenses {
license {
name = 'The Mindbox License'
url = 'https://github.com/mindbox-cloud/android-sdk/blob/master/LICENSE.md'
}
}
developers {
developer {
id = 'Mindbox'
name = 'Mindbox'
email = '[email protected]'
}
}
scm {
connection = 'scm:https://github.com/mindbox-cloud/android-sdk.git'
developerConnection = 'scm:git://github.com/mindbox-cloud/android-sdk.git'
url = 'https://github.com/mindbox-cloud/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")
}
}
}